def on_toolbutton_openDatabase_clicked (self, widget): # Open File Selector parentWindow = widget.get_root_window() dialog = Gtk.FileChooserDialog(title="Open an existing Terminology Database", parent=self.mainwindow, action=Gtk.FileChooserAction.OPEN, buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK)) response = dialog.run() if response == Gtk.ResponseType.OK: # Read path from Widget path = dialog.get_filename() dialog.destroy() commands.loadDB(self,path) else: dialog.destroy()
def _initialize_user_data(self): if Config.config.getboolean('usage', 'first_use'): assistant = CreateTable(self.assistant_callback) elif Config.config['database']['last_database_opened'] != '': commands.loadDB(self, Config.config['database']['last_database_opened'])
def assistant_callback (self, path): commands.loadDB(self, path)