remember window size across invocations
This commit is contained in:
parent
ff430fd127
commit
77963428f1
@ -10,6 +10,10 @@ class MainWindow(Gtk.Window):
|
|||||||
super().__init__(title = "Simple SVN Browser v%s" % VERSION)
|
super().__init__(title = "Simple SVN Browser v%s" % VERSION)
|
||||||
|
|
||||||
self.cache_file = CacheFile()
|
self.cache_file = CacheFile()
|
||||||
|
if (self.cache_file["width"] is not None and
|
||||||
|
self.cache_file["height"] is not None):
|
||||||
|
self.set_default_size(self.cache_file["width"],
|
||||||
|
self.cache_file["height"])
|
||||||
|
|
||||||
top_hbox = Gtk.Box()
|
top_hbox = Gtk.Box()
|
||||||
address_entry = Gtk.Entry(text = url)
|
address_entry = Gtk.Entry(text = url)
|
||||||
@ -31,8 +35,16 @@ class MainWindow(Gtk.Window):
|
|||||||
|
|
||||||
self.add(vbox)
|
self.add(vbox)
|
||||||
|
|
||||||
self.connect("delete-event", Gtk.main_quit)
|
self.connect("delete-event", self.__close)
|
||||||
self.show_all()
|
self.show_all()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
Gtk.main()
|
Gtk.main()
|
||||||
|
|
||||||
|
def __close(self, *more):
|
||||||
|
size = self.get_size()
|
||||||
|
self.cache_file["width"] = size[0]
|
||||||
|
self.cache_file["height"] = size[1]
|
||||||
|
self.cache_file.write()
|
||||||
|
Gtk.main_quit()
|
||||||
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user