diff options
author | Micah Anderson <micah@riseup.net> | 2013-08-22 14:10:50 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2013-08-22 14:10:50 -0400 |
commit | 6bae67c3e7c66af9e8ce1605070f7e92f247f0cb (patch) | |
tree | 64dc7e2588cc5c17fdb6c801877792f83cfcecf3 /src/leap/gui/utils.py | |
parent | 00efccabb1eb6c3597282bc0e095cf2026f75a3b (diff) | |
parent | 00d98a47c60764475d97df1c2eb847e20a77cae5 (diff) |
Merge tag '0.3.0' into debian
Tag bitmask version 0.3.0
Conflicts:
.coveragerc
.tx/config
NEWS.rst
setup.cfg
src/leap/base/checks.py
src/leap/base/exceptions.py
src/leap/base/tests/test_checks.py
src/leap/eip/checks.py
src/leap/gui/firstrun/login.py
src/leap/gui/locale_rc.py
src/leap/util/polkit.py
tests/test_qt_environment.py
tox.ini
Diffstat (limited to 'src/leap/gui/utils.py')
-rw-r--r-- | src/leap/gui/utils.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/leap/gui/utils.py b/src/leap/gui/utils.py deleted file mode 100644 index f91ac3ef..00000000 --- a/src/leap/gui/utils.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -utility functions to work with gui objects -""" -from PyQt4 import QtCore - - -def layout_widgets(layout): - """ - return a generator with all widgets in a layout - """ - return (layout.itemAt(i) for i in range(layout.count())) - - -DELAY_MSECS = 50 - - -def delay(obj, method_str=None, call_args=None): - """ - Triggers a function or slot with a small delay. - this is a mainly a hack to get responsiveness in the ui - in cases in which the event loop freezes and the task - is not heavy enough to setup a processing queue. - """ - if callable(obj) and not method_str: - fun = lambda: obj() - - if method_str: - invoke = QtCore.QMetaObject.invokeMethod - if call_args: - fun = lambda: invoke(obj, method_str, call_args) - else: - fun = lambda: invoke(obj, method_str) - - QtCore.QTimer().singleShot(DELAY_MSECS, fun) |