Skip to content

Commit

Permalink
Connect dialog inputs to default actions.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dashea committed Jul 7, 2015
1 parent 46076f9 commit b024bfb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
10 changes: 8 additions & 2 deletions pyanaconda/ui/gui/spokes/advanced_user.glade
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
19 changes: 14 additions & 5 deletions 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">
Expand Down Expand Up @@ -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>
Expand All @@ -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"/>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>

This comment has been minimized.

Copy link
@vpodzime

vpodzime Jul 7, 2015

Is this halign specification added intentionally?

This comment has been minimized.

Copy link
@dashea

dashea Jul 7, 2015

Author Owner

Is this halign specification added intentionally?

No, I probably caught something while scrolling. Thanks for catching that.

<property name="use_underline">True</property>
</object>
<packing>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
9 changes: 6 additions & 3 deletions 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"/>
Expand All @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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"/>
Expand Down Expand Up @@ -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"/>
Expand Down
7 changes: 6 additions & 1 deletion pyanaconda/ui/gui/spokes/source.glade
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit b024bfb

Please sign in to comment.