version 1.0

This commit is contained in:
Rinaldus 2015-10-31 20:38:11 +03:00
parent 0ffa071746
commit 5bde21a5c7
10 changed files with 2240 additions and 41 deletions

View File

@ -2,8 +2,10 @@
This is Light weight mail notifier written in PyQt5. It checks your mailbox periodically and notify you if you have new mail. This is Light weight mail notifier written in PyQt5. It checks your mailbox periodically and notify you if you have new mail.
## Screenshot ## Screenshots
![Screenshot](https://raw.github.com/rinaldus/mail-notify/master/screenshot.jpg) ![MailboxEmpty](https://raw.github.com/rinaldus/mail-notify/master/screenshots/screen1.jpg)
![MailboxFull](https://raw.github.com/rinaldus/mail-notify/master/screenshots/screen1.jpg)
![Settings](https://raw.github.com/rinaldus/mail-notify/master/screenshots/screen3.jpg)
## Install ## Install
@ -16,6 +18,16 @@ Give execute permission to mail-notifier.py
```sh ```sh
$ chmod +x mail-notifier.py $ chmod +x mail-notifier.py
``` ```
## Todo
## Changelog
### Version 1.0 (release date: 31.10.15)
* Settings window * Settings window
* All parameters are stored in configuration file *(~/.config/mail-notify/settings.conf)*
* Many improvements
### Version 0.10 (pre release date: 28.10.15)
* Initial version
* All parameters are stored right in script
## Todo
* "About program" window * "About program" window

BIN
icons/settings.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -5,14 +5,32 @@ from PyQt5.QtWidgets import (QAction, QApplication, QCheckBox, QComboBox,
QDialog, QGridLayout, QGroupBox, QHBoxLayout, QLabel, QLineEdit, QDialog, QGridLayout, QGroupBox, QHBoxLayout, QLabel, QLineEdit,
QMessageBox, QMenu, QPushButton, QSpinBox, QStyle, QSystemTrayIcon, QMessageBox, QMenu, QPushButton, QSpinBox, QStyle, QSystemTrayIcon,
QTextEdit, QVBoxLayout) QTextEdit, QVBoxLayout)
from PyQt5.QtCore import (QThread, QTimer) from PyQt5.QtCore import (QThread, QTimer, QFile, QSettings)
import imaplib import imaplib
imaplib._MAXLINE = 400000
import subprocess import subprocess
import res import res
from ui_settings import Ui_Settings
from PyQt5 import QtCore, QtGui, QtWidgets
import os
import socket
import hashlib, uuid
#variables #variables
timers = [] timers = []
programTitle = "Mail Notifier" programTitle = "Mail Notifier"
settings = QSettings(os.path.expanduser("~")+"/.config/mail-notify/settings.conf", QSettings.NativeFormat)
def SettingsExist():
if ((settings.contains("CheckInterval") and settings.value("CheckInterval") != "") and
(settings.contains("Notify") and settings.value("Notify") != "") and
(settings.contains("MailServer") and settings.value("MailServer") != "") and
(settings.contains("Port") and settings.value("Port") != "") and
(settings.contains("Login") and settings.value("Login") != "") and
(settings.contains("Password") and settings.value("Password") != "") and
(settings.contains("SSL") and settings.value("SSL") != "")):
return True
else:
return False
class Window(QDialog): class Window(QDialog):
def __init__(self): def __init__(self):
@ -25,66 +43,138 @@ class Window(QDialog):
self.trayIcon.setIcon(QIcon(":icons/mailbox_empty.png")) self.trayIcon.setIcon(QIcon(":icons/mailbox_empty.png"))
self.trayIcon.setToolTip("You have no unread letters") self.trayIcon.setToolTip("You have no unread letters")
self.trayIcon.show() self.trayIcon.show()
# setup settings
self.ui = Ui_Settings()
self.ui.setupUi(self)
self.setWindowIcon(QIcon(os.path.dirname(os.path.realpath(__file__))+"/icons/mailbox_empty.png"))
self.SettingsRestore()
self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).clicked.connect(self.btnOK_clicked)
self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Cancel).clicked.connect(self.btnCancel_clicked)
self.ui.btnTestConnection.clicked.connect(self.btnTestConnection_clicked)
# Menu actions # Menu actions
def createActions(self): def createActions(self):
self.quitAction = QAction(QIcon(':icons/menu_quit.png'),"&Quit", self, self.quitAction = QAction(QIcon(':icons/menu_quit.png'),"&Quit", self,
triggered=QApplication.instance().quit) triggered=QApplication.instance().quit)
self.checkNow = QAction(QIcon(':icons/check_now.png'),"&Check now", self, self.checkNow = QAction(QIcon(':icons/check_now.png'),"&Check now", self,
triggered=self.checkNow) triggered=mail_check)
# self.restoreAction = QAction("&Restore", self, self.restoreAction = QAction(QIcon(":icons/settings.png"),"&Settings", self,
# triggered=self.showNormal) triggered=self.showNormal)
# UI functions # UI functions
def createTrayIcon(self): def createTrayIcon(self):
self.trayIconMenu = QMenu(self) self.trayIconMenu = QMenu(self)
self.trayIconMenu.addAction(self.checkNow) self.trayIconMenu.addAction(self.checkNow)
self.trayIconMenu.addAction(self.restoreAction)
self.trayIconMenu.addAction(self.quitAction) self.trayIconMenu.addAction(self.quitAction)
#self.trayIconMenu.addAction(self.restoreAction)
self.trayIcon = QSystemTrayIcon(self) self.trayIcon = QSystemTrayIcon(self)
self.trayIcon.setContextMenu(self.trayIconMenu) self.trayIcon.setContextMenu(self.trayIconMenu)
def SettingsRestore(self):
if SettingsExist():
self.ui.checkFreq.setValue(int(settings.value("CheckInterval")))
self.ui.boolifNotify.setChecked(bool(settings.value("Notify")))
self.ui.txtboxMailServer.setText(settings.value("MailServer"))
self.ui.txtboxPort.setText(settings.value("Port"))
self.ui.txtboxLogin.setText(settings.value("Login"))
self.ui.txtboxPassword.setText(settings.value("Password"))
self.ui.boolifSSL.setChecked(bool(settings.value("SSL")))
def SettingsSave(self):
settings.setValue("CheckInterval",self.ui.checkFreq.value())
settings.setValue("Notify", self.ui.boolifNotify.isChecked())
settings.setValue("MailServer",self.ui.txtboxMailServer.text())
settings.setValue("Port",self.ui.txtboxPort.text())
settings.setValue("Login",self.ui.txtboxLogin.text())
settings.setValue("Password",self.ui.txtboxPassword.text())
settings.setValue("SSL",self.ui.boolifSSL.isChecked())
def mailboxEmpty(self): def btnOK_clicked(self):
self.trayIcon.setToolTip ("You have no unread mail") self.SettingsSave()
self.trayIcon.setIcon(QIcon(":icons/mailbox_empty.png"))
if (settings.value("MailServer") == "" or settings.value("Port") == "" or settings.value("Login") == "" or settings.value("Password") == ""):
def mailboxFull(self): QMessageBox.critical(self, "Warning","You should fill all fields in IMAP settings!")
self.trayIcon.setToolTip ("You have "+ str(Mail().checkMail())+" unread letters") self.show()
self.trayIcon.setIcon(QIcon(":icons/mailbox_full.png")) mail_check()
notify ("You have "+ str(Mail().checkMail())+" unread letters") self.ui.lblTestOutput.setText("")
def checkNow (self): def btnCancel_clicked(self):
if Mail().checkMail() == 0: self.SettingsRestore()
self.mailboxEmpty() self.ui.lblTestOutput.setText("")
notify("You have no unread mail")
else: def btnTestConnection_clicked(self):
self.mailboxFull() try:
if self.ui.boolifSSL.isChecked:
self.imap = imaplib.IMAP4_SSL(self.ui.txtboxMailServer.text(), self.ui.txtboxPort.text())
else:
self.imap = imaplib.IMAP4(self.ui.txtboxMailServer.text(), self.ui.txtboxPort.text())
self.imap.login(self.ui.txtboxLogin.text(), self.ui.txtboxPassword.text())
output = "Connection was established successfully"
except:
output = "Unable to establish connection to mailbox"
finally:
self.ui.lblTestOutput.setText(output)
def closeEvent(self, event): def closeEvent(self, event):
print ("Closing the app") print ("Closing the app")
# Common functions # Common functions
class Mail(): class Mail():
def __init__(self): def __init__(self):
self.user= 'YOUR_MAILBOX_LOGIN' socket.setdefaulttimeout(5)
self.password= 'YOUR_MAILBOX_PASSWORD' self.user = settings.value("Login")
self.M = imaplib.IMAP4_SSL('MAIL_SERVER', 'PORT(i.e 993)') self.password = settings.value("Password")
self.M.login(self.user, self.password) self.mailserver = settings.value("MailServer")
self.port = settings.value("Port")
def login(self):
try:
if settings.value("SSL"):
self.imap = imaplib.IMAP4_SSL(self.mailserver, self.port)
else:
self.imap = imaplib.IMAP4(self.mailserver, self.port)
self.imap.login(self.user, self.password)
return True
except:
print("Login error")
return False
def checkMail(self): def checkMail(self):
self.M.select() try:
self.unRead = self.M.search(None, 'UnSeen') self.imap.select()
return len(self.unRead[1][0].split()) self.unRead = self.imap.search(None, 'UNSEEN')
return len(self.unRead[1][0].split())
except:
print("Unable to check mail")
return "ERROR"
def mail_check(): def mail_check():
if Mail().checkMail() == 0: if SettingsExist():
window.mailboxEmpty() m = Mail()
if m.login():
mail_count = m.checkMail()
if mail_count == 0:
window.trayIcon.setToolTip ("You have no unread mail")
window.trayIcon.setIcon(QIcon(":icons/mailbox_empty.png"))
else:
window.trayIcon.setToolTip ("You have "+ str(mail_count)+" unread letters")
window.trayIcon.setIcon(QIcon(":icons/mailbox_full.png"))
notify ("You have "+ str(mail_count) +" unread letters")
else:
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.")
else: else:
window.mailboxFull() window.trayIcon.setToolTip("Cannot find configuration file. You should give access to your mailbox")
def notify(message): def notify(message):
subprocess.Popen(['notify-send', programTitle, message]) if settings.value("Notify"):
subprocess.Popen(['notify-send', programTitle, message])
return return
def hash(password):
salt = uuid.uuid4().hex
return hashlib.sha512(password.encode('utf-8') + salt.encode('utf-8')).hexdigest()
class Thread(QThread): class Thread(QThread):
def __init__(self): def __init__(self):
@ -93,7 +183,11 @@ class Thread(QThread):
def run(self): def run(self):
timer = QTimer() timer = QTimer()
timer.timeout.connect(mail_check) timer.timeout.connect(mail_check)
timer.start(1000*60*5) if SettingsExist():
CheckInterval = 1000*60*int(settings.value("CheckInterval"))
else:
CheckInterval = 1000*60*5
timer.start(CheckInterval)
timers.append(timer) timers.append(timer)
self.exec_() self.exec_()
@ -107,7 +201,10 @@ if __name__ == '__main__':
sys.exit(1) sys.exit(1)
QApplication.setQuitOnLastWindowClosed(False) QApplication.setQuitOnLastWindowClosed(False)
window = Window() window = Window()
window.hide() if (SettingsExist() == True):
window.hide()
else:
window.show()
# UI started. Starting required functions after UI start # UI started. Starting required functions after UI start
mail_check() mail_check()
thread_instance = Thread() thread_instance = Thread()

