From 54d393632d5c964f0c30ca9bc816853b92552c9c Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Wed, 19 Jul 2023 16:29:52 +0100 Subject: Automatically create theme folders, and add an action to open them Signed-off-by: TheKodeToad --- launcher/ui/MainWindow.ui | 48 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) (limited to 'launcher/ui/MainWindow.ui') diff --git a/launcher/ui/MainWindow.ui b/launcher/ui/MainWindow.ui index e4421d40..1bc62027 100644 --- a/launcher/ui/MainWindow.ui +++ b/launcher/ui/MainWindow.ui @@ -131,7 +131,7 @@ 0 0 800 - 20 + 31 @@ -186,9 +186,13 @@ true - + + + + + @@ -465,7 +469,8 @@ - + + .. Prism Launcher (zip) @@ -473,7 +478,8 @@ - + + .. Modrinth (mrpack) @@ -481,15 +487,17 @@ - + + .. - CurseForge (zip) + CurseForge (zip) - + + .. Mod List @@ -552,7 +560,7 @@ .. - &View Instance Folder + View &Instance Folder Open the instance folder in a file browser. @@ -564,7 +572,7 @@ .. - &View Launcher Root Folder + View Launcher &Root Folder Open the launcher's root folder in a file browser. @@ -719,6 +727,28 @@ Open the %1 wiki + + + + + + View &Widget Themes Folder + + + View Widget Theme Folder + + + + + + + + View I&con Theme Folder + + + View Icon Theme Folder + + -- cgit From 39f7bea53e8b8b30c1bb8c3e97eb4f856b361880 Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Thu, 20 Jul 2023 14:13:29 +0100 Subject: Revert accidental change in MainWindow Signed-off-by: TheKodeToad --- launcher/ui/MainWindow.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'launcher/ui/MainWindow.ui') diff --git a/launcher/ui/MainWindow.ui b/launcher/ui/MainWindow.ui index 1bc62027..a3f6dff7 100644 --- a/launcher/ui/MainWindow.ui +++ b/launcher/ui/MainWindow.ui @@ -131,7 +131,7 @@ 0 0 800 - 31 + 20 -- cgit From 816acc9c769eee50a4b738761d0b07995dc1eef6 Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Wed, 26 Jul 2023 17:17:02 +0100 Subject: Open catpak folder action Signed-off-by: TheKodeToad --- launcher/ui/MainWindow.cpp | 5 +++++ launcher/ui/MainWindow.h | 1 + launcher/ui/MainWindow.ui | 17 ++++++++++++++--- launcher/ui/themes/ThemeManager.cpp | 15 ++++++++++----- launcher/ui/themes/ThemeManager.h | 2 ++ launcher/ui/widgets/ThemeCustomizationWidget.cpp | 1 + launcher/ui/widgets/ThemeCustomizationWidget.ui | 12 +++++++----- 7 files changed, 40 insertions(+), 13 deletions(-) (limited to 'launcher/ui/MainWindow.ui') diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 00bb296f..e4a699da 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1160,6 +1160,11 @@ void MainWindow::on_actionViewWidgetThemeFolder_triggered() DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path()); } +void MainWindow::on_actionViewCatPackFolder_triggered() +{ + DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path()); +} + void MainWindow::refreshInstances() { APPLICATION->instances()->loadList(); diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h index 8756c078..ffc7154a 100644 --- a/launcher/ui/MainWindow.h +++ b/launcher/ui/MainWindow.h @@ -118,6 +118,7 @@ private slots: void on_actionViewIconThemeFolder_triggered(); void on_actionViewWidgetThemeFolder_triggered(); + void on_actionViewCatPackFolder_triggered(); void on_actionViewSelectedInstFolder_triggered(); diff --git a/launcher/ui/MainWindow.ui b/launcher/ui/MainWindow.ui index a3f6dff7..ad0a0808 100644 --- a/launcher/ui/MainWindow.ui +++ b/launcher/ui/MainWindow.ui @@ -131,7 +131,7 @@ 0 0 800 - 20 + 30 @@ -193,6 +193,7 @@ + @@ -729,7 +730,8 @@ - + + .. View &Widget Themes Folder @@ -740,7 +742,8 @@ - + + .. View I&con Theme Folder @@ -749,6 +752,14 @@ View Icon Theme Folder + + + + + + View Cat Packs Folder + + diff --git a/launcher/ui/themes/ThemeManager.cpp b/launcher/ui/themes/ThemeManager.cpp index 46fe0b25..bce13b45 100644 --- a/launcher/ui/themes/ThemeManager.cpp +++ b/launcher/ui/themes/ThemeManager.cpp @@ -205,6 +205,11 @@ QDir ThemeManager::getApplicationThemesFolder() return m_applicationThemeFolder; } +QDir ThemeManager::getCatPacksFolder() +{ + return m_catPacksFolder; +} + void ThemeManager::setIconTheme(const QString& name) { if (m_icons.find(name) == m_icons.end()) { @@ -270,9 +275,9 @@ void ThemeManager::initializeCatPacks() for (auto [id, name] : defaultCats) { addCatPack(std::unique_ptr(new BasicCatPack(id, name))); } - QDir catpacksDir("catpacks"); - QString catpacksFolder = catpacksDir.absoluteFilePath(""); - themeDebugLog() << "CatPacks Folder Path:" << catpacksFolder; + if (!m_catPacksFolder.mkpath(".")) + themeWarningLog() << "Couldn't create theme folder"; + themeDebugLog() << "CatPacks Folder Path:" << m_catPacksFolder.absolutePath(); QStringList supportedImageFormats; for (auto format : QImageReader::supportedImageFormats()) { @@ -289,9 +294,9 @@ void ThemeManager::initializeCatPacks() } }; - loadFiles(catpacksDir); + loadFiles(m_catPacksFolder); - QDirIterator directoryIterator(catpacksFolder, QDir::Dirs | QDir::NoDotAndDotDot); + QDirIterator directoryIterator(m_catPacksFolder.path(), QDir::Dirs | QDir::NoDotAndDotDot); while (directoryIterator.hasNext()) { QDir dir(directoryIterator.next()); QFileInfo manifest(dir.absoluteFilePath("catpack.json")); diff --git a/launcher/ui/themes/ThemeManager.h b/launcher/ui/themes/ThemeManager.h index 1eb83ce1..b5c66677 100644 --- a/launcher/ui/themes/ThemeManager.h +++ b/launcher/ui/themes/ThemeManager.h @@ -44,6 +44,7 @@ class ThemeManager { bool isValidApplicationTheme(const QString& id); QDir getIconThemesFolder(); QDir getApplicationThemesFolder(); + QDir getCatPacksFolder(); void applyCurrentlySelectedTheme(bool initial = false); void setIconTheme(const QString& name); void setApplicationTheme(const QString& name, bool initial = false); @@ -59,6 +60,7 @@ class ThemeManager { std::map m_icons; QDir m_iconThemeFolder{ "iconthemes" }; QDir m_applicationThemeFolder{ "themes" }; + QDir m_catPacksFolder{ "catpacks" }; std::map> m_catPacks; void initializeThemes(); diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.cpp b/launcher/ui/widgets/ThemeCustomizationWidget.cpp index b9294908..c999ac92 100644 --- a/launcher/ui/widgets/ThemeCustomizationWidget.cpp +++ b/launcher/ui/widgets/ThemeCustomizationWidget.cpp @@ -35,6 +35,7 @@ ThemeCustomizationWidget::ThemeCustomizationWidget(QWidget* parent) : QWidget(pa connect(ui->iconsFolder, &QPushButton::clicked, this, [] { DesktopServices::openDirectory(APPLICATION->themeManager()->getIconThemesFolder().path()); }); connect(ui->widgetStyleFolder, &QPushButton::clicked, this, [] { DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path()); }); + connect(ui->catPackFolder, &QPushButton::clicked, this, [] { DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path()); }); } ThemeCustomizationWidget::~ThemeCustomizationWidget() diff --git a/launcher/ui/widgets/ThemeCustomizationWidget.ui b/launcher/ui/widgets/ThemeCustomizationWidget.ui index 266b1dd6..4503181c 100644 --- a/launcher/ui/widgets/ThemeCustomizationWidget.ui +++ b/launcher/ui/widgets/ThemeCustomizationWidget.ui @@ -63,7 +63,8 @@ - + + .. true @@ -106,7 +107,8 @@ - + + .. true @@ -147,15 +149,15 @@ - + - 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. + View cat packs folder. - + .. -- cgit From 719d87de3bb6f65bc63ad518126074fd9f5f6283 Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Wed, 26 Jul 2023 17:21:12 +0100 Subject: Update MainWindow.ui Signed-off-by: TheKodeToad --- launcher/ui/MainWindow.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'launcher/ui/MainWindow.ui') diff --git a/launcher/ui/MainWindow.ui b/launcher/ui/MainWindow.ui index ad0a0808..6ef32099 100644 --- a/launcher/ui/MainWindow.ui +++ b/launcher/ui/MainWindow.ui @@ -131,7 +131,7 @@ 0 0 800 - 30 + 20 -- cgit