[polari/wip/fmuellner/design-review: 15/16] connections: Remove action buttons from properties dialog



commit 68131071da79740e3f590d36a4a70b8b36fe1872
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Feb 22 20:07:51 2016 +0100

    connections: Remove action buttons from properties dialog
    
    Having the dialog use explicit apply is a bit overkill, in particular
    with predefined networks, which we expect users to use in most cases.
    Just use a normal close button and apply the changes when the dialog
    is closed.

 data/resources/connection-properties.ui |   23 -----------------------
 src/connections.js                      |    4 +---
 2 files changed, 1 insertions(+), 26 deletions(-)
---
diff --git a/data/resources/connection-properties.ui b/data/resources/connection-properties.ui
index 91e9166..1581bfa 100644
--- a/data/resources/connection-properties.ui
+++ b/data/resources/connection-properties.ui
@@ -4,25 +4,6 @@
     <property name="modal">True</property>
     <property name="destroy-with-parent">True</property>
     <property name="default-width">450</property>
-    <child type="action">
-      <object class="GtkButton" id="cancelButton">
-        <property name="label" translatable="yes">_Cancel</property>
-        <property name="visible">True</property>
-        <property name="receives-default">True</property>
-        <property name="use-underline">True</property>
-      </object>
-    </child>
-    <child type="action">
-      <object class="GtkButton" id="applyButton">
-        <property name="label" translatable="yes">_Apply</property>
-        <property name="visible">True</property>
-        <property name="can-default">True</property>
-        <property name="receives-default">True</property>
-        <property name="use-underline">True</property>
-        <property name="sensitive" bind-source="details"
-                  bind-property="can-confirm" bind-flags="sync-create"/>
-      </object>
-    </child>
     <child internal-child="vbox">
       <object class="GtkBox">
         <property name="can-focus">False</property>
@@ -64,9 +45,5 @@
         </child>
       </object>
     </child>
-    <action-widgets>
-      <action-widget response="cancel">cancelButton</action-widget>
-      <action-widget response="ok">applyButton</action-widget>
-    </action-widgets>
   </template>
 </interface>
diff --git a/src/connections.js b/src/connections.js
index db8d675..5313429 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -439,10 +439,8 @@ const ConnectionProperties = new Lang.Class({
 
         this.connect('response', Lang.bind(this,
             function(w, response) {
-                if (response == Gtk.ResponseType.OK)
-                    this._details.save();
+                this._details.save();
             }));
-        this.set_default_response(Gtk.ResponseType.OK);
 
         account.connect('notify::connection-status',
                         Lang.bind(this, this._syncErrorMessage));


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