/dev/qulogic/ckeditor: 1cf4db8b95d7: Enable the WebKit inspector...

Elliott Sales de Andrade qulogic at pidgin.im
Fri Aug 9 03:13:28 EDT 2013


Changeset: 1cf4db8b95d7583558887dfd172d0727f79d8ec7
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2013-08-05 20:37 -0400
Branch:	 default
URL: https://hg.pidgin.im/dev/qulogic/ckeditor/rev/1cf4db8b95d7

Description:

Enable the WebKit inspector on the entry widget.

diffstat:

 pidgin/plugins/webkit.c |  24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diffs (71 lines):

diff --git a/pidgin/plugins/webkit.c b/pidgin/plugins/webkit.c
--- a/pidgin/plugins/webkit.c
+++ b/pidgin/plugins/webkit.c
@@ -37,8 +37,12 @@ create_gtk_window_around_it(WebKitWebIns
 	char *title;
 
 	win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-	title = g_strdup_printf(_("%s - Inspector"),
-	                        gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
+	if (GTK_WIDGET(webview) == gtkconv->webview)
+		title = g_strdup_printf(_("%s - History Inspector"),
+		                        gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
+	else
+		title = g_strdup_printf(_("%s - Editor Inspector"),
+		                        gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
 	gtk_window_set_title(GTK_WINDOW(win), title);
 	g_free(title);
 	gtk_window_set_default_size(GTK_WINDOW(win), 600, 400);
@@ -65,9 +69,8 @@ show_inspector_window(WebKitWebInspector
 }
 
 static void
-setup_inspector(PidginConversation *gtkconv)
+setup_inspector(PidginConversation *gtkconv, GtkWidget *webview)
 {
-	GtkWidget *webview = gtkconv->webview;
 	WebKitWebSettings *settings;
 	WebKitWebInspector *inspector;
 
@@ -83,9 +86,8 @@ setup_inspector(PidginConversation *gtkc
 }
 
 static void
-remove_inspector(PidginConversation *gtkconv)
+remove_inspector(GtkWidget *webview)
 {
-	GtkWidget *webview = gtkconv->webview;
 	GtkWidget *win;
 	WebKitWebSettings *settings;
 
@@ -106,7 +108,8 @@ conversation_displayed_cb(PidginConversa
 	inspect = g_object_get_data(G_OBJECT(gtkconv->webview),
 	                            "inspector-window");
 	if (inspect == NULL) {
-		setup_inspector(gtkconv);
+		setup_inspector(gtkconv, gtkconv->webview);
+		setup_inspector(gtkconv, gtkconv->entry);
 	}
 }
 
@@ -124,7 +127,9 @@ plugin_load(PurplePlugin *plugin)
 
 		/* Setup WebKit Inspector */
 		if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) {
-			setup_inspector(PIDGIN_CONVERSATION(conv));
+			PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+			setup_inspector(gtkconv, gtkconv->webview);
+			setup_inspector(gtkconv, gtkconv->entry);
 		}
 
 		convs = convs->next;
@@ -143,7 +148,8 @@ plugin_unload(PurplePlugin *plugin)
 
 		/* Remove WebKit Inspector */
 		if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) {
-			remove_inspector(PIDGIN_CONVERSATION(conv));
+			remove_inspector(PIDGIN_CONVERSATION(conv)->webview);
+			remove_inspector(PIDGIN_CONVERSATION(conv)->entry);
 		}
 
 		convs = convs->next;



More information about the Commits mailing list