[PATCH 4/4] Use timing decorator for more actions

Vratislav Podzimek vpodzime at redhat.com
Wed Nov 13 12:46:53 UTC 2013


Filtering languages on the Welcome/Langsupport screens and changing value of the
resize slider in the Reclaim dialog may cause hangs if callback is called over
and over again.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py | 3 ++-
 pyanaconda/ui/gui/spokes/lib/resize.py              | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py b/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py
index 22dbbce..ee4921b 100644
--- a/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py
+++ b/pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py
@@ -27,7 +27,7 @@ screens handling languages or locales configuration.
 from gi.repository import Gtk, Pango
 from pyanaconda import localization
 from pyanaconda.iutil import strip_accents
-from pyanaconda.ui.gui.utils import set_treeview_selection, get_default_widget_direction
+from pyanaconda.ui.gui.utils import set_treeview_selection, get_default_widget_direction, timed_action
 
 class LangLocaleHandler(object):
     """
@@ -161,6 +161,7 @@ class LangLocaleHandler(object):
         if icon_pos == Gtk.EntryIconPosition.SECONDARY:
             entry.set_text("")
 
+    @timed_action()
     def on_entry_changed(self, *args):
         self._languageStoreFilter.refilter()
 
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
index c81774e..1dfa34a 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.py
+++ b/pyanaconda/ui/gui/spokes/lib/resize.py
@@ -27,7 +27,7 @@ from gi.repository import Gdk, Gtk
 from pyanaconda.i18n import _, C_, N_, P_
 from pyanaconda.ui.lib.disks import size_str
 from pyanaconda.ui.gui import GUIObject
-from pyanaconda.ui.gui.utils import escape_markup
+from pyanaconda.ui.gui.utils import escape_markup, timed_action
 from blivet.size import Size
 
 __all__ = ["ResizeDialog"]
@@ -447,6 +447,7 @@ class ResizeDialog(GUIObject):
 
         self._update_action_buttons(self._diskStore[itr])
 
+    @timed_action(delay=200, threshold=500, busy_cursor=False)
     def on_resize_value_changed(self, rng):
         (model, itr) = self._selection.get_selected()
 
-- 
1.8.4.2



More information about the anaconda-patches mailing list