diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-09-23 21:31:58 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2011-09-26 18:33:37 +0800 |
commit | 381062d1a807da25f188340cdc81188c43bf0f58 (patch) | |
tree | 39e6d7d632e59d8ae255ea672702e9db00c20813 /libempathy-gtk | |
parent | 3a459b35bd5b7a29b308d729fe82b203f777b99f (diff) | |
download | gsoc2013-empathy-381062d1a807da25f188340cdc81188c43bf0f58.tar gsoc2013-empathy-381062d1a807da25f188340cdc81188c43bf0f58.tar.gz gsoc2013-empathy-381062d1a807da25f188340cdc81188c43bf0f58.tar.bz2 gsoc2013-empathy-381062d1a807da25f188340cdc81188c43bf0f58.tar.lz gsoc2013-empathy-381062d1a807da25f188340cdc81188c43bf0f58.tar.xz gsoc2013-empathy-381062d1a807da25f188340cdc81188c43bf0f58.tar.zst gsoc2013-empathy-381062d1a807da25f188340cdc81188c43bf0f58.zip |
Add /inspector command to show webkit inspector
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 13 | ||||
-rw-r--r-- | libempathy-gtk/empathy-theme-adium.c | 14 | ||||
-rw-r--r-- | libempathy-gtk/empathy-theme-adium.h | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 570d73b69..c9f6dd9d5 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -56,6 +56,7 @@ #include "empathy-input-text-view.h" #include "empathy-search-bar.h" #include "empathy-theme-manager.h" +#include "empathy-theme-adium.h" #include "empathy-smiley-manager.h" #include "empathy-ui-utils.h" #include "empathy-string-parser.h" @@ -1042,6 +1043,16 @@ chat_command_babywhale (EmpathyChat *chat, g_object_unref (message); } +static void +chat_command_inspector (EmpathyChat *chat, + GStrv strv) +{ + if (EMPATHY_IS_THEME_ADIUM (chat->view)) { + empathy_theme_adium_show_inspector ( + EMPATHY_THEME_ADIUM (chat->view)); + } +} + static void chat_command_help (EmpathyChat *chat, GStrv strv); typedef void (*ChatCommandFunc) (EmpathyChat *chat, GStrv strv); @@ -1097,6 +1108,8 @@ static ChatCommandItem commands[] = { N_("/help [<command>]: show all supported commands. " "If <command> is defined, show its usage.")}, + {"inspector", 1, 1, chat_command_inspector, NULL, NULL}, + {"whale", 1, 1, chat_command_whale, NULL, NULL}, {"babywhale", 1, 1, chat_command_babywhale, NULL, NULL}, }; diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index f81329b79..8877a2796 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -1654,6 +1654,20 @@ empathy_theme_adium_set_variant (EmpathyThemeAdium *theme, g_object_notify (G_OBJECT (theme), "variant"); } +void +empathy_theme_adium_show_inspector (EmpathyThemeAdium *theme) +{ + WebKitWebView *web_view = WEBKIT_WEB_VIEW (theme); + WebKitWebInspector *inspector; + + g_object_set (G_OBJECT (webkit_web_view_get_settings (web_view)), + "enable-developer-extras", TRUE, + NULL); + + inspector = webkit_web_view_get_inspector (web_view); + webkit_web_inspector_show (inspector); +} + gboolean empathy_adium_path_is_valid (const gchar *path) { diff --git a/libempathy-gtk/empathy-theme-adium.h b/libempathy-gtk/empathy-theme-adium.h index 1c01b7b37..6f7573b04 100644 --- a/libempathy-gtk/empathy-theme-adium.h +++ b/libempathy-gtk/empathy-theme-adium.h @@ -53,6 +53,7 @@ EmpathyThemeAdium *empathy_theme_adium_new (EmpathyAdiumData *data, const gchar *variant); void empathy_theme_adium_set_variant (EmpathyThemeAdium *theme, const gchar *variant); +void empathy_theme_adium_show_inspector (EmpathyThemeAdium *theme); gboolean empathy_adium_path_is_valid (const gchar *path); |