mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-15 17:27:43 -05:00
Merge remote-tracking branch 'origin/keepassx_merge'
This commit is contained in:
commit
5eadd10612
@ -23,7 +23,7 @@ The following libraries are required:
|
|||||||
* zlib
|
* zlib
|
||||||
* libmicrohttpd
|
* libmicrohttpd
|
||||||
* libxtst (optional for auto-type on X11)
|
* libxtst (optional for auto-type on X11)
|
||||||
* libxtst, qtx11extras (optional for auto-type on X11)
|
* libxi, libxtst, qtx11extras (optional for auto-type on X11)
|
||||||
|
|
||||||
On Debian you can install them with:
|
On Debian you can install them with:
|
||||||
|
|
||||||
|
@ -20,10 +20,12 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
|
#include <QHeaderView>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "autotype/AutoTypeSelectView.h"
|
#include "autotype/AutoTypeSelectView.h"
|
||||||
|
#include "core/Config.h"
|
||||||
#include "core/FilePath.h"
|
#include "core/FilePath.h"
|
||||||
#include "gui/entry/EntryModel.h"
|
#include "gui/entry/EntryModel.h"
|
||||||
|
|
||||||
@ -39,11 +41,14 @@ AutoTypeSelectDialog::AutoTypeSelectDialog(QWidget* parent)
|
|||||||
setWindowTitle(tr("Auto-Type - KeePassX"));
|
setWindowTitle(tr("Auto-Type - KeePassX"));
|
||||||
setWindowIcon(filePath()->applicationIcon());
|
setWindowIcon(filePath()->applicationIcon());
|
||||||
|
|
||||||
QSize size(400, 250);
|
QRect screenGeometry = QApplication::desktop()->availableGeometry(QCursor::pos());
|
||||||
|
QSize size = config()->get("GUI/AutoTypeSelectDialogSize", QSize(400, 250)).toSize();
|
||||||
|
size.setWidth(qMin(size.width(), screenGeometry.width()));
|
||||||
|
size.setHeight(qMin(size.height(), screenGeometry.height()));
|
||||||
resize(size);
|
resize(size);
|
||||||
|
|
||||||
// move dialog to the center of the screen
|
// move dialog to the center of the screen
|
||||||
QPoint screenCenter = QApplication::desktop()->availableGeometry(QCursor::pos()).center();
|
QPoint screenCenter = screenGeometry.center();
|
||||||
move(screenCenter.x() - (size.width() / 2), screenCenter.y() - (size.height() / 2));
|
move(screenCenter.x() - (size.width() / 2), screenCenter.y() - (size.height() / 2));
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||||
@ -65,6 +70,15 @@ void AutoTypeSelectDialog::setEntries(const QList<Entry*>& entries, const QHash<
|
|||||||
{
|
{
|
||||||
m_sequences = sequences;
|
m_sequences = sequences;
|
||||||
m_view->setEntryList(entries);
|
m_view->setEntryList(entries);
|
||||||
|
|
||||||
|
m_view->header()->resizeSections(QHeaderView::ResizeToContents);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AutoTypeSelectDialog::done(int r)
|
||||||
|
{
|
||||||
|
config()->set("GUI/AutoTypeSelectDialogSize", size());
|
||||||
|
|
||||||
|
QDialog::done(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTypeSelectDialog::emitEntryActivated(const QModelIndex& index)
|
void AutoTypeSelectDialog::emitEntryActivated(const QModelIndex& index)
|
||||||
|
@ -36,6 +36,9 @@ public:
|
|||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void entryActivated(Entry* entry, const QString& sequence);
|
void entryActivated(Entry* entry, const QString& sequence);
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void done(int r) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void emitEntryActivated(const QModelIndex& index);
|
void emitEntryActivated(const QModelIndex& index);
|
||||||
void entryRemoved();
|
void entryRemoved();
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
find_package(X11)
|
find_package(X11)
|
||||||
find_package(Qt5X11Extras 5.2)
|
find_package(Qt5X11Extras 5.2)
|
||||||
add_feature_info(libXi X11_Xi_FOUND "The X11 Xi Protocol library is required for auto-type")
|
if(PRINT_SUMMARY)
|
||||||
add_feature_info(libXtest X11_XTest_FOUND "The X11 XTEST Protocol library is required for auto-type")
|
add_feature_info(libXi X11_Xi_FOUND "The X11 Xi Protocol library is required for auto-type")
|
||||||
add_feature_info(Qt5X11Extras Qt5X11Extras_FOUND "The Qt5X11Extras library is required for auto-type")
|
add_feature_info(libXtst X11_XTest_FOUND "The X11 XTEST Protocol library is required for auto-type")
|
||||||
|
add_feature_info(Qt5X11Extras Qt5X11Extras_FOUND "The Qt5X11Extras library is required for auto-type")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(X11_FOUND AND X11_Xi_FOUND AND X11_XTest_FOUND AND Qt5X11Extras_FOUND)
|
if(X11_FOUND AND X11_Xi_FOUND AND X11_XTest_FOUND AND Qt5X11Extras_FOUND)
|
||||||
add_subdirectory(xcb)
|
add_subdirectory(x11)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -380,6 +380,10 @@ SymmetricCipherStream* KeePass1Reader::testKeys(const QString& password, const Q
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!cipherStream) {
|
||||||
|
raiseError(tr("Wrong key or database file is corrupt."));
|
||||||
|
}
|
||||||
|
|
||||||
return cipherStream.take();
|
return cipherStream.take();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ Database* KeePass2Reader::readDatabase(QIODevice* device, const CompositeKey& ke
|
|||||||
if (!xmlReader.headerHash().isEmpty()) {
|
if (!xmlReader.headerHash().isEmpty()) {
|
||||||
QByteArray headerHash = CryptoHash::hash(headerStream.storedData(), CryptoHash::Sha256);
|
QByteArray headerHash = CryptoHash::hash(headerStream.storedData(), CryptoHash::Sha256);
|
||||||
if (headerHash != xmlReader.headerHash()) {
|
if (headerHash != xmlReader.headerHash()) {
|
||||||
raiseError("Head doesn't match hash");
|
raiseError("Header doesn't match hash");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,8 @@ void DatabaseOpenWidget::openDatabase()
|
|||||||
|
|
||||||
QFile file(m_filename);
|
QFile file(m_filename);
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
// TODO: error message
|
MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n")
|
||||||
|
.append(file.errorString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_db) {
|
if (m_db) {
|
||||||
|
@ -60,7 +60,8 @@ void DatabaseRepairWidget::openDatabase()
|
|||||||
|
|
||||||
QFile file(m_filename);
|
QFile file(m_filename);
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
// TODO: error message
|
MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n")
|
||||||
|
.append(file.errorString()));
|
||||||
Q_EMIT editFinished(false);
|
Q_EMIT editFinished(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -132,11 +132,10 @@ void DatabaseTabWidget::openDatabase(const QString& fileName, const QString& pw,
|
|||||||
|
|
||||||
// test if we can read/write or read the file
|
// test if we can read/write or read the file
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
// TODO: error handling
|
|
||||||
if (!file.open(QIODevice::ReadWrite)) {
|
if (!file.open(QIODevice::ReadWrite)) {
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
// can't open
|
MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n")
|
||||||
// TODO: error message
|
.append(file.errorString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -49,7 +49,8 @@ void KeePass1OpenWidget::openDatabase()
|
|||||||
|
|
||||||
QFile file(m_filename);
|
QFile file(m_filename);
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
// TODO: error message
|
MessageBox::warning(this, tr("Error"), tr("Unable to open the database.").append("\n")
|
||||||
|
.append(file.errorString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_db) {
|
if (m_db) {
|
||||||
|
Loading…
Reference in New Issue
Block a user