diff --git a/src/browser/BrowserOptionDialog.cpp b/src/browser/BrowserOptionDialog.cpp index 9a876ac45..2040bef66 100755 --- a/src/browser/BrowserOptionDialog.cpp +++ b/src/browser/BrowserOptionDialog.cpp @@ -23,6 +23,7 @@ #include "core/FilePath.h" #include +#include BrowserOptionDialog::BrowserOptionDialog(QWidget* parent) : QWidget(parent), @@ -40,7 +41,10 @@ BrowserOptionDialog::BrowserOptionDialog(QWidget* parent) : connect(m_ui->enableBrowserSupport, SIGNAL(toggled(bool)), m_ui->tabWidget, SLOT(setEnabled(bool))); m_ui->customProxyLocation->setEnabled(m_ui->useCustomProxy->isChecked()); + m_ui->customProxyLocationBrowseButton->setEnabled(m_ui->useCustomProxy->isChecked()); connect(m_ui->useCustomProxy, SIGNAL(toggled(bool)), m_ui->customProxyLocation, SLOT(setEnabled(bool))); + connect(m_ui->useCustomProxy, SIGNAL(toggled(bool)), m_ui->customProxyLocationBrowseButton, SLOT(setEnabled(bool))); + connect(m_ui->customProxyLocationBrowseButton, SIGNAL(clicked()), this, SLOT(showProxyLocationFileDialog())); } BrowserOptionDialog::~BrowserOptionDialog() @@ -57,6 +61,11 @@ void BrowserOptionDialog::loadSettings() m_ui->unlockDatabase->setChecked(settings.unlockDatabase()); m_ui->matchUrlScheme->setChecked(settings.matchUrlScheme()); + // hide unimplemented options + // TODO: fix this + m_ui->showNotification->hide(); + m_ui->bestMatchOnly->hide(); + if (settings.sortByUsername()) { m_ui->sortByUsername->setChecked(true); } else { @@ -102,3 +111,16 @@ void BrowserOptionDialog::saveSettings() settings.setFirefoxSupport(m_ui->firefoxSupport->isChecked()); settings.setVivaldiSupport(m_ui->vivaldiSupport->isChecked()); } + +void BrowserOptionDialog::showProxyLocationFileDialog() +{ +#ifdef Q_OS_WIN + QString fileTypeFilter(tr("Executable Files (*.exe);;All Files (*.*)")); +#else + QString fileTypeFilter(tr("Executable Files (*.*)")); +#endif + auto proxyLocation = QFileDialog::getOpenFileName(this, tr("Select custom proxy location"), + QFileInfo(QCoreApplication::applicationDirPath()).filePath(), + fileTypeFilter); + m_ui->customProxyLocation->setText(proxyLocation); +} diff --git a/src/browser/BrowserOptionDialog.h b/src/browser/BrowserOptionDialog.h index 798d215d6..b562f6c18 100755 --- a/src/browser/BrowserOptionDialog.h +++ b/src/browser/BrowserOptionDialog.h @@ -43,6 +43,9 @@ signals: void removeSharedEncryptionKeys(); void removeStoredPermissions(); +private slots: + void showProxyLocationFileDialog(); + private: QScopedPointer m_ui; }; diff --git a/src/browser/BrowserOptionDialog.ui b/src/browser/BrowserOptionDialog.ui index 81eaa229d..e5352b0fa 100755 --- a/src/browser/BrowserOptionDialog.ui +++ b/src/browser/BrowserOptionDialog.ui @@ -6,8 +6,8 @@ 0 0 - 577 - 404 + 456 + 385 @@ -32,7 +32,7 @@ This is required for accessing your databases with keepassxc-browser - Enable KeepassXC browser extension + Enable KeepassXC browser integration @@ -47,22 +47,93 @@ - - - Sh&ow a notification when credentials are requested - - - true + + + Enable integration for these browsers: + + + 40 + + + + + &Google Chrome + + + false + + + + + + + &Firefox + + + false + + + + + + + Qt::Horizontal + + + + 179 + 20 + + + + + + + + &Chromium + + + false + + + + + + + &Vivaldi + + + false + + + + - - - Only returns the best matches for a specific URL instead of all entries for the whole domain. + + + Qt::Vertical + + QSizePolicy::Fixed + + + + 20 + 4 + + + + + + - &Return only best-matching entries + Show a &notification when credentials are requested + + + true @@ -82,117 +153,82 @@ Only entries with the same scheme (http://, https://, ...) are returned. - &Match URL schemes + &Match URL scheme (e.g., https://...) - + + + Only returns the best matches for a specific URL instead of all entries for the whole domain. + - Sort matching entries by &username + &Return only best-matching credentials - Sort &matching entries by title + Sort &matching credentials by title - + - R&emove all shared encryption keys from active database + Sort matching credentials by &username - - - Re&move all stored permissions from entries in active database - - - - - + Qt::Vertical + + QSizePolicy::Fixed + 20 - 40 + 10 - - - - - Supported browsers - - - - - - Native messaging requires certain .json files to be installed. Already installed browsers are automatically detected. - - - true - - - - - - - Enable KeePassXC native messaging extension for these browsers: - - - - - - - Chrome - - - false - - - - - - - Chromium - - - false - - - - - - - Firefox - - - false - - - - - - - Vivaldi - - - false - - - - + + + + + + 0 + 0 + + + + &Disconnect all browsers + + + + + + + + 0 + 0 + + + + Forget all remembered &permissions + + + + + + + Qt::Vertical @@ -224,14 +260,14 @@ - Always allow &access to entries + Never &ask before accessing credentials - Always allow &updating entries + Never ask before &updating credentials @@ -241,7 +277,7 @@ Only the selected database has to be connected with a client. - Searc&h in all opened databases for matching entries + Searc&h in all opened databases for matching credentials @@ -261,7 +297,7 @@ Updates KeePassXC or keepassxc-proxy binary path automatically to native messaging scripts on startup. - &Update KeePassXC binary path automatically to native messaging scripts on startup + Update &native messaging manifest files at startup @@ -271,7 +307,7 @@ Support a proxy application between KeePassXC and browser extension. - &Enable support for proxy application between KeePassXC and browser extension + Use a &proxy application between KeePassXC and browser extension @@ -281,19 +317,30 @@ Use a custom proxy location if you installed a proxy manually. - &Use a custom proxy location + Use a &custom proxy location - - - 999 - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - + + + + + 999 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Browse... + + + + diff --git a/src/browser/BrowserSettings.h b/src/browser/BrowserSettings.h index 8d08eef71..eb59fa5ac 100755 --- a/src/browser/BrowserSettings.h +++ b/src/browser/BrowserSettings.h @@ -34,7 +34,7 @@ public: static void setShowNotification(bool showNotification); static bool bestMatchOnly(); //TODO!! static void setBestMatchOnly(bool bestMatchOnly); - static bool unlockDatabase(); //TODO!! + static bool unlockDatabase(); static void setUnlockDatabase(bool unlockDatabase); static bool matchUrlScheme(); static void setMatchUrlScheme(bool matchUrlScheme); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 9c0fe1dfb..a3e713426 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -77,7 +77,7 @@ public: QString name() override { - return QObject::tr("Browser Integration"); + return QObject::tr("Browser Integration (old)"); } QIcon icon() override @@ -125,7 +125,7 @@ class BrowserPlugin: public ISettingsPage QString name() override { - return QObject::tr("Browser extension with native messaging"); + return QObject::tr("Browser Integration"); } QIcon icon() override @@ -182,16 +182,16 @@ MainWindow::MainWindow() m_countDefaultAttributes = m_ui->menuEntryCopyAttribute->actions().size(); restoreGeometry(config()->get("GUI/MainWindowGeometry").toByteArray()); - #ifdef WITH_XC_HTTP +#ifdef WITH_XC_BROWSER + m_ui->settingsWidget->addSettingsPage(new BrowserPlugin(m_ui->tabWidget)); +#endif +#ifdef WITH_XC_HTTP m_ui->settingsWidget->addSettingsPage(new HttpPlugin(m_ui->tabWidget)); - #endif - #ifdef WITH_XC_SSHAGENT +#endif +#ifdef WITH_XC_SSHAGENT SSHAgent::init(this); m_ui->settingsWidget->addSettingsPage(new AgentSettingsPage(m_ui->tabWidget)); - #endif - #ifdef WITH_XC_BROWSER - m_ui->settingsWidget->addSettingsPage(new BrowserPlugin(m_ui->tabWidget)); - #endif +#endif setWindowIcon(filePath()->applicationIcon()); m_ui->globalMessageWidget->setHidden(true);