Browse Source

changed license loading method

master 2.0
Rinaldus 7 years ago
parent
commit
127bbebe72
  1. 8
      mail-notifier.py
  2. 1
      resources.qrc
  3. 10955
      resources_rc.py
  4. 3
      ui/about.ui
  5. 3
      ui_about.py

8
mail-notifier.py

@ -20,7 +20,6 @@ import time @@ -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): @@ -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()

1
resources.qrc

@ -1,5 +1,6 @@ @@ -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>

10955
resources_rc.py

File diff suppressed because it is too large Load Diff

3
ui/about.ui

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

3
ui_about.py

@ -22,6 +22,7 @@ class Ui_about(object): @@ -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): @@ -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

Loading…
Cancel
Save