本文整理汇总了Python中util.qui_utils.notify_error函数的典型用法代码示例。如果您正苦于以下问题:Python notify_error函数的具体用法?Python notify_error怎么用?Python notify_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了notify_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _on_new_message_alert
def _on_new_message_alert(self):
with qui_utils.notify_error(self._errorLog):
if self._app.alarmHandler.alarmType == self._app.alarmHandler.ALARM_APPLICATION:
if self._currentTab == self.MESSAGES_TAB or not self._app.ledHandler.isReal:
self._errorLog.push_message("New messages")
else:
self._app.ledHandler.on()
示例2: _on_window_resized
def _on_window_resized(self):
with qui_utils.notify_error(self._app.errorLog):
windowOrientation = self.idealWindowOrientation
if windowOrientation == QtCore.Qt.Horizontal:
self._tabWidget.setTabPosition(QtGui.QTabWidget.West)
else:
self._tabWidget.setTabPosition(QtGui.QTabWidget.South)
示例3: _on_row_activated
def _on_row_activated(self, index):
with qui_utils.notify_error(self._errorLog):
timeIndex = index.parent()
if not timeIndex.isValid():
return
timeRow = timeIndex.row()
row = index.row()
detailsItem = self._categoryManager.get_item(timeRow, row, self.DETAILS_IDX)
fromItem = self._categoryManager.get_item(timeRow, row, self.FROM_IDX)
contactDetails = detailsItem.data()
title = unicode(fromItem.text())
number = str(contactDetails["number"])
contactId = number # ids don't seem too unique so using numbers
descriptionRows = []
for t in xrange(self._itemStore.rowCount()):
randomTimeItem = self._itemStore.item(t, 0)
for i in xrange(randomTimeItem.rowCount()):
iItem = randomTimeItem.child(i, 0)
iContactDetails = iItem.data()
iNumber = str(iContactDetails["number"])
if number != iNumber:
continue
relTime = misc_utils.abbrev_relative_date(iContactDetails["relTime"])
action = str(iContactDetails["action"])
number = str(iContactDetails["number"])
prettyNumber = misc_utils.make_pretty(number)
rowItems = relTime, action, prettyNumber
descriptionRows.append("<tr><td>%s</td></tr>" % "</td><td>".join(rowItems))
description = "<table>%s</table>" % "".join(descriptionRows)
numbersWithDescriptions = [(str(contactDetails["number"]), "")]
self._session.draft.add_contact(contactId, None, title, description, numbersWithDescriptions)
示例4: _on_play_invalidated
def _on_play_invalidated(self):
with qui_utils.notify_error(self._app.errorLog):
self._playButton.show()
self._pauseButton.hide()
self._resumeButton.hide()
self._stopButton.hide()
self._invalidate_token()
示例5: _on_op_error
def _on_op_error(self, message):
with qui_utils.notify_error(self._app.errorLog):
self._smsEntry.setReadOnly(False)
self._cancelButton.setVisible(False)
self._smsButton.setVisible(True)
self._dialButton.setVisible(True)
self._errorLog.push_error(message)
示例6: _on_refresh_history
def _on_refresh_history(self):
with qui_utils.notify_error(self._app.errorLog):
draftContactsCount = self._session.draft.get_num_contacts()
if draftContactsCount != 1:
# Changing contact count will automatically refresh it
return
(cid, ) = self._session.draft.get_contacts()
self._update_history(cid)
示例7: _on_op_finished
def _on_op_finished(self):
with qui_utils.notify_error(self._app.errorLog):
self._smsEntry.setPlainText("")
self._smsEntry.setReadOnly(False)
self._cancelButton.setVisible(False)
self._smsButton.setVisible(True)
self._dialButton.setVisible(True)
self.close()
self.destroy()
示例8: _on_app_alert
def _on_app_alert(self):
with qui_utils.notify_error(self._errorLog):
if self._session.state == self._session.LOGGEDIN_STATE:
messageType = {
(True, True): self._session.MESSAGE_ALL,
(True, False): self._session.MESSAGE_TEXTS,
(False, True): self._session.MESSAGE_VOICEMAILS,
}[(self._app.notifyOnSms, self._app.notifyOnVoicemail)]
self._session.update_messages(messageType, force=True)
示例9: _on_sms_clicked
def _on_sms_clicked(self, checked = False):
with qui_utils.notify_error(self._errorLog):
number = misc_utils.make_ugly(str(self._entry.text()))
self._entry.clear()
contactId = number
title = misc_utils.make_pretty(number)
description = misc_utils.make_pretty(number)
numbersWithDescriptions = [(number, "")]
self._session.draft.add_contact(contactId, None, title, description, numbersWithDescriptions)
示例10: _on_import
def _on_import(self, checked = True):
with qui_utils.notify_error(self._errorLog):
csvName = QtGui.QFileDialog.getOpenFileName(self._window, caption="Import", filter="CSV Files (*.csv)")
csvName = unicode(csvName)
if not csvName:
return
import shutil
shutil.copy2(csvName, self._app.fsContactsPath)
if self._tabsContents[self.CONTACTS_TAB].has_child:
self._tabsContents[self.CONTACTS_TAB].child.update_addressbooks()
示例11: _on_row_activated
def _on_row_activated(self, index):
with qui_utils.notify_error(self._errorLog):
if index.column() == self._CLOSE_COLUMN:
self._historyStore.removeRow(index.row(), index.parent())
self._rowCount -= 1
elif index.column() == self._EQ_COLUMN:
self._duplicate_row(index)
elif index.column() == self._RESULT_COLUMN:
self._duplicate_row(index)
else:
raise NotImplementedError("Unsupported column to activate %s" % index.column())
示例12: _on_single_change_number
def _on_single_change_number(self, index):
with qui_utils.notify_error(self._app.errorLog):
# Exception thrown when the first item is removed
cid = self._cids[0]
try:
numbers = self._session.draft.get_numbers(cid)
except KeyError:
_moduleLogger.error("Contact no longer available (or bizarre error): %r (%r)" % (cid, index))
return
number = numbers[index][0]
self._session.draft.set_selected_number(cid, number)
示例13: _on_recipients_changed
def _on_recipients_changed(self):
with qui_utils.notify_error(self._errorLog):
if self._session.draft.get_num_contacts() == 0:
return
if self._smsEntryDialog is None:
import dialogs
self._smsEntryDialog = dialogs.SMSEntryWindow(self.window, self._app, self._session, self._errorLog)
self._smsEntryDialog.window.destroyed.connect(self._on_child_close)
self._smsEntryDialog.window.closed.connect(self._on_child_close)
self._smsEntryDialog.window.show()
示例14: _on_voicemail_save
def _on_voicemail_save(self, arg = None):
with qui_utils.notify_error(self._app.errorLog):
targetPath = QtGui.QFileDialog.getSaveFileName(None, caption="Save Voicemail", filter="Audio File (*.mp3)")
targetPath = unicode(targetPath)
if not targetPath:
return
(cid, ) = self._session.draft.get_contacts()
messageId = self._session.draft.get_message_id(cid)
sourcePath = self._session.voicemail_path(messageId)
import shutil
shutil.copy2(sourcePath, targetPath)
示例15: _on_voicemail_play
def _on_voicemail_play(self, arg = None):
with qui_utils.notify_error(self._app.errorLog):
(cid, ) = self._session.draft.get_contacts()
messageId = self._session.draft.get_message_id(cid)
sourcePath = self._session.voicemail_path(messageId)
self._invalidate_token()
uri = "file://%s" % sourcePath
self._token = self._app.streamHandler.set_file(uri)
self._token.stateChange.connect(self._on_play_state)
self._token.invalidated.connect(self._on_play_invalidated)
self._token.error.connect(self._on_play_error)
self._token.play()