Add sharing of groups between databases
* Add source folder keeshare for sharing with corresponding define WITH_XC_KEESHARE * Move common crypto parts to src/crypto/ssh * Extended OpenSSHKey * Move filewatching to own file (currently in two related classes DelayedFileWatcher and BulkFileWatcher) * Small improvements for style and code in several classes * Sharing is secured using RSA-Keys which are generated on demand * Publisher signs the container using their private key * Client can verify the signed container and choose to decline an import, import only once or trust the publisher and automatically import all data of this source henceforth * Integration of settings into Group-Settings, Database-Settings and Application-Settings * Introduced dependency QuaZip as dependency to allow combined export of key container and the (custom format) certificate
This commit is contained in:
committed by
Jonathan White
parent
c1e9f45df9
commit
eca9c658f4
@@ -21,11 +21,36 @@
|
||||
#include "DatabaseSettingsWidgetGeneral.h"
|
||||
#include "DatabaseSettingsWidgetEncryption.h"
|
||||
#include "DatabaseSettingsWidgetMasterKey.h"
|
||||
#ifdef WITH_XC_KEESHARE
|
||||
#include "keeshare/DatabaseSettingsPageKeeShare.h"
|
||||
#endif
|
||||
|
||||
#include "core/Global.h"
|
||||
#include "core/Config.h"
|
||||
#include "core/FilePath.h"
|
||||
#include "core/Database.h"
|
||||
|
||||
class DatabaseSettingsDialog::ExtraPage
|
||||
{
|
||||
public:
|
||||
ExtraPage(IDatabaseSettingsPage* page, QWidget* widget)
|
||||
: settingsPage(page)
|
||||
, widget(widget)
|
||||
{
|
||||
}
|
||||
void loadSettings(Database* db) const
|
||||
{
|
||||
settingsPage->loadSettings(widget, db);
|
||||
}
|
||||
void saveSettings() const
|
||||
{
|
||||
settingsPage->saveSettings(widget);
|
||||
}
|
||||
private:
|
||||
QSharedPointer<IDatabaseSettingsPage> settingsPage;
|
||||
QWidget* widget;
|
||||
};
|
||||
|
||||
DatabaseSettingsDialog::DatabaseSettingsDialog(QWidget* parent)
|
||||
: DialogyWidget(parent)
|
||||
, m_ui(new Ui::DatabaseSettingsDialog())
|
||||
@@ -47,6 +72,10 @@ DatabaseSettingsDialog::DatabaseSettingsDialog(QWidget* parent)
|
||||
m_securityTabWidget->addTab(m_masterKeyWidget, tr("Master Key"));
|
||||
m_securityTabWidget->addTab(m_encryptionWidget, tr("Encryption Settings"));
|
||||
|
||||
#ifdef WITH_XC_KEESHARE
|
||||
addSettingsPage(new DatabaseSettingsPageKeeShare());
|
||||
#endif
|
||||
|
||||
m_ui->stackedWidget->setCurrentIndex(0);
|
||||
m_securityTabWidget->setCurrentIndex(0);
|
||||
|
||||
@@ -67,10 +96,24 @@ void DatabaseSettingsDialog::load(Database* db)
|
||||
m_generalWidget->load(db);
|
||||
m_masterKeyWidget->load(db);
|
||||
m_encryptionWidget->load(db);
|
||||
for (const ExtraPage& page : asConst(m_extraPages)) {
|
||||
page.loadSettings(db);
|
||||
}
|
||||
m_ui->advancedSettingsToggle->setChecked(config()->get("GUI/AdvancedSettings", false).toBool());
|
||||
m_db = db;
|
||||
}
|
||||
|
||||
void DatabaseSettingsDialog::addSettingsPage(IDatabaseSettingsPage* page)
|
||||
{
|
||||
const int category = m_ui->categoryList->currentCategory();
|
||||
QWidget* widget = page->createWidget();
|
||||
widget->setParent(this);
|
||||
m_extraPages.append(ExtraPage(page, widget));
|
||||
m_ui->stackedWidget->addWidget(widget);
|
||||
m_ui->categoryList->addCategory(page->name(), page->icon());
|
||||
m_ui->categoryList->setCurrentCategory(category);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show page and tab with database master key settings.
|
||||
*/
|
||||
@@ -94,6 +137,10 @@ void DatabaseSettingsDialog::save()
|
||||
return;
|
||||
}
|
||||
|
||||
for (const ExtraPage& extraPage : asConst(m_extraPages)) {
|
||||
extraPage.saveSettings();
|
||||
}
|
||||
|
||||
#ifdef WITH_XC_TOUCHID
|
||||
TouchID::getInstance().reset(m_db ? m_db->filePath() : "");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user