mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-04 17:05:23 -05:00
parent
f9dc314e72
commit
870417d9c4
@ -81,6 +81,7 @@ set(keepassx_SOURCES
|
|||||||
gui/KeePass1OpenWidget.cpp
|
gui/KeePass1OpenWidget.cpp
|
||||||
gui/LineEdit.cpp
|
gui/LineEdit.cpp
|
||||||
gui/MainWindow.cpp
|
gui/MainWindow.cpp
|
||||||
|
gui/PasswordGeneratorWidget.cpp
|
||||||
gui/SettingsWidget.cpp
|
gui/SettingsWidget.cpp
|
||||||
gui/SortFilterHideProxyModel.cpp
|
gui/SortFilterHideProxyModel.cpp
|
||||||
gui/UnlockDatabaseWidget.cpp
|
gui/UnlockDatabaseWidget.cpp
|
||||||
@ -142,6 +143,7 @@ set(keepassx_MOC
|
|||||||
gui/KeePass1OpenWidget.h
|
gui/KeePass1OpenWidget.h
|
||||||
gui/LineEdit.h
|
gui/LineEdit.h
|
||||||
gui/MainWindow.h
|
gui/MainWindow.h
|
||||||
|
gui/PasswordGeneratorWidget.h
|
||||||
gui/SettingsWidget.h
|
gui/SettingsWidget.h
|
||||||
gui/SortFilterHideProxyModel.h
|
gui/SortFilterHideProxyModel.h
|
||||||
gui/UnlockDatabaseWidget.h
|
gui/UnlockDatabaseWidget.h
|
||||||
@ -173,6 +175,7 @@ set(keepassx_FORMS
|
|||||||
gui/EditWidgetIcons.ui
|
gui/EditWidgetIcons.ui
|
||||||
gui/EditWidgetProperties.ui
|
gui/EditWidgetProperties.ui
|
||||||
gui/MainWindow.ui
|
gui/MainWindow.ui
|
||||||
|
gui/PasswordGeneratorWidget.ui
|
||||||
gui/SearchWidget.ui
|
gui/SearchWidget.ui
|
||||||
gui/SettingsWidgetGeneral.ui
|
gui/SettingsWidgetGeneral.ui
|
||||||
gui/SettingsWidgetSecurity.ui
|
gui/SettingsWidgetSecurity.ui
|
||||||
|
31
src/gui/PasswordGeneratorWidget.cpp
Normal file
31
src/gui/PasswordGeneratorWidget.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Felix Geyer <debfx@fobos.de>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 or (at your option)
|
||||||
|
* version 3 of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "PasswordGeneratorWidget.h"
|
||||||
|
#include "ui_PasswordGeneratorWidget.h"
|
||||||
|
|
||||||
|
PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent)
|
||||||
|
: QWidget(parent)
|
||||||
|
, m_ui(new Ui::PasswordGeneratorWidget())
|
||||||
|
{
|
||||||
|
m_ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
PasswordGeneratorWidget::~PasswordGeneratorWidget()
|
||||||
|
{
|
||||||
|
;
|
||||||
|
}
|
42
src/gui/PasswordGeneratorWidget.h
Normal file
42
src/gui/PasswordGeneratorWidget.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Felix Geyer <debfx@fobos.de>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 or (at your option)
|
||||||
|
* version 3 of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef KEEPASSX_PASSWORDGENERATORWIDGET_H
|
||||||
|
#define KEEPASSX_PASSWORDGENERATORWIDGET_H
|
||||||
|
|
||||||
|
#include <QtGui/QWidget>
|
||||||
|
|
||||||
|
#include "core/Global.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class PasswordGeneratorWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
class PasswordGeneratorWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit PasswordGeneratorWidget(QWidget* parent = Q_NULLPTR);
|
||||||
|
~PasswordGeneratorWidget();
|
||||||
|
|
||||||
|
private:
|
||||||
|
const QScopedPointer<Ui::PasswordGeneratorWidget> m_ui;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // KEEPASSX_PASSWORDGENERATORWIDGET_H
|
28
src/gui/PasswordGeneratorWidget.ui
Normal file
28
src/gui/PasswordGeneratorWidget.ui
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>PasswordGeneratorWidget</class>
|
||||||
|
<widget class="QWidget" name="PasswordGeneratorWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>383</width>
|
||||||
|
<height>181</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Password Generator</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -89,12 +89,15 @@ void EditEntryWidget::setupMain()
|
|||||||
add(tr("Entry"), m_mainWidget);
|
add(tr("Entry"), m_mainWidget);
|
||||||
|
|
||||||
connect(m_mainUi->togglePasswordButton, SIGNAL(toggled(bool)), SLOT(togglePassword(bool)));
|
connect(m_mainUi->togglePasswordButton, SIGNAL(toggled(bool)), SLOT(togglePassword(bool)));
|
||||||
|
connect(m_mainUi->tooglePasswordGeneratorButton, SIGNAL(toggled(bool)), SLOT(togglePasswordGeneratorButton(bool)));
|
||||||
connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool)));
|
connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool)));
|
||||||
connect(m_mainUi->passwordEdit, SIGNAL(textEdited(QString)), SLOT(setPasswordCheckColors()));
|
connect(m_mainUi->passwordEdit, SIGNAL(textEdited(QString)), SLOT(setPasswordCheckColors()));
|
||||||
connect(m_mainUi->passwordRepeatEdit, SIGNAL(textEdited(QString)), SLOT(setPasswordCheckColors()));
|
connect(m_mainUi->passwordRepeatEdit, SIGNAL(textEdited(QString)), SLOT(setPasswordCheckColors()));
|
||||||
|
|
||||||
m_mainUi->expirePresets->setMenu(createPresetsMenu());
|
m_mainUi->expirePresets->setMenu(createPresetsMenu());
|
||||||
connect(m_mainUi->expirePresets->menu(), SIGNAL(triggered(QAction*)), this, SLOT(useExpiryPreset(QAction*)));
|
connect(m_mainUi->expirePresets->menu(), SIGNAL(triggered(QAction*)), this, SLOT(useExpiryPreset(QAction*)));
|
||||||
|
|
||||||
|
m_mainUi->passwordGenerator->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditEntryWidget::setupAdvanced()
|
void EditEntryWidget::setupAdvanced()
|
||||||
@ -276,6 +279,7 @@ void EditEntryWidget::setForms(const Entry* entry, bool restore)
|
|||||||
m_mainUi->expireCheck->setEnabled(!m_history);
|
m_mainUi->expireCheck->setEnabled(!m_history);
|
||||||
m_mainUi->expireDatePicker->setReadOnly(m_history);
|
m_mainUi->expireDatePicker->setReadOnly(m_history);
|
||||||
m_mainUi->notesEdit->setReadOnly(m_history);
|
m_mainUi->notesEdit->setReadOnly(m_history);
|
||||||
|
m_mainUi->tooglePasswordGeneratorButton->setChecked(false);
|
||||||
m_advancedUi->addAttachmentButton->setEnabled(!m_history);
|
m_advancedUi->addAttachmentButton->setEnabled(!m_history);
|
||||||
m_advancedUi->removeAttachmentButton->setEnabled(!m_history);
|
m_advancedUi->removeAttachmentButton->setEnabled(!m_history);
|
||||||
m_advancedUi->addAttributeButton->setEnabled(!m_history);
|
m_advancedUi->addAttributeButton->setEnabled(!m_history);
|
||||||
@ -478,6 +482,11 @@ void EditEntryWidget::togglePassword(bool checked)
|
|||||||
m_mainUi->passwordRepeatEdit->setEchoMode(checked ? QLineEdit::Password : QLineEdit::Normal);
|
m_mainUi->passwordRepeatEdit->setEchoMode(checked ? QLineEdit::Password : QLineEdit::Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditEntryWidget::togglePasswordGeneratorButton(bool checked)
|
||||||
|
{
|
||||||
|
m_mainUi->passwordGenerator->setVisible(checked);
|
||||||
|
}
|
||||||
|
|
||||||
bool EditEntryWidget::passwordsEqual()
|
bool EditEntryWidget::passwordsEqual()
|
||||||
{
|
{
|
||||||
return m_mainUi->passwordEdit->text() == m_mainUi->passwordRepeatEdit->text();
|
return m_mainUi->passwordEdit->text() == m_mainUi->passwordRepeatEdit->text();
|
||||||
|
@ -63,6 +63,7 @@ public:
|
|||||||
|
|
||||||
void createPresetsMenu(QMenu* expirePresetsMenu);
|
void createPresetsMenu(QMenu* expirePresetsMenu);
|
||||||
QString entryTitle() const;
|
QString entryTitle() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void editFinished(bool accepted);
|
void editFinished(bool accepted);
|
||||||
void historyEntryActivated(Entry* entry);
|
void historyEntryActivated(Entry* entry);
|
||||||
@ -71,6 +72,7 @@ private Q_SLOTS:
|
|||||||
void saveEntry();
|
void saveEntry();
|
||||||
void cancel();
|
void cancel();
|
||||||
void togglePassword(bool checked);
|
void togglePassword(bool checked);
|
||||||
|
void togglePasswordGeneratorButton(bool checked);
|
||||||
void setPasswordCheckColors();
|
void setPasswordCheckColors();
|
||||||
void insertAttribute();
|
void insertAttribute();
|
||||||
void editCurrentAttribute();
|
void editCurrentAttribute();
|
||||||
|
@ -75,28 +75,45 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="passwordRepeatLabel">
|
<widget class="QLabel" name="passwordRepeatLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Repeat:</string>
|
<string>Repeat:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="5" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
<widget class="QLineEdit" name="passwordRepeatEdit">
|
<widget class="QLineEdit" name="passwordRepeatEdit">
|
||||||
<property name="echoMode">
|
<property name="echoMode">
|
||||||
<enum>QLineEdit::Password</enum>
|
<enum>QLineEdit::Password</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item>
|
||||||
|
<widget class="QToolButton" name="tooglePasswordGeneratorButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Gen.</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<widget class="PasswordGeneratorWidget" name="passwordGenerator" native="true"/>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
<widget class="QCheckBox" name="expireCheck">
|
<widget class="QCheckBox" name="expireCheck">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Expires</string>
|
<string>Expires</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="7" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDateTimeEdit" name="expireDatePicker">
|
<widget class="QDateTimeEdit" name="expireDatePicker">
|
||||||
@ -117,14 +134,14 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QLabel" name="notesLabel">
|
<widget class="QLabel" name="notesLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Notes:</string>
|
<string>Notes:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="8" column="1">
|
||||||
<widget class="QPlainTextEdit" name="notesEdit">
|
<widget class="QPlainTextEdit" name="notesEdit">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
@ -136,6 +153,14 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>PasswordGeneratorWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>gui/PasswordGeneratorWidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>titleEdit</tabstop>
|
<tabstop>titleEdit</tabstop>
|
||||||
<tabstop>usernameEdit</tabstop>
|
<tabstop>usernameEdit</tabstop>
|
||||||
@ -143,9 +168,11 @@
|
|||||||
<tabstop>passwordEdit</tabstop>
|
<tabstop>passwordEdit</tabstop>
|
||||||
<tabstop>passwordRepeatEdit</tabstop>
|
<tabstop>passwordRepeatEdit</tabstop>
|
||||||
<tabstop>togglePasswordButton</tabstop>
|
<tabstop>togglePasswordButton</tabstop>
|
||||||
|
<tabstop>tooglePasswordGeneratorButton</tabstop>
|
||||||
<tabstop>expireCheck</tabstop>
|
<tabstop>expireCheck</tabstop>
|
||||||
<tabstop>expireDatePicker</tabstop>
|
<tabstop>expireDatePicker</tabstop>
|
||||||
<tabstop>expirePresets</tabstop>
|
<tabstop>expirePresets</tabstop>
|
||||||
|
<tabstop>notesEdit</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user