Performed project-wide code formatting
* Updated format CMake command to properly ignore new directories and files * Added output when command is run * Resolves #2623
This commit is contained in:
@@ -65,15 +65,15 @@ AboutDialog::AboutDialog(QWidget* parent)
|
||||
#endif
|
||||
|
||||
debugInfo.append("\n").append(
|
||||
QString("%1\n- Qt %2\n- %3\n\n")
|
||||
.arg(tr("Libraries:"), QString::fromLocal8Bit(qVersion()), Crypto::backendVersion()));
|
||||
QString("%1\n- Qt %2\n- %3\n\n")
|
||||
.arg(tr("Libraries:"), QString::fromLocal8Bit(qVersion()), Crypto::backendVersion()));
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
|
||||
debugInfo.append(tr("Operating system: %1\nCPU architecture: %2\nKernel: %3 %4")
|
||||
.arg(QSysInfo::prettyProductName(),
|
||||
QSysInfo::currentCpuArchitecture(),
|
||||
QSysInfo::kernelType(),
|
||||
QSysInfo::kernelVersion()));
|
||||
.arg(QSysInfo::prettyProductName(),
|
||||
QSysInfo::currentCpuArchitecture(),
|
||||
QSysInfo::kernelType(),
|
||||
QSysInfo::kernelVersion()));
|
||||
|
||||
debugInfo.append("\n\n");
|
||||
#endif
|
||||
|
||||
@@ -248,7 +248,8 @@ void ApplicationSettingsWidget::saveSettings()
|
||||
config()->set("GUI/MovableToolbar", m_generalUi->toolbarMovableCheckBox->isChecked());
|
||||
|
||||
int currentToolButtonStyleIndex = m_generalUi->toolButtonStyleComboBox->currentIndex();
|
||||
config()->set("GUI/ToolButtonStyle", m_generalUi->toolButtonStyleComboBox->itemData(currentToolButtonStyleIndex).toString());
|
||||
config()->set("GUI/ToolButtonStyle",
|
||||
m_generalUi->toolButtonStyleComboBox->itemData(currentToolButtonStyleIndex).toString());
|
||||
|
||||
config()->set("GUI/ShowTrayIcon", m_generalUi->systrayShowCheckBox->isChecked());
|
||||
config()->set("GUI/DarkTrayIcon", m_generalUi->systrayDarkIconCheckBox->isChecked());
|
||||
@@ -329,4 +330,3 @@ void ApplicationSettingsWidget::enableToolbarSettings(bool checked)
|
||||
m_generalUi->toolButtonStyleComboBox->setEnabled(!checked);
|
||||
m_generalUi->toolButtonStyleLabel->setEnabled(!checked);
|
||||
}
|
||||
|
||||
|
||||
@@ -202,9 +202,8 @@ void DatabaseOpenWidget::openDatabase()
|
||||
bool ok = m_db->open(m_filename, masterKey, &error, false);
|
||||
QApplication::restoreOverrideCursor();
|
||||
if (!ok) {
|
||||
m_ui->messageWidget->showMessage(
|
||||
tr("Unable to open the database:\n%1").arg(error),
|
||||
MessageWidget::MessageType::Error);
|
||||
m_ui->messageWidget->showMessage(tr("Unable to open the database:\n%1").arg(error),
|
||||
MessageWidget::MessageType::Error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -232,8 +231,7 @@ void DatabaseOpenWidget::openDatabase()
|
||||
}
|
||||
emit dialogFinished(true);
|
||||
} else {
|
||||
m_ui->messageWidget->showMessage(tr("Unable to open the database:\n%1").arg(error),
|
||||
MessageWidget::Error);
|
||||
m_ui->messageWidget->showMessage(tr("Unable to open the database:\n%1").arg(error), MessageWidget::Error);
|
||||
m_ui->editPassword->setText("");
|
||||
|
||||
#ifdef WITH_XC_TOUCHID
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
#include "core/Tools.h"
|
||||
#include "format/CsvExporter.h"
|
||||
#include "gui/Clipboard.h"
|
||||
#include "gui/DatabaseOpenDialog.h"
|
||||
#include "gui/DatabaseWidget.h"
|
||||
#include "gui/DatabaseWidgetStateSync.h"
|
||||
#include "gui/DragTabBar.h"
|
||||
#include "gui/FileDialog.h"
|
||||
#include "gui/MessageBox.h"
|
||||
#include "gui/DatabaseOpenDialog.h"
|
||||
#include "gui/entry/EntryView.h"
|
||||
#include "gui/group/GroupView.h"
|
||||
#ifdef Q_OS_MACOS
|
||||
@@ -54,12 +54,15 @@ DatabaseTabWidget::DatabaseTabWidget(QWidget* parent)
|
||||
setTabBar(tabBar);
|
||||
setDocumentMode(true);
|
||||
|
||||
// clang-format off
|
||||
connect(this, SIGNAL(tabCloseRequested(int)), SLOT(closeDatabaseTab(int)));
|
||||
connect(this, SIGNAL(currentChanged(int)), SLOT(emitActivateDatabaseChanged()));
|
||||
connect(this, SIGNAL(activateDatabaseChanged(DatabaseWidget*)), m_dbWidgetStateSync, SLOT(setActive(DatabaseWidget*)));
|
||||
connect(this, SIGNAL(activateDatabaseChanged(DatabaseWidget*)),
|
||||
m_dbWidgetStateSync, SLOT(setActive(DatabaseWidget*)));
|
||||
connect(autoType(), SIGNAL(globalShortcutTriggered()), SLOT(performGlobalAutoType()));
|
||||
connect(autoType(), SIGNAL(autotypePerformed()), SLOT(relockPendingDatabase()));
|
||||
connect(autoType(), SIGNAL(autotypeRejected()), SLOT(relockPendingDatabase()));
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
DatabaseTabWidget::~DatabaseTabWidget()
|
||||
@@ -186,8 +189,9 @@ void DatabaseTabWidget::addDatabaseTab(DatabaseWidget* dbWidget, bool inBackgrou
|
||||
setCurrentIndex(index);
|
||||
}
|
||||
|
||||
connect(dbWidget, SIGNAL(databaseFilePathChanged(QString,QString)), SLOT(updateTabName()));
|
||||
connect(dbWidget, SIGNAL(requestOpenDatabase(QString,bool,QString)), SLOT(addDatabaseTab(QString,bool,QString)));
|
||||
connect(dbWidget, SIGNAL(databaseFilePathChanged(QString, QString)), SLOT(updateTabName()));
|
||||
connect(
|
||||
dbWidget, SIGNAL(requestOpenDatabase(QString, bool, QString)), SLOT(addDatabaseTab(QString, bool, QString)));
|
||||
connect(dbWidget, SIGNAL(closeRequest()), SLOT(closeDatabaseTabFromSender()));
|
||||
connect(dbWidget, SIGNAL(databaseModified()), SLOT(updateTabName()));
|
||||
connect(dbWidget, SIGNAL(databaseSaved()), SLOT(updateTabName()));
|
||||
@@ -520,7 +524,6 @@ void DatabaseTabWidget::lockDatabases()
|
||||
// If we locked a database without a file close the tab
|
||||
closeDatabaseTab(dbWidget);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,7 +545,8 @@ void DatabaseTabWidget::unlockDatabaseInDialog(DatabaseWidget* dbWidget, Databas
|
||||
* @param intent intent for unlocking
|
||||
* @param file path of the database to be unlocked
|
||||
*/
|
||||
void DatabaseTabWidget::unlockDatabaseInDialog(DatabaseWidget* dbWidget, DatabaseOpenDialog::Intent intent,
|
||||
void DatabaseTabWidget::unlockDatabaseInDialog(DatabaseWidget* dbWidget,
|
||||
DatabaseOpenDialog::Intent intent,
|
||||
const QString& filePath)
|
||||
{
|
||||
m_databaseOpenDialog->setTargetDatabaseWidget(dbWidget);
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
#ifndef KEEPASSX_DATABASETABWIDGET_H
|
||||
#define KEEPASSX_DATABASETABWIDGET_H
|
||||
|
||||
#include "gui/MessageWidget.h"
|
||||
#include "DatabaseOpenDialog.h"
|
||||
#include "gui/MessageWidget.h"
|
||||
|
||||
#include <QTabWidget>
|
||||
#include <QPointer>
|
||||
#include <QTabWidget>
|
||||
|
||||
class Database;
|
||||
class DatabaseWidget;
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
#include <QSplitter>
|
||||
|
||||
#include "autotype/AutoType.h"
|
||||
#include "core/Database.h"
|
||||
#include "core/Config.h"
|
||||
#include "core/Database.h"
|
||||
#include "core/EntrySearcher.h"
|
||||
#include "core/FilePath.h"
|
||||
#include "core/FileWatcher.h"
|
||||
@@ -42,18 +42,18 @@
|
||||
#include "core/Metadata.h"
|
||||
#include "core/Tools.h"
|
||||
#include "format/KeePass2Reader.h"
|
||||
#include "gui/FileDialog.h"
|
||||
#include "gui/Clipboard.h"
|
||||
#include "gui/CloneDialog.h"
|
||||
#include "gui/DatabaseOpenWidget.h"
|
||||
#include "gui/DatabaseOpenDialog.h"
|
||||
#include "gui/dbsettings/DatabaseSettingsDialog.h"
|
||||
#include "gui/DatabaseOpenWidget.h"
|
||||
#include "gui/EntryPreviewWidget.h"
|
||||
#include "gui/FileDialog.h"
|
||||
#include "gui/KeePass1OpenWidget.h"
|
||||
#include "gui/MessageBox.h"
|
||||
#include "gui/TotpDialog.h"
|
||||
#include "gui/TotpSetupDialog.h"
|
||||
#include "gui/TotpExportSettingsDialog.h"
|
||||
#include "gui/TotpSetupDialog.h"
|
||||
#include "gui/dbsettings/DatabaseSettingsDialog.h"
|
||||
#include "gui/entry/EditEntryWidget.h"
|
||||
#include "gui/entry/EntryView.h"
|
||||
#include "gui/group/EditGroupWidget.h"
|
||||
@@ -443,7 +443,7 @@ void DatabaseWidget::deleteSelectedEntries()
|
||||
// Confirm entry removal before moving forward
|
||||
auto* recycleBin = m_db->metadata()->recycleBin();
|
||||
bool permanent = (recycleBin && recycleBin->findEntryByUuid(selectedEntries.first()->uuid()))
|
||||
|| !m_db->metadata()->recycleBinEnabled();
|
||||
|| !m_db->metadata()->recycleBinEnabled();
|
||||
|
||||
if (!confirmDeleteEntries(selectedEntries, permanent)) {
|
||||
return;
|
||||
@@ -462,15 +462,16 @@ void DatabaseWidget::deleteSelectedEntries()
|
||||
if (!references.isEmpty()) {
|
||||
// Prompt for reference handling
|
||||
auto result = MessageBox::question(
|
||||
this,
|
||||
tr("Replace references to entry?"),
|
||||
tr("Entry \"%1\" has %2 reference(s). "
|
||||
"Do you want to overwrite references with values, skip this entry, or delete anyway?", "",
|
||||
references.size())
|
||||
.arg((*it)->title().toHtmlEscaped())
|
||||
.arg(references.size()),
|
||||
MessageBox::Overwrite | MessageBox::Skip | MessageBox::Delete,
|
||||
MessageBox::Overwrite);
|
||||
this,
|
||||
tr("Replace references to entry?"),
|
||||
tr("Entry \"%1\" has %2 reference(s). "
|
||||
"Do you want to overwrite references with values, skip this entry, or delete anyway?",
|
||||
"",
|
||||
references.size())
|
||||
.arg((*it)->title().toHtmlEscaped())
|
||||
.arg(references.size()),
|
||||
MessageBox::Overwrite | MessageBox::Skip | MessageBox::Delete,
|
||||
MessageBox::Overwrite);
|
||||
|
||||
if (result == MessageBox::Overwrite) {
|
||||
for (auto* entry : references) {
|
||||
@@ -590,8 +591,7 @@ void DatabaseWidget::copyAttribute(QAction* action)
|
||||
Entry* currentEntry = m_entryView->currentEntry();
|
||||
if (currentEntry) {
|
||||
setClipboardTextAndMinimize(
|
||||
currentEntry->resolveMultiplePlaceholders(
|
||||
currentEntry->attributes()->value(action->data().toString())));
|
||||
currentEntry->resolveMultiplePlaceholders(currentEntry->attributes()->value(action->data().toString())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -707,12 +707,12 @@ void DatabaseWidget::deleteGroup()
|
||||
bool isRecycleBin = recycleBin && (currentGroup == recycleBin);
|
||||
bool isRecycleBinSubgroup = recycleBin && currentGroup->findGroupByUuid(recycleBin->uuid());
|
||||
if (inRecycleBin || isRecycleBin || isRecycleBinSubgroup || !m_db->metadata()->recycleBinEnabled()) {
|
||||
auto result = MessageBox::question(this,
|
||||
tr("Delete group"),
|
||||
tr("Do you really want to delete the group \"%1\" for good?")
|
||||
.arg(currentGroup->name().toHtmlEscaped()),
|
||||
MessageBox::Delete | MessageBox::Cancel,
|
||||
MessageBox::Cancel);
|
||||
auto result = MessageBox::question(
|
||||
this,
|
||||
tr("Delete group"),
|
||||
tr("Do you really want to delete the group \"%1\" for good?").arg(currentGroup->name().toHtmlEscaped()),
|
||||
MessageBox::Delete | MessageBox::Cancel,
|
||||
MessageBox::Cancel);
|
||||
|
||||
if (result == MessageBox::Delete) {
|
||||
delete currentGroup;
|
||||
@@ -722,7 +722,7 @@ void DatabaseWidget::deleteGroup()
|
||||
tr("Move group to recycle bin?"),
|
||||
tr("Do you really want to move the group "
|
||||
"\"%1\" to the recycle bin?")
|
||||
.arg(currentGroup->name().toHtmlEscaped()),
|
||||
.arg(currentGroup->name().toHtmlEscaped()),
|
||||
MessageBox::Move | MessageBox::Cancel,
|
||||
MessageBox::Cancel);
|
||||
if (result == MessageBox::Move) {
|
||||
@@ -815,7 +815,10 @@ void DatabaseWidget::switchToGroupEdit(Group* group, bool create)
|
||||
void DatabaseWidget::connectDatabaseSignals()
|
||||
{
|
||||
// relayed Database events
|
||||
connect(m_db.data(), SIGNAL(filePathChanged(QString,QString)), SIGNAL(databaseFilePathChanged(QString,QString)));
|
||||
connect(m_db.data(),
|
||||
SIGNAL(filePathChanged(QString, QString)),
|
||||
|
||||
SIGNAL(databaseFilePathChanged(QString, QString)));
|
||||
connect(m_db.data(), SIGNAL(databaseModified()), SIGNAL(databaseModified()));
|
||||
connect(m_db.data(), SIGNAL(databaseModified()), SLOT(onDatabaseModified()));
|
||||
connect(m_db.data(), SIGNAL(databaseSaved()), SIGNAL(databaseSaved()));
|
||||
@@ -1208,9 +1211,11 @@ bool DatabaseWidget::lock()
|
||||
clipboard()->clearCopiedText();
|
||||
|
||||
if (currentMode() == DatabaseWidget::Mode::EditMode) {
|
||||
auto result = MessageBox::question(this, tr("Lock Database?"),
|
||||
tr("You are editing an entry. Discard changes and lock anyway?"),
|
||||
MessageBox::Discard | MessageBox::Cancel, MessageBox::Cancel);
|
||||
auto result = MessageBox::question(this,
|
||||
tr("Lock Database?"),
|
||||
tr("You are editing an entry. Discard changes and lock anyway?"),
|
||||
MessageBox::Discard | MessageBox::Cancel,
|
||||
MessageBox::Cancel);
|
||||
if (result == MessageBox::Cancel) {
|
||||
return false;
|
||||
}
|
||||
@@ -1228,8 +1233,11 @@ bool DatabaseWidget::lock()
|
||||
} else {
|
||||
msg = tr("Database was modified.\nSave changes?");
|
||||
}
|
||||
auto result = MessageBox::question(this, tr("Save changes?"), msg,
|
||||
MessageBox::Save | MessageBox::Discard | MessageBox::Cancel, MessageBox::Save);
|
||||
auto result = MessageBox::question(this,
|
||||
tr("Save changes?"),
|
||||
msg,
|
||||
MessageBox::Save | MessageBox::Discard | MessageBox::Cancel,
|
||||
MessageBox::Save);
|
||||
if (result == MessageBox::Save) {
|
||||
if (!save()) {
|
||||
return false;
|
||||
@@ -1288,9 +1296,9 @@ void DatabaseWidget::reloadDatabaseFile()
|
||||
if (!config()->get("AutoReloadOnChange").toBool()) {
|
||||
// Ask if we want to reload the db
|
||||
auto result = MessageBox::question(this,
|
||||
tr("File has changed"),
|
||||
tr("The database file has changed. Do you want to load the changes?"),
|
||||
MessageBox::Yes | MessageBox::No);
|
||||
tr("File has changed"),
|
||||
tr("The database file has changed. Do you want to load the changes?"),
|
||||
MessageBox::Yes | MessageBox::No);
|
||||
|
||||
if (result == MessageBox::No) {
|
||||
// Notify everyone the database does not match the file
|
||||
@@ -1306,7 +1314,8 @@ void DatabaseWidget::reloadDatabaseFile()
|
||||
if (db->open(database()->key(), &error, true)) {
|
||||
if (m_db->isModified()) {
|
||||
// Ask if we want to merge changes into new database
|
||||
auto result = MessageBox::question(this,
|
||||
auto result = MessageBox::question(
|
||||
this,
|
||||
tr("Merge Request"),
|
||||
tr("The database file has changed and you have unsaved changes.\nDo you want to merge your changes?"),
|
||||
MessageBox::Merge | MessageBox::Cancel,
|
||||
@@ -1336,9 +1345,8 @@ void DatabaseWidget::reloadDatabaseFile()
|
||||
m_db->setReadOnly(isReadOnly);
|
||||
restoreGroupEntryFocus(groupBeforeReload, entryBeforeReload);
|
||||
} else {
|
||||
showMessage(
|
||||
tr("Could not open the new database file while attempting to autoreload.\nError: %1").arg(error),
|
||||
MessageWidget::Error);
|
||||
showMessage(tr("Could not open the new database file while attempting to autoreload.\nError: %1").arg(error),
|
||||
MessageWidget::Error);
|
||||
// Mark db as modified since existing data may differ from file or file was deleted
|
||||
m_db->markAsModified();
|
||||
}
|
||||
@@ -1525,12 +1533,16 @@ bool DatabaseWidget::saveAs()
|
||||
while (true) {
|
||||
QString oldFilePath = m_db->filePath();
|
||||
if (!QFileInfo(oldFilePath).exists()) {
|
||||
oldFilePath = QDir::toNativeSeparators(config()->get("LastDir", QDir::homePath()).toString()
|
||||
+ "/" + tr("Passwords").append(".kdbx"));
|
||||
oldFilePath = QDir::toNativeSeparators(config()->get("LastDir", QDir::homePath()).toString() + "/"
|
||||
+ tr("Passwords").append(".kdbx"));
|
||||
}
|
||||
QString newFilePath = fileDialog()->getSaveFileName(
|
||||
this, tr("Save database as"), oldFilePath,
|
||||
tr("KeePass 2 Database").append(" (*.kdbx)"), nullptr, nullptr, "kdbx");
|
||||
QString newFilePath = fileDialog()->getSaveFileName(this,
|
||||
tr("Save database as"),
|
||||
oldFilePath,
|
||||
tr("KeePass 2 Database").append(" (*.kdbx)"),
|
||||
nullptr,
|
||||
nullptr,
|
||||
"kdbx");
|
||||
|
||||
if (!newFilePath.isEmpty()) {
|
||||
// Ensure we don't recurse back into this function
|
||||
@@ -1550,8 +1562,10 @@ bool DatabaseWidget::saveAs()
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::showMessage(const QString& text, MessageWidget::MessageType type,
|
||||
bool showClosebutton, int autoHideTimeout)
|
||||
void DatabaseWidget::showMessage(const QString& text,
|
||||
MessageWidget::MessageType type,
|
||||
bool showClosebutton,
|
||||
int autoHideTimeout)
|
||||
{
|
||||
m_messageWidget->setCloseButtonVisible(showClosebutton);
|
||||
m_messageWidget->showMessage(text, type, autoHideTimeout);
|
||||
@@ -1580,11 +1594,12 @@ void DatabaseWidget::emptyRecycleBin()
|
||||
return;
|
||||
}
|
||||
|
||||
auto result = MessageBox::question(this,
|
||||
tr("Empty recycle bin?"),
|
||||
tr("Are you sure you want to permanently delete everything from your recycle bin?"),
|
||||
MessageBox::Empty | MessageBox::Cancel,
|
||||
MessageBox::Cancel);
|
||||
auto result =
|
||||
MessageBox::question(this,
|
||||
tr("Empty recycle bin?"),
|
||||
tr("Are you sure you want to permanently delete everything from your recycle bin?"),
|
||||
MessageBox::Empty | MessageBox::Cancel,
|
||||
MessageBox::Cancel);
|
||||
|
||||
if (result == MessageBox::Empty) {
|
||||
m_db->emptyRecycleBin();
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <QTimer>
|
||||
|
||||
#include "DatabaseOpenDialog.h"
|
||||
#include "gui/entry/EntryModel.h"
|
||||
#include "gui/MessageWidget.h"
|
||||
#include "gui/csvImport/CsvImportWizard.h"
|
||||
#include "gui/entry/EntryModel.h"
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#include "gui/MessageBox.h"
|
||||
|
||||
#ifdef WITH_XC_NETWORKING
|
||||
#include <QtNetwork>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QtNetwork>
|
||||
#endif
|
||||
|
||||
IconStruct::IconStruct()
|
||||
@@ -417,7 +417,6 @@ void EditWidgetIcons::removeCustomIcon()
|
||||
int iconUseCount = entriesWithSameIcon.size() + groupsWithSameIcon.size();
|
||||
if (iconUseCount > 0) {
|
||||
|
||||
|
||||
auto result = MessageBox::question(this,
|
||||
tr("Confirm Delete"),
|
||||
tr("This icon is used by %n entry(s), and will be replaced "
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include "EditWidgetProperties.h"
|
||||
#include "ui_EditWidgetProperties.h"
|
||||
|
||||
#include "MessageBox.h"
|
||||
#include "core/CustomData.h"
|
||||
#include "core/TimeInfo.h"
|
||||
#include "MessageBox.h"
|
||||
|
||||
#include <QUuid>
|
||||
|
||||
@@ -105,8 +105,8 @@ void EditWidgetProperties::update()
|
||||
m_ui->removeCustomDataButton->setEnabled(false);
|
||||
} else {
|
||||
for (const QString& key : m_customData->keys()) {
|
||||
m_customDataModel->appendRow(QList<QStandardItem*>() << new QStandardItem(key)
|
||||
<< new QStandardItem(m_customData->value(key)));
|
||||
m_customDataModel->appendRow(QList<QStandardItem*>()
|
||||
<< new QStandardItem(key) << new QStandardItem(m_customData->value(key)));
|
||||
}
|
||||
m_ui->removeCustomDataButton->setEnabled(!m_customData->isEmpty());
|
||||
}
|
||||
|
||||
@@ -30,8 +30,9 @@
|
||||
#include "keeshare/KeeShare.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
constexpr int GeneralTabIndex = 0;
|
||||
namespace
|
||||
{
|
||||
constexpr int GeneralTabIndex = 0;
|
||||
}
|
||||
|
||||
EntryPreviewWidget::EntryPreviewWidget(QWidget* parent)
|
||||
@@ -208,7 +209,7 @@ void EntryPreviewWidget::updateEntryGeneralTab()
|
||||
|
||||
const TimeInfo entryTime = m_currentEntry->timeInfo();
|
||||
const QString expires =
|
||||
entryTime.expires() ? entryTime.expiryTime().toLocalTime().toString(Qt::DefaultLocaleShortDate) : tr("Never");
|
||||
entryTime.expires() ? entryTime.expiryTime().toLocalTime().toString(Qt::DefaultLocaleShortDate) : tr("Never");
|
||||
m_ui->entryExpirationLabel->setText(expires);
|
||||
}
|
||||
|
||||
@@ -258,7 +259,7 @@ void EntryPreviewWidget::updateEntryAutotypeTab()
|
||||
const auto associations = autotypeAssociations->getAll();
|
||||
for (const auto& assoc : associations) {
|
||||
const QString sequence =
|
||||
assoc.sequence.isEmpty() ? m_currentEntry->effectiveAutoTypeSequence() : assoc.sequence;
|
||||
assoc.sequence.isEmpty() ? m_currentEntry->effectiveAutoTypeSequence() : assoc.sequence;
|
||||
items.append(new QTreeWidgetItem(m_ui->entryAutotypeTree, {assoc.window, sequence}));
|
||||
}
|
||||
|
||||
@@ -284,7 +285,7 @@ void EntryPreviewWidget::updateGroupGeneralTab()
|
||||
|
||||
const TimeInfo groupTime = m_currentGroup->timeInfo();
|
||||
const QString expiresText =
|
||||
groupTime.expires() ? groupTime.expiryTime().toString(Qt::DefaultLocaleShortDate) : tr("Never");
|
||||
groupTime.expires() ? groupTime.expiryTime().toString(Qt::DefaultLocaleShortDate) : tr("Never");
|
||||
m_ui->groupExpirationLabel->setText(expiresText);
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,8 @@ QString FileDialog::getSaveFileName(QWidget* parent,
|
||||
}
|
||||
}
|
||||
|
||||
QString FileDialog::getExistingDirectory(QWidget* parent, const QString& caption, QString dir, QFileDialog::Options options)
|
||||
QString
|
||||
FileDialog::getExistingDirectory(QWidget* parent, const QString& caption, QString dir, QFileDialog::Options options)
|
||||
{
|
||||
if (!m_nextDirName.isEmpty()) {
|
||||
QString result = m_nextDirName;
|
||||
|
||||
@@ -29,12 +29,14 @@ public:
|
||||
const QString& filter = QString(),
|
||||
QString* selectedFilter = nullptr,
|
||||
QFileDialog::Options options = 0);
|
||||
|
||||
QStringList getOpenFileNames(QWidget* parent = nullptr,
|
||||
const QString& caption = QString(),
|
||||
QString dir = QString(),
|
||||
const QString& filter = QString(),
|
||||
QString* selectedFilter = nullptr,
|
||||
QFileDialog::Options options = 0);
|
||||
|
||||
QString getFileName(QWidget* parent = nullptr,
|
||||
const QString& caption = QString(),
|
||||
QString dir = QString(),
|
||||
@@ -43,6 +45,7 @@ public:
|
||||
QFileDialog::Options options = 0,
|
||||
const QString& defaultExtension = QString(),
|
||||
const QString& defaultName = QString());
|
||||
|
||||
QString getSaveFileName(QWidget* parent = nullptr,
|
||||
const QString& caption = QString(),
|
||||
QString dir = QString(),
|
||||
@@ -51,6 +54,7 @@ public:
|
||||
QFileDialog::Options options = 0,
|
||||
const QString& defaultExtension = QString(),
|
||||
const QString& defaultName = QString());
|
||||
|
||||
QString getExistingDirectory(QWidget* parent = nullptr,
|
||||
const QString& caption = QString(),
|
||||
QString dir = QString(),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -c MainWindowAdaptor -a MainWindowAdaptor.h:MainWindowAdaptor.cpp org.keepassxc.MainWindow.xml
|
||||
* Command line was: qdbusxml2cpp -c MainWindowAdaptor -a MainWindowAdaptor.h:MainWindowAdaptor.cpp
|
||||
* org.keepassxc.MainWindow.xml
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
|
||||
*
|
||||
@@ -9,10 +10,10 @@
|
||||
*/
|
||||
|
||||
#include "MainWindowAdaptor.h"
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QMetaObject>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVariant>
|
||||
@@ -21,7 +22,7 @@
|
||||
* Implementation of adaptor class MainWindowAdaptor
|
||||
*/
|
||||
|
||||
MainWindowAdaptor::MainWindowAdaptor(QObject *parent)
|
||||
MainWindowAdaptor::MainWindowAdaptor(QObject* parent)
|
||||
: QDBusAbstractAdaptor(parent)
|
||||
{
|
||||
setAutoRelaySignals(true);
|
||||
@@ -46,18 +47,18 @@ void MainWindowAdaptor::lockAllDatabases()
|
||||
QMetaObject::invokeMethod(parent(), "lockAllDatabases");
|
||||
}
|
||||
|
||||
void MainWindowAdaptor::openDatabase(const QString &fileName)
|
||||
void MainWindowAdaptor::openDatabase(const QString& fileName)
|
||||
{
|
||||
QMetaObject::invokeMethod(parent(), "openDatabase", Q_ARG(QString, fileName));
|
||||
}
|
||||
|
||||
void MainWindowAdaptor::openDatabase(const QString &fileName, const QString &pw)
|
||||
void MainWindowAdaptor::openDatabase(const QString& fileName, const QString& pw)
|
||||
{
|
||||
QMetaObject::invokeMethod(parent(), "openDatabase", Q_ARG(QString, fileName), Q_ARG(QString, pw));
|
||||
}
|
||||
|
||||
void MainWindowAdaptor::openDatabase(const QString &fileName, const QString &pw, const QString &keyFile)
|
||||
void MainWindowAdaptor::openDatabase(const QString& fileName, const QString& pw, const QString& keyFile)
|
||||
{
|
||||
QMetaObject::invokeMethod(parent(), "openDatabase", Q_ARG(QString, fileName), Q_ARG(QString, pw), Q_ARG(QString, keyFile));
|
||||
QMetaObject::invokeMethod(
|
||||
parent(), "openDatabase", Q_ARG(QString, fileName), Q_ARG(QString, pw), Q_ARG(QString, keyFile));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* This file was generated by qdbusxml2cpp version 0.8
|
||||
* Command line was: qdbusxml2cpp -c MainWindowAdaptor -a MainWindowAdaptor.h:MainWindowAdaptor.cpp org.keepassxc.MainWindow.xml
|
||||
* Command line was: qdbusxml2cpp -c MainWindowAdaptor -a MainWindowAdaptor.h:MainWindowAdaptor.cpp
|
||||
* org.keepassxc.MainWindow.xml
|
||||
*
|
||||
* qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
|
||||
*
|
||||
@@ -16,8 +17,8 @@
|
||||
#include <QtDBus/QtDBus>
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QByteArray;
|
||||
template<class T> class QList;
|
||||
template<class Key, class Value> class QMap;
|
||||
template <class T> class QList;
|
||||
template <class Key, class Value> class QMap;
|
||||
class QString;
|
||||
class QStringList;
|
||||
class QVariant;
|
||||
@@ -26,31 +27,32 @@ QT_END_NAMESPACE
|
||||
/*
|
||||
* Adaptor class for interface org.keepassxc.MainWindow
|
||||
*/
|
||||
class MainWindowAdaptor: public QDBusAbstractAdaptor
|
||||
class MainWindowAdaptor : public QDBusAbstractAdaptor
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "org.keepassxc.MainWindow")
|
||||
Q_CLASSINFO("D-Bus Introspection", ""
|
||||
" <interface name=\"org.keepassxc.MainWindow\">\n"
|
||||
" <method name=\"openDatabase\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"fileName\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"pw\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"keyFile\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"openDatabase\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"fileName\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"pw\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"openDatabase\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"fileName\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"appExit\"/>\n"
|
||||
" <method name=\"lockAllDatabases\"/>\n"
|
||||
" <method name=\"closeAllDatabases\"/>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
Q_CLASSINFO("D-Bus Introspection",
|
||||
""
|
||||
" <interface name=\"org.keepassxc.MainWindow\">\n"
|
||||
" <method name=\"openDatabase\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"fileName\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"pw\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"keyFile\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"openDatabase\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"fileName\"/>\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"pw\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"openDatabase\">\n"
|
||||
" <arg direction=\"in\" type=\"s\" name=\"fileName\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"appExit\"/>\n"
|
||||
" <method name=\"lockAllDatabases\"/>\n"
|
||||
" <method name=\"closeAllDatabases\"/>\n"
|
||||
" </interface>\n"
|
||||
"")
|
||||
public:
|
||||
MainWindowAdaptor(QObject *parent);
|
||||
MainWindowAdaptor(QObject* parent);
|
||||
virtual ~MainWindowAdaptor();
|
||||
|
||||
public:
|
||||
@@ -58,9 +60,9 @@ public slots:
|
||||
void appExit();
|
||||
void closeAllDatabases();
|
||||
void lockAllDatabases();
|
||||
void openDatabase(const QString &fileName);
|
||||
void openDatabase(const QString &fileName, const QString &pw);
|
||||
void openDatabase(const QString &fileName, const QString &pw, const QString &keyFile);
|
||||
void openDatabase(const QString& fileName);
|
||||
void openDatabase(const QString& fileName, const QString& pw);
|
||||
void openDatabase(const QString& fileName, const QString& pw, const QString& keyFile);
|
||||
signals:
|
||||
};
|
||||
|
||||
|
||||
@@ -20,49 +20,45 @@
|
||||
|
||||
MessageBox::Button MessageBox::m_nextAnswer(MessageBox::NoButton);
|
||||
|
||||
QMap<QAbstractButton*, MessageBox::Button>
|
||||
MessageBox::m_addedButtonLookup =
|
||||
QMap<QAbstractButton*, MessageBox::Button> MessageBox::m_addedButtonLookup =
|
||||
QMap<QAbstractButton*, MessageBox::Button>();
|
||||
|
||||
QMap<MessageBox::Button, std::pair<QString, QMessageBox::ButtonRole>>
|
||||
MessageBox::m_buttonDefs =
|
||||
QMap<MessageBox::Button, std::pair<QString, QMessageBox::ButtonRole>> MessageBox::m_buttonDefs =
|
||||
QMap<MessageBox::Button, std::pair<QString, QMessageBox::ButtonRole>>();
|
||||
|
||||
void MessageBox::initializeButtonDefs()
|
||||
{
|
||||
m_buttonDefs =
|
||||
QMap<Button, std::pair<QString, QMessageBox::ButtonRole>>
|
||||
{
|
||||
// Reimplementation of Qt StandardButtons
|
||||
{Ok, {stdButtonText(QMessageBox::Ok), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Open, {stdButtonText(QMessageBox::Open), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Save, {stdButtonText(QMessageBox::Save), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Cancel, {stdButtonText(QMessageBox::Cancel), QMessageBox::ButtonRole::RejectRole}},
|
||||
{Close, {stdButtonText(QMessageBox::Close), QMessageBox::ButtonRole::RejectRole}},
|
||||
{Discard, {stdButtonText(QMessageBox::Discard), QMessageBox::ButtonRole::DestructiveRole}},
|
||||
{Apply, {stdButtonText(QMessageBox::Apply), QMessageBox::ButtonRole::ApplyRole}},
|
||||
{Reset, {stdButtonText(QMessageBox::Reset), QMessageBox::ButtonRole::ResetRole}},
|
||||
{RestoreDefaults, {stdButtonText(QMessageBox::RestoreDefaults), QMessageBox::ButtonRole::ResetRole}},
|
||||
{Help, {stdButtonText(QMessageBox::Help), QMessageBox::ButtonRole::HelpRole}},
|
||||
{SaveAll, {stdButtonText(QMessageBox::SaveAll), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Yes, {stdButtonText(QMessageBox::Yes), QMessageBox::ButtonRole::YesRole}},
|
||||
{YesToAll, {stdButtonText(QMessageBox::YesToAll), QMessageBox::ButtonRole::YesRole}},
|
||||
{No, {stdButtonText(QMessageBox::No), QMessageBox::ButtonRole::NoRole}},
|
||||
{NoToAll, {stdButtonText(QMessageBox::NoToAll), QMessageBox::ButtonRole::NoRole}},
|
||||
{Abort, {stdButtonText(QMessageBox::Abort), QMessageBox::ButtonRole::RejectRole}},
|
||||
{Retry, {stdButtonText(QMessageBox::Retry), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Ignore, {stdButtonText(QMessageBox::Ignore), QMessageBox::ButtonRole::AcceptRole}},
|
||||
m_buttonDefs = QMap<Button, std::pair<QString, QMessageBox::ButtonRole>>{
|
||||
// Reimplementation of Qt StandardButtons
|
||||
{Ok, {stdButtonText(QMessageBox::Ok), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Open, {stdButtonText(QMessageBox::Open), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Save, {stdButtonText(QMessageBox::Save), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Cancel, {stdButtonText(QMessageBox::Cancel), QMessageBox::ButtonRole::RejectRole}},
|
||||
{Close, {stdButtonText(QMessageBox::Close), QMessageBox::ButtonRole::RejectRole}},
|
||||
{Discard, {stdButtonText(QMessageBox::Discard), QMessageBox::ButtonRole::DestructiveRole}},
|
||||
{Apply, {stdButtonText(QMessageBox::Apply), QMessageBox::ButtonRole::ApplyRole}},
|
||||
{Reset, {stdButtonText(QMessageBox::Reset), QMessageBox::ButtonRole::ResetRole}},
|
||||
{RestoreDefaults, {stdButtonText(QMessageBox::RestoreDefaults), QMessageBox::ButtonRole::ResetRole}},
|
||||
{Help, {stdButtonText(QMessageBox::Help), QMessageBox::ButtonRole::HelpRole}},
|
||||
{SaveAll, {stdButtonText(QMessageBox::SaveAll), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Yes, {stdButtonText(QMessageBox::Yes), QMessageBox::ButtonRole::YesRole}},
|
||||
{YesToAll, {stdButtonText(QMessageBox::YesToAll), QMessageBox::ButtonRole::YesRole}},
|
||||
{No, {stdButtonText(QMessageBox::No), QMessageBox::ButtonRole::NoRole}},
|
||||
{NoToAll, {stdButtonText(QMessageBox::NoToAll), QMessageBox::ButtonRole::NoRole}},
|
||||
{Abort, {stdButtonText(QMessageBox::Abort), QMessageBox::ButtonRole::RejectRole}},
|
||||
{Retry, {stdButtonText(QMessageBox::Retry), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Ignore, {stdButtonText(QMessageBox::Ignore), QMessageBox::ButtonRole::AcceptRole}},
|
||||
|
||||
// KeePassXC Buttons
|
||||
{Overwrite, {QMessageBox::tr("Overwrite"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Delete, {QMessageBox::tr("Delete"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Move, {QMessageBox::tr("Move"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Empty, {QMessageBox::tr("Empty"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Remove, {QMessageBox::tr("Remove"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Skip, {QMessageBox::tr("Skip"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Disable, {QMessageBox::tr("Disable"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Merge, {QMessageBox::tr("Merge"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
};
|
||||
// KeePassXC Buttons
|
||||
{Overwrite, {QMessageBox::tr("Overwrite"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Delete, {QMessageBox::tr("Delete"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Move, {QMessageBox::tr("Move"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Empty, {QMessageBox::tr("Empty"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Remove, {QMessageBox::tr("Remove"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Skip, {QMessageBox::tr("Skip"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Disable, {QMessageBox::tr("Disable"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
{Merge, {QMessageBox::tr("Merge"), QMessageBox::ButtonRole::AcceptRole}},
|
||||
};
|
||||
}
|
||||
|
||||
QString MessageBox::stdButtonText(QMessageBox::StandardButton button)
|
||||
|
||||
@@ -19,52 +19,54 @@
|
||||
#ifndef KEEPASSX_MESSAGEBOX_H
|
||||
#define KEEPASSX_MESSAGEBOX_H
|
||||
|
||||
#include <QMap>
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QMap>
|
||||
|
||||
class MessageBox
|
||||
{
|
||||
public:
|
||||
enum Button : uint64_t {
|
||||
enum Button : uint64_t
|
||||
{
|
||||
// Reimplementation of Qt StandardButtons
|
||||
NoButton = 0,
|
||||
Ok = 1 << 1,
|
||||
Open = 1 << 2,
|
||||
Save = 1 << 3,
|
||||
Cancel = 1 << 4,
|
||||
Close = 1 << 5,
|
||||
Discard = 1 << 6,
|
||||
Apply = 1 << 7,
|
||||
Reset = 1 << 8,
|
||||
NoButton = 0,
|
||||
Ok = 1 << 1,
|
||||
Open = 1 << 2,
|
||||
Save = 1 << 3,
|
||||
Cancel = 1 << 4,
|
||||
Close = 1 << 5,
|
||||
Discard = 1 << 6,
|
||||
Apply = 1 << 7,
|
||||
Reset = 1 << 8,
|
||||
RestoreDefaults = 1 << 9,
|
||||
Help = 1 << 10,
|
||||
SaveAll = 1 << 11,
|
||||
Yes = 1 << 12,
|
||||
YesToAll = 1 << 13,
|
||||
No = 1 << 14,
|
||||
NoToAll = 1 << 15,
|
||||
Abort = 1 << 16,
|
||||
Retry = 1 << 17,
|
||||
Ignore = 1 << 18,
|
||||
Help = 1 << 10,
|
||||
SaveAll = 1 << 11,
|
||||
Yes = 1 << 12,
|
||||
YesToAll = 1 << 13,
|
||||
No = 1 << 14,
|
||||
NoToAll = 1 << 15,
|
||||
Abort = 1 << 16,
|
||||
Retry = 1 << 17,
|
||||
Ignore = 1 << 18,
|
||||
|
||||
// KeePassXC Buttons
|
||||
Overwrite = 1 << 19,
|
||||
Delete = 1 << 20,
|
||||
Move = 1 << 21,
|
||||
Empty = 1 << 22,
|
||||
Remove = 1 << 23,
|
||||
Skip = 1 << 24,
|
||||
Disable = 1 << 25,
|
||||
Merge = 1 << 26,
|
||||
Overwrite = 1 << 19,
|
||||
Delete = 1 << 20,
|
||||
Move = 1 << 21,
|
||||
Empty = 1 << 22,
|
||||
Remove = 1 << 23,
|
||||
Skip = 1 << 24,
|
||||
Disable = 1 << 25,
|
||||
Merge = 1 << 26,
|
||||
|
||||
// Internal loop markers. Update Last when new KeePassXC button is added
|
||||
First = Ok,
|
||||
Last = Merge,
|
||||
};
|
||||
|
||||
enum Action {
|
||||
None = 0,
|
||||
enum Action
|
||||
{
|
||||
None = 0,
|
||||
Raise = 1,
|
||||
};
|
||||
|
||||
@@ -102,7 +104,7 @@ private:
|
||||
static Button m_nextAnswer;
|
||||
static QMap<QAbstractButton*, Button> m_addedButtonLookup;
|
||||
static QMap<Button, std::pair<QString, QMessageBox::ButtonRole>> m_buttonDefs;
|
||||
|
||||
|
||||
static Button messageBox(QWidget* parent,
|
||||
QMessageBox::Icon icon,
|
||||
const QString& title,
|
||||
@@ -112,9 +114,6 @@ private:
|
||||
Action action = MessageBox::None);
|
||||
|
||||
static QString stdButtonText(QMessageBox::StandardButton button);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_MESSAGEBOX_H
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
#include "SearchWidget.h"
|
||||
#include "ui_SearchWidget.h"
|
||||
#include "ui_SearchHelpWidget.h"
|
||||
#include "ui_SearchWidget.h"
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include <QMenu>
|
||||
@@ -38,7 +38,7 @@ SearchWidget::SearchWidget(QWidget* parent)
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_helpWidget = new PopupHelpWidget(m_ui->searchEdit);
|
||||
m_helpWidget->setOffset(QPoint(0,1));
|
||||
m_helpWidget->setOffset(QPoint(0, 1));
|
||||
Ui::SearchHelpWidget helpUi;
|
||||
helpUi.setupUi(m_helpWidget);
|
||||
|
||||
@@ -56,7 +56,7 @@ SearchWidget::SearchWidget(QWidget* parent)
|
||||
new QShortcut(Qt::Key_Escape, m_ui->searchEdit, SLOT(clear()), nullptr, Qt::ApplicationShortcut);
|
||||
|
||||
m_ui->searchEdit->setPlaceholderText(tr("Search (%1)...", "Search placeholder text, %1 is the keyboard shortcut")
|
||||
.arg(QKeySequence(QKeySequence::Find).toString(QKeySequence::NativeText)));
|
||||
.arg(QKeySequence(QKeySequence::Find).toString(QKeySequence::NativeText)));
|
||||
m_ui->searchEdit->installEventFilter(this);
|
||||
|
||||
QMenu* searchMenu = new QMenu();
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <QKeyEvent>
|
||||
#include "WelcomeWidget.h"
|
||||
#include "ui_WelcomeWidget.h"
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include "config-keepassx.h"
|
||||
#include "core/Config.h"
|
||||
@@ -78,7 +78,8 @@ void WelcomeWidget::refreshLastDatabases()
|
||||
}
|
||||
}
|
||||
|
||||
void WelcomeWidget::keyPressEvent(QKeyEvent *event) {
|
||||
void WelcomeWidget::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
if (m_ui->recentListWidget->hasFocus() && (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)) {
|
||||
openDatabaseFromFile(m_ui->recentListWidget->currentItem());
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ signals:
|
||||
void importCsv();
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
private slots:
|
||||
void openDatabaseFromFile(QListWidgetItem* item);
|
||||
|
||||
@@ -29,18 +29,18 @@
|
||||
#include "keeshare/DatabaseSettingsPageKeeShare.h"
|
||||
#endif
|
||||
|
||||
#include "core/Global.h"
|
||||
#include "core/Config.h"
|
||||
#include "core/Database.h"
|
||||
#include "core/FilePath.h"
|
||||
#include "core/Global.h"
|
||||
#include "touchid/TouchID.h"
|
||||
|
||||
class DatabaseSettingsDialog::ExtraPage
|
||||
{
|
||||
public:
|
||||
ExtraPage(IDatabaseSettingsPage* page, QWidget* widget)
|
||||
: settingsPage(page)
|
||||
, widget(widget)
|
||||
: settingsPage(page)
|
||||
, widget(widget)
|
||||
{
|
||||
}
|
||||
void loadSettings(QSharedPointer<Database> db) const
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
{
|
||||
settingsPage->saveSettings(widget);
|
||||
}
|
||||
|
||||
private:
|
||||
QSharedPointer<IDatabaseSettingsPage> settingsPage;
|
||||
QWidget* widget;
|
||||
|
||||
@@ -175,9 +175,9 @@ void DatabaseSettingsWidgetBrowser::removeSharedEncryptionKeys()
|
||||
|
||||
if (keysToRemove.isEmpty()) {
|
||||
MessageBox::information(this,
|
||||
tr("KeePassXC: No keys found"),
|
||||
tr("No shared encryption keys found in KeePassXC settings."),
|
||||
MessageBox::Ok);
|
||||
tr("KeePassXC: No keys found"),
|
||||
tr("No shared encryption keys found in KeePassXC settings."),
|
||||
MessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -187,9 +187,9 @@ void DatabaseSettingsWidgetBrowser::removeSharedEncryptionKeys()
|
||||
|
||||
const int count = keysToRemove.count();
|
||||
MessageBox::information(this,
|
||||
tr("KeePassXC: Removed keys from database"),
|
||||
tr("Successfully removed %n encryption key(s) from KeePassXC settings.", "", count),
|
||||
MessageBox::Ok);
|
||||
tr("KeePassXC: Removed keys from database"),
|
||||
tr("Successfully removed %n encryption key(s) from KeePassXC settings.", "", count),
|
||||
MessageBox::Ok);
|
||||
}
|
||||
|
||||
void DatabaseSettingsWidgetBrowser::removeStoredPermissions()
|
||||
@@ -227,14 +227,14 @@ void DatabaseSettingsWidgetBrowser::removeStoredPermissions()
|
||||
|
||||
if (counter > 0) {
|
||||
MessageBox::information(this,
|
||||
tr("KeePassXC: Removed permissions"),
|
||||
tr("Successfully removed permissions from %n entry(s).", "", counter),
|
||||
MessageBox::Ok);
|
||||
tr("KeePassXC: Removed permissions"),
|
||||
tr("Successfully removed permissions from %n entry(s).", "", counter),
|
||||
MessageBox::Ok);
|
||||
} else {
|
||||
MessageBox::information(this,
|
||||
tr("KeePassXC: No entry with permissions found!"),
|
||||
tr("The active database does not contain an entry with permissions."),
|
||||
MessageBox::Ok);
|
||||
tr("KeePassXC: No entry with permissions found!"),
|
||||
tr("The active database does not contain an entry with permissions."),
|
||||
MessageBox::Ok);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,6 @@ void EditEntryWidget::setupMain()
|
||||
m_mainUi->fetchFaviconButton->setVisible(false);
|
||||
#endif
|
||||
|
||||
|
||||
connect(m_mainUi->togglePasswordButton, SIGNAL(toggled(bool)), m_mainUi->passwordEdit, SLOT(setShowPassword(bool)));
|
||||
connect(m_mainUi->togglePasswordGeneratorButton, SIGNAL(toggled(bool)), SLOT(togglePasswordGeneratorButton(bool)));
|
||||
#ifdef WITH_XC_NETWORKING
|
||||
@@ -309,8 +308,8 @@ void EditEntryWidget::setupEntryUpdate()
|
||||
connect(m_sshAgentUi->externalFileEdit, SIGNAL(textChanged(QString)), this, SLOT(setUnsavedChanges()));
|
||||
connect(m_sshAgentUi->addKeyToAgentCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setUnsavedChanges()));
|
||||
connect(m_sshAgentUi->removeKeyFromAgentCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setUnsavedChanges()));
|
||||
connect(m_sshAgentUi->requireUserConfirmationCheckBox, SIGNAL(stateChanged(int)),
|
||||
this, SLOT(setUnsavedChanges()));
|
||||
connect(
|
||||
m_sshAgentUi->requireUserConfirmationCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setUnsavedChanges()));
|
||||
connect(m_sshAgentUi->lifetimeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setUnsavedChanges()));
|
||||
connect(m_sshAgentUi->lifetimeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUnsavedChanges()));
|
||||
}
|
||||
@@ -370,7 +369,9 @@ void EditEntryWidget::setupSSHAgent()
|
||||
connect(m_sshAgentUi->decryptButton, SIGNAL(clicked()), SLOT(decryptPrivateKey()));
|
||||
connect(m_sshAgentUi->copyToClipboardButton, SIGNAL(clicked()), SLOT(copyPublicKey()));
|
||||
|
||||
connect(m_advancedUi->attachmentsWidget->entryAttachments(), SIGNAL(entryAttachmentsModified()), SLOT(updateSSHAgentAttachments()));
|
||||
connect(m_advancedUi->attachmentsWidget->entryAttachments(),
|
||||
SIGNAL(entryAttachmentsModified()),
|
||||
SLOT(updateSSHAgentAttachments()));
|
||||
|
||||
addPage(tr("SSH Agent"), FilePath::instance()->icon("apps", "utilities-terminal"), m_sshAgentWidget);
|
||||
}
|
||||
@@ -591,8 +592,8 @@ void EditEntryWidget::addKeyToAgent()
|
||||
lifetime = m_sshAgentUi->lifetimeSpinBox->value();
|
||||
}
|
||||
|
||||
if (!SSHAgent::instance()->addIdentity(key, m_sshAgentUi->removeKeyFromAgentCheckBox->isChecked(),
|
||||
static_cast<quint32>(lifetime), confirm)) {
|
||||
if (!SSHAgent::instance()->addIdentity(
|
||||
key, m_sshAgentUi->removeKeyFromAgentCheckBox->isChecked(), static_cast<quint32>(lifetime), confirm)) {
|
||||
showMessage(SSHAgent::instance()->errorString(), MessageWidget::Error);
|
||||
return;
|
||||
}
|
||||
@@ -662,7 +663,11 @@ QString EditEntryWidget::entryTitle() const
|
||||
}
|
||||
}
|
||||
|
||||
void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const QString& parentName, QSharedPointer<Database> database)
|
||||
void EditEntryWidget::loadEntry(Entry* entry,
|
||||
bool create,
|
||||
bool history,
|
||||
const QString& parentName,
|
||||
QSharedPointer<Database> database)
|
||||
{
|
||||
m_entry = entry;
|
||||
m_db = std::move(database);
|
||||
|
||||
@@ -21,9 +21,8 @@
|
||||
|
||||
#include <QButtonGroup>
|
||||
#include <QModelIndex>
|
||||
#include <QScopedPointer>
|
||||
#include <QButtonGroup>
|
||||
#include <QPointer>
|
||||
#include <QScopedPointer>
|
||||
|
||||
#include "config-keepassx.h"
|
||||
#include "gui/EditWidget.h"
|
||||
@@ -64,8 +63,8 @@ public:
|
||||
explicit EditEntryWidget(QWidget* parent = nullptr);
|
||||
~EditEntryWidget() override;
|
||||
|
||||
void loadEntry(Entry* entry, bool create, bool history, const QString& parentName,
|
||||
QSharedPointer<Database> database);
|
||||
void
|
||||
loadEntry(Entry* entry, bool create, bool history, const QString& parentName, QSharedPointer<Database> database);
|
||||
|
||||
QString entryTitle() const;
|
||||
void clear();
|
||||
|
||||
@@ -223,11 +223,8 @@ void EntryAttachmentsWidget::saveSelectedAttachments()
|
||||
const QString questionText(
|
||||
tr("Are you sure you want to overwrite the existing file \"%1\" with the attachment?"));
|
||||
|
||||
auto result = MessageBox::question(this,
|
||||
tr("Confirm overwrite"),
|
||||
questionText.arg(filename),
|
||||
buttons,
|
||||
MessageBox::Cancel);
|
||||
auto result = MessageBox::question(
|
||||
this, tr("Confirm overwrite"), questionText.arg(filename), buttons, MessageBox::Cancel);
|
||||
|
||||
if (result == MessageBox::Skip) {
|
||||
continue;
|
||||
|
||||
@@ -469,7 +469,7 @@ bool EntryModel::isUsernamesHidden() const
|
||||
void EntryModel::setUsernamesHidden(bool hide)
|
||||
{
|
||||
m_hideUsernames = hide;
|
||||
emit dataChanged(index(0, 0), index(rowCount()-1, columnCount() - 1));
|
||||
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
||||
emit usernamesHiddenChanged();
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ bool EntryModel::isPasswordsHidden() const
|
||||
void EntryModel::setPasswordsHidden(bool hide)
|
||||
{
|
||||
m_hidePasswords = hide;
|
||||
emit dataChanged(index(0, 0), index(rowCount()-1, columnCount() - 1));
|
||||
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
|
||||
emit passwordsHiddenChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ class EditGroupWidget::ExtraPage
|
||||
{
|
||||
public:
|
||||
ExtraPage(IEditGroupPage* page, QWidget* widget)
|
||||
: editPage(page)
|
||||
, widget(widget)
|
||||
: editPage(page)
|
||||
, widget(widget)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -52,12 +52,12 @@ private:
|
||||
};
|
||||
|
||||
EditGroupWidget::EditGroupWidget(QWidget* parent)
|
||||
: EditWidget(parent)
|
||||
, m_mainUi(new Ui::EditGroupWidgetMain())
|
||||
, m_editGroupWidgetMain(new QWidget())
|
||||
, m_editGroupWidgetIcons(new EditWidgetIcons())
|
||||
, m_editWidgetProperties(new EditWidgetProperties())
|
||||
, m_group(nullptr)
|
||||
: EditWidget(parent)
|
||||
, m_mainUi(new Ui::EditGroupWidgetMain())
|
||||
, m_editGroupWidgetMain(new QWidget())
|
||||
, m_editGroupWidgetIcons(new EditWidgetIcons())
|
||||
, m_editWidgetProperties(new EditWidgetProperties())
|
||||
, m_group(nullptr)
|
||||
{
|
||||
m_mainUi->setupUi(m_editGroupWidgetMain);
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#ifndef KEEPASSXC_POPUPHELPWIDGET_H
|
||||
#define KEEPASSXC_POPUPHELPWIDGET_H
|
||||
|
||||
#include <QPointer>
|
||||
#include <QFrame>
|
||||
#include <QPointer>
|
||||
|
||||
class PopupHelpWidget : public QFrame
|
||||
{
|
||||
@@ -44,5 +44,4 @@ private:
|
||||
Qt::Corner m_corner;
|
||||
};
|
||||
|
||||
|
||||
#endif //KEEPASSXC_POPUPHELPWIDGET_H
|
||||
#endif // KEEPASSXC_POPUPHELPWIDGET_H
|
||||
|
||||
@@ -34,7 +34,7 @@ NewDatabaseWizard::NewDatabaseWizard(QWidget* parent)
|
||||
{
|
||||
setWizardStyle(QWizard::MacStyle);
|
||||
setOption(QWizard::WizardOption::HaveHelpButton, false);
|
||||
setOption(QWizard::WizardOption::NoDefaultButton, false); // Needed for macOS
|
||||
setOption(QWizard::WizardOption::NoDefaultButton, false); // Needed for macOS
|
||||
|
||||
// clang-format off
|
||||
m_pages << new NewDatabaseWizardPageMetaData()
|
||||
|
||||
Reference in New Issue
Block a user