[seahorse-plugins] Close preferences window properly
- From: Adam Schreiber <sadam src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [seahorse-plugins] Close preferences window properly
- Date: Thu, 26 Nov 2009 22:43:47 +0000 (UTC)
commit f2fd3fa3e4f9f0c834f38e098f0ccde2fed36ee9
Author: Adam Schreiber <sadam gnome org>
Date: Thu Nov 26 17:39:15 2009 -0500
Close preferences window properly
Created and connected signal handlers for the close button and the
window's delete event. Deleted signal names from the gtkbuilder
file.
plugins/applet/seahorse-applet-preferences.xml | 9 +++------
plugins/applet/seahorse-applet.c | 22 ++++++++++++++++++++--
2 files changed, 23 insertions(+), 8 deletions(-)
---
diff --git a/plugins/applet/seahorse-applet-preferences.xml b/plugins/applet/seahorse-applet-preferences.xml
index e445075..b05d51d 100644
--- a/plugins/applet/seahorse-applet-preferences.xml
+++ b/plugins/applet/seahorse-applet-preferences.xml
@@ -9,7 +9,6 @@
<property name="resizable">False</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
- <signal name="delete_event" handler="on_widget_delete_event"/>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
@@ -128,14 +127,12 @@
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="ok">
+ <object class="GtkButton" id="close">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
+ <property name="receives_default">True</property>
<property name="use_stock">True</property>
- <signal name="clicked" handler="on_widget_closed"/>
</object>
<packing>
<property name="expand">False</property>
@@ -153,7 +150,7 @@
</object>
</child>
<action-widgets>
- <action-widget response="-7">ok</action-widget>
+ <action-widget response="0">close</action-widget>
</action-widgets>
</object>
</interface>
diff --git a/plugins/applet/seahorse-applet.c b/plugins/applet/seahorse-applet.c
index e2bf616..bde93b8 100644
--- a/plugins/applet/seahorse-applet.c
+++ b/plugins/applet/seahorse-applet.c
@@ -666,6 +666,18 @@ dvi_cb (GtkMenuItem *menuitem, SeahorseApplet *sapplet)
(GtkClipboardTextReceivedFunc)dvi_received, sapplet);
}
+static void
+close_props (GtkButton *button, SeahorseWidget *swidget)
+{
+ seahorse_widget_destroy (swidget);
+}
+
+static void
+win_destroyed (GtkWidget *widget, GdkEvent *event, SeahorseWidget *swidget)
+{
+ seahorse_widget_destroy (swidget);
+}
+
void
properties_cb (BonoboUIComponent *uic, SeahorseApplet *sapplet, const char *verbname)
{
@@ -704,8 +716,14 @@ properties_cb (BonoboUIComponent *uic, SeahorseApplet *sapplet, const char *verb
widget = GTK_WIDGET (seahorse_widget_get_widget (swidget, "display-verified-clipboard"));
if (widget && GTK_IS_CHECK_BUTTON (widget))
- seahorse_check_button_gconf_attach (GTK_CHECK_BUTTON (widget), DISPLAY_CLIPBOARD_VER_KEY);
-
+ seahorse_check_button_gconf_attach (GTK_CHECK_BUTTON (widget), DISPLAY_CLIPBOARD_VER_KEY);
+
+ widget = GTK_WIDGET (seahorse_widget_get_widget (swidget, "close"));
+ g_signal_connect (widget, "clicked", G_CALLBACK (close_props), swidget);
+
+ widget = seahorse_widget_get_toplevel (swidget);
+ g_signal_connect (widget, "delete-event", G_CALLBACK (win_destroyed), swidget);
+
seahorse_widget_show (swidget);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]