[Xfce4-commits] <xfce4-session:jeromeg/libxfce4ui> Fix the response handling of the settings dialog.
Jérôme Guelfucci
noreply at xfce.org
Sun Jan 24 18:18:01 CET 2010
Updating branch refs/heads/jeromeg/libxfce4ui
to 0705fad62108919cfefc43d37d667726aafde5d9 (commit)
from 2b6060de90be9fe07e69218a12ef4f8999db27f9 (commit)
commit 0705fad62108919cfefc43d37d667726aafde5d9
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date: Sun Jan 24 18:18:34 2010 +0100
Fix the response handling of the settings dialog.
The close button and the help button did not work anymore. Add a handler
for the "response" and "delete-event" signals.
settings/main.c | 18 +++++++++++++++---
settings/xfce4-session-settings.glade | 4 ++++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/settings/main.c b/settings/main.c
index e5ebecc..8588dd4 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -44,6 +44,17 @@ static GOptionEntry option_entries[] =
{ NULL }
};
+static void xfce4_session_settings_dialog_response (GtkDialog *dialog, gint response, gpointer userdata)
+{
+ if (response == GTK_RESPONSE_HELP) {
+ g_signal_stop_emission_by_name(dialog, "response");
+ g_spawn_command_line_async("xfhelp4 xfce4-session.html", NULL);
+ }
+ else {
+ gtk_widget_destroy(GTK_WIDGET(dialog));
+ gtk_main_quit ();
+ }
+}
int
main(int argc,
@@ -122,10 +133,11 @@ main(int argc,
if(G_UNLIKELY(opt_socket_id == 0)) {
GtkWidget *dialog = GTK_WIDGET(gtk_builder_get_object(builder, "xfce4_session_settings_dialog"));
- while(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_HELP)
- g_spawn_command_line_async("xfhelp4 xfce4-session.html", NULL);
+ g_signal_connect(dialog, "response", G_CALLBACK(xfce4_session_settings_dialog_response), NULL);
+ g_signal_connect(dialog, "delete-event", G_CALLBACK(gtk_main_quit), NULL);
- gtk_widget_destroy(dialog);
+ gtk_widget_show(dialog);
+ gtk_main ();
} else {
GtkWidget *plug, *plug_child;
diff --git a/settings/xfce4-session-settings.glade b/settings/xfce4-session-settings.glade
index d84e17e..f09cf9e 100644
--- a/settings/xfce4-session-settings.glade
+++ b/settings/xfce4-session-settings.glade
@@ -716,6 +716,10 @@
</child>
</object>
</child>
+ <action-widgets>
+ <action-widget response="-11">button1</action-widget>
+ <action-widget response="-7">button2</action-widget>
+ </action-widgets>
</object>
<object class="GtkDialog" id="dialog_saving">
<property name="border_width">5</property>
More information about the Xfce4-commits
mailing list