400625975d
To keep dialogs in a common format and allow them to share the same properties, three classes of dialogs have been implemented inheriting from each other. The classes are `BaseDialog` -> `ButtonDialog` -> `ActionDialog` * Basedialog: is the basis of all dialogs and is responsible for rejecting close requests from the window manager and the keyboard. It also restricts access to `exec()` and `exec_()` because they are harmful. It serves as the basis of Launch and Login dialogs * ButtonDialog: is offering buttons for accepting or rejecting the presented option. It implements its own buttons and exposes abstract methods to implement handling in them. It restricts access to `close()` because these dialogs should always product a result. It is the basis of Uninstall, Selective dialogs. * ActionDialog: in addition to the ButtonDialog, it offers an action buttom with to validate the form or to make the dialog unable to close. It serves as the basis of Install and Move dialogs.
63 lines
2.8 KiB
Python
63 lines
2.8 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/login/login_dialog.ui'
|
|
#
|
|
# Created by: PyQt5 UI code generator 5.15.10
|
|
#
|
|
# 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_LoginDialog(object):
|
|
def setupUi(self, LoginDialog):
|
|
LoginDialog.setObjectName("LoginDialog")
|
|
LoginDialog.resize(241, 128)
|
|
self.main_layout = QtWidgets.QVBoxLayout(LoginDialog)
|
|
self.main_layout.setObjectName("main_layout")
|
|
spacerItem = QtWidgets.QSpacerItem(0, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
|
self.main_layout.addItem(spacerItem)
|
|
self.welcome_label = QtWidgets.QLabel(LoginDialog)
|
|
self.welcome_label.setObjectName("welcome_label")
|
|
self.main_layout.addWidget(self.welcome_label)
|
|
spacerItem1 = QtWidgets.QSpacerItem(0, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
|
self.main_layout.addItem(spacerItem1)
|
|
self.login_stack_layout = QtWidgets.QVBoxLayout()
|
|
self.login_stack_layout.setObjectName("login_stack_layout")
|
|
self.main_layout.addLayout(self.login_stack_layout)
|
|
self.button_layout = QtWidgets.QHBoxLayout()
|
|
self.button_layout.setObjectName("button_layout")
|
|
self.exit_button = QtWidgets.QPushButton(LoginDialog)
|
|
self.exit_button.setObjectName("exit_button")
|
|
self.button_layout.addWidget(self.exit_button)
|
|
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
|
self.button_layout.addItem(spacerItem2)
|
|
self.back_button = QtWidgets.QPushButton(LoginDialog)
|
|
self.back_button.setObjectName("back_button")
|
|
self.button_layout.addWidget(self.back_button)
|
|
self.next_button = QtWidgets.QPushButton(LoginDialog)
|
|
self.next_button.setObjectName("next_button")
|
|
self.button_layout.addWidget(self.next_button)
|
|
self.main_layout.addLayout(self.button_layout)
|
|
|
|
self.retranslateUi(LoginDialog)
|
|
|
|
def retranslateUi(self, LoginDialog):
|
|
_translate = QtCore.QCoreApplication.translate
|
|
LoginDialog.setWindowTitle(_translate("LoginDialog", "Login"))
|
|
self.welcome_label.setText(_translate("LoginDialog", "<h1>Welcome to Rare</h1>"))
|
|
self.exit_button.setText(_translate("LoginDialog", "Exit"))
|
|
self.back_button.setText(_translate("LoginDialog", "Back"))
|
|
self.next_button.setText(_translate("LoginDialog", "Next"))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import sys
|
|
app = QtWidgets.QApplication(sys.argv)
|
|
LoginDialog = QtWidgets.QDialog()
|
|
ui = Ui_LoginDialog()
|
|
ui.setupUi(LoginDialog)
|
|
LoginDialog.show()
|
|
sys.exit(app.exec_())
|