From 9e27dd39b94a37594a2dd2ddeb48041a4a024fb8 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Thu, 28 Mar 2024 07:44:47 +0100 Subject: ✨ Updates will be automatically checked on startup and can also be checked manually. Version dialog is used to display update information. Fixes #76 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/ui/dialog_version.py | 130 ++++++++++++++++++-- tidal_dl_ng/ui/dialog_version.ui | 250 ++++++++++++++++++++++++++++++++------- tidal_dl_ng/ui/main.py | 10 +- tidal_dl_ng/ui/main.ui | 14 ++- 4 files changed, 352 insertions(+), 52 deletions(-) (limited to 'tidal_dl_ng/ui') 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", "", 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", "", 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 @@ 235 + + + 0 + 0 + + + + + 436 + 235 + + Version - - - - 190 - 100 - 61 - 16 - - - - v1.2.3 - - - - - - 160 - 200 - 251 - 20 - - - - <a href="https://github.com/exislow/tidal-dl-ng/">https://github.com/exislow/tidal-dl-ng/</a> - - - true - - - - - - 110 - 30 - 231 - 16 - - - - TIDAL Downloader Next Generation - - + + + + + + 0 + 0 + + + + + true + + + + TIDAL Downloader Next Generation! + + + Qt::AlignCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + + Installed Version: + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + true + + + + v1.2.3 + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + + + + + true + + + + ERROR + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + true + + + + <ERROR> + + + Qt::AlignCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + New Version Available: + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + true + + + + v0.0.0 + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + true + + + + Changelog + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + <CHANGELOG> + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + 20 + + + + + Download + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + <a href="https://github.com/exislow/tidal-dl-ng/">https://github.com/exislow/tidal-dl-ng/</a> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + 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 @@ File - + + + Help + + + + + @@ -619,6 +626,11 @@ Logout + + + Check for Updates + + -- cgit v1.3.1