def name_dialog(self): def cb(text): if text: self.ids.wallet_name.text = text d = LabelDialog(_('Enter wallet name'), '', cb) d.open()
def new_wallet(self, app, dirname): def cb(text): if text: app.load_wallet_by_name(os.path.join(dirname, text)) d = LabelDialog(_('Enter wallet name'), '', cb) d.open()
def openalias_dialog(self, label, dt): from label_dialog import LabelDialog def callback(text): label.text = text d = LabelDialog(_('OpenAlias'), '', callback) d.open()
def openalias_dialog(self): from label_dialog import LabelDialog def callback(text): pass d = LabelDialog(_('OpenAlias'), '', callback) d.open()
def new_wallet(self, app, dirname): def cb(text): if text: app.load_wallet_by_name(os.path.join(dirname, text)) if self.ids.wallet_selector.selection: app.load_wallet_by_name(self.ids.wallet_selector.selection[0]) else: d = LabelDialog(_('Enter wallet name'), '', cb) d.open()
def newShape(self): ''' 槽函数 用来处理canvas传来的信号 弹出对话框来添加新的label ''' def iterAllItems(listwidget): items = [] for i in range(listwidget.count()): items.append(listwidget.item(i).text()) return items items = iterAllItems(self.listWidget_labels) label_dialog = LabelDialog(self, items) # 检测dialog的返回值 result = label_dialog.exec_() if result: label = label_dialog.lineEdit.text() self.canvas.setLastLabel(label) self.addLabel(self.canvas.shapes[-1]) self.setDirty() else: self.canvas.undoLastLine()