diff --git a/src/http/HttpPasswordGeneratorWidget.cpp b/src/http/HttpPasswordGeneratorWidget.cpp index 30e4f71e7..031ff30ad 100644 --- a/src/http/HttpPasswordGeneratorWidget.cpp +++ b/src/http/HttpPasswordGeneratorWidget.cpp @@ -32,13 +32,10 @@ HttpPasswordGeneratorWidget::HttpPasswordGeneratorWidget(QWidget* parent) { m_ui->setupUi(this); - connect(m_ui->buttonApply, SIGNAL(clicked()), SLOT(saveSettings())); - connect(m_ui->sliderLength, SIGNAL(valueChanged(int)), SLOT(sliderMoved())); connect(m_ui->spinBoxLength, SIGNAL(valueChanged(int)), SLOT(spinBoxChanged())); connect(m_ui->optionButtons, SIGNAL(buttonClicked(int)), SLOT(updateGenerator())); - m_ui->buttonApply->setEnabled(true); loadSettings(); reset(); diff --git a/src/http/HttpPasswordGeneratorWidget.h b/src/http/HttpPasswordGeneratorWidget.h index 2b2ace39b..f8e35c232 100644 --- a/src/http/HttpPasswordGeneratorWidget.h +++ b/src/http/HttpPasswordGeneratorWidget.h @@ -35,10 +35,10 @@ public: explicit HttpPasswordGeneratorWidget(QWidget* parent = nullptr); ~HttpPasswordGeneratorWidget(); void loadSettings(); + void saveSettings(); void reset(); private Q_SLOTS: - void saveSettings(); void sliderMoved(); void spinBoxChanged(); diff --git a/src/http/HttpPasswordGeneratorWidget.ui b/src/http/HttpPasswordGeneratorWidget.ui index 29399bcd6..066b9c512 100644 --- a/src/http/HttpPasswordGeneratorWidget.ui +++ b/src/http/HttpPasswordGeneratorWidget.ui @@ -6,14 +6,26 @@ 0 0 - 434 - 250 + 500 + 181 + + 0 + + + 0 + + + 0 + + + 0 + @@ -168,42 +180,8 @@ - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - Accept - - - - - - - - PasswordComboBox - QComboBox -
gui/PasswordComboBox.h
-
-
sliderLength spinBoxLength @@ -213,7 +191,6 @@ checkBoxSpecialChars checkBoxExcludeAlike checkBoxEnsureEvery - buttonApply diff --git a/src/http/OptionDialog.cpp b/src/http/OptionDialog.cpp index 5245d333b..a82e2c77e 100644 --- a/src/http/OptionDialog.cpp +++ b/src/http/OptionDialog.cpp @@ -15,15 +15,21 @@ #include "ui_OptionDialog.h" #include "HttpSettings.h" +#include "core/FilePath.h" + #include OptionDialog::OptionDialog(QWidget *parent) : QWidget(parent), - ui(new Ui::OptionDialog()) + m_ui(new Ui::OptionDialog()) { - ui->setupUi(this); - connect(ui->removeSharedEncryptionKeys, SIGNAL(clicked()), this, SIGNAL(removeSharedEncryptionKeys())); - connect(ui->removeStoredPermissions, SIGNAL(clicked()), this, SIGNAL(removeStoredPermissions())); + m_ui->setupUi(this); + connect(m_ui->removeSharedEncryptionKeys, SIGNAL(clicked()), this, SIGNAL(removeSharedEncryptionKeys())); + connect(m_ui->removeStoredPermissions, SIGNAL(clicked()), this, SIGNAL(removeStoredPermissions())); + + m_ui->warningWidget->showMessage(tr("The following options can be dangerous!\nChange them only if you know what you are doing."), MessageWidget::Warning); + m_ui->warningWidget->setIcon(FilePath::instance()->icon("status", "dialog-warning")); + m_ui->warningWidget->setCloseButtonVisible(false); } OptionDialog::~OptionDialog() @@ -33,65 +39,48 @@ OptionDialog::~OptionDialog() void OptionDialog::loadSettings() { HttpSettings settings; - ui->enableHttpServer->setChecked(settings.isEnabled()); + m_ui->enableHttpServer->setChecked(settings.isEnabled()); - ui->showNotification->setChecked(settings.showNotification()); - ui->bestMatchOnly->setChecked(settings.bestMatchOnly()); - ui->unlockDatabase->setChecked(settings.unlockDatabase()); - ui->matchUrlScheme->setChecked(settings.matchUrlScheme()); + m_ui->showNotification->setChecked(settings.showNotification()); + m_ui->bestMatchOnly->setChecked(settings.bestMatchOnly()); + m_ui->unlockDatabase->setChecked(settings.unlockDatabase()); + m_ui->matchUrlScheme->setChecked(settings.matchUrlScheme()); if (settings.sortByUsername()) - ui->sortByUsername->setChecked(true); + m_ui->sortByUsername->setChecked(true); else - ui->sortByTitle->setChecked(true); - ui->httpPort->setText(QString::number(settings.httpPort())); + m_ui->sortByTitle->setChecked(true); + m_ui->httpPort->setText(QString::number(settings.httpPort())); -/* - ui->checkBoxLower->setChecked(settings.passwordUseLowercase()); - ui->checkBoxNumbers->setChecked(settings.passwordUseNumbers()); - ui->checkBoxUpper->setChecked(settings.passwordUseUppercase()); - ui->checkBoxSpecialChars->setChecked(settings.passwordUseSpecial()); - ui->checkBoxEnsureEvery->setChecked(settings.passwordEveryGroup()); - ui->checkBoxExcludeAlike->setChecked(settings.passwordExcludeAlike()); - ui->spinBoxLength->setValue(settings.passwordLength()); -*/ + m_ui->alwaysAllowAccess->setChecked(settings.alwaysAllowAccess()); + m_ui->alwaysAllowUpdate->setChecked(settings.alwaysAllowUpdate()); + m_ui->searchInAllDatabases->setChecked(settings.searchInAllDatabases()); + m_ui->supportKphFields->setChecked(settings.supportKphFields()); - ui->alwaysAllowAccess->setChecked(settings.alwaysAllowAccess()); - ui->alwaysAllowUpdate->setChecked(settings.alwaysAllowUpdate()); - ui->searchInAllDatabases->setChecked(settings.searchInAllDatabases()); - ui->supportKphFields->setChecked(settings.supportKphFields()); + m_ui->passwordGenerator->loadSettings(); } void OptionDialog::saveSettings() { HttpSettings settings; - settings.setEnabled(ui->enableHttpServer->isChecked()); + settings.setEnabled(m_ui->enableHttpServer->isChecked()); - settings.setShowNotification(ui->showNotification->isChecked()); - settings.setBestMatchOnly(ui->bestMatchOnly->isChecked()); - settings.setUnlockDatabase(ui->unlockDatabase->isChecked()); - settings.setMatchUrlScheme(ui->matchUrlScheme->isChecked()); - settings.setSortByUsername(ui->sortByUsername->isChecked()); + settings.setShowNotification(m_ui->showNotification->isChecked()); + settings.setBestMatchOnly(m_ui->bestMatchOnly->isChecked()); + settings.setUnlockDatabase(m_ui->unlockDatabase->isChecked()); + settings.setMatchUrlScheme(m_ui->matchUrlScheme->isChecked()); + settings.setSortByUsername(m_ui->sortByUsername->isChecked()); - int port = ui->httpPort->text().toInt(); + int port = m_ui->httpPort->text().toInt(); if (port < 1024) { QMessageBox::warning(this, tr("Cannot bind to privileged ports"), tr("Cannot bind to privileged ports below 1024!\nUsing default port 19455.")); port = 19455; } settings.setHttpPort(port); + settings.setAlwaysAllowAccess(m_ui->alwaysAllowAccess->isChecked()); + settings.setAlwaysAllowUpdate(m_ui->alwaysAllowUpdate->isChecked()); + settings.setSearchInAllDatabases(m_ui->searchInAllDatabases->isChecked()); + settings.setSupportKphFields(m_ui->supportKphFields->isChecked()); -/* - settings.setPasswordUseLowercase(ui->checkBoxLower->isChecked()); - settings.setPasswordUseNumbers(ui->checkBoxNumbers->isChecked()); - settings.setPasswordUseUppercase(ui->checkBoxUpper->isChecked()); - settings.setPasswordUseSpecial(ui->checkBoxSpecialChars->isChecked()); - settings.setPasswordEveryGroup(ui->checkBoxEnsureEvery->isChecked()); - settings.setPasswordExcludeAlike(ui->checkBoxExcludeAlike->isChecked()); - settings.setPasswordLength(ui->spinBoxLength->value()); -*/ - - settings.setAlwaysAllowAccess(ui->alwaysAllowAccess->isChecked()); - settings.setAlwaysAllowUpdate(ui->alwaysAllowUpdate->isChecked()); - settings.setSearchInAllDatabases(ui->searchInAllDatabases->isChecked()); - settings.setSupportKphFields(ui->supportKphFields->isChecked()); + m_ui->passwordGenerator->saveSettings(); } diff --git a/src/http/OptionDialog.h b/src/http/OptionDialog.h index adec9f695..1b1819159 100644 --- a/src/http/OptionDialog.h +++ b/src/http/OptionDialog.h @@ -38,7 +38,7 @@ Q_SIGNALS: void removeStoredPermissions(); private: - QScopedPointer ui; + QScopedPointer m_ui; }; #endif // OPTIONDIALOG_H diff --git a/src/http/OptionDialog.ui b/src/http/OptionDialog.ui index 9bb168ee8..f3171733b 100644 --- a/src/http/OptionDialog.ui +++ b/src/http/OptionDialog.ui @@ -6,14 +6,26 @@ 0 0 - 605 - 429 + 577 + 404 Dialog + + 0 + + + 0 + + + 0 + + + 0 + @@ -37,13 +49,18 @@ This is required for accessing your databases from ChromeIPass or PassIFox Sh&ow a notification when credentials are requested + + true + + + Only returns the best matches for a specific URL instead of all entries for the whole domain. + - &Return only best matching entries for a URL instead -of all entries for the whole domain + &Return only best matching entries @@ -52,13 +69,18 @@ of all entries for the whole domain Re&quest to unlock the database if it is locked + + true + + + Only entries with the same scheme (http://, https://, ftp://, ...) are returned. + - &Match URL schemes -Only entries with the same scheme (http://, https://, ftp://, ...) are returned + &Match URL schemes @@ -107,7 +129,7 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned< - Password generator + Password Generator @@ -132,20 +154,14 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned< Advanced - + - - - - 75 - true - - - - color: rgb(255, 0, 0); - - - The following options can be dangerous. Change them only if you know what you are doing. + + + + 0 + 0 + @@ -165,35 +181,21 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned< + + Only the selected database has to be connected with a client. + Searc&h in all opened databases for matching entries - - - - Only the selected database has to be connected with a client! - - - 30 - - - - - &Return advanced string fields which start with "KPH: " - - - - - - + Automatically creating or updating string fields is not supported. - - 30 + + &Return advanced string fields which start with "KPH: " @@ -214,25 +216,8 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned< - - - - - d0000 - - - Default port: 19455 - - - - - - - KeePassXC will listen to this port on 127.0.0.1 - - - - + + @@ -248,6 +233,23 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned< + + + + d0000 + + + Default port: 19455 + + + + + + + KeePassXC will listen to this port on 127.0.0.1 + + + @@ -276,6 +278,12 @@ Only entries with the same scheme (http://, https://, ftp://, ...) are returned<
http/HttpPasswordGeneratorWidget.h
1 + + MessageWidget + QWidget +
gui/MessageWidget.h
+ 1 +