[PATCH 3/4 rhel7-branch] Use timing decorator for more actions
Radek Vykydal
rvykydal at redhat.com
Tue Sep 16 07:39:48 UTC 2014
From: Vratislav Podzimek <vpodzime at redhat.com>
Related: rhbz#1065716
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.
Port of commit 7cd059720ae4f106180820f01a5bba608b7318b3 from master.
---
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 36b5828..f3bf1a5 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, override_cell_property
+from pyanaconda.ui.gui.utils import set_treeview_selection, override_cell_property, timed_action
class LangLocaleHandler(object):
"""
@@ -156,6 +156,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 832e776..8f997f9 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.py
+++ b/pyanaconda/ui/gui/spokes/lib/resize.py
@@ -28,7 +28,7 @@ from gi.repository import Gdk, Gtk
from pyanaconda.i18n import _, 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"]
@@ -475,6 +475,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.9.3
More information about the anaconda-patches
mailing list