mirror of
https://github.com/NinjaCheetah/NUSGet.git
synced 2026-02-27 15:15:28 -05:00
Added custom QSS to make NUSGet look nice and pretty (still WIP)
Massive thanks to Isla and Alex from WiiLink for making all the styling I'm using here.
This commit is contained in:
@@ -1,13 +1,151 @@
|
||||
# "qt/py/ui_AboutDialog.py", licensed under the MIT license
|
||||
# Copyright 2024-2025 NinjaCheetah and Contributors
|
||||
# Thanks Isla and Alex for making such a nice about dialog that I could then "borrow" :p
|
||||
|
||||
from PySide6.QtWidgets import QDialog
|
||||
from qt.py.ui_AboutNUSGet import Ui_AboutNUSGet
|
||||
import os
|
||||
import pathlib
|
||||
import webbrowser
|
||||
|
||||
from PySide6.QtCore import Qt, QCoreApplication
|
||||
from PySide6.QtWidgets import QDialog, QLabel, QVBoxLayout, QPushButton
|
||||
from PySide6.QtGui import QIcon
|
||||
|
||||
class AboutNUSGet(QDialog):
|
||||
def __init__(self, version_str):
|
||||
super().__init__()
|
||||
self.ui = Ui_AboutNUSGet()
|
||||
self.ui.setupUi(self)
|
||||
self.setWindowTitle(self.tr("About NUSGet"))
|
||||
self.setFixedWidth(450)
|
||||
self.setFixedHeight(500)
|
||||
|
||||
self.ui.version_lbl.setText(version_str)
|
||||
# Set background color to match main app
|
||||
self.setStyleSheet("""
|
||||
Credits {
|
||||
background-color: #222222;
|
||||
color: #ffffff;
|
||||
}
|
||||
QLabel {
|
||||
color: #ffffff;
|
||||
}
|
||||
QLabel[class="title"] {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
}
|
||||
QLabel[class="version"] {
|
||||
font-size: 13px;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
QLabel[class="copyright"] {
|
||||
font-size: 12px;
|
||||
color: #888888;
|
||||
}
|
||||
QLabel[class="header"] {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #444444;
|
||||
padding-bottom: 4px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
QPushButton {
|
||||
background-color: transparent;
|
||||
border: 1px solid rgba(70, 70, 70, 1);
|
||||
border-radius: 8px;
|
||||
padding: 8px 12px;
|
||||
margin: 4px 0px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: rgba(60, 60, 60, 1);
|
||||
border-color: #4a86e8;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: rgba(26, 115, 232, 0.15);
|
||||
border: 1px solid #1a73e8;
|
||||
}""")
|
||||
|
||||
# Create main layout
|
||||
self.layout = QVBoxLayout()
|
||||
self.layout.setSpacing(4)
|
||||
self.layout.setContentsMargins(30, 20, 30, 20)
|
||||
|
||||
# Logo
|
||||
logo_label = QLabel()
|
||||
icon = QIcon(os.path.join(pathlib.Path(os.path.dirname(__file__)).resolve().parent.parent, "resources", "icon.png"))
|
||||
logo_pixmap = icon.pixmap(96, 96)
|
||||
logo_label.setPixmap(logo_pixmap)
|
||||
logo_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
|
||||
# Title
|
||||
title_label = QLabel(self.tr("NUSGet"))
|
||||
title_label.setProperty("class", "title")
|
||||
title_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
|
||||
# Version
|
||||
version_label = QLabel(self.tr("{version_str}".format(version_str=version_str)))
|
||||
version_label.setProperty("class", "version")
|
||||
version_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
|
||||
# Copyright
|
||||
copyright_label = QLabel(self.tr("© 2024-2025 NinjaCheetah & Contributors"))
|
||||
copyright_label.setProperty("class", "copyright")
|
||||
copyright_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
|
||||
# Add header section
|
||||
self.layout.addWidget(logo_label)
|
||||
self.layout.addWidget(title_label)
|
||||
self.layout.addWidget(version_label)
|
||||
self.layout.addWidget(copyright_label)
|
||||
self.layout.addSpacing(15)
|
||||
|
||||
# External links layout
|
||||
links_layout = QVBoxLayout()
|
||||
|
||||
# GitHub button
|
||||
self.github_button = QPushButton(self.tr("View Project on GitHub"))
|
||||
self.github_button.clicked.connect(lambda: webbrowser.open("https://github.com/NinjaCheetah/NUSGet"))
|
||||
links_layout.addWidget(self.github_button)
|
||||
|
||||
# Add the links layout to main layout
|
||||
self.layout.addLayout(links_layout)
|
||||
self.layout.addSpacing(15)
|
||||
|
||||
# Add a horizontal line
|
||||
line = QLabel()
|
||||
line.setStyleSheet("background-color: #444444; height: 1px;")
|
||||
line.setFixedHeight(1)
|
||||
self.layout.addWidget(line)
|
||||
self.layout.addSpacing(10)
|
||||
|
||||
# Team members header
|
||||
team_header = QLabel(self.tr("Translations"))
|
||||
team_header.setProperty("class", "header")
|
||||
self.layout.addWidget(team_header)
|
||||
self.layout.addSpacing(5)
|
||||
|
||||
# Team members with roles
|
||||
self.people = {
|
||||
"yeah-its-gloria": QLabel(self.tr(
|
||||
"German (Deutsch): <a href=https://github.com/yeah-its-gloria style='color: #4a86e8; text-decoration: none;'><b>yeah-its-gloria</b></a>")),
|
||||
"LNLenost": QLabel(self.tr(
|
||||
"Italian (Italiano): <a href=https://github.com/LNLenost style='color: #4a86e8; text-decoration: none;'><b>LNLenost</b></a>")),
|
||||
"DDinghoya": QLabel(self.tr(
|
||||
"Korean (\ud55c\uad6d\uc5b4): <a href=https://github.com/DDinghoya style='color: #4a86e8; text-decoration: none;'><b>DDinghoya</b></a>")),
|
||||
"rolfiee": QLabel(self.tr(
|
||||
"Norwegian (Norsk): <a href=https://github.com/rolfiee style='color: #4a86e8; text-decoration: none;'><b>rolfiee</b></a>")),
|
||||
"NotImplementedLife": QLabel(self.tr(
|
||||
"Romanian (Rom\u00e2n\u0103): <a href=https://github.com/NotImplementedLife style='color: #4a86e8; text-decoration: none;'><b>NotImplementedLife</b></a>"))
|
||||
}
|
||||
|
||||
# Add team members to layout
|
||||
for credit in self.people.values():
|
||||
credit.setOpenExternalLinks(True)
|
||||
credit.setContentsMargins(15, 0, 0, 0)
|
||||
self.layout.addWidget(credit)
|
||||
|
||||
# Add spacer at the bottom
|
||||
self.layout.addStretch()
|
||||
|
||||
self.setLayout(self.layout)
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'AboutNUSGet.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.9.0
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QAbstractButton, QApplication, QDialog, QDialogButtonBox,
|
||||
QHBoxLayout, QLabel, QLayout, QSizePolicy,
|
||||
QSpacerItem, QTextBrowser, QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_AboutNUSGet(object):
|
||||
def setupUi(self, AboutNUSGet):
|
||||
if not AboutNUSGet.objectName():
|
||||
AboutNUSGet.setObjectName(u"AboutNUSGet")
|
||||
AboutNUSGet.resize(400, 300)
|
||||
self.verticalLayout = QVBoxLayout(AboutNUSGet)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.outer_layout = QHBoxLayout()
|
||||
self.outer_layout.setObjectName(u"outer_layout")
|
||||
self.icon_layout = QVBoxLayout()
|
||||
self.icon_layout.setObjectName(u"icon_layout")
|
||||
self.icon_layout.setSizeConstraint(QLayout.SizeConstraint.SetDefaultConstraint)
|
||||
self.icon_lbl = QLabel(AboutNUSGet)
|
||||
icon = QIcon("resources/icon.png")
|
||||
pixmap = icon.pixmap(QSize(75, 75))
|
||||
self.icon_lbl.setPixmap(pixmap)
|
||||
self.icon_lbl.setObjectName(u"icon_lbl")
|
||||
self.icon_lbl.setMaximumSize(QSize(75, 75))
|
||||
|
||||
self.icon_layout.addWidget(self.icon_lbl)
|
||||
|
||||
self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
|
||||
self.icon_layout.addItem(self.verticalSpacer)
|
||||
|
||||
|
||||
self.outer_layout.addLayout(self.icon_layout)
|
||||
|
||||
self.details_layout = QVBoxLayout()
|
||||
self.details_layout.setObjectName(u"details_layout")
|
||||
self.about_title_lbl = QLabel(AboutNUSGet)
|
||||
self.about_title_lbl.setObjectName(u"about_title_lbl")
|
||||
font = QFont()
|
||||
font.setPointSize(15)
|
||||
font.setBold(True)
|
||||
self.about_title_lbl.setFont(font)
|
||||
|
||||
self.details_layout.addWidget(self.about_title_lbl)
|
||||
|
||||
self.version_lbl = QLabel(AboutNUSGet)
|
||||
self.version_lbl.setObjectName(u"version_lbl")
|
||||
font1 = QFont()
|
||||
font1.setBold(True)
|
||||
self.version_lbl.setFont(font1)
|
||||
|
||||
self.details_layout.addWidget(self.version_lbl)
|
||||
|
||||
self.detail_text_lbl = QLabel(AboutNUSGet)
|
||||
self.detail_text_lbl.setObjectName(u"detail_text_lbl")
|
||||
self.detail_text_lbl.setWordWrap(True)
|
||||
|
||||
self.details_layout.addWidget(self.detail_text_lbl)
|
||||
|
||||
self.textBrowser = QTextBrowser(AboutNUSGet)
|
||||
self.textBrowser.setObjectName(u"textBrowser")
|
||||
|
||||
self.details_layout.addWidget(self.textBrowser)
|
||||
|
||||
self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
|
||||
self.details_layout.addItem(self.verticalSpacer_2)
|
||||
|
||||
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
||||
|
||||
self.details_layout.addItem(self.horizontalSpacer)
|
||||
|
||||
|
||||
self.outer_layout.addLayout(self.details_layout)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.outer_layout)
|
||||
|
||||
self.buttonBox = QDialogButtonBox(AboutNUSGet)
|
||||
self.buttonBox.setObjectName(u"buttonBox")
|
||||
self.buttonBox.setOrientation(Qt.Orientation.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QDialogButtonBox.StandardButton.Close)
|
||||
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
|
||||
self.retranslateUi(AboutNUSGet)
|
||||
self.buttonBox.accepted.connect(AboutNUSGet.accept)
|
||||
self.buttonBox.rejected.connect(AboutNUSGet.reject)
|
||||
|
||||
QMetaObject.connectSlotsByName(AboutNUSGet)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, AboutNUSGet):
|
||||
AboutNUSGet.setWindowTitle(QCoreApplication.translate("AboutNUSGet", u"Dialog", None))
|
||||
self.icon_lbl.setText("")
|
||||
self.about_title_lbl.setText(QCoreApplication.translate("AboutNUSGet", u"About NUSGet", None))
|
||||
self.version_lbl.setText(QCoreApplication.translate("AboutNUSGet", u"Placeholder Version String", None))
|
||||
self.detail_text_lbl.setText(QCoreApplication.translate("AboutNUSGet", u"Copyright (c) 2024-2025 NinjaCheetah & Contributors", None))
|
||||
self.textBrowser.setHtml(QCoreApplication.translate("AboutNUSGet", u"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><meta charset=\"utf-8\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"hr { height: 1px; border-width: 0; }\n"
|
||||
"li.unchecked::marker { content: \"\\2610\"; }\n"
|
||||
"li.checked::marker { content: \"\\2612\"; }\n"
|
||||
"</style></head><body style=\" font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:700;\">Translations</span></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">German (Deutsch): <a href=\"https://github.com/yeah-its-gloria\"><span style=\" text-decoration: underline; color:#3586ff;\">yeah-its-gloria</span></a></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; mar"
|
||||
"gin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Italian (Italiano): <a href=\"https://github.com/LNLenost\"><span style=\" text-decoration: underline; color:#3586ff;\">LNLenost</span></a></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Korean (\ud55c\uad6d\uc5b4): <a href=\"https://github.com/DDinghoya\"><span style=\" text-decoration: underline; color:#3586ff;\">DDinghoya</span></a></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Norwegian (Norsk): <a href=\"https://github.com/rolfiee\"><span style=\" text-decoration: underline; color:#3586ff;\">rolfiee</span></a></p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Romanian (Rom\u00e2n\u0103): <a href=\"https://github.com/NotImplementedLife\"><span style=\" text-decoration: underline; color:#3586ff;\">"
|
||||
"NotImplementedLife</span></a></p></body></html>", None))
|
||||
# retranslateUi
|
||||
|
||||
@@ -16,11 +16,13 @@ from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient,
|
||||
QIcon, QImage, QKeySequence, QLinearGradient,
|
||||
QPainter, QPalette, QPixmap, QRadialGradient,
|
||||
QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QHBoxLayout,
|
||||
QHeaderView, QLabel, QLayout, QLineEdit,
|
||||
QMainWindow, QMenu, QMenuBar, QPushButton,
|
||||
QSizePolicy, QSpacerItem, QTabWidget, QTextBrowser,
|
||||
QTreeView, QVBoxLayout, QWidget)
|
||||
from PySide6.QtWidgets import (QApplication, QComboBox, QHBoxLayout, QHeaderView,
|
||||
QLabel, QLayout, QLineEdit, QMainWindow,
|
||||
QMenu, QMenuBar, QPushButton, QSizePolicy,
|
||||
QSpacerItem, QTabWidget, QTextBrowser, QTreeView,
|
||||
QVBoxLayout, QWidget)
|
||||
|
||||
from qt.py.ui_WrapCheckboxWidget import WrapCheckboxWidget
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
@@ -175,7 +177,7 @@ class Ui_MainWindow(object):
|
||||
self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
|
||||
self.horizontalLayout_5.setSizeConstraint(QLayout.SizeConstraint.SetMinimumSize)
|
||||
self.verticalLayout_7 = QVBoxLayout()
|
||||
self.verticalLayout_7.setSpacing(5)
|
||||
self.verticalLayout_7.setSpacing(4)
|
||||
self.verticalLayout_7.setObjectName(u"verticalLayout_7")
|
||||
self.verticalLayout_7.setSizeConstraint(QLayout.SizeConstraint.SetMinimumSize)
|
||||
self.label_3 = QLabel(self.centralwidget)
|
||||
@@ -186,31 +188,10 @@ class Ui_MainWindow(object):
|
||||
|
||||
self.verticalLayout_7.addWidget(self.label_3)
|
||||
|
||||
self.pack_archive_row = QHBoxLayout()
|
||||
self.pack_archive_row.setSpacing(10)
|
||||
self.pack_archive_row.setObjectName(u"pack_archive_row")
|
||||
self.pack_archive_chkbox = QCheckBox(self.centralwidget)
|
||||
self.pack_archive_chkbox.setObjectName(u"pack_archive_chkbox")
|
||||
sizePolicy1.setHeightForWidth(self.pack_archive_chkbox.sizePolicy().hasHeightForWidth())
|
||||
self.pack_archive_chkbox.setSizePolicy(sizePolicy1)
|
||||
self.pack_archive_chkbox.setText(u"")
|
||||
self.pack_archive_chkbox.setChecked(True)
|
||||
self.pack_archive_checkbox = WrapCheckboxWidget(self.centralwidget)
|
||||
self.pack_archive_checkbox.setObjectName(u"pack_archive_checkbox")
|
||||
|
||||
self.pack_archive_row.addWidget(self.pack_archive_chkbox)
|
||||
|
||||
self.pack_archive_chkbox_lbl = QLabel(self.centralwidget)
|
||||
self.pack_archive_chkbox_lbl.setObjectName(u"pack_archive_chkbox_lbl")
|
||||
sizePolicy4 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.MinimumExpanding)
|
||||
sizePolicy4.setHorizontalStretch(0)
|
||||
sizePolicy4.setVerticalStretch(0)
|
||||
sizePolicy4.setHeightForWidth(self.pack_archive_chkbox_lbl.sizePolicy().hasHeightForWidth())
|
||||
self.pack_archive_chkbox_lbl.setSizePolicy(sizePolicy4)
|
||||
self.pack_archive_chkbox_lbl.setWordWrap(True)
|
||||
|
||||
self.pack_archive_row.addWidget(self.pack_archive_chkbox_lbl)
|
||||
|
||||
|
||||
self.verticalLayout_7.addLayout(self.pack_archive_row)
|
||||
self.verticalLayout_7.addWidget(self.pack_archive_checkbox)
|
||||
|
||||
self.archive_file_entry = QLineEdit(self.centralwidget)
|
||||
self.archive_file_entry.setObjectName(u"archive_file_entry")
|
||||
@@ -218,124 +199,33 @@ class Ui_MainWindow(object):
|
||||
|
||||
self.verticalLayout_7.addWidget(self.archive_file_entry)
|
||||
|
||||
self.keep_enc_row = QHBoxLayout()
|
||||
self.keep_enc_row.setSpacing(10)
|
||||
self.keep_enc_row.setObjectName(u"keep_enc_row")
|
||||
self.keep_enc_chkbox = QCheckBox(self.centralwidget)
|
||||
self.keep_enc_chkbox.setObjectName(u"keep_enc_chkbox")
|
||||
sizePolicy1.setHeightForWidth(self.keep_enc_chkbox.sizePolicy().hasHeightForWidth())
|
||||
self.keep_enc_chkbox.setSizePolicy(sizePolicy1)
|
||||
self.keep_enc_chkbox.setText(u"")
|
||||
self.keep_enc_chkbox.setChecked(True)
|
||||
self.keep_enc_checkbox = WrapCheckboxWidget(self.centralwidget)
|
||||
self.keep_enc_checkbox.setObjectName(u"keep_enc_checkbox")
|
||||
|
||||
self.keep_enc_row.addWidget(self.keep_enc_chkbox)
|
||||
self.verticalLayout_7.addWidget(self.keep_enc_checkbox)
|
||||
|
||||
self.keep_enc_chkbox_lbl = QLabel(self.centralwidget)
|
||||
self.keep_enc_chkbox_lbl.setObjectName(u"keep_enc_chkbox_lbl")
|
||||
sizePolicy4.setHeightForWidth(self.keep_enc_chkbox_lbl.sizePolicy().hasHeightForWidth())
|
||||
self.keep_enc_chkbox_lbl.setSizePolicy(sizePolicy4)
|
||||
self.keep_enc_chkbox_lbl.setWordWrap(True)
|
||||
self.create_dec_checkbox = WrapCheckboxWidget(self.centralwidget)
|
||||
self.create_dec_checkbox.setObjectName(u"create_dec_checkbox")
|
||||
|
||||
self.keep_enc_row.addWidget(self.keep_enc_chkbox_lbl)
|
||||
self.verticalLayout_7.addWidget(self.create_dec_checkbox)
|
||||
|
||||
self.use_local_checkbox = WrapCheckboxWidget(self.centralwidget)
|
||||
self.use_local_checkbox.setObjectName(u"use_local_checkbox")
|
||||
|
||||
self.verticalLayout_7.addLayout(self.keep_enc_row)
|
||||
self.verticalLayout_7.addWidget(self.use_local_checkbox)
|
||||
|
||||
self.create_dec_row = QHBoxLayout()
|
||||
self.create_dec_row.setSpacing(10)
|
||||
self.create_dec_row.setObjectName(u"create_dec_row")
|
||||
self.create_dec_chkbox = QCheckBox(self.centralwidget)
|
||||
self.create_dec_chkbox.setObjectName(u"create_dec_chkbox")
|
||||
sizePolicy1.setHeightForWidth(self.create_dec_chkbox.sizePolicy().hasHeightForWidth())
|
||||
self.create_dec_chkbox.setSizePolicy(sizePolicy1)
|
||||
self.create_dec_chkbox.setText(u"")
|
||||
self.use_wiiu_nus_checkbox = WrapCheckboxWidget(self.centralwidget)
|
||||
self.use_wiiu_nus_checkbox.setObjectName(u"use_wiiu_nus_checkbox")
|
||||
|
||||
self.create_dec_row.addWidget(self.create_dec_chkbox)
|
||||
self.verticalLayout_7.addWidget(self.use_wiiu_nus_checkbox)
|
||||
|
||||
self.create_dec_chkbox_lbl = QLabel(self.centralwidget)
|
||||
self.create_dec_chkbox_lbl.setObjectName(u"create_dec_chkbox_lbl")
|
||||
sizePolicy4.setHeightForWidth(self.create_dec_chkbox_lbl.sizePolicy().hasHeightForWidth())
|
||||
self.create_dec_chkbox_lbl.setSizePolicy(sizePolicy4)
|
||||
self.create_dec_chkbox_lbl.setWordWrap(True)
|
||||
self.patch_ios_checkbox = WrapCheckboxWidget(self.centralwidget)
|
||||
self.patch_ios_checkbox.setObjectName(u"patch_ios_checkbox")
|
||||
self.patch_ios_checkbox.setEnabled(False)
|
||||
|
||||
self.create_dec_row.addWidget(self.create_dec_chkbox_lbl)
|
||||
self.verticalLayout_7.addWidget(self.patch_ios_checkbox)
|
||||
|
||||
|
||||
self.verticalLayout_7.addLayout(self.create_dec_row)
|
||||
|
||||
self.use_local_row = QHBoxLayout()
|
||||
self.use_local_row.setSpacing(10)
|
||||
self.use_local_row.setObjectName(u"use_local_row")
|
||||
self.use_local_chkbox = QCheckBox(self.centralwidget)
|
||||
self.use_local_chkbox.setObjectName(u"use_local_chkbox")
|
||||
self.use_local_chkbox.setEnabled(True)
|
||||
sizePolicy1.setHeightForWidth(self.use_local_chkbox.sizePolicy().hasHeightForWidth())
|
||||
self.use_local_chkbox.setSizePolicy(sizePolicy1)
|
||||
self.use_local_chkbox.setText(u"")
|
||||
|
||||
self.use_local_row.addWidget(self.use_local_chkbox)
|
||||
|
||||
self.use_local_chkbox_lbl = QLabel(self.centralwidget)
|
||||
self.use_local_chkbox_lbl.setObjectName(u"use_local_chkbox_lbl")
|
||||
sizePolicy4.setHeightForWidth(self.use_local_chkbox_lbl.sizePolicy().hasHeightForWidth())
|
||||
self.use_local_chkbox_lbl.setSizePolicy(sizePolicy4)
|
||||
self.use_local_chkbox_lbl.setWordWrap(True)
|
||||
|
||||
self.use_local_row.addWidget(self.use_local_chkbox_lbl)
|
||||
|
||||
|
||||
self.verticalLayout_7.addLayout(self.use_local_row)
|
||||
|
||||
self.use_wiiu_nus_row = QHBoxLayout()
|
||||
self.use_wiiu_nus_row.setSpacing(10)
|
||||
self.use_wiiu_nus_row.setObjectName(u"use_wiiu_nus_row")
|
||||
self.use_wiiu_nus_row.setSizeConstraint(QLayout.SizeConstraint.SetDefaultConstraint)
|
||||
self.use_wiiu_nus_chkbox = QCheckBox(self.centralwidget)
|
||||
self.use_wiiu_nus_chkbox.setObjectName(u"use_wiiu_nus_chkbox")
|
||||
sizePolicy2.setHeightForWidth(self.use_wiiu_nus_chkbox.sizePolicy().hasHeightForWidth())
|
||||
self.use_wiiu_nus_chkbox.setSizePolicy(sizePolicy2)
|
||||
self.use_wiiu_nus_chkbox.setLayoutDirection(Qt.LayoutDirection.LeftToRight)
|
||||
self.use_wiiu_nus_chkbox.setText(u"")
|
||||
self.use_wiiu_nus_chkbox.setChecked(True)
|
||||
|
||||
self.use_wiiu_nus_row.addWidget(self.use_wiiu_nus_chkbox)
|
||||
|
||||
self.use_wiiu_nus_chkbox_lbl = QLabel(self.centralwidget)
|
||||
self.use_wiiu_nus_chkbox_lbl.setObjectName(u"use_wiiu_nus_chkbox_lbl")
|
||||
sizePolicy4.setHeightForWidth(self.use_wiiu_nus_chkbox_lbl.sizePolicy().hasHeightForWidth())
|
||||
self.use_wiiu_nus_chkbox_lbl.setSizePolicy(sizePolicy4)
|
||||
self.use_wiiu_nus_chkbox_lbl.setWordWrap(True)
|
||||
|
||||
self.use_wiiu_nus_row.addWidget(self.use_wiiu_nus_chkbox_lbl)
|
||||
|
||||
|
||||
self.verticalLayout_7.addLayout(self.use_wiiu_nus_row)
|
||||
|
||||
self.patch_ios_row = QHBoxLayout()
|
||||
self.patch_ios_row.setSpacing(10)
|
||||
self.patch_ios_row.setObjectName(u"patch_ios_row")
|
||||
self.patch_ios_chkbox = QCheckBox(self.centralwidget)
|
||||
self.patch_ios_chkbox.setObjectName(u"patch_ios_chkbox")
|
||||
self.patch_ios_chkbox.setEnabled(False)
|
||||
sizePolicy1.setHeightForWidth(self.patch_ios_chkbox.sizePolicy().hasHeightForWidth())
|
||||
self.patch_ios_chkbox.setSizePolicy(sizePolicy1)
|
||||
self.patch_ios_chkbox.setText(u"")
|
||||
|
||||
self.patch_ios_row.addWidget(self.patch_ios_chkbox)
|
||||
|
||||
self.patch_ios_chkbox_lbl = QLabel(self.centralwidget)
|
||||
self.patch_ios_chkbox_lbl.setObjectName(u"patch_ios_chkbox_lbl")
|
||||
self.patch_ios_chkbox_lbl.setEnabled(True)
|
||||
sizePolicy4.setHeightForWidth(self.patch_ios_chkbox_lbl.sizePolicy().hasHeightForWidth())
|
||||
self.patch_ios_chkbox_lbl.setSizePolicy(sizePolicy4)
|
||||
self.patch_ios_chkbox_lbl.setWordWrap(True)
|
||||
|
||||
self.patch_ios_row.addWidget(self.patch_ios_chkbox_lbl)
|
||||
|
||||
|
||||
self.verticalLayout_7.addLayout(self.patch_ios_row)
|
||||
|
||||
self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Ignored)
|
||||
self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
|
||||
self.verticalLayout_7.addItem(self.verticalSpacer_2)
|
||||
|
||||
@@ -355,31 +245,11 @@ class Ui_MainWindow(object):
|
||||
|
||||
self.verticalLayout_8.addWidget(self.label_4)
|
||||
|
||||
self.pack_vwii_mode_row = QHBoxLayout()
|
||||
self.pack_vwii_mode_row.setObjectName(u"pack_vwii_mode_row")
|
||||
self.pack_vwii_mode_chkbox = QCheckBox(self.centralwidget)
|
||||
self.pack_vwii_mode_chkbox.setObjectName(u"pack_vwii_mode_chkbox")
|
||||
self.pack_vwii_mode_chkbox.setEnabled(False)
|
||||
sizePolicy1.setHeightForWidth(self.pack_vwii_mode_chkbox.sizePolicy().hasHeightForWidth())
|
||||
self.pack_vwii_mode_chkbox.setSizePolicy(sizePolicy1)
|
||||
self.pack_vwii_mode_chkbox.setText(u"")
|
||||
self.pack_vwii_mode_checkbox = WrapCheckboxWidget(self.centralwidget)
|
||||
self.pack_vwii_mode_checkbox.setObjectName(u"pack_vwii_mode_checkbox")
|
||||
self.pack_vwii_mode_checkbox.setEnabled(False)
|
||||
|
||||
self.pack_vwii_mode_row.addWidget(self.pack_vwii_mode_chkbox)
|
||||
|
||||
self.pack_vwii_mode_chkbox_lbl = QLabel(self.centralwidget)
|
||||
self.pack_vwii_mode_chkbox_lbl.setObjectName(u"pack_vwii_mode_chkbox_lbl")
|
||||
self.pack_vwii_mode_chkbox_lbl.setEnabled(True)
|
||||
sizePolicy5 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Preferred)
|
||||
sizePolicy5.setHorizontalStretch(0)
|
||||
sizePolicy5.setVerticalStretch(0)
|
||||
sizePolicy5.setHeightForWidth(self.pack_vwii_mode_chkbox_lbl.sizePolicy().hasHeightForWidth())
|
||||
self.pack_vwii_mode_chkbox_lbl.setSizePolicy(sizePolicy5)
|
||||
self.pack_vwii_mode_chkbox_lbl.setWordWrap(True)
|
||||
|
||||
self.pack_vwii_mode_row.addWidget(self.pack_vwii_mode_chkbox_lbl)
|
||||
|
||||
|
||||
self.verticalLayout_8.addLayout(self.pack_vwii_mode_row)
|
||||
self.verticalLayout_8.addWidget(self.pack_vwii_mode_checkbox)
|
||||
|
||||
self.label_2 = QLabel(self.centralwidget)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
@@ -387,39 +257,15 @@ class Ui_MainWindow(object):
|
||||
|
||||
self.verticalLayout_8.addWidget(self.label_2)
|
||||
|
||||
self.auto_update_row = QHBoxLayout()
|
||||
self.auto_update_row.setObjectName(u"auto_update_row")
|
||||
self.auto_update_chkbox = QCheckBox(self.centralwidget)
|
||||
self.auto_update_chkbox.setObjectName(u"auto_update_chkbox")
|
||||
sizePolicy1.setHeightForWidth(self.auto_update_chkbox.sizePolicy().hasHeightForWidth())
|
||||
self.auto_update_chkbox.setSizePolicy(sizePolicy1)
|
||||
self.auto_update_checkbox = WrapCheckboxWidget(self.centralwidget)
|
||||
self.auto_update_checkbox.setObjectName(u"auto_update_checkbox")
|
||||
|
||||
self.auto_update_row.addWidget(self.auto_update_chkbox)
|
||||
self.verticalLayout_8.addWidget(self.auto_update_checkbox)
|
||||
|
||||
self.auto_update_chkbox_lbl = QLabel(self.centralwidget)
|
||||
self.auto_update_chkbox_lbl.setObjectName(u"auto_update_chkbox_lbl")
|
||||
self.custom_out_dir_checkbox = WrapCheckboxWidget(self.centralwidget)
|
||||
self.custom_out_dir_checkbox.setObjectName(u"custom_out_dir_checkbox")
|
||||
|
||||
self.auto_update_row.addWidget(self.auto_update_chkbox_lbl)
|
||||
|
||||
|
||||
self.verticalLayout_8.addLayout(self.auto_update_row)
|
||||
|
||||
self.custom_out_dir_row = QHBoxLayout()
|
||||
self.custom_out_dir_row.setObjectName(u"custom_out_dir_row")
|
||||
self.custom_out_dir_chkbox = QCheckBox(self.centralwidget)
|
||||
self.custom_out_dir_chkbox.setObjectName(u"custom_out_dir_chkbox")
|
||||
sizePolicy1.setHeightForWidth(self.custom_out_dir_chkbox.sizePolicy().hasHeightForWidth())
|
||||
self.custom_out_dir_chkbox.setSizePolicy(sizePolicy1)
|
||||
|
||||
self.custom_out_dir_row.addWidget(self.custom_out_dir_chkbox)
|
||||
|
||||
self.custom_out_dir_chkbox_lbl = QLabel(self.centralwidget)
|
||||
self.custom_out_dir_chkbox_lbl.setObjectName(u"custom_out_dir_chkbox_lbl")
|
||||
|
||||
self.custom_out_dir_row.addWidget(self.custom_out_dir_chkbox_lbl)
|
||||
|
||||
|
||||
self.verticalLayout_8.addLayout(self.custom_out_dir_row)
|
||||
self.verticalLayout_8.addWidget(self.custom_out_dir_checkbox)
|
||||
|
||||
self.custom_out_dir_entry_row = QHBoxLayout()
|
||||
self.custom_out_dir_entry_row.setObjectName(u"custom_out_dir_entry_row")
|
||||
@@ -438,7 +284,7 @@ class Ui_MainWindow(object):
|
||||
|
||||
self.verticalLayout_8.addLayout(self.custom_out_dir_entry_row)
|
||||
|
||||
self.verticalSpacer = QSpacerItem(20, 50, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.MinimumExpanding)
|
||||
self.verticalSpacer = QSpacerItem(20, 50, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
||||
|
||||
self.verticalLayout_8.addItem(self.verticalSpacer)
|
||||
|
||||
@@ -501,20 +347,9 @@ class Ui_MainWindow(object):
|
||||
self.download_btn.setText(QCoreApplication.translate("MainWindow", u"Start Download", None))
|
||||
self.script_btn.setText(QCoreApplication.translate("MainWindow", u"Run Script", None))
|
||||
self.label_3.setText(QCoreApplication.translate("MainWindow", u"General Settings", None))
|
||||
self.pack_archive_chkbox_lbl.setText(QCoreApplication.translate("MainWindow", u"Pack installable archive (WAD/TAD)", None))
|
||||
self.archive_file_entry.setPlaceholderText(QCoreApplication.translate("MainWindow", u"File Name", None))
|
||||
self.keep_enc_chkbox_lbl.setText(QCoreApplication.translate("MainWindow", u"Keep encrypted contents", None))
|
||||
self.create_dec_chkbox_lbl.setText(QCoreApplication.translate("MainWindow", u"Create decrypted contents (*.app)", None))
|
||||
self.use_local_chkbox_lbl.setText(QCoreApplication.translate("MainWindow", u"Use local files, if they exist", None))
|
||||
self.use_wiiu_nus_chkbox_lbl.setText(QCoreApplication.translate("MainWindow", u"Use the Wii U NUS (faster, only effects Wii/vWii)", None))
|
||||
self.patch_ios_chkbox_lbl.setText(QCoreApplication.translate("MainWindow", u"Apply patches to IOS (Applies to WADs only)", None))
|
||||
self.label_4.setText(QCoreApplication.translate("MainWindow", u"vWii Title Settings", None))
|
||||
self.pack_vwii_mode_chkbox_lbl.setText(QCoreApplication.translate("MainWindow", u"Re-encrypt title using the Wii Common Key", None))
|
||||
self.label_2.setText(QCoreApplication.translate("MainWindow", u"App Settings", None))
|
||||
self.auto_update_chkbox.setText("")
|
||||
self.auto_update_chkbox_lbl.setText(QCoreApplication.translate("MainWindow", u"Check for updates on startup", None))
|
||||
self.custom_out_dir_chkbox.setText("")
|
||||
self.custom_out_dir_chkbox_lbl.setText(QCoreApplication.translate("MainWindow", u"Use a custom download directory", None))
|
||||
self.custom_out_dir_entry.setPlaceholderText(QCoreApplication.translate("MainWindow", u"Output Path", None))
|
||||
self.custom_out_dir_btn.setText(QCoreApplication.translate("MainWindow", u"Select...", None))
|
||||
self.log_text_browser.setMarkdown("")
|
||||
|
||||
46
qt/py/ui_WrapCheckboxWidget.py
Normal file
46
qt/py/ui_WrapCheckboxWidget.py
Normal file
@@ -0,0 +1,46 @@
|
||||
from PySide6.QtCore import Qt, QSize
|
||||
from PySide6.QtWidgets import QCheckBox, QHBoxLayout, QLabel, QWidget, QSizePolicy, QLayout
|
||||
|
||||
class WrapCheckboxWidget(QWidget):
|
||||
def __init__(self, text, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setAttribute(Qt.WA_StyledBackground, True)
|
||||
self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.MinimumExpanding)
|
||||
|
||||
self.checkbox = QCheckBox("")
|
||||
sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Maximum, QSizePolicy.Policy.Fixed)
|
||||
sizePolicy1.setHorizontalStretch(0)
|
||||
sizePolicy1.setVerticalStretch(0)
|
||||
sizePolicy1.setHeightForWidth(self.checkbox.sizePolicy().hasHeightForWidth())
|
||||
self.checkbox.setSizePolicy(sizePolicy1)
|
||||
|
||||
self.label = QLabel(text)
|
||||
self.label.setAlignment(Qt.AlignVCenter | Qt.AlignLeft)
|
||||
self.label.setWordWrap(True)
|
||||
self.label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
||||
|
||||
layout = QHBoxLayout(self)
|
||||
layout.setContentsMargins(5, 5, 5, 5)
|
||||
layout.setSizeConstraint(QLayout.SetMinimumSize)
|
||||
layout.addWidget(self.checkbox)
|
||||
layout.addWidget(self.label)
|
||||
|
||||
# Connect signals so that clicking the label still changes the state of the checkbox.
|
||||
def toggle_checkbox(event):
|
||||
if self.checkbox.isEnabled() and event.button() == Qt.LeftButton:
|
||||
self.checkbox.toggle()
|
||||
self.label.mousePressEvent = toggle_checkbox
|
||||
|
||||
# Bind checkbox stuff for easier access.
|
||||
self.toggled = self.checkbox.toggled
|
||||
|
||||
def isChecked(self):
|
||||
return self.checkbox.isChecked()
|
||||
|
||||
def setChecked(self, checked):
|
||||
self.checkbox.setChecked(checked)
|
||||
|
||||
def setEnabled(self, enabled):
|
||||
super().setEnabled(enabled)
|
||||
self.checkbox.setEnabled(enabled)
|
||||
self.label.setEnabled(enabled)
|
||||
Reference in New Issue
Block a user