mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-29 09:38:48 -04:00
Add setting for not displaying KeePassHTTP migration popup
This commit is contained in:
parent
d12f15da92
commit
c27ee6aba8
7 changed files with 65 additions and 16 deletions
|
@ -116,6 +116,7 @@ void BrowserOptionDialog::loadSettings()
|
||||||
m_ui->httpAuthPermission->setChecked(settings->httpAuthPermission());
|
m_ui->httpAuthPermission->setChecked(settings->httpAuthPermission());
|
||||||
m_ui->searchInAllDatabases->setChecked(settings->searchInAllDatabases());
|
m_ui->searchInAllDatabases->setChecked(settings->searchInAllDatabases());
|
||||||
m_ui->supportKphFields->setChecked(settings->supportKphFields());
|
m_ui->supportKphFields->setChecked(settings->supportKphFields());
|
||||||
|
m_ui->noMigrationPrompt->setChecked(settings->noMigrationPrompt());
|
||||||
m_ui->supportBrowserProxy->setChecked(settings->supportBrowserProxy());
|
m_ui->supportBrowserProxy->setChecked(settings->supportBrowserProxy());
|
||||||
m_ui->useCustomProxy->setChecked(settings->useCustomProxy());
|
m_ui->useCustomProxy->setChecked(settings->useCustomProxy());
|
||||||
m_ui->customProxyLocation->setText(settings->customProxyLocation());
|
m_ui->customProxyLocation->setText(settings->customProxyLocation());
|
||||||
|
@ -183,6 +184,7 @@ void BrowserOptionDialog::saveSettings()
|
||||||
settings->setHttpAuthPermission(m_ui->httpAuthPermission->isChecked());
|
settings->setHttpAuthPermission(m_ui->httpAuthPermission->isChecked());
|
||||||
settings->setSearchInAllDatabases(m_ui->searchInAllDatabases->isChecked());
|
settings->setSearchInAllDatabases(m_ui->searchInAllDatabases->isChecked());
|
||||||
settings->setSupportKphFields(m_ui->supportKphFields->isChecked());
|
settings->setSupportKphFields(m_ui->supportKphFields->isChecked());
|
||||||
|
settings->setNoMigrationPrompt(m_ui->noMigrationPrompt->isChecked());
|
||||||
|
|
||||||
settings->setChromeSupport(m_ui->chromeSupport->isChecked());
|
settings->setChromeSupport(m_ui->chromeSupport->isChecked());
|
||||||
settings->setChromiumSupport(m_ui->chromiumSupport->isChecked());
|
settings->setChromiumSupport(m_ui->chromiumSupport->isChecked());
|
||||||
|
|
|
@ -321,6 +321,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="noMigrationPrompt">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Don't display the popup suggesting migration of legacy KeePassHTTP settings.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Do not prompt for KeePassHTTP settings migration.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="updateBinaryPath">
|
<widget class="QCheckBox" name="updateBinaryPath">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
#include <QCheckBox>
|
||||||
|
|
||||||
#include "BrowserAccessControlDialog.h"
|
#include "BrowserAccessControlDialog.h"
|
||||||
#include "BrowserEntryConfig.h"
|
#include "BrowserEntryConfig.h"
|
||||||
|
@ -1070,7 +1071,7 @@ int BrowserService::moveKeysToCustomData(Entry* entry, const QSharedPointer<Data
|
||||||
|
|
||||||
bool BrowserService::checkLegacySettings()
|
bool BrowserService::checkLegacySettings()
|
||||||
{
|
{
|
||||||
if (!browserSettings()->isEnabled()) {
|
if (!browserSettings()->isEnabled() || browserSettings()->noMigrationPrompt()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1093,13 +1094,21 @@ bool BrowserService::checkLegacySettings()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto* checkbox = new QCheckBox(tr("Don't show this warning again"));
|
||||||
|
QObject::connect(checkbox, &QCheckBox::stateChanged, [&](int state) {
|
||||||
|
browserSettings()->setNoMigrationPrompt(static_cast<Qt::CheckState>(state) == Qt::CheckState::Checked);
|
||||||
|
});
|
||||||
|
|
||||||
auto dialogResult =
|
auto dialogResult =
|
||||||
MessageBox::warning(nullptr,
|
MessageBox::warning(nullptr,
|
||||||
tr("KeePassXC: Legacy browser integration settings detected"),
|
tr("KeePassXC: Legacy browser integration settings detected"),
|
||||||
tr("Your KeePassXC-Browser settings need to be moved into the database settings.\n"
|
tr("Your KeePassXC-Browser settings need to be moved into the database settings.\n"
|
||||||
"This is necessary to maintain your current browser connections.\n"
|
"This is necessary to maintain your current browser connections.\n"
|
||||||
"Would you like to migrate your existing settings now?"),
|
"Would you like to migrate your existing settings now?"),
|
||||||
MessageBox::Yes | MessageBox::No);
|
MessageBox::Yes | MessageBox::No,
|
||||||
|
MessageBox::NoButton,
|
||||||
|
MessageBox::Raise,
|
||||||
|
checkbox);
|
||||||
|
|
||||||
return dialogResult == MessageBox::Yes;
|
return dialogResult == MessageBox::Yes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,16 @@ void BrowserSettings::setSupportKphFields(bool supportKphFields)
|
||||||
config()->set("Browser/SupportKphFields", supportKphFields);
|
config()->set("Browser/SupportKphFields", supportKphFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BrowserSettings::noMigrationPrompt()
|
||||||
|
{
|
||||||
|
return config()->get("Browser/NoMigrationPrompt", false).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BrowserSettings::setNoMigrationPrompt(bool prompt)
|
||||||
|
{
|
||||||
|
config()->set("Browser/NoMigrationPrompt", prompt);
|
||||||
|
}
|
||||||
|
|
||||||
bool BrowserSettings::supportBrowserProxy()
|
bool BrowserSettings::supportBrowserProxy()
|
||||||
{
|
{
|
||||||
return config()->get("Browser/SupportBrowserProxy", true).toBool();
|
return config()->get("Browser/SupportBrowserProxy", true).toBool();
|
||||||
|
|
|
@ -55,6 +55,8 @@ public:
|
||||||
void setHttpAuthPermission(bool httpAuthPermission);
|
void setHttpAuthPermission(bool httpAuthPermission);
|
||||||
bool supportKphFields();
|
bool supportKphFields();
|
||||||
void setSupportKphFields(bool supportKphFields);
|
void setSupportKphFields(bool supportKphFields);
|
||||||
|
bool noMigrationPrompt();
|
||||||
|
void setNoMigrationPrompt(bool prompt);
|
||||||
|
|
||||||
bool supportBrowserProxy();
|
bool supportBrowserProxy();
|
||||||
void setSupportBrowserProxy(bool enabled);
|
void setSupportBrowserProxy(bool enabled);
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "MessageBox.h"
|
#include "MessageBox.h"
|
||||||
|
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
|
#include <QCheckBox>
|
||||||
|
|
||||||
QWindow* MessageBox::m_overrideParent(nullptr);
|
QWindow* MessageBox::m_overrideParent(nullptr);
|
||||||
|
|
||||||
|
@ -77,7 +78,8 @@ MessageBox::Button MessageBox::messageBox(QWidget* parent,
|
||||||
const QString& text,
|
const QString& text,
|
||||||
MessageBox::Buttons buttons,
|
MessageBox::Buttons buttons,
|
||||||
MessageBox::Button defaultButton,
|
MessageBox::Button defaultButton,
|
||||||
MessageBox::Action action)
|
MessageBox::Action action,
|
||||||
|
QCheckBox* checkbox)
|
||||||
{
|
{
|
||||||
if (m_nextAnswer == MessageBox::NoButton) {
|
if (m_nextAnswer == MessageBox::NoButton) {
|
||||||
QMessageBox msgBox(parent);
|
QMessageBox msgBox(parent);
|
||||||
|
@ -110,6 +112,11 @@ MessageBox::Button MessageBox::messageBox(QWidget* parent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (checkbox) {
|
||||||
|
checkbox->setParent(&msgBox);
|
||||||
|
msgBox.setCheckBox(checkbox);
|
||||||
|
}
|
||||||
|
|
||||||
if (action == MessageBox::Raise) {
|
if (action == MessageBox::Raise) {
|
||||||
msgBox.setWindowFlags(Qt::WindowStaysOnTopHint);
|
msgBox.setWindowFlags(Qt::WindowStaysOnTopHint);
|
||||||
msgBox.activateWindow();
|
msgBox.activateWindow();
|
||||||
|
@ -133,9 +140,10 @@ MessageBox::Button MessageBox::critical(QWidget* parent,
|
||||||
const QString& text,
|
const QString& text,
|
||||||
MessageBox::Buttons buttons,
|
MessageBox::Buttons buttons,
|
||||||
MessageBox::Button defaultButton,
|
MessageBox::Button defaultButton,
|
||||||
MessageBox::Action action)
|
MessageBox::Action action,
|
||||||
|
QCheckBox* checkbox)
|
||||||
{
|
{
|
||||||
return messageBox(parent, QMessageBox::Critical, title, text, buttons, defaultButton, action);
|
return messageBox(parent, QMessageBox::Critical, title, text, buttons, defaultButton, action, checkbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageBox::Button MessageBox::information(QWidget* parent,
|
MessageBox::Button MessageBox::information(QWidget* parent,
|
||||||
|
@ -143,9 +151,10 @@ MessageBox::Button MessageBox::information(QWidget* parent,
|
||||||
const QString& text,
|
const QString& text,
|
||||||
MessageBox::Buttons buttons,
|
MessageBox::Buttons buttons,
|
||||||
MessageBox::Button defaultButton,
|
MessageBox::Button defaultButton,
|
||||||
MessageBox::Action action)
|
MessageBox::Action action,
|
||||||
|
QCheckBox* checkbox)
|
||||||
{
|
{
|
||||||
return messageBox(parent, QMessageBox::Information, title, text, buttons, defaultButton, action);
|
return messageBox(parent, QMessageBox::Information, title, text, buttons, defaultButton, action, checkbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageBox::Button MessageBox::question(QWidget* parent,
|
MessageBox::Button MessageBox::question(QWidget* parent,
|
||||||
|
@ -153,9 +162,10 @@ MessageBox::Button MessageBox::question(QWidget* parent,
|
||||||
const QString& text,
|
const QString& text,
|
||||||
MessageBox::Buttons buttons,
|
MessageBox::Buttons buttons,
|
||||||
MessageBox::Button defaultButton,
|
MessageBox::Button defaultButton,
|
||||||
MessageBox::Action action)
|
MessageBox::Action action,
|
||||||
|
QCheckBox* checkbox)
|
||||||
{
|
{
|
||||||
return messageBox(parent, QMessageBox::Question, title, text, buttons, defaultButton, action);
|
return messageBox(parent, QMessageBox::Question, title, text, buttons, defaultButton, action, checkbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageBox::Button MessageBox::warning(QWidget* parent,
|
MessageBox::Button MessageBox::warning(QWidget* parent,
|
||||||
|
@ -163,9 +173,10 @@ MessageBox::Button MessageBox::warning(QWidget* parent,
|
||||||
const QString& text,
|
const QString& text,
|
||||||
MessageBox::Buttons buttons,
|
MessageBox::Buttons buttons,
|
||||||
MessageBox::Button defaultButton,
|
MessageBox::Button defaultButton,
|
||||||
MessageBox::Action action)
|
MessageBox::Action action,
|
||||||
|
QCheckBox* checkbox)
|
||||||
{
|
{
|
||||||
return messageBox(parent, QMessageBox::Warning, title, text, buttons, defaultButton, action);
|
return messageBox(parent, QMessageBox::Warning, title, text, buttons, defaultButton, action, checkbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageBox::setNextAnswer(MessageBox::Button button)
|
void MessageBox::setNextAnswer(MessageBox::Button button)
|
||||||
|
|
|
@ -81,25 +81,29 @@ public:
|
||||||
const QString& text,
|
const QString& text,
|
||||||
Buttons buttons = MessageBox::Ok,
|
Buttons buttons = MessageBox::Ok,
|
||||||
Button defaultButton = MessageBox::NoButton,
|
Button defaultButton = MessageBox::NoButton,
|
||||||
Action action = MessageBox::None);
|
Action action = MessageBox::None,
|
||||||
|
QCheckBox* checkbox = nullptr);
|
||||||
static Button information(QWidget* parent,
|
static Button information(QWidget* parent,
|
||||||
const QString& title,
|
const QString& title,
|
||||||
const QString& text,
|
const QString& text,
|
||||||
Buttons buttons = MessageBox::Ok,
|
Buttons buttons = MessageBox::Ok,
|
||||||
Button defaultButton = MessageBox::NoButton,
|
Button defaultButton = MessageBox::NoButton,
|
||||||
Action action = MessageBox::None);
|
Action action = MessageBox::None,
|
||||||
|
QCheckBox* checkbox = nullptr);
|
||||||
static Button question(QWidget* parent,
|
static Button question(QWidget* parent,
|
||||||
const QString& title,
|
const QString& title,
|
||||||
const QString& text,
|
const QString& text,
|
||||||
Buttons buttons = MessageBox::Ok,
|
Buttons buttons = MessageBox::Ok,
|
||||||
Button defaultButton = MessageBox::NoButton,
|
Button defaultButton = MessageBox::NoButton,
|
||||||
Action action = MessageBox::None);
|
Action action = MessageBox::None,
|
||||||
|
QCheckBox* checkbox = nullptr);
|
||||||
static Button warning(QWidget* parent,
|
static Button warning(QWidget* parent,
|
||||||
const QString& title,
|
const QString& title,
|
||||||
const QString& text,
|
const QString& text,
|
||||||
Buttons buttons = MessageBox::Ok,
|
Buttons buttons = MessageBox::Ok,
|
||||||
Button defaultButton = MessageBox::NoButton,
|
Button defaultButton = MessageBox::NoButton,
|
||||||
Action action = MessageBox::None);
|
Action action = MessageBox::None,
|
||||||
|
QCheckBox* checkbox = nullptr);
|
||||||
|
|
||||||
class OverrideParent
|
class OverrideParent
|
||||||
{
|
{
|
||||||
|
@ -123,7 +127,8 @@ private:
|
||||||
const QString& text,
|
const QString& text,
|
||||||
Buttons buttons = MessageBox::Ok,
|
Buttons buttons = MessageBox::Ok,
|
||||||
Button defaultButton = MessageBox::NoButton,
|
Button defaultButton = MessageBox::NoButton,
|
||||||
Action action = MessageBox::None);
|
Action action = MessageBox::None,
|
||||||
|
QCheckBox* checkbox = nullptr);
|
||||||
|
|
||||||
static QString stdButtonText(QMessageBox::StandardButton button);
|
static QString stdButtonText(QMessageBox::StandardButton button);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue