1
0
Fork 0
mirror of synced 2024-06-23 08:40:45 +12:00

Merge pull request #220 from loathingKernel/fixups

Bug fixes for merged features
This commit is contained in:
Dummerle 2022-06-23 22:13:57 +02:00 committed by GitHub
commit 7cba799d21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 534 additions and 471 deletions

View file

@ -91,7 +91,13 @@ class LaunchDialog(QDialog, Ui_LaunchDialog):
super(LaunchDialog, self).__init__(parent=parent)
self.setupUi(self)
self.setAttribute(Qt.WA_DeleteOnClose, True)
self.setWindowFlags(Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint)
self.setWindowFlags(
Qt.Window
| Qt.Dialog
| Qt.CustomizeWindowHint
| Qt.WindowTitleHint
| Qt.WindowMinimizeButtonHint
)
self.setWindowModality(Qt.WindowModal)
self.core = LegendaryCoreSingleton()
@ -113,7 +119,8 @@ class LaunchDialog(QDialog, Ui_LaunchDialog):
except ValueError as e:
logger.info(str(e))
# Do not set parent, because it won't show a task bar icon
do_launch = LoginDialog(core=self.core).login()
# Update: Inherit the same parent as LaunchDialog
do_launch = LoginDialog(core=self.core, parent=self.parent()).login()
except ConnectionError as e:
logger.warning(e)
self.args.offline = True

View file

@ -2,13 +2,15 @@ from dataclasses import dataclass
from logging import getLogger
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QSizePolicy, QLayout, QDialog, QMessageBox
from PyQt5.QtWidgets import QLayout, QDialog, QMessageBox, QFrame
from legendary.core import LegendaryCore
from rare.components.dialogs.login.browser_login import BrowserLogin
from rare.components.dialogs.login.import_login import ImportLogin
from rare.shared import ArgumentsSingleton
from rare.ui.components.dialogs.login.landing_page import Ui_LandingPage
from rare.ui.components.dialogs.login.login_dialog import Ui_LoginDialog
from rare.widgets.sliding_stack import SlidingStackedWidget
from .browser_login import BrowserLogin
from .import_login import ImportLogin
logger = getLogger("Login")
@ -20,66 +22,81 @@ class LoginPages:
import_egl: int
class LoginDialog(QDialog, Ui_LoginDialog):
class LandingPage(QFrame):
def __init__(self, parent=None):
super(LandingPage, self).__init__(parent=parent)
self.setFrameStyle(self.StyledPanel)
self.ui = Ui_LandingPage()
self.ui.setupUi(self)
class LoginDialog(QDialog):
logged_in: bool = False
pages = LoginPages(landing=0, browser=1, import_egl=2)
def __init__(self, core: LegendaryCore, parent=None):
super(LoginDialog, self).__init__(parent=parent)
self.setupUi(self)
self.ui = Ui_LoginDialog()
self.ui.setupUi(self)
self.setAttribute(Qt.WA_DeleteOnClose, True)
self.setWindowFlags(Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint)
self.setWindowFlags(
Qt.Window
| Qt.Dialog
| Qt.CustomizeWindowHint
| Qt.WindowTitleHint
| Qt.WindowMinimizeButtonHint
| Qt.WindowCloseButtonHint
)
self.setWindowModality(Qt.WindowModal)
self.core = core
self.args = ArgumentsSingleton()
self.login_stack = SlidingStackedWidget(parent=self)
self.login_stack.setMinimumSize(480, 180)
self.ui.login_stack_layout.addWidget(self.login_stack)
self.landing_page = LandingPage(self.login_stack)
self.login_stack.insertWidget(self.pages.landing, self.landing_page)
self.browser_page = BrowserLogin(self.core, self.login_stack)
self.login_stack.insertWidget(self.pages.browser, self.browser_page)
self.browser_page.success.connect(self.login_successful)
self.browser_page.changed.connect(
lambda: self.next_button.setEnabled(self.browser_page.is_valid())
lambda: self.ui.next_button.setEnabled(self.browser_page.is_valid())
)
self.import_page = ImportLogin(self.core, self.login_stack)
self.login_stack.insertWidget(self.pages.import_egl, self.import_page)
self.import_page.success.connect(self.login_successful)
self.import_page.changed.connect(
lambda: self.next_button.setEnabled(self.import_page.is_valid())
)
self.import_page.changed.connect(lambda: self.ui.next_button.setEnabled(self.import_page.is_valid()))
self.next_button.setEnabled(False)
self.back_button.setEnabled(False)
self.ui.next_button.setEnabled(False)
self.ui.back_button.setEnabled(False)
self.login_browser_radio.clicked.connect(
lambda: self.next_button.setEnabled(True)
)
self.login_import_radio.clicked.connect(
lambda: self.next_button.setEnabled(True)
)
self.exit_button.clicked.connect(self.close)
self.back_button.clicked.connect(self.back_clicked)
self.next_button.clicked.connect(self.next_clicked)
self.landing_page.ui.login_browser_radio.clicked.connect(lambda: self.ui.next_button.setEnabled(True))
self.landing_page.ui.login_import_radio.clicked.connect(lambda: self.ui.next_button.setEnabled(True))
self.ui.exit_button.clicked.connect(self.close)
self.ui.back_button.clicked.connect(self.back_clicked)
self.ui.next_button.clicked.connect(self.next_clicked)
self.login_stack.setCurrentIndex(self.pages.landing)
self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
self.layout().setSizeConstraint(QLayout.SetFixedSize)
# self.resize(self.minimumSizeHint())
def back_clicked(self):
self.back_button.setEnabled(False)
self.next_button.setEnabled(True)
self.login_stack.setCurrentIndex(self.pages.landing)
self.ui.back_button.setEnabled(False)
self.ui.next_button.setEnabled(True)
self.login_stack.slideInIndex(self.pages.landing)
def next_clicked(self):
if self.login_stack.currentIndex() == self.pages.landing:
if self.login_browser_radio.isChecked():
self.login_stack.setCurrentIndex(self.pages.browser)
self.next_button.setEnabled(False)
if self.login_import_radio.isChecked():
self.login_stack.setCurrentIndex(self.pages.import_egl)
self.next_button.setEnabled(self.import_page.is_valid())
self.back_button.setEnabled(True)
if self.landing_page.ui.login_browser_radio.isChecked():
self.login_stack.slideInIndex(self.pages.browser)
self.ui.next_button.setEnabled(False)
if self.landing_page.ui.login_import_radio.isChecked():
self.login_stack.slideInIndex(self.pages.import_egl)
self.ui.next_button.setEnabled(self.import_page.is_valid())
self.ui.back_button.setEnabled(True)
elif self.login_stack.currentIndex() == self.pages.browser:
self.browser_page.do_login()
elif self.login_stack.currentIndex() == self.pages.import_egl:
@ -100,6 +117,6 @@ class LoginDialog(QDialog, Ui_LoginDialog):
raise ValueError("Login failed.")
except ValueError as e:
logger.error(str(e))
self.next_button.setEnabled(False)
self.ui.next_button.setEnabled(False)
self.logged_in = False
QMessageBox.warning(self, "Error", str(e))

