示例#1
0
	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()
示例#2
0
	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'])
示例#3
0
	def assistant_callback (self, path):
		commands.loadDB(self, path)