[PATCH 2/7] Preserve the state of the Customize... expanders on custom storage (#883134).

Martin Sivak msivak at redhat.com
Thu Jan 31 13:56:58 UTC 2013


Ack.

----- Original Message -----
> Also, reword the label on that expander and change a keyboard
> accelerator to
> match.
> ---
>  pyanaconda/ui/gui/spokes/custom.glade     |  7 ++++---
>  pyanaconda/ui/gui/spokes/custom.py        | 11 +++++++++++
>  pyanaconda/ui/gui/spokes/lib/accordion.py |  2 ++
>  3 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/custom.glade
> b/pyanaconda/ui/gui/spokes/custom.glade
> index ba4a4c8..39e3866 100644
> --- a/pyanaconda/ui/gui/spokes/custom.glade
> +++ b/pyanaconda/ui/gui/spokes/custom.glade
> @@ -154,7 +154,7 @@
>                  <property name="visible">True</property>
>                  <property name="can_focus">False</property>
>                  <property name="xalign">0</property>
> -                <property name="label"
> translatable="yes">&lt;b&gt;M_ount Point:&lt;/b&gt;</property>
> +                <property name="label"
> translatable="yes">&lt;b&gt;Mount _Point:&lt;/b&gt;</property>
>                  <property name="use_markup">True</property>
>                  <property name="use_underline">True</property>
>                  <property
>                  name="mnemonic_widget">addMountPointEntry</property>
> @@ -561,7 +561,7 @@ use.  Try something else?</property>
>                                      <property
>                                      name="visible">True</property>
>                                      <property
>                                      name="can_focus">False</property>
>                                      <property
>                                      name="xalign">0</property>
> -                                    <property name="label"
> translatable="yes">&lt;b&gt;M_ount Point:&lt;/b&gt;</property>
> +                                    <property name="label"
> translatable="yes">&lt;b&gt;Mount _Point:&lt;/b&gt;</property>
>                                      <property
>                                      name="use_markup">True</property>
>                                      <property
>                                      name="use_underline">True</property>
>                                      <property
>                                      name="mnemonic_widget">mountPointEntry</property>
> @@ -711,6 +711,7 @@ use.  Try something else?</property>
>                                  <property
>                                  name="visible">True</property>
>                                  <property
>                                  name="can_focus">True</property>
>                                  <property
>                                  name="use_underline">True</property>
> +                                <signal name="activate"
> handler="on_customize_activated" swapped="no"/>
>                                  <child>
>                                    <object class="GtkGrid"
>                                    id="grid3">
>                                      <property
>                                      name="visible">True</property>
> @@ -918,7 +919,7 @@ use.  Try something else?</property>
>                                    <object class="GtkLabel"
>                                    id="label3">
>                                      <property
>                                      name="visible">True</property>
>                                      <property
>                                      name="can_focus">False</property>
> -                                    <property name="label"
> translatable="yes">_Customize...</property>
> +                                    <property name="label"
> translatable="yes">Device and file system _options...</property>
>                                      <property
>                                      name="use_underline">True</property>
>                                    </object>
>                                  </child>
> diff --git a/pyanaconda/ui/gui/spokes/custom.py
> b/pyanaconda/ui/gui/spokes/custom.py
> index a590b6f..e9fc86b 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -1426,6 +1426,11 @@ class CustomPartitioningSpoke(NormalSpoke,
> StorageChecker):
>          sizeSpinner = self.builder.get_object("sizeSpinner")
>          typeCombo = self.builder.get_object("deviceTypeCombo")
>          fsCombo = self.builder.get_object("fileSystemTypeCombo")
> +        expander = self.builder.get_object("customizeExpander")
> +
> +        # We want to preserve the state of the customize expander so
> that it's
> +        # open should you open it and then look at some other device
> instead.
> +        expander.set_expanded(selector.customizeIsOpen)
>  
>          device = selector._device
>          if device.type == "luks/dm-crypt":
> @@ -1661,6 +1666,12 @@ class CustomPartitioningSpoke(NormalSpoke,
> StorageChecker):
>  
>          NormalSpoke.on_back_clicked(self, button)
>  
> +    def on_customize_activated(self, expander):
> +        if not self._current_selector:
> +            return
> +
> +        self._current_selector.customizeIsOpen = not
> self._current_selector.customizeIsOpen
> +
>      def on_add_clicked(self, button):
>          self._save_right_side(self._current_selector)
>  
> diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py
> b/pyanaconda/ui/gui/spokes/lib/accordion.py
> index 7a42ffd..af5c218 100644
> --- a/pyanaconda/ui/gui/spokes/lib/accordion.py
> +++ b/pyanaconda/ui/gui/spokes/lib/accordion.py
> @@ -155,6 +155,7 @@ class Page(Gtk.Box):
>  
>          selector._device = None
>          selector._root = None
> +        selector.customizeIsOpen = False
>  
>          if self._mountpointType(mountpoint) == DATA_DEVICE:
>              self._dataBox.add(selector)
> @@ -210,6 +211,7 @@ class UnknownPage(Page):
>  
>          selector._device = None
>          selector._root = None
> +        selector.customizeIsOpen = False
>  
>          self._members.append(selector)
>          self.add(selector)
> --
> 1.7.11.2
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 


More information about the anaconda-patches mailing list