View file

@ -4,10 +4,10 @@ from typing import Tuple
from PyQt5.QtCore import pyqtSignal, QUrl
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtWidgets import QWidget, QApplication
from legendary.utils import webview_login
from PyQt5.QtWidgets import QFrame, qApp
from legendary.core import LegendaryCore
from legendary.utils import webview_login
from rare.ui.components.dialogs.login.browser_login import Ui_BrowserLogin
from rare.utils.extra_widgets import IndicatorLineEdit
from rare.utils.utils import icon
@ -15,33 +15,37 @@ from rare.utils.utils import icon
logger = getLogger("BrowserLogin")
class BrowserLogin(QWidget, Ui_BrowserLogin):
class BrowserLogin(QFrame):
success = pyqtSignal()
changed = pyqtSignal()
login_url = "https://www.epicgames.com/id/login?redirectUrl=https%3A%2F%2Fwww.epicgames.com%2Fid%2Fapi%2Fredirect"
login_url = (
"https://www.epicgames.com/id/login?redirectUrl=https%3A%2F%2Fwww.epicgames.com%2Fid%2Fapi%2Fredirect"
)
def __init__(self, core: LegendaryCore, parent=None):
super(BrowserLogin, self).__init__(parent=parent)
self.setupUi(self)
self.setFrameStyle(self.StyledPanel)
self.ui = Ui_BrowserLogin()
self.ui.setupUi(self)
self.core = core
self.sid_edit = IndicatorLineEdit(
placeholder=self.tr("Insert SID here"), edit_func=self.text_changed, parent=self
)
self.link_text.setText(self.login_url)
self.copy_button.setIcon(icon("mdi.content-copy", "fa.copy"))
self.copy_button.clicked.connect(self.copy_link)
self.ui.link_text.setText(self.login_url)
self.ui.copy_button.setIcon(icon("mdi.content-copy", "fa.copy"))
self.ui.copy_button.clicked.connect(self.copy_link)
self.sid_layout.addWidget(self.sid_edit)
self.ui.sid_layout.addWidget(self.sid_edit)
self.open_button.clicked.connect(self.open_browser)
self.ui.open_button.clicked.connect(self.open_browser)
self.sid_edit.textChanged.connect(self.changed.emit)
def copy_link(self):
clipboard = QApplication.instance().clipboard()
clipboard = qApp.clipboard()
clipboard.setText(self.login_url)
self.status_label.setText(self.tr("Copied to clipboard"))
self.ui.status_label.setText(self.tr("Copied to clipboard"))
def is_valid(self):
return self.sid_edit.is_valid
@ -62,34 +66,28 @@ class BrowserLogin(QWidget, Ui_BrowserLogin):
return False, text, ""
def do_login(self):
self.status_label.setText(self.tr("Logging in..."))
self.ui.status_label.setText(self.tr("Logging in..."))
sid = self.sid_edit.text()
try:
token = self.core.auth_sid(sid)
if self.core.auth_code(token):
logger.info(
f"Successfully logged in as {self.core.lgd.userdata['displayName']}"
)
logger.info(f"Successfully logged in as {self.core.lgd.userdata['displayName']}")
self.success.emit()
else:
self.status_label.setText(self.tr("Login failed."))
self.ui.status_label.setText(self.tr("Login failed."))
logger.warning("Failed to login through browser")
except Exception as e:
logger.warning(e)
def open_browser(self):
if webview_login.webview_available is False:
logger.warning("You don't have webengine installed, "
"you will need to manually copy the SID.")
logger.warning("You don't have webengine installed, " "you will need to manually copy the SID.")
QDesktopServices.openUrl(QUrl(self.login_url))
else:
if webview_login.do_webview_login(
callback_sid=self.core.auth_sid,
callback_code=self.core.auth_code):
logger.info(
"Successfully logged in as "
f"{self.core.lgd.userdata['displayName']}"
)
callback_sid=self.core.auth_sid, callback_code=self.core.auth_code
):
logger.info("Successfully logged in as " f"{self.core.lgd.userdata['displayName']}")
self.success.emit()
else:
logger.warning("Failed to login through browser.")

