changed license loading method

This commit is contained in:
Rinaldus 2016-03-23 13:51:54 +03:00
parent c069562b18
commit 127bbebe72
5 changed files with 2578 additions and 2470 deletions

View File

@ -20,7 +20,6 @@ import time
#variables #variables
programTitle = "Mail Notifier" programTitle = "Mail Notifier"
programVersion = "2.0" programVersion = "2.0"
programDir=os.path.dirname(__file__)
settings = QSettings(os.path.expanduser("~")+"/.config/mail-notifier/settings.conf", QSettings.NativeFormat) settings = QSettings(os.path.expanduser("~")+"/.config/mail-notifier/settings.conf", QSettings.NativeFormat)
def GlobalSettingsExist(): def GlobalSettingsExist():
if ((settings.contains("CheckInterval") and settings.value("CheckInterval") != "") and if ((settings.contains("CheckInterval") and settings.value("CheckInterval") != "") and
@ -226,8 +225,11 @@ class About(QDialog):
self.ui.lblNameVersion.setText(programTitle + " " + programVersion) self.ui.lblNameVersion.setText(programTitle + " " + programVersion)
f = open(os.path.join(programDir,'LICENSE.txt'), 'r') f = QtCore.QFile(":/LICENSE.txt")
self.ui.txtLicense.setPlainText(f.read()) if f.open(QtCore.QIODevice.ReadOnly | QtCore.QFile.Text):
text = QtCore.QTextStream(f).readAll()
f.close()
self.ui.txtLicense.setPlainText(text)
def closeEvent(self, event): def closeEvent(self, event):
event.ignore() event.ignore()

View File

@ -1,5 +1,6 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>LICENSE.txt</file>
<file>icons/save_account.png</file> <file>icons/save_account.png</file>
<file>icons/mailbox_empty.png</file> <file>icons/mailbox_empty.png</file>
<file>icons/mailbox_full.png</file> <file>icons/mailbox_full.png</file>

File diff suppressed because it is too large Load Diff

View File

@ -32,6 +32,9 @@
<height>201</height> <height>201</height>
</rect> </rect>
</property> </property>
<property name="plainText">
<string/>
</property>
</widget> </widget>
<widget class="QLabel" name="lblLogo"> <widget class="QLabel" name="lblLogo">
<property name="geometry"> <property name="geometry">

View File

@ -22,6 +22,7 @@ class Ui_about(object):
about.setWindowIcon(icon) about.setWindowIcon(icon)
self.txtLicense = QtWidgets.QPlainTextEdit(about) self.txtLicense = QtWidgets.QPlainTextEdit(about)
self.txtLicense.setGeometry(QtCore.QRect(50, 120, 381, 201)) self.txtLicense.setGeometry(QtCore.QRect(50, 120, 381, 201))
self.txtLicense.setPlainText("")
self.txtLicense.setObjectName("txtLicense") self.txtLicense.setObjectName("txtLicense")
self.lblLogo = QtWidgets.QLabel(about) self.lblLogo = QtWidgets.QLabel(about)
self.lblLogo.setGeometry(QtCore.QRect(50, 0, 131, 111)) self.lblLogo.setGeometry(QtCore.QRect(50, 0, 131, 111))
@ -46,6 +47,6 @@ class Ui_about(object):
def retranslateUi(self, about): def retranslateUi(self, about):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
about.setWindowTitle(_translate("about", "Mail Notifier")) about.setWindowTitle(_translate("about", "Mail Notifier"))
self.lblNameVersion.setText(_translate("about", "Mail Notifier 2.0")) self.lblNameVersion.setText(_translate("about", "Mail Notifier"))
import resources_rc import resources_rc