diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 321f944b..879af535 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -516,6 +516,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_settings->registerSetting("InstanceDir", "instances");
m_settings->registerSetting({"CentralModsDir", "ModsDir"}, "mods");
m_settings->registerSetting("IconsDir", "icons");
+ m_settings->registerSetting("DownloadsDir", QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
// Editors
m_settings->registerSetting("JsonEditor", QString());
diff --git a/launcher/ui/dialogs/BlockedModsDialog.cpp b/launcher/ui/dialogs/BlockedModsDialog.cpp
index eb427953..ff885f10 100644
--- a/launcher/ui/dialogs/BlockedModsDialog.cpp
+++ b/launcher/ui/dialogs/BlockedModsDialog.cpp
@@ -184,7 +184,7 @@ void BlockedModsDialog::directoryChanged(QString path)
/// @brief add the user downloads folder and the global mods folder to the filesystem watcher
void BlockedModsDialog::setupWatch()
{
- const QString downloadsFolder = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
+ const QString downloadsFolder = APPLICATION->settings()->get("DownloadsDir").toString();
const QString modsFolder = APPLICATION->settings()->get("CentralModsDir").toString();
m_watcher.addPath(downloadsFolder);
m_watcher.addPath(modsFolder);
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index a9f44c0b..324eb461 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -140,8 +140,8 @@ void LauncherPage::on_instDirBrowseBtn_clicked()
if (result == QMessageBox::Ok)
{
ui->instDirTextBox->setText(cooked_dir);
- }
- }
+ }
+ }
else
{
ui->instDirTextBox->setText(cooked_dir);
@@ -160,6 +160,7 @@ void LauncherPage::on_iconsDirBrowseBtn_clicked()
ui->iconsDirTextBox->setText(cooked_dir);
}
}
+
void LauncherPage::on_modsDirBrowseBtn_clicked()
{
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Mods Folder"), ui->modsDirTextBox->text());
@@ -172,6 +173,17 @@ void LauncherPage::on_modsDirBrowseBtn_clicked()
}
}
+void LauncherPage::on_downloadsDirBrowseBtn_clicked()
+{
+ QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Downloads Folder"), ui->downloadsDirTextBox->text());
+
+ if (!raw_dir.isEmpty() && QDir(raw_dir).exists())
+ {
+ QString cooked_dir = FS::NormalizePath(raw_dir);
+ ui->downloadsDirTextBox->setText(cooked_dir);
+ }
+}
+
void LauncherPage::on_metadataDisableBtn_clicked()
{
ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
@@ -204,6 +216,7 @@ void LauncherPage::applySettings()
s->set("InstanceDir", ui->instDirTextBox->text());
s->set("CentralModsDir", ui->modsDirTextBox->text());
s->set("IconsDir", ui->iconsDirTextBox->text());
+ s->set("DownloadsDir", ui->downloadsDirTextBox->text());
auto sortMode = (InstSortMode)ui->sortingModeGroup->checkedId();
switch (sortMode)
@@ -260,6 +273,7 @@ void LauncherPage::loadSettings()
ui->instDirTextBox->setText(s->get("InstanceDir").toString());
ui->modsDirTextBox->setText(s->get("CentralModsDir").toString());
ui->iconsDirTextBox->setText(s->get("IconsDir").toString());
+ ui->downloadsDirTextBox->setText(s->get("DownloadsDir").toString());
QString sortMode = s->get("InstSortMode").toString();
diff --git a/launcher/ui/pages/global/LauncherPage.h b/launcher/ui/pages/global/LauncherPage.h
index c60156c2..33f66f1b 100644
--- a/launcher/ui/pages/global/LauncherPage.h
+++ b/launcher/ui/pages/global/LauncherPage.h
@@ -88,6 +88,7 @@ slots:
void on_instDirBrowseBtn_clicked();
void on_modsDirBrowseBtn_clicked();
void on_iconsDirBrowseBtn_clicked();
+ void on_downloadsDirBrowseBtn_clicked();
void on_metadataDisableBtn_clicked();
/*!
diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui
index f084d970..923b7f95 100644
--- a/launcher/ui/pages/global/LauncherPage.ui
+++ b/launcher/ui/pages/global/LauncherPage.ui
@@ -38,7 +38,7 @@
QTabWidget::Rounded
- 1
+ 0
@@ -67,13 +67,6 @@
Folders
- -
-
-
- ...
-
-
-
-
@@ -81,29 +74,12 @@
- -
-
-
- ...
-
-
+
-
+
-
- -
-
-
- &Icons:
-
-
- iconsDirTextBox
-
-
-
- -
-
-
-
@@ -117,6 +93,20 @@
-
+ -
+
+
+ ...
+
+
+
+ -
+
+
+ ...
+
+
+
-
@@ -127,6 +117,36 @@
+ -
+
+
+ &Icons:
+
+
+ iconsDirTextBox
+
+
+
+ -
+
+
+ &Downloads:
+
+
+ downloadsDirTextBox
+
+
+
+ -
+
+
+ -
+
+
+ ...
+
+
+