View file

@ -3,64 +3,57 @@ from getpass import getuser
from logging import getLogger
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QWidget, QFileDialog
from PyQt5.QtWidgets import QFrame, QFileDialog
from legendary.core import LegendaryCore
from rare.ui.components.dialogs.login.import_login import Ui_ImportLogin
logger = getLogger("ImportLogin")
class ImportLogin(QWidget, Ui_ImportLogin):
class ImportLogin(QFrame):
success = pyqtSignal()
changed = pyqtSignal()
if os.name == "nt":
localappdata = os.path.expandvars("%LOCALAPPDATA%")
else:
localappdata = os.path.join(
"drive_c/users", getuser(), "Local Settings/Application Data"
)
localappdata = os.path.join("drive_c/users", getuser(), "Local Settings/Application Data")
appdata_path = os.path.join(localappdata, "EpicGamesLauncher/Saved/Config/Windows")
found = False
def __init__(self, core: LegendaryCore, parent=None):
super(ImportLogin, self).__init__(parent=parent)
self.setupUi(self)
self.setFrameStyle(self.StyledPanel)
self.ui = Ui_ImportLogin()
self.ui.setupUi(self)
self.core = core
self.text_egl_found = self.tr(
"Found EGL Program Data. Click 'Next' to import them."
)
self.text_egl_found = self.tr("Found EGL Program Data. Click 'Next' to import them.")
self.text_egl_notfound = self.tr("Could not find EGL Program Data. ")
if os.name == "nt":
if not self.core.egl.appdata_path and os.path.exists(self.egl_data_path):
if not self.core.egl.appdata_path and os.path.exists(self.appdata_path):
self.core.egl.appdata_path = self.appdata_path
if not self.core.egl.appdata_path:
self.status_label.setText(self.text_egl_notfound)
self.ui.status_label.setText(self.text_egl_notfound)
else:
self.status_label.setText(self.text_egl_found)
self.ui.status_label.setText(self.text_egl_found)
self.found = True
else:
self.info_label.setText(
self.tr(
"Please select the Wine prefix"
" where Epic Games Launcher is installed. "
)
+ self.info_label.text()
self.ui.info_label.setText(
self.tr("Please select the Wine prefix" " where Epic Games Launcher is installed. ")
+ self.ui.info_label.text()
)
prefixes = self.get_wine_prefixes()
if len(prefixes):
self.prefix_combo.addItems(prefixes)
self.status_label.setText(
self.tr("Select the Wine prefix you want to import.")
)
self.ui.prefix_combo.addItems(prefixes)
self.ui.status_label.setText(self.tr("Select the Wine prefix you want to import."))
else:
self.status_label.setText(self.text_egl_notfound)
self.ui.status_label.setText(self.text_egl_notfound)
self.prefix_tool.clicked.connect(self.prefix_path)
self.prefix_combo.editTextChanged.connect(self.changed.emit)
self.ui.prefix_tool.clicked.connect(self.prefix_path)
self.ui.prefix_combo.editTextChanged.connect(self.changed.emit)
def get_wine_prefixes(self):
possible_prefixes = [
@ -74,37 +67,31 @@ class ImportLogin(QWidget, Ui_ImportLogin):
return prefixes
def prefix_path(self):
prefix_dialog = QFileDialog(
self, self.tr("Choose path"), os.path.expanduser("~/")
)
prefix_dialog = QFileDialog(self, self.tr("Choose path"), os.path.expanduser("~/"))
prefix_dialog.setFileMode(QFileDialog.DirectoryOnly)
if prefix_dialog.exec_():
names = prefix_dialog.selectedFiles()
self.prefix_combo.setCurrentText(names[0])
self.ui.prefix_combo.setCurrentText(names[0])
def is_valid(self):
if os.name == "nt":
return self.found
else:
return os.path.exists(
os.path.join(self.prefix_combo.currentText(), self.appdata_path)
)
return os.path.exists(os.path.join(self.ui.prefix_combo.currentText(), self.appdata_path))
def do_login(self):
self.status_label.setText(self.tr("Loading..."))
self.ui.status_label.setText(self.tr("Loading..."))
if os.name == "nt":
pass
else:
self.core.egl.appdata_path = os.path.join(
self.prefix_combo.currentText(), self.appdata_path
)
self.core.egl.appdata_path = os.path.join(self.ui.prefix_combo.currentText(), self.appdata_path)
try:
if self.core.auth_import():
logger.info(f"Logged in as {self.core.lgd.userdata['displayName']}")
self.success.emit()
else:
self.status_label.setText(self.tr("Login failed."))
self.ui.status_label.setText(self.tr("Login failed."))
logger.warning("Failed to import existing session.")
except Exception as e:
self.status_label.setText(self.tr("Login failed. {}").format(str(e)))
self.ui.status_label.setText(self.tr("Login failed. {}").format(str(e)))
logger.warning(f"Failed to import existing session: {e}")

View file

@ -170,13 +170,7 @@ class GamesTab(QStackedWidget):
self.filter_games("")
def installation_started(self, app_name: str):
game = self.core.get_game(app_name, False)
if not game:
return
if game.is_dlc:
return
self.installing_widget.set_game(app_name)
self.installing_widget.setVisible(True)
i_widget, l_widget = self.widgets.get(app_name, (None, None))
if not i_widget or not l_widget:

View file

@ -23,8 +23,8 @@ class GameDlc(QWidget, Ui_GameDlc):
self.game_utils = game_utils
self.available_dlc_scroll.setProperty("noBorder", 1)
self.installed_dlc_scroll.setProperty("noBorder", 1)
self.available_dlc_scroll.setFrameStyle(QFrame.NoFrame)
self.installed_dlc_scroll.setFrameStyle(QFrame.NoFrame)
self.dlcs = dlcs
self.installed_dlc_widgets = list()
@ -37,6 +37,7 @@ class GameDlc(QWidget, Ui_GameDlc):
if self.installed_dlc_widgets:
for dlc_widget in self.installed_dlc_widgets:
dlc_widget.uninstall.disconnect()
dlc_widget.deleteLater()
self.installed_dlc_widgets.clear()
if self.available_dlc_widgets:
@ -66,7 +67,7 @@ class GameDlc(QWidget, Ui_GameDlc):
def uninstall(self, app_name):
if self.game_utils.uninstall_game(app_name):
self.update_dlcs(app_name)
self.update_dlcs(self.game.app_name)
def install(self, app_name):
if not self.core.is_installed(self.game.app_name):
@ -116,7 +117,7 @@ class GameDlcWidget(QFrame, Ui_GameDlcWidget):
def uninstall_dlc(self):
self.action_button.setDisabled(True)
self.action_button.setText(self.tr("Uninstalling"))
self.uninstall.emit(self.dlc)
self.uninstall.emit(self.dlc.app_name)
def install_game(self):
self.action_button.setDisabled(True)

View file

@ -45,10 +45,13 @@ class InstallingGameWidget(QFrame):
self.setLayout(layout)
def set_game(self, app_name):
if not app_name:
self.game = self.core.get_game(app_name, False)
if (not self.game) or self.game.is_dlc:
# Don't show for EOS Overlay or DLCs
self.game = None
self.setVisible(False)
return
self.game = self.core.get_game(app_name)
self.setVisible(True)
self.title_label.setText(f"<h4>{self.game.app_title}</h4>")
self.image.hideProgress(True)
self.image.showProgress(
@ -57,4 +60,7 @@ class InstallingGameWidget(QFrame):
)
def set_status(self, s: int):
if not self.game:
# Don't show for EOS Overlay or DLCs
return
self.image.updateProgress(s)

View file

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/login/browser_login.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
@ -14,29 +14,32 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_BrowserLogin(object):
def setupUi(self, BrowserLogin):
BrowserLogin.setObjectName("BrowserLogin")
BrowserLogin.resize(426, 210)
BrowserLogin.resize(400, 200)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(BrowserLogin.sizePolicy().hasHeightForWidth())
BrowserLogin.setSizePolicy(sizePolicy)
BrowserLogin.setWindowTitle("BrowserLogin")
self.browser_layout = QtWidgets.QGridLayout(BrowserLogin)
self.browser_layout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
self.browser_layout.setObjectName("browser_layout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.link_layout = QtWidgets.QHBoxLayout()
self.link_layout.setObjectName("link_layout")
self.link_text = QtWidgets.QLineEdit(BrowserLogin)
self.link_text.setText("")
self.link_text.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
self.link_text.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.link_text.setReadOnly(True)
self.link_text.setPlaceholderText("")
self.link_text.setObjectName("link_text")
self.horizontalLayout.addWidget(self.link_text)
self.link_layout.addWidget(self.link_text)
self.copy_button = QtWidgets.QPushButton(BrowserLogin)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.copy_button.sizePolicy().hasHeightForWidth())
self.copy_button.setSizePolicy(sizePolicy)
self.copy_button.setText("")
self.copy_button.setObjectName("copy_button")
self.horizontalLayout.addWidget(self.copy_button)
self.browser_layout.addLayout(self.horizontalLayout, 2, 0, 1, 3)
self.link_layout.addWidget(self.copy_button)
self.browser_layout.addLayout(self.link_layout, 2, 0, 1, 2)
spacerItem = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.browser_layout.addItem(spacerItem, 4, 0, 1, 2)
self.open_button = QtWidgets.QPushButton(BrowserLogin)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
sizePolicy.setHorizontalStretch(0)
@ -45,33 +48,28 @@ class Ui_BrowserLogin(object):
self.open_button.setSizePolicy(sizePolicy)
self.open_button.setObjectName("open_button")
self.browser_layout.addWidget(self.open_button, 1, 0, 1, 1)
self.info_label = QtWidgets.QLabel(BrowserLogin)
font = QtGui.QFont()
font.setItalic(True)
self.info_label.setFont(font)
self.info_label.setWordWrap(True)
self.info_label.setObjectName("info_label")
self.browser_layout.addWidget(self.info_label, 4, 0, 1, 3)
self.sid_layout = QtWidgets.QHBoxLayout()
self.sid_layout.setObjectName("sid_layout")
self.browser_layout.addLayout(self.sid_layout, 1, 1, 1, 1)
self.title_label = QtWidgets.QLabel(BrowserLogin)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.title_label.setFont(font)
self.title_label.setObjectName("title_label")
self.browser_layout.addWidget(self.title_label, 0, 0, 1, 3, QtCore.Qt.AlignTop)
self.browser_layout.addWidget(self.title_label, 0, 0, 1, 2)
self.info_label = QtWidgets.QLabel(BrowserLogin)
font = QtGui.QFont()
font.setItalic(True)
self.info_label.setFont(font)
self.info_label.setWordWrap(True)
self.info_label.setObjectName("info_label")
self.browser_layout.addWidget(self.info_label, 5, 0, 1, 2)
self.status_label = QtWidgets.QLabel(BrowserLogin)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.status_label.sizePolicy().hasHeightForWidth())
self.status_label.setSizePolicy(sizePolicy)
self.status_label.setText("")
self.status_label.setAlignment(QtCore.Qt.AlignBottom | QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft)
self.status_label.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft)
self.status_label.setObjectName("status_label")
self.browser_layout.addWidget(self.status_label, 3, 0, 1, 3)
self.sid_layout = QtWidgets.QHBoxLayout()
self.sid_layout.setObjectName("sid_layout")
self.browser_layout.addLayout(self.sid_layout, 1, 1, 1, 2)
self.browser_layout.addWidget(self.status_label, 3, 0, 1, 2)
self.retranslateUi(BrowserLogin)
QtCore.QMetaObject.connectSlotsByName(BrowserLogin)
@ -79,9 +77,8 @@ class Ui_BrowserLogin(object):
def retranslateUi(self, BrowserLogin):
_translate = QtCore.QCoreApplication.translate
self.open_button.setText(_translate("BrowserLogin", "Open Browser"))
self.info_label.setText(_translate("BrowserLogin",
"Click the button to open the login page in a browser or copy the link and paste it in a browser. After logging in, copy the SID code in the input above."))
self.title_label.setText(_translate("BrowserLogin", "Login through browser"))
self.info_label.setText(_translate("BrowserLogin", "Click the button to open the login page in a browser or copy the link and paste it in a browser. After logging in, copy the SID code in the input above."))
if __name__ == "__main__":

