[gnome-software/wip/temp/ubuntu-xenial-rebased: 86/329] Simplify cancel button in U1 dialog



commit e3a086d4b61dc4902bfde094b24b0d6df44055ed
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Feb 11 11:41:47 2016 +1300

    Simplify cancel button in U1 dialog

 src/plugins/gs-ubuntu-login-dialog.c  |    8 --------
 src/plugins/gs-ubuntu-login-dialog.ui |    3 +++
 2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/gs-ubuntu-login-dialog.c b/src/plugins/gs-ubuntu-login-dialog.c
index e4ceb38..3506907 100644
--- a/src/plugins/gs-ubuntu-login-dialog.c
+++ b/src/plugins/gs-ubuntu-login-dialog.c
@@ -275,13 +275,6 @@ update_widgets (GsUbuntuLoginDialog *self)
        }
 }
 
-static void
-cancel_button_clicked_cb (GsUbuntuLoginDialog *self,
-                         GtkButton      *button)
-{
-       gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_CANCEL);
-}
-
 typedef void (*ResponseCallback) (GsUbuntuLoginDialog *self,
                                  guint       status,
                                  GVariant        *response,
@@ -545,7 +538,6 @@ gs_ubuntu_login_dialog_init (GsUbuntuLoginDialog *self)
 {
        gtk_widget_init_template (GTK_WIDGET (self));
 
-       g_signal_connect_swapped (self->cancel_button, "clicked", G_CALLBACK (cancel_button_clicked_cb), 
self);
        g_signal_connect_swapped (self->next_button, "clicked", G_CALLBACK (next_button_clicked_cb), self);
        g_signal_connect_swapped (self->login_radio, "toggled", G_CALLBACK (radio_button_toggled_cb), self);
        g_signal_connect_swapped (self->register_radio, "toggled", G_CALLBACK (radio_button_toggled_cb), 
self);
diff --git a/src/plugins/gs-ubuntu-login-dialog.ui b/src/plugins/gs-ubuntu-login-dialog.ui
index ba80e3a..5409c90 100644
--- a/src/plugins/gs-ubuntu-login-dialog.ui
+++ b/src/plugins/gs-ubuntu-login-dialog.ui
@@ -3,6 +3,9 @@
 <interface>
   <requires lib="gtk+" version="3.16"/>
   <template class="GsUbuntuLoginDialog" parent="GtkDialog">
+    <action-widgets>
+      <action-widget response="cancel">cancel_button</action-widget>
+    </action-widgets>
     <child internal-child="headerbar">
       <object class="GtkHeaderBar">
         <property name="show_close_button">False</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]