moved cache into general page

This commit is contained in:
fourtf
2019-09-03 12:46:22 +02:00
parent 41a49b854e
commit 577e2e0a21
7 changed files with 32 additions and 98 deletions
+23
View File
@@ -413,6 +413,29 @@ void GeneralPage::initLayout(SettingsLayout &layout)
layout.addCheckbox("Load message history on connect",
s.loadTwitchMessageHistoryOnConnect);
layout.addTitle("Cache");
layout.addDescription(
"Files that are used often (such as emotes) are saved to disk to "
"reduce bandwidth usage and tho 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 <a href=\"file:///" + newPath +
"\"><span style=\"color: white;\">" +
shortenString(newPath, 50) + "</span></a>";
cachePathLabel->setText(pathShortened);
cachePathLabel->setToolTip(newPath);
});
layout.addButton("Choose", [this]() {
getSettings()->cachePath = QFileDialog::getExistingDirectory(this);
});
layout.addButton("Reset", []() { getSettings()->cachePath = ""; });
layout.addTitle("AppData");
layout.addDescription("All local files like settings and cache files are "
"store in this directory.");