mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-05 21:47:38 +03:00
Rework browser integration settings
This commit is contained in:
parent
780608894e
commit
f2b3181735
5 changed files with 189 additions and 117 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "core/FilePath.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QtWidgets/QFileDialog>
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue