From b2ae2e598fe02587433b3513ffeab23abb3eb5aa Mon Sep 17 00:00:00 2001 From: fourtf Date: Thu, 13 Aug 2020 16:59:42 +0200 Subject: [PATCH] moved cache and appdata settings up --- src/widgets/settingspages/GeneralPage.cpp | 76 +++++++++++------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index 41bf5571d..8fa05a307 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -508,6 +508,44 @@ void GeneralPage::initLayout(SettingsLayout &layout) s.attachExtensionToAnyProcess); #endif + layout.addTitle("Cache"); + layout.addDescription( + "Files that are used often (such as emotes) are saved to disk to " + "reduce bandwidth usage and to speed up loading."); + + auto cachePathLabel = layout.addDescription("placeholder :D"); + getSettings()->cachePath.connect([cachePathLabel](const auto &, + auto) mutable { + QString newPath = getPaths()->cacheDirectory(); + + QString pathShortened = "Cache saved at " + + shortenString(newPath, 50) + ""; + cachePathLabel->setText(pathShortened); + cachePathLabel->setToolTip(newPath); + }); + + // Choose and reset buttons + { + auto box = new QHBoxLayout; + + box->addWidget(layout.makeButton("Choose cache path", [this]() { + getSettings()->cachePath = QFileDialog::getExistingDirectory(this); + })); + box->addWidget(layout.makeButton( + "Reset", []() { getSettings()->cachePath = ""; })); + box->addStretch(1); + + layout.addLayout(box); + } + + layout.addTitle("AppData"); + layout.addDescription("All local files like settings and cache files are " + "store in this directory."); + layout.addButton("Open AppData directory", [] { + QDesktopServices::openUrl(getPaths()->rootAppDataDirectory); + }); + layout.addTitle("Miscellaneous"); if (supportsIncognitoLinks()) @@ -629,44 +667,6 @@ void GeneralPage::initLayout(SettingsLayout &layout) "Ask for confirmation when uploading an image to i.nuuls.com", s.askOnImageUpload); - layout.addTitle("Cache"); - layout.addDescription( - "Files that are used often (such as emotes) are saved to disk to " - "reduce bandwidth usage and to speed up loading."); - - auto cachePathLabel = layout.addDescription("placeholder :D"); - getSettings()->cachePath.connect([cachePathLabel](const auto &, - auto) mutable { - QString newPath = getPaths()->cacheDirectory(); - - QString pathShortened = "Cache saved at " + - shortenString(newPath, 50) + ""; - cachePathLabel->setText(pathShortened); - cachePathLabel->setToolTip(newPath); - }); - - // Choose and reset buttons - { - auto box = new QHBoxLayout; - - box->addWidget(layout.makeButton("Choose cache path", [this]() { - getSettings()->cachePath = QFileDialog::getExistingDirectory(this); - })); - box->addWidget(layout.makeButton( - "Reset", []() { getSettings()->cachePath = ""; })); - box->addStretch(1); - - layout.addLayout(box); - } - - layout.addTitle("AppData"); - layout.addDescription("All local files like settings and cache files are " - "store in this directory."); - layout.addButton("Open AppData directory", [] { - QDesktopServices::openUrl(getPaths()->rootAppDataDirectory); - }); - // invisible element for width auto inv = new BaseWidget(this); inv->setScaleIndependantWidth(500);