[master 3/7] Connect dialog inputs to default actions.

dashea installerbot-noreply at redhat.com
Tue Jul 7 14:15:55 UTC 2015


From: David Shea <dshea at redhat.com>

For the dialogs with relatively simple layouts (a single view with a set
of inputs followed by OK/Cancel buttons), change the widget properties
so that hitting enter in any of the inputs is equivalent to hitting the
OK button.
---
 pyanaconda/ui/gui/spokes/advanced_user.glade          | 10 ++++++++--
 .../ui/gui/spokes/lib/custom_storage_helpers.glade    | 19 ++++++++++++++-----
 pyanaconda/ui/gui/spokes/lib/passphrase.glade         |  9 ++++++---
 pyanaconda/ui/gui/spokes/source.glade                 |  7 ++++++-
 4 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/advanced_user.glade b/pyanaconda/ui/gui/spokes/advanced_user.glade
index 0bf041f..8bec496 100644
--- a/pyanaconda/ui/gui/spokes/advanced_user.glade
+++ b/pyanaconda/ui/gui/spokes/advanced_user.glade
@@ -36,7 +36,7 @@
                 <property name="label" translatable="yes" context="GUI|Advanced User">_Cancel</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
@@ -50,7 +50,9 @@
                 <property name="label" translatable="yes" context="GUI|Advanced User">_Save Changes</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
@@ -115,6 +117,7 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="margin_left">8</property>
+                    <property name="activates_default">True</property>
                   </object>
                   <packing>
                     <property name="expand">True</property>
@@ -193,6 +196,7 @@
                     <property name="can_focus">True</property>
                     <property name="margin_left">8</property>
                     <property name="invisible_char">●</property>
+                    <property name="activates_default">True</property>
                     <property name="width_chars">5</property>
                     <property name="progress_pulse_step">0.0099999997764825821</property>
                     <property name="adjustment">uid</property>
@@ -209,6 +213,7 @@
                     <property name="can_focus">True</property>
                     <property name="margin_left">8</property>
                     <property name="invisible_char">●</property>
+                    <property name="activates_default">True</property>
                     <property name="width_chars">5</property>
                     <property name="adjustment">gid</property>
                   </object>
@@ -273,6 +278,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="margin_top">3</property>
+                        <property name="activates_default">True</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.glade b/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.glade
index 19b4486..ff3c0ef 100644
--- a/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.glade
+++ b/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.19.0 -->
 <interface>
   <requires lib="gtk+" version="3.2"/>
   <object class="GtkDialog" id="confirmDeleteDialog">
@@ -321,7 +321,7 @@
                 <property name="label" translatable="yes" context="GUI|Custom Partitioning|Add Dialog">_Cancel</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="receives_default">False</property>
                 <property name="halign">end</property>
                 <property name="use_underline">True</property>
               </object>
@@ -336,7 +336,9 @@
                 <property name="label" translatable="yes" context="GUI|Custom Partitioning|Add Dialog">_Add mount point</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">False</property>
                 <property name="halign">end</property>
                 <property name="use_underline">True</property>
                 <signal name="clicked" handler="on_add_confirm_clicked" swapped="no"/>
@@ -478,6 +480,7 @@ use.  Try something else?</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="tooltip_text" translatable="yes">eg: "20 GB", "500mb" (minus the quotation marks)</property>
+                <property name="activates_default">True</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
@@ -493,6 +496,7 @@ use.  Try something else?</property>
                   <object class="GtkEntry" id="comboboxtext-entry">
                     <property name="can_focus">True</property>
                     <property name="buffer">mountPointEntryBuffer</property>
+                    <property name="activates_default">True</property>
                     <property name="completion">mountPointCompletion</property>
                   </object>
                 </child>
@@ -583,7 +587,7 @@ use.  Try something else?</property>
                 <property name="label" translatable="yes" context="GUI|Custom Partitioning|Container Dialog">_Cancel</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
@@ -597,7 +601,10 @@ use.  Try something else?</property>
                 <property name="label" translatable="yes" context="GUI|Custom Partitioning|Container Dialog">_Save</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="halign">start</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
@@ -672,6 +679,7 @@ use.  Try something else?</property>
                   <object class="GtkEntry" id="container_name_entry">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
+                    <property name="activates_default">True</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -907,6 +915,7 @@ use.  Try something else?</property>
                   <object class="GtkEntry" id="containerSizeEntry">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
+                    <property name="activates_default">True</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/spokes/lib/passphrase.glade b/pyanaconda/ui/gui/spokes/lib/passphrase.glade
index f2ea51f..dcfda4b 100644
--- a/pyanaconda/ui/gui/spokes/lib/passphrase.glade
+++ b/pyanaconda/ui/gui/spokes/lib/passphrase.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.19.0 -->
 <interface>
   <requires lib="gtk+" version="3.6"/>
   <requires lib="AnacondaWidgets" version="1.0"/>
@@ -23,7 +23,7 @@
                 <property name="label" translatable="yes" context="GUI|Passphrase Dialog">_Cancel</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="receives_default">False</property>
                 <property name="halign">end</property>
                 <property name="use_underline">True</property>
               </object>
@@ -39,7 +39,8 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
-                <property name="receives_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
@@ -114,6 +115,7 @@
                 <property name="can_focus">True</property>
                 <property name="visibility">False</property>
                 <property name="invisible_char">●</property>
+                <property name="activates_default">True</property>
                 <property name="width_chars">32</property>
                 <signal name="activate" handler="on_entry_activated" swapped="no"/>
                 <signal name="changed" handler="on_passphrase_changed" swapped="no"/>
@@ -143,6 +145,7 @@
                 <property name="can_focus">True</property>
                 <property name="visibility">False</property>
                 <property name="invisible_char">●</property>
+                <property name="activates_default">True</property>
                 <property name="width_chars">32</property>
                 <signal name="activate" handler="on_entry_activated" swapped="no"/>
                 <signal name="changed" handler="on_confirm_changed" swapped="no"/>
diff --git a/pyanaconda/ui/gui/spokes/source.glade b/pyanaconda/ui/gui/spokes/source.glade
index 1d4260c..0b1045c 100644
--- a/pyanaconda/ui/gui/spokes/source.glade
+++ b/pyanaconda/ui/gui/spokes/source.glade
@@ -238,7 +238,9 @@
                 <property name="label" translatable="yes" context="GUI|Software Source|Proxy Dialog">_OK</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">False</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
@@ -324,6 +326,7 @@
                       <object class="GtkEntry" id="proxyURLEntry">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
+                        <property name="activates_default">True</property>
                         <property name="width_chars">40</property>
                       </object>
                       <packing>
@@ -403,6 +406,7 @@
                       <object class="GtkEntry" id="proxyUsernameEntry">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
+                        <property name="activates_default">True</property>
                         <signal name="changed" handler="on_proxyUsernameEntry_changed" swapped="no"/>
                       </object>
                       <packing>
@@ -416,6 +420,7 @@
                         <property name="can_focus">True</property>
                         <property name="visibility">False</property>
                         <property name="invisible_char">●</property>
+                        <property name="activates_default">True</property>
                         <signal name="changed" handler="on_proxyPasswordEntry_changed" swapped="no"/>
                       </object>
                       <packing>


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/b024bfb5575ba85ba5a5d5b6ef7a6c016cd15638


More information about the anaconda-patches mailing list