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


Python QMessageBox.Warning方法代码示例

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


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

示例1: late_init

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def late_init(save_manager: savemanager.SaveManager) -> None:
    """Initialize the rest of the config after the QApplication is created."""
    global _init_errors
    if _init_errors is not None:
        errbox = msgbox.msgbox(parent=None,
                               title="Error while reading config",
                               text=_init_errors.to_html(),
                               icon=QMessageBox.Warning,
                               plain_text=False)
        errbox.exec_()

        if _init_errors.fatal:
            sys.exit(usertypes.Exit.err_init)

    _init_errors = None

    configtypes.FontBase.set_defaults(config.val.fonts.default_family,
                                      config.val.fonts.default_size)
    config.instance.changed.connect(_update_font_defaults)

    config.instance.init_save_manager(save_manager)
    configfiles.state.init_save_manager(save_manager) 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:24,代码来源:configinit.py

示例2: on_btnEnDisPin_clicked

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def on_btnEnDisPin_clicked(self):
        try:
            if self.hw_session and self.hw_session.hw_client:
                if self.pin_protection is True:
                    # disable
                    if self.queryDlg('Do you really want to disable PIN protection of your %s?' % self.main_ui.getHwName(),
                                     buttons=QMessageBox.Yes | QMessageBox.Cancel, default_button=QMessageBox.Cancel,
                                     icon=QMessageBox.Warning) == QMessageBox.Yes:
                        hw_intf.change_pin(self.main_ui.hw_session, remove=True)
                        self.read_hw_features()
                        self.updateControlsState()
                elif self.pin_protection is False:
                    # enable PIN
                    hw_intf.change_pin(self.main_ui.hw_session, remove=False)
                    self.read_hw_features()
                    self.updateControlsState()

        except Exception as e:
            self.errorMsg(str(e)) 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:21,代码来源:hw_setup_dlg.py

示例3: on_btnEnDisPass_clicked

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def on_btnEnDisPass_clicked(self):
        try:
            if self.hw_session and self.hw_session.hw_client:
                if self.passphrase_protection is True:
                    # disable passphrase
                    if self.queryDlg('Do you really want to disable passphrase protection of your %s?' % self.main_ui.getHwName(),
                                     buttons=QMessageBox.Yes | QMessageBox.Cancel, default_button=QMessageBox.Cancel,
                                     icon=QMessageBox.Warning) == QMessageBox.Yes:
                        hw_intf.enable_passphrase(self.hw_session, passphrase_enabled=False)
                        self.read_hw_features()
                        self.updateControlsState()
                elif self.passphrase_protection is False:
                    # enable passphrase
                    if self.queryDlg('Do you really want to enable passphrase protection of your %s?' % self.main_ui.getHwName(),
                                     buttons=QMessageBox.Yes | QMessageBox.Cancel, default_button=QMessageBox.Cancel,
                                     icon=QMessageBox.Warning) == QMessageBox.Yes:
                        hw_intf.enable_passphrase(self.hw_session, passphrase_enabled=True)
                        self.read_hw_features()
                        self.updateControlsState()

        except Exception as e:
            self.errorMsg(str(e)) 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:24,代码来源:hw_setup_dlg.py

示例4: main

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def main():
    QApplication.setApplicationName("Blender Version Manager")
    QApplication.setApplicationVersion("1.6.1 Beta")

    app = QApplication(sys.argv)

    proc_count = len([proc for proc in psutil.process_iter()
                      if proc.name() == "Blender Version Manager.exe"])

    if proc_count > 2:
        msg = QMessageBox(QMessageBox.Warning, "Blender Version Manager",
                          "Another instance is already running!",
                          QMessageBox.Ok)
        msg.setWindowIcon(QIcon(":/icons/app.svg"))
        msg.exec_()
    else:
        window = BVMQMainWindow(app)

        if not window.is_run_minimized:
            window.show()

        app.exec_() 
开发者ID:DotBow,项目名称:Blender-Version-Manager,代码行数:24,代码来源:main.py

