1
0
Fork 0
mirror of synced 2024-06-29 19:51:02 +12:00
Rare/rare/ui/components/dialogs/launch_dialog.py
loathingKernel 400625975d Dialogs: Re-implement Launch and Login dialogs on top of a few common super-classes
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.
2023-12-24 21:08:26 +02:00

51 lines
2 KiB
Python

# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/launch_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_LaunchDialog(object):
def setupUi(self, LaunchDialog):
LaunchDialog.setObjectName("LaunchDialog")
LaunchDialog.resize(400, 160)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(LaunchDialog.sizePolicy().hasHeightForWidth())
LaunchDialog.setSizePolicy(sizePolicy)
LaunchDialog.setMinimumSize(QtCore.QSize(400, 160))
LaunchDialog.setMaximumSize(QtCore.QSize(400, 160))
self.launch_layout = QtWidgets.QVBoxLayout(LaunchDialog)
self.launch_layout.setObjectName("launch_layout")
self.title_label = QtWidgets.QLabel(LaunchDialog)
self.title_label.setObjectName("title_label")
self.launch_layout.addWidget(self.title_label)
self.progress_bar = QtWidgets.QProgressBar(LaunchDialog)
self.progress_bar.setProperty("value", 0)
self.progress_bar.setObjectName("progress_bar")
self.launch_layout.addWidget(self.progress_bar)
self.retranslateUi(LaunchDialog)
def retranslateUi(self, LaunchDialog):
_translate = QtCore.QCoreApplication.translate
LaunchDialog.setWindowTitle(_translate("LaunchDialog", "Launching"))
self.title_label.setText(_translate("LaunchDialog", "<h2>Launching Rare</h2>"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
LaunchDialog = QtWidgets.QDialog()
ui = Ui_LaunchDialog()
ui.setupUi(LaunchDialog)
LaunchDialog.show()
sys.exit(app.exec_())