Ejemplo n.º 1
0
    def cardOutputFun(self, text=None):
        if not self.ableCheck():
            return

        thiscard = self.makeMyCard()
        thistext = thiscard.make_gu_text()
        QInputDialog.getMultiLineText(self, '请复制', "", thistext)
Ejemplo n.º 2
0
def act():
    text = QInputDialog.getMultiLineText(QtCreator.Core.ICore.dialogParent(),
        "Input Text", "Input your text, including some macros",
        "3 + 3 = %{Python:3+3}"
    )
    text = QtCreator.Utils.MacroExpander().expand(text[0])
    QMessageBox.information(QtCreator.Core.ICore.dialogParent(), "Result", text)
Ejemplo n.º 3
0
    def sendText(self):
        if self.tabManager.currentWidget() is not self.liveWindow:
            return

        text, success = QInputDialog.getMultiLineText(self, "Type text...", "Text to type:")

        if not success:
            return

        self.liveWindow.sendText(text)
 def _import_to_list(self,qlist: QTreeWidget):
     text, ok = QInputDialog.getMultiLineText(self,"Input Address List","Address in hex (one address each line):","")
     if not ok:
         return
     for line in text.splitlines(keepends=False):
         try:
             addr = int(line, 16)
             self.add_address_to_list(qlist, addr)
         except ValueError as e: #pylint: disable=unused-variable
             pass
Ejemplo n.º 5
0
 def add_audio_path(self):
     new_paths, okay = QInputDialog.getMultiLineText(
         self,
         "Add audio path(s)",
         "Enter the directories where the audio files are stored, separated by line breaks. Sub-directories will be scanned automatically.",
         "\n".join(import_export.config["audio_paths"]),
     )
     if okay:
         import_export.config["audio_paths"] = new_paths.splitlines()
         path = import_export.write_config()
         self.console("Saved settings to " + path)
         self.scan_for_files()
Ejemplo n.º 6
0
 def contextMenuEvent(self, event):
     clip_panel_menu = QMenu(self)
     clear_action = clip_panel_menu.addAction("Clear")
     edit_action = clip_panel_menu.addAction("Edit")
     action = clip_panel_menu.exec_(self.mapToGlobal(event.pos()))
     p = event.pos()
     clip_panel = self.childAt(p)
     if action == clear_action:
         clip_panel.setText('')
     elif action == edit_action:
         if hasattr(clip_panel, 'text'):
             cur_value = clip_panel.text()
             value, ok = QInputDialog.getMultiLineText(
                 self, "please input text", "", cur_value)
             if ok:
                 clip_panel.setText(value)
Ejemplo n.º 7
0
    def wishImportFun(self, text=None):
        if text is None:
            text, ok = QInputDialog.getMultiLineText(self, '导入祝福', 'WISH 开头')
            if not (ok and text):
                return

        text = text.split(" ")
        if text[0] != "WISH":
            return
        else:
            wishLevelList = []
            for i in range(len(text) - 1):
                try:
                    wishLevelList.append(int(text[i + 1]))
                except:
                    pass
            self.wishpanel.wishLevelList = wishLevelList.copy()
Ejemplo n.º 8
0
    def amuletImportFun(self, text=None):
        if text is None:
            text, ok = QInputDialog.getMultiLineText(self, '导入护符', 'AMULET 开头,ENDAMULET结束')
            if not (ok and text):
                return

        text = text.split(" ")
        if text[0] != "AMULET":
            return
        else:
            amuletLevelList = [0] * len(all_amulet["data"])
            for i in range(1, len(text) - 2, 2):
                try:
                    name = text[i]
                    level = text[i + 1]
                    for j in range(len(all_amulet["data"])):
                        if all_amulet["data"][j] == name:
                            amuletLevelList[j] = int(level)
                except:
                    pass
            self.amuletpanel.amuletLevelList = amuletLevelList.copy()
Ejemplo n.º 9
0
 def get_item_from_input(self):
     value, ok = QInputDialog.getMultiLineText(self, "please input text",
                                               "", "")
     if ok and value not in self.ctrlcv.CLIPBOARD:
         self.combo_box.addItem(value)
         self.ctrlcv.CLIPBOARD.append(value)
Ejemplo n.º 10
0
    def cardImportFun(self, text=None):
        if text is None:
            text, ok = QInputDialog.getMultiLineText(self, '导入卡片', '计算器格式')
            if not (ok and text):
                return

        text = re.sub(r"\n\n", "\n", text)
        text = text.split("\n")

        attrs1 = text[0].split()
        if (len(attrs1) == 2):
            cardtype, nickname = attrs1[0].split("_")
            for i in range(len(all_character['data'])):
                if cardtype == all_character['data'][i]:
                    self.cardtypecomboBox.setCurrentIndex(i)
                    break
            self.nicknamelineedit.setText(nickname)
            text.pop(0)
            attrs1 = text[0].split()

        if attrs1[0] == "WISH":
            self.wishImportFun(text[0])
            text.pop(0)
            attrs1 = text[0].split()

        if attrs1[0] == "AMULET":
            self.amuletImportFun(text[0])
            text.pop(0)
            attrs1 = text[0].split()

        self.ADLineEdit.setText(attrs1[0])
        self.APLineEdit.setText(attrs1[1])
        self.RTKLineEdit.setText(attrs1[2])
        self.ADCLineEdit.setText(attrs1[3])
        self.ADCALineEdit.setText(attrs1[4])
        self.APCLineEdit.setText(attrs1[5])
        self.APCALineEdit.setText(attrs1[6])
        self.CRITCLineEdit.setText(attrs1[7])

        attrs2 = text[1].split()
        self.SPEEDLineEdit.setText(attrs2[0])
        self.WDEFLineEdit.setText(attrs2[1])
        self.WDEFALineEdit.setText(attrs2[2])
        self.MDEFLineEdit.setText(attrs2[3])
        self.MDEFALineEdit.setText(attrs2[4])

        attrs3 = text[2].split()
        self.HEALTHLineEdit.setText(attrs3[0])
        self.RECOVERLineEdit.setText(attrs3[1])
        self.RECOVERALineEdit.setText(attrs3[2])
        self.SHIELDLineEdit.setText(attrs3[3])
        self.SHIELDRECOVERLineEdit.setText(attrs3[4])
        self.SHIELDRECOVERALineEdit.setText(attrs3[5])

        attrs4 = text[3].split()
        self.CRITLineEdit.setText(attrs4[0])
        self.SKILLLineEdit.setText(attrs4[1])
        self.REFLECTLineEdit.setText(attrs4[2])
        self.VAMPIRELineEdit.setText(attrs4[3])

        others = text[4].split()
        for i in range(len(self.comboBoxList)):
            self.comboBoxList[i].setChecked(False)
            for j in range(1,len(others)):
                if others[j] == self.comboBoxList[i].ATTR:
                    self.comboBoxList[i].setChecked(True)
Ejemplo n.º 11
0
def getMultiLineText(parentWindow=None,
                     title="Text Input",
                     label="Text:",
                     text=""):
    return QInputDialog.getMultiLineText(parentWindow, title, label, text)