示例5: warning

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def warning(self, warningstr):
        warning = QMessageBox()
        warning.setWindowTitle('Warning')
        warning.setIcon(QMessageBox.Warning)
        warning.setText(warningstr)
        warning.setStandardButtons(QMessageBox.Ok)
        return warning.exec_() 
开发者ID:aerospaceresearch,项目名称:visma,代码行数:9,代码来源:window.py

示例6: callBack

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def callBack(self, keys):
        # do nothing if keys is empty
        if not(keys):
            return

        # check that if shortcut used before.
        if keys in self.shortcuts_list:
            self.msgBox = QMessageBox()
            self.msgBox.setText(QCoreApplication.translate("setting_src_ui_tr", "<b><center>This shortcut has been used before!\
                    Use another one!</center></b>"))
            self.msgBox.setIcon(QMessageBox.Warning)
            reply = self.msgBox.exec_()

        # set new shortcut
        else:
            selected_row = self.shortcut_table.selectionModel().selectedRows()[0].row()

            item = QTableWidgetItem(keys)

            # align center
            item.setTextAlignment(0x0004 | 0x0080)

            # insert item in shortcut_table
            self.shortcut_table.setItem(selected_row, 1, item)

            # set keys in shortcuts_list
            self.shortcuts_list[selected_row] = keys

    # active color_comboBox only when user is select "Fusion" style. 
开发者ID:persepolisdm,项目名称:persepolis,代码行数:31,代码来源:setting.py

示例7: DisplayErrorMessage

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def DisplayErrorMessage(self, message):
        print(message)
        self.alert.setText(message)
        self.alert.setIcon(QMessageBox.Warning)
        self.alert.exec_()

    # Start the telemetry system for the selected spacecraft 
开发者ID:nasa,项目名称:cFS-GroundSystem,代码行数:9,代码来源:GroundSystem.py

示例8: generate_priv_key

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def generate_priv_key(self, pk_type:str, edit_control: QLineEdit, compressed: bool):
        if edit_control.text():
            if WndUtils.queryDlg(
                    f'This will overwrite the current {pk_type} private key value. Do you really want to proceed?',
                     buttons=QMessageBox.Yes | QMessageBox.Cancel,
                     default_button=QMessageBox.Yes, icon=QMessageBox.Warning) != QMessageBox.Yes:
                return None

        if pk_type == 'operator':
            pk = dash_utils.generate_bls_privkey()
        else:
            pk = dash_utils.generate_wif_privkey(self.app_config.dash_network, compressed=compressed)
        edit_control.setText(pk)
        return pk 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:16,代码来源:masternode_details.py

示例9: load_configuration_from_file

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def load_configuration_from_file(self, file_name: str, ask_save_changes = True,
                                     update_current_file_name = True) -> None:
        """
        Load configuration from a file.
        :param file_name: A name of the configuration file to be loaded into the application.
        """
        if self.app_config.is_modified() and ask_save_changes:
            ret = self.queryDlg('Current configuration has been modified. Save?',
                                buttons=QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel,
                                default_button=QMessageBox.Yes, icon=QMessageBox.Warning)
            if ret == QMessageBox.Yes:
                self.save_configuration()
            elif ret == QMessageBox.Cancel:
                self.update_config_files_mru_menu_items()
                return

        try:
            self.disconnect_hardware_wallet()
            dash_network_sav = self.app_config.dash_network
            self.app_config.read_from_file(hw_session=self.hw_session, file_name=file_name,
                                           update_current_file_name=update_current_file_name)
            self.editing_enabled = False
            self.configuration_to_ui()
            self.dashd_intf.reload_configuration()
            self.app_config.modified = False
            file_name = self.app_config.app_config_file_name
            if file_name:
                self.add_item_to_config_files_mru_list(file_name)
                self.update_config_files_mru_menu_items()
                if dash_network_sav != self.app_config.dash_network:
                    self.disconnect_hardware_wallet()
                    self.app_config.reset_network_dependent_dyn_params()
            self.display_window_title()
        except CancelException:
            self.update_config_files_mru_menu_items() 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:37,代码来源:main_dlg.py

