aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--launcher/ui/MainWindow.cpp5
-rw-r--r--launcher/ui/MainWindow.h1
-rw-r--r--launcher/ui/MainWindow.ui17
-rw-r--r--launcher/ui/themes/ThemeManager.cpp15
-rw-r--r--launcher/ui/themes/ThemeManager.h2
-rw-r--r--launcher/ui/widgets/ThemeCustomizationWidget.cpp1
-rw-r--r--launcher/ui/widgets/ThemeCustomizationWidget.ui12
7 files changed, 40 insertions, 13 deletions
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 @@
<x>0</x>
<y>0</y>
<width>800</width>
- <height>20</height>
+ <height>30</height>
</rect>
</property>
<widget class="QMenu" name="fileMenu">
@@ -193,6 +193,7 @@
<addaction name="separator"/>
<addaction name="actionViewIconThemeFolder"/>
<addaction name="actionViewWidgetThemeFolder"/>
+ <addaction name="actionViewCatPackFolder"/>
</widget>
<widget class="QMenu" name="accountsMenu">
<property name="title">
@@ -729,7 +730,8 @@
</action>
<action name="actionViewWidgetThemeFolder">
<property name="icon">
- <iconset theme="viewfolder"/>
+ <iconset theme="viewfolder">
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>View &amp;Widget Themes Folder</string>
@@ -740,7 +742,8 @@
</action>
<action name="actionViewIconThemeFolder">
<property name="icon">
- <iconset theme="viewfolder"/>
+ <iconset theme="viewfolder">
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>View I&amp;con Theme Folder</string>
@@ -749,6 +752,14 @@
<string>View Icon Theme Folder</string>
</property>
</action>
+ <action name="actionViewCatPackFolder">
+ <property name="icon">
+ <iconset theme="viewfolder"/>
+ </property>
+ <property name="text">
+ <string>View Cat Packs Folder</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>
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<CatPack>(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<QString, IconTheme> m_icons;
QDir m_iconThemeFolder{ "iconthemes" };
QDir m_applicationThemeFolder{ "themes" };
+ QDir m_catPacksFolder{ "catpacks" };
std::map<QString, std::unique_ptr<CatPack>> 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 @@
<string/>
</property>
<property name="icon">
- <iconset theme="viewfolder"/>
+ <iconset theme="viewfolder">
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="flat">
<bool>true</bool>
@@ -106,7 +107,8 @@
<string/>
</property>
<property name="icon">
- <iconset theme="viewfolder"/>
+ <iconset theme="viewfolder">
+ <normaloff>.</normaloff>.</iconset>
</property>
<property name="flat">
<bool>true</bool>
@@ -147,15 +149,15 @@
</widget>
</item>
<item>
- <widget class="QPushButton" name="catInfoLabel">
+ <widget class="QPushButton" name="catPackFolder">
<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>
+ <string>View cat packs folder.</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
- <iconset theme="about">
+ <iconset theme="viewfolder">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="flat">