X-Git-Url: http://git.datanom.net/lensdatabase.git/blobdiff_plain/365c79d46c3804dd4b3f796bd2fcd4e3ddf1186b..97626a263da480862b73ac92ec136bca7a9f786d:/lensdb.py?ds=sidebyside diff --git a/lensdb.py b/lensdb.py index 9af5862..cdc9200 100644 --- a/lensdb.py +++ b/lensdb.py @@ -1,25 +1,20 @@ #!/usr/bin/python -import gi +try: + import gi, os +except ImportError as err: + print (err) + os._exit(1) + +from main import MainWindow gi.require_version("Gtk", "3.0") from gi.repository import Gtk -dirty = False - -class Handler: - def onDestroy(self, *args): - Gtk.main_quit() - def onQuit(self, *args): - if dirty: - """ show warning """ - self.onDestroy(self, args) - -builder = Gtk.Builder() -builder.add_from_file("lensdatabase.ui") -builder.connect_signals(Handler()) - -window = builder.get_object("main_window") -window.show_all() +def Main(): + path = os.path.dirname(os.path.realpath(__file__)) + MainWindow(path) + Gtk.main() -Gtk.main() +if __name__ == "__main__": + Main()