summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/dialog.py
diff options
context:
space:
mode:
authorexislow <exislow@users.noreply.github.com>2024-11-29 17:42:31 +0100
committerGitHub <noreply@github.com>2024-11-29 17:42:31 +0100
commit6da679b262dc99cd8798e18845385947491fb86e (patch)
tree9ccb8c4c273ce96fd6ebce8ea2077d281d812712 /tidal_dl_ng/dialog.py
parent4deaf94fb53ad304db73f9384f817b29afcac4a8 (diff)
parent33a30537e9a205dd4b43e891b00c0b5f15a9b71b (diff)
downloadtidal-dl-ng-6da679b262dc99cd8798e18845385947491fb86e.tar.gz
Merge pull request #257 from exislow/login-to-simple
Login to simple
Diffstat (limited to 'tidal_dl_ng/dialog.py')
-rw-r--r--tidal_dl_ng/dialog.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tidal_dl_ng/dialog.py b/tidal_dl_ng/dialog.py
index 92656dc..928f6c1 100644
--- a/tidal_dl_ng/dialog.py
+++ b/tidal_dl_ng/dialog.py
@@ -1,3 +1,4 @@
+import datetime
import os.path
import shutil
import webbrowser
@@ -83,24 +84,25 @@ class DialogLogin(QtWidgets.QDialog):
ui: Ui_DialogLogin
url_redirect: str
- return_code: int
- def __init__(self, url_login: str, hint: str, parent=None):
+ def __init__(self, url_login: str, hint: str, expires_in: int, parent=None):
super().__init__(parent)
+ datetime_current: datetime.datetime = datetime.datetime.now()
+ datetime_expires: datetime.datetime = datetime_current + datetime.timedelta(0, expires_in)
+
# Create an instance of the GUI
self.ui = Ui_DialogLogin()
# Run the .setupUi() method to show the GUI
self.ui.setupUi(self)
# Set data.
- self.ui.tb_url_login.setText(f'<a href="{url_login}">{url_login}</a>')
+ self.ui.tb_url_login.setText(f'<a href="https://{url_login}">https://{url_login}</a>')
self.ui.l_hint.setText(hint)
+ self.ui.l_expires_date_time.setText(datetime_expires.strftime("%Y-%m-%d %H:%M"))
# Show
self.return_code = self.exec()
- self.url_redirect = self.ui.te_url_redirect.toPlainText()
-
class DialogPreferences(QtWidgets.QDialog):
"""Preferences dialog."""