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
programTitle = "Mail Notifier"
programVersion = "2.0"
programDir=os.path.dirname(__file__)
settings = QSettings(os.path.expanduser("~")+"/.config/mail-notifier/settings.conf", QSettings.NativeFormat)
def GlobalSettingsExist():
if ((settings.contains("CheckInterval") and settings.value("CheckInterval") != "") and
@ -226,8 +225,11 @@ class About(QDialog):
self.ui.lblNameVersion.setText(programTitle + " " + programVersion)
f = open(os.path.join(programDir,'LICENSE.txt'), 'r')
self.ui.txtLicense.setPlainText(f.read())
f = QtCore.QFile(":/LICENSE.txt")
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):
event.ignore()

View File

@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
<file>LICENSE.txt</file>
<file>icons/save_account.png</file>
<file>icons/mailbox_empty.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>
</rect>
</property>
<property name="plainText">
<string/>
</property>
</widget>
<widget class="QLabel" name="lblLogo">
<property name="geometry">

View File

@ -22,6 +22,7 @@ class Ui_about(object):
about.setWindowIcon(icon)
self.txtLicense = QtWidgets.QPlainTextEdit(about)
self.txtLicense.setGeometry(QtCore.QRect(50, 120, 381, 201))
self.txtLicense.setPlainText("")
self.txtLicense.setObjectName("txtLicense")
self.lblLogo = QtWidgets.QLabel(about)
self.lblLogo.setGeometry(QtCore.QRect(50, 0, 131, 111))
@ -46,6 +47,6 @@ class Ui_about(object):
def retranslateUi(self, about):
_translate = QtCore.QCoreApplication.translate
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