Simplify get_toplevel_window method
issue6995 review39951002
This commit is contained in:
1 parent
66f5d83967
commit
802a0a27e2
1 file changed
+5
-7
@@ -293,13 +293,11 @@ def request_server(server_widget):
|
||||
|
||||
|
||||
def get_toplevel_window():
|
||||
windows = [x for x in gtk.window_list_toplevels()
|
||||
if x.get_window() and x.props.visible
|
||||
and x.props.type == gtk.WINDOW_TOPLEVEL]
|
||||
trans2windows = dict((x.get_transient_for(), x) for x in windows)
|
||||
for window in set(windows) - set(trans2windows.iterkeys()):
|
||||
return window
|
||||
return trans2windows[None]
|
||||
for window in gtk.window_list_toplevels():
|
||||
if window.is_active():
|
||||
return window
|
||||
from tryton.gui.main import Main
|
||||
return Main.get_main().window
|
||||
|
||||
|
||||
def get_sensible_widget(window):
|
||||
|
||||
Reference in new issue
Block a user