1613
res.py

File diff suppressed because it is too large Load Diff

View File

@ -4,5 +4,6 @@
<file>icons/mailbox_full.png</file> <file>icons/mailbox_full.png</file>
<file>icons/menu_quit.png</file> <file>icons/menu_quit.png</file>
<file>icons/check_now.png</file> <file>icons/check_now.png</file>
<file>icons/settings.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

BIN
screenshots/screen2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
screenshots/screen3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

345
ui/settings.ui Normal file
View File

@ -0,0 +1,345 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Settings</class>
<widget class="QDialog" name="Settings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>585</width>
<height>282</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Mail Notify - Settings</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>../icons/mailbox_empty.png</normaloff>../icons/mailbox_empty.png</iconset>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>20</x>
<y>240</y>
<width>341</width>
<height>32</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QCheckBox" name="boolifNotify">
<property name="geometry">
<rect>
<x>21</x>
<y>42</y>
<width>231</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Use also pop-up notification</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>541</width>
<height>161</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>IMAP settings</string>
</property>
<widget class="QLineEdit" name="txtboxMailServer">
<property name="geometry">
<rect>
<x>90</x>
<y>30</y>
<width>181</width>
<height>22</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="placeholderText">
<string>mail.example.com</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>310</x>
<y>30</y>
<width>31</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Port</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>40</x>
<y>60</y>
<width>41</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Login</string>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>280</x>
<y>60</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Password</string>
</property>
</widget>
<widget class="QLineEdit" name="txtboxPassword">
<property name="geometry">
<rect>
<x>350</x>
<y>60</y>
<width>181</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="placeholderText">
<string/>
</property>
</widget>
<widget class="QLineEdit" name="txtboxLogin">
<property name="geometry">
<rect>
<x>90</x>
<y>60</y>
<width>181</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="placeholderText">
<string>name@example.com</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>11</x>
<y>31</y>
<width>71</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Mail server</string>
</property>
</widget>
<widget class="QLineEdit" name="txtboxPort">
<property name="geometry">
<rect>
<x>350</x>
<y>30</y>
<width>41</width>
<height>22</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="placeholderText">
<string>143</string>
</property>
</widget>
<widget class="QCheckBox" name="boolifSSL">
<property name="geometry">
<rect>
<x>10</x>
<y>90</y>
<width>161</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Use SSL connection</string>
</property>
</widget>
<widget class="QPushButton" name="btnTestConnection">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>10</x>
<y>120</y>
<width>121</width>
<height>22</height>
</rect>
</property>
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Test connection</string>
</property>
</widget>
<widget class="QLabel" name="lblTestOutput">
<property name="geometry">
<rect>
<x>150</x>
<y>120</y>
<width>371</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<zorder>txtboxPort</zorder>
<zorder>txtboxMailServer</zorder>
<zorder>label_4</zorder>
<zorder>label_3</zorder>
<zorder>label_5</zorder>
<zorder>label_6</zorder>
<zorder>txtboxPassword</zorder>
<zorder>txtboxLogin</zorder>
<zorder>boolifSSL</zorder>
<zorder>btnTestConnection</zorder>
<zorder>lblTestOutput</zorder>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>181</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Check for unread mail every</string>
</property>
</widget>
<widget class="QSpinBox" name="checkFreq">
<property name="geometry">
<rect>
<x>200</x>
<y>15</y>
<width>52</width>
<height>23</height>
</rect>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>120</number>
</property>
<property name="value">
<number>15</number>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>260</x>
<y>20</y>
<width>61</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>minutes</string>
</property>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Settings</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Settings</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

