本文整理汇总了Python中PyKDE4.kdeui.KApplication.disconnect方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.disconnect方法的具体用法?Python KApplication.disconnect怎么用?Python KApplication.disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyKDE4.kdeui.KApplication
的用法示例。
在下文中一共展示了KApplication.disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Frontend
# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import disconnect [as 别名]
#.........这里部分代码省略.........
self.debconf_fd_counter = 0
self.socketNotifierRead = QSocketNotifier(from_debconf, QSocketNotifier.Read, self.app)
self.app.connect(self.socketNotifierRead, SIGNAL("activated(int)"), self.watch_debconf_fd_helper_read)
self.socketNotifierWrite = QSocketNotifier(from_debconf, QSocketNotifier.Write, self.app)
self.app.connect(self.socketNotifierWrite, SIGNAL("activated(int)"), self.watch_debconf_fd_helper_write)
self.socketNotifierException = QSocketNotifier(from_debconf, QSocketNotifier.Exception, self.app)
self.app.connect(self.socketNotifierException, SIGNAL("activated(int)"), self.watch_debconf_fd_helper_exception)
self.debconf_callbacks[from_debconf] = process_input
self.current_debconf_fd = from_debconf
def watch_debconf_fd_helper_read (self, source):
self.debconf_fd_counter += 1
debconf_condition = 0
debconf_condition |= filteredcommand.DEBCONF_IO_IN
self.debconf_callbacks[source](source, debconf_condition)
def watch_debconf_fd_helper_write(self, source):
debconf_condition = 0
debconf_condition |= filteredcommand.DEBCONF_IO_OUT
self.debconf_callbacks[source](source, debconf_condition)
def watch_debconf_fd_helper_exception(self, source):
debconf_condition = 0
debconf_condition |= filteredcommand.DEBCONF_IO_ERR
self.debconf_callbacks[source](source, debconf_condition)
def debconffilter_done (self, dbfilter):
##FIXME in Qt 4 without this disconnect it calls watch_debconf_fd_helper_read once more causing
## a crash after the keyboard stage. No idea why.
self.app.disconnect(self.socketNotifierRead, SIGNAL("activated(int)"), self.watch_debconf_fd_helper_read)
# TODO cjwatson 2006-02-10: handle dbfilter.status
self.app.disconnect(self.socketNotifierWrite, SIGNAL("activated(int)"), self.watch_debconf_fd_helper_write)
self.app.disconnect(self.socketNotifierException, SIGNAL("activated(int)"), self.watch_debconf_fd_helper_exception)
if BaseFrontend.debconffilter_done(self, dbfilter):
self.app.exit()
def error_dialog (self, title, msg):
self.allow_change_step(True)
# TODO: cancel button as well if capb backup
QMessageBox.warning(self.userinterface, title, msg, QMessageBox.Ok)
def question_dialog (self, title, msg, options, use_templates=True):
# I doubt we'll ever need more than three buttons.
assert len(options) <= 3, options
self.allow_change_step(True)
buttons = {}
messageBox = QMessageBox(QMessageBox.Question, title, msg, QMessageBox.NoButton, self.userinterface)
for option in options:
if use_templates:
text = self.get_string(option)
else:
text = option
if text is None:
text = option
# Convention for options is to have the affirmative action last; KDE
# convention is to have it first.
if option == options[-1]:
button = messageBox.addButton(text, QMessageBox.AcceptRole)
else:
button = messageBox.addButton(text, QMessageBox.RejectRole)
buttons[button] = option