当前位置: 首页>>代码示例>>Python>>正文


Python QMessageBox.Retry方法代码示例

本文整理汇总了Python中PyQt5.QtWidgets.QMessageBox.Retry方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.Retry方法的具体用法?Python QMessageBox.Retry怎么用?Python QMessageBox.Retry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtWidgets.QMessageBox的用法示例。


在下文中一共展示了QMessageBox.Retry方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_tor_with_prompt

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Retry [as 别名]
def get_tor_with_prompt(reactor, parent=None):
    tor = yield get_tor(reactor)
    while not tor:
        msgbox = QMessageBox(parent)
        msgbox.setIcon(QMessageBox.Critical)
        msgbox.setWindowTitle("Tor Required")
        msgbox.setText(
            "This connection can only be made over the Tor network, however, "
            "no running Tor daemon was found or Tor has been disabled."
        )
        msgbox.setInformativeText(
            "Please ensure that Tor is running and try again.<p>For help "
            "installing Tor, visit "
            "<a href=https://torproject.org>https://torproject.org</a>"
        )
        msgbox.setStandardButtons(QMessageBox.Abort | QMessageBox.Retry)
        if msgbox.exec_() == QMessageBox.Retry:
            tor = yield get_tor(reactor)
        else:
            break
    return tor 
开发者ID:gridsync,项目名称:gridsync,代码行数:23,代码来源:tor.py

示例2: findPubKey

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Retry [as 别名]
def findPubKey(self):
        printDbg("Computing public key...")
        currSpath = self.ui.edt_spath.value()
        currHwAcc = self.ui.edt_hwAccount.value()
        # Check HW device
        if self.caller.hwStatus != 2:
            myPopUp_sb(self.caller, "crit", 'SPMT - hw device check', "Connect to HW device first")
            printDbg("Unable to connect to hardware device. The device status is: %d" % self.caller.hwStatus)
            return None

        result = self.caller.hwdevice.scanForPubKey(currHwAcc, currSpath, self.isTestnet())

        # Connection pop-up
        warningText = "Unable to find public key. The action was refused on the device or another application "
        warningText += "might have taken over the USB communication with the device.<br><br>"
        warningText += "To continue click the <b>Retry</b> button.\nTo cancel, click the <b>Abort</b> button."
        mBox = QMessageBox(QMessageBox.Critical, "WARNING", warningText, QMessageBox.Retry)
        mBox.setStandardButtons(QMessageBox.Retry | QMessageBox.Abort);

        while result is None:
            ans = mBox.exec_()
            if ans == QMessageBox.Abort:
                return
            # we need to reconnect the device
            self.caller.hwdevice.clearDevice()
            self.caller.hwdevice.initDevice(self.caller.header.hwDevices.currentIndex())

            result = self.caller.hwdevice.scanForPubKey(currHwAcc, currSpath, self.isTestnet())

        mess = "Found public key:\n%s" % result
        myPopUp_sb(self.caller, "info", "SPMT - findPubKey", mess)
        printOK("Public Key: %s" % result)
        self.ui.edt_pubKey.setText(result) 
开发者ID:PIVX-Project,项目名称:PIVX-SPMT,代码行数:35,代码来源:tabMNConf.py

示例3: _on_decryption_failed

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Retry [as 别名]
def _on_decryption_failed(self, msg):
        logging.error("%s", msg)
        self.crypter_thread.quit()
        if msg == "Decryption failed. Ciphertext failed verification":
            msg = "The provided passphrase was incorrect. Please try again."
        reply = QMessageBox.critical(
            self.parent,
            "Decryption Error",
            msg,
            QMessageBox.Abort | QMessageBox.Retry,
        )
        self.crypter_thread.wait()
        if reply == QMessageBox.Retry:
            self._load_from_file(self.filepath) 
开发者ID:gridsync,项目名称:gridsync,代码行数:16,代码来源:recovery.py

