From e7e56eb1e397a528df91f9ce99f738c49bde363c Mon Sep 17 00:00:00 2001 From: Marcelo Hernandez Date: Sat, 22 Oct 2022 14:50:32 -0400 Subject: add more options to copy instance dialog - Copy game options, copy resource packs, copy shaders, copy servers, and copy mods - Also made a new InstanceCopyPrefs struct to store those options rather than passing 7 different booleans into InstanceCopyTask's constructor Signed-off-by: Marcelo Hernandez --- launcher/ui/MainWindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'launcher/ui/MainWindow.cpp') diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 97152a48..d51f799c 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1616,7 +1616,17 @@ void MainWindow::on_actionCopyInstance_triggered() if (!copyInstDlg.exec()) return; - auto copyTask = new InstanceCopyTask(m_selectedInstance, copyInstDlg.shouldCopySaves(), copyInstDlg.shouldKeepPlaytime()); + auto copyTask = new InstanceCopyTask( + m_selectedInstance, + InstanceCopyPrefs { + copyInstDlg.shouldCopySaves(), + copyInstDlg.shouldKeepPlaytime(), + copyInstDlg.shouldCopyGameOptions(), + copyInstDlg.shouldCopyResourcePacks(), + copyInstDlg.shouldCopyShaderPacks(), + copyInstDlg.shouldCopyServers(), + copyInstDlg.shouldCopyMods() + }); copyTask->setName(copyInstDlg.instName()); copyTask->setGroup(copyInstDlg.instGroup()); copyTask->setIcon(copyInstDlg.iconKey()); -- cgit From 15593b5c0912b4fe5ad77d6a27e336e9b68ed861 Mon Sep 17 00:00:00 2001 From: Marcelo Hernandez Date: Sat, 22 Oct 2022 23:04:36 -0400 Subject: Add "Select all" checkbox + ui revamp + code cleanup Signed-off-by: Marcelo Hernandez --- launcher/CMakeLists.txt | 1 + launcher/InstanceCopyPrefs.cpp | 15 ++++ launcher/InstanceCopyPrefs.h | 3 + launcher/InstanceCopyTask.cpp | 4 +- launcher/InstanceCopyTask.h | 2 +- launcher/ui/MainWindow.cpp | 12 +-- launcher/ui/dialogs/CopyInstanceDialog.cpp | 96 ++++++++++---------- launcher/ui/dialogs/CopyInstanceDialog.h | 22 ++--- launcher/ui/dialogs/CopyInstanceDialog.ui | 136 ++++++++++++++++------------- 9 files changed, 150 insertions(+), 141 deletions(-) create mode 100644 launcher/InstanceCopyPrefs.cpp (limited to 'launcher/ui/MainWindow.cpp') diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 77440cca..7dc060fb 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -32,6 +32,7 @@ set(CORE_SOURCES InstanceCreationTask.h InstanceCreationTask.cpp InstanceCopyPrefs.h + InstanceCopyPrefs.cpp InstanceCopyTask.h InstanceCopyTask.cpp InstanceImportTask.h diff --git a/launcher/InstanceCopyPrefs.cpp b/launcher/InstanceCopyPrefs.cpp new file mode 100644 index 00000000..56b43a03 --- /dev/null +++ b/launcher/InstanceCopyPrefs.cpp @@ -0,0 +1,15 @@ +// +// Created by marcelohdez on 10/22/22. +// + +#include "InstanceCopyPrefs.h" + +InstanceCopyPrefs::InstanceCopyPrefs(bool setAll) + : copySaves(setAll), + keepPlaytime(setAll), + copyGameOptions(setAll), + copyResourcePacks(setAll), + copyShaderPacks(setAll), + copyServers(setAll), + copyMods(setAll) +{} diff --git a/launcher/InstanceCopyPrefs.h b/launcher/InstanceCopyPrefs.h index ac2feab8..d360a8a7 100644 --- a/launcher/InstanceCopyPrefs.h +++ b/launcher/InstanceCopyPrefs.h @@ -6,6 +6,9 @@ #define LAUNCHER_INSTANCECOPYPREFS_H struct InstanceCopyPrefs { + explicit InstanceCopyPrefs(bool setAll); + ~InstanceCopyPrefs() = default; + bool copySaves; bool keepPlaytime; bool copyGameOptions; diff --git a/launcher/InstanceCopyTask.cpp b/launcher/InstanceCopyTask.cpp index 360f6cfa..e0f68224 100644 --- a/launcher/InstanceCopyTask.cpp +++ b/launcher/InstanceCopyTask.cpp @@ -5,7 +5,7 @@ #include "pathmatcher/RegexpMatcher.h" #include -InstanceCopyTask::InstanceCopyTask(InstancePtr origInstance, InstanceCopyPrefs prefs) +InstanceCopyTask::InstanceCopyTask(InstancePtr origInstance, const InstanceCopyPrefs& prefs) { m_origInstance = origInstance; m_keepPlaytime = prefs.keepPlaytime; @@ -51,7 +51,7 @@ InstanceCopyTask::InstanceCopyTask(InstancePtr origInstance, InstanceCopyPrefs p } } -void InstanceCopyTask::appendToFilter(QString& filter, const QString &append) +void InstanceCopyTask::appendToFilter(QString& filter, const QString& append) { if (!filter.isEmpty()) filter.append('|'); // OR regex diff --git a/launcher/InstanceCopyTask.h b/launcher/InstanceCopyTask.h index d66bec55..4abbf6e6 100644 --- a/launcher/InstanceCopyTask.h +++ b/launcher/InstanceCopyTask.h @@ -15,7 +15,7 @@ class InstanceCopyTask : public InstanceTask { Q_OBJECT public: - explicit InstanceCopyTask(InstancePtr origInstance, InstanceCopyPrefs prefs); + explicit InstanceCopyTask(InstancePtr origInstance, const InstanceCopyPrefs& prefs); protected: //! Entry point for tasks. diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index d51f799c..08005b86 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1616,17 +1616,7 @@ void MainWindow::on_actionCopyInstance_triggered() if (!copyInstDlg.exec()) return; - auto copyTask = new InstanceCopyTask( - m_selectedInstance, - InstanceCopyPrefs { - copyInstDlg.shouldCopySaves(), - copyInstDlg.shouldKeepPlaytime(), - copyInstDlg.shouldCopyGameOptions(), - copyInstDlg.shouldCopyResourcePacks(), - copyInstDlg.shouldCopyShaderPacks(), - copyInstDlg.shouldCopyServers(), - copyInstDlg.shouldCopyMods() - }); + auto copyTask = new InstanceCopyTask(m_selectedInstance, copyInstDlg.getChosenOptions()); copyTask->setName(copyInstDlg.instName()); copyTask->setGroup(copyInstDlg.instGroup()); copyTask->setIcon(copyInstDlg.iconKey()); diff --git a/launcher/ui/dialogs/CopyInstanceDialog.cpp b/launcher/ui/dialogs/CopyInstanceDialog.cpp index d19888ed..0a23cd34 100644 --- a/launcher/ui/dialogs/CopyInstanceDialog.cpp +++ b/launcher/ui/dialogs/CopyInstanceDialog.cpp @@ -78,13 +78,13 @@ CopyInstanceDialog::CopyInstanceDialog(InstancePtr original, QWidget *parent) } ui->groupBox->setCurrentIndex(index); ui->groupBox->lineEdit()->setPlaceholderText(tr("No group")); - ui->copySavesCheckbox->setChecked(m_copySaves); - ui->keepPlaytimeCheckbox->setChecked(m_keepPlaytime); - ui->copyGameOptionsCheckbox->setChecked(m_copyGameOptions); - ui->copyResPacksCheckbox->setChecked(m_copyResourcePacks); - ui->copyShaderPacksCheckbox->setChecked(m_copyShaderPacks); - ui->copyServersCheckbox->setChecked(m_copyServers); - ui->copyModsCheckbox->setChecked(m_copyMods); + ui->copySavesCheckbox->setChecked(m_selectedOptions.copySaves); + ui->keepPlaytimeCheckbox->setChecked(m_selectedOptions.keepPlaytime); + ui->copyGameOptionsCheckbox->setChecked(m_selectedOptions.copyGameOptions); + ui->copyResPacksCheckbox->setChecked(m_selectedOptions.copyResourcePacks); + ui->copyShaderPacksCheckbox->setChecked(m_selectedOptions.copyShaderPacks); + ui->copyServersCheckbox->setChecked(m_selectedOptions.copyServers); + ui->copyModsCheckbox->setChecked(m_selectedOptions.copyMods); } CopyInstanceDialog::~CopyInstanceDialog() @@ -139,122 +139,118 @@ void CopyInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1) updateDialogState(); } -bool CopyInstanceDialog::shouldCopySaves() const +const InstanceCopyPrefs& CopyInstanceDialog::getChosenOptions() const { - return m_copySaves; + return m_selectedOptions; } -void CopyInstanceDialog::on_copySavesCheckbox_stateChanged(int state) +void CopyInstanceDialog::on_selectAllCheckbox_stateChanged(int state) { + bool checked; if(state == Qt::Unchecked) { - m_copySaves = false; + checked = false; } else if(state == Qt::Checked) { - m_copySaves = true; + checked = true; } + + checkAllCheckboxes(checked); } -bool CopyInstanceDialog::shouldKeepPlaytime() const +void CopyInstanceDialog::checkAllCheckboxes(bool b) { - return m_keepPlaytime; + ui->keepPlaytimeCheckbox->setChecked(b); + ui->copySavesCheckbox->setChecked(b); + ui->copyGameOptionsCheckbox->setChecked(b); + ui->copyResPacksCheckbox->setChecked(b); + ui->copyShaderPacksCheckbox->setChecked(b); + ui->copyServersCheckbox->setChecked(b); + ui->copyModsCheckbox->setChecked(b); } - -void CopyInstanceDialog::on_keepPlaytimeCheckbox_stateChanged(int state) +void CopyInstanceDialog::on_copySavesCheckbox_stateChanged(int state) { if(state == Qt::Unchecked) { - m_keepPlaytime = false; + m_selectedOptions.copySaves = false; } else if(state == Qt::Checked) { - m_keepPlaytime = true; + m_selectedOptions.copySaves = true; } } -bool CopyInstanceDialog::shouldCopyGameOptions() const -{ - return m_copyGameOptions; -} -void CopyInstanceDialog::on_copyGameOptionsCheckbox_stateChanged(int state) +void CopyInstanceDialog::on_keepPlaytimeCheckbox_stateChanged(int state) { if(state == Qt::Unchecked) { - m_copyGameOptions = false; + m_selectedOptions.keepPlaytime = false; } else if(state == Qt::Checked) { - m_copyGameOptions = true; + m_selectedOptions.keepPlaytime = true; } } -bool CopyInstanceDialog::shouldCopyResourcePacks() const +void CopyInstanceDialog::on_copyGameOptionsCheckbox_stateChanged(int state) { - return m_copyResourcePacks; + if(state == Qt::Unchecked) + { + m_selectedOptions.copyGameOptions = false; + } + else if(state == Qt::Checked) + { + m_selectedOptions.copyGameOptions = true; + } } void CopyInstanceDialog::on_copyResPacksCheckbox_stateChanged(int state) { if(state == Qt::Unchecked) { - m_copyResourcePacks = false; + m_selectedOptions.copyResourcePacks = false; } else if(state == Qt::Checked) { - m_copyResourcePacks = true; + m_selectedOptions.copyResourcePacks = true; } } -bool CopyInstanceDialog::shouldCopyShaderPacks() const -{ - return m_copyShaderPacks; -} - void CopyInstanceDialog::on_copyShaderPacksCheckbox_stateChanged(int state) { if(state == Qt::Unchecked) { - m_copyShaderPacks = false; + m_selectedOptions.copyShaderPacks = false; } else if(state == Qt::Checked) { - m_copyShaderPacks = true; + m_selectedOptions.copyShaderPacks = true; } } -bool CopyInstanceDialog::shouldCopyServers() const -{ - return m_copyServers; -} - void CopyInstanceDialog::on_copyServersCheckbox_stateChanged(int state) { if(state == Qt::Unchecked) { - m_copyServers = false; + m_selectedOptions.copyServers = false; } else if(state == Qt::Checked) { - m_copyServers = true; + m_selectedOptions.copyServers = true; } } -bool CopyInstanceDialog::shouldCopyMods() const -{ - return m_copyMods; -} - void CopyInstanceDialog::on_copyModsCheckbox_stateChanged(int state) { if(state == Qt::Unchecked) { - m_copyMods = false; + m_selectedOptions.copyMods = false; } else if(state == Qt::Checked) { - m_copyMods = true; + m_selectedOptions.copyMods = true; } } diff --git a/launcher/ui/dialogs/CopyInstanceDialog.h b/launcher/ui/dialogs/CopyInstanceDialog.h index e4c70494..e57de0a1 100644 --- a/launcher/ui/dialogs/CopyInstanceDialog.h +++ b/launcher/ui/dialogs/CopyInstanceDialog.h @@ -17,7 +17,7 @@ #include #include "BaseVersion.h" -#include +#include "InstanceCopyPrefs.h" class BaseInstance; @@ -39,18 +39,16 @@ public: QString instName() const; QString instGroup() const; QString iconKey() const; - bool shouldCopySaves() const; - bool shouldKeepPlaytime() const; - bool shouldCopyGameOptions() const; - bool shouldCopyResourcePacks() const; - bool shouldCopyShaderPacks() const; - bool shouldCopyServers() const; - bool shouldCopyMods() const; + const InstanceCopyPrefs& getChosenOptions() const; private slots: void on_iconButton_clicked(); void on_instNameTextBox_textChanged(const QString &arg1); + + // Checkbox options: + void checkAllCheckboxes(bool b); + void on_selectAllCheckbox_stateChanged(int state); void on_copySavesCheckbox_stateChanged(int state); void on_keepPlaytimeCheckbox_stateChanged(int state); void on_copyGameOptionsCheckbox_stateChanged(int state); @@ -63,11 +61,5 @@ private: Ui::CopyInstanceDialog *ui; QString InstIconKey; InstancePtr m_original; - bool m_copySaves = true; - bool m_keepPlaytime = true; - bool m_copyGameOptions = true; - bool m_copyResourcePacks = true; - bool m_copyShaderPacks = true; - bool m_copyServers = true; - bool m_copyMods = true; + InstanceCopyPrefs m_selectedOptions = InstanceCopyPrefs(true); // Default to all options as true }; diff --git a/launcher/ui/dialogs/CopyInstanceDialog.ui b/launcher/ui/dialogs/CopyInstanceDialog.ui index e89439e6..822ed797 100644 --- a/launcher/ui/dialogs/CopyInstanceDialog.ui +++ b/launcher/ui/dialogs/CopyInstanceDialog.ui @@ -9,8 +9,8 @@ 0 0 - 265 - 425 + 341 + 385 @@ -60,7 +60,7 @@ - 40 + 60 20 @@ -83,7 +83,10 @@ - + + + 6 + @@ -110,62 +113,73 @@ - - - Copy saves - - - - - - - Keep play time - - - - - - - Copy the in-game options like FOV, max framerate, etc. - - - Copy game options - - - - - - - true - - - Copy resource packs - - - - - - - Copy shader packs - - - - - - - Copy servers - - - - - - - Disabling this will still keep the mod loader (ex: Fabric, Quilt, etc.) but erase the mods folder and their configs. - - - Copy mods - - + + + + + Copy saves + + + + + + + true + + + Copy resource packs + + + + + + + Disabling this will still keep the mod loader (ex: Fabric, Quilt, etc.) but erase the mods folder and their configs. + + + Copy mods + + + + + + + Copy the in-game options like FOV, max framerate, etc. + + + Copy game options + + + + + + + Copy servers + + + + + + + Keep play time + + + + + + + Copy shader packs + + + + + + + Select all + + + + @@ -183,8 +197,6 @@ iconButton instNameTextBox groupBox - copySavesCheckbox - keepPlaytimeCheckbox -- cgit From 3d11d044d2849c098187de4e973a8787538f4496 Mon Sep 17 00:00:00 2001 From: leo78913 Date: Tue, 25 Oct 2022 19:22:11 -0300 Subject: add an option to lock the toolbars Signed-off-by: leo78913 --- launcher/Application.cpp | 2 ++ launcher/ui/MainWindow.cpp | 32 +++++++++++++++++++++++++++++--- launcher/ui/MainWindow.h | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) (limited to 'launcher/ui/MainWindow.cpp') diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 5772d7ca..9013577c 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -614,6 +614,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) // The cat m_settings->registerSetting("TheCat", false); + m_settings->registerSetting("ToolbarsLocked", false); + m_settings->registerSetting("InstSortMode", "Name"); m_settings->registerSetting("SelectedInstance", QString()); diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 28eaa741..ef056fcb 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -262,6 +262,8 @@ public: TranslatedAction actionNoAccountsAdded; TranslatedAction actionNoDefaultAccount; + TranslatedAction actionLockToolbars; + QVector all_toolbuttons; QWidget *centralWidget = nullptr; @@ -420,6 +422,12 @@ public: actionManageAccounts->setCheckable(false); actionManageAccounts->setIcon(APPLICATION->getThemedIcon("accounts")); all_actions.append(&actionManageAccounts); + + actionLockToolbars = TranslatedAction(MainWindow); + actionLockToolbars->setObjectName(QStringLiteral("actionLockToolbars")); + actionLockToolbars.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Lock Toolbars")); + actionLockToolbars->setCheckable(true); + all_actions.append(&actionLockToolbars); } void createMainToolbar(QMainWindow *MainWindow) @@ -427,7 +435,6 @@ public: mainToolBar = TranslatedToolbar(MainWindow); mainToolBar->setVisible(menuBar->isNativeMenuBar() || !APPLICATION->settings()->get("MenuBarInsteadOfToolBar").toBool()); mainToolBar->setObjectName(QStringLiteral("mainToolBar")); - mainToolBar->setMovable(true); mainToolBar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea); mainToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); mainToolBar->setFloatable(false); @@ -524,6 +531,8 @@ public: viewMenu->addAction(actionCAT); viewMenu->addSeparator(); + viewMenu->addAction(actionLockToolbars); + menuBar->addMenu(foldersMenu); profileMenu = menuBar->addMenu(tr("&Accounts")); @@ -601,7 +610,6 @@ public: { newsToolBar = TranslatedToolbar(MainWindow); newsToolBar->setObjectName(QStringLiteral("newsToolBar")); - newsToolBar->setMovable(true); newsToolBar->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea); newsToolBar->setIconSize(QSize(16, 16)); newsToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -736,7 +744,6 @@ public: instanceToolBar->setObjectName(QStringLiteral("instanceToolBar")); // disabled until we have an instance selected instanceToolBar->setEnabled(false); - instanceToolBar->setMovable(true); // Qt doesn't like vertical moving toolbars, so we have to force them... // See https://github.com/PolyMC/PolyMC/issues/493 connect(instanceToolBar, &QToolBar::orientationChanged, [=](Qt::Orientation){ instanceToolBar->setOrientation(Qt::Vertical); }); @@ -918,6 +925,14 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow connect(ui->actionCAT.operator->(), SIGNAL(toggled(bool)), SLOT(onCatToggled(bool))); setCatBackground(cat_enable); } + + // Lock toolbars + { + bool toolbarsLocked = APPLICATION->settings()->get("ToolbarsLocked").toBool(); + ui->actionLockToolbars->setChecked(toolbarsLocked); + connect(ui->actionLockToolbars.operator->(), SIGNAL(toggled(bool)), SLOT(lockToolbars(bool))); + lockToolbars(toolbarsLocked); + } // start instance when double-clicked connect(view, &InstanceView::activated, this, &MainWindow::instanceActivated); @@ -1073,8 +1088,19 @@ QMenu * MainWindow::createPopupMenu() { QMenu* filteredMenu = QMainWindow::createPopupMenu(); filteredMenu->removeAction( ui->mainToolBar->toggleViewAction() ); + + filteredMenu->addAction(ui->actionLockToolbars); + return filteredMenu; } +void MainWindow::lockToolbars(bool state) +{ + ui->mainToolBar->setMovable(!state); + ui->instanceToolBar->setMovable(!state); + ui->newsToolBar->setMovable(!state); + APPLICATION->settings()->set("ToolbarsLocked", state); +} + void MainWindow::konamiTriggered() { diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h index cb8cb4aa..f9d1f1c7 100644 --- a/launcher/ui/MainWindow.h +++ b/launcher/ui/MainWindow.h @@ -203,6 +203,8 @@ private slots: void globalSettingsClosed(); + void lockToolbars(bool); + #ifndef Q_OS_MAC void keyReleaseEvent(QKeyEvent *event) override; #endif -- cgit From 0938f80b4148cfc1734636e15da5ddb8b9a7bdfb Mon Sep 17 00:00:00 2001 From: leo78913 Date: Sat, 5 Nov 2022 18:10:36 -0300 Subject: Update launcher/ui/MainWindow.cpp Co-authored-by: flow Signed-off-by: leo78913 --- launcher/ui/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'launcher/ui/MainWindow.cpp') diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index ef056fcb..7bbc1bde 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -930,7 +930,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow { bool toolbarsLocked = APPLICATION->settings()->get("ToolbarsLocked").toBool(); ui->actionLockToolbars->setChecked(toolbarsLocked); - connect(ui->actionLockToolbars.operator->(), SIGNAL(toggled(bool)), SLOT(lockToolbars(bool))); + connect(ui->actionLockToolbars, &QAction::toggled, this, &MainWindow::lockToolbars); lockToolbars(toolbarsLocked); } // start instance when double-clicked -- cgit From a0580946dcac871b74e670e354921842bcf07aa6 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 6 Nov 2022 00:04:43 +0100 Subject: fix: allow -ween variants for all cats Signed-off-by: Sefa Eyeoglu --- launcher/ui/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'launcher/ui/MainWindow.cpp') diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index afbc505e..8cf2bde7 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1564,7 +1564,7 @@ void MainWindow::setCatBackground(bool enabled) QString cat = APPLICATION->settings()->get("BackgroundCat").toString(); if (non_stupid_abs(now.daysTo(xmas)) <= 4) { cat += "-xmas"; - } else if (cat == "kitteh" && non_stupid_abs(now.daysTo(halloween)) <= 4) { + } else if (non_stupid_abs(now.daysTo(halloween)) <= 4) { cat += "-ween"; } else if (non_stupid_abs(now.daysTo(birthday)) <= 12) { cat += "-bday"; -- cgit From 4708ce4226e7b23046b8a099dd033192e68f8fd5 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 6 Nov 2022 00:47:33 +0100 Subject: refactor: rename halloween cats to -spooky Signed-off-by: Sefa Eyeoglu --- launcher/resources/backgrounds/backgrounds.qrc | 2 +- launcher/resources/backgrounds/kitteh-spooky.png | Bin 0 -> 94677 bytes launcher/resources/backgrounds/kitteh-ween.png | Bin 94677 -> 0 bytes launcher/ui/MainWindow.cpp | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 launcher/resources/backgrounds/kitteh-spooky.png delete mode 100644 launcher/resources/backgrounds/kitteh-ween.png (limited to 'launcher/ui/MainWindow.cpp') diff --git a/launcher/resources/backgrounds/backgrounds.qrc b/launcher/resources/backgrounds/backgrounds.qrc index edfa44c0..e55faf15 100644 --- a/launcher/resources/backgrounds/backgrounds.qrc +++ b/launcher/resources/backgrounds/backgrounds.qrc @@ -4,7 +4,7 @@ kitteh.png kitteh-xmas.png kitteh-bday.png - kitteh-ween.png + kitteh-spooky.png rory.png rory-xmas.png rory-bday.png diff --git a/launcher/resources/backgrounds/kitteh-spooky.png b/launcher/resources/backgrounds/kitteh-spooky.png new file mode 100644 index 00000000..deb0bebb Binary files /dev/null and b/launcher/resources/backgrounds/kitteh-spooky.png differ diff --git a/launcher/resources/backgrounds/kitteh-ween.png b/launcher/resources/backgrounds/kitteh-ween.png deleted file mode 100644 index deb0bebb..00000000 Binary files a/launcher/resources/backgrounds/kitteh-ween.png and /dev/null differ diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 8cf2bde7..f6b9888f 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1565,7 +1565,7 @@ void MainWindow::setCatBackground(bool enabled) if (non_stupid_abs(now.daysTo(xmas)) <= 4) { cat += "-xmas"; } else if (non_stupid_abs(now.daysTo(halloween)) <= 4) { - cat += "-ween"; + cat += "-spooky"; } else if (non_stupid_abs(now.daysTo(birthday)) <= 12) { cat += "-bday"; } -- cgit From d5d224d89a6d1fccacbf8ffe8d0981cec32e89fb Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 6 Nov 2022 01:05:10 +0100 Subject: fix: save metacache after clearing If the user closes the launcher right after clearing, it probably didn't actually clear the cache yet. Signed-off-by: Sefa Eyeoglu --- launcher/ui/MainWindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'launcher/ui/MainWindow.cpp') diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 28eaa741..bbaf2827 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1899,6 +1899,7 @@ void MainWindow::on_actionReportBug_triggered() void MainWindow::on_actionClearMetadata_triggered() { APPLICATION->metacache()->evictAll(); + APPLICATION->metacache()->SaveNow(); } void MainWindow::on_actionOpenWiki_triggered() -- cgit