View file

@ -6,16 +6,19 @@
<rect>
<x>0</x>
<y>0</y>
<width>426</width>
<height>210</height>
<width>246</width>
<height>184</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">BrowserLogin</string>
</property>
<layout class="QGridLayout" name="browser_layout">
<item row="2" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item row="2" column="0" colspan="2">
<layout class="QHBoxLayout" name="link_layout">
<item>
<widget class="QLineEdit" name="link_text">
<property name="text">
@ -34,19 +37,26 @@
</item>
<item>
<widget class="QPushButton" name="copy_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<spacer name="vspacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="open_button">
<property name="sizePolicy">
@ -60,24 +70,10 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="info_label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Click the button to open the login page in a browser or copy the link and paste it in a browser. After
logging in, copy the SID code in the input above.
</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<item row="1" column="1">
<layout class="QHBoxLayout" name="sid_layout"/>
</item>
<item row="0" column="0" colspan="3" alignment="Qt::AlignTop">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="title_label">
<property name="font">
<font>
@ -90,14 +86,23 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QLabel" name="status_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="info_label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Click the button to open the login page in a browser or copy the link and paste it in a browser. After logging in, copy the SID code in the input above.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="status_label">
<property name="text">
<string notr="true"/>
</property>
@ -106,9 +111,6 @@
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<layout class="QHBoxLayout" name="sid_layout"/>
</item>
</layout>
</widget>
<resources/>

