Rework the settings user interface (#3534)
|
@ -59,6 +59,7 @@
|
||||||
#include "ui/pages/BasePageProvider.h"
|
#include "ui/pages/BasePageProvider.h"
|
||||||
#include "ui/pages/global/APIPage.h"
|
#include "ui/pages/global/APIPage.h"
|
||||||
#include "ui/pages/global/AccountListPage.h"
|
#include "ui/pages/global/AccountListPage.h"
|
||||||
|
#include "ui/pages/global/AppearancePage.h"
|
||||||
#include "ui/pages/global/ExternalToolsPage.h"
|
#include "ui/pages/global/ExternalToolsPage.h"
|
||||||
#include "ui/pages/global/JavaPage.h"
|
#include "ui/pages/global/JavaPage.h"
|
||||||
#include "ui/pages/global/LanguagePage.h"
|
#include "ui/pages/global/LanguagePage.h"
|
||||||
|
@ -881,13 +882,14 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||||
{
|
{
|
||||||
m_globalSettingsProvider = std::make_shared<GenericPageProvider>(tr("Settings"));
|
m_globalSettingsProvider = std::make_shared<GenericPageProvider>(tr("Settings"));
|
||||||
m_globalSettingsProvider->addPage<LauncherPage>();
|
m_globalSettingsProvider->addPage<LauncherPage>();
|
||||||
|
m_globalSettingsProvider->addPage<LanguagePage>();
|
||||||
|
m_globalSettingsProvider->addPage<AppearancePage>();
|
||||||
m_globalSettingsProvider->addPage<MinecraftPage>();
|
m_globalSettingsProvider->addPage<MinecraftPage>();
|
||||||
m_globalSettingsProvider->addPage<JavaPage>();
|
m_globalSettingsProvider->addPage<JavaPage>();
|
||||||
m_globalSettingsProvider->addPage<LanguagePage>();
|
|
||||||
m_globalSettingsProvider->addPage<ProxyPage>();
|
|
||||||
m_globalSettingsProvider->addPage<ExternalToolsPage>();
|
|
||||||
m_globalSettingsProvider->addPage<AccountListPage>();
|
m_globalSettingsProvider->addPage<AccountListPage>();
|
||||||
m_globalSettingsProvider->addPage<APIPage>();
|
m_globalSettingsProvider->addPage<APIPage>();
|
||||||
|
m_globalSettingsProvider->addPage<ExternalToolsPage>();
|
||||||
|
m_globalSettingsProvider->addPage<ProxyPage>();
|
||||||
}
|
}
|
||||||
|
|
||||||
PixmapCache::setInstance(new PixmapCache(this));
|
PixmapCache::setInstance(new PixmapCache(this));
|
||||||
|
@ -1645,9 +1647,9 @@ void Application::ShowGlobalSettings(class QWidget* parent, QString open_page)
|
||||||
{
|
{
|
||||||
SettingsObject::Lock lock(APPLICATION->settings());
|
SettingsObject::Lock lock(APPLICATION->settings());
|
||||||
PageDialog dlg(m_globalSettingsProvider.get(), open_page, parent);
|
PageDialog dlg(m_globalSettingsProvider.get(), open_page, parent);
|
||||||
|
connect(&dlg, &PageDialog::applied, this, &Application::globalSettingsApplied);
|
||||||
dlg.exec();
|
dlg.exec();
|
||||||
}
|
}
|
||||||
emit globalSettingsClosed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow* Application::showMainWindow(bool minimized)
|
MainWindow* Application::showMainWindow(bool minimized)
|
||||||
|
|
|
@ -196,7 +196,7 @@ class Application : public QApplication {
|
||||||
signals:
|
signals:
|
||||||
void updateAllowedChanged(bool status);
|
void updateAllowedChanged(bool status);
|
||||||
void globalSettingsAboutToOpen();
|
void globalSettingsAboutToOpen();
|
||||||
void globalSettingsClosed();
|
void globalSettingsApplied();
|
||||||
int currentCatChanged(int index);
|
int currentCatChanged(int index);
|
||||||
|
|
||||||
void oauthReplyRecieved(QVariantMap);
|
void oauthReplyRecieved(QVariantMap);
|
||||||
|
|
|
@ -864,7 +864,6 @@ SET(LAUNCHER_SOURCES
|
||||||
ui/setupwizard/LanguageWizardPage.h
|
ui/setupwizard/LanguageWizardPage.h
|
||||||
ui/setupwizard/PasteWizardPage.cpp
|
ui/setupwizard/PasteWizardPage.cpp
|
||||||
ui/setupwizard/PasteWizardPage.h
|
ui/setupwizard/PasteWizardPage.h
|
||||||
ui/setupwizard/ThemeWizardPage.cpp
|
|
||||||
ui/setupwizard/ThemeWizardPage.h
|
ui/setupwizard/ThemeWizardPage.h
|
||||||
ui/setupwizard/AutoJavaWizardPage.cpp
|
ui/setupwizard/AutoJavaWizardPage.cpp
|
||||||
ui/setupwizard/AutoJavaWizardPage.h
|
ui/setupwizard/AutoJavaWizardPage.h
|
||||||
|
@ -958,6 +957,7 @@ SET(LAUNCHER_SOURCES
|
||||||
ui/pages/global/MinecraftPage.h
|
ui/pages/global/MinecraftPage.h
|
||||||
ui/pages/global/LauncherPage.cpp
|
ui/pages/global/LauncherPage.cpp
|
||||||
ui/pages/global/LauncherPage.h
|
ui/pages/global/LauncherPage.h
|
||||||
|
ui/pages/global/AppearancePage.h
|
||||||
ui/pages/global/ProxyPage.cpp
|
ui/pages/global/ProxyPage.cpp
|
||||||
ui/pages/global/ProxyPage.h
|
ui/pages/global/ProxyPage.h
|
||||||
ui/pages/global/APIPage.cpp
|
ui/pages/global/APIPage.cpp
|
||||||
|
@ -1153,8 +1153,8 @@ SET(LAUNCHER_SOURCES
|
||||||
ui/widgets/ProgressWidget.cpp
|
ui/widgets/ProgressWidget.cpp
|
||||||
ui/widgets/WideBar.h
|
ui/widgets/WideBar.h
|
||||||
ui/widgets/WideBar.cpp
|
ui/widgets/WideBar.cpp
|
||||||
ui/widgets/ThemeCustomizationWidget.h
|
ui/widgets/AppearanceWidget.h
|
||||||
ui/widgets/ThemeCustomizationWidget.cpp
|
ui/widgets/AppearanceWidget.cpp
|
||||||
ui/widgets/MinecraftSettingsWidget.h
|
ui/widgets/MinecraftSettingsWidget.h
|
||||||
ui/widgets/MinecraftSettingsWidget.cpp
|
ui/widgets/MinecraftSettingsWidget.cpp
|
||||||
ui/widgets/JavaSettingsWidget.h
|
ui/widgets/JavaSettingsWidget.h
|
||||||
|
@ -1196,7 +1196,6 @@ qt_wrap_ui(LAUNCHER_UI
|
||||||
ui/setupwizard/PasteWizardPage.ui
|
ui/setupwizard/PasteWizardPage.ui
|
||||||
ui/setupwizard/AutoJavaWizardPage.ui
|
ui/setupwizard/AutoJavaWizardPage.ui
|
||||||
ui/setupwizard/LoginWizardPage.ui
|
ui/setupwizard/LoginWizardPage.ui
|
||||||
ui/setupwizard/ThemeWizardPage.ui
|
|
||||||
ui/pages/global/AccountListPage.ui
|
ui/pages/global/AccountListPage.ui
|
||||||
ui/pages/global/JavaPage.ui
|
ui/pages/global/JavaPage.ui
|
||||||
ui/pages/global/LauncherPage.ui
|
ui/pages/global/LauncherPage.ui
|
||||||
|
@ -1230,7 +1229,7 @@ qt_wrap_ui(LAUNCHER_UI
|
||||||
ui/widgets/InfoFrame.ui
|
ui/widgets/InfoFrame.ui
|
||||||
ui/widgets/ModFilterWidget.ui
|
ui/widgets/ModFilterWidget.ui
|
||||||
ui/widgets/SubTaskProgressBar.ui
|
ui/widgets/SubTaskProgressBar.ui
|
||||||
ui/widgets/ThemeCustomizationWidget.ui
|
ui/widgets/AppearanceWidget.ui
|
||||||
ui/widgets/MinecraftSettingsWidget.ui
|
ui/widgets/MinecraftSettingsWidget.ui
|
||||||
ui/widgets/JavaSettingsWidget.ui
|
ui/widgets/JavaSettingsWidget.ui
|
||||||
ui/dialogs/CopyInstanceDialog.ui
|
ui/dialogs/CopyInstanceDialog.ui
|
||||||
|
|
|
@ -95,7 +95,7 @@ void JavaCommon::javaBinaryWasBad(QWidget* parent, const JavaChecker::Result& re
|
||||||
{
|
{
|
||||||
QString text;
|
QString text;
|
||||||
text += QObject::tr(
|
text += QObject::tr(
|
||||||
"The specified Java binary didn't work.<br />You should use the auto-detect feature, "
|
"The specified Java binary didn't work.<br />You should press 'Detect', "
|
||||||
"or set the path to the Java executable.<br />");
|
"or set the path to the Java executable.<br />");
|
||||||
CustomMessageBox::selectable(parent, QObject::tr("Java test failure"), text, QMessageBox::Warning)->show();
|
CustomMessageBox::selectable(parent, QObject::tr("Java test failure"), text, QMessageBox::Warning)->show();
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,5 +43,6 @@
|
||||||
<file>scalable/rename.svg</file>
|
<file>scalable/rename.svg</file>
|
||||||
<file>scalable/launch.svg</file>
|
<file>scalable/launch.svg</file>
|
||||||
<file>scalable/server.svg</file>
|
<file>scalable/server.svg</file>
|
||||||
|
<file>scalable/appearance.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
13
launcher/resources/breeze_dark/scalable/appearance.svg
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||||
|
<defs id="defs3051">
|
||||||
|
<style type="text/css" id="current-color-scheme">
|
||||||
|
.ColorScheme-Text {
|
||||||
|
color:#EFF0F1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</defs>
|
||||||
|
<path style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||||
|
d="M 13.427734 2.0058594 A 1.500133 6.7506007 44.989453 0 0 8.0507812 5.8300781 A 1.500133 6.7506007 44.989453 0 0 5.3945312 8.9160156 C 6.2015113 9.1731156 6.8308906 9.802075 7.0878906 10.609375 A 1.500133 6.7506007 44.989453 0 0 10.171875 7.9511719 A 1.500133 6.7506007 44.989453 0 0 13.882812 2.1171875 A 1.500133 6.7506007 44.989453 0 0 13.634766 2.0058594 A 1.500133 6.7506007 44.989453 0 0 13.427734 2.0058594 z M 5 9.9960938 L 5 10 C 2.00008 10.8042 4.24994 12.7027 2 14 C 4.99992 14 6.5 12.499247 6.5 11.498047 C 6.5 10.998947 6.55095 10.079094 5 9.9960938 z "
|
||||||
|
class="ColorScheme-Text"
|
||||||
|
/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 900 B |
|
@ -43,5 +43,6 @@
|
||||||
<file>scalable/rename.svg</file>
|
<file>scalable/rename.svg</file>
|
||||||
<file>scalable/launch.svg</file>
|
<file>scalable/launch.svg</file>
|
||||||
<file>scalable/server.svg</file>
|
<file>scalable/server.svg</file>
|
||||||
|
<file>scalable/appearance.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
13
launcher/resources/breeze_light/scalable/appearance.svg
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||||
|
<defs id="defs3051">
|
||||||
|
<style type="text/css" id="current-color-scheme">
|
||||||
|
.ColorScheme-Text {
|
||||||
|
color:#232629;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</defs>
|
||||||
|
<path style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||||
|
d="M 13.427734 2.0058594 A 1.500133 6.7506007 44.989453 0 0 8.0507812 5.8300781 A 1.500133 6.7506007 44.989453 0 0 5.3945312 8.9160156 C 6.2015113 9.1731156 6.8308906 9.802075 7.0878906 10.609375 A 1.500133 6.7506007 44.989453 0 0 10.171875 7.9511719 A 1.500133 6.7506007 44.989453 0 0 13.882812 2.1171875 A 1.500133 6.7506007 44.989453 0 0 13.634766 2.0058594 A 1.500133 6.7506007 44.989453 0 0 13.427734 2.0058594 z M 5 9.9960938 L 5 10 C 2.00008 10.8042 4.24994 12.7027 2 14 C 4.99992 14 6.5 12.499247 6.5 11.498047 C 6.5 10.998947 6.55095 10.079094 5 9.9960938 z "
|
||||||
|
class="ColorScheme-Text"
|
||||||
|
/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 900 B |
|
@ -49,5 +49,6 @@
|
||||||
<file>scalable/rename.svg</file>
|
<file>scalable/rename.svg</file>
|
||||||
<file>scalable/server.svg</file>
|
<file>scalable/server.svg</file>
|
||||||
<file>scalable/launch.svg</file>
|
<file>scalable/launch.svg</file>
|
||||||
|
<file>scalable/appearance.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
1
launcher/resources/flat/scalable/appearance.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#757575"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3zm13.71-9.37l-1.34-1.34c-.39-.39-1.02-.39-1.41 0L9 12.25 11.75 15l8.96-8.96c.39-.39.39-1.02 0-1.41z"/></svg>
|
After Width: | Height: | Size: 354 B |
|
@ -49,5 +49,6 @@
|
||||||
<file>scalable/tag.svg</file>
|
<file>scalable/tag.svg</file>
|
||||||
<file>scalable/launch.svg</file>
|
<file>scalable/launch.svg</file>
|
||||||
<file>scalable/server.svg</file>
|
<file>scalable/server.svg</file>
|
||||||
|
<file>scalable/appearance.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
1
launcher/resources/flat_white/scalable/appearance.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#eeeeee"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3zm13.71-9.37l-1.34-1.34c-.39-.39-1.02-.39-1.41 0L9 12.25 11.75 15l8.96-8.96c.39-.39.39-1.02 0-1.41z"/></svg>
|
After Width: | Height: | Size: 354 B |
|
@ -347,6 +347,7 @@
|
||||||
<file>scalable/export.svg</file>
|
<file>scalable/export.svg</file>
|
||||||
<file>scalable/launch.svg</file>
|
<file>scalable/launch.svg</file>
|
||||||
<file>scalable/server.svg</file>
|
<file>scalable/server.svg</file>
|
||||||
|
<file>scalable/appearance.svg</file>
|
||||||
|
|
||||||
<file>scalable/instances/quiltmc.svg</file> <!-- CC0 QuiltMC -->
|
<file>scalable/instances/quiltmc.svg</file> <!-- CC0 QuiltMC -->
|
||||||
<file>scalable/instances/fabricmc.svg</file> <!-- CC0 unascribed, https://github.com/FabricMC/community/blob/main/media/unascribed/README.md -->
|
<file>scalable/instances/fabricmc.svg</file> <!-- CC0 unascribed, https://github.com/FabricMC/community/blob/main/media/unascribed/README.md -->
|
||||||
|
|
2440
launcher/resources/multimc/scalable/appearance.svg
Normal file
After Width: | Height: | Size: 154 KiB |
|
@ -41,5 +41,6 @@
|
||||||
<file>scalable/launch.svg</file>
|
<file>scalable/launch.svg</file>
|
||||||
<file>scalable/shortcut.svg</file>
|
<file>scalable/shortcut.svg</file>
|
||||||
<file>scalable/server.svg</file>
|
<file>scalable/server.svg</file>
|
||||||
|
<file>scalable/appearance.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
65
launcher/resources/pe_blue/scalable/appearance.svg
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="Calque_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 32 32"
|
||||||
|
enable-background="new 0 0 32 32"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="appearance.svg"
|
||||||
|
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#000000"
|
||||||
|
borderopacity="0.25"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:zoom="11.313708"
|
||||||
|
inkscape:cx="4.9497475"
|
||||||
|
inkscape:cy="37.388271"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1011"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="g7954"
|
||||||
|
showgrid="false" /><defs
|
||||||
|
id="defs45" />
|
||||||
|
|
||||||
|
<g
|
||||||
|
id="g7954"><path
|
||||||
|
id="path2"
|
||||||
|
d="M 26,32 H 6 C 2.7,32 0,29.3 0,26 V 6 C 0,2.7 2.7,0 6,0 h 20 c 3.3,0 6,2.7 6,6 v 20 c 0,3.3 -2.7,6 -6,6 z"
|
||||||
|
fill="#3366cc"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
fill-rule="evenodd" /><path
|
||||||
|
fill="#daeeff"
|
||||||
|
fill-rule="evenodd"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
id="path4"
|
||||||
|
d="M 28,6 C 28,4.9 27.1,4 26,4 H 6 C 4.9,4 4,4.9 4,6 v 20 c 0,1.1 0.9,2 2,2 h 20 c 1.1,0 2,-0.9 2,-2 z" /><path
|
||||||
|
fill="none"
|
||||||
|
d="M 8.9659036,28 H 22.965904 c 1.1,0 2,-0.9 2,-2 V 15 14 H 6.9659036 v 1 11 c 0,1.1 0.9,2 2,2 z"
|
||||||
|
id="path8" /><rect
|
||||||
|
style="fill:#000000;fill-opacity:0;stroke:none;stroke-width:0.000000879999;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
id="rect2311"
|
||||||
|
width="29.020048"
|
||||||
|
height="4"
|
||||||
|
x="1.4899759"
|
||||||
|
y="7.1611009" /><g
|
||||||
|
id="g2657"
|
||||||
|
transform="rotate(31.454004,7.3789217,28.015625)"><path
|
||||||
|
id="path5-56"
|
||||||
|
style="fill:#c1272d;fill-opacity:1;stroke-width:14.5284"
|
||||||
|
d="M 8.413071,2.4595861 A 2.5,8.0000002 0 0 0 6.3465633,10.337319 2.5,8.0000002 0 0 0 7.4458626,16.960111 C 7.7356137,16.430277 8.2119852,16.01524 8.9151067,15.96976 9.5063364,15.93152 9.9629895,16.336614 10.250228,16.958042 A 2.5,8.0000002 0 0 0 11.346521,10.337343 2.5,8.0000002 0 0 0 8.8459304,2.3382251 2.5,8.0000002 0 0 0 8.413071,2.4595861 Z" /><path
|
||||||
|
id="path5-6"
|
||||||
|
style="fill:#c1272d;fill-opacity:1;stroke-width:9.6096"
|
||||||
|
d="m 9.1439767,17.889764 c -1.3309058,0.08609 -1.8604029,1.491611 -1.8189608,2.506407 0.045613,1.116922 1.4392755,2.225341 0.1366377,3.772111 1.6687108,-0.08051 2.5726364,-1.0077 3.1912724,-2.25073 0.506557,-1.849334 -0.145661,-4.115969 -1.5089493,-4.027788 z"
|
||||||
|
sodipodi:nodetypes="ssccs" /></g></g></svg>
|
After Width: | Height: | Size: 2.7 KiB |
|
@ -41,5 +41,6 @@
|
||||||
<file>scalable/launch.svg</file>
|
<file>scalable/launch.svg</file>
|
||||||
<file>scalable/shortcut.svg</file>
|
<file>scalable/shortcut.svg</file>
|
||||||
<file>scalable/server.svg</file>
|
<file>scalable/server.svg</file>
|
||||||
|
<file>scalable/appearance.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
71
launcher/resources/pe_colored/scalable/appearance.svg
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="Calque_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 32 32"
|
||||||
|
enable-background="new 0 0 32 32"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="appearance.svg"
|
||||||
|
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#000000"
|
||||||
|
borderopacity="0.25"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:zoom="16"
|
||||||
|
inkscape:cx="-7.8125"
|
||||||
|
inkscape:cy="17.6875"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1011"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="g7954"
|
||||||
|
showgrid="false"
|
||||||
|
showguides="false" /><defs
|
||||||
|
id="defs45" />
|
||||||
|
|
||||||
|
<g
|
||||||
|
id="g7954"><path
|
||||||
|
fill="none"
|
||||||
|
d="M 8.9659036,28 H 22.965904 c 1.1,0 2,-0.9 2,-2 V 15 14 H 6.9659036 v 1 11 c 0,1.1 0.9,2 2,2 z"
|
||||||
|
id="path8" /><rect
|
||||||
|
style="fill:#000000;fill-opacity:0;stroke:none;stroke-width:0.000000879999;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
id="rect2311"
|
||||||
|
width="29.020048"
|
||||||
|
height="4"
|
||||||
|
x="1.4899759"
|
||||||
|
y="7.1611009" /><path
|
||||||
|
id="path2-6"
|
||||||
|
d="M 28,6 C 28,4.9 27.1,4 26,4 H 6 C 4.9,4 4,4.9 4,6 v 20 c 0,1.1 0.9,2 2,2 h 20 c 1.1,0 2,-0.9 2,-2 z"
|
||||||
|
fill="#f2f2f2"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
fill-rule="evenodd" /><g
|
||||||
|
id="g12"><path
|
||||||
|
id="path6"
|
||||||
|
d="m 6,28 h 20 c 1.1,0 2,-0.9 2,-2 V 9 6 C 28,4.9 27.1,4 26,4 H 6 C 4.9,4 4,4.9 4,6 v 3 17 c 0,1.1 0.9,2 2,2 z"
|
||||||
|
fill="none" /><path
|
||||||
|
id="path8-7"
|
||||||
|
d="M 26,0 H 6 C 2.7,0 0,2.7 0,6 V 9 H 4 V 6 C 4,4.9 4.9,4 6,4 h 20 c 1.1,0 2,0.9 2,2 v 3 h 4 V 6 C 32,2.7 29.3,0 26,0 Z"
|
||||||
|
fill="#39b54a" /><path
|
||||||
|
id="path10-5"
|
||||||
|
d="m 28,26 c 0,1.1 -0.9,2 -2,2 H 6 C 4.9,28 4,27.1 4,26 V 9 H 0 v 17 c 0,3.3 2.7,6 6,6 h 20 c 3.3,0 6,-2.7 6,-6 V 9 h -4 z"
|
||||||
|
fill="#8c6239" /></g><g
|
||||||
|
id="g2657"
|
||||||
|
transform="rotate(31.454004,7.3789216,28.015625)"><path
|
||||||
|
id="path5"
|
||||||
|
style="fill:#c1272d;fill-opacity:1;stroke-width:14.5284"
|
||||||
|
d="M 8.413071,2.4595861 A 2.5,8.0000002 0 0 0 6.3465633,10.337319 2.5,8.0000002 0 0 0 7.4458626,16.960111 C 7.7356137,16.430277 8.2119852,16.01524 8.9151067,15.96976 9.5063364,15.93152 9.9629895,16.336614 10.250228,16.958042 A 2.5,8.0000002 0 0 0 11.346521,10.337343 2.5,8.0000002 0 0 0 8.8459304,2.3382251 2.5,8.0000002 0 0 0 8.413071,2.4595861 Z" /><path
|
||||||
|
id="path5-6"
|
||||||
|
style="fill:#c1272d;fill-opacity:1;stroke-width:9.6096"
|
||||||
|
d="m 9.1439767,17.889764 c -1.3309058,0.08609 -1.8604029,1.491611 -1.8189608,2.506407 0.045613,1.116922 1.4392755,2.225341 0.1366377,3.772111 1.6687108,-0.08051 2.5726364,-1.0077 3.1912724,-2.25073 0.506557,-1.849334 -0.145661,-4.115969 -1.5089493,-4.027788 z"
|
||||||
|
sodipodi:nodetypes="ssccs" /></g></g></svg>
|
After Width: | Height: | Size: 3.1 KiB |
|
@ -41,5 +41,6 @@
|
||||||
<file>scalable/launch.svg</file>
|
<file>scalable/launch.svg</file>
|
||||||
<file>scalable/shortcut.svg</file>
|
<file>scalable/shortcut.svg</file>
|
||||||
<file>scalable/server.svg</file>
|
<file>scalable/server.svg</file>
|
||||||
|
<file>scalable/appearance.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
65
launcher/resources/pe_dark/scalable/appearance.svg
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="Calque_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 32 32"
|
||||||
|
enable-background="new 0 0 32 32"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="appearance.svg"
|
||||||
|
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#000000"
|
||||||
|
borderopacity="0.25"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:zoom="8"
|
||||||
|
inkscape:cx="17.5"
|
||||||
|
inkscape:cy="18.5"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1011"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="g7954"
|
||||||
|
showgrid="false" /><defs
|
||||||
|
id="defs45" />
|
||||||
|
|
||||||
|
<g
|
||||||
|
id="g7954"><path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
d="M 26,32 H 6 C 2.7,32 0,29.3 0,26 V 6 C 0,2.7 2.7,0 6,0 h 20 c 3.3,0 6,2.7 6,6 v 20 c 0,3.3 -2.7,6 -6,6 z"
|
||||||
|
id="path2" /><path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
fill="#f2f2f2"
|
||||||
|
d="M 28,6 C 28,4.9 27.1,4 26,4 H 6 C 4.9,4 4,4.9 4,6 v 20 c 0,1.1 0.9,2 2,2 h 20 c 1.1,0 2,-0.9 2,-2 z"
|
||||||
|
id="path4" /><path
|
||||||
|
fill="none"
|
||||||
|
d="M 8.9659036,28 H 22.965904 c 1.1,0 2,-0.9 2,-2 V 15 14 H 6.9659036 v 1 11 c 0,1.1 0.9,2 2,2 z"
|
||||||
|
id="path8" /><rect
|
||||||
|
style="fill:#000000;fill-opacity:0;stroke:none;stroke-width:0.000000879999;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
id="rect2311"
|
||||||
|
width="29.020048"
|
||||||
|
height="4"
|
||||||
|
x="1.4899759"
|
||||||
|
y="7.1611009" /><g
|
||||||
|
id="g2657"
|
||||||
|
transform="rotate(31.454004,7.3789216,28.015625)"
|
||||||
|
style="fill:#666666;fill-opacity:1"><path
|
||||||
|
id="path5-7"
|
||||||
|
style="fill:#666666;fill-opacity:1;stroke-width:14.5284"
|
||||||
|
d="M 8.413071,2.4595861 A 2.5,8.0000002 0 0 0 6.3465633,10.337319 2.5,8.0000002 0 0 0 7.4458626,16.960111 C 7.7356137,16.430277 8.2119852,16.01524 8.9151067,15.96976 9.5063364,15.93152 9.9629895,16.336614 10.250228,16.958042 A 2.5,8.0000002 0 0 0 11.346521,10.337343 2.5,8.0000002 0 0 0 8.8459304,2.3382251 2.5,8.0000002 0 0 0 8.413071,2.4595861 Z" /><path
|
||||||
|
id="path5-6"
|
||||||
|
style="fill:#666666;fill-opacity:1;stroke-width:9.6096"
|
||||||
|
d="m 9.1439767,17.889764 c -1.3309058,0.08609 -1.8604029,1.491611 -1.8189608,2.506407 0.045613,1.116922 1.4392755,2.225341 0.1366377,3.772111 1.6687108,-0.08051 2.5726364,-1.0077 3.1912724,-2.25073 0.506557,-1.849334 -0.145661,-4.115969 -1.5089493,-4.027788 z"
|
||||||
|
sodipodi:nodetypes="ssccs" /></g></g></svg>
|
After Width: | Height: | Size: 2.7 KiB |
|
@ -41,5 +41,6 @@
|
||||||
<file>scalable/launch.svg</file>
|
<file>scalable/launch.svg</file>
|
||||||
<file>scalable/shortcut.svg</file>
|
<file>scalable/shortcut.svg</file>
|
||||||
<file>scalable/server.svg</file>
|
<file>scalable/server.svg</file>
|
||||||
|
<file>scalable/appearance.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
66
launcher/resources/pe_light/scalable/appearance.svg
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
id="Calque_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 32 32"
|
||||||
|
enable-background="new 0 0 32 32"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="appearance.svg"
|
||||||
|
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#000000"
|
||||||
|
borderopacity="0.25"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:zoom="16"
|
||||||
|
inkscape:cx="16.875"
|
||||||
|
inkscape:cy="15.4375"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1011"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="g7954"
|
||||||
|
showgrid="false" /><defs
|
||||||
|
id="defs45" />
|
||||||
|
|
||||||
|
<g
|
||||||
|
id="g7954"><path
|
||||||
|
id="path2"
|
||||||
|
d="M 28,6 C 28,4.9 27.1,4 26,4 H 6 C 4.9,4 4,4.9 4,6 v 20 c 0,1.1 0.9,2 2,2 h 20 c 1.1,0 2,-0.9 2,-2 z"
|
||||||
|
fill="#4d4d4d"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
fill-rule="evenodd" /><path
|
||||||
|
id="path6"
|
||||||
|
d="M 26,32 H 6 C 2.7,32 0,29.3 0,26 V 6 C 0,2.7 2.7,0 6,0 h 20 c 3.3,0 6,2.7 6,6 v 20 c 0,3.3 -2.7,6 -6,6 z M 28,6 C 28,4.9 27.1,4 26,4 H 6 C 4.9,4 4,4.9 4,6 v 20 c 0,1.1 0.9,2 2,2 h 20 c 1.1,0 2,-0.9 2,-2 z"
|
||||||
|
fill="#f2f2f2"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
fill-rule="evenodd" /><path
|
||||||
|
fill="none"
|
||||||
|
d="M 8.9659036,28 H 22.965904 c 1.1,0 2,-0.9 2,-2 V 15 14 H 6.9659036 v 1 11 c 0,1.1 0.9,2 2,2 z"
|
||||||
|
id="path8" /><rect
|
||||||
|
style="fill:#000000;fill-opacity:0;stroke:none;stroke-width:0.000000879999;stroke-linecap:round;stroke-linejoin:round"
|
||||||
|
id="rect2311"
|
||||||
|
width="29.020048"
|
||||||
|
height="4"
|
||||||
|
x="1.4899759"
|
||||||
|
y="7.1611009" /><g
|
||||||
|
id="g2657"
|
||||||
|
transform="rotate(31.454004,7.3789216,28.015625)"
|
||||||
|
style="fill:#ffffff"><path
|
||||||
|
id="path5"
|
||||||
|
style="fill:#ffffff;fill-opacity:1;stroke-width:14.5284"
|
||||||
|
d="M 8.413071,2.4595861 A 2.5,8.0000002 0 0 0 6.3465633,10.337319 2.5,8.0000002 0 0 0 7.4458626,16.960111 C 7.7356137,16.430277 8.2119852,16.01524 8.9151067,15.96976 9.5063364,15.93152 9.9629895,16.336614 10.250228,16.958042 A 2.5,8.0000002 0 0 0 11.346521,10.337343 2.5,8.0000002 0 0 0 8.8459304,2.3382251 2.5,8.0000002 0 0 0 8.413071,2.4595861 Z" /><path
|
||||||
|
id="path5-6"
|
||||||
|
style="fill:#ffffff;fill-opacity:1;stroke-width:9.6096"
|
||||||
|
d="m 9.1439767,17.889764 c -1.3309058,0.08609 -1.8604029,1.491611 -1.8189608,2.506407 0.045613,1.116922 1.4392755,2.225341 0.1366377,3.772111 1.6687108,-0.08051 2.5726364,-1.0077 3.1912724,-2.25073 0.506557,-1.849334 -0.145661,-4.115969 -1.5089493,-4.027788 z"
|
||||||
|
sodipodi:nodetypes="ssccs" /></g></g></svg>
|
After Width: | Height: | Size: 2.8 KiB |
|
@ -24,7 +24,7 @@ JVisualVM::JVisualVM(SettingsObjectPtr settings, InstancePtr instance, QObject*
|
||||||
|
|
||||||
void JVisualVM::profilerStarted()
|
void JVisualVM::profilerStarted()
|
||||||
{
|
{
|
||||||
emit readyToLaunch(tr("JVisualVM started"));
|
emit readyToLaunch(tr("VisualVM started"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void JVisualVM::profilerFinished([[maybe_unused]] int exit, QProcess::ExitStatus status)
|
void JVisualVM::profilerFinished([[maybe_unused]] int exit, QProcess::ExitStatus status)
|
||||||
|
@ -82,7 +82,7 @@ bool JVisualVMFactory::check(const QString& path, QString* error)
|
||||||
}
|
}
|
||||||
QFileInfo finfo(path);
|
QFileInfo finfo(path);
|
||||||
if (!finfo.isExecutable() || !finfo.fileName().contains("visualvm")) {
|
if (!finfo.isExecutable() || !finfo.fileName().contains("visualvm")) {
|
||||||
*error = QObject::tr("Invalid path to JVisualVM");
|
*error = QObject::tr("Invalid path to VisualVM");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
class JVisualVMFactory : public BaseProfilerFactory {
|
class JVisualVMFactory : public BaseProfilerFactory {
|
||||||
public:
|
public:
|
||||||
QString name() const override { return "JVisualVM"; }
|
QString name() const override { return "VisualVM"; }
|
||||||
void registerSettings(SettingsObjectPtr settings) override;
|
void registerSettings(SettingsObjectPtr settings) override;
|
||||||
BaseExternalTool* createTool(InstancePtr instance, QObject* parent = 0) override;
|
BaseExternalTool* createTool(InstancePtr instance, QObject* parent = 0) override;
|
||||||
bool check(QString* error) override;
|
bool check(QString* error) override;
|
||||||
|
|
|
@ -111,7 +111,7 @@ InstanceWindow::InstanceWindow(InstancePtr instance, QWidget* parent) : QMainWin
|
||||||
m_container->addButtons(horizontalLayout);
|
m_container->addButtons(horizontalLayout);
|
||||||
|
|
||||||
connect(m_instance.get(), &BaseInstance::profilerChanged, this, &InstanceWindow::updateButtons);
|
connect(m_instance.get(), &BaseInstance::profilerChanged, this, &InstanceWindow::updateButtons);
|
||||||
connect(APPLICATION, &Application::globalSettingsClosed, this, &InstanceWindow::updateButtons);
|
connect(APPLICATION, &Application::globalSettingsApplied, this, &InstanceWindow::updateButtons);
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore window state
|
// restore window state
|
||||||
|
|
|
@ -379,7 +379,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||||
connect(APPLICATION->instances().get(), &InstanceList::instanceSelectRequest, this, &MainWindow::instanceSelectRequest);
|
connect(APPLICATION->instances().get(), &InstanceList::instanceSelectRequest, this, &MainWindow::instanceSelectRequest);
|
||||||
|
|
||||||
// When the global settings page closes, we want to know about it and update our state
|
// When the global settings page closes, we want to know about it and update our state
|
||||||
connect(APPLICATION, &Application::globalSettingsClosed, this, &MainWindow::globalSettingsClosed);
|
connect(APPLICATION, &Application::globalSettingsApplied, this, &MainWindow::globalSettingsClosed);
|
||||||
|
|
||||||
m_statusLeft = new QLabel(tr("No instance selected"), this);
|
m_statusLeft = new QLabel(tr("No instance selected"), this);
|
||||||
m_statusCenter = new QLabel(tr("Total playtime: 0s"), this);
|
m_statusCenter = new QLabel(tr("Total playtime: 0s"), this);
|
||||||
|
|
|
@ -21,42 +21,63 @@
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "settings/SettingsObject.h"
|
|
||||||
|
|
||||||
#include "ui/widgets/IconLabel.h"
|
|
||||||
#include "ui/widgets/PageContainer.h"
|
#include "ui/widgets/PageContainer.h"
|
||||||
|
|
||||||
PageDialog::PageDialog(BasePageProvider* pageProvider, QString defaultId, QWidget* parent) : QDialog(parent)
|
PageDialog::PageDialog(BasePageProvider* pageProvider, QString defaultId, QWidget* parent) : QDialog(parent)
|
||||||
{
|
{
|
||||||
setWindowTitle(pageProvider->dialogTitle());
|
setWindowTitle(pageProvider->dialogTitle());
|
||||||
m_container = new PageContainer(pageProvider, defaultId, this);
|
m_container = new PageContainer(pageProvider, std::move(defaultId), this);
|
||||||
|
|
||||||
|
auto* mainLayout = new QVBoxLayout(this);
|
||||||
|
|
||||||
|
auto* focusStealer = new QPushButton(this);
|
||||||
|
mainLayout->addWidget(focusStealer);
|
||||||
|
focusStealer->setDefault(true);
|
||||||
|
focusStealer->hide();
|
||||||
|
|
||||||
QVBoxLayout* mainLayout = new QVBoxLayout;
|
|
||||||
mainLayout->addWidget(m_container);
|
mainLayout->addWidget(m_container);
|
||||||
mainLayout->setSpacing(0);
|
mainLayout->setSpacing(0);
|
||||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close);
|
auto* buttons = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
buttons->button(QDialogButtonBox::Close)->setDefault(true);
|
buttons->button(QDialogButtonBox::Ok)->setText(tr("&OK"));
|
||||||
buttons->button(QDialogButtonBox::Close)->setText(tr("Close"));
|
buttons->button(QDialogButtonBox::Cancel)->setText(tr("&Cancel"));
|
||||||
buttons->button(QDialogButtonBox::Help)->setText(tr("Help"));
|
buttons->button(QDialogButtonBox::Help)->setText(tr("Help"));
|
||||||
buttons->setContentsMargins(6, 0, 6, 0);
|
buttons->setContentsMargins(6, 0, 6, 0);
|
||||||
m_container->addButtons(buttons);
|
m_container->addButtons(buttons);
|
||||||
|
|
||||||
connect(buttons->button(QDialogButtonBox::Close), SIGNAL(clicked()), this, SLOT(close()));
|
connect(buttons->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &PageDialog::accept);
|
||||||
connect(buttons->button(QDialogButtonBox::Help), SIGNAL(clicked()), m_container, SLOT(help()));
|
connect(buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &PageDialog::reject);
|
||||||
|
connect(buttons->button(QDialogButtonBox::Help), &QPushButton::clicked, m_container, &PageContainer::help);
|
||||||
|
|
||||||
restoreGeometry(QByteArray::fromBase64(APPLICATION->settings()->get("PagedGeometry").toByteArray()));
|
restoreGeometry(QByteArray::fromBase64(APPLICATION->settings()->get("PagedGeometry").toByteArray()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PageDialog::accept()
|
||||||
|
{
|
||||||
|
if (handleClose())
|
||||||
|
QDialog::accept();
|
||||||
|
}
|
||||||
|
|
||||||
void PageDialog::closeEvent(QCloseEvent* event)
|
void PageDialog::closeEvent(QCloseEvent* event)
|
||||||
{
|
{
|
||||||
qDebug() << "Paged dialog close requested";
|
if (handleClose())
|
||||||
if (m_container->prepareToClose()) {
|
|
||||||
qDebug() << "Paged dialog close approved";
|
|
||||||
APPLICATION->settings()->set("PagedGeometry", saveGeometry().toBase64());
|
|
||||||
qDebug() << "Paged dialog geometry saved";
|
|
||||||
QDialog::closeEvent(event);
|
QDialog::closeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PageDialog::handleClose()
|
||||||
|
{
|
||||||
|
qDebug() << "Paged dialog close requested";
|
||||||
|
if (!m_container->prepareToClose())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
qDebug() << "Paged dialog close approved";
|
||||||
|
APPLICATION->settings()->set("PagedGeometry", saveGeometry().toBase64());
|
||||||
|
qDebug() << "Paged dialog geometry saved";
|
||||||
|
|
||||||
|
emit applied();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,13 @@ class PageDialog : public QDialog {
|
||||||
explicit PageDialog(BasePageProvider* pageProvider, QString defaultId = QString(), QWidget* parent = 0);
|
explicit PageDialog(BasePageProvider* pageProvider, QString defaultId = QString(), QWidget* parent = 0);
|
||||||
virtual ~PageDialog() {}
|
virtual ~PageDialog() {}
|
||||||
|
|
||||||
private slots:
|
signals:
|
||||||
virtual void closeEvent(QCloseEvent* event);
|
void applied();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void accept() override;
|
||||||
|
void closeEvent(QCloseEvent* event) override;
|
||||||
|
bool handleClose();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PageContainer* m_container;
|
PageContainer* m_container;
|
||||||
|
|
|
@ -53,7 +53,7 @@ class APIPage : public QWidget, public BasePage {
|
||||||
explicit APIPage(QWidget* parent = 0);
|
explicit APIPage(QWidget* parent = 0);
|
||||||
~APIPage();
|
~APIPage();
|
||||||
|
|
||||||
QString displayName() const override { return tr("APIs"); }
|
QString displayName() const override { return tr("Services"); }
|
||||||
QIcon icon() const override { return APPLICATION->getThemedIcon("worlds"); }
|
QIcon icon() const override { return APPLICATION->getThemedIcon("worlds"); }
|
||||||
QString id() const override { return "apis"; }
|
QString id() const override { return "apis"; }
|
||||||
QString helpPage() const override { return "APIs"; }
|
QString helpPage() const override { return "APIs"; }
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<height>620</height>
|
<height>620</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -24,15 +24,20 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
<property name="currentIndex">
|
<property name="widgetResizable">
|
||||||
<number>0</number>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
<attribute name="title">
|
<property name="geometry">
|
||||||
<string>Services</string>
|
<rect>
|
||||||
</attribute>
|
<x>0</x>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<y>-216</y>
|
||||||
|
<width>816</width>
|
||||||
|
<height>832</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_paste">
|
<widget class="QGroupBox" name="groupBox_paste">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -50,7 +55,14 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="pasteTypeComboBox"/>
|
<widget class="QComboBox" name="pasteTypeComboBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="baseURLLabel">
|
<widget class="QLabel" name="baseURLLabel">
|
||||||
|
@ -65,7 +77,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="baseURLEntry">
|
<widget class="QLineEdit" name="baseURLEntry">
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string/>
|
<string>Use Default</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="clearButtonEnabled">
|
<property name="clearButtonEnabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
@ -91,30 +103,10 @@
|
||||||
<string>Meta&data Server</string>
|
<string>Meta&data Server</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>You can set this to a third-party metadata server to use patched libraries or other hacks.</string>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::RichText</enum>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="metaURL">
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enter a custom URL for meta here.</string>
|
<string>You can set this to a third-party metadata server to use patched libraries or other hacks.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::RichText</enum>
|
<enum>Qt::RichText</enum>
|
||||||
|
@ -127,35 +119,80 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="metaURL">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Use Default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_2">
|
<widget class="QGroupBox" name="groupBox_ua">
|
||||||
<property name="orientation">
|
<property name="minimumSize">
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>0</width>
|
||||||
<height>40</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
<property name="title">
|
||||||
|
<string>User Agent</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="userAgentLineEdit">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Use Default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="userAgentLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enter a custom User Agent here. The special string $LAUNCHER_VER will be replaced with the version of the launcher.</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tab_2">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>API Keys</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_msa">
|
<widget class="QGroupBox" name="groupBox_msa">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>&Microsoft Authentication</string>
|
<string>&API Keys</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="msaClientIDLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Microsoft Authentation</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>msaClientID</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="msaClientID">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Use Default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -170,99 +207,83 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="msaClientID">
|
<spacer name="verticalSpacer">
|
||||||
<property name="placeholderText">
|
<property name="orientation">
|
||||||
<string>(Default)</string>
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="modrinthTokenLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Mod&rinth</string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>modrinthToken</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enter a custom client ID for Microsoft Authentication here.</string>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::RichText</enum>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_modrinth">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>&Modrinth API</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_8">
|
|
||||||
<property name="text">
|
|
||||||
<string><html><head/><body><p>Note: you only need to set this to access private data. Read the <a href="https://docs.modrinth.com/api/#authentication">documentation</a> for more information.</p></body></html></string>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_7">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enter a custom API token for Modrinth here.</string>
|
|
||||||
</property>
|
|
||||||
<property name="textFormat">
|
|
||||||
<enum>Qt::RichText</enum>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLineEdit" name="modrinthToken">
|
<widget class="QLineEdit" name="modrinthToken">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>(None)</string>
|
<string>Use None</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item>
|
||||||
</widget>
|
<widget class="QLabel" name="label_8">
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_flame">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string>&CurseForge Core API</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_10">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Note: you probably don't need to set this if CurseForge already works.</string>
|
<string><html><head/><body><p>Note: you only need to set this to access private data. Read the <a href="https://docs.modrinth.com/api/#authentication">documentation</a> for more information.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item>
|
||||||
<widget class="QLabel" name="label_9">
|
<spacer name="verticalSpacer_4">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="flameKeyLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enter a custom API Key for CurseForge here.</string>
|
<string>&CurseForge</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::RichText</enum>
|
<enum>Qt::RichText</enum>
|
||||||
|
@ -273,45 +294,71 @@
|
||||||
<property name="openExternalLinks">
|
<property name="openExternalLinks">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>flameKey</cstring>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
<widget class="QLineEdit" name="flameKey">
|
<widget class="QLineEdit" name="flameKey">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>(Default)</string>
|
<string>Use Default</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Technic Client ID</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_11">
|
<widget class="QLabel" name="label_10">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p>Note: you only need to set this to access private data.</p></body></html></string>
|
<string>Note: you probably don't need to set this if CurseForge already works.</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_3">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_12">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Technic</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>technicClientID</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="technicClientID">
|
<widget class="QLineEdit" name="technicClientID">
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>(None)</string>
|
<string>Use Default</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_12">
|
<widget class="QLabel" name="label_11">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enter a custom GUID client ID for Technic here.</string>
|
<string><html><head/><body><p>Note: you only need to set this to access private data.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -319,61 +366,16 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tab_3">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Miscellaneous</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_ua">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
|
||||||
<string>User Agent</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="userAgentLineEdit"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="userAgentLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enter a custom User Agent here. The special string $LAUNCHER_VER will be replaced with the version of the launcher.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
67
launcher/ui/pages/global/AppearancePage.h
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
/*
|
||||||
|
* Prism Launcher - Minecraft Launcher
|
||||||
|
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* This file incorporates work covered by the following copyright and
|
||||||
|
* permission notice:
|
||||||
|
*
|
||||||
|
* Copyright 2013-2021 MultiMC Contributors
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QLayout>
|
||||||
|
#include "Application.h"
|
||||||
|
#include "java/JavaChecker.h"
|
||||||
|
#include "translations/TranslationsModel.h"
|
||||||
|
#include "ui/pages/BasePage.h"
|
||||||
|
#include "ui/widgets/AppearanceWidget.h"
|
||||||
|
|
||||||
|
class QTextCharFormat;
|
||||||
|
class SettingsObject;
|
||||||
|
|
||||||
|
class AppearancePage : public AppearanceWidget, public BasePage {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AppearancePage(QWidget* parent = nullptr) : AppearanceWidget(false, parent) { layout()->setContentsMargins(0, 0, 6, 0); }
|
||||||
|
|
||||||
|
QString displayName() const override { return tr("Appearance"); }
|
||||||
|
QIcon icon() const override { return APPLICATION->getThemedIcon("appearance"); }
|
||||||
|
QString id() const override { return "appearance-settings"; }
|
||||||
|
QString helpPage() const override { return "Launcher-settings"; }
|
||||||
|
|
||||||
|
bool apply() override
|
||||||
|
{
|
||||||
|
applySettings();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void retranslate() override { retranslateUi(); }
|
||||||
|
};
|
|
@ -50,7 +50,6 @@
|
||||||
ExternalToolsPage::ExternalToolsPage(QWidget* parent) : QWidget(parent), ui(new Ui::ExternalToolsPage)
|
ExternalToolsPage::ExternalToolsPage(QWidget* parent) : QWidget(parent), ui(new Ui::ExternalToolsPage)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->tabWidget->tabBar()->hide();
|
|
||||||
|
|
||||||
ui->jsonEditorTextBox->setClearButtonEnabled(true);
|
ui->jsonEditorTextBox->setClearButtonEnabled(true);
|
||||||
|
|
||||||
|
@ -128,13 +127,13 @@ void ExternalToolsPage::on_jvisualvmPathBtn_clicked()
|
||||||
QString raw_dir = ui->jvisualvmPathEdit->text();
|
QString raw_dir = ui->jvisualvmPathEdit->text();
|
||||||
QString error;
|
QString error;
|
||||||
do {
|
do {
|
||||||
raw_dir = QFileDialog::getOpenFileName(this, tr("JVisualVM Executable"), raw_dir);
|
raw_dir = QFileDialog::getOpenFileName(this, tr("VisualVM Executable"), raw_dir);
|
||||||
if (raw_dir.isEmpty()) {
|
if (raw_dir.isEmpty()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||||
if (!APPLICATION->profilers()["jvisualvm"]->check(cooked_dir, &error)) {
|
if (!APPLICATION->profilers()["jvisualvm"]->check(cooked_dir, &error)) {
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Error while checking JVisualVM install:\n%1").arg(error));
|
QMessageBox::critical(this, tr("Error"), tr("Error while checking VisualVM install:\n%1").arg(error));
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
ui->jvisualvmPathEdit->setText(cooked_dir);
|
ui->jvisualvmPathEdit->setText(cooked_dir);
|
||||||
|
@ -146,9 +145,9 @@ void ExternalToolsPage::on_jvisualvmCheckBtn_clicked()
|
||||||
{
|
{
|
||||||
QString error;
|
QString error;
|
||||||
if (!APPLICATION->profilers()["jvisualvm"]->check(ui->jvisualvmPathEdit->text(), &error)) {
|
if (!APPLICATION->profilers()["jvisualvm"]->check(ui->jvisualvmPathEdit->text(), &error)) {
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Error while checking JVisualVM install:\n%1").arg(error));
|
QMessageBox::critical(this, tr("Error"), tr("Error while checking VisualVM install:\n%1").arg(error));
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::information(this, tr("OK"), tr("JVisualVM setup seems to be OK"));
|
QMessageBox::information(this, tr("OK"), tr("VisualVM setup seems to be OK"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +186,7 @@ void ExternalToolsPage::on_mceditCheckBtn_clicked()
|
||||||
|
|
||||||
void ExternalToolsPage::on_jsonEditorBrowseBtn_clicked()
|
void ExternalToolsPage::on_jsonEditorBrowseBtn_clicked()
|
||||||
{
|
{
|
||||||
QString raw_file = QFileDialog::getOpenFileName(this, tr("JSON Editor"),
|
QString raw_file = QFileDialog::getOpenFileName(this, tr("Text Editor"),
|
||||||
ui->jsonEditorTextBox->text().isEmpty()
|
ui->jsonEditorTextBox->text().isEmpty()
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
? QString("/usr/bin")
|
? QString("/usr/bin")
|
||||||
|
|
|
@ -51,7 +51,7 @@ class ExternalToolsPage : public QWidget, public BasePage {
|
||||||
explicit ExternalToolsPage(QWidget* parent = 0);
|
explicit ExternalToolsPage(QWidget* parent = 0);
|
||||||
~ExternalToolsPage();
|
~ExternalToolsPage();
|
||||||
|
|
||||||
QString displayName() const override { return tr("External Tools"); }
|
QString displayName() const override { return tr("Tools"); }
|
||||||
QIcon icon() const override
|
QIcon icon() const override
|
||||||
{
|
{
|
||||||
auto icon = APPLICATION->getThemedIcon("externaltools");
|
auto icon = APPLICATION->getThemedIcon("externaltools");
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>673</width>
|
<width>673</width>
|
||||||
<height>751</height>
|
<height>823</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
@ -24,28 +24,43 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
<property name="currentIndex">
|
<property name="widgetResizable">
|
||||||
<number>0</number>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="scrollAreaWidgetContents_2">
|
||||||
<attribute name="title">
|
<property name="geometry">
|
||||||
<string notr="true">Tab 1</string>
|
<rect>
|
||||||
</attribute>
|
<x>0</x>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<y>0</y>
|
||||||
|
<width>669</width>
|
||||||
|
<height>819</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="editorsBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string notr="true">J&Profiler</string>
|
<string>&Editors</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Text Editor</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>jsonEditorTextBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="jprofilerPathEdit"/>
|
<widget class="QLineEdit" name="jsonEditorTextBox"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="jprofilerPathBtn">
|
<widget class="QPushButton" name="jsonEditorBrowseBtn">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Browse</string>
|
<string>Browse</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -54,65 +69,38 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="jprofilerCheckBtn">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Check</string>
|
<string>Used to edit component JSON files.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="jprofilerLink">
|
<spacer name="verticalSpacer_7">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="mceditLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true"><html><head/><body><p><a href="https://www.ej-technologies.com/products/jprofiler/overview.html">https://www.ej-technologies.com/products/jprofiler/overview.html</a></p></body></html></string>
|
<string>&MCEdit</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>mceditPathEdit</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
|
||||||
<property name="title">
|
|
||||||
<string notr="true">J&VisualVM</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="jvisualvmPathEdit"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="jvisualvmPathBtn">
|
|
||||||
<property name="text">
|
|
||||||
<string>Browse</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="jvisualvmCheckBtn">
|
|
||||||
<property name="text">
|
|
||||||
<string>Check</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="jvisualvmLink">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true"><html><head/><body><p><a href="https://visualvm.github.io/">https://visualvm.github.io/</a></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="groupBox_4">
|
|
||||||
<property name="title">
|
|
||||||
<string notr="true">&MCEdit</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
<item>
|
<item>
|
||||||
|
@ -129,6 +117,12 @@
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="mceditCheckBtn">
|
<widget class="QPushButton" name="mceditCheckBtn">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Check</string>
|
<string>Check</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -137,7 +131,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="mceditLink">
|
<widget class="QLabel" name="mceditLink">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true"><html><head/><body><p><a href="https://www.mcedit.net/">https://www.mcedit.net/</a></p></body></html></string>
|
<string notr="true"><html><head/><body><p><a href="https://www.mcedit.net/">MCEdit Website</a> - Used as world editor in the instance Worlds menu.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -145,28 +139,138 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="editorsBox">
|
<widget class="QGroupBox" name="profilersBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>External Editors (leave empty for system default)</string>
|
<string>&Profilers</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="foldersBoxLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<item row="0" column="1">
|
<item>
|
||||||
<widget class="QLineEdit" name="jsonEditorTextBox"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="labelJsonEditor">
|
<widget class="QLabel" name="labelJsonEditor">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Text Editor:</string>
|
<string>Profilers are accessible through the Launch dropdown menu.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>jsonEditorTextBox</cstring>
|
<cstring>jsonEditorTextBox</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item>
|
||||||
<widget class="QToolButton" name="jsonEditorBrowseBtn">
|
<spacer name="verticalSpacer_9">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Browse</string>
|
<string>J&Profiler</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>jprofilerPathEdit</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="jprofilerPathEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="jprofilerPathBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>Browse</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="jprofilerCheckBtn">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Check</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="jprofilerLink">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"><html><head/><body><p><a href="https://www.ej-technologies.com/products/jprofiler/overview.html">JProfiler Website</a></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_8">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>&VisualVM</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>jvisualvmPathEdit</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="jvisualvmPathEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="jvisualvmPathBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>Browse</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="jvisualvmCheckBtn">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Check</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="jvisualvmLink">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"><html><head/><body><p><a href="https://visualvm.github.io/">VisualVM Website</a></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -180,8 +284,8 @@
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>0</width>
|
||||||
<height>216</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
|
|
|
@ -50,10 +50,22 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>535</width>
|
<width>535</width>
|
||||||
<height>610</height>
|
<height>606</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="JavaSettingsWidget" name="javaSettings" native="true"/>
|
<widget class="JavaSettingsWidget" name="javaSettings" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
|
@ -65,78 +77,56 @@
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="management">
|
<widget class="QWidget" name="management">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Management</string>
|
<string>Installations</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="title">
|
<item>
|
||||||
<string>Downloaded Java Versions</string>
|
<widget class="QPushButton" name="downloadJavaButton">
|
||||||
</property>
|
<property name="text">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<string>Download</string>
|
||||||
<item>
|
</property>
|
||||||
<widget class="VersionSelectWidget" name="managedJavaList" native="true">
|
</widget>
|
||||||
<property name="sizePolicy">
|
</item>
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<item>
|
||||||
<horstretch>0</horstretch>
|
<widget class="QPushButton" name="removeJavaButton">
|
||||||
<verstretch>0</verstretch>
|
<property name="text">
|
||||||
</sizepolicy>
|
<string>Remove</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="managedJavaBtnLayout">
|
<spacer name="horizontalSpacer">
|
||||||
<item>
|
<property name="orientation">
|
||||||
<widget class="QPushButton" name="downloadJavaButton">
|
<enum>Qt::Horizontal</enum>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Download</string>
|
<property name="sizeHint" stdset="0">
|
||||||
</property>
|
<size>
|
||||||
</widget>
|
<width>40</width>
|
||||||
</item>
|
<height>20</height>
|
||||||
<item>
|
</size>
|
||||||
<widget class="QPushButton" name="removeJavaButton">
|
</property>
|
||||||
<property name="text">
|
</spacer>
|
||||||
<string>Remove</string>
|
</item>
|
||||||
</property>
|
<item>
|
||||||
</widget>
|
<widget class="QPushButton" name="refreshJavaButton">
|
||||||
</item>
|
<property name="text">
|
||||||
<item>
|
<string>Refresh</string>
|
||||||
<spacer name="verticalSpacer_2">
|
</property>
|
||||||
<property name="orientation">
|
</widget>
|
||||||
<enum>Qt::Vertical</enum>
|
</item>
|
||||||
</property>
|
</layout>
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="refreshJavaButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Refresh</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="managementSpacer">
|
<widget class="VersionSelectWidget" name="managedJavaList" native="true">
|
||||||
<property name="orientation">
|
<property name="sizePolicy">
|
||||||
<enum>Qt::Vertical</enum>
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
</widget>
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
@ -81,24 +81,14 @@ LauncherPage::LauncherPage(QWidget* parent) : QWidget(parent), ui(new Ui::Launch
|
||||||
ui->sortingModeGroup->setId(ui->sortByNameBtn, Sort_Name);
|
ui->sortingModeGroup->setId(ui->sortByNameBtn, Sort_Name);
|
||||||
ui->sortingModeGroup->setId(ui->sortLastLaunchedBtn, Sort_LastLaunch);
|
ui->sortingModeGroup->setId(ui->sortLastLaunchedBtn, Sort_LastLaunch);
|
||||||
|
|
||||||
defaultFormat = new QTextCharFormat(ui->fontPreview->currentCharFormat());
|
|
||||||
|
|
||||||
m_languageModel = APPLICATION->translations();
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|
||||||
ui->updateSettingsBox->setHidden(!APPLICATION->updater());
|
ui->updateSettingsBox->setHidden(!APPLICATION->updater());
|
||||||
|
|
||||||
connect(ui->fontSizeBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &LauncherPage::refreshFontPreview);
|
|
||||||
connect(ui->consoleFont, &QFontComboBox::currentFontChanged, this, &LauncherPage::refreshFontPreview);
|
|
||||||
connect(ui->themeCustomizationWidget, &ThemeCustomizationWidget::currentWidgetThemeChanged, this, &LauncherPage::refreshFontPreview);
|
|
||||||
|
|
||||||
connect(ui->themeCustomizationWidget, &ThemeCustomizationWidget::currentCatChanged, APPLICATION, &Application::currentCatChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LauncherPage::~LauncherPage()
|
LauncherPage::~LauncherPage()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
delete defaultFormat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LauncherPage::apply()
|
bool LauncherPage::apply()
|
||||||
|
@ -203,9 +193,9 @@ void LauncherPage::on_skinsDirBrowseBtn_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherPage::on_metadataDisableBtn_clicked()
|
void LauncherPage::on_metadataEnableBtn_clicked()
|
||||||
{
|
{
|
||||||
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
|
ui->metadataWarningLabel->setHidden(ui->metadataEnableBtn->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherPage::applySettings()
|
void LauncherPage::applySettings()
|
||||||
|
@ -226,9 +216,6 @@ void LauncherPage::applySettings()
|
||||||
s->set("RequestTimeout", ui->timeoutSecondsSpinBox->value());
|
s->set("RequestTimeout", ui->timeoutSecondsSpinBox->value());
|
||||||
|
|
||||||
// Console settings
|
// Console settings
|
||||||
QString consoleFontFamily = ui->consoleFont->currentFont().family();
|
|
||||||
s->set("ConsoleFont", consoleFontFamily);
|
|
||||||
s->set("ConsoleFontSize", ui->fontSizeBox->value());
|
|
||||||
s->set("ConsoleMaxLines", ui->lineLimitSpinBox->value());
|
s->set("ConsoleMaxLines", ui->lineLimitSpinBox->value());
|
||||||
s->set("ConsoleOverflowStop", ui->checkStopLogging->checkState() != Qt::Unchecked);
|
s->set("ConsoleOverflowStop", ui->checkStopLogging->checkState() != Qt::Unchecked);
|
||||||
|
|
||||||
|
@ -269,13 +256,10 @@ void LauncherPage::applySettings()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cat
|
|
||||||
s->set("CatOpacity", ui->catOpacitySpinBox->value());
|
|
||||||
|
|
||||||
// Mods
|
// Mods
|
||||||
s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked());
|
s->set("ModMetadataDisabled", !ui->metadataEnableBtn->isChecked());
|
||||||
s->set("ModDependenciesDisabled", ui->dependenciesDisableBtn->isChecked());
|
s->set("ModDependenciesDisabled", !ui->dependenciesEnableBtn->isChecked());
|
||||||
s->set("SkipModpackUpdatePrompt", ui->skipModpackUpdatePromptBtn->isChecked());
|
s->set("SkipModpackUpdatePrompt", !ui->modpackUpdatePromptBtn->isChecked());
|
||||||
}
|
}
|
||||||
void LauncherPage::loadSettings()
|
void LauncherPage::loadSettings()
|
||||||
{
|
{
|
||||||
|
@ -286,11 +270,6 @@ void LauncherPage::loadSettings()
|
||||||
ui->updateIntervalSpinBox->setValue(APPLICATION->updater()->getUpdateCheckInterval() / 3600);
|
ui->updateIntervalSpinBox->setValue(APPLICATION->updater()->getUpdateCheckInterval() / 3600);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toolbar/menu bar settings (not applicable if native menu bar is present)
|
|
||||||
ui->toolsBox->setEnabled(!QMenuBar().isNativeMenuBar());
|
|
||||||
#ifdef Q_OS_MACOS
|
|
||||||
ui->toolsBox->setVisible(!QMenuBar().isNativeMenuBar());
|
|
||||||
#endif
|
|
||||||
ui->preferMenuBarCheckBox->setChecked(s->get("MenuBarInsteadOfToolBar").toBool());
|
ui->preferMenuBarCheckBox->setChecked(s->get("MenuBarInsteadOfToolBar").toBool());
|
||||||
|
|
||||||
ui->numberOfConcurrentTasksSpinBox->setValue(s->get("NumberOfConcurrentTasks").toInt());
|
ui->numberOfConcurrentTasksSpinBox->setValue(s->get("NumberOfConcurrentTasks").toInt());
|
||||||
|
@ -299,17 +278,6 @@ void LauncherPage::loadSettings()
|
||||||
ui->timeoutSecondsSpinBox->setValue(s->get("RequestTimeout").toInt());
|
ui->timeoutSecondsSpinBox->setValue(s->get("RequestTimeout").toInt());
|
||||||
|
|
||||||
// Console settings
|
// Console settings
|
||||||
QString fontFamily = APPLICATION->settings()->get("ConsoleFont").toString();
|
|
||||||
QFont consoleFont(fontFamily);
|
|
||||||
ui->consoleFont->setCurrentFont(consoleFont);
|
|
||||||
|
|
||||||
bool conversionOk = true;
|
|
||||||
int fontSize = APPLICATION->settings()->get("ConsoleFontSize").toInt(&conversionOk);
|
|
||||||
if (!conversionOk) {
|
|
||||||
fontSize = 11;
|
|
||||||
}
|
|
||||||
ui->fontSizeBox->setValue(fontSize);
|
|
||||||
refreshFontPreview();
|
|
||||||
ui->lineLimitSpinBox->setValue(s->get("ConsoleMaxLines").toInt());
|
ui->lineLimitSpinBox->setValue(s->get("ConsoleMaxLines").toInt());
|
||||||
ui->checkStopLogging->setChecked(s->get("ConsoleOverflowStop").toBool());
|
ui->checkStopLogging->setChecked(s->get("ConsoleOverflowStop").toBool());
|
||||||
|
|
||||||
|
@ -342,59 +310,11 @@ void LauncherPage::loadSettings()
|
||||||
}
|
}
|
||||||
ui->renamingBehaviorComboBox->setCurrentIndex(renamingModeEnum);
|
ui->renamingBehaviorComboBox->setCurrentIndex(renamingModeEnum);
|
||||||
|
|
||||||
// Cat
|
|
||||||
ui->catOpacitySpinBox->setValue(s->get("CatOpacity").toInt());
|
|
||||||
|
|
||||||
// Mods
|
// Mods
|
||||||
ui->metadataDisableBtn->setChecked(s->get("ModMetadataDisabled").toBool());
|
ui->metadataEnableBtn->setChecked(!s->get("ModMetadataDisabled").toBool());
|
||||||
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
|
ui->metadataWarningLabel->setHidden(ui->metadataEnableBtn->isChecked());
|
||||||
ui->dependenciesDisableBtn->setChecked(s->get("ModDependenciesDisabled").toBool());
|
ui->dependenciesEnableBtn->setChecked(!s->get("ModDependenciesDisabled").toBool());
|
||||||
ui->skipModpackUpdatePromptBtn->setChecked(s->get("SkipModpackUpdatePrompt").toBool());
|
ui->modpackUpdatePromptBtn->setChecked(!s->get("SkipModpackUpdatePrompt").toBool());
|
||||||
}
|
|
||||||
|
|
||||||
void LauncherPage::refreshFontPreview()
|
|
||||||
{
|
|
||||||
const LogColors& colors = APPLICATION->themeManager()->getLogColors();
|
|
||||||
|
|
||||||
int fontSize = ui->fontSizeBox->value();
|
|
||||||
QString fontFamily = ui->consoleFont->currentFont().family();
|
|
||||||
ui->fontPreview->clear();
|
|
||||||
defaultFormat->setFont(QFont(fontFamily, fontSize));
|
|
||||||
|
|
||||||
auto print = [this, colors](const QString& message, MessageLevel::Enum level) {
|
|
||||||
QTextCharFormat format(*defaultFormat);
|
|
||||||
|
|
||||||
QColor bg = colors.background.value(level);
|
|
||||||
QColor fg = colors.foreground.value(level);
|
|
||||||
|
|
||||||
if (bg.isValid())
|
|
||||||
format.setBackground(bg);
|
|
||||||
|
|
||||||
if (fg.isValid())
|
|
||||||
format.setForeground(fg);
|
|
||||||
|
|
||||||
// append a paragraph/line
|
|
||||||
auto workCursor = ui->fontPreview->textCursor();
|
|
||||||
workCursor.movePosition(QTextCursor::End);
|
|
||||||
workCursor.insertText(message, format);
|
|
||||||
workCursor.insertBlock();
|
|
||||||
};
|
|
||||||
|
|
||||||
print(QString("%1 version: %2 (%3)\n")
|
|
||||||
.arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString(), BuildConfig.BUILD_PLATFORM),
|
|
||||||
MessageLevel::Launcher);
|
|
||||||
|
|
||||||
QDate today = QDate::currentDate();
|
|
||||||
|
|
||||||
if (today.month() == 10 && today.day() == 31)
|
|
||||||
print(tr("[Test/ERROR] OOoooOOOoooo! A spooky error!"), MessageLevel::Error);
|
|
||||||
else
|
|
||||||
print(tr("[Test/ERROR] A spooky error!"), MessageLevel::Error);
|
|
||||||
|
|
||||||
print(tr("[Test/INFO] A harmless message..."), MessageLevel::Info);
|
|
||||||
print(tr("[Test/WARN] A not so spooky warning."), MessageLevel::Warning);
|
|
||||||
print(tr("[Test/DEBUG] A secret debugging message..."), MessageLevel::Debug);
|
|
||||||
print(tr("[Test/FATAL] A terrifying fatal error!"), MessageLevel::Fatal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherPage::retranslate()
|
void LauncherPage::retranslate()
|
||||||
|
|
|
@ -57,8 +57,8 @@ class LauncherPage : public QWidget, public BasePage {
|
||||||
explicit LauncherPage(QWidget* parent = 0);
|
explicit LauncherPage(QWidget* parent = 0);
|
||||||
~LauncherPage();
|
~LauncherPage();
|
||||||
|
|
||||||
QString displayName() const override { return tr("Launcher"); }
|
QString displayName() const override { return tr("General"); }
|
||||||
QIcon icon() const override { return APPLICATION->getThemedIcon("launcher"); }
|
QIcon icon() const override { return APPLICATION->getThemedIcon("settings"); }
|
||||||
QString id() const override { return "launcher-settings"; }
|
QString id() const override { return "launcher-settings"; }
|
||||||
QString helpPage() const override { return "Launcher-settings"; }
|
QString helpPage() const override { return "Launcher-settings"; }
|
||||||
bool apply() override;
|
bool apply() override;
|
||||||
|
@ -75,23 +75,8 @@ class LauncherPage : public QWidget, public BasePage {
|
||||||
void on_downloadsDirBrowseBtn_clicked();
|
void on_downloadsDirBrowseBtn_clicked();
|
||||||
void on_javaDirBrowseBtn_clicked();
|
void on_javaDirBrowseBtn_clicked();
|
||||||
void on_skinsDirBrowseBtn_clicked();
|
void on_skinsDirBrowseBtn_clicked();
|
||||||
void on_metadataDisableBtn_clicked();
|
void on_metadataEnableBtn_clicked();
|
||||||
|
|
||||||
/*!
|
|
||||||
* Updates the font preview
|
|
||||||
*/
|
|
||||||
void refreshFontPreview();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::LauncherPage* ui;
|
Ui::LauncherPage* ui;
|
||||||
|
|
||||||
/*!
|
|
||||||
* Stores the currently selected update channel.
|
|
||||||
*/
|
|
||||||
QString m_currentUpdateChannel;
|
|
||||||
|
|
||||||
// default format for the font preview...
|
|
||||||
QTextCharFormat* defaultFormat;
|
|
||||||
|
|
||||||
std::shared_ptr<TranslationsModel> m_languageModel;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
ProxyPage::ProxyPage(QWidget* parent) : QWidget(parent), ui(new Ui::ProxyPage)
|
ProxyPage::ProxyPage(QWidget* parent) : QWidget(parent), ui(new Ui::ProxyPage)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->tabWidget->tabBar()->hide();
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
updateCheckboxStuff();
|
updateCheckboxStuff();
|
||||||
|
|
||||||
|
|
|
@ -23,184 +23,205 @@
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QLabel" name="proxyPlainTextWarningLabel_2">
|
||||||
<widget class="QWidget" name="tabWidgetPage1">
|
<property name="text">
|
||||||
<attribute name="title">
|
<string>This only applies to the launcher. Minecraft does not accept proxy settings.</string>
|
||||||
<string notr="true"/>
|
</property>
|
||||||
</attribute>
|
<property name="alignment">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
<item>
|
</property>
|
||||||
<widget class="QLabel" name="proxyPlainTextWarningLabel_2">
|
<property name="wordWrap">
|
||||||
<property name="text">
|
<bool>true</bool>
|
||||||
<string>This only applies to the launcher. Minecraft does not accept proxy settings.</string>
|
</property>
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="proxyTypeBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Type</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="proxyDefaultBtn">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Uses your system's default proxy settings.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&Default</string>
|
|
||||||
</property>
|
|
||||||
<attribute name="buttonGroup">
|
|
||||||
<string notr="true">proxyGroup</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="proxyNoneBtn">
|
|
||||||
<property name="text">
|
|
||||||
<string>&None</string>
|
|
||||||
</property>
|
|
||||||
<attribute name="buttonGroup">
|
|
||||||
<string notr="true">proxyGroup</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="proxySOCKS5Btn">
|
|
||||||
<property name="text">
|
|
||||||
<string>&SOCKS5</string>
|
|
||||||
</property>
|
|
||||||
<attribute name="buttonGroup">
|
|
||||||
<string notr="true">proxyGroup</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="proxyHTTPBtn">
|
|
||||||
<property name="text">
|
|
||||||
<string>&HTTP</string>
|
|
||||||
</property>
|
|
||||||
<attribute name="buttonGroup">
|
|
||||||
<string notr="true">proxyGroup</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="proxyAddrBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>&Address and Port</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="proxyAddrEdit">
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string notr="true">127.0.0.1</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="proxyPortEdit">
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="buttonSymbols">
|
|
||||||
<enum>QAbstractSpinBox::PlusMinus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>65535</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>8080</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="proxyAuthBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Authentication</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_5">
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="proxyUserEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="proxyUsernameLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Username:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>proxyUserEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="proxyPasswordLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Password:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>proxyPassEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="proxyPassEdit">
|
|
||||||
<property name="echoMode">
|
|
||||||
<enum>QLineEdit::Password</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="proxyPlainTextWarningLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Note: Proxy username and password are stored in plain text inside the launcher's configuration file!</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="proxyTypeBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Type</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="proxyDefaultBtn">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Uses your system's default proxy settings.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Use S&ystem Settings</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">proxyGroup</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="proxyNoneBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>&None</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">proxyGroup</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="proxySOCKS5Btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>&SOCKS5</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">proxyGroup</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="proxyHTTPBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>&HTTP</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="buttonGroup">
|
||||||
|
<string notr="true">proxyGroup</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="proxyAddrBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>&Address and Port</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="proxyAddrEdit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string notr="true">127.0.0.1</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="proxyPortEdit">
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="buttonSymbols">
|
||||||
|
<enum>QAbstractSpinBox::PlusMinus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>65535</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>8080</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="proxyAuthBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Authentication</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="proxyUsernameLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Username:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>proxyUserEdit</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="proxyUserEdit"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="proxyPasswordLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Password:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>proxyPassEdit</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="proxyPassEdit">
|
||||||
|
<property name="echoMode">
|
||||||
|
<enum>QLineEdit::Password</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="proxyPlainTextWarningLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Note: Proxy username and password are stored in plain text inside the launcher's configuration file!</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>proxyDefaultBtn</tabstop>
|
||||||
|
<tabstop>proxyNoneBtn</tabstop>
|
||||||
|
<tabstop>proxySOCKS5Btn</tabstop>
|
||||||
|
<tabstop>proxyHTTPBtn</tabstop>
|
||||||
|
<tabstop>proxyAddrEdit</tabstop>
|
||||||
|
<tabstop>proxyPortEdit</tabstop>
|
||||||
|
<tabstop>proxyUserEdit</tabstop>
|
||||||
|
<tabstop>proxyPassEdit</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
|
|
|
@ -49,7 +49,7 @@ class InstanceSettingsPage : public MinecraftSettingsWidget, public BasePage {
|
||||||
: MinecraftSettingsWidget(std::move(instance), parent)
|
: MinecraftSettingsWidget(std::move(instance), parent)
|
||||||
{
|
{
|
||||||
connect(APPLICATION, &Application::globalSettingsAboutToOpen, this, &InstanceSettingsPage::saveSettings);
|
connect(APPLICATION, &Application::globalSettingsAboutToOpen, this, &InstanceSettingsPage::saveSettings);
|
||||||
connect(APPLICATION, &Application::globalSettingsClosed, this, &InstanceSettingsPage::loadSettings);
|
connect(APPLICATION, &Application::globalSettingsApplied, this, &InstanceSettingsPage::loadSettings);
|
||||||
}
|
}
|
||||||
~InstanceSettingsPage() override {}
|
~InstanceSettingsPage() override {}
|
||||||
QString displayName() const override { return tr("Settings"); }
|
QString displayName() const override { return tr("Settings"); }
|
||||||
|
|
|
@ -34,37 +34,6 @@ ThemeWizardPage::ThemeWizardPage(QWidget* parent) : BaseWizardPage(parent), ui(n
|
||||||
updateIcons();
|
updateIcons();
|
||||||
updateCat();
|
updateCat();
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeWizardPage::~ThemeWizardPage()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeWizardPage::updateIcons()
|
|
||||||
{
|
|
||||||
qDebug() << "Setting Icons";
|
|
||||||
ui->previewIconButton0->setIcon(APPLICATION->getThemedIcon("new"));
|
|
||||||
ui->previewIconButton1->setIcon(APPLICATION->getThemedIcon("centralmods"));
|
|
||||||
ui->previewIconButton2->setIcon(APPLICATION->getThemedIcon("viewfolder"));
|
|
||||||
ui->previewIconButton3->setIcon(APPLICATION->getThemedIcon("launch"));
|
|
||||||
ui->previewIconButton4->setIcon(APPLICATION->getThemedIcon("copy"));
|
|
||||||
ui->previewIconButton5->setIcon(APPLICATION->getThemedIcon("export"));
|
|
||||||
ui->previewIconButton6->setIcon(APPLICATION->getThemedIcon("delete"));
|
|
||||||
ui->previewIconButton7->setIcon(APPLICATION->getThemedIcon("about"));
|
|
||||||
ui->previewIconButton8->setIcon(APPLICATION->getThemedIcon("settings"));
|
|
||||||
ui->previewIconButton9->setIcon(APPLICATION->getThemedIcon("cat"));
|
|
||||||
update();
|
|
||||||
repaint();
|
|
||||||
parentWidget()->update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeWizardPage::updateCat()
|
|
||||||
{
|
|
||||||
qDebug() << "Setting Cat";
|
|
||||||
ui->catImagePreviewButton->setIcon(QIcon(QString(R"(%1)").arg(APPLICATION->themeManager()->getCatPack())));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeWizardPage::retranslate()
|
|
||||||
{
|
{
|
||||||
ui->retranslateUi(this);
|
ui->retranslateUi(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,27 +17,30 @@
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <ui/widgets/AppearanceWidget.h>
|
||||||
|
#include <QHBoxLayout>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include "BaseWizardPage.h"
|
#include "BaseWizardPage.h"
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class ThemeWizardPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ThemeWizardPage : public BaseWizardPage {
|
class ThemeWizardPage : public BaseWizardPage {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ThemeWizardPage(QWidget* parent = nullptr);
|
ThemeWizardPage(QWidget* parent = nullptr) : BaseWizardPage(parent)
|
||||||
~ThemeWizardPage();
|
{
|
||||||
|
auto layout = new QVBoxLayout(this);
|
||||||
|
layout->addWidget(&widget);
|
||||||
|
layout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||||
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
setLayout(layout);
|
||||||
|
|
||||||
|
setTitle(tr("Appearance"));
|
||||||
|
setSubTitle(tr("Select theme and icons to use"));
|
||||||
|
}
|
||||||
|
|
||||||
bool validatePage() override { return true; };
|
bool validatePage() override { return true; };
|
||||||
void retranslate() override;
|
void retranslate() override { widget.retranslateUi(); }
|
||||||
|
|
||||||
private slots:
|
|
||||||
void updateIcons();
|
|
||||||
void updateCat();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ThemeWizardPage* ui;
|
AppearanceWidget widget{true};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,371 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>ThemeWizardPage</class>
|
|
||||||
<widget class="QWizardPage" name="ThemeWizardPage">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>510</width>
|
|
||||||
<height>552</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>WizardPage</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Select the Theme you wish to use</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="ThemeCustomizationWidget" name="themeCustomizationWidget" native="true">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>100</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Hint: The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar.</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string> Preview:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout" name="iconPreview">
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QPushButton" name="previewIconButton2">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="applications-engineering">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="5">
|
|
||||||
<widget class="QPushButton" name="previewIconButton5">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="applications-engineering">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="7">
|
|
||||||
<widget class="QPushButton" name="previewIconButton7">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="applications-engineering">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="4">
|
|
||||||
<widget class="QPushButton" name="previewIconButton4">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="applications-engineering">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QPushButton" name="previewIconButton1">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="centralmods">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QPushButton" name="previewIconButton0">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="applications-engineering">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="9">
|
|
||||||
<widget class="QPushButton" name="previewIconButton9">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="viewfolder">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="6">
|
|
||||||
<widget class="QPushButton" name="previewIconButton6">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="new">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3">
|
|
||||||
<widget class="QPushButton" name="previewIconButton3">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="applications-engineering">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="8">
|
|
||||||
<widget class="QPushButton" name="previewIconButton8">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>30</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="applications-engineering">
|
|
||||||
<normaloff>.</normaloff>.</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="catImagePreviewButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>256</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>The cat appears in the background and does not serve a purpose, it is purely visual.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>256</width>
|
|
||||||
<height>256</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>193</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>ThemeCustomizationWidget</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header>ui/widgets/ThemeCustomizationWidget.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "FileSystem.h"
|
#include "FileSystem.h"
|
||||||
#include "Json.h"
|
#include "Json.h"
|
||||||
|
|
||||||
QString BasicCatPack::path()
|
QString BasicCatPack::path() const
|
||||||
{
|
{
|
||||||
const auto now = QDate::currentDate();
|
const auto now = QDate::currentDate();
|
||||||
const auto birthday = QDate(now.year(), 11, 1);
|
const auto birthday = QDate(now.year(), 11, 1);
|
||||||
|
@ -100,12 +100,12 @@ QDate ensureDay(int year, int month, int day)
|
||||||
return QDate(year, month, day);
|
return QDate(year, month, day);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString JsonCatPack::path()
|
QString JsonCatPack::path() const
|
||||||
{
|
{
|
||||||
return path(QDate::currentDate());
|
return path(QDate::currentDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString JsonCatPack::path(QDate now)
|
QString JsonCatPack::path(QDate now) const
|
||||||
{
|
{
|
||||||
for (auto var : m_variants) {
|
for (auto var : m_variants) {
|
||||||
QDate startDate = ensureDay(now.year(), var.startTime.month, var.startTime.day);
|
QDate startDate = ensureDay(now.year(), var.startTime.month, var.startTime.day);
|
||||||
|
|
|
@ -43,18 +43,18 @@
|
||||||
class CatPack {
|
class CatPack {
|
||||||
public:
|
public:
|
||||||
virtual ~CatPack() {}
|
virtual ~CatPack() {}
|
||||||
virtual QString id() = 0;
|
virtual QString id() const = 0;
|
||||||
virtual QString name() = 0;
|
virtual QString name() const = 0;
|
||||||
virtual QString path() = 0;
|
virtual QString path() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BasicCatPack : public CatPack {
|
class BasicCatPack : public CatPack {
|
||||||
public:
|
public:
|
||||||
BasicCatPack(QString id, QString name) : m_id(id), m_name(name) {}
|
BasicCatPack(QString id, QString name) : m_id(id), m_name(name) {}
|
||||||
BasicCatPack(QString id) : BasicCatPack(id, id) {}
|
BasicCatPack(QString id) : BasicCatPack(id, id) {}
|
||||||
virtual QString id() override { return m_id; }
|
virtual QString id() const override { return m_id; }
|
||||||
virtual QString name() override { return m_name; }
|
virtual QString name() const override { return m_name; }
|
||||||
virtual QString path() override;
|
virtual QString path() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString m_id;
|
QString m_id;
|
||||||
|
@ -65,7 +65,7 @@ class FileCatPack : public BasicCatPack {
|
||||||
public:
|
public:
|
||||||
FileCatPack(QString id, QFileInfo& fileInfo) : BasicCatPack(id), m_path(fileInfo.absoluteFilePath()) {}
|
FileCatPack(QString id, QFileInfo& fileInfo) : BasicCatPack(id), m_path(fileInfo.absoluteFilePath()) {}
|
||||||
FileCatPack(QFileInfo& fileInfo) : FileCatPack(fileInfo.baseName(), fileInfo) {}
|
FileCatPack(QFileInfo& fileInfo) : FileCatPack(fileInfo.baseName(), fileInfo) {}
|
||||||
virtual QString path() { return m_path; }
|
virtual QString path() const { return m_path; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_path;
|
QString m_path;
|
||||||
|
@ -83,8 +83,8 @@ class JsonCatPack : public BasicCatPack {
|
||||||
PartialDate endTime;
|
PartialDate endTime;
|
||||||
};
|
};
|
||||||
JsonCatPack(QFileInfo& manifestInfo);
|
JsonCatPack(QFileInfo& manifestInfo);
|
||||||
virtual QString path() override;
|
virtual QString path() const override;
|
||||||
QString path(QDate now);
|
QString path(QDate now) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_default_path;
|
QString m_default_path;
|
||||||
|
|
|
@ -31,5 +31,11 @@ int HintOverrideProxyStyle::styleHint(QStyle::StyleHint hint,
|
||||||
if (hint == QStyle::SH_ItemView_ActivateItemOnSingleClick)
|
if (hint == QStyle::SH_ItemView_ActivateItemOnSingleClick)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (hint == QStyle::SH_Slider_AbsoluteSetButtons)
|
||||||
|
return Qt::LeftButton | Qt::MiddleButton;
|
||||||
|
|
||||||
|
if (hint == QStyle::SH_Slider_PageSetButtons)
|
||||||
|
return Qt::RightButton;
|
||||||
|
|
||||||
return QProxyStyle::styleHint(hint, option, widget, returnData);
|
return QProxyStyle::styleHint(hint, option, widget, returnData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ struct LogColors {
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: rename to Theme; this is not an interface as it contains method implementations
|
// TODO: rename to Theme; this is not an interface as it contains method implementations
|
||||||
|
// TODO: make methods const
|
||||||
class ITheme {
|
class ITheme {
|
||||||
public:
|
public:
|
||||||
virtual ~ITheme() {}
|
virtual ~ITheme() {}
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
IconTheme::IconTheme(const QString& id, const QString& path) : m_id(id), m_path(path) {}
|
|
||||||
|
|
||||||
bool IconTheme::load()
|
bool IconTheme::load()
|
||||||
{
|
{
|
||||||
const QString path = m_path + "/index.theme";
|
const QString path = m_path + "/index.theme";
|
||||||
|
@ -36,18 +34,3 @@ bool IconTheme::load()
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
return !m_name.isNull();
|
return !m_name.isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IconTheme::id()
|
|
||||||
{
|
|
||||||
return m_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString IconTheme::path()
|
|
||||||
{
|
|
||||||
return m_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString IconTheme::name()
|
|
||||||
{
|
|
||||||
return m_name;
|
|
||||||
}
|
|
||||||
|
|
|
@ -22,13 +22,13 @@
|
||||||
|
|
||||||
class IconTheme {
|
class IconTheme {
|
||||||
public:
|
public:
|
||||||
IconTheme(const QString& id, const QString& path);
|
IconTheme(const QString& id, const QString& path) : m_id(id), m_path(path) {}
|
||||||
IconTheme() = default;
|
IconTheme() = default;
|
||||||
|
|
||||||
bool load();
|
bool load();
|
||||||
QString id();
|
QString id() const { return m_id; }
|
||||||
QString path();
|
QString path() const { return m_path; }
|
||||||
QString name();
|
QString name() const { return m_name; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_id;
|
QString m_id;
|
||||||
|
|
273
launcher/ui/widgets/AppearanceWidget.cpp
Normal file
|
@ -0,0 +1,273 @@
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
/*
|
||||||
|
* Prism Launcher - Minecraft Launcher
|
||||||
|
* Copyright (C) 2025 TheKodeToad <TheKodeToad@proton.me>
|
||||||
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* This file incorporates work covered by the following copyright and
|
||||||
|
* permission notice:
|
||||||
|
*
|
||||||
|
* Copyright 2013-2021 MultiMC Contributors
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AppearanceWidget.h"
|
||||||
|
#include "ui_AppearanceWidget.h"
|
||||||
|
|
||||||
|
#include <DesktopServices.h>
|
||||||
|
#include <QGraphicsOpacityEffect>
|
||||||
|
#include "BuildConfig.h"
|
||||||
|
#include "ui/themes/ITheme.h"
|
||||||
|
#include "ui/themes/ThemeManager.h"
|
||||||
|
|
||||||
|
AppearanceWidget::AppearanceWidget(bool themesOnly, QWidget* parent)
|
||||||
|
: QWidget(parent), m_ui(new Ui::AppearanceWidget), m_themesOnly(themesOnly)
|
||||||
|
{
|
||||||
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
m_ui->catPreview->setGraphicsEffect(new QGraphicsOpacityEffect(this));
|
||||||
|
|
||||||
|
m_defaultFormat = QTextCharFormat(m_ui->consolePreview->currentCharFormat());
|
||||||
|
|
||||||
|
if (themesOnly) {
|
||||||
|
m_ui->catPackLabel->hide();
|
||||||
|
m_ui->catPackComboBox->hide();
|
||||||
|
m_ui->catPackFolder->hide();
|
||||||
|
m_ui->settingsBox->hide();
|
||||||
|
m_ui->consolePreview->hide();
|
||||||
|
m_ui->catPreview->hide();
|
||||||
|
loadThemeSettings();
|
||||||
|
} else {
|
||||||
|
loadSettings();
|
||||||
|
loadThemeSettings();
|
||||||
|
|
||||||
|
updateConsolePreview();
|
||||||
|
updateCatPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(m_ui->fontSizeBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &AppearanceWidget::updateConsolePreview);
|
||||||
|
connect(m_ui->consoleFont, &QFontComboBox::currentFontChanged, this, &AppearanceWidget::updateConsolePreview);
|
||||||
|
|
||||||
|
connect(m_ui->iconsComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AppearanceWidget::applyIconTheme);
|
||||||
|
connect(m_ui->widgetStyleComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AppearanceWidget::applyWidgetTheme);
|
||||||
|
connect(m_ui->catPackComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AppearanceWidget::applyCatTheme);
|
||||||
|
connect(m_ui->catOpacitySlider, &QAbstractSlider::valueChanged, this, &AppearanceWidget::updateCatPreview);
|
||||||
|
|
||||||
|
connect(m_ui->iconsFolder, &QPushButton::clicked, this,
|
||||||
|
[] { DesktopServices::openPath(APPLICATION->themeManager()->getIconThemesFolder().path()); });
|
||||||
|
connect(m_ui->widgetStyleFolder, &QPushButton::clicked, this,
|
||||||
|
[] { DesktopServices::openPath(APPLICATION->themeManager()->getApplicationThemesFolder().path()); });
|
||||||
|
connect(m_ui->catPackFolder, &QPushButton::clicked, this,
|
||||||
|
[] { DesktopServices::openPath(APPLICATION->themeManager()->getCatPacksFolder().path()); });
|
||||||
|
connect(m_ui->reloadThemesButton, &QPushButton::pressed, this, &AppearanceWidget::loadThemeSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
AppearanceWidget::~AppearanceWidget()
|
||||||
|
{
|
||||||
|
delete m_ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppearanceWidget::applySettings()
|
||||||
|
{
|
||||||
|
SettingsObjectPtr settings = APPLICATION->settings();
|
||||||
|
QString consoleFontFamily = m_ui->consoleFont->currentFont().family();
|
||||||
|
settings->set("ConsoleFont", consoleFontFamily);
|
||||||
|
settings->set("ConsoleFontSize", m_ui->fontSizeBox->value());
|
||||||
|
settings->set("CatOpacity", m_ui->catOpacitySlider->value());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppearanceWidget::loadSettings()
|
||||||
|
{
|
||||||
|
QString fontFamily = APPLICATION->settings()->get("ConsoleFont").toString();
|
||||||
|
QFont consoleFont(fontFamily);
|
||||||
|
m_ui->consoleFont->setCurrentFont(consoleFont);
|
||||||
|
|
||||||
|
bool conversionOk = true;
|
||||||
|
int fontSize = APPLICATION->settings()->get("ConsoleFontSize").toInt(&conversionOk);
|
||||||
|
if (!conversionOk) {
|
||||||
|
fontSize = 11;
|
||||||
|
}
|
||||||
|
m_ui->fontSizeBox->setValue(fontSize);
|
||||||
|
|
||||||
|
m_ui->catOpacitySlider->setValue(APPLICATION->settings()->get("CatOpacity").toInt());
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppearanceWidget::retranslateUi()
|
||||||
|
{
|
||||||
|
m_ui->retranslateUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppearanceWidget::applyIconTheme(int index)
|
||||||
|
{
|
||||||
|
auto settings = APPLICATION->settings();
|
||||||
|
auto originalIconTheme = settings->get("IconTheme").toString();
|
||||||
|
auto newIconTheme = m_ui->iconsComboBox->itemData(index).toString();
|
||||||
|
if (originalIconTheme != newIconTheme) {
|
||||||
|
settings->set("IconTheme", newIconTheme);
|
||||||
|
APPLICATION->themeManager()->applyCurrentlySelectedTheme();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppearanceWidget::applyWidgetTheme(int index)
|
||||||
|
{
|
||||||
|
auto settings = APPLICATION->settings();
|
||||||
|
auto originalAppTheme = settings->get("ApplicationTheme").toString();
|
||||||
|
auto newAppTheme = m_ui->widgetStyleComboBox->itemData(index).toString();
|
||||||
|
if (originalAppTheme != newAppTheme) {
|
||||||
|
settings->set("ApplicationTheme", newAppTheme);
|
||||||
|
APPLICATION->themeManager()->applyCurrentlySelectedTheme();
|
||||||
|
}
|
||||||
|
|
||||||
|
updateConsolePreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppearanceWidget::applyCatTheme(int index)
|
||||||
|
{
|
||||||
|
auto settings = APPLICATION->settings();
|
||||||
|
auto originalCat = settings->get("BackgroundCat").toString();
|
||||||
|
auto newCat = m_ui->catPackComboBox->itemData(index).toString();
|
||||||
|
if (originalCat != newCat) {
|
||||||
|
settings->set("BackgroundCat", newCat);
|
||||||
|
}
|
||||||
|
|
||||||
|
APPLICATION->currentCatChanged(index);
|
||||||
|
updateCatPreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppearanceWidget::loadThemeSettings()
|
||||||
|
{
|
||||||
|
APPLICATION->themeManager()->refresh();
|
||||||
|
|
||||||
|
m_ui->iconsComboBox->blockSignals(true);
|
||||||
|
m_ui->widgetStyleComboBox->blockSignals(true);
|
||||||
|
m_ui->catPackComboBox->blockSignals(true);
|
||||||
|
|
||||||
|
m_ui->iconsComboBox->clear();
|
||||||
|
m_ui->widgetStyleComboBox->clear();
|
||||||
|
m_ui->catPackComboBox->clear();
|
||||||
|
|
||||||
|
const SettingsObjectPtr settings = APPLICATION->settings();
|
||||||
|
|
||||||
|
const QString currentIconTheme = settings->get("IconTheme").toString();
|
||||||
|
const auto iconThemes = APPLICATION->themeManager()->getValidIconThemes();
|
||||||
|
|
||||||
|
for (int i = 0; i < iconThemes.count(); ++i) {
|
||||||
|
const IconTheme* theme = iconThemes[i];
|
||||||
|
|
||||||
|
QIcon iconForComboBox = QIcon(theme->path() + "/scalable/settings");
|
||||||
|
m_ui->iconsComboBox->addItem(iconForComboBox, theme->name(), theme->id());
|
||||||
|
|
||||||
|
if (currentIconTheme == theme->id())
|
||||||
|
m_ui->iconsComboBox->setCurrentIndex(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString currentTheme = settings->get("ApplicationTheme").toString();
|
||||||
|
auto themes = APPLICATION->themeManager()->getValidApplicationThemes();
|
||||||
|
for (int i = 0; i < themes.count(); ++i) {
|
||||||
|
ITheme* theme = themes[i];
|
||||||
|
|
||||||
|
m_ui->widgetStyleComboBox->addItem(theme->name(), theme->id());
|
||||||
|
|
||||||
|
if (!theme->tooltip().isEmpty())
|
||||||
|
m_ui->widgetStyleComboBox->setItemData(i, theme->tooltip(), Qt::ToolTipRole);
|
||||||
|
|
||||||
|
if (currentTheme == theme->id())
|
||||||
|
m_ui->widgetStyleComboBox->setCurrentIndex(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_themesOnly) {
|
||||||
|
const QString currentCat = settings->get("BackgroundCat").toString();
|
||||||
|
const auto cats = APPLICATION->themeManager()->getValidCatPacks();
|
||||||
|
for (int i = 0; i < cats.count(); ++i) {
|
||||||
|
const CatPack* cat = cats[i];
|
||||||
|
|
||||||
|
QIcon catIcon = QIcon(QString("%1").arg(cat->path()));
|
||||||
|
m_ui->catPackComboBox->addItem(catIcon, cat->name(), cat->id());
|
||||||
|
|
||||||
|
if (currentCat == cat->id())
|
||||||
|
m_ui->catPackComboBox->setCurrentIndex(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ui->iconsComboBox->blockSignals(false);
|
||||||
|
m_ui->widgetStyleComboBox->blockSignals(false);
|
||||||
|
m_ui->catPackComboBox->blockSignals(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppearanceWidget::updateConsolePreview()
|
||||||
|
{
|
||||||
|
const LogColors& colors = APPLICATION->themeManager()->getLogColors();
|
||||||
|
|
||||||
|
int fontSize = m_ui->fontSizeBox->value();
|
||||||
|
QString fontFamily = m_ui->consoleFont->currentFont().family();
|
||||||
|
m_ui->consolePreview->clear();
|
||||||
|
m_defaultFormat.setFont(QFont(fontFamily, fontSize));
|
||||||
|
|
||||||
|
auto print = [this, colors](const QString& message, MessageLevel::Enum level) {
|
||||||
|
QTextCharFormat format(m_defaultFormat);
|
||||||
|
|
||||||
|
QColor bg = colors.background.value(level);
|
||||||
|
QColor fg = colors.foreground.value(level);
|
||||||
|
|
||||||
|
if (bg.isValid())
|
||||||
|
format.setBackground(bg);
|
||||||
|
|
||||||
|
if (fg.isValid())
|
||||||
|
format.setForeground(fg);
|
||||||
|
|
||||||
|
// append a paragraph/line
|
||||||
|
auto workCursor = m_ui->consolePreview->textCursor();
|
||||||
|
workCursor.movePosition(QTextCursor::End);
|
||||||
|
workCursor.insertText(message, format);
|
||||||
|
workCursor.insertBlock();
|
||||||
|
};
|
||||||
|
|
||||||
|
print(QString("%1 version: %2\n")
|
||||||
|
.arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString()),
|
||||||
|
MessageLevel::Launcher);
|
||||||
|
|
||||||
|
QDate today = QDate::currentDate();
|
||||||
|
|
||||||
|
if (today.month() == 10 && today.day() == 31)
|
||||||
|
print(tr("[ERROR] OOoooOOOoooo! A spooky error!"), MessageLevel::Error);
|
||||||
|
else
|
||||||
|
print(tr("[ERROR] A spooky error!"), MessageLevel::Error);
|
||||||
|
|
||||||
|
print(tr("[INFO] A harmless message..."), MessageLevel::Info);
|
||||||
|
print(tr("[WARN] A not so spooky warning."), MessageLevel::Warning);
|
||||||
|
print(tr("[DEBUG] A secret debugging message..."), MessageLevel::Debug);
|
||||||
|
print(tr("[FATAL] A terrifying fatal error!"), MessageLevel::Fatal);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppearanceWidget::updateCatPreview()
|
||||||
|
{
|
||||||
|
QIcon catPackIcon(APPLICATION->themeManager()->getCatPack());
|
||||||
|
m_ui->catPreview->setIcon(catPackIcon);
|
||||||
|
|
||||||
|
auto effect = dynamic_cast<QGraphicsOpacityEffect*>(m_ui->catPreview->graphicsEffect());
|
||||||
|
if (effect)
|
||||||
|
effect->setOpacity(m_ui->catOpacitySlider->value() / 100.0);
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
/*
|
/*
|
||||||
* Prism Launcher - Minecraft Launcher
|
* Prism Launcher - Minecraft Launcher
|
||||||
|
* Copyright (C) 2025 TheKodeToad <TheKodeToad@proton.me>
|
||||||
* Copyright (C) 2022 Tayou <git@tayou.org>
|
* Copyright (C) 2022 Tayou <git@tayou.org>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -15,42 +16,47 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QDialog>
|
||||||
#include "translations/TranslationsModel.h"
|
#include <memory>
|
||||||
|
|
||||||
enum ThemeFields { NONE = 0b0000, ICONS = 0b0001, WIDGETS = 0b0010, CAT = 0b0100 };
|
#include <Application.h>
|
||||||
|
#include <translations/TranslationsModel.h>
|
||||||
|
#include <QTextCursor>
|
||||||
|
#include "java/JavaChecker.h"
|
||||||
|
#include "ui/pages/BasePage.h"
|
||||||
|
|
||||||
|
class QTextCharFormat;
|
||||||
|
class SettingsObject;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class ThemeCustomizationWidget;
|
class AppearanceWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ThemeCustomizationWidget : public QWidget {
|
class AppearanceWidget : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ThemeCustomizationWidget(QWidget* parent = nullptr);
|
explicit AppearanceWidget(bool simple, QWidget* parent = 0);
|
||||||
~ThemeCustomizationWidget() override;
|
virtual ~AppearanceWidget();
|
||||||
|
|
||||||
void showFeatures(ThemeFields features);
|
|
||||||
|
|
||||||
|
public:
|
||||||
void applySettings();
|
void applySettings();
|
||||||
|
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void retranslate();
|
void retranslateUi();
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void applyIconTheme(int index);
|
void applyIconTheme(int index);
|
||||||
void applyWidgetTheme(int index);
|
void applyWidgetTheme(int index);
|
||||||
void applyCatTheme(int index);
|
void applyCatTheme(int index);
|
||||||
void refresh();
|
void loadThemeSettings();
|
||||||
|
|
||||||
signals:
|
void updateConsolePreview();
|
||||||
int currentIconThemeChanged(int index);
|
void updateCatPreview();
|
||||||
int currentWidgetThemeChanged(int index);
|
|
||||||
int currentCatChanged(int index);
|
|
||||||
|
|
||||||
private:
|
Ui::AppearanceWidget* m_ui;
|
||||||
Ui::ThemeCustomizationWidget* ui;
|
QTextCharFormat m_defaultFormat;
|
||||||
|
bool m_themesOnly;
|
||||||
};
|
};
|
594
launcher/ui/widgets/AppearanceWidget.ui
Normal file
|
@ -0,0 +1,594 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>AppearanceWidget</class>
|
||||||
|
<widget class="QWidget" name="AppearanceWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>600</width>
|
||||||
|
<height>700</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="themingBox">
|
||||||
|
<property name="title">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="2" column="3">
|
||||||
|
<widget class="QPushButton" name="catPackFolder">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>View cat packs folder.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Open Folder</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<widget class="QPushButton" name="widgetStyleFolder">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>View widget themes folder.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Open Folder</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
|
<widget class="QPushButton" name="iconsFolder">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>View icon themes folder.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Open Folder</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="catPackLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Cat Pack:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>catPackComboBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QComboBox" name="catPackComboBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QComboBox" name="iconsComboBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::StrongFocus</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QComboBox" name="widgetStyleComboBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::StrongFocus</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QPushButton" name="reloadThemesButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reload All</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="widgetStyleLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Theme:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>widgetStyleComboBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="iconsLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Icons:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>iconsComboBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="settingsBox">
|
||||||
|
<property name="title">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Console Font:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFontComboBox" name="consoleFont"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="fontSizeBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>5</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>16</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>11</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<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>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="catOpacityLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cat Opacity</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_2" native="true">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget" native="true">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>300</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="3" column="3">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Opaque</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<spacer name="horizontalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Transparent</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="4">
|
||||||
|
<widget class="QSlider" name="catOpacitySlider">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="previewBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Preview</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="catPreview">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>128</width>
|
||||||
|
<height>256</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon1">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="new">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon2">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="centralmods">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon3">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="viewfolder">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon4">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="launch">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon5">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="copy">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon6">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="export">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon7">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="delete">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon8">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="about">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon9">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="settings">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="icon10">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="cat">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<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>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="consolePreview">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
|
</property>
|
||||||
|
<property name="undoRedoEnabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>widgetStyleComboBox</tabstop>
|
||||||
|
<tabstop>widgetStyleFolder</tabstop>
|
||||||
|
<tabstop>iconsComboBox</tabstop>
|
||||||
|
<tabstop>iconsFolder</tabstop>
|
||||||
|
<tabstop>catPackComboBox</tabstop>
|
||||||
|
<tabstop>catPackFolder</tabstop>
|
||||||
|
<tabstop>reloadThemesButton</tabstop>
|
||||||
|
<tabstop>consoleFont</tabstop>
|
||||||
|
<tabstop>fontSizeBox</tabstop>
|
||||||
|
<tabstop>catOpacitySlider</tabstop>
|
||||||
|
<tabstop>consolePreview</tabstop>
|
||||||
|
</tabstops>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -44,13 +44,14 @@ CustomCommands::~CustomCommands()
|
||||||
CustomCommands::CustomCommands(QWidget* parent) : QWidget(parent), ui(new Ui::CustomCommands)
|
CustomCommands::CustomCommands(QWidget* parent) : QWidget(parent), ui(new Ui::CustomCommands)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
connect(ui->overrideCheckBox, &QCheckBox::toggled, ui->customCommandsWidget, &QWidget::setEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomCommands::initialize(bool checkable, bool checked, const QString& prelaunch, const QString& wrapper, const QString& postexit)
|
void CustomCommands::initialize(bool checkable, bool checked, const QString& prelaunch, const QString& wrapper, const QString& postexit)
|
||||||
{
|
{
|
||||||
ui->customCommandsGroupBox->setCheckable(checkable);
|
ui->overrideCheckBox->setVisible(checkable);
|
||||||
if (checkable) {
|
if (checkable) {
|
||||||
ui->customCommandsGroupBox->setChecked(checked);
|
ui->overrideCheckBox->setChecked(checked);
|
||||||
}
|
}
|
||||||
ui->preLaunchCmdTextBox->setText(prelaunch);
|
ui->preLaunchCmdTextBox->setText(prelaunch);
|
||||||
ui->wrapperCmdTextBox->setText(wrapper);
|
ui->wrapperCmdTextBox->setText(wrapper);
|
||||||
|
@ -64,9 +65,9 @@ void CustomCommands::retranslate()
|
||||||
|
|
||||||
bool CustomCommands::checked() const
|
bool CustomCommands::checked() const
|
||||||
{
|
{
|
||||||
if (!ui->customCommandsGroupBox->isCheckable())
|
if (!ui->overrideCheckBox->isVisible())
|
||||||
return true;
|
return true;
|
||||||
return ui->customCommandsGroupBox->isChecked();
|
return ui->overrideCheckBox->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CustomCommands::prelaunchCommand() const
|
QString CustomCommands::prelaunchCommand() const
|
||||||
|
|
|
@ -24,58 +24,100 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="customCommandsGroupBox">
|
<widget class="QCheckBox" name="overrideCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Override &Global Settings</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="customCommandsWidget" native="true">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
|
||||||
<string>&Custom Commands</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="labelPreLaunchCmd">
|
<widget class="QLabel" name="labelPreLaunchCmd">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Pre-launch command:</string>
|
<string>&Pre-launch Command</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>preLaunchCmdTextBox</cstring>
|
<cstring>preLaunchCmdTextBox</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="5" column="0">
|
||||||
<widget class="QLineEdit" name="preLaunchCmdTextBox"/>
|
<spacer name="verticalSpacer_2">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
|
<widget class="QLineEdit" name="preLaunchCmdTextBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLineEdit" name="wrapperCmdTextBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="labelPostExitCmd">
|
||||||
|
<property name="text">
|
||||||
|
<string>P&ost-exit Command</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>labelPostExitCmd</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<widget class="QLineEdit" name="postExitCmdTextBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="labelWrapperCmd">
|
<widget class="QLabel" name="labelWrapperCmd">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Wrapper command:</string>
|
<string>&Wrapper Command</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>wrapperCmdTextBox</cstring>
|
<cstring>wrapperCmdTextBox</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="wrapperCmdTextBox"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="labelPostExitCmd">
|
<spacer name="verticalSpacer_3">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>P&ost-exit command:</string>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="sizeType">
|
||||||
<cstring>postExitCmdTextBox</cstring>
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
</item>
|
<size>
|
||||||
<item row="2" column="1">
|
<width>0</width>
|
||||||
<widget class="QLineEdit" name="postExitCmdTextBox"/>
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
@ -50,6 +50,8 @@ EnvironmentVariables::EnvironmentVariables(QWidget* parent) : QWidget(parent), u
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->clear, &QPushButton::clicked, this, [this] { ui->list->clear(); });
|
connect(ui->clear, &QPushButton::clicked, this, [this] { ui->list->clear(); });
|
||||||
|
|
||||||
|
connect(ui->overrideCheckBox, &QCheckBox::toggled, ui->settingsWidget, &QWidget::setEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvironmentVariables::~EnvironmentVariables()
|
EnvironmentVariables::~EnvironmentVariables()
|
||||||
|
@ -60,8 +62,8 @@ EnvironmentVariables::~EnvironmentVariables()
|
||||||
void EnvironmentVariables::initialize(bool instance, bool override, const QMap<QString, QVariant>& value)
|
void EnvironmentVariables::initialize(bool instance, bool override, const QMap<QString, QVariant>& value)
|
||||||
{
|
{
|
||||||
// update widgets to settings
|
// update widgets to settings
|
||||||
ui->groupBox->setCheckable(instance);
|
ui->overrideCheckBox->setVisible(instance);
|
||||||
ui->groupBox->setChecked(override);
|
ui->overrideCheckBox->setChecked(override);
|
||||||
|
|
||||||
// populate
|
// populate
|
||||||
ui->list->clear();
|
ui->list->clear();
|
||||||
|
@ -94,9 +96,9 @@ void EnvironmentVariables::retranslate()
|
||||||
|
|
||||||
bool EnvironmentVariables::override() const
|
bool EnvironmentVariables::override() const
|
||||||
{
|
{
|
||||||
if (!ui->groupBox->isCheckable())
|
if (!ui->overrideCheckBox->isVisible())
|
||||||
return false;
|
return false;
|
||||||
return ui->groupBox->isChecked();
|
return ui->overrideCheckBox->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<QString, QVariant> EnvironmentVariables::value() const
|
QMap<QString, QVariant> EnvironmentVariables::value() const
|
||||||
|
|
|
@ -14,27 +14,72 @@
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QCheckBox" name="overrideCheckBox">
|
||||||
<property name="title">
|
<property name="text">
|
||||||
<string>&Environment Variables</string>
|
<string>Override &Global Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checked">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="settingsWidget" native="true">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="buttons">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="add">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Add</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="remove">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Remove</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<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>
|
||||||
|
<widget class="QPushButton" name="clear">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Clear</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTreeWidget" name="list">
|
<widget class="QTreeWidget" name="list">
|
||||||
<property name="alternatingRowColors">
|
<property name="alternatingRowColors">
|
||||||
|
@ -67,44 +112,6 @@
|
||||||
</column>
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="buttons">
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="add">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Add</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="remove">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Remove</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="clear">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Clear</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -289,26 +289,18 @@ void JavaSettingsWidget::updateThresholds()
|
||||||
unsigned int maxMem = m_ui->maxMemSpinBox->value();
|
unsigned int maxMem = m_ui->maxMemSpinBox->value();
|
||||||
unsigned int minMem = m_ui->minMemSpinBox->value();
|
unsigned int minMem = m_ui->minMemSpinBox->value();
|
||||||
|
|
||||||
QString iconName;
|
const QString warningColour(QStringLiteral("<span style='color:#f5c211'>%1</span>"));
|
||||||
|
|
||||||
if (maxMem >= sysMiB) {
|
if (maxMem >= sysMiB) {
|
||||||
iconName = "status-bad";
|
m_ui->labelMaxMemNotice->setText(QString("<span style='color:red'>%1</span>").arg(tr("Your maximum memory allocation exceeds your system memory capacity.")));
|
||||||
m_ui->labelMaxMemIcon->setToolTip(tr("Your maximum memory allocation exceeds your system memory capacity."));
|
m_ui->labelMaxMemNotice->show();
|
||||||
} else if (maxMem > (sysMiB * 0.9)) {
|
} else if (maxMem > (sysMiB * 0.9)) {
|
||||||
iconName = "status-yellow";
|
m_ui->labelMaxMemNotice->setText(warningColour.arg(tr("Your maximum memory allocation is close to your system memory capacity.")));
|
||||||
m_ui->labelMaxMemIcon->setToolTip(tr("Your maximum memory allocation approaches your system memory capacity."));
|
m_ui->labelMaxMemNotice->show();
|
||||||
} else if (maxMem < minMem) {
|
} else if (maxMem < minMem) {
|
||||||
iconName = "status-yellow";
|
m_ui->labelMaxMemNotice->setText(warningColour.arg(tr("Your maximum memory allocation is below the minimum memory allocation.")));
|
||||||
m_ui->labelMaxMemIcon->setToolTip(tr("Your maximum memory allocation is smaller than the minimum value"));
|
m_ui->labelMaxMemNotice->show();
|
||||||
} else {
|
} else {
|
||||||
iconName = "status-good";
|
m_ui->labelMaxMemNotice->hide();
|
||||||
m_ui->labelMaxMemIcon->setToolTip("");
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto height = m_ui->labelMaxMemIcon->fontInfo().pixelSize();
|
|
||||||
QIcon icon = APPLICATION->getThemedIcon(iconName);
|
|
||||||
QPixmap pix = icon.pixmap(height, height);
|
|
||||||
m_ui->labelMaxMemIcon->setPixmap(pix);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>500</width>
|
<width>500</width>
|
||||||
<height>600</height>
|
<height>1000</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="javaInstallationGroupBox">
|
<widget class="QGroupBox" name="javaInstallationGroupBox">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
|
@ -29,53 +29,92 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="6" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QCheckBox" name="autodetectJavaCheckBox">
|
<widget class="QCheckBox" name="autodetectJavaCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Auto-&detect Java version</string>
|
<string>Auto-&detect Java version</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="javaPathTextBox"/>
|
<widget class="QPushButton" name="javaDetectBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Detect</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="javaBrowseBtn">
|
<widget class="QPushButton" name="javaBrowseBtn">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Browse</string>
|
<string>&Browse</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="10" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="javaDownloadBtn">
|
|
||||||
<property name="text">
|
|
||||||
<string>Download Java</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="javaDetectBtn">
|
|
||||||
<property name="text">
|
|
||||||
<string>Auto-detect...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="javaTestBtn">
|
<widget class="QPushButton" name="javaTestBtn">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Test</string>
|
<string>Test S&ettings</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="javaDownloadBtn">
|
||||||
|
<property name="text">
|
||||||
|
<string>Open Java &Downloader</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_7">
|
||||||
|
<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>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="9" column="0">
|
||||||
|
<spacer name="verticalSpacer_4">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="0">
|
||||||
<widget class="QCheckBox" name="autodownloadJavaCheckBox">
|
<widget class="QCheckBox" name="autodownloadJavaCheckBox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Automatically downloads and selects the Java build recommended by Mojang.</string>
|
<string>Automatically downloads and selects the Java build recommended by Mojang.</string>
|
||||||
|
@ -86,6 +125,29 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
|
<widget class="QCheckBox" name="skipCompatibilityCheckBox">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>If enabled, the launcher will not check if an instance is compatible with the selected Java version.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Skip Java compatibility checks</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLineEdit" name="javaPathTextBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Java &Executable</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>javaPathTextBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
<widget class="QCheckBox" name="skipWizardCheckBox">
|
<widget class="QCheckBox" name="skipWizardCheckBox">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>If enabled, the launcher won't prompt you to choose a Java version if one is not found on startup.</string>
|
<string>If enabled, the launcher won't prompt you to choose a Java version if one is not found on startup.</string>
|
||||||
|
@ -96,14 +158,20 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QCheckBox" name="skipCompatibilityCheckBox">
|
<spacer name="verticalSpacer_5">
|
||||||
<property name="toolTip">
|
<property name="orientation">
|
||||||
<string>If enabled, the launcher will not check if an instance is compatible with the selected Java version.</string>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="sizeType">
|
||||||
<string>Skip Java compatibility checks</string>
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -122,23 +190,29 @@
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_5" columnstretch="1,0,0">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="2" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="labelPermGen">
|
<widget class="QLabel" name="labelMaxMemNotice">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>PermGen (Java 7 and earlier):</string>
|
<string>Memory Notice</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="2" column="2">
|
||||||
<widget class="QLabel" name="labelMinMem">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Minimum memory allocation:</string>
|
<string>(-XX:PermSize)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QSpinBox" name="permGenSpinBox">
|
<widget class="QSpinBox" name="permGenSpinBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>The amount of memory available to store loaded Java classes.</string>
|
<string>The amount of memory available to store loaded Java classes.</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -149,7 +223,7 @@
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>999999999</number>
|
<number>1048576</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="singleStep">
|
<property name="singleStep">
|
||||||
<number>8</number>
|
<number>8</number>
|
||||||
|
@ -159,28 +233,14 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="labelMaxMem">
|
|
||||||
<property name="text">
|
|
||||||
<string>Maximum memory allocation:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QLabel" name="labelMaxMemIcon">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>maxMemSpinBox</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="maxMemSpinBox">
|
<widget class="QSpinBox" name="maxMemSpinBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>The maximum amount of memory Minecraft is allowed to use.</string>
|
<string>The maximum amount of memory Minecraft is allowed to use.</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -201,8 +261,21 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>(-Xmx)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QSpinBox" name="minMemSpinBox">
|
<widget class="QSpinBox" name="minMemSpinBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>The amount of memory Minecraft is started with.</string>
|
<string>The amount of memory Minecraft is started with.</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -223,6 +296,56 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_11">
|
||||||
|
<property name="text">
|
||||||
|
<string>&PermGen Size:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>permGenSpinBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>(-Xms)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="labelMaxMem">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ma&ximum Memory Usage:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>maxMemSpinBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelMinMem">
|
||||||
|
<property name="text">
|
||||||
|
<string>M&inimum Memory Usage:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>minMemSpinBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="3">
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -251,14 +374,14 @@
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>javaPathTextBox</tabstop>
|
<tabstop>javaPathTextBox</tabstop>
|
||||||
<tabstop>javaBrowseBtn</tabstop>
|
|
||||||
<tabstop>javaDownloadBtn</tabstop>
|
|
||||||
<tabstop>javaDetectBtn</tabstop>
|
<tabstop>javaDetectBtn</tabstop>
|
||||||
<tabstop>javaTestBtn</tabstop>
|
<tabstop>javaBrowseBtn</tabstop>
|
||||||
<tabstop>skipCompatibilityCheckBox</tabstop>
|
<tabstop>skipCompatibilityCheckBox</tabstop>
|
||||||
<tabstop>skipWizardCheckBox</tabstop>
|
<tabstop>skipWizardCheckBox</tabstop>
|
||||||
<tabstop>autodetectJavaCheckBox</tabstop>
|
<tabstop>autodetectJavaCheckBox</tabstop>
|
||||||
<tabstop>autodownloadJavaCheckBox</tabstop>
|
<tabstop>autodownloadJavaCheckBox</tabstop>
|
||||||
|
<tabstop>javaTestBtn</tabstop>
|
||||||
|
<tabstop>javaDownloadBtn</tabstop>
|
||||||
<tabstop>minMemSpinBox</tabstop>
|
<tabstop>minMemSpinBox</tabstop>
|
||||||
<tabstop>maxMemSpinBox</tabstop>
|
<tabstop>maxMemSpinBox</tabstop>
|
||||||
<tabstop>permGenSpinBox</tabstop>
|
<tabstop>permGenSpinBox</tabstop>
|
||||||
|
|
|
@ -50,14 +50,11 @@ MinecraftSettingsWidget::MinecraftSettingsWidget(MinecraftInstancePtr instance,
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
if (m_instance == nullptr) {
|
if (m_instance == nullptr) {
|
||||||
for (int i = m_ui->settingsTabs->count() - 1; i >= 0; --i) {
|
m_ui->settingsTabs->removeTab(1);
|
||||||
const QString name = m_ui->settingsTabs->widget(i)->objectName();
|
|
||||||
|
|
||||||
if (name == "javaPage" || name == "launchPage")
|
|
||||||
m_ui->settingsTabs->removeTab(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_ui->openGlobalSettingsButton->setVisible(false);
|
m_ui->openGlobalSettingsButton->setVisible(false);
|
||||||
|
m_ui->instanceAccountGroupBox->hide();
|
||||||
|
m_ui->serverJoinGroupBox->hide();
|
||||||
} else {
|
} else {
|
||||||
m_javaSettings = new JavaSettingsWidget(m_instance, this);
|
m_javaSettings = new JavaSettingsWidget(m_instance, this);
|
||||||
m_ui->javaScrollArea->setWidget(m_javaSettings);
|
m_ui->javaScrollArea->setWidget(m_javaSettings);
|
||||||
|
@ -71,7 +68,6 @@ MinecraftSettingsWidget::MinecraftSettingsWidget(MinecraftInstancePtr instance,
|
||||||
tr("<span style=\" font-weight:600; color:#f5c211;\">Warning</span><span style=\" color:#f5c211;\">: The maximized option is "
|
tr("<span style=\" font-weight:600; color:#f5c211;\">Warning</span><span style=\" color:#f5c211;\">: The maximized option is "
|
||||||
"not fully supported on this Minecraft version.</span>"));
|
"not fully supported on this Minecraft version.</span>"));
|
||||||
|
|
||||||
m_ui->miscellaneousSettingsBox->setCheckable(true);
|
|
||||||
m_ui->consoleSettingsBox->setCheckable(true);
|
m_ui->consoleSettingsBox->setCheckable(true);
|
||||||
m_ui->windowSizeGroupBox->setCheckable(true);
|
m_ui->windowSizeGroupBox->setCheckable(true);
|
||||||
m_ui->nativeWorkaroundsGroupBox->setCheckable(true);
|
m_ui->nativeWorkaroundsGroupBox->setCheckable(true);
|
||||||
|
@ -139,11 +135,13 @@ void MinecraftSettingsWidget::loadSettings()
|
||||||
settings = APPLICATION->settings();
|
settings = APPLICATION->settings();
|
||||||
|
|
||||||
// Game Window
|
// Game Window
|
||||||
m_ui->windowSizeGroupBox->setChecked(m_instance == nullptr || settings->get("OverrideWindow").toBool());
|
m_ui->windowSizeGroupBox->setChecked(m_instance == nullptr || settings->get("OverrideWindow").toBool() ||
|
||||||
m_ui->windowSizeGroupBox->setChecked(settings->get("OverrideWindow").toBool());
|
settings->get("OverrideMiscellaneous").toBool());
|
||||||
m_ui->maximizedCheckBox->setChecked(settings->get("LaunchMaximized").toBool());
|
m_ui->maximizedCheckBox->setChecked(settings->get("LaunchMaximized").toBool());
|
||||||
m_ui->windowWidthSpinBox->setValue(settings->get("MinecraftWinWidth").toInt());
|
m_ui->windowWidthSpinBox->setValue(settings->get("MinecraftWinWidth").toInt());
|
||||||
m_ui->windowHeightSpinBox->setValue(settings->get("MinecraftWinHeight").toInt());
|
m_ui->windowHeightSpinBox->setValue(settings->get("MinecraftWinHeight").toInt());
|
||||||
|
m_ui->closeAfterLaunchCheck->setChecked(settings->get("CloseAfterLaunch").toBool());
|
||||||
|
m_ui->quitAfterGameStopCheck->setChecked(settings->get("QuitAfterGameStop").toBool());
|
||||||
|
|
||||||
// Game Time
|
// Game Time
|
||||||
m_ui->gameTimeGroupBox->setChecked(m_instance == nullptr || settings->get("OverrideGameTime").toBool());
|
m_ui->gameTimeGroupBox->setChecked(m_instance == nullptr || settings->get("OverrideGameTime").toBool());
|
||||||
|
@ -158,11 +156,6 @@ void MinecraftSettingsWidget::loadSettings()
|
||||||
m_ui->autoCloseConsoleCheck->setChecked(settings->get("AutoCloseConsole").toBool());
|
m_ui->autoCloseConsoleCheck->setChecked(settings->get("AutoCloseConsole").toBool());
|
||||||
m_ui->showConsoleErrorCheck->setChecked(settings->get("ShowConsoleOnError").toBool());
|
m_ui->showConsoleErrorCheck->setChecked(settings->get("ShowConsoleOnError").toBool());
|
||||||
|
|
||||||
// Miscellaneous
|
|
||||||
m_ui->miscellaneousSettingsBox->setChecked(settings->get("OverrideMiscellaneous").toBool());
|
|
||||||
m_ui->closeAfterLaunchCheck->setChecked(settings->get("CloseAfterLaunch").toBool());
|
|
||||||
m_ui->quitAfterGameStopCheck->setChecked(settings->get("QuitAfterGameStop").toBool());
|
|
||||||
|
|
||||||
if (m_javaSettings != nullptr)
|
if (m_javaSettings != nullptr)
|
||||||
m_javaSettings->loadSettings();
|
m_javaSettings->loadSettings();
|
||||||
|
|
||||||
|
@ -245,19 +238,6 @@ void MinecraftSettingsWidget::saveSettings()
|
||||||
{
|
{
|
||||||
SettingsObject::Lock lock(settings);
|
SettingsObject::Lock lock(settings);
|
||||||
|
|
||||||
// Miscellaneous
|
|
||||||
bool miscellaneous = m_instance == nullptr || m_ui->miscellaneousSettingsBox->isChecked();
|
|
||||||
|
|
||||||
if (m_instance != nullptr)
|
|
||||||
settings->set("OverrideMiscellaneous", miscellaneous);
|
|
||||||
|
|
||||||
if (miscellaneous) {
|
|
||||||
settings->set("CloseAfterLaunch", m_ui->closeAfterLaunchCheck->isChecked());
|
|
||||||
settings->set("QuitAfterGameStop", m_ui->quitAfterGameStopCheck->isChecked());
|
|
||||||
} else {
|
|
||||||
settings->reset("CloseAfterLaunch");
|
|
||||||
settings->reset("QuitAfterGameStop");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Console
|
// Console
|
||||||
bool console = m_instance == nullptr || m_ui->consoleSettingsBox->isChecked();
|
bool console = m_instance == nullptr || m_ui->consoleSettingsBox->isChecked();
|
||||||
|
@ -275,20 +255,26 @@ void MinecraftSettingsWidget::saveSettings()
|
||||||
settings->reset("ShowConsoleOnError");
|
settings->reset("ShowConsoleOnError");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Window Size
|
// Game Window
|
||||||
bool window = m_instance == nullptr || m_ui->windowSizeGroupBox->isChecked();
|
bool window = m_instance == nullptr || m_ui->windowSizeGroupBox->isChecked();
|
||||||
|
|
||||||
if (m_instance != nullptr)
|
if (m_instance != nullptr) {
|
||||||
settings->set("OverrideWindow", window);
|
settings->set("OverrideWindow", window);
|
||||||
|
settings->set("OverrideMiscellaneous", window);
|
||||||
|
}
|
||||||
|
|
||||||
if (window) {
|
if (window) {
|
||||||
settings->set("LaunchMaximized", m_ui->maximizedCheckBox->isChecked());
|
settings->set("LaunchMaximized", m_ui->maximizedCheckBox->isChecked());
|
||||||
settings->set("MinecraftWinWidth", m_ui->windowWidthSpinBox->value());
|
settings->set("MinecraftWinWidth", m_ui->windowWidthSpinBox->value());
|
||||||
settings->set("MinecraftWinHeight", m_ui->windowHeightSpinBox->value());
|
settings->set("MinecraftWinHeight", m_ui->windowHeightSpinBox->value());
|
||||||
|
settings->set("CloseAfterLaunch", m_ui->closeAfterLaunchCheck->isChecked());
|
||||||
|
settings->set("QuitAfterGameStop", m_ui->quitAfterGameStopCheck->isChecked());
|
||||||
} else {
|
} else {
|
||||||
settings->reset("LaunchMaximized");
|
settings->reset("LaunchMaximized");
|
||||||
settings->reset("MinecraftWinWidth");
|
settings->reset("MinecraftWinWidth");
|
||||||
settings->reset("MinecraftWinHeight");
|
settings->reset("MinecraftWinHeight");
|
||||||
|
settings->reset("CloseAfterLaunch");
|
||||||
|
settings->reset("QuitAfterGameStop");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom Commands
|
// Custom Commands
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>648</width>
|
<width>648</width>
|
||||||
<height>400</height>
|
<height>600</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
@ -51,9 +51,6 @@
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="horizontalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
@ -61,9 +58,9 @@
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-253</y>
|
<y>-207</y>
|
||||||
<width>610</width>
|
<width>603</width>
|
||||||
<height>550</height>
|
<height>694</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
@ -81,15 +78,8 @@
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item>
|
<item row="1" column="0" colspan="6">
|
||||||
<widget class="QCheckBox" name="maximizedCheckBox">
|
|
||||||
<property name="text">
|
|
||||||
<string>Start Minecraft maximized</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="maximizedWarning">
|
<widget class="QLabel" name="maximizedWarning">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>The base game only supports resolution. In order to simulate the maximized behaviour the current implementation approximates the maximum display size.</string>
|
<string>The base game only supports resolution. In order to simulate the maximized behaviour the current implementation approximates the maximum display size.</string>
|
||||||
|
@ -99,52 +89,165 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="5" column="0" colspan="6">
|
||||||
|
<widget class="QCheckBox" name="quitAfterGameStopCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>When the game window closes, quit the launcher</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="6">
|
||||||
|
<widget class="QCheckBox" name="maximizedCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Start Minecraft maximized</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="6">
|
||||||
|
<widget class="QCheckBox" name="closeAfterLaunchCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>When the game window opens, hide the launcher</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="3">
|
||||||
|
<widget class="QSpinBox" name="windowWidthSpinBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>65536</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>854</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<spacer name="verticalSpacer_3">
|
||||||
|
<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>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QSpinBox" name="windowHeightSpinBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>65536</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>480</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="labelWindowWidth">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Window Size:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>windowWidthSpinBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>×</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="4">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>pixels</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="5">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<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>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="consoleSettingsBox">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>&Console Window</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayoutWindowSize">
|
<widget class="QCheckBox" name="showConsoleCheck">
|
||||||
<item row="1" column="0">
|
<property name="text">
|
||||||
<widget class="QLabel" name="labelWindowHeight">
|
<string>When the game is launched, show the console window</string>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Window height:</string>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<widget class="QCheckBox" name="showConsoleErrorCheck">
|
||||||
<item row="0" column="0">
|
<property name="text">
|
||||||
<widget class="QLabel" name="labelWindowWidth">
|
<string>When the game crashes, show the console window</string>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Window width:</string>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<widget class="QCheckBox" name="autoCloseConsoleCheck">
|
||||||
<item row="0" column="1">
|
<property name="text">
|
||||||
<widget class="QSpinBox" name="windowWidthSpinBox">
|
<string>When the game quits, hide the console window</string>
|
||||||
<property name="minimum">
|
</property>
|
||||||
<number>1</number>
|
</widget>
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>65536</number>
|
|
||||||
</property>
|
|
||||||
<property name="singleStep">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>854</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QSpinBox" name="windowHeightSpinBox">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>65536</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>480</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -196,70 +299,103 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="consoleSettingsBox">
|
<widget class="QGroupBox" name="instanceAccountGroupBox">
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>&Console</string>
|
<string>Override &Default Account</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="showConsoleCheck">
|
<widget class="QLabel" name="instanceAccountNameLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Show console while the game is running</string>
|
<string>Account:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="autoCloseConsoleCheck">
|
<widget class="QComboBox" name="instanceAccountSelector">
|
||||||
<property name="text">
|
<property name="sizePolicy">
|
||||||
<string>Automatically close console when the game quits</string>
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="showConsoleErrorCheck">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Show console when the game crashes</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="miscellaneousSettingsBox">
|
<widget class="QGroupBox" name="serverJoinGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>&Miscellaneous</string>
|
<string>Enable Auto-&join</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item>
|
<item row="1" column="1">
|
||||||
<widget class="QCheckBox" name="closeAfterLaunchCheck">
|
<widget class="QComboBox" name="worldsCb">
|
||||||
<property name="text">
|
<property name="sizePolicy">
|
||||||
<string>Close the launcher after game window opens</string>
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="quitAfterGameStopCheck">
|
<widget class="QRadioButton" name="worldJoinButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Quit the launcher after game window closes</string>
|
<string>Singleplayer world:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QRadioButton" name="serverJoinAddressButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Server address:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="serverJoinAddress">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -298,7 +434,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>624</width>
|
<width>624</width>
|
||||||
<height>297</height>
|
<height>487</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -313,9 +449,6 @@
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QScrollArea" name="scrollArea_2">
|
<widget class="QScrollArea" name="scrollArea_2">
|
||||||
<property name="horizontalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
@ -323,9 +456,9 @@
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>-101</y>
|
<y>0</y>
|
||||||
<width>610</width>
|
<width>624</width>
|
||||||
<height>398</height>
|
<height>487</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||||
|
@ -368,49 +501,68 @@
|
||||||
<property name="checked">
|
<property name="checked">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QFormLayout" name="formLayout_2">
|
||||||
|
<property name="labelAlignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="useNativeOpenALCheck">
|
|
||||||
<property name="text">
|
|
||||||
<string>Use system installation of OpenAL</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="labelGLFWPath">
|
<widget class="QLabel" name="labelGLFWPath">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&GLFW library path</string>
|
<string>&GLFW library path:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>lineEditGLFWPath</cstring>
|
<cstring>lineEditGLFWPath</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QCheckBox" name="useNativeGLFWCheck">
|
<spacer name="verticalSpacer_6">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Use system installation of GLFW</string>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeType">
|
||||||
</item>
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="lineEditGLFWPath">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>6</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="labelOpenALPath">
|
<widget class="QLabel" name="labelOpenALPath">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&OpenAL library path</string>
|
<string>&OpenAL library path:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>lineEditOpenALPath</cstring>
|
<cstring>lineEditOpenALPath</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditGLFWPath">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="useNativeGLFWCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use system installation of GLFW</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="useNativeOpenALCheck">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use system installation of OpenAL</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
<widget class="QLineEdit" name="lineEditOpenALPath">
|
<widget class="QLineEdit" name="lineEditOpenALPath">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
@ -497,115 +649,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="launchPage">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Launch</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
|
||||||
<item>
|
|
||||||
<widget class="QScrollArea" name="scrollArea_3">
|
|
||||||
<property name="widgetResizable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="scrollAreaWidgetContents_5">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>624</width>
|
|
||||||
<height>297</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="instanceAccountGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Override default &account</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_15">
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout" name="instanceAccountLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="instanceAccountNameLabel">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Account:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QComboBox" name="instanceAccountSelector"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="serverJoinGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Set a &target to join on launch</string>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QRadioButton" name="serverJoinAddressButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Server address:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QLineEdit" name="serverJoinAddress"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QRadioButton" name="worldJoinButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Singleplayer world</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QComboBox" name="worldsCb"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="customCommandsPage">
|
<widget class="QWidget" name="customCommandsPage">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Custom Commands</string>
|
<string>Custom Commands</string>
|
||||||
|
@ -621,6 +664,18 @@
|
||||||
<string>Environment Variables</string>
|
<string>Environment Variables</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="EnvironmentVariables" name="environmentVariables" native="true"/>
|
<widget class="EnvironmentVariables" name="environmentVariables" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
|
@ -649,30 +704,17 @@
|
||||||
<tabstop>settingsTabs</tabstop>
|
<tabstop>settingsTabs</tabstop>
|
||||||
<tabstop>scrollArea</tabstop>
|
<tabstop>scrollArea</tabstop>
|
||||||
<tabstop>maximizedCheckBox</tabstop>
|
<tabstop>maximizedCheckBox</tabstop>
|
||||||
<tabstop>windowWidthSpinBox</tabstop>
|
|
||||||
<tabstop>windowHeightSpinBox</tabstop>
|
<tabstop>windowHeightSpinBox</tabstop>
|
||||||
|
<tabstop>windowWidthSpinBox</tabstop>
|
||||||
|
<tabstop>closeAfterLaunchCheck</tabstop>
|
||||||
|
<tabstop>quitAfterGameStopCheck</tabstop>
|
||||||
|
<tabstop>showConsoleCheck</tabstop>
|
||||||
|
<tabstop>showConsoleErrorCheck</tabstop>
|
||||||
|
<tabstop>autoCloseConsoleCheck</tabstop>
|
||||||
<tabstop>showGameTime</tabstop>
|
<tabstop>showGameTime</tabstop>
|
||||||
<tabstop>recordGameTime</tabstop>
|
<tabstop>recordGameTime</tabstop>
|
||||||
<tabstop>showGlobalGameTime</tabstop>
|
<tabstop>showGlobalGameTime</tabstop>
|
||||||
<tabstop>showGameTimeWithoutDays</tabstop>
|
<tabstop>showGameTimeWithoutDays</tabstop>
|
||||||
<tabstop>showConsoleCheck</tabstop>
|
|
||||||
<tabstop>autoCloseConsoleCheck</tabstop>
|
|
||||||
<tabstop>showConsoleErrorCheck</tabstop>
|
|
||||||
<tabstop>closeAfterLaunchCheck</tabstop>
|
|
||||||
<tabstop>quitAfterGameStopCheck</tabstop>
|
|
||||||
<tabstop>javaScrollArea</tabstop>
|
|
||||||
<tabstop>scrollArea_2</tabstop>
|
|
||||||
<tabstop>onlineFixes</tabstop>
|
|
||||||
<tabstop>useNativeGLFWCheck</tabstop>
|
|
||||||
<tabstop>lineEditGLFWPath</tabstop>
|
|
||||||
<tabstop>useNativeOpenALCheck</tabstop>
|
|
||||||
<tabstop>lineEditOpenALPath</tabstop>
|
|
||||||
<tabstop>perfomanceGroupBox</tabstop>
|
|
||||||
<tabstop>enableFeralGamemodeCheck</tabstop>
|
|
||||||
<tabstop>enableMangoHud</tabstop>
|
|
||||||
<tabstop>useDiscreteGpuCheck</tabstop>
|
|
||||||
<tabstop>useZink</tabstop>
|
|
||||||
<tabstop>scrollArea_3</tabstop>
|
|
||||||
<tabstop>instanceAccountGroupBox</tabstop>
|
<tabstop>instanceAccountGroupBox</tabstop>
|
||||||
<tabstop>instanceAccountSelector</tabstop>
|
<tabstop>instanceAccountSelector</tabstop>
|
||||||
<tabstop>serverJoinGroupBox</tabstop>
|
<tabstop>serverJoinGroupBox</tabstop>
|
||||||
|
@ -680,6 +722,17 @@
|
||||||
<tabstop>serverJoinAddress</tabstop>
|
<tabstop>serverJoinAddress</tabstop>
|
||||||
<tabstop>worldJoinButton</tabstop>
|
<tabstop>worldJoinButton</tabstop>
|
||||||
<tabstop>worldsCb</tabstop>
|
<tabstop>worldsCb</tabstop>
|
||||||
|
<tabstop>javaScrollArea</tabstop>
|
||||||
|
<tabstop>scrollArea_2</tabstop>
|
||||||
|
<tabstop>onlineFixes</tabstop>
|
||||||
|
<tabstop>useNativeGLFWCheck</tabstop>
|
||||||
|
<tabstop>lineEditGLFWPath</tabstop>
|
||||||
|
<tabstop>useNativeOpenALCheck</tabstop>
|
||||||
|
<tabstop>lineEditOpenALPath</tabstop>
|
||||||
|
<tabstop>enableFeralGamemodeCheck</tabstop>
|
||||||
|
<tabstop>enableMangoHud</tabstop>
|
||||||
|
<tabstop>useDiscreteGpuCheck</tabstop>
|
||||||
|
<tabstop>useZink</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
@ -1,197 +0,0 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
|
||||||
/*
|
|
||||||
* Prism Launcher - Minecraft Launcher
|
|
||||||
* Copyright (C) 2024 Tayou <git@tayou.org>
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, version 3.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#include "ThemeCustomizationWidget.h"
|
|
||||||
#include "ui_ThemeCustomizationWidget.h"
|
|
||||||
|
|
||||||
#include "Application.h"
|
|
||||||
#include "DesktopServices.h"
|
|
||||||
#include "ui/themes/ITheme.h"
|
|
||||||
#include "ui/themes/ThemeManager.h"
|
|
||||||
|
|
||||||
ThemeCustomizationWidget::ThemeCustomizationWidget(QWidget* parent) : QWidget(parent), ui(new Ui::ThemeCustomizationWidget)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
loadSettings();
|
|
||||||
ThemeCustomizationWidget::refresh();
|
|
||||||
|
|
||||||
connect(ui->iconsComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ThemeCustomizationWidget::applyIconTheme);
|
|
||||||
connect(ui->widgetStyleComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
|
||||||
&ThemeCustomizationWidget::applyWidgetTheme);
|
|
||||||
connect(ui->backgroundCatComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ThemeCustomizationWidget::applyCatTheme);
|
|
||||||
|
|
||||||
connect(ui->iconsFolder, &QPushButton::clicked, this,
|
|
||||||
[] { DesktopServices::openPath(APPLICATION->themeManager()->getIconThemesFolder().path()); });
|
|
||||||
connect(ui->widgetStyleFolder, &QPushButton::clicked, this,
|
|
||||||
[] { DesktopServices::openPath(APPLICATION->themeManager()->getApplicationThemesFolder().path()); });
|
|
||||||
connect(ui->catPackFolder, &QPushButton::clicked, this,
|
|
||||||
[] { DesktopServices::openPath(APPLICATION->themeManager()->getCatPacksFolder().path()); });
|
|
||||||
|
|
||||||
connect(ui->refreshButton, &QPushButton::clicked, this, &ThemeCustomizationWidget::refresh);
|
|
||||||
}
|
|
||||||
|
|
||||||
ThemeCustomizationWidget::~ThemeCustomizationWidget()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The layout was not quite right, so currently this just disables the UI elements, which should be hidden instead
|
|
||||||
/// TODO FIXME
|
|
||||||
///
|
|
||||||
/// Original Method One:
|
|
||||||
/// ui->iconsComboBox->setVisible(features& ThemeFields::ICONS);
|
|
||||||
/// ui->iconsLabel->setVisible(features& ThemeFields::ICONS);
|
|
||||||
/// ui->widgetStyleComboBox->setVisible(features& ThemeFields::WIDGETS);
|
|
||||||
/// ui->widgetThemeLabel->setVisible(features& ThemeFields::WIDGETS);
|
|
||||||
/// ui->backgroundCatComboBox->setVisible(features& ThemeFields::CAT);
|
|
||||||
/// ui->backgroundCatLabel->setVisible(features& ThemeFields::CAT);
|
|
||||||
///
|
|
||||||
/// original Method Two:
|
|
||||||
/// if (!(features & ThemeFields::ICONS)) {
|
|
||||||
/// ui->formLayout->setRowVisible(0, false);
|
|
||||||
/// }
|
|
||||||
/// if (!(features & ThemeFields::WIDGETS)) {
|
|
||||||
/// ui->formLayout->setRowVisible(1, false);
|
|
||||||
/// }
|
|
||||||
/// if (!(features & ThemeFields::CAT)) {
|
|
||||||
/// ui->formLayout->setRowVisible(2, false);
|
|
||||||
/// }
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="features"></param>
|
|
||||||
void ThemeCustomizationWidget::showFeatures(ThemeFields features)
|
|
||||||
{
|
|
||||||
ui->iconsComboBox->setEnabled(features & ThemeFields::ICONS);
|
|
||||||
ui->iconsLabel->setEnabled(features & ThemeFields::ICONS);
|
|
||||||
ui->widgetStyleComboBox->setEnabled(features & ThemeFields::WIDGETS);
|
|
||||||
ui->widgetStyleLabel->setEnabled(features & ThemeFields::WIDGETS);
|
|
||||||
ui->backgroundCatComboBox->setEnabled(features & ThemeFields::CAT);
|
|
||||||
ui->backgroundCatLabel->setEnabled(features & ThemeFields::CAT);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeCustomizationWidget::applyIconTheme(int index)
|
|
||||||
{
|
|
||||||
auto settings = APPLICATION->settings();
|
|
||||||
auto originalIconTheme = settings->get("IconTheme").toString();
|
|
||||||
auto newIconTheme = ui->iconsComboBox->itemData(index).toString();
|
|
||||||
if (originalIconTheme != newIconTheme) {
|
|
||||||
settings->set("IconTheme", newIconTheme);
|
|
||||||
APPLICATION->themeManager()->applyCurrentlySelectedTheme();
|
|
||||||
}
|
|
||||||
|
|
||||||
emit currentIconThemeChanged(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeCustomizationWidget::applyWidgetTheme(int index)
|
|
||||||
{
|
|
||||||
auto settings = APPLICATION->settings();
|
|
||||||
auto originalAppTheme = settings->get("ApplicationTheme").toString();
|
|
||||||
auto newAppTheme = ui->widgetStyleComboBox->itemData(index).toString();
|
|
||||||
if (originalAppTheme != newAppTheme) {
|
|
||||||
settings->set("ApplicationTheme", newAppTheme);
|
|
||||||
APPLICATION->themeManager()->applyCurrentlySelectedTheme();
|
|
||||||
}
|
|
||||||
|
|
||||||
emit currentWidgetThemeChanged(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeCustomizationWidget::applyCatTheme(int index)
|
|
||||||
{
|
|
||||||
auto settings = APPLICATION->settings();
|
|
||||||
auto originalCat = settings->get("BackgroundCat").toString();
|
|
||||||
auto newCat = ui->backgroundCatComboBox->itemData(index).toString();
|
|
||||||
if (originalCat != newCat) {
|
|
||||||
settings->set("BackgroundCat", newCat);
|
|
||||||
}
|
|
||||||
|
|
||||||
emit currentCatChanged(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeCustomizationWidget::applySettings()
|
|
||||||
{
|
|
||||||
applyIconTheme(ui->iconsComboBox->currentIndex());
|
|
||||||
applyWidgetTheme(ui->widgetStyleComboBox->currentIndex());
|
|
||||||
applyCatTheme(ui->backgroundCatComboBox->currentIndex());
|
|
||||||
}
|
|
||||||
void ThemeCustomizationWidget::loadSettings()
|
|
||||||
{
|
|
||||||
auto settings = APPLICATION->settings();
|
|
||||||
|
|
||||||
{
|
|
||||||
auto currentIconTheme = settings->get("IconTheme").toString();
|
|
||||||
auto iconThemes = APPLICATION->themeManager()->getValidIconThemes();
|
|
||||||
int idx = 0;
|
|
||||||
for (auto iconTheme : iconThemes) {
|
|
||||||
QIcon iconForComboBox = QIcon(iconTheme->path() + "/scalable/settings");
|
|
||||||
ui->iconsComboBox->addItem(iconForComboBox, iconTheme->name(), iconTheme->id());
|
|
||||||
if (currentIconTheme == iconTheme->id()) {
|
|
||||||
ui->iconsComboBox->setCurrentIndex(idx);
|
|
||||||
}
|
|
||||||
idx++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
auto currentTheme = settings->get("ApplicationTheme").toString();
|
|
||||||
auto themes = APPLICATION->themeManager()->getValidApplicationThemes();
|
|
||||||
int idx = 0;
|
|
||||||
for (auto& theme : themes) {
|
|
||||||
ui->widgetStyleComboBox->addItem(theme->name(), theme->id());
|
|
||||||
if (theme->tooltip() != "") {
|
|
||||||
int index = ui->widgetStyleComboBox->count() - 1;
|
|
||||||
ui->widgetStyleComboBox->setItemData(index, theme->tooltip(), Qt::ToolTipRole);
|
|
||||||
}
|
|
||||||
if (currentTheme == theme->id()) {
|
|
||||||
ui->widgetStyleComboBox->setCurrentIndex(idx);
|
|
||||||
}
|
|
||||||
idx++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
auto cat = settings->get("BackgroundCat").toString();
|
|
||||||
for (auto& catFromList : APPLICATION->themeManager()->getValidCatPacks()) {
|
|
||||||
QIcon catIcon = QIcon(QString("%1").arg(catFromList->path()));
|
|
||||||
ui->backgroundCatComboBox->addItem(catIcon, catFromList->name(), catFromList->id());
|
|
||||||
if (cat == catFromList->id()) {
|
|
||||||
ui->backgroundCatComboBox->setCurrentIndex(ui->backgroundCatComboBox->count() - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeCustomizationWidget::retranslate()
|
|
||||||
{
|
|
||||||
ui->retranslateUi(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeCustomizationWidget::refresh()
|
|
||||||
{
|
|
||||||
applySettings();
|
|
||||||
disconnect(ui->iconsComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ThemeCustomizationWidget::applyIconTheme);
|
|
||||||
disconnect(ui->widgetStyleComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
|
||||||
&ThemeCustomizationWidget::applyWidgetTheme);
|
|
||||||
disconnect(ui->backgroundCatComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
|
||||||
&ThemeCustomizationWidget::applyCatTheme);
|
|
||||||
APPLICATION->themeManager()->refresh();
|
|
||||||
ui->iconsComboBox->clear();
|
|
||||||
ui->widgetStyleComboBox->clear();
|
|
||||||
ui->backgroundCatComboBox->clear();
|
|
||||||
loadSettings();
|
|
||||||
connect(ui->iconsComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ThemeCustomizationWidget::applyIconTheme);
|
|
||||||
connect(ui->widgetStyleComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
|
||||||
&ThemeCustomizationWidget::applyWidgetTheme);
|
|
||||||
connect(ui->backgroundCatComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ThemeCustomizationWidget::applyCatTheme);
|
|
||||||
};
|
|
|
@ -1,212 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>ThemeCustomizationWidget</class>
|
|
||||||
<widget class="QWidget" name="ThemeCustomizationWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>400</width>
|
|
||||||
<height>191</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string notr="true">Form</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetMinimumSize</enum>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="iconsLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Icons</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>iconsComboBox</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<layout class="QHBoxLayout" name="iconsLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="iconsComboBox">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::StrongFocus</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="iconsFolder">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>View icon themes folder.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="viewfolder"/>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="widgetStyleLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Widgets</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>widgetStyleComboBox</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<layout class="QHBoxLayout" name="widgetStyleLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="widgetStyleComboBox">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::StrongFocus</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="widgetStyleFolder">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>View widget themes folder.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="viewfolder"/>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="backgroundCatLabel">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>C&at</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>backgroundCatComboBox</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<layout class="QHBoxLayout" name="catLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="backgroundCatComboBox">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::StrongFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="catPackFolder">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>View cat packs folder.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset theme="viewfolder"/>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="refreshLayout">
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<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>
|
|
||||||
<widget class="QPushButton" name="refreshButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Refresh all</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|