X-Git-Url: http://git.maemo.org/git/?p=jamaendo;a=blobdiff_plain;f=helldon%2F__init__.py;h=09590389b76c5fec5a7dadb7bc041ce57d0c6de5;hp=c333823e375ea29c550f4e859ede6f55a919a528;hb=bc2d10958e2ca043e6ac3e9b38783091e721c94c;hpb=bfda1c4c14e85f118b8396f3c82cec119a689d09 diff --git a/helldon/__init__.py b/helldon/__init__.py index c333823..0959038 100644 --- a/helldon/__init__.py +++ b/helldon/__init__.py @@ -18,7 +18,7 @@ class Program(gtk.Window): self.set_app_paintable(True) self._vbox = gtk.VBox() self._title = gtk.Label("Jamaendo") - self._backbtn = gtk.Button("<<<") + self._backbtn = gtk.Button("Quit") self._hbox = gtk.HBox() self._hbox.pack_start(self._title, True) self._hbox.pack_start(self._backbtn, False) @@ -56,6 +56,10 @@ class Program(gtk.Window): self._notebook.set_current_page(idx) wnd.show_all() wnd._nb_index = idx + if self._stack: + self._backbtn.set_label("<<<") + else: + self._backbtn.set_label("Quit") def popped_stackable(self, wnd=None): pass @@ -71,6 +75,15 @@ class Program(gtk.Window): def on_back(self, *args): self.pop_stackable() + if self._stack: + self._backbtn.set_label("<<<") + else: + self._backbtn.set_label("Quit") + if self._notebook.get_n_pages() == 0: + gtk.main_quit() + + def size(self): + return len(self._stack)+1 class StackableWindow(gtk.Frame): def __init__(self): @@ -87,6 +100,9 @@ class StackableWindow(gtk.Frame): def on_destroy(self, *args): Program.instance.popped_stackable(self) + def get_stack(self): + return Program.instance + class AppMenu(object): def __init__(self): pass