diff options
| author | Robert Honz <exislow+github@gmail.com> | 2024-03-28 07:44:47 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2024-03-28 07:44:47 +0100 |
| commit | 9e27dd39b94a37594a2dd2ddeb48041a4a024fb8 (patch) | |
| tree | 923c17d40f26ea7826d673688770e022507b2861 /tidal_dl_ng/ui | |
| parent | 1ab71a45d385cc51d65ab04d71989e2906588509 (diff) | |
| download | tidal-dl-ng-9e27dd39b94a37594a2dd2ddeb48041a4a024fb8.tar.gz | |
✨ Updates will be automatically checked on startup and can also be checked manually. Version dialog is used to display update information. Fixes #76
Diffstat (limited to 'tidal_dl_ng/ui')
| -rw-r--r-- | tidal_dl_ng/ui/dialog_version.py | 130 | ||||
| -rw-r--r-- | tidal_dl_ng/ui/dialog_version.ui | 250 | ||||
| -rw-r--r-- | tidal_dl_ng/ui/main.py | 10 | ||||
| -rw-r--r-- | tidal_dl_ng/ui/main.ui | 14 |
4 files changed, 352 insertions, 52 deletions
diff --git a/tidal_dl_ng/ui/dialog_version.py b/tidal_dl_ng/ui/dialog_version.py index 52556c3..b8cf294 100644 --- a/tidal_dl_ng/ui/dialog_version.py +++ b/tidal_dl_ng/ui/dialog_version.py @@ -6,8 +6,9 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from PySide6.QtCore import QCoreApplication, QMetaObject, QRect -from PySide6.QtWidgets import QLabel +from PySide6.QtCore import QCoreApplication, QMetaObject, QSize, Qt +from PySide6.QtGui import QFont +from PySide6.QtWidgets import QHBoxLayout, QLabel, QPushButton, QSizePolicy, QSpacerItem, QVBoxLayout class Ui_DialogVersion: @@ -15,16 +16,121 @@ class Ui_DialogVersion: if not DialogVersion.objectName(): DialogVersion.setObjectName("DialogVersion") DialogVersion.resize(436, 235) + sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(DialogVersion.sizePolicy().hasHeightForWidth()) + DialogVersion.setSizePolicy(sizePolicy) + DialogVersion.setMaximumSize(QSize(436, 235)) + self.verticalLayout = QVBoxLayout(DialogVersion) + self.verticalLayout.setObjectName("verticalLayout") + self.l_name_app = QLabel(DialogVersion) + self.l_name_app.setObjectName("l_name_app") + sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) + sizePolicy1.setHorizontalStretch(0) + sizePolicy1.setVerticalStretch(0) + sizePolicy1.setHeightForWidth(self.l_name_app.sizePolicy().hasHeightForWidth()) + self.l_name_app.setSizePolicy(sizePolicy1) + font = QFont() + font.setBold(True) + self.l_name_app.setFont(font) + self.l_name_app.setAlignment(Qt.AlignCenter) + self.l_name_app.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.verticalLayout.addWidget(self.l_name_app) + + self.lv_version = QVBoxLayout() + self.lv_version.setObjectName("lv_version") + self.lh_version = QHBoxLayout() + self.lh_version.setObjectName("lh_version") + self.l_h_version = QLabel(DialogVersion) + self.l_h_version.setObjectName("l_h_version") + self.l_h_version.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.lh_version.addWidget(self.l_h_version) + self.l_version = QLabel(DialogVersion) self.l_version.setObjectName("l_version") - self.l_version.setGeometry(QRect(190, 100, 61, 16)) + self.l_version.setFont(font) + self.l_version.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.lh_version.addWidget(self.l_version) + + self.lv_version.addLayout(self.lh_version) + + self.verticalLayout.addLayout(self.lv_version) + + self.lv_update = QVBoxLayout() + self.lv_update.setObjectName("lv_update") + self.l_error = QLabel(DialogVersion) + self.l_error.setObjectName("l_error") + self.l_error.setFont(font) + self.l_error.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.lv_update.addWidget(self.l_error) + + self.l_error_details = QLabel(DialogVersion) + self.l_error_details.setObjectName("l_error_details") + self.l_error_details.setFont(font) + self.l_error_details.setAlignment(Qt.AlignCenter) + self.l_error_details.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.lv_update.addWidget(self.l_error_details) + + self.lh_update_version = QHBoxLayout() + self.lh_update_version.setObjectName("lh_update_version") + self.l_h_version_new = QLabel(DialogVersion) + self.l_h_version_new.setObjectName("l_h_version_new") + self.l_h_version_new.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.lh_update_version.addWidget(self.l_h_version_new) + + self.l_version_new = QLabel(DialogVersion) + self.l_version_new.setObjectName("l_version_new") + self.l_version_new.setFont(font) + self.l_version_new.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.lh_update_version.addWidget(self.l_version_new) + + self.lv_update.addLayout(self.lh_update_version) + + self.l_changelog = QLabel(DialogVersion) + self.l_changelog.setObjectName("l_changelog") + self.l_changelog.setFont(font) + self.l_changelog.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.lv_update.addWidget(self.l_changelog) + + self.l_changelog_details = QLabel(DialogVersion) + self.l_changelog_details.setObjectName("l_changelog_details") + self.l_changelog_details.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.lv_update.addWidget(self.l_changelog_details) + + self.lv_download = QHBoxLayout() + self.lv_download.setObjectName("lv_download") + self.lv_download.setContentsMargins(-1, 20, -1, -1) + self.pb_download = QPushButton(DialogVersion) + self.pb_download.setObjectName("pb_download") + self.pb_download.setFlat(False) + + self.lv_download.addWidget(self.pb_download) + + self.sh_download = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) + + self.lv_download.addItem(self.sh_download) + + self.lv_update.addLayout(self.lv_download) + + self.verticalLayout.addLayout(self.lv_update) + self.l_url_github = QLabel(DialogVersion) self.l_url_github.setObjectName("l_url_github") - self.l_url_github.setGeometry(QRect(160, 200, 251, 20)) + self.l_url_github.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.l_url_github.setOpenExternalLinks(True) - self.l_name_app = QLabel(DialogVersion) - self.l_name_app.setObjectName("l_name_app") - self.l_name_app.setGeometry(QRect(110, 30, 231, 16)) + self.l_url_github.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse) + + self.verticalLayout.addWidget(self.l_url_github) self.retranslateUi(DialogVersion) @@ -34,7 +140,16 @@ class Ui_DialogVersion: def retranslateUi(self, DialogVersion): DialogVersion.setWindowTitle(QCoreApplication.translate("DialogVersion", "Version", None)) + self.l_name_app.setText(QCoreApplication.translate("DialogVersion", "TIDAL Downloader Next Generation!", None)) + self.l_h_version.setText(QCoreApplication.translate("DialogVersion", "Installed Version:", None)) self.l_version.setText(QCoreApplication.translate("DialogVersion", "v1.2.3", None)) + self.l_error.setText(QCoreApplication.translate("DialogVersion", "ERROR", None)) + self.l_error_details.setText(QCoreApplication.translate("DialogVersion", "<ERROR>", None)) + self.l_h_version_new.setText(QCoreApplication.translate("DialogVersion", "New Version Available:", None)) + self.l_version_new.setText(QCoreApplication.translate("DialogVersion", "v0.0.0", None)) + self.l_changelog.setText(QCoreApplication.translate("DialogVersion", "Changelog", None)) + self.l_changelog_details.setText(QCoreApplication.translate("DialogVersion", "<CHANGELOG>", None)) + self.pb_download.setText(QCoreApplication.translate("DialogVersion", "Download", None)) self.l_url_github.setText( QCoreApplication.translate( "DialogVersion", @@ -42,6 +157,5 @@ class Ui_DialogVersion: None, ) ) - self.l_name_app.setText(QCoreApplication.translate("DialogVersion", "TIDAL Downloader Next Generation", None)) # retranslateUi diff --git a/tidal_dl_ng/ui/dialog_version.ui b/tidal_dl_ng/ui/dialog_version.ui index e061f75..0cea9bd 100644 --- a/tidal_dl_ng/ui/dialog_version.ui +++ b/tidal_dl_ng/ui/dialog_version.ui @@ -10,51 +10,217 @@ <height>235</height> </rect> </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>436</width> + <height>235</height> + </size> + </property> <property name="windowTitle"> <string>Version</string> </property> - <widget class="QLabel" name="l_version"> - <property name="geometry"> - <rect> - <x>190</x> - <y>100</y> - <width>61</width> - <height>16</height> - </rect> - </property> - <property name="text"> - <string>v1.2.3</string> - </property> - </widget> - <widget class="QLabel" name="l_url_github"> - <property name="geometry"> - <rect> - <x>160</x> - <y>200</y> - <width>251</width> - <height>20</height> - </rect> - </property> - <property name="text"> - <string><a href="https://github.com/exislow/tidal-dl-ng/">https://github.com/exislow/tidal-dl-ng/</a></string> - </property> - <property name="openExternalLinks"> - <bool>true</bool> - </property> - </widget> - <widget class="QLabel" name="l_name_app"> - <property name="geometry"> - <rect> - <x>110</x> - <y>30</y> - <width>231</width> - <height>16</height> - </rect> - </property> - <property name="text"> - <string>TIDAL Downloader Next Generation</string> - </property> - </widget> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="l_name_app"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>TIDAL Downloader Next Generation!</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="lv_version"> + <item> + <layout class="QHBoxLayout" name="lh_version"> + <item> + <widget class="QLabel" name="l_h_version"> + <property name="text"> + <string>Installed Version:</string> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="l_version"> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>v1.2.3</string> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="lv_update"> + <item> + <widget class="QLabel" name="l_error"> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>ERROR</string> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="l_error_details"> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string><ERROR></string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="lh_update_version"> + <item> + <widget class="QLabel" name="l_h_version_new"> + <property name="text"> + <string>New Version Available:</string> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="l_version_new"> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>v0.0.0</string> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="l_changelog"> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Changelog</string> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="l_changelog_details"> + <property name="text"> + <string><CHANGELOG></string> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="lv_download"> + <property name="topMargin"> + <number>20</number> + </property> + <item> + <widget class="QPushButton" name="pb_download"> + <property name="text"> + <string>Download</string> + </property> + <property name="flat"> + <bool>false</bool> + </property> + </widget> + </item> + <item> + <spacer name="sh_download"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="l_url_github"> + <property name="text"> + <string><a href="https://github.com/exislow/tidal-dl-ng/">https://github.com/exislow/tidal-dl-ng/</a></string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + <property name="textInteractionFlags"> + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> </widget> <resources/> <connections/> diff --git a/tidal_dl_ng/ui/main.py b/tidal_dl_ng/ui/main.py index 5f0ef0a..bd21113 100644 --- a/tidal_dl_ng/ui/main.py +++ b/tidal_dl_ng/ui/main.py @@ -53,6 +53,8 @@ class Ui_MainWindow: self.a_exit.setObjectName("a_exit") self.a_logout = QAction(MainWindow) self.a_logout.setObjectName("a_logout") + self.a_updates_check = QAction(MainWindow) + self.a_updates_check.setObjectName("a_updates_check") self.w_central = QWidget(MainWindow) self.w_central.setObjectName("w_central") self.w_central.setEnabled(True) @@ -418,6 +420,8 @@ class Ui_MainWindow: # if QT_CONFIG(accessibility) self.m_file.setAccessibleDescription("") # endif // QT_CONFIG(accessibility) + self.m_help = QMenu(self.menubar) + self.m_help.setObjectName("m_help") MainWindow.setMenuBar(self.menubar) self.statusbar = QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") @@ -440,10 +444,12 @@ class Ui_MainWindow: MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.m_file.menuAction()) + self.menubar.addAction(self.m_help.menuAction()) self.m_file.addAction(self.a_preferences) - self.m_file.addAction(self.a_version) self.m_file.addAction(self.a_logout) self.m_file.addAction(self.a_exit) + self.m_help.addAction(self.a_version) + self.m_help.addAction(self.a_updates_check) self.retranslateUi(MainWindow) @@ -456,6 +462,7 @@ class Ui_MainWindow: self.a_version.setText(QCoreApplication.translate("MainWindow", "Version", None)) self.a_exit.setText(QCoreApplication.translate("MainWindow", "Exit", None)) self.a_logout.setText(QCoreApplication.translate("MainWindow", "Logout", None)) + self.a_updates_check.setText(QCoreApplication.translate("MainWindow", "Check for Updates", None)) ___qtreewidgetitem = self.tr_lists_user.headerItem() ___qtreewidgetitem.setText(2, QCoreApplication.translate("MainWindow", "obj", None)) @@ -479,5 +486,6 @@ class Ui_MainWindow: ___qtreewidgetitem4.setText(0, QCoreApplication.translate("MainWindow", "#", None)) self.te_debug.setPlaceholderText(QCoreApplication.translate("MainWindow", "Logs...", None)) self.m_file.setTitle(QCoreApplication.translate("MainWindow", "File", None)) + self.m_help.setTitle(QCoreApplication.translate("MainWindow", "Help", None)) # retranslateUi diff --git a/tidal_dl_ng/ui/main.ui b/tidal_dl_ng/ui/main.ui index 26b7270..8bfe727 100644 --- a/tidal_dl_ng/ui/main.ui +++ b/tidal_dl_ng/ui/main.ui @@ -558,11 +558,18 @@ <string>File</string> </property> <addaction name="a_preferences"/> - <addaction name="a_version"/> <addaction name="a_logout"/> <addaction name="a_exit"/> </widget> + <widget class="QMenu" name="m_help"> + <property name="title"> + <string>Help</string> + </property> + <addaction name="a_version"/> + <addaction name="a_updates_check"/> + </widget> <addaction name="m_file"/> + <addaction name="m_help"/> </widget> <widget class="QStatusBar" name="statusbar"> <property name="toolTip"> @@ -619,6 +626,11 @@ <string>Logout</string> </property> </action> + <action name="a_updates_check"> + <property name="text"> + <string>Check for Updates</string> + </property> + </action> </widget> <resources/> <connections/> |
