summaryrefslogtreecommitdiff
path: root/portato/gui/windows/basic.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-02-18 22:51:55 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-02-18 22:51:55 +0100
commit6f740cbb6b651dfa73ed6c0e0e2cf4176310e3c8 (patch)
tree0b528b92d62c7984fc6edc566d4f86b2e6e7865c /portato/gui/windows/basic.py
parentbc8b90244640273e775ce25a2f33d97f5da5bbfb (diff)
downloadportato-6f740cbb6b651dfa73ed6c0e0e2cf4176310e3c8.tar.gz
portato-6f740cbb6b651dfa73ed6c0e0e2cf4176310e3c8.tar.bz2
portato-6f740cbb6b651dfa73ed6c0e0e2cf4176310e3c8.zip
Add 'get_ui()' method for convenience
Diffstat (limited to 'portato/gui/windows/basic.py')
-rw-r--r--portato/gui/windows/basic.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/portato/gui/windows/basic.py b/portato/gui/windows/basic.py
index d7c7940..a4f8236 100644
--- a/portato/gui/windows/basic.py
+++ b/portato/gui/windows/basic.py
@@ -23,7 +23,7 @@ from ...constants import TEMPLATE_DIR, APP, LOCALE_DIR
from ...helper import error
class WrappedTree (object):
- __slots__ = ("klass", "tree", "get_widget")
+ __slots__ = ("klass", "tree", "get_widget", "get_ui")
def __init__ (self, klass, tree):
self.tree = tree
self.klass = klass
@@ -40,6 +40,19 @@ class WrappedTree (object):
error("Widget '%s' could not be found in class '%s'.", name, self.klass)
return w
+ def get_ui (self, name, ui = "uimanager"):
+ uiw = self.get_widget(ui)
+ if uiw is None:
+ return None
+
+ if not name.startswith("ui/"):
+ name = "ui/%s" % name
+
+ w = uiw.get_widget(name)
+ if w is None:
+ error("UIItem '%s' of UIManager '%s' could not be found in class '%s'.", name, ui, self.klass)
+ return w
+
class UIBuilder (object):
def __init__ (self, connector = None):
ss='logmsg'> - avoid accessing $? unless it is actually available - when calling a filter, make sure to release the mutex even if there is an exception during the filter handling. The long term solution is to drastically reorganize concurrency code. 2015-01-13Handle being given numbers as feed nameAntonio Terceiro2-0/+16 Force feed names to be strings because they will be handled as strings later. 2015-01-13Rakefile: remove wrong (and thus unused) flagAntonio Terceiro1-1/+0 2015-01-13Remove deprecated 'test suite' fileAntonio Terceiro1-12/+0 I want to always run all tests 2015-01-13Rakefile: re-indentAntonio Terceiro1-35/+35 2015-01-13Rakefile: run tests in verbose modeAntonio Terceiro1-1/+2 2014-10-071.2.3 releaseAntonio Terceiro1-1/+1 2014-10-07Fix cleanup of maildirsAntonio Terceiro3-1/+16 Thanks to Sylvain L. Sauvage for the bug report 2014-05-18feed2imap-test: reuse cache dir/protect configAntonio Terceiro1-1/+1 this reduces the noise in the output and helps testing feed updates 2014-02-13feed2imap-test: can now take a feed URL as argumentAntonio Terceiro1-3/+22 2014-02-13update .gitignoreAntonio Terceiro1-0/+2 2014-02-13fix dependency on ruby-feedparserAntonio Terceiro1-1/+1 2014-02-05Release 1.2.2Antonio Terceiro2-2/+2 2014-02-05config: fix regression with arrays as targetAntonio Terceiro2-1/+17 2013-08-28Fix teardown method nameAntonio Terceiro1-1/+1