[gnome-music/wip/merge: 307/343] application: Reshow window if we already have one



commit 0f82be1e61c7634ca9e2c039a852fd95d572818f
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Sun Jul 21 15:29:26 2013 +0800

    application: Reshow window if we already have one
    
    The design of gnome-music is to only have one window, so we should just
    reshow our main window when activated again.

 gnomemusic/application.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index 0695cbb..a7597fb 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -17,12 +17,15 @@ class Application(Gtk.Application):
         styleContext.add_provider_for_screen(screen, cssProvider,
                                              Gtk.STYLE_PROVIDER_PRIORITY_USER)
 
+        self._window = None
+
     def do_startup(self):
         Gtk.Application.do_startup(self)
 
     def do_activate(self):
-        self._window = Window(self)
-        self._window.show()
+        if not self._window:
+            self._window = Window(self)
+        self._window.present()
 
     def quit(self):
         self.quit()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]