#!/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()