KeeShare settings fixes

* Moved KeeShare Quiet Success message setting to the KeeShare portion of the application settings
* Removed an assert that caused the application to crash in debugging when a share file could not be found
* Corrected database settings security icon
This commit is contained in:
Jonathan White 2019-06-19 21:24:24 -04:00
parent ef3c2daef1
commit eb9371091a
6 changed files with 18 additions and 20 deletions

View File

@ -100,10 +100,6 @@ ApplicationSettingsWidget::ApplicationSettingsWidget(QWidget* parent)
m_generalUi->checkUpdatesSpacer->changeSize(0, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
#endif
#ifndef WITH_XC_KEESHARE
m_generalUi->quietKeeShareSuccess->setVisible(false);
#endif
#ifndef WITH_XC_NETWORKING
m_secUi->privacy->setVisible(false);
#endif
@ -186,7 +182,6 @@ void ApplicationSettingsWidget::loadSettings()
m_generalUi->systrayDarkIconCheckBox->setChecked(config()->get("GUI/DarkTrayIcon").toBool());
m_generalUi->systrayMinimizeToTrayCheckBox->setChecked(config()->get("GUI/MinimizeToTray").toBool());
m_generalUi->minimizeOnCloseCheckBox->setChecked(config()->get("GUI/MinimizeOnClose").toBool());
m_generalUi->quietKeeShareSuccess->setChecked(config()->get("GUI/QuietKeeShareSuccess").toBool());
m_generalUi->systrayMinimizeOnStartup->setChecked(config()->get("GUI/MinimizeOnStartup").toBool());
m_generalUi->checkForUpdatesOnStartupCheckBox->setChecked(config()->get("GUI/CheckForUpdates").toBool());
m_generalUi->checkForUpdatesIncludeBetasCheckBox->setChecked(
@ -272,7 +267,6 @@ void ApplicationSettingsWidget::saveSettings()
config()->set("GUI/DarkTrayIcon", m_generalUi->systrayDarkIconCheckBox->isChecked());
config()->set("GUI/MinimizeToTray", m_generalUi->systrayMinimizeToTrayCheckBox->isChecked());
config()->set("GUI/MinimizeOnClose", m_generalUi->minimizeOnCloseCheckBox->isChecked());
config()->set("GUI/QuietKeeShareSuccess", m_generalUi->quietKeeShareSuccess->isChecked());
config()->set("GUI/MinimizeOnStartup", m_generalUi->systrayMinimizeOnStartup->isChecked());
config()->set("GUI/CheckForUpdates", m_generalUi->checkForUpdatesOnStartupCheckBox->isChecked());
config()->set("GUI/CheckForUpdatesIncludeBetas", m_generalUi->checkForUpdatesIncludeBetasCheckBox->isChecked());

View File

@ -382,13 +382,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="quietKeeShareSuccess">
<property name="text">
<string>Do not show success notifications for KeeShare, only warnings and errors</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="systrayShowCheckBox">
<property name="text">

View File

@ -77,7 +77,7 @@ DatabaseSettingsDialog::DatabaseSettingsDialog(QWidget* parent)
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
m_ui->categoryList->addCategory(tr("General"), FilePath::instance()->icon("categories", "preferences-other"));
m_ui->categoryList->addCategory(tr("Security"), FilePath::instance()->icon("actions", "security-high"));
m_ui->categoryList->addCategory(tr("Security"), FilePath::instance()->icon("status", "security-high"));
m_ui->stackedWidget->addWidget(m_generalWidget);
m_ui->stackedWidget->addWidget(m_securityTabWidget);

View File

@ -119,6 +119,8 @@ void SettingsWidgetKeeShare::saveSettings()
KeeShare::setOwn(m_own);
KeeShare::setForeign(m_foreign);
KeeShare::setActive(active);
config()->set("KeeShare/QuietSuccess", m_ui->quietSuccessCheckBox->isChecked());
}
void SettingsWidgetKeeShare::setVerificationExporter(const QString& signer)

View File

@ -29,6 +29,13 @@
<string>Active</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QCheckBox" name="enableImportCheckBox">
<property name="text">
<string>Allow import</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="enableExportCheckBox">
<property name="text">
@ -36,10 +43,13 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="enableImportCheckBox">
<item row="2" column="1">
<widget class="QCheckBox" name="quietSuccessCheckBox">
<property name="text">
<string>Allow import</string>
<string>Only show warnings and errors</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>

View File

@ -148,7 +148,7 @@ void ShareObserver::notifyAbout(const QStringList& success, const QStringList& w
{
QStringList messages;
MessageWidget::MessageType type = MessageWidget::Positive;
if (!(success.isEmpty() || config()->get("GUI/QuietKeeShareSuccess").toBool())) {
if (!(success.isEmpty() || config()->get("KeeShare/QuietSuccess", true).toBool())) {
messages += success;
}
if (!warning.isEmpty()) {
@ -219,8 +219,7 @@ ShareObserver::Result ShareObserver::importShare(const QString& path)
const auto changePath = resolvePath(path, m_db);
auto shareGroup = m_shareToGroup.value(changePath);
if (!shareGroup) {
qWarning("Source for %s does not exist", qPrintable(path));
Q_ASSERT(shareGroup);
qWarning("Group for %s does not exist", qPrintable(path));
return {};
}
const auto reference = KeeShare::referenceOf(shareGroup);