fixed bugs with error outputs
This commit is contained in:
parent
6a1dba2aae
commit
2ee5a40de7
|
@ -180,7 +180,7 @@ class Window(QDialog):
|
||||||
self.ui.lblTestOutput.setText("Acount saved")
|
self.ui.lblTestOutput.setText("Acount saved")
|
||||||
|
|
||||||
def btnRemoveAccount_clicked(self):
|
def btnRemoveAccount_clicked(self):
|
||||||
reply = QMessageBox.critical(self, 'Warning!', "Delete this account permanently?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
reply = QMessageBox.warning(self, 'Warning!', "Delete this account permanently?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
||||||
if (reply == QMessageBox.Yes):
|
if (reply == QMessageBox.Yes):
|
||||||
Index = self.ui.comboAccounts.currentIndex()
|
Index = self.ui.comboAccounts.currentIndex()
|
||||||
GroupName = self.ui.comboAccounts.currentText()
|
GroupName = self.ui.comboAccounts.currentText()
|
||||||
|
@ -260,19 +260,25 @@ def mail_check():
|
||||||
else:
|
else:
|
||||||
mail_count += m.checkMail()
|
mail_count += m.checkMail()
|
||||||
else:
|
else:
|
||||||
window.trayIcon.setToolTip("Unable to establish connection to mailbox. Check your mail settings and make sure that you have not network problems.")
|
mail_count = "CONNECTION_ERROR"
|
||||||
notify("Unable to establish connection to mailbox. Check your mail settings and make sure that you have not network problems.")
|
|
||||||
window.trayIcon.setIcon(QIcon(":icons/mailbox_error.png"))
|
|
||||||
else:
|
else:
|
||||||
window.trayIcon.setIcon(QIcon(":icons/mailbox_error.png"))
|
mail_count = "CONFIGURATION_ERROR"
|
||||||
window.trayIcon.setToolTip("Cannot find configuration file. You should give access to your mailbox")
|
|
||||||
|
|
||||||
|
# Parsing mail_count values
|
||||||
|
|
||||||
if mail_count == 0:
|
if mail_count == 0:
|
||||||
window.trayIcon.setToolTip ("You have no unread mail")
|
window.trayIcon.setToolTip ("You have no unread mail")
|
||||||
window.trayIcon.setIcon(QIcon(":icons/mailbox_empty.png"))
|
window.trayIcon.setIcon(QIcon(":icons/mailbox_empty.png"))
|
||||||
elif mail_count == "ERROR":
|
elif mail_count == "ERROR":
|
||||||
window.trayIcon.setIcon(QIcon(":icons/mailbox_error.png"))
|
window.trayIcon.setIcon(QIcon(":icons/mailbox_error.png"))
|
||||||
window.trayIcon.setToolTip ("Error checking mail.")
|
window.trayIcon.setToolTip ("Error checking mail.")
|
||||||
|
elif mail_count == "CONNECTION_ERROR":
|
||||||
|
window.trayIcon.setToolTip("Unable to establish connection to mailbox. Check your mail settings and make sure that you have not network problems.")
|
||||||
|
notify("Unable to establish connection to mailbox. Check your mail settings and make sure that you have not network problems.")
|
||||||
|
window.trayIcon.setIcon(QIcon(":icons/mailbox_error.png"))
|
||||||
|
elif mail_count == "CONFIGURATION_ERROR":
|
||||||
|
window.trayIcon.setIcon(QIcon(":icons/mailbox_error.png"))
|
||||||
|
window.trayIcon.setToolTip("Cannot find configuration file. You should give access to your mailbox")
|
||||||
else:
|
else:
|
||||||
window.trayIcon.setToolTip ("You have "+ str(mail_count)+" unread letters")
|
window.trayIcon.setToolTip ("You have "+ str(mail_count)+" unread letters")
|
||||||
window.trayIcon.setIcon(QIcon(":icons/mailbox_full.png"))
|
window.trayIcon.setIcon(QIcon(":icons/mailbox_full.png"))
|
||||||
|
|
Loading…
Reference in New Issue