Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kamm <mail@ckamm.de>2018-04-10 14:07:20 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2018-06-05 21:07:53 +0300
commit4a81ae75cfbcb1f25b72e1fbcafbb6e89071b584 (patch)
treec9ff81ce2619f0a2bd6fd4f1fe48dd92b52c6746 /src/gui/logbrowser.cpp
parent428cfc5e1c1046708584327dd2d3089f9eccbf8d (diff)
Logging: Add persistent auto-logdir option #6442
Diffstat (limited to 'src/gui/logbrowser.cpp')
-rw-r--r--src/gui/logbrowser.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/logbrowser.cpp b/src/gui/logbrowser.cpp
index a7303b0f0..7abfeb22d 100644
--- a/src/gui/logbrowser.cpp
+++ b/src/gui/logbrowser.cpp
@@ -96,6 +96,20 @@ LogBrowser::LogBrowser(QWidget *parent)
mainLayout->addWidget(btnbox);
+ // button to permanently save logs
+ _permanentLogging = new QCheckBox;
+ _permanentLogging->setText(tr("Permanently save logs"));
+ _permanentLogging->setToolTip(
+ tr("When this option is enabled and no other logging is configured, "
+ "logs will be written to a temporary folder and expire after a few hours. "
+ "This setting persists across client restarts.\n"
+ "\n"
+ "Logs will be written to %1")
+ .arg(Logger::instance()->temporaryFolderLogDirPath()));
+ _permanentLogging->setChecked(ConfigFile().automaticLogDir());
+ btnbox->addButton(_permanentLogging, QDialogButtonBox::ActionRole);
+ connect(_permanentLogging, &QCheckBox::toggled, this, &LogBrowser::togglePermanentLogging);
+
// clear button
_clearBtn = new QPushButton;
_clearBtn->setText(tr("Clear"));
@@ -216,4 +230,18 @@ void LogBrowser::slotClearLog()
_logWidget->clear();
}
+void LogBrowser::togglePermanentLogging(bool enabled)
+{
+ ConfigFile().setAutomaticLogDir(enabled);
+
+ auto logger = Logger::instance();
+ if (enabled) {
+ if (!logger->isLoggingToFile()) {
+ logger->setupTemporaryFolderLogDir();
+ }
+ } else {
+ logger->disableTemporaryFolderLogDir();
+ }
+}
+
} // namespace