137
ui_settings.py Normal file
View File

@ -0,0 +1,137 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/settings.ui'
#
# Created by: PyQt5 UI code generator 5.5
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Settings(object):
def setupUi(self, Settings):
Settings.setObjectName("Settings")
Settings.resize(585, 282)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Settings.sizePolicy().hasHeightForWidth())
Settings.setSizePolicy(sizePolicy)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("../icons/mailbox_empty.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Settings.setWindowIcon(icon)
self.buttonBox = QtWidgets.QDialogButtonBox(Settings)
self.buttonBox.setGeometry(QtCore.QRect(20, 240, 341, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.boolifNotify = QtWidgets.QCheckBox(Settings)
self.boolifNotify.setGeometry(QtCore.QRect(21, 42, 231, 20))
self.boolifNotify.setChecked(True)
self.boolifNotify.setObjectName("boolifNotify")
self.groupBox = QtWidgets.QGroupBox(Settings)
self.groupBox.setGeometry(QtCore.QRect(20, 70, 541, 161))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
self.groupBox.setSizePolicy(sizePolicy)
self.groupBox.setObjectName("groupBox")
self.txtboxMailServer = QtWidgets.QLineEdit(self.groupBox)
self.txtboxMailServer.setGeometry(QtCore.QRect(90, 30, 181, 22))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.txtboxMailServer.sizePolicy().hasHeightForWidth())
self.txtboxMailServer.setSizePolicy(sizePolicy)
self.txtboxMailServer.setText("")
self.txtboxMailServer.setObjectName("txtboxMailServer")
self.label_4 = QtWidgets.QLabel(self.groupBox)
self.label_4.setGeometry(QtCore.QRect(310, 30, 31, 21))
self.label_4.setObjectName("label_4")
self.label_5 = QtWidgets.QLabel(self.groupBox)
self.label_5.setGeometry(QtCore.QRect(40, 60, 41, 21))
self.label_5.setObjectName("label_5")
self.label_6 = QtWidgets.QLabel(self.groupBox)
self.label_6.setGeometry(QtCore.QRect(280, 60, 61, 21))
self.label_6.setObjectName("label_6")
self.txtboxPassword = QtWidgets.QLineEdit(self.groupBox)
self.txtboxPassword.setGeometry(QtCore.QRect(350, 60, 181, 22))
self.txtboxPassword.setText("")
self.txtboxPassword.setEchoMode(QtWidgets.QLineEdit.Password)
self.txtboxPassword.setPlaceholderText("")
self.txtboxPassword.setObjectName("txtboxPassword")
self.txtboxLogin = QtWidgets.QLineEdit(self.groupBox)
self.txtboxLogin.setGeometry(QtCore.QRect(90, 60, 181, 22))
self.txtboxLogin.setText("")
self.txtboxLogin.setObjectName("txtboxLogin")
self.label_3 = QtWidgets.QLabel(self.groupBox)
self.label_3.setGeometry(QtCore.QRect(11, 31, 71, 21))
self.label_3.setObjectName("label_3")
self.txtboxPort = QtWidgets.QLineEdit(self.groupBox)
self.txtboxPort.setGeometry(QtCore.QRect(350, 30, 41, 22))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.txtboxPort.sizePolicy().hasHeightForWidth())
self.txtboxPort.setSizePolicy(sizePolicy)
self.txtboxPort.setText("")
self.txtboxPort.setObjectName("txtboxPort")
self.boolifSSL = QtWidgets.QCheckBox(self.groupBox)
self.boolifSSL.setGeometry(QtCore.QRect(10, 90, 161, 20))
self.boolifSSL.setObjectName("boolifSSL")
self.btnTestConnection = QtWidgets.QPushButton(self.groupBox)
self.btnTestConnection.setEnabled(True)
self.btnTestConnection.setGeometry(QtCore.QRect(10, 120, 121, 22))
self.btnTestConnection.setToolTip("")
self.btnTestConnection.setObjectName("btnTestConnection")
self.lblTestOutput = QtWidgets.QLabel(self.groupBox)
self.lblTestOutput.setGeometry(QtCore.QRect(150, 120, 371, 21))
self.lblTestOutput.setText("")
self.lblTestOutput.setObjectName("lblTestOutput")
self.txtboxPort.raise_()
self.txtboxMailServer.raise_()
self.label_4.raise_()
self.label_3.raise_()
self.label_5.raise_()
self.label_6.raise_()
self.txtboxPassword.raise_()
self.txtboxLogin.raise_()
self.boolifSSL.raise_()
self.btnTestConnection.raise_()
self.lblTestOutput.raise_()
self.label = QtWidgets.QLabel(Settings)
self.label.setGeometry(QtCore.QRect(20, 20, 181, 16))
self.label.setObjectName("label")
self.checkFreq = QtWidgets.QSpinBox(Settings)
self.checkFreq.setGeometry(QtCore.QRect(200, 15, 52, 23))
self.checkFreq.setMinimum(1)
self.checkFreq.setMaximum(120)
self.checkFreq.setProperty("value", 15)
self.checkFreq.setObjectName("checkFreq")
self.label_2 = QtWidgets.QLabel(Settings)
self.label_2.setGeometry(QtCore.QRect(260, 20, 61, 16))
self.label_2.setObjectName("label_2")
self.retranslateUi(Settings)
self.buttonBox.accepted.connect(Settings.accept)
self.buttonBox.rejected.connect(Settings.reject)
QtCore.QMetaObject.connectSlotsByName(Settings)
def retranslateUi(self, Settings):
_translate = QtCore.QCoreApplication.translate
Settings.setWindowTitle(_translate("Settings", "Mail Notify - Settings"))
self.boolifNotify.setText(_translate("Settings", "Use also pop-up notification"))
self.groupBox.setTitle(_translate("Settings", "IMAP settings"))
self.txtboxMailServer.setPlaceholderText(_translate("Settings", "mail.example.com"))
self.label_4.setText(_translate("Settings", "Port"))
self.label_5.setText(_translate("Settings", "Login"))
self.label_6.setText(_translate("Settings", "Password"))
self.txtboxLogin.setPlaceholderText(_translate("Settings", "name@example.com"))
self.label_3.setText(_translate("Settings", "Mail server"))
self.txtboxPort.setPlaceholderText(_translate("Settings", "143"))
self.boolifSSL.setText(_translate("Settings", "Use SSL connection"))
self.btnTestConnection.setText(_translate("Settings", "Test connection"))
self.label.setText(_translate("Settings", "Check for unread mail every"))
self.label_2.setText(_translate("Settings", "minutes"))