mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-24 22:50:57 -04:00
Rename KeyOpenDialog to DatabaseOpenDialog.
This commit is contained in:
parent
a282745efc
commit
9d1838a0fe
7 changed files with 28 additions and 28 deletions
|
@ -47,6 +47,7 @@ set(keepassx_SOURCES
|
||||||
format/KeePass2XmlReader.cpp
|
format/KeePass2XmlReader.cpp
|
||||||
format/KeePass2XmlWriter.cpp
|
format/KeePass2XmlWriter.cpp
|
||||||
gui/ChangeMasterKeyWidget.cpp
|
gui/ChangeMasterKeyWidget.cpp
|
||||||
|
gui/DatabaseOpenDialog.cpp
|
||||||
gui/DatabaseTabWidget.cpp
|
gui/DatabaseTabWidget.cpp
|
||||||
gui/DatabaseWidget.cpp
|
gui/DatabaseWidget.cpp
|
||||||
gui/EditEntryWidget.cpp
|
gui/EditEntryWidget.cpp
|
||||||
|
@ -56,7 +57,6 @@ set(keepassx_SOURCES
|
||||||
gui/FileDialog.cpp
|
gui/FileDialog.cpp
|
||||||
gui/GroupModel.cpp
|
gui/GroupModel.cpp
|
||||||
gui/GroupView.cpp
|
gui/GroupView.cpp
|
||||||
gui/KeyOpenDialog.cpp
|
|
||||||
gui/MainWindow.cpp
|
gui/MainWindow.cpp
|
||||||
keys/CompositeKey.cpp
|
keys/CompositeKey.cpp
|
||||||
keys/FileKey.cpp
|
keys/FileKey.cpp
|
||||||
|
@ -74,6 +74,7 @@ set(keepassx_MOC
|
||||||
core/Group.h
|
core/Group.h
|
||||||
core/Metadata.h
|
core/Metadata.h
|
||||||
gui/ChangeMasterKeyWidget.h
|
gui/ChangeMasterKeyWidget.h
|
||||||
|
gui/DatabaseOpenDialog.h
|
||||||
gui/DatabaseTabWidget.h
|
gui/DatabaseTabWidget.h
|
||||||
gui/DatabaseWidget.h
|
gui/DatabaseWidget.h
|
||||||
gui/EditEntryWidget.h
|
gui/EditEntryWidget.h
|
||||||
|
@ -82,7 +83,6 @@ set(keepassx_MOC
|
||||||
gui/EntryView.h
|
gui/EntryView.h
|
||||||
gui/GroupModel.h
|
gui/GroupModel.h
|
||||||
gui/GroupView.h
|
gui/GroupView.h
|
||||||
gui/KeyOpenDialog.h
|
|
||||||
gui/MainWindow.h
|
gui/MainWindow.h
|
||||||
streams/HashedBlockStream.h
|
streams/HashedBlockStream.h
|
||||||
streams/LayeredStream.h
|
streams/LayeredStream.h
|
||||||
|
@ -92,11 +92,11 @@ set(keepassx_MOC
|
||||||
|
|
||||||
set(keepassx_FORMS
|
set(keepassx_FORMS
|
||||||
gui/ChangeMasterKeyWidget.ui
|
gui/ChangeMasterKeyWidget.ui
|
||||||
|
gui/DatabaseOpenDialog.ui
|
||||||
gui/EditEntryWidget.ui
|
gui/EditEntryWidget.ui
|
||||||
gui/EditEntryWidgetMain.ui
|
gui/EditEntryWidgetMain.ui
|
||||||
gui/EditEntryWidgetNotes.ui
|
gui/EditEntryWidgetNotes.ui
|
||||||
gui/EditGroupWidget.ui
|
gui/EditGroupWidget.ui
|
||||||
gui/KeyOpenDialog.ui
|
|
||||||
gui/MainWindow.ui
|
gui/MainWindow.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "KeyOpenDialog.h"
|
#include "DatabaseOpenDialog.h"
|
||||||
#include "ui_KeyOpenDialog.h"
|
#include "ui_DatabaseOpenDialog.h"
|
||||||
|
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@
|
||||||
#include "keys/FileKey.h"
|
#include "keys/FileKey.h"
|
||||||
#include "keys/PasswordKey.h"
|
#include "keys/PasswordKey.h"
|
||||||
|
|
||||||
KeyOpenDialog::KeyOpenDialog(const QString& filename, QWidget* parent)
|
DatabaseOpenDialog::DatabaseOpenDialog(const QString& filename, QWidget* parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_ui(new Ui::KeyOpenDialog())
|
, m_ui(new Ui::DatabaseOpenDialog())
|
||||||
, m_filename(filename)
|
, m_filename(filename)
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
@ -54,16 +54,16 @@ KeyOpenDialog::KeyOpenDialog(const QString& filename, QWidget* parent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyOpenDialog::~KeyOpenDialog()
|
DatabaseOpenDialog::~DatabaseOpenDialog()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CompositeKey KeyOpenDialog::key()
|
CompositeKey DatabaseOpenDialog::key()
|
||||||
{
|
{
|
||||||
return m_key;
|
return m_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyOpenDialog::createKey()
|
void DatabaseOpenDialog::createKey()
|
||||||
{
|
{
|
||||||
if (m_ui->checkPassword->isChecked()) {
|
if (m_ui->checkPassword->isChecked()) {
|
||||||
m_key.addKey(PasswordKey(m_ui->editPassword->text()));
|
m_key.addKey(PasswordKey(m_ui->editPassword->text()));
|
||||||
|
@ -91,29 +91,29 @@ void KeyOpenDialog::createKey()
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyOpenDialog::togglePassword(bool checked)
|
void DatabaseOpenDialog::togglePassword(bool checked)
|
||||||
{
|
{
|
||||||
m_ui->editPassword->setEchoMode(checked ? QLineEdit::Password : QLineEdit::Normal);
|
m_ui->editPassword->setEchoMode(checked ? QLineEdit::Password : QLineEdit::Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyOpenDialog::activatePassword()
|
void DatabaseOpenDialog::activatePassword()
|
||||||
{
|
{
|
||||||
m_ui->checkPassword->setChecked(true);
|
m_ui->checkPassword->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyOpenDialog::activateKeyFile()
|
void DatabaseOpenDialog::activateKeyFile()
|
||||||
{
|
{
|
||||||
m_ui->checkKeyFile->setChecked(true);
|
m_ui->checkKeyFile->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyOpenDialog::setOkButtonEnabled()
|
void DatabaseOpenDialog::setOkButtonEnabled()
|
||||||
{
|
{
|
||||||
bool enable = m_ui->checkPassword->isChecked() || (m_ui->checkKeyFile->isChecked() && !m_ui->comboKeyFile->currentText().isEmpty());
|
bool enable = m_ui->checkPassword->isChecked() || (m_ui->checkKeyFile->isChecked() && !m_ui->comboKeyFile->currentText().isEmpty());
|
||||||
|
|
||||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(enable);
|
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyOpenDialog::browseKeyFile()
|
void DatabaseOpenDialog::browseKeyFile()
|
||||||
{
|
{
|
||||||
QString filters = QString("%1 (*);;%2 (*.key)").arg(tr("All files"), tr("Key files"));
|
QString filters = QString("%1 (*);;%2 (*.key)").arg(tr("All files"), tr("Key files"));
|
||||||
QString filename = fileDialog()->getOpenFileName(this, tr("Select key file"), QString(), filters);
|
QString filename = fileDialog()->getOpenFileName(this, tr("Select key file"), QString(), filters);
|
|
@ -24,16 +24,16 @@
|
||||||
#include "keys/CompositeKey.h"
|
#include "keys/CompositeKey.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class KeyOpenDialog;
|
class DatabaseOpenDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class KeyOpenDialog : public QDialog
|
class DatabaseOpenDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit KeyOpenDialog(const QString& filename, QWidget* parent = 0);
|
explicit DatabaseOpenDialog(const QString& filename, QWidget* parent = 0);
|
||||||
~KeyOpenDialog();
|
~DatabaseOpenDialog();
|
||||||
CompositeKey key();
|
CompositeKey key();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
@ -45,11 +45,11 @@ private Q_SLOTS:
|
||||||
void browseKeyFile();
|
void browseKeyFile();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::KeyOpenDialog> m_ui;
|
QScopedPointer<Ui::DatabaseOpenDialog> m_ui;
|
||||||
CompositeKey m_key;
|
CompositeKey m_key;
|
||||||
QString m_filename;
|
QString m_filename;
|
||||||
|
|
||||||
Q_DISABLE_COPY(KeyOpenDialog)
|
Q_DISABLE_COPY(DatabaseOpenDialog)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEEPASSX_KEYOPENDIALOG_H
|
#endif // KEEPASSX_KEYOPENDIALOG_H
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>KeyOpenDialog</class>
|
<class>DatabaseOpenDialog</class>
|
||||||
<widget class="QDialog" name="KeyOpenDialog">
|
<widget class="QDialog" name="DatabaseOpenDialog">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
|
@ -27,7 +27,7 @@
|
||||||
#include "gui/FileDialog.h"
|
#include "gui/FileDialog.h"
|
||||||
#include "gui/EntryView.h"
|
#include "gui/EntryView.h"
|
||||||
#include "gui/GroupView.h"
|
#include "gui/GroupView.h"
|
||||||
#include "gui/KeyOpenDialog.h"
|
#include "gui/DatabaseOpenDialog.h"
|
||||||
|
|
||||||
DatabaseManagerStruct::DatabaseManagerStruct()
|
DatabaseManagerStruct::DatabaseManagerStruct()
|
||||||
: file(0)
|
: file(0)
|
||||||
|
@ -86,7 +86,7 @@ void DatabaseTabWidget::openDatabase(const QString& fileName)
|
||||||
|
|
||||||
void DatabaseTabWidget::openDatabaseDialog()
|
void DatabaseTabWidget::openDatabaseDialog()
|
||||||
{
|
{
|
||||||
m_curKeyDialog = new KeyOpenDialog(m_curDbStruct.fileName, m_window);
|
m_curKeyDialog = new DatabaseOpenDialog(m_curDbStruct.fileName, m_window);
|
||||||
connect(m_curKeyDialog, SIGNAL(accepted()), SLOT(openDatabaseRead()));
|
connect(m_curKeyDialog, SIGNAL(accepted()), SLOT(openDatabaseRead()));
|
||||||
connect(m_curKeyDialog, SIGNAL(rejected()), SLOT(openDatabaseCleanup()));
|
connect(m_curKeyDialog, SIGNAL(rejected()), SLOT(openDatabaseCleanup()));
|
||||||
m_curKeyDialog->setModal(true);
|
m_curKeyDialog->setModal(true);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "format/KeePass2Writer.h"
|
#include "format/KeePass2Writer.h"
|
||||||
|
|
||||||
class DatabaseWidget;
|
class DatabaseWidget;
|
||||||
class KeyOpenDialog;
|
class DatabaseOpenDialog;
|
||||||
class QFile;
|
class QFile;
|
||||||
class QTabWidget;
|
class QTabWidget;
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ private:
|
||||||
KeePass2Writer m_writer;
|
KeePass2Writer m_writer;
|
||||||
QHash<Database*, DatabaseManagerStruct> m_dbList;
|
QHash<Database*, DatabaseManagerStruct> m_dbList;
|
||||||
DatabaseManagerStruct m_curDbStruct;
|
DatabaseManagerStruct m_curDbStruct;
|
||||||
KeyOpenDialog* m_curKeyDialog;
|
DatabaseOpenDialog* m_curKeyDialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEEPASSX_DATABASETABWIDGET_H
|
#endif // KEEPASSX_DATABASETABWIDGET_H
|
||||||
|
|
|
@ -42,7 +42,7 @@ void TestGui::testOpenDatabase()
|
||||||
QAction* actionDatabaseOpen = m_mainWindow->findChild<QAction*>("actionDatabaseOpen");
|
QAction* actionDatabaseOpen = m_mainWindow->findChild<QAction*>("actionDatabaseOpen");
|
||||||
fileDialog()->setNextFileName(QString(KEEPASSX_TEST_DATA_DIR).append("/NewDatabase.kdbx"));
|
fileDialog()->setNextFileName(QString(KEEPASSX_TEST_DATA_DIR).append("/NewDatabase.kdbx"));
|
||||||
actionDatabaseOpen->trigger();
|
actionDatabaseOpen->trigger();
|
||||||
QWidget* keyDialog = m_mainWindow->findChild<QWidget*>("KeyOpenDialog");
|
QWidget* keyDialog = m_mainWindow->findChild<QWidget*>("DatabaseOpenDialog");
|
||||||
QVERIFY(keyDialog);
|
QVERIFY(keyDialog);
|
||||||
QTest::qWaitForWindowShown(keyDialog);
|
QTest::qWaitForWindowShown(keyDialog);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue