[PATCH 2/3] Move the really_hide and really_show functions to utils

Vratislav Podzimek vpodzime at redhat.com
Wed May 15 12:28:45 UTC 2013


These functions may come handy in other spokes as well.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/spokes/custom.py | 17 +----------------
 pyanaconda/ui/gui/utils.py         | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index a8ac173..019857b 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -73,6 +73,7 @@ from pyanaconda.ui.gui.spokes.lib.accordion import *
 from pyanaconda.ui.gui.spokes.lib.refresh import RefreshDialog
 from pyanaconda.ui.gui.spokes.lib.summary import ActionSummaryDialog
 from pyanaconda.ui.gui.utils import setViewportBackground, gtk_action_wait, enlightbox, fancy_set_sensitive
+from pyanaconda.ui.gui.utils import really_hide, really_show
 from pyanaconda.ui.gui.categories.storage import StorageCategory
 
 from gi.repository import Gtk
@@ -205,22 +206,6 @@ def validate_mountpoint(mountpoint, used_mountpoints, strict=True):
 
     return valid
 
-def really_hide(widget):
-    """Some widgets need to be both hidden, and have no_show_all set on them
-       to prevent them from being shown later when the screen is redrawn.
-       This method takes care of that.
-    """
-    widget.set_no_show_all(True)
-    widget.hide()
-
-def really_show(widget):
-    """Some widgets need to have no_show_all unset before they can also be
-       shown, so they are displayed later when the screen is redrawn.  This
-       method takes care of that.
-    """
-    widget.set_no_show_all(False)
-    widget.show()
-
 class AddDialog(GUIObject):
     builderObjects = ["addDialog", "mountPointStore", "mountPointCompletion", "mountPointEntryBuffer"]
     mainWidgetName = "addDialog"
diff --git a/pyanaconda/ui/gui/utils.py b/pyanaconda/ui/gui/utils.py
index 1be3bd1..195ad4a 100644
--- a/pyanaconda/ui/gui/utils.py
+++ b/pyanaconda/ui/gui/utils.py
@@ -122,3 +122,19 @@ def fancy_set_sensitive(widget, value):
     widget.set_sensitive(value)
     for w in widget.list_mnemonic_labels():
         w.set_sensitive(value)
+
+def really_hide(widget):
+    """Some widgets need to be both hidden, and have no_show_all set on them
+       to prevent them from being shown later when the screen is redrawn.
+       This method takes care of that.
+    """
+    widget.set_no_show_all(True)
+    widget.hide()
+
+def really_show(widget):
+    """Some widgets need to have no_show_all unset before they can also be
+       shown, so they are displayed later when the screen is redrawn.  This
+       method takes care of that.
+    """
+    widget.set_no_show_all(False)
+    widget.show()
-- 
1.7.11.7



More information about the anaconda-patches mailing list