aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCrispin Flowerday <gnome@flowerday.cx>2005-01-25 06:48:05 +0800
committerCrispin Flowerday <crispin@src.gnome.org>2005-01-25 06:48:05 +0800
commit2fe563af75ec8d4fc0127a6385307775dd2df368 (patch)
tree58d57a99115e048d80b157fb7124c46dfb53c636 /src
parentcd81c004a5fd5299e795ffd1fec4413e8b2e3300 (diff)
downloadgsoc2013-epiphany-2fe563af75ec8d4fc0127a6385307775dd2df368.tar
gsoc2013-epiphany-2fe563af75ec8d4fc0127a6385307775dd2df368.tar.gz
gsoc2013-epiphany-2fe563af75ec8d4fc0127a6385307775dd2df368.tar.bz2
gsoc2013-epiphany-2fe563af75ec8d4fc0127a6385307775dd2df368.tar.lz
gsoc2013-epiphany-2fe563af75ec8d4fc0127a6385307775dd2df368.tar.xz
gsoc2013-epiphany-2fe563af75ec8d4fc0127a6385307775dd2df368.tar.zst
gsoc2013-epiphany-2fe563af75ec8d4fc0127a6385307775dd2df368.zip
Add a alert when the user clicks on a sidebar link, telling that the
2005-01-24 Crispin Flowerday <gnome@flowerday.cx> * embed/ephy-embed-shell.c: (impl_get_embed_single), (ephy_embed_shell_get_embed_single), (ephy_embed_shell_class_init): * embed/ephy-embed-shell.h: * src/ephy-shell.c: (ephy_shell_class_init), (ephy_shell_add_sidebar_cb), (impl_get_embed_single): Add a alert when the user clicks on a sidebar link, telling that the sidebar extension is required. Fixes bug #162685
Diffstat (limited to 'src')
-rw-r--r--src/ephy-shell.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index a05d0a759..08e493ab0 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -24,6 +24,7 @@
#include "ephy-shell.h"
#include "ephy-type-builtins.h"
#include "ephy-embed-shell.h"
+#include "ephy-embed-single.h"
#include "eel-gconf-extensions.h"
#include "ephy-prefs.h"
#include "ephy-file-helpers.h"
@@ -80,6 +81,8 @@ struct _EphyShellPrivate
GObject *prefs_dialog;
GObject *print_setup_dialog;
GList *del_on_exit;
+
+ gboolean embed_single_connected;
};
EphyShell *ephy_shell = NULL;
@@ -87,6 +90,7 @@ EphyShell *ephy_shell = NULL;
static void ephy_shell_class_init (EphyShellClass *klass);
static void ephy_shell_init (EphyShell *shell);
static void ephy_shell_finalize (GObject *object);
+static GObject *impl_get_embed_single (EphyEmbedShell *embed_shell);
static GObjectClass *parent_class = NULL;
@@ -135,14 +139,75 @@ static void
ephy_shell_class_init (EphyShellClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ EphyEmbedShellClass *embed_shell_class = EPHY_EMBED_SHELL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = ephy_shell_finalize;
+ embed_shell_class->get_embed_single = impl_get_embed_single;
+
g_type_class_add_private (object_class, sizeof(EphyShellPrivate));
}
+static gboolean
+ephy_shell_add_sidebar_cb (EphyEmbedSingle *embed_single,
+ const char *url,
+ const char *title,
+ EphyShell *shell)
+{
+ EphySession *session;
+ EphyWindow *window;
+ GtkWidget *dialog;
+
+ session = EPHY_SESSION (ephy_shell_get_session (shell));
+ g_return_val_if_fail (EPHY_IS_SESSION (session), FALSE);
+
+ window = ephy_session_get_active_window (session);
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (window),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ _("Sidebar extension required"));
+
+ gtk_window_set_title (GTK_WINDOW (dialog), _("Sidebar Extension Required"));
+ gtk_window_set_icon_name (GTK_WINDOW (dialog), "web-browser");
+
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ _("The link you clicked needs the sidebar extension to be "
+ "installed."));
+
+ g_signal_connect_swapped (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), dialog);
+
+ gtk_widget_show (dialog);
+
+ return TRUE;
+}
+
+static GObject*
+impl_get_embed_single (EphyEmbedShell *embed_shell)
+{
+ EphyShell *shell;
+ GObject *embed_single;
+
+ embed_single = EPHY_EMBED_SHELL_CLASS (parent_class)->get_embed_single (embed_shell);
+
+ shell = EPHY_SHELL (embed_shell);
+
+ if (embed_single != NULL && shell->priv->embed_single_connected == FALSE)
+ {
+ g_signal_connect_object (embed_single, "add-sidebar",
+ G_CALLBACK (ephy_shell_add_sidebar_cb),
+ embed_shell, G_CONNECT_AFTER);
+
+ shell->priv->embed_single_connected = TRUE;
+ }
+
+ return embed_single;
+}
+
static BonoboObject *
ephy_automation_factory_cb (BonoboGenericFactory *this_factory,
const char *iid,