示例4: test_get_tor_with_prompt_retry

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Retry [as 别名]
def test_get_tor_with_prompt_retry(monkeypatch):
    monkeypatch.setattr(
        "gridsync.tor.get_tor", MagicMock(side_effect=[None, "FakeTxtorcon"])
    )
    monkeypatch.setattr(
        "PyQt5.QtWidgets.QMessageBox.exec_",
        MagicMock(return_value=QMessageBox.Retry),
    )
    tor = yield get_tor_with_prompt(None)
    assert tor == "FakeTxtorcon" 
开发者ID:gridsync,项目名称:gridsync,代码行数:12,代码来源:test_tor.py

示例5: show_critical_error

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Retry [as 别名]
def show_critical_error(self, message_list):

        message = '''
        <p>
        {message}
        <br>
        Error: {error}
        </p>
        '''.format(message=message_list[0], error=message_list[1])

        result = QMessageBox.critical(self, 'ERROR', message, QMessageBox.Abort, QMessageBox.Retry)

        # Abort
        if result == QMessageBox.Abort:
            self.close()

        # Retry
        else:

            # set error flag to True -- implies error
            self._flag_error = True
            return

##############################################
# FILL COMBO BOXES
############################################## 
开发者ID:PaloAltoNetworks,项目名称:pan-fca,代码行数:28,代码来源:load_partial.py

示例6: _show_critical_error

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Retry [as 别名]
def _show_critical_error(self, message_list):

        message = '''
        <p>
        {message}
        <br>
        Error: {error}
        </p>
        '''.format(message=message_list[0], error=message_list[1])

        result = QMessageBox.critical(self, 'ERROR', message, QMessageBox.Abort, QMessageBox.Retry)

        # Abort
        if result == QMessageBox.Abort:
            self.close()

        # Retry
        else:

            # set error flag to True -- implies error
            self._flag_error = True
            return


############################################################################
# MAIN
############################################################################ 
开发者ID:PaloAltoNetworks,项目名称:pan-fca,代码行数:29,代码来源:load_partial.py

示例7: signMess

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Retry [as 别名]
def signMess(self, caller, hwpath, message, isTestnet=False):
        if isTestnet:
            path = MPATH_TESTNET + hwpath
        else:
            path = MPATH + hwpath
        # Ledger doesn't accept characters other that ascii printable:
        # https://ledgerhq.github.io/btchip-doc/bitcoin-technical.html#_sign_message
        message = message.encode('ascii', 'ignore')
        message_sha = splitString(single_sha256(message).hex(), 32);

        # Connection pop-up
        mBox = QMessageBox(caller)
        warningText = "Another application (such as Ledger Wallet app) has probably taken over "
        warningText += "the communication with the Ledger device.<br><br>To continue, close that application and "
        warningText += "click the <b>Retry</b> button.\nTo cancel, click the <b>Abort</b> button"
        mBox.setText(warningText)
        mBox.setWindowTitle("WARNING")
        mBox.setStandardButtons(QMessageBox.Retry | QMessageBox.Abort);

        # Ask confirmation
        with self.lock:
            info = self.chip.signMessagePrepare(path, message)

            while info['confirmationNeeded'] and info['confirmationType'] == 34:
                ans = mBox.exec_()

                if ans == QMessageBox.Abort:
                    raise Exception("Reconnect HW device")

                # we need to reconnect the device
                self.initDevice()
                info = self.chip.signMessagePrepare(path, message)

            printOK('Signing Message')
            self.mBox = QMessageBox(caller)
            messageText = "Check display of your hardware device\n\n- message hash:\n\n%s\n\n-path:\t%s\n" % (
            message_sha, path)
            self.mBox.setText(messageText)
            self.mBox.setIconPixmap(caller.tabMain.ledgerImg.scaledToHeight(200, Qt.SmoothTransformation))
            self.mBox.setWindowTitle("CHECK YOUR LEDGER")
            self.mBox.setStandardButtons(QMessageBox.NoButton)
            self.mBox.show()

        # Sign message
        ThreadFuns.runInThread(self.signMessageSign, (), self.signMessageFinish) 
开发者ID:PIVX-Project,项目名称:PIVX-SPMT,代码行数:47,代码来源:ledgerClient.py


注:本文中的PyQt5.QtWidgets.QMessageBox.Retry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。