Esempio n. 1
0
    def name_dialog(self):
        def cb(text):
            if text:
                self.ids.wallet_name.text = text

        d = LabelDialog(_('Enter wallet name'), '', cb)
        d.open()
Esempio n. 2
0
    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()
Esempio n. 3
0
    def openalias_dialog(self, label, dt):
        from label_dialog import LabelDialog

        def callback(text):
            label.text = text

        d = LabelDialog(_('OpenAlias'), '', callback)
        d.open()
Esempio n. 4
0
    def openalias_dialog(self):
        from label_dialog import LabelDialog

        def callback(text):
            pass

        d = LabelDialog(_('OpenAlias'), '', callback)
        d.open()
Esempio n. 5
0
 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()
Esempio n. 6
0
    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()
Esempio n. 7
0
    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()
Esempio n. 8
0
 def openalias_dialog(self, label, dt):
     from label_dialog import LabelDialog
     def callback(text):
         label.text = text
     d = LabelDialog(_('OpenAlias'), '', callback)
     d.open()
Esempio n. 9
0
 def openalias_dialog(self):
     from label_dialog import LabelDialog
     def callback(text):
         pass
     d = LabelDialog(_('OpenAlias'), '', callback)
     d.open()
Esempio n. 10
0
 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()
Esempio n. 11
0
 def name_dialog(self):
     def cb(text):
         if text:
             self.ids.wallet_name.text = text
     d = LabelDialog(_('Enter wallet name'), '', cb)
     d.open()