def newSnippet(self, whatever): dialog = InputDialog(mainwindow=self.main_WIN) res = dialog.showInput(["title", "alias"], text="input the info of the snippet:") dialog.clear() uid = str(uuid.uuid1()).replace("-", "") sql = "insert into snippet (title, alias, filename) values (?, ?, ?);" cursor = self.conn.cursor() cursor.execute(sql, (res["title"], res["alias"], uid)) self.conn.commit() # add items self.addItem(res["title"]) self.updateResults()
def inputdia(self, *args): inputdialog = InputDialog(mainwindow=self.main_WIN) result = inputdialog.showInput(["name", "age", "gender", "hello", "world"], "fill the info:") inputdialog.clear() self.redraw() return True