aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-theme-adium.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-09-19 19:42:06 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-12-26 16:48:52 +0800
commit968b7430566d7fd877bbc5bcbcb894261fbdab70 (patch)
treed0980de58addb86ac2cb78411e223f534eec7121 /libempathy-gtk/empathy-theme-adium.c
parent9db3e4d18cc032bf1246caf80115af291d672bf5 (diff)
downloadgsoc2013-empathy-968b7430566d7fd877bbc5bcbcb894261fbdab70.tar
gsoc2013-empathy-968b7430566d7fd877bbc5bcbcb894261fbdab70.tar.gz
gsoc2013-empathy-968b7430566d7fd877bbc5bcbcb894261fbdab70.tar.bz2
gsoc2013-empathy-968b7430566d7fd877bbc5bcbcb894261fbdab70.tar.lz
gsoc2013-empathy-968b7430566d7fd877bbc5bcbcb894261fbdab70.tar.xz
gsoc2013-empathy-968b7430566d7fd877bbc5bcbcb894261fbdab70.tar.zst
gsoc2013-empathy-968b7430566d7fd877bbc5bcbcb894261fbdab70.zip
theme-adium: use EMPATHY_WEBKIT_MENU_INSPECT
We are now always using our own context menu even when the inspect menu item is displayed. https://bugzilla.gnome.org/show_bug.cgi?id=684357
Diffstat (limited to 'libempathy-gtk/empathy-theme-adium.c')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c62
1 files changed, 11 insertions, 51 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index ee2b314fc..92bae197f 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -164,30 +164,6 @@ free_queued_item (QueuedItem *item)
g_slice_free (QueuedItem, item);
}
-static void
-theme_adium_update_enable_webkit_developer_tools (EmpathyThemeAdium *self)
-{
- WebKitWebView *web_view = WEBKIT_WEB_VIEW (self);
- gboolean enable_webkit_developer_tools;
-
- enable_webkit_developer_tools = g_settings_get_boolean (
- self->priv->gsettings_chat,
- EMPATHY_PREFS_CHAT_WEBKIT_DEVELOPER_TOOLS);
-
- g_object_set (G_OBJECT (webkit_web_view_get_settings (web_view)),
- "enable-developer-extras", enable_webkit_developer_tools, NULL);
-}
-
-static void
-theme_adium_notify_enable_webkit_developer_tools_cb (GSettings *gsettings,
- const gchar *key,
- gpointer user_data)
-{
- EmpathyThemeAdium *self = user_data;
-
- theme_adium_update_enable_webkit_developer_tools (self);
-}
-
static gboolean
theme_adium_navigation_policy_decision_requested_cb (WebKitWebView *view,
WebKitWebFrame *web_frame,
@@ -1359,31 +1335,22 @@ theme_adium_context_menu_cb (EmpathyThemeAdium *self,
gboolean triggered_with_keyboard,
gpointer user_data)
{
- gboolean developer_tools_enabled;
+ GtkWidget *menu;
+ EmpathyWebKitMenuFlags flags = EMPATHY_WEBKIT_MENU_CLEAR;
- g_object_get (
- G_OBJECT (webkit_web_view_get_settings (WEBKIT_WEB_VIEW (self))),
- "enable-developer-extras", &developer_tools_enabled, NULL);
+ if (g_settings_get_boolean (self->priv->gsettings_chat,
+ EMPATHY_PREFS_CHAT_WEBKIT_DEVELOPER_TOOLS))
+ flags |= EMPATHY_WEBKIT_MENU_INSPECT;
- /* We currently have no way to add an inspector menu
- * item ourselves, so we disable our customized menu
- * if the developer extras are enabled. */
- if (!developer_tools_enabled)
- {
- GtkWidget *menu;
+ menu = empathy_webkit_create_context_menu (
+ WEBKIT_WEB_VIEW (self), hit_test_result, flags);
- menu = empathy_webkit_create_context_menu (
- WEBKIT_WEB_VIEW (self), hit_test_result,
- EMPATHY_WEBKIT_MENU_CLEAR);
+ gtk_widget_show_all (menu);
- gtk_widget_show_all (menu);
- gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3,
- gtk_get_current_event_time ());
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3,
+ gtk_get_current_event_time ());
- return TRUE;
- }
-
- return FALSE;
+ return TRUE;
}
void
@@ -1689,13 +1656,6 @@ empathy_theme_adium_init (EmpathyThemeAdium *self)
self->priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
self->priv->gsettings_desktop = g_settings_new (
EMPATHY_PREFS_DESKTOP_INTERFACE_SCHEMA);
-
- g_signal_connect (self->priv->gsettings_chat,
- "changed::" EMPATHY_PREFS_CHAT_WEBKIT_DEVELOPER_TOOLS,
- G_CALLBACK (theme_adium_notify_enable_webkit_developer_tools_cb),
- self);
-
- theme_adium_update_enable_webkit_developer_tools (self);
}
EmpathyThemeAdium *