Add checkbox to general settings to disable the crash reporter

This commit is contained in:
Dominik Schmidt 2014-08-28 16:19:17 +02:00
parent b8e8d975aa
commit 89aec52503
5 changed files with 29 additions and 1 deletions

View file

@ -55,6 +55,7 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
// misc
connect(_ui->monoIconsCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
connect(_ui->crashreporterCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
// OEM themes are not obliged to ship mono icons, so there
// is no point in offering an option
@ -73,6 +74,7 @@ void GeneralSettings::loadMiscSettings()
MirallConfigFile cfgFile;
_ui->monoIconsCheckBox->setChecked(cfgFile.monoIcons());
_ui->desktopNotificationsCheckBox->setChecked(cfgFile.optionalDesktopNotifications());
_ui->crashreporterCheckBox->setChecked(cfgFile.crashReporter());
}
void GeneralSettings::slotUpdateInfo()
@ -96,6 +98,7 @@ void GeneralSettings::saveMiscSettings()
bool isChecked = _ui->monoIconsCheckBox->isChecked();
cfgFile.setMonoIcons(isChecked);
Theme::instance()->setSystrayUseMonoIcons(isChecked);
cfgFile.setCrashReporter(_ui->crashreporterCheckBox->isChecked());
}
void GeneralSettings::slotToggleLaunchOnStartup(bool enable)

View file

@ -41,6 +41,13 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="crashreporterCheckBox">
<property name="text">
<string>Show crash reporter</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View file

@ -29,6 +29,7 @@
#include "updater/updater.h"
#ifdef WITH_CRASHREPORTER
#include "mirallconfigfile.h"
#include <libcrashreporter-handler/Handler.h>
#endif
@ -58,7 +59,8 @@ int main(int argc, char **argv)
#ifdef WITH_CRASHREPORTER
new CrashReporter::Handler( QDir::tempPath(), true, "owncloud_crash_reporter" );
MirallConfigFile cfgFile;
new CrashReporter::Handler( QDir::tempPath(), cfgFile.crashReporter(), "owncloud_crash_reporter" );
#endif
#ifndef Q_OS_WIN

View file

@ -44,6 +44,7 @@ static const char caCertsKeyC[] = "CaCertificates";
static const char remotePollIntervalC[] = "remotePollInterval";
static const char forceSyncIntervalC[] = "forceSyncInterval";
static const char monoIconsC[] = "monoIcons";
static const char crashReporterC[] = "crashReporter";
static const char optionalDesktopNoficationsC[] = "optionalDesktopNotifications";
static const char skipUpdateCheckC[] = "skipUpdateCheck";
static const char geometryC[] = "geometry";
@ -539,4 +540,16 @@ void MirallConfigFile::setMonoIcons(bool useMonoIcons)
settings.setValue(QLatin1String(monoIconsC), useMonoIcons);
}
bool MirallConfigFile::crashReporter() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(crashReporterC), true).toBool();
}
void MirallConfigFile::setCrashReporter(bool enabled)
{
QSettings settings(configFile(), QSettings::IniFormat);
settings.setValue(QLatin1String(crashReporterC), enabled);
}
}

View file

@ -67,6 +67,9 @@ public:
bool monoIcons() const;
void setMonoIcons(bool);
bool crashReporter() const;
void setCrashReporter(bool enabled);
// proxy settings
void setProxyType(int proxyType,
const QString& host = QString(),