View file

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'import_login.ui'
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/login/import_login.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
@ -14,24 +14,29 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ImportLogin(object):
def setupUi(self, ImportLogin):
ImportLogin.setObjectName("ImportLogin")
ImportLogin.resize(503, 173)
ImportLogin.resize(400, 200)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(ImportLogin.sizePolicy().hasHeightForWidth())
ImportLogin.setSizePolicy(sizePolicy)
ImportLogin.setWindowTitle("ImportLogin")
self.import_layout = QtWidgets.QGridLayout(ImportLogin)
self.import_layout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
self.import_layout.setObjectName("import_layout")
self.info_label = QtWidgets.QLabel(ImportLogin)
font = QtGui.QFont()
font.setItalic(True)
self.info_label.setFont(font)
self.info_label.setWordWrap(True)
self.info_label.setObjectName("info_label")
self.import_layout.addWidget(self.info_label, 3, 0, 1, 3, QtCore.Qt.AlignBottom)
self.prefix_label = QtWidgets.QLabel(ImportLogin)
self.prefix_label.setObjectName("prefix_label")
self.import_layout.addWidget(self.prefix_label, 1, 0, 1, 1)
self.title_label = QtWidgets.QLabel(ImportLogin)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.title_label.setFont(font)
self.title_label.setObjectName("title_label")
self.import_layout.addWidget(self.title_label, 0, 0, 1, 3, QtCore.Qt.AlignTop)
self.import_layout.addWidget(self.title_label, 0, 0, 1, 3)
self.prefix_tool = QtWidgets.QToolButton(ImportLogin)
self.prefix_tool.setObjectName("prefix_tool")
self.import_layout.addWidget(self.prefix_tool, 1, 2, 1, 1)
self.prefix_combo = QtWidgets.QComboBox(ImportLogin)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
@ -41,39 +46,36 @@ class Ui_ImportLogin(object):
self.prefix_combo.setEditable(True)
self.prefix_combo.setObjectName("prefix_combo")
self.import_layout.addWidget(self.prefix_combo, 1, 1, 1, 1)
self.prefix_label = QtWidgets.QLabel(ImportLogin)
self.prefix_label.setObjectName("prefix_label")
self.import_layout.addWidget(self.prefix_label, 1, 0, 1, 1)
self.prefix_tool = QtWidgets.QToolButton(ImportLogin)
self.prefix_tool.setObjectName("prefix_tool")
self.import_layout.addWidget(self.prefix_tool, 1, 2, 1, 1)
self.status_label = QtWidgets.QLabel(ImportLogin)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.status_label.sizePolicy().hasHeightForWidth())
self.status_label.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setItalic(True)
self.status_label.setFont(font)
self.status_label.setText("")
self.status_label.setObjectName("status_label")
self.import_layout.addWidget(self.status_label, 2, 1, 1, 2)
self.info_label = QtWidgets.QLabel(ImportLogin)
font = QtGui.QFont()
font.setItalic(True)
self.info_label.setFont(font)
self.info_label.setWordWrap(True)
self.info_label.setObjectName("info_label")
self.import_layout.addWidget(self.info_label, 4, 0, 1, 3)
spacerItem = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.import_layout.addItem(spacerItem, 3, 0, 1, 3)
self.retranslateUi(ImportLogin)
QtCore.QMetaObject.connectSlotsByName(ImportLogin)
def retranslateUi(self, ImportLogin):
_translate = QtCore.QCoreApplication.translate
self.info_label.setText(_translate("ImportLogin", "You will get logged out from EGL in the process."))
self.title_label.setText(_translate("ImportLogin", "Import existing session from EGL"))
self.prefix_label.setText(_translate("ImportLogin", "Select path"))
self.title_label.setText(_translate("ImportLogin", "Import existing session from EGL"))
self.prefix_tool.setText(_translate("ImportLogin", "Browse"))
self.info_label.setText(_translate("ImportLogin", "You will get logged out from EGL in the process."))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
ImportLogin = QtWidgets.QWidget()
ui = Ui_ImportLogin()

