mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
moved cache and appdata settings up
This commit is contained in:
parent
a50e95d9f8
commit
b2ae2e598f
1 changed files with 38 additions and 38 deletions
|
@ -508,6 +508,44 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
s.attachExtensionToAnyProcess);
|
s.attachExtensionToAnyProcess);
|
||||||
#endif
|
#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 <a href=\"file:///" + newPath +
|
||||||
|
"\"><span style=\"color: white;\">" +
|
||||||
|
shortenString(newPath, 50) + "</span></a>";
|
||||||
|
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");
|
layout.addTitle("Miscellaneous");
|
||||||
|
|
||||||
if (supportsIncognitoLinks())
|
if (supportsIncognitoLinks())
|
||||||
|
@ -629,44 +667,6 @@ void GeneralPage::initLayout(SettingsLayout &layout)
|
||||||
"Ask for confirmation when uploading an image to i.nuuls.com",
|
"Ask for confirmation when uploading an image to i.nuuls.com",
|
||||||
s.askOnImageUpload);
|
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 <a href=\"file:///" + newPath +
|
|
||||||
"\"><span style=\"color: white;\">" +
|
|
||||||
shortenString(newPath, 50) + "</span></a>";
|
|
||||||
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
|
// invisible element for width
|
||||||
auto inv = new BaseWidget(this);
|
auto inv = new BaseWidget(this);
|
||||||
inv->setScaleIndependantWidth(500);
|
inv->setScaleIndependantWidth(500);
|
||||||
|
|
Loading…
Reference in a new issue