diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index d48d09500..cf33a7b82 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -29,6 +29,9 @@ #include "gui/AboutDialog.h" #include "gui/DatabaseWidget.h" +#include "http/Service.h" +#include "http/HttpSettings.h" + const QString MainWindow::BaseWindowTitle = "KeePassX"; MainWindow::MainWindow() @@ -204,6 +207,11 @@ MainWindow::MainWindow() SLOT(openSearch())); updateTrayIcon(); + + // Keepasshttp service + Service *m_service = new Service(m_ui->tabWidget); + if (HttpSettings::isEnabled()) + m_service->start(); } MainWindow::~MainWindow() @@ -305,6 +313,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) } case DatabaseWidget::EditMode: case DatabaseWidget::LockedMode: + case DatabaseWidget::OpenMode: Q_FOREACH (QAction* action, m_ui->menuEntries->actions()) { action->setEnabled(false); } diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index 33789ae7e..d265b2545 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -23,12 +23,15 @@ #include "core/Config.h" #include "core/Translator.h" +#include "http/OptionDialog.h" + SettingsWidget::SettingsWidget(QWidget* parent) : EditWidget(parent) , m_secWidget(new QWidget()) , m_generalWidget(new QWidget()) , m_secUi(new Ui::SettingsWidgetSecurity()) , m_generalUi(new Ui::SettingsWidgetGeneral()) + , m_optionDialogUi(new OptionDialog()) , m_globalAutoTypeKey(static_cast(0)) , m_globalAutoTypeModifiers(Qt::NoModifier) { @@ -38,6 +41,9 @@ SettingsWidget::SettingsWidget(QWidget* parent) m_generalUi->setupUi(m_generalWidget); add(tr("General"), m_generalWidget); add(tr("Security"), m_secWidget); + add(tr("HTTP"), m_optionDialogUi); + //QObject::connect(m_optionDialogUi, SIGNAL(removeSharedEncryptionKeys()), m_service, SLOT(removeSharedEncryptionKeys())); + //QObject::connect(m_optionDialogUi, SIGNAL(removeStoredPermissions()), m_service, SLOT(removeStoredPermissions())); m_generalUi->autoTypeShortcutWidget->setVisible(autoType()->isAvailable()); m_generalUi->autoTypeShortcutLabel->setVisible(autoType()->isAvailable()); @@ -62,6 +68,7 @@ SettingsWidget::~SettingsWidget() void SettingsWidget::loadSettings() { + m_optionDialogUi->loadSettings(); m_generalUi->rememberLastDatabasesCheckBox->setChecked(config()->get("RememberLastDatabases").toBool()); m_generalUi->openPreviousDatabasesOnStartupCheckBox->setChecked( config()->get("OpenPreviousDatabasesOnStartup").toBool()); @@ -107,6 +114,7 @@ void SettingsWidget::loadSettings() void SettingsWidget::saveSettings() { + m_optionDialogUi->saveSettings(); config()->set("RememberLastDatabases", m_generalUi->rememberLastDatabasesCheckBox->isChecked()); config()->set("OpenPreviousDatabasesOnStartup", m_generalUi->openPreviousDatabasesOnStartupCheckBox->isChecked()); diff --git a/src/gui/SettingsWidget.h b/src/gui/SettingsWidget.h index 58983ebb1..0dc96e7df 100644 --- a/src/gui/SettingsWidget.h +++ b/src/gui/SettingsWidget.h @@ -19,6 +19,7 @@ #define KEEPASSX_SETTINGSWIDGET_H #include "gui/EditWidget.h" +#include "http/OptionDialog.h" namespace Ui { class SettingsWidgetGeneral; @@ -55,6 +56,7 @@ private Q_SLOTS: private: QWidget* const m_secWidget; QWidget* const m_generalWidget; + OptionDialog* const m_optionDialogUi; const QScopedPointer m_secUi; const QScopedPointer m_generalUi; Qt::Key m_globalAutoTypeKey;