diff options
| author | Robert Honz <exislow+github@gmail.com> | 2024-11-12 19:15:33 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2024-11-12 19:15:33 +0100 |
| commit | 618b16257b6f398345bac467aa2706f7385ff577 (patch) | |
| tree | fca209e4983e81cc2ae3a64ef4731051ee794a7e /tidal_dl_ng/ui | |
| parent | 4cef07b08f16410f56fa53a34884ce3b5dd6b64e (diff) | |
| download | tidal-dl-ng-618b16257b6f398345bac467aa2706f7385ff577.tar.gz | |
✨ Backend and GUI changed to device login. Login dialog needs to be threaded / non blocking.
Diffstat (limited to 'tidal_dl_ng/ui')
| -rw-r--r-- | tidal_dl_ng/ui/dialog_login.py | 92 | ||||
| -rw-r--r-- | tidal_dl_ng/ui/dialog_login.ui | 43 |
2 files changed, 88 insertions, 47 deletions
diff --git a/tidal_dl_ng/ui/dialog_login.py b/tidal_dl_ng/ui/dialog_login.py index bbc916f..d30ca6c 100644 --- a/tidal_dl_ng/ui/dialog_login.py +++ b/tidal_dl_ng/ui/dialog_login.py @@ -1,42 +1,51 @@ +# -*- coding: utf-8 -*- + ################################################################################ ## Form generated from reading UI file 'dialog_login.ui' ## -## Created by: Qt User Interface Compiler version 6.6.1 +## Created by: Qt User Interface Compiler version 6.8.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from PySide6.QtCore import QCoreApplication, QMetaObject, QRect, Qt -from PySide6.QtGui import QFont -from PySide6.QtWidgets import QDialogButtonBox, QLabel, QSizePolicy, QTextBrowser, QTextEdit, QVBoxLayout, QWidget - +from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, + QMetaObject, QObject, QPoint, QRect, + QSize, QTime, QUrl, Qt) +from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, + QFont, QFontDatabase, QGradient, QIcon, + QImage, QKeySequence, QLinearGradient, QPainter, + QPalette, QPixmap, QRadialGradient, QTransform) +from PySide6.QtWidgets import (QAbstractButton, QApplication, QDialog, QDialogButtonBox, + QHBoxLayout, QLabel, QSizePolicy, QTextBrowser, + QVBoxLayout, QWidget) -class Ui_DialogLogin: +class Ui_DialogLogin(object): def setupUi(self, DialogLogin): if not DialogLogin.objectName(): - DialogLogin.setObjectName("DialogLogin") + DialogLogin.setObjectName(u"DialogLogin") DialogLogin.resize(451, 400) - sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) + sizePolicy = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(DialogLogin.sizePolicy().hasHeightForWidth()) DialogLogin.setSizePolicy(sizePolicy) self.bb_dialog = QDialogButtonBox(DialogLogin) - self.bb_dialog.setObjectName("bb_dialog") + self.bb_dialog.setObjectName(u"bb_dialog") self.bb_dialog.setGeometry(QRect(20, 350, 411, 32)) sizePolicy.setHeightForWidth(self.bb_dialog.sizePolicy().hasHeightForWidth()) self.bb_dialog.setSizePolicy(sizePolicy) - self.bb_dialog.setStyleSheet("") - self.bb_dialog.setOrientation(Qt.Horizontal) - self.bb_dialog.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) + self.bb_dialog.setLayoutDirection(Qt.LayoutDirection.LeftToRight) + self.bb_dialog.setStyleSheet(u"") + self.bb_dialog.setOrientation(Qt.Orientation.Horizontal) + self.bb_dialog.setStandardButtons(QDialogButtonBox.StandardButton.Cancel|QDialogButtonBox.StandardButton.Ok) self.verticalLayoutWidget = QWidget(DialogLogin) - self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") + self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget") self.verticalLayoutWidget.setGeometry(QRect(20, 20, 411, 325)) self.lv_main = QVBoxLayout(self.verticalLayoutWidget) - self.lv_main.setObjectName("lv_main") + self.lv_main.setObjectName(u"lv_main") self.lv_main.setContentsMargins(0, 0, 0, 0) self.l_header = QLabel(self.verticalLayoutWidget) - self.l_header.setObjectName("l_header") + self.l_header.setObjectName(u"l_header") sizePolicy.setHeightForWidth(self.l_header.sizePolicy().hasHeightForWidth()) self.l_header.setSizePolicy(sizePolicy) font = QFont() @@ -47,7 +56,7 @@ class Ui_DialogLogin: self.lv_main.addWidget(self.l_header) self.l_description = QLabel(self.verticalLayoutWidget) - self.l_description.setObjectName("l_description") + self.l_description.setObjectName(u"l_description") sizePolicy.setHeightForWidth(self.l_description.sizePolicy().hasHeightForWidth()) self.l_description.setSizePolicy(sizePolicy) font1 = QFont() @@ -58,47 +67,54 @@ class Ui_DialogLogin: self.lv_main.addWidget(self.l_description) self.tb_url_login = QTextBrowser(self.verticalLayoutWidget) - self.tb_url_login.setObjectName("tb_url_login") + self.tb_url_login.setObjectName(u"tb_url_login") self.tb_url_login.setOpenExternalLinks(True) self.lv_main.addWidget(self.tb_url_login) - self.te_url_redirect = QTextEdit(self.verticalLayoutWidget) - self.te_url_redirect.setObjectName("te_url_redirect") + self.horizontalLayout = QHBoxLayout() + self.horizontalLayout.setObjectName(u"horizontalLayout") + self.l_expires_description = QLabel(self.verticalLayoutWidget) + self.l_expires_description.setObjectName(u"l_expires_description") + + self.horizontalLayout.addWidget(self.l_expires_description) + + self.l_expires_date_time = QLabel(self.verticalLayoutWidget) + self.l_expires_date_time.setObjectName(u"l_expires_date_time") + font2 = QFont() + font2.setBold(True) + self.l_expires_date_time.setFont(font2) + self.l_expires_date_time.setAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignmentFlag.AlignTrailing|Qt.AlignmentFlag.AlignVCenter) + + self.horizontalLayout.addWidget(self.l_expires_date_time) - self.lv_main.addWidget(self.te_url_redirect) + + self.lv_main.addLayout(self.horizontalLayout) self.l_hint = QLabel(self.verticalLayoutWidget) - self.l_hint.setObjectName("l_hint") + self.l_hint.setObjectName(u"l_hint") sizePolicy.setHeightForWidth(self.l_hint.sizePolicy().hasHeightForWidth()) self.l_hint.setSizePolicy(sizePolicy) self.l_hint.setFont(font1) + self.l_hint.setWordWrap(True) self.lv_main.addWidget(self.l_hint) + self.retranslateUi(DialogLogin) self.bb_dialog.accepted.connect(DialogLogin.accept) self.bb_dialog.rejected.connect(DialogLogin.reject) QMetaObject.connectSlotsByName(DialogLogin) - # setupUi def retranslateUi(self, DialogLogin): - DialogLogin.setWindowTitle(QCoreApplication.translate("DialogLogin", "Dialog", None)) - self.l_header.setText(QCoreApplication.translate("DialogLogin", "TIDAL PKCE Login", None)) - self.l_description.setText( - QCoreApplication.translate( - "DialogLogin", - 'Click the link below and login with your TIDAL credentials. You will be redirected to an "Ooops" page' - ' after a successful login. Copy the URL of this "Ooops" page and post it in the box below.', - None, - ) - ) - self.tb_url_login.setPlaceholderText(QCoreApplication.translate("DialogLogin", "Copy this login URL...", None)) - self.te_url_redirect.setPlaceholderText( - QCoreApplication.translate("DialogLogin", "Copy and paste the redirect URL after login here...", None) - ) - self.l_hint.setText(QCoreApplication.translate("DialogLogin", "Waiting...", None)) - + DialogLogin.setWindowTitle(QCoreApplication.translate("DialogLogin", u"Dialog", None)) + self.l_header.setText(QCoreApplication.translate("DialogLogin", u"TIDAL Login (as Device)", None)) + self.l_description.setText(QCoreApplication.translate("DialogLogin", u"Click the link below and login with your TIDAL credentials. TIDAL will ask you, if you like to add this app as a new device. You need to confirm this.", None)) + self.tb_url_login.setPlaceholderText(QCoreApplication.translate("DialogLogin", u"Copy this login URL...", None)) + self.l_expires_description.setText(QCoreApplication.translate("DialogLogin", u"This link expires at:", None)) + self.l_expires_date_time.setText(QCoreApplication.translate("DialogLogin", u"COMPUTING", None)) + self.l_hint.setText(QCoreApplication.translate("DialogLogin", u"Waiting...", None)) # retranslateUi + diff --git a/tidal_dl_ng/ui/dialog_login.ui b/tidal_dl_ng/ui/dialog_login.ui index c9c9774..2ff401f 100644 --- a/tidal_dl_ng/ui/dialog_login.ui +++ b/tidal_dl_ng/ui/dialog_login.ui @@ -34,14 +34,17 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="layoutDirection"> + <enum>Qt::LayoutDirection::LeftToRight</enum> + </property> <property name="styleSheet"> <string notr="true"/> </property> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Orientation::Horizontal</enum> </property> <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + <set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set> </property> </widget> <widget class="QWidget" name="verticalLayoutWidget"> @@ -69,7 +72,7 @@ </font> </property> <property name="text"> - <string>TIDAL PKCE Login</string> + <string>TIDAL Login (as Device)</string> </property> </widget> </item> @@ -87,7 +90,7 @@ </font> </property> <property name="text"> - <string>Click the link below and login with your TIDAL credentials. You will be redirected to an "Ooops" page after a successful login. Copy the URL of this "Ooops" page and post it in the box below.</string> + <string>Click the link below and login with your TIDAL credentials. TIDAL will ask you, if you like to add this app as a new device. You need to confirm this.</string> </property> <property name="wordWrap"> <bool>true</bool> @@ -105,11 +108,30 @@ </widget> </item> <item> - <widget class="QTextEdit" name="te_url_redirect"> - <property name="placeholderText"> - <string>Copy and paste the redirect URL after login here...</string> - </property> - </widget> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="l_expires_description"> + <property name="text"> + <string>This link expires at:</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="l_expires_date_time"> + <property name="font"> + <font> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>COMPUTING</string> + </property> + <property name="alignment"> + <set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set> + </property> + </widget> + </item> + </layout> </item> <item> <widget class="QLabel" name="l_hint"> @@ -127,6 +149,9 @@ <property name="text"> <string>Waiting...</string> </property> + <property name="wordWrap"> + <bool>true</bool> + </property> </widget> </item> </layout> |