View file

@ -1,94 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ImportLogin</class>
<widget class="QWidget" name="ImportLogin">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>503</width>
<height>173</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">ImportLogin</string>
</property>
<layout class="QGridLayout" name="import_layout">
<item row="3" column="0" colspan="3" alignment="Qt::AlignBottom">
<widget class="QLabel" name="info_label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>You will get logged out from EGL in the process.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3" alignment="Qt::AlignTop">
<widget class="QLabel" name="title_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Import existing session from EGL</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="prefix_combo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="prefix_label">
<property name="text">
<string>Select path</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="prefix_tool">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLabel" name="status_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
<class>ImportLogin</class>
<widget class="QWidget" name="ImportLogin">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>235</width>
<height>120</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true">ImportLogin</string>
</property>
<layout class="QGridLayout" name="import_layout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item row="1" column="0">
<widget class="QLabel" name="prefix_label">
<property name="text">
<string>Select path</string>
</property>
</widget>
<resources/>
<connections/>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="title_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Import existing session from EGL</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="prefix_tool">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="prefix_combo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLabel" name="status_label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="info_label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>You will get logged out from EGL in the process.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<spacer name="vspacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/login/landing_page.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_LandingPage(object):
def setupUi(self, LandingPage):
LandingPage.setObjectName("LandingPage")
LandingPage.resize(400, 200)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(LandingPage.sizePolicy().hasHeightForWidth())
LandingPage.setSizePolicy(sizePolicy)
self.landing_layout = QtWidgets.QGridLayout(LandingPage)
self.landing_layout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
self.landing_layout.setObjectName("landing_layout")
self.login_label = QtWidgets.QLabel(LandingPage)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.login_label.setFont(font)
self.login_label.setObjectName("login_label")
self.landing_layout.addWidget(self.login_label, 0, 0, 1, 3)
self.login_browser_radio = QtWidgets.QRadioButton(LandingPage)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.login_browser_radio.sizePolicy().hasHeightForWidth())
self.login_browser_radio.setSizePolicy(sizePolicy)
self.login_browser_radio.setObjectName("login_browser_radio")
self.landing_layout.addWidget(self.login_browser_radio, 1, 0, 1, 1)
self.login_browser_label = QtWidgets.QLabel(LandingPage)
font = QtGui.QFont()
font.setItalic(True)
self.login_browser_label.setFont(font)
self.login_browser_label.setObjectName("login_browser_label")
self.landing_layout.addWidget(self.login_browser_label, 1, 1, 1, 1)
self.login_import_radio = QtWidgets.QRadioButton(LandingPage)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.login_import_radio.sizePolicy().hasHeightForWidth())
self.login_import_radio.setSizePolicy(sizePolicy)
self.login_import_radio.setObjectName("login_import_radio")
self.landing_layout.addWidget(self.login_import_radio, 2, 0, 1, 1)
self.login_import_label = QtWidgets.QLabel(LandingPage)
font = QtGui.QFont()
font.setItalic(True)
self.login_import_label.setFont(font)
self.login_import_label.setObjectName("login_import_label")
self.landing_layout.addWidget(self.login_import_label, 2, 1, 1, 1)
spacerItem = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.landing_layout.addItem(spacerItem, 1, 2, 2, 1)
self.landing_layout.setRowStretch(1, 1)
self.landing_layout.setRowStretch(2, 1)
self.retranslateUi(LandingPage)
QtCore.QMetaObject.connectSlotsByName(LandingPage)
def retranslateUi(self, LandingPage):
_translate = QtCore.QCoreApplication.translate
LandingPage.setWindowTitle(_translate("LandingPage", "LandingPage"))
self.login_label.setText(_translate("LandingPage", "Select login method"))
self.login_browser_radio.setText(_translate("LandingPage", "Browser"))
self.login_browser_label.setText(_translate("LandingPage", "Login using a browser."))
self.login_import_radio.setText(_translate("LandingPage", "Import"))
self.login_import_label.setText(_translate("LandingPage", "Import from Epic Games Launcher"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
LandingPage = QtWidgets.QWidget()
ui = Ui_LandingPage()
ui.setupUi(LandingPage)
LandingPage.show()
sys.exit(app.exec_())

View file

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LandingPage</class>
<widget class="QWidget" name="LandingPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>295</width>
<height>78</height>
</rect>
</property>
<property name="windowTitle">
<string>LandingPage</string>
</property>
<layout class="QGridLayout" name="landing_layout" rowstretch="0,1,1">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="login_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Select login method</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="login_browser_radio">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Browser</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="login_browser_label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Login using a browser.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="login_import_radio">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Import</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="login_import_label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Import from Epic Games Launcher</string>
</property>
</widget>
</item>
<item row="1" column="2" rowspan="2">
<spacer name="login_hspacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/login/login_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
@ -14,71 +14,23 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_LoginDialog(object):
def setupUi(self, LoginDialog):
LoginDialog.setObjectName("LoginDialog")
LoginDialog.resize(492, 267)
LoginDialog.resize(324, 132)
self.login_layout = QtWidgets.QVBoxLayout(LoginDialog)
self.login_layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
self.login_layout.setObjectName("login_layout")
spacerItem = QtWidgets.QSpacerItem(0, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
spacerItem = QtWidgets.QSpacerItem(0, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.login_layout.addItem(spacerItem)
self.welcome_label = QtWidgets.QLabel(LoginDialog)
self.welcome_label.setObjectName("welcome_label")
self.login_layout.addWidget(self.welcome_label)
spacerItem1 = QtWidgets.QSpacerItem(0, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
spacerItem1 = QtWidgets.QSpacerItem(0, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.login_layout.addItem(spacerItem1)
self.login_stack = QtWidgets.QStackedWidget(LoginDialog)
self.login_stack.setEnabled(True)
self.login_stack.setMinimumSize(QtCore.QSize(480, 135))
self.login_stack.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.login_stack.setFrameShadow(QtWidgets.QFrame.Raised)
self.login_stack.setObjectName("login_stack")
self.login_page = QtWidgets.QWidget()
self.login_page.setEnabled(True)
self.login_page.setObjectName("login_page")
self.login_page_layout = QtWidgets.QGridLayout(self.login_page)
self.login_page_layout.setObjectName("login_page_layout")
self.login_browser_label = QtWidgets.QLabel(self.login_page)
font = QtGui.QFont()
font.setItalic(True)
self.login_browser_label.setFont(font)
self.login_browser_label.setObjectName("login_browser_label")
self.login_page_layout.addWidget(self.login_browser_label, 1, 1, 1, 1)
self.login_label = QtWidgets.QLabel(self.login_page)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.login_label.setFont(font)
self.login_label.setObjectName("login_label")
self.login_page_layout.addWidget(self.login_label, 0, 0, 1, 3, QtCore.Qt.AlignTop)
self.login_import_label = QtWidgets.QLabel(self.login_page)
font = QtGui.QFont()
font.setItalic(True)
self.login_import_label.setFont(font)
self.login_import_label.setObjectName("login_import_label")
self.login_page_layout.addWidget(self.login_import_label, 2, 1, 1, 1)
self.login_import_radio = QtWidgets.QRadioButton(self.login_page)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.login_import_radio.sizePolicy().hasHeightForWidth())
self.login_import_radio.setSizePolicy(sizePolicy)
self.login_import_radio.setObjectName("login_import_radio")
self.login_page_layout.addWidget(self.login_import_radio, 2, 0, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.login_page_layout.addItem(spacerItem2, 1, 2, 2, 1)
self.login_browser_radio = QtWidgets.QRadioButton(self.login_page)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.login_browser_radio.sizePolicy().hasHeightForWidth())
self.login_browser_radio.setSizePolicy(sizePolicy)
self.login_browser_radio.setObjectName("login_browser_radio")
self.login_page_layout.addWidget(self.login_browser_radio, 1, 0, 1, 1)
self.login_stack.addWidget(self.login_page)
self.login_layout.addWidget(self.login_stack)
self.login_stack_layout = QtWidgets.QVBoxLayout()
self.login_stack_layout.setObjectName("login_stack_layout")
self.login_layout.addLayout(self.login_stack_layout)
self.button_layout = QtWidgets.QHBoxLayout()
self.button_layout.setObjectName("button_layout")
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.button_layout.addItem(spacerItem3)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.button_layout.addItem(spacerItem2)
self.exit_button = QtWidgets.QPushButton(LoginDialog)
self.exit_button.setObjectName("exit_button")
self.button_layout.addWidget(self.exit_button)
@ -91,18 +43,12 @@ class Ui_LoginDialog(object):
self.login_layout.addLayout(self.button_layout)
self.retranslateUi(LoginDialog)
self.login_stack.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(LoginDialog)
def retranslateUi(self, LoginDialog):
_translate = QtCore.QCoreApplication.translate
LoginDialog.setWindowTitle(_translate("LoginDialog", "Rare Login"))
self.welcome_label.setText(_translate("LoginDialog", "<h1>Welcome to Rare</h1>"))
self.login_browser_label.setText(_translate("LoginDialog", "Login using a browser."))
self.login_label.setText(_translate("LoginDialog", "Select login method"))
self.login_import_label.setText(_translate("LoginDialog", "Import from Epic Games Launcher"))
self.login_import_radio.setText(_translate("LoginDialog", "Import"))
self.login_browser_radio.setText(_translate("LoginDialog", "Browser"))
self.exit_button.setText(_translate("LoginDialog", "Exit"))
self.back_button.setText(_translate("LoginDialog", "Back"))
self.next_button.setText(_translate("LoginDialog", "Next"))

View file

@ -6,19 +6,22 @@
<rect>
<x>0</x>
<y>0</y>
<width>492</width>
<height>267</height>
<width>324</width>
<height>132</height>
</rect>
</property>
<property name="windowTitle">
<string>Rare Login</string>
</property>
<layout class="QVBoxLayout" name="login_layout">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<layout class="QVBoxLayout" name="login_layout" stretch="0,0,0,0,0">
<item>
<spacer name="login_vspacer_top">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
@ -36,6 +39,12 @@
</item>
<item>
<spacer name="login_vspacer_bottom">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
@ -45,109 +54,7 @@
</spacer>
</item>
<item>
<widget class="QStackedWidget" name="login_stack">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>135</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="login_page">
<property name="enabled">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="login_page_layout">
<item row="1" column="1">
<widget class="QLabel" name="login_browser_label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Login using a browser.</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3" alignment="Qt::AlignTop">
<widget class="QLabel" name="login_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Select login method</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="login_import_label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Import from Epic Games Launcher</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="login_import_radio">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Import</string>
</property>
</widget>
</item>
<item row="1" column="2" rowspan="2">
<spacer name="login_hspacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="login_browser_radio">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Browser</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<layout class="QVBoxLayout" name="login_stack_layout"/>
</item>
<item>
<layout class="QHBoxLayout" name="button_layout">