Move some options in install dialog to advanced options
This commit is contained in:
parent
04cd397a2f
commit
da07d6b791
|
@ -10,17 +10,18 @@ from legendary.models.downloading import ConditionCheckResult
|
||||||
from legendary.models.game import Game
|
from legendary.models.game import Game
|
||||||
from legendary.utils.selective_dl import get_sdl_appname
|
from legendary.utils.selective_dl import get_sdl_appname
|
||||||
|
|
||||||
from rare.lgndr.cli import LegendaryCLI
|
|
||||||
from rare.lgndr.api_arguments import LgndrInstallGameArgs
|
from rare.lgndr.api_arguments import LgndrInstallGameArgs
|
||||||
from rare.lgndr.api_exception import LgndrException
|
from rare.lgndr.api_exception import LgndrException
|
||||||
from rare.lgndr.api_monkeys import LgndrIndirectStatus
|
from rare.lgndr.api_monkeys import LgndrIndirectStatus
|
||||||
|
from rare.lgndr.cli import LegendaryCLI
|
||||||
from rare.lgndr.core import LegendaryCore
|
from rare.lgndr.core import LegendaryCore
|
||||||
|
from rare.models.install import InstallDownloadModel, InstallQueueItemModel
|
||||||
from rare.shared import LegendaryCoreSingleton, ApiResultsSingleton, ArgumentsSingleton
|
from rare.shared import LegendaryCoreSingleton, ApiResultsSingleton, ArgumentsSingleton
|
||||||
from rare.ui.components.dialogs.install_dialog import Ui_InstallDialog
|
from rare.ui.components.dialogs.install_dialog import Ui_InstallDialog
|
||||||
from rare.utils.extra_widgets import PathEdit
|
|
||||||
from rare.models.install import InstallDownloadModel, InstallQueueItemModel
|
|
||||||
from rare.utils.misc import get_size
|
|
||||||
from rare.utils import config_helper
|
from rare.utils import config_helper
|
||||||
|
from rare.utils.extra_widgets import PathEdit
|
||||||
|
from rare.utils.misc import get_size
|
||||||
|
from rare.widgets.collabsible_widget import CollabsibleWidget
|
||||||
|
|
||||||
|
|
||||||
class InstallDialog(QDialog, Ui_InstallDialog):
|
class InstallDialog(QDialog, Ui_InstallDialog):
|
||||||
|
@ -41,6 +42,11 @@ class InstallDialog(QDialog, Ui_InstallDialog):
|
||||||
if not self.dl_item.options.overlay
|
if not self.dl_item.options.overlay
|
||||||
else Game(app_name=self.app_name, app_title="Epic Overlay")
|
else Game(app_name=self.app_name, app_title="Epic Overlay")
|
||||||
)
|
)
|
||||||
|
self.advanced_layout.setParent(None)
|
||||||
|
self.advanced_widget = CollabsibleWidget(
|
||||||
|
self.advanced_layout, self.tr("Advanced options"), parent=self
|
||||||
|
)
|
||||||
|
self.advanced_placeholder_layout.addWidget(self.advanced_widget)
|
||||||
|
|
||||||
self.game_path = self.game.metadata.get("customAttributes", {}).get("FolderName", {}).get("value", "")
|
self.game_path = self.game.metadata.get("customAttributes", {}).get("FolderName", {}).get("value", "")
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/install_dialog.ui'
|
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/install_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
|
# 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.
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
@ -14,11 +14,13 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
||||||
class Ui_InstallDialog(object):
|
class Ui_InstallDialog(object):
|
||||||
def setupUi(self, InstallDialog):
|
def setupUi(self, InstallDialog):
|
||||||
InstallDialog.setObjectName("InstallDialog")
|
InstallDialog.setObjectName("InstallDialog")
|
||||||
InstallDialog.resize(406, 447)
|
InstallDialog.resize(526, 483)
|
||||||
InstallDialog.setWindowTitle("Rare")
|
InstallDialog.setWindowTitle("Rare")
|
||||||
self.install_dialog_layout = QtWidgets.QFormLayout(InstallDialog)
|
self.install_dialog_layout = QtWidgets.QFormLayout(InstallDialog)
|
||||||
self.install_dialog_layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
|
self.install_dialog_layout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
|
||||||
self.install_dialog_layout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
self.install_dialog_layout.setLabelAlignment(
|
||||||
|
QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter
|
||||||
|
)
|
||||||
self.install_dialog_layout.setObjectName("install_dialog_layout")
|
self.install_dialog_layout.setObjectName("install_dialog_layout")
|
||||||
self.install_dialog_label = QtWidgets.QLabel(InstallDialog)
|
self.install_dialog_label = QtWidgets.QLabel(InstallDialog)
|
||||||
self.install_dialog_label.setObjectName("install_dialog_label")
|
self.install_dialog_label.setObjectName("install_dialog_label")
|
||||||
|
@ -29,38 +31,6 @@ class Ui_InstallDialog(object):
|
||||||
self.install_dir_layout = QtWidgets.QHBoxLayout()
|
self.install_dir_layout = QtWidgets.QHBoxLayout()
|
||||||
self.install_dir_layout.setObjectName("install_dir_layout")
|
self.install_dir_layout.setObjectName("install_dir_layout")
|
||||||
self.install_dialog_layout.setLayout(1, QtWidgets.QFormLayout.FieldRole, self.install_dir_layout)
|
self.install_dialog_layout.setLayout(1, QtWidgets.QFormLayout.FieldRole, self.install_dir_layout)
|
||||||
self.max_workers_label = QtWidgets.QLabel(InstallDialog)
|
|
||||||
self.max_workers_label.setObjectName("max_workers_label")
|
|
||||||
self.install_dialog_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.max_workers_label)
|
|
||||||
self.max_workers_layout = QtWidgets.QHBoxLayout()
|
|
||||||
self.max_workers_layout.setObjectName("max_workers_layout")
|
|
||||||
self.max_workers_spin = QtWidgets.QSpinBox(InstallDialog)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.max_workers_spin.sizePolicy().hasHeightForWidth())
|
|
||||||
self.max_workers_spin.setSizePolicy(sizePolicy)
|
|
||||||
self.max_workers_spin.setObjectName("max_workers_spin")
|
|
||||||
self.max_workers_layout.addWidget(self.max_workers_spin)
|
|
||||||
self.max_workers_info_label = QtWidgets.QLabel(InstallDialog)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setItalic(True)
|
|
||||||
self.max_workers_info_label.setFont(font)
|
|
||||||
self.max_workers_info_label.setObjectName("max_workers_info_label")
|
|
||||||
self.max_workers_layout.addWidget(self.max_workers_info_label)
|
|
||||||
self.install_dialog_layout.setLayout(3, QtWidgets.QFormLayout.FieldRole, self.max_workers_layout)
|
|
||||||
self.force_download_label = QtWidgets.QLabel(InstallDialog)
|
|
||||||
self.force_download_label.setObjectName("force_download_label")
|
|
||||||
self.install_dialog_layout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.force_download_label)
|
|
||||||
self.force_download_check = QtWidgets.QCheckBox(InstallDialog)
|
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.force_download_check.sizePolicy().hasHeightForWidth())
|
|
||||||
self.force_download_check.setSizePolicy(sizePolicy)
|
|
||||||
self.force_download_check.setText("")
|
|
||||||
self.force_download_check.setObjectName("force_download_check")
|
|
||||||
self.install_dialog_layout.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.force_download_check)
|
|
||||||
self.platform_label = QtWidgets.QLabel(InstallDialog)
|
self.platform_label = QtWidgets.QLabel(InstallDialog)
|
||||||
self.platform_label.setObjectName("platform_label")
|
self.platform_label.setObjectName("platform_label")
|
||||||
self.install_dialog_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.platform_label)
|
self.install_dialog_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.platform_label)
|
||||||
|
@ -72,12 +42,6 @@ class Ui_InstallDialog(object):
|
||||||
self.platform_combo_box.setSizePolicy(sizePolicy)
|
self.platform_combo_box.setSizePolicy(sizePolicy)
|
||||||
self.platform_combo_box.setObjectName("platform_combo_box")
|
self.platform_combo_box.setObjectName("platform_combo_box")
|
||||||
self.install_dialog_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.platform_combo_box)
|
self.install_dialog_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.platform_combo_box)
|
||||||
self.ignore_space_label = QtWidgets.QLabel(InstallDialog)
|
|
||||||
self.ignore_space_label.setObjectName("ignore_space_label")
|
|
||||||
self.install_dialog_layout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.ignore_space_label)
|
|
||||||
self.download_only_label = QtWidgets.QLabel(InstallDialog)
|
|
||||||
self.download_only_label.setObjectName("download_only_label")
|
|
||||||
self.install_dialog_layout.setWidget(8, QtWidgets.QFormLayout.LabelRole, self.download_only_label)
|
|
||||||
self.shortcut_lbl = QtWidgets.QLabel(InstallDialog)
|
self.shortcut_lbl = QtWidgets.QLabel(InstallDialog)
|
||||||
self.shortcut_lbl.setObjectName("shortcut_lbl")
|
self.shortcut_lbl.setObjectName("shortcut_lbl")
|
||||||
self.install_dialog_layout.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.shortcut_lbl)
|
self.install_dialog_layout.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.shortcut_lbl)
|
||||||
|
@ -85,6 +49,16 @@ class Ui_InstallDialog(object):
|
||||||
self.shortcut_cb.setText("")
|
self.shortcut_cb.setText("")
|
||||||
self.shortcut_cb.setObjectName("shortcut_cb")
|
self.shortcut_cb.setObjectName("shortcut_cb")
|
||||||
self.install_dialog_layout.setWidget(9, QtWidgets.QFormLayout.FieldRole, self.shortcut_cb)
|
self.install_dialog_layout.setWidget(9, QtWidgets.QFormLayout.FieldRole, self.shortcut_cb)
|
||||||
|
self.install_preqs_lbl = QtWidgets.QLabel(InstallDialog)
|
||||||
|
self.install_preqs_lbl.setObjectName("install_preqs_lbl")
|
||||||
|
self.install_dialog_layout.setWidget(10, QtWidgets.QFormLayout.LabelRole, self.install_preqs_lbl)
|
||||||
|
self.install_preqs_check = QtWidgets.QCheckBox(InstallDialog)
|
||||||
|
font = QtGui.QFont()
|
||||||
|
font.setItalic(True)
|
||||||
|
self.install_preqs_check.setFont(font)
|
||||||
|
self.install_preqs_check.setText("")
|
||||||
|
self.install_preqs_check.setObjectName("install_preqs_check")
|
||||||
|
self.install_dialog_layout.setWidget(10, QtWidgets.QFormLayout.FieldRole, self.install_preqs_check)
|
||||||
self.sdl_list_label = QtWidgets.QLabel(InstallDialog)
|
self.sdl_list_label = QtWidgets.QLabel(InstallDialog)
|
||||||
self.sdl_list_label.setObjectName("sdl_list_label")
|
self.sdl_list_label.setObjectName("sdl_list_label")
|
||||||
self.install_dialog_layout.setWidget(11, QtWidgets.QFormLayout.LabelRole, self.sdl_list_label)
|
self.install_dialog_layout.setWidget(11, QtWidgets.QFormLayout.LabelRole, self.sdl_list_label)
|
||||||
|
@ -104,7 +78,9 @@ class Ui_InstallDialog(object):
|
||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
self.download_size_info_label.setFont(font)
|
self.download_size_info_label.setFont(font)
|
||||||
self.download_size_info_label.setObjectName("download_size_info_label")
|
self.download_size_info_label.setObjectName("download_size_info_label")
|
||||||
self.install_dialog_layout.setWidget(13, QtWidgets.QFormLayout.FieldRole, self.download_size_info_label)
|
self.install_dialog_layout.setWidget(
|
||||||
|
13, QtWidgets.QFormLayout.FieldRole, self.download_size_info_label
|
||||||
|
)
|
||||||
self.install_size_label = QtWidgets.QLabel(InstallDialog)
|
self.install_size_label = QtWidgets.QLabel(InstallDialog)
|
||||||
self.install_size_label.setObjectName("install_size_label")
|
self.install_size_label.setObjectName("install_size_label")
|
||||||
self.install_dialog_layout.setWidget(14, QtWidgets.QFormLayout.LabelRole, self.install_size_label)
|
self.install_dialog_layout.setWidget(14, QtWidgets.QFormLayout.LabelRole, self.install_size_label)
|
||||||
|
@ -114,7 +90,12 @@ class Ui_InstallDialog(object):
|
||||||
self.install_size_info_label.setFont(font)
|
self.install_size_info_label.setFont(font)
|
||||||
self.install_size_info_label.setWordWrap(True)
|
self.install_size_info_label.setWordWrap(True)
|
||||||
self.install_size_info_label.setObjectName("install_size_info_label")
|
self.install_size_info_label.setObjectName("install_size_info_label")
|
||||||
self.install_dialog_layout.setWidget(14, QtWidgets.QFormLayout.FieldRole, self.install_size_info_label)
|
self.install_dialog_layout.setWidget(
|
||||||
|
14, QtWidgets.QFormLayout.FieldRole, self.install_size_info_label
|
||||||
|
)
|
||||||
|
self.warn_label = QtWidgets.QLabel(InstallDialog)
|
||||||
|
self.warn_label.setObjectName("warn_label")
|
||||||
|
self.install_dialog_layout.setWidget(15, QtWidgets.QFormLayout.LabelRole, self.warn_label)
|
||||||
self.warn_message = QtWidgets.QLabel(InstallDialog)
|
self.warn_message = QtWidgets.QLabel(InstallDialog)
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
|
@ -124,12 +105,11 @@ class Ui_InstallDialog(object):
|
||||||
self.warn_message.setWordWrap(True)
|
self.warn_message.setWordWrap(True)
|
||||||
self.warn_message.setObjectName("warn_message")
|
self.warn_message.setObjectName("warn_message")
|
||||||
self.install_dialog_layout.setWidget(15, QtWidgets.QFormLayout.FieldRole, self.warn_message)
|
self.install_dialog_layout.setWidget(15, QtWidgets.QFormLayout.FieldRole, self.warn_message)
|
||||||
self.warn_label = QtWidgets.QLabel(InstallDialog)
|
|
||||||
self.warn_label.setObjectName("warn_label")
|
|
||||||
self.install_dialog_layout.setWidget(15, QtWidgets.QFormLayout.LabelRole, self.warn_label)
|
|
||||||
self.button_layout = QtWidgets.QHBoxLayout()
|
self.button_layout = QtWidgets.QHBoxLayout()
|
||||||
self.button_layout.setObjectName("button_layout")
|
self.button_layout.setObjectName("button_layout")
|
||||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
spacerItem = QtWidgets.QSpacerItem(
|
||||||
|
40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum
|
||||||
|
)
|
||||||
self.button_layout.addItem(spacerItem)
|
self.button_layout.addItem(spacerItem)
|
||||||
self.cancel_button = QtWidgets.QPushButton(InstallDialog)
|
self.cancel_button = QtWidgets.QPushButton(InstallDialog)
|
||||||
self.cancel_button.setObjectName("cancel_button")
|
self.cancel_button.setObjectName("cancel_button")
|
||||||
|
@ -140,42 +120,41 @@ class Ui_InstallDialog(object):
|
||||||
self.install_button = QtWidgets.QPushButton(InstallDialog)
|
self.install_button = QtWidgets.QPushButton(InstallDialog)
|
||||||
self.install_button.setObjectName("install_button")
|
self.install_button.setObjectName("install_button")
|
||||||
self.button_layout.addWidget(self.install_button)
|
self.button_layout.addWidget(self.install_button)
|
||||||
self.install_dialog_layout.setLayout(16, QtWidgets.QFormLayout.SpanningRole, self.button_layout)
|
self.install_dialog_layout.setLayout(17, QtWidgets.QFormLayout.SpanningRole, self.button_layout)
|
||||||
self.install_preqs_lbl = QtWidgets.QLabel(InstallDialog)
|
self.advanced_layout = QtWidgets.QFormLayout()
|
||||||
self.install_preqs_lbl.setObjectName("install_preqs_lbl")
|
self.advanced_layout.setLabelAlignment(
|
||||||
self.install_dialog_layout.setWidget(10, QtWidgets.QFormLayout.LabelRole, self.install_preqs_lbl)
|
QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter
|
||||||
self.install_preqs_check = QtWidgets.QCheckBox(InstallDialog)
|
)
|
||||||
font = QtGui.QFont()
|
self.advanced_layout.setObjectName("advanced_layout")
|
||||||
font.setItalic(True)
|
self.max_workers_label = QtWidgets.QLabel(InstallDialog)
|
||||||
self.install_preqs_check.setFont(font)
|
self.max_workers_label.setAlignment(
|
||||||
self.install_preqs_check.setText("")
|
QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter
|
||||||
self.install_preqs_check.setObjectName("install_preqs_check")
|
)
|
||||||
self.install_dialog_layout.setWidget(10, QtWidgets.QFormLayout.FieldRole, self.install_preqs_check)
|
self.max_workers_label.setObjectName("max_workers_label")
|
||||||
self.ignore_space_check = QtWidgets.QCheckBox(InstallDialog)
|
self.advanced_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.max_workers_label)
|
||||||
|
self.max_workers_layout = QtWidgets.QHBoxLayout()
|
||||||
|
self.max_workers_layout.setObjectName("max_workers_layout")
|
||||||
|
self.max_workers_spin = QtWidgets.QSpinBox(InstallDialog)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.ignore_space_check.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(self.max_workers_spin.sizePolicy().hasHeightForWidth())
|
||||||
self.ignore_space_check.setSizePolicy(sizePolicy)
|
self.max_workers_spin.setSizePolicy(sizePolicy)
|
||||||
|
self.max_workers_spin.setObjectName("max_workers_spin")
|
||||||
|
self.max_workers_layout.addWidget(self.max_workers_spin)
|
||||||
|
self.max_workers_info_label = QtWidgets.QLabel(InstallDialog)
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
self.ignore_space_check.setFont(font)
|
self.max_workers_info_label.setFont(font)
|
||||||
self.ignore_space_check.setObjectName("ignore_space_check")
|
self.max_workers_info_label.setObjectName("max_workers_info_label")
|
||||||
self.install_dialog_layout.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.ignore_space_check)
|
self.max_workers_layout.addWidget(self.max_workers_info_label)
|
||||||
self.download_only_check = QtWidgets.QCheckBox(InstallDialog)
|
self.advanced_layout.setLayout(0, QtWidgets.QFormLayout.FieldRole, self.max_workers_layout)
|
||||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
|
||||||
sizePolicy.setHorizontalStretch(0)
|
|
||||||
sizePolicy.setVerticalStretch(0)
|
|
||||||
sizePolicy.setHeightForWidth(self.download_only_check.sizePolicy().hasHeightForWidth())
|
|
||||||
self.download_only_check.setSizePolicy(sizePolicy)
|
|
||||||
font = QtGui.QFont()
|
|
||||||
font.setItalic(True)
|
|
||||||
self.download_only_check.setFont(font)
|
|
||||||
self.download_only_check.setObjectName("download_only_check")
|
|
||||||
self.install_dialog_layout.setWidget(8, QtWidgets.QFormLayout.FieldRole, self.download_only_check)
|
|
||||||
self.max_memory_label = QtWidgets.QLabel(InstallDialog)
|
self.max_memory_label = QtWidgets.QLabel(InstallDialog)
|
||||||
|
self.max_memory_label.setAlignment(
|
||||||
|
QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter
|
||||||
|
)
|
||||||
self.max_memory_label.setObjectName("max_memory_label")
|
self.max_memory_label.setObjectName("max_memory_label")
|
||||||
self.install_dialog_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.max_memory_label)
|
self.advanced_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.max_memory_label)
|
||||||
self.max_memory_layout = QtWidgets.QHBoxLayout()
|
self.max_memory_layout = QtWidgets.QHBoxLayout()
|
||||||
self.max_memory_layout.setObjectName("max_memory_layout")
|
self.max_memory_layout.setObjectName("max_memory_layout")
|
||||||
self.max_memory_spin = QtWidgets.QSpinBox(InstallDialog)
|
self.max_memory_spin = QtWidgets.QSpinBox(InstallDialog)
|
||||||
|
@ -196,15 +175,61 @@ class Ui_InstallDialog(object):
|
||||||
self.max_memory_info_label.setFont(font)
|
self.max_memory_info_label.setFont(font)
|
||||||
self.max_memory_info_label.setObjectName("max_memory_info_label")
|
self.max_memory_info_label.setObjectName("max_memory_info_label")
|
||||||
self.max_memory_layout.addWidget(self.max_memory_info_label)
|
self.max_memory_layout.addWidget(self.max_memory_info_label)
|
||||||
self.install_dialog_layout.setLayout(4, QtWidgets.QFormLayout.FieldRole, self.max_memory_layout)
|
self.advanced_layout.setLayout(1, QtWidgets.QFormLayout.FieldRole, self.max_memory_layout)
|
||||||
self.dl_optimizations_label = QtWidgets.QLabel(InstallDialog)
|
self.dl_optimizations_label = QtWidgets.QLabel(InstallDialog)
|
||||||
self.dl_optimizations_label.setObjectName("dl_optimizations_label")
|
self.dl_optimizations_label.setObjectName("dl_optimizations_label")
|
||||||
self.install_dialog_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.dl_optimizations_label)
|
self.advanced_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.dl_optimizations_label)
|
||||||
self.dl_optimizations_check = QtWidgets.QCheckBox(InstallDialog)
|
self.dl_optimizations_check = QtWidgets.QCheckBox(InstallDialog)
|
||||||
self.dl_optimizations_check.setText("")
|
self.dl_optimizations_check.setText("")
|
||||||
self.dl_optimizations_check.setChecked(False)
|
self.dl_optimizations_check.setChecked(False)
|
||||||
self.dl_optimizations_check.setObjectName("dl_optimizations_check")
|
self.dl_optimizations_check.setObjectName("dl_optimizations_check")
|
||||||
self.install_dialog_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.dl_optimizations_check)
|
self.advanced_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.dl_optimizations_check)
|
||||||
|
self.force_download_label = QtWidgets.QLabel(InstallDialog)
|
||||||
|
self.force_download_label.setObjectName("force_download_label")
|
||||||
|
self.advanced_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.force_download_label)
|
||||||
|
self.force_download_check = QtWidgets.QCheckBox(InstallDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.force_download_check.sizePolicy().hasHeightForWidth())
|
||||||
|
self.force_download_check.setSizePolicy(sizePolicy)
|
||||||
|
self.force_download_check.setText("")
|
||||||
|
self.force_download_check.setObjectName("force_download_check")
|
||||||
|
self.advanced_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.force_download_check)
|
||||||
|
self.ignore_space_label = QtWidgets.QLabel(InstallDialog)
|
||||||
|
self.ignore_space_label.setObjectName("ignore_space_label")
|
||||||
|
self.advanced_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.ignore_space_label)
|
||||||
|
self.ignore_space_check = QtWidgets.QCheckBox(InstallDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.ignore_space_check.sizePolicy().hasHeightForWidth())
|
||||||
|
self.ignore_space_check.setSizePolicy(sizePolicy)
|
||||||
|
font = QtGui.QFont()
|
||||||
|
font.setItalic(True)
|
||||||
|
self.ignore_space_check.setFont(font)
|
||||||
|
self.ignore_space_check.setObjectName("ignore_space_check")
|
||||||
|
self.advanced_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.ignore_space_check)
|
||||||
|
self.download_only_label = QtWidgets.QLabel(InstallDialog)
|
||||||
|
self.download_only_label.setObjectName("download_only_label")
|
||||||
|
self.advanced_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.download_only_label)
|
||||||
|
self.download_only_check = QtWidgets.QCheckBox(InstallDialog)
|
||||||
|
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(self.download_only_check.sizePolicy().hasHeightForWidth())
|
||||||
|
self.download_only_check.setSizePolicy(sizePolicy)
|
||||||
|
font = QtGui.QFont()
|
||||||
|
font.setItalic(True)
|
||||||
|
self.download_only_check.setFont(font)
|
||||||
|
self.download_only_check.setObjectName("download_only_check")
|
||||||
|
self.advanced_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.download_only_check)
|
||||||
|
self.install_dialog_layout.setLayout(16, QtWidgets.QFormLayout.SpanningRole, self.advanced_layout)
|
||||||
|
self.advanced_placeholder_layout = QtWidgets.QVBoxLayout()
|
||||||
|
self.advanced_placeholder_layout.setObjectName("advanced_placeholder_layout")
|
||||||
|
self.install_dialog_layout.setLayout(
|
||||||
|
12, QtWidgets.QFormLayout.SpanningRole, self.advanced_placeholder_layout
|
||||||
|
)
|
||||||
|
|
||||||
self.retranslateUi(InstallDialog)
|
self.retranslateUi(InstallDialog)
|
||||||
QtCore.QMetaObject.connectSlotsByName(InstallDialog)
|
QtCore.QMetaObject.connectSlotsByName(InstallDialog)
|
||||||
|
@ -213,34 +238,35 @@ class Ui_InstallDialog(object):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
self.install_dialog_label.setText(_translate("InstallDialog", "error"))
|
self.install_dialog_label.setText(_translate("InstallDialog", "error"))
|
||||||
self.install_dir_label.setText(_translate("InstallDialog", "Install directory"))
|
self.install_dir_label.setText(_translate("InstallDialog", "Install directory"))
|
||||||
self.max_workers_label.setText(_translate("InstallDialog", "Max workers"))
|
|
||||||
self.max_workers_info_label.setText(_translate("InstallDialog", "Less is slower. (0: Default)"))
|
|
||||||
self.force_download_label.setText(_translate("InstallDialog", "Force redownload"))
|
|
||||||
self.platform_label.setText(_translate("InstallDialog", "Platform"))
|
self.platform_label.setText(_translate("InstallDialog", "Platform"))
|
||||||
self.ignore_space_label.setText(_translate("InstallDialog", "Ignore free space"))
|
|
||||||
self.download_only_label.setText(_translate("InstallDialog", "Download only"))
|
|
||||||
self.shortcut_lbl.setText(_translate("InstallDialog", "Create shortcut"))
|
self.shortcut_lbl.setText(_translate("InstallDialog", "Create shortcut"))
|
||||||
|
self.install_preqs_lbl.setText(_translate("InstallDialog", "Install prerequisites"))
|
||||||
self.sdl_list_label.setText(_translate("InstallDialog", "Optional packs"))
|
self.sdl_list_label.setText(_translate("InstallDialog", "Optional packs"))
|
||||||
self.download_size_label.setText(_translate("InstallDialog", "Download size"))
|
self.download_size_label.setText(_translate("InstallDialog", "Download size"))
|
||||||
self.download_size_info_label.setText(_translate("InstallDialog", "Click verify..."))
|
self.download_size_info_label.setText(_translate("InstallDialog", "Click verify..."))
|
||||||
self.install_size_label.setText(_translate("InstallDialog", "Total install size"))
|
self.install_size_label.setText(_translate("InstallDialog", "Total install size"))
|
||||||
self.install_size_info_label.setText(_translate("InstallDialog", "Click verify..."))
|
self.install_size_info_label.setText(_translate("InstallDialog", "Click verify..."))
|
||||||
self.warn_message.setText(_translate("InstallDialog", "None"))
|
|
||||||
self.warn_label.setText(_translate("InstallDialog", "Warning"))
|
self.warn_label.setText(_translate("InstallDialog", "Warning"))
|
||||||
|
self.warn_message.setText(_translate("InstallDialog", "None"))
|
||||||
self.cancel_button.setText(_translate("InstallDialog", "Cancel"))
|
self.cancel_button.setText(_translate("InstallDialog", "Cancel"))
|
||||||
self.verify_button.setText(_translate("InstallDialog", "Verify"))
|
self.verify_button.setText(_translate("InstallDialog", "Verify"))
|
||||||
self.install_button.setText(_translate("InstallDialog", "Install"))
|
self.install_button.setText(_translate("InstallDialog", "Install"))
|
||||||
self.install_preqs_lbl.setText(_translate("InstallDialog", "Install prerequisites"))
|
self.max_workers_label.setText(_translate("InstallDialog", "Max workers"))
|
||||||
self.ignore_space_check.setText(_translate("InstallDialog", "Use with caution!"))
|
self.max_workers_info_label.setText(_translate("InstallDialog", "Less is slower. (0: Default)"))
|
||||||
self.download_only_check.setText(_translate("InstallDialog", "Do not try to install."))
|
|
||||||
self.max_memory_label.setText(_translate("InstallDialog", "Max shared memory"))
|
self.max_memory_label.setText(_translate("InstallDialog", "Max shared memory"))
|
||||||
self.max_memory_spin.setSuffix(_translate("InstallDialog", "MiB"))
|
self.max_memory_spin.setSuffix(_translate("InstallDialog", "MiB"))
|
||||||
self.max_memory_info_label.setText(_translate("InstallDialog", "Less is slower (0: Default)"))
|
self.max_memory_info_label.setText(_translate("InstallDialog", "Less is slower (0: Default)"))
|
||||||
self.dl_optimizations_label.setText(_translate("InstallDialog", "Enable reordering"))
|
self.dl_optimizations_label.setText(_translate("InstallDialog", "Enable reordering"))
|
||||||
|
self.force_download_label.setText(_translate("InstallDialog", "Force redownload"))
|
||||||
|
self.ignore_space_label.setText(_translate("InstallDialog", "Ignore free space"))
|
||||||
|
self.ignore_space_check.setText(_translate("InstallDialog", "Use with caution!"))
|
||||||
|
self.download_only_label.setText(_translate("InstallDialog", "Download only"))
|
||||||
|
self.download_only_check.setText(_translate("InstallDialog", "Do not try to install."))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
app = QtWidgets.QApplication(sys.argv)
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
InstallDialog = QtWidgets.QDialog()
|
InstallDialog = QtWidgets.QDialog()
|
||||||
ui = Ui_InstallDialog()
|
ui = Ui_InstallDialog()
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>406</width>
|
<width>526</width>
|
||||||
<height>447</height>
|
<height>483</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -37,59 +37,6 @@
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<layout class="QHBoxLayout" name="install_dir_layout"/>
|
<layout class="QHBoxLayout" name="install_dir_layout"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="max_workers_label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Max workers</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<layout class="QHBoxLayout" name="max_workers_layout">
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="max_workers_spin">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="max_workers_info_label">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<italic>true</italic>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Less is slower. (0: Default)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0">
|
|
||||||
<widget class="QLabel" name="force_download_label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Force redownload</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QCheckBox" name="force_download_check">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="platform_label">
|
<widget class="QLabel" name="platform_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -107,20 +54,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
|
||||||
<widget class="QLabel" name="ignore_space_label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Ignore free space</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0">
|
|
||||||
<widget class="QLabel" name="download_only_label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Download only</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="shortcut_lbl">
|
<widget class="QLabel" name="shortcut_lbl">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -135,6 +68,25 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="0">
|
||||||
|
<widget class="QLabel" name="install_preqs_lbl">
|
||||||
|
<property name="text">
|
||||||
|
<string>Install prerequisites</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="1">
|
||||||
|
<widget class="QCheckBox" name="install_preqs_check">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<italic>true</italic>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="11" column="0">
|
<item row="11" column="0">
|
||||||
<widget class="QLabel" name="sdl_list_label">
|
<widget class="QLabel" name="sdl_list_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -198,6 +150,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="15" column="0">
|
||||||
|
<widget class="QLabel" name="warn_label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Warning</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="15" column="1">
|
<item row="15" column="1">
|
||||||
<widget class="QLabel" name="warn_message">
|
<widget class="QLabel" name="warn_message">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
|
@ -219,14 +178,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="15" column="0">
|
<item row="17" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="warn_label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Warning</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="16" column="0" colspan="2">
|
|
||||||
<layout class="QHBoxLayout" name="button_layout">
|
<layout class="QHBoxLayout" name="button_layout">
|
||||||
<item>
|
<item>
|
||||||
<spacer name="button_hspacer">
|
<spacer name="button_hspacer">
|
||||||
|
@ -264,69 +216,58 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="16" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="install_preqs_lbl">
|
<layout class="QFormLayout" name="advanced_layout">
|
||||||
|
<property name="labelAlignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="max_workers_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Install prerequisites</string>
|
<string>Max workers</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QCheckBox" name="install_preqs_check">
|
<layout class="QHBoxLayout" name="max_workers_layout">
|
||||||
<property name="font">
|
<item>
|
||||||
<font>
|
<widget class="QSpinBox" name="max_workers_spin">
|
||||||
<italic>true</italic>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="1">
|
|
||||||
<widget class="QCheckBox" name="ignore_space_check">
|
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="max_workers_info_label">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<italic>true</italic>
|
<italic>true</italic>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use with caution!</string>
|
<string>Less is slower. (0: Default)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="1">
|
</layout>
|
||||||
<widget class="QCheckBox" name="download_only_check">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<italic>true</italic>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Do not try to install.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="max_memory_label">
|
<widget class="QLabel" name="max_memory_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Max shared memory</string>
|
<string>Max shared memory</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="1" column="1">
|
||||||
<layout class="QHBoxLayout" name="max_memory_layout">
|
<layout class="QHBoxLayout" name="max_memory_layout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="max_memory_spin">
|
<widget class="QSpinBox" name="max_memory_spin">
|
||||||
|
@ -367,14 +308,14 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="dl_optimizations_label">
|
<widget class="QLabel" name="dl_optimizations_label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enable reordering</string>
|
<string>Enable reordering</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QCheckBox" name="dl_optimizations_check">
|
<widget class="QCheckBox" name="dl_optimizations_check">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
|
@ -384,6 +325,81 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="force_download_label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Force redownload</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QCheckBox" name="force_download_check">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="ignore_space_label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ignore free space</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QCheckBox" name="ignore_space_check">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<italic>true</italic>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Use with caution!</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="download_only_label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Download only</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QCheckBox" name="download_only_check">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<italic>true</italic>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Do not try to install.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="0" colspan="2">
|
||||||
|
<layout class="QVBoxLayout" name="advanced_placeholder_layout"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
86
rare/widgets/collabsible_widget.py
Normal file
86
rare/widgets/collabsible_widget.py
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
from PyQt5.QtCore import QParallelAnimationGroup, Qt, QPropertyAnimation, QAbstractAnimation
|
||||||
|
from PyQt5.QtWidgets import QWidget, QFrame, QToolButton, QGridLayout, QSizePolicy, QLayout
|
||||||
|
|
||||||
|
|
||||||
|
# https://newbedev.com/how-to-make-an-expandable-collapsable-section-widget-in-qt
|
||||||
|
|
||||||
|
|
||||||
|
class CollabsibleWidget(QWidget):
|
||||||
|
def __init__(
|
||||||
|
self, child_layout: QLayout = None, title: str = "", animation_duration: int = 200, parent=None
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
References:
|
||||||
|
# Adapted from c++ version
|
||||||
|
https://stackoverflow.com/questions/32476006/how-to-make-an-expandable-collapsable-section-widget-in-qt
|
||||||
|
"""
|
||||||
|
super(CollabsibleWidget, self).__init__(parent=parent)
|
||||||
|
|
||||||
|
self.animationDuration = animation_duration
|
||||||
|
self.toggleAnimation = QParallelAnimationGroup()
|
||||||
|
self.contentArea = QWidget()
|
||||||
|
self.headerLine = QFrame()
|
||||||
|
self.toggleButton = QToolButton()
|
||||||
|
self.mainLayout = QGridLayout()
|
||||||
|
|
||||||
|
toggleButton = self.toggleButton
|
||||||
|
toggleButton.setStyleSheet("QToolButton { border: none; }")
|
||||||
|
toggleButton.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
|
||||||
|
toggleButton.setArrowType(Qt.RightArrow)
|
||||||
|
toggleButton.setText(str(title))
|
||||||
|
toggleButton.setCheckable(True)
|
||||||
|
toggleButton.setChecked(False)
|
||||||
|
|
||||||
|
headerLine = self.headerLine
|
||||||
|
headerLine.setFrameShape(QFrame.HLine)
|
||||||
|
headerLine.setFrameShadow(QFrame.Sunken)
|
||||||
|
headerLine.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum)
|
||||||
|
|
||||||
|
self.contentArea.setStyleSheet("QScrollArea { background-color: white; border: none; }")
|
||||||
|
self.contentArea.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
||||||
|
# start out collapsed
|
||||||
|
self.contentArea.setMaximumHeight(0)
|
||||||
|
self.contentArea.setMinimumHeight(0)
|
||||||
|
# let the entire widget grow and shrink with its content
|
||||||
|
toggleAnimation = self.toggleAnimation
|
||||||
|
toggleAnimation.addAnimation(QPropertyAnimation(self, b"minimumHeight"))
|
||||||
|
toggleAnimation.addAnimation(QPropertyAnimation(self, b"maximumHeight"))
|
||||||
|
toggleAnimation.addAnimation(QPropertyAnimation(self.contentArea, b"maximumHeight"))
|
||||||
|
# don't waste space
|
||||||
|
mainLayout = self.mainLayout
|
||||||
|
mainLayout.setVerticalSpacing(0)
|
||||||
|
mainLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
row = 0
|
||||||
|
mainLayout.addWidget(self.toggleButton, row, 0, 1, 1, Qt.AlignLeft)
|
||||||
|
mainLayout.addWidget(self.headerLine, row, 2, 1, 1)
|
||||||
|
row += 1
|
||||||
|
mainLayout.addWidget(self.contentArea, row, 0, 1, 3)
|
||||||
|
self.setLayout(self.mainLayout)
|
||||||
|
|
||||||
|
def start_animation(checked):
|
||||||
|
arrow_type = Qt.DownArrow if checked else Qt.RightArrow
|
||||||
|
direction = QAbstractAnimation.Forward if checked else QAbstractAnimation.Backward
|
||||||
|
toggleButton.setArrowType(arrow_type)
|
||||||
|
self.toggleAnimation.setDirection(direction)
|
||||||
|
self.toggleAnimation.start()
|
||||||
|
|
||||||
|
self.toggleButton.clicked.connect(start_animation)
|
||||||
|
|
||||||
|
if child_layout:
|
||||||
|
self.setContentLayout(child_layout)
|
||||||
|
|
||||||
|
def setContentLayout(self, content_layout: QLayout):
|
||||||
|
# Not sure if this is equivalent to self.contentArea.destroy()
|
||||||
|
self.contentArea.destroy()
|
||||||
|
self.contentArea.setLayout(content_layout)
|
||||||
|
collapsedHeight = self.sizeHint().height() - self.contentArea.maximumHeight()
|
||||||
|
contentHeight = content_layout.sizeHint().height()
|
||||||
|
for i in range(self.toggleAnimation.animationCount() - 1):
|
||||||
|
spoilerAnimation = self.toggleAnimation.animationAt(i)
|
||||||
|
spoilerAnimation.setDuration(self.animationDuration)
|
||||||
|
spoilerAnimation.setStartValue(collapsedHeight)
|
||||||
|
spoilerAnimation.setEndValue(collapsedHeight + contentHeight)
|
||||||
|
contentAnimation = self.toggleAnimation.animationAt(self.toggleAnimation.animationCount() - 1)
|
||||||
|
contentAnimation.setDuration(self.animationDuration)
|
||||||
|
contentAnimation.setStartValue(0)
|
||||||
|
contentAnimation.setEndValue(contentHeight)
|
Loading…
Reference in a new issue