From 2b2e3c11c8d37e88e7c757efb943f592bde809ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ren=C3=A9=20Stadler?= Date: Wed, 23 Jan 2008 17:07:55 +0200 Subject: [PATCH] Allow creation of more than one window --- debug-viewer/GstDebugViewer/GUI.py | 24 ++++++++++++++++-------- debug-viewer/data/gst-debug-viewer.ui | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/debug-viewer/GstDebugViewer/GUI.py b/debug-viewer/GstDebugViewer/GUI.py index 7a972c2..6bd7e9a 100644 --- a/debug-viewer/GstDebugViewer/GUI.py +++ b/debug-viewer/GstDebugViewer/GUI.py @@ -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,14 +2209,20 @@ class App (object): else: self.detach () + def open_window (self): + + self.windows.append (Window (self)) + def close_window (self, window): - # GtkTreeView takes some time to go down for large files. Let's block - # until the window is hidden: - gobject.idle_add (gtk.main_quit) - gtk.main () - - gtk.main_quit () + 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) + gtk.main () + + gtk.main_quit () import time diff --git a/debug-viewer/data/gst-debug-viewer.ui b/debug-viewer/data/gst-debug-viewer.ui index fef6de4..802721a 100644 --- a/debug-viewer/data/gst-debug-viewer.ui +++ b/debug-viewer/data/gst-debug-viewer.ui @@ -2,7 +2,7 @@ - + -- 2.7.4