本文整理汇总了Python中PySide.QtGui.QComboBox.blockSignals方法的典型用法代码示例。如果您正苦于以下问题:Python QComboBox.blockSignals方法的具体用法?Python QComboBox.blockSignals怎么用?Python QComboBox.blockSignals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QComboBox
的用法示例。
在下文中一共展示了QComboBox.blockSignals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from PySide.QtGui import QComboBox [as 别名]
# 或者: from PySide.QtGui.QComboBox import blockSignals [as 别名]
#.........这里部分代码省略.........
self.settings_manager,
self.domain_edit)
def set_visibilities(self):
if len(self.domain_edit.lineEdit().text()) > 0:
self.username_label.setVisible(True)
self.username_edit.setVisible(True)
self.strength_label.setVisible(True)
self.strength_selector.setVisible(True)
self.password_label.setVisible(True)
self.password.setVisible(True)
else:
self.username_label.setVisible(False)
self.username_edit.setVisible(False)
self.strength_label.setVisible(False)
self.strength_selector.setVisible(False)
self.password_label.setVisible(False)
self.password.setVisible(False)
self.clipboard_button.setVisible(False)
def domain_changed(self):
self.setting_dirty = True
self.password.setText("")
self.clipboard_button.setVisible(False)
self.set_visibilities()
if self.kgk_manager.has_kgk() and (not self.decrypt_kgk_task or not self.decrypt_kgk_task.is_running()) and \
len(self.domain_edit.lineEdit().text()) > 0 and \
self.domain_edit.lineEdit().text() in self.settings_manager.get_domain_list():
self.domain_entered()
def domain_entered(self):
self.setting_dirty = self.domain_edit.lineEdit().text() not in self.settings_manager.get_domain_list()
self.setting = self.settings_manager.get_setting(self.domain_edit.lineEdit().text())
self.username_edit.blockSignals(True)
self.username_edit.setText(self.setting.get_username())
self.username_edit.blockSignals(False)
self.strength_selector.blockSignals(True)
self.strength_selector.set_length(self.setting.get_length())
self.strength_selector.set_complexity(self.setting.get_complexity())
self.strength_selector.set_extra_count(len(self.setting.get_extra_character_set()))
self.strength_selector.blockSignals(False)
self.generate_password()
def move_focus(self):
line_edits = [self.master_password_edit, self.domain_edit, self.username_edit]
for i, edit in enumerate(line_edits):
if edit.hasFocus() and i + 1 < len(line_edits):
line_edits[i + 1].setFocus()
return True
self.generate_button.setFocus()
def generate_password(self):
if not self.kgk_manager.has_kgk():
self.kgk_manager.create_new_kgk()
self.kgk_manager.create_and_save_new_kgk_block()
if not self.kgk_manager.kgk_crypter or not self.kgk_manager.salt:
self.kgk_manager.get_kgk_crypter(self.master_password_edit.text().encode('utf-8'),
self.kgk_manager.get_kgk_crypter_salt())
if self.setting_dirty:
self.setting.new_salt()
self.setting.calculate_template()
self.settings_manager.set_setting(self.setting)
if not self.setting.get_legacy_password():
generator = CtSesam(self.setting.get_domain(),
self.setting.get_username(),
self.kgk_manager.get_kgk(),