mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
Allow creation of more than one window
This commit is contained in:
parent
f998069d6b
commit
2b2e3c11c8
2 changed files with 17 additions and 9 deletions
|
@ -1828,7 +1828,7 @@ class Window (object):
|
|||
|
||||
def handle_new_window_action_activate (self, action):
|
||||
|
||||
pass
|
||||
self.app.open_window ()
|
||||
|
||||
def handle_open_file_action_activate (self, action):
|
||||
|
||||
|
@ -2190,7 +2190,9 @@ class App (object):
|
|||
|
||||
self.load_plugins ()
|
||||
|
||||
self.windows = [Window (self)]
|
||||
self.windows = []
|
||||
|
||||
self.open_window ()
|
||||
|
||||
def detach (self):
|
||||
|
||||
|
@ -2207,8 +2209,14 @@ class App (object):
|
|||
else:
|
||||
self.detach ()
|
||||
|
||||
def open_window (self):
|
||||
|
||||
self.windows.append (Window (self))
|
||||
|
||||
def close_window (self, window):
|
||||
|
||||
self.windows.remove (window)
|
||||
if not self.windows:
|
||||
# GtkTreeView takes some time to go down for large files. Let's block
|
||||
# until the window is hidden:
|
||||
gobject.idle_add (gtk.main_quit)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<ui>
|
||||
<menubar>
|
||||
<menu name="FileMenu" action="FileMenuAction">
|
||||
<!--<menuitem name="FileNewWindow" action="new-window"/>-->
|
||||
<menuitem name="FileNewWindow" action="new-window"/>
|
||||
<menuitem name="FileOpen" action="open-file"/>
|
||||
<menuitem name="FileReload" action="reload-file"/>
|
||||
<separator/>
|
||||
|
|
Loading…
Reference in a new issue