示例10: on_action_clear_wallet_cache_triggered

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def on_action_clear_wallet_cache_triggered(self, checked):
        if self.queryDlg('Do you really want to clear the wallet cache?',
                         buttons=QMessageBox.Yes | QMessageBox.Cancel,
                         default_button=QMessageBox.Cancel, icon=QMessageBox.Warning) == QMessageBox.Yes:
            db_cursor = self.app_config.db_intf.get_cursor()
            try:
                db_cursor.execute('drop table address')
                db_cursor.execute('drop table hd_tree')
                db_cursor.execute('drop table tx_input')
                db_cursor.execute('drop table tx_output')
                db_cursor.execute('drop table tx')
                self.app_config.db_intf.create_structures()
            finally:
                self.app_config.db_intf.release_cursor()
            self.infoMsg('Wallet cache cleared.') 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:17,代码来源:main_dlg.py

示例11: on_action_clear_proposals_cache_triggered

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def on_action_clear_proposals_cache_triggered(self, checked):
        if self.queryDlg('Do you really want to clear the proposals cache?',
                         buttons=QMessageBox.Yes | QMessageBox.Cancel,
                         default_button=QMessageBox.Cancel, icon=QMessageBox.Warning) == QMessageBox.Yes:
            db_cursor = self.app_config.db_intf.get_cursor()
            try:
                db_cursor.execute('drop table proposals')
                db_cursor.execute('drop table voting_results')
                self.app_config.db_intf.create_structures()
            finally:
                self.app_config.db_intf.release_cursor()
            self.infoMsg('Proposals cache cleared.') 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:14,代码来源:main_dlg.py

示例12: on_btnDeleteMn_clicked

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def on_btnDeleteMn_clicked(self):
        if self.cur_masternode:
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Warning)
            msg.setText('Do you really want to delete current masternode configuration?')
            msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
            msg.setDefaultButton(QMessageBox.No)
            retval = msg.exec_()
            if retval == QMessageBox.No:
                return
            self.app_config.masternodes.remove(self.cur_masternode)
            self.cboMasternodes.removeItem(self.cboMasternodes.currentIndex())
            self.app_config.modified = True
            self.update_edit_controls_state() 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:16,代码来源:main_dlg.py

示例13: __init__

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def __init__(self, problems, *args):
        super().__init__(*args)
        self.setIcon(QMessageBox.Warning)
        self.setWindowTitle("Insufficient protocol")
        self.setText("The provided protocol is insufficient for this model.")
        self.setInformativeText("The reported problems are: \n{}".format('\n'.join(' - ' + str(p) for p in problems)))
        self._in_resize = False 
开发者ID:robbert-harms,项目名称:MDT,代码行数:9,代码来源:fit_model_tab.py

示例14: dwarning

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def dwarning(title, text, detailed_text, parent=None):
        """MessageBox with "Warning" icon"""
        QDetailedMessageBox.dgeneric(title,
                                     text,
                                     detailed_text,
                                     QMessageBox.Warning,
                                     parent) 
开发者ID:FrancescoCeruti,项目名称:linux-show-player,代码行数:9,代码来源:qmessagebox.py

示例15: display_error_box

# 需要导入模块: from PyQt5.QtWidgets import QMessageBox [as 别名]
# 或者: from PyQt5.QtWidgets.QMessageBox import Warning [as 别名]
def display_error_box(msg, title="Error"):
    msgbox = QMessageBox()
    msgbox.setIcon(QMessageBox.Warning)
    msgbox.setText(msg)
    msgbox.setWindowTitle(title)
    msgbox.setStandardButtons(QMessageBox.Ok)
    return msgbox.exec_() 
开发者ID:roglew,项目名称:guppy-proxy,代码行数:9,代码来源:util.py


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