[Goodies-commits] r4619 - in xfce4-dict/trunk: lib panel-plugin

Enrico Troeger enrico at xfce.org
Fri Apr 18 18:06:57 CEST 2008


Author: enrico
Date: 2008-04-18 16:06:57 +0000 (Fri, 18 Apr 2008)
New Revision: 4619

Modified:
   xfce4-dict/trunk/lib/prefs.c
   xfce4-dict/trunk/lib/prefs.h
   xfce4-dict/trunk/panel-plugin/xfce4-dict-plugin.c
Log:
Fix problems with preferences dialog callback if panel plugin is loaded.


Modified: xfce4-dict/trunk/lib/prefs.c
===================================================================
--- xfce4-dict/trunk/lib/prefs.c	2008-04-18 16:06:53 UTC (rev 4618)
+++ xfce4-dict/trunk/lib/prefs.c	2008-04-18 16:06:57 UTC (rev 4619)
@@ -99,7 +99,7 @@
 }
 
 
-static void prefs_dialog_response(GtkWidget *dlg, gint response, DictData *dd)
+void dict_prefs_dialog_response(GtkWidget *dlg, gint response, DictData *dd)
 {
 	gchar *tmp;
 
@@ -172,7 +172,8 @@
 
     gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
     gtk_window_set_icon_name(GTK_WINDOW(dialog), "xfce4-settings");
-	g_signal_connect_after(dialog, "response", G_CALLBACK(prefs_dialog_response), dd);
+	if (! dd->is_plugin) /* the response callback is run by the plugin's callback */
+		g_signal_connect(dialog, "response", G_CALLBACK(dict_prefs_dialog_response), dd);
 
 	notebook = gtk_notebook_new();
 	gtk_widget_show(notebook);

Modified: xfce4-dict/trunk/lib/prefs.h
===================================================================
--- xfce4-dict/trunk/lib/prefs.h	2008-04-18 16:06:53 UTC (rev 4618)
+++ xfce4-dict/trunk/lib/prefs.h	2008-04-18 16:06:57 UTC (rev 4619)
@@ -22,6 +22,7 @@
 #define PREFS_H 1
 
 GtkWidget *dict_prefs_dialog_show(GtkWidget *parent, DictData *dd);
+void dict_prefs_dialog_response(GtkWidget *dlg, gint response, DictData *dd);
 
 
 #endif

Modified: xfce4-dict/trunk/panel-plugin/xfce4-dict-plugin.c
===================================================================
--- xfce4-dict/trunk/panel-plugin/xfce4-dict-plugin.c	2008-04-18 16:06:53 UTC (rev 4618)
+++ xfce4-dict/trunk/panel-plugin/xfce4-dict-plugin.c	2008-04-18 16:06:57 UTC (rev 4619)
@@ -286,6 +286,9 @@
 
 static void dict_plugin_properties_dialog_response(GtkWidget *dlg, gint response, DictPanelData *dpd)
 {
+	/* first run the real response handler which reads the settings from the dialog */
+	dict_prefs_dialog_response(dlg, response, dpd->dd);
+
 	dict_plugin_panel_save_settings(dpd);
 
 	g_object_set_data(G_OBJECT(dpd->plugin), "dialog", NULL);




More information about the Goodies-commits mailing list