2012-04-19 10:20:20 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 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_DATABASESETTINGSWIDGET_H
|
|
|
|
#define KEEPASSX_DATABASESETTINGSWIDGET_H
|
|
|
|
|
2018-03-31 16:01:30 -04:00
|
|
|
#include "gui/DialogyWidget.h"
|
2018-10-24 10:49:53 -04:00
|
|
|
#include "config-keepassx.h"
|
2012-04-19 10:20:20 -04:00
|
|
|
|
2018-05-13 17:21:43 -04:00
|
|
|
#include <QPointer>
|
2018-11-22 05:47:31 -05:00
|
|
|
#include <QScopedPointer>
|
|
|
|
#include <QSharedPointer>
|
2018-05-13 17:21:43 -04:00
|
|
|
|
2012-05-19 08:52:00 -04:00
|
|
|
class Database;
|
2018-05-13 17:21:43 -04:00
|
|
|
class DatabaseSettingsWidgetGeneral;
|
|
|
|
class DatabaseSettingsWidgetEncryption;
|
|
|
|
class DatabaseSettingsWidgetMasterKey;
|
2018-10-24 10:49:53 -04:00
|
|
|
#ifdef WITH_XC_BROWSER
|
|
|
|
class DatabaseSettingsWidgetBrowser;
|
|
|
|
#endif
|
2018-05-13 17:21:43 -04:00
|
|
|
class QTabWidget;
|
2012-04-19 10:20:20 -04:00
|
|
|
|
2017-12-17 08:49:46 -05:00
|
|
|
namespace Ui
|
|
|
|
{
|
2018-05-13 17:21:43 -04:00
|
|
|
class DatabaseSettingsDialog;
|
2012-04-19 10:20:20 -04:00
|
|
|
}
|
|
|
|
|
2018-05-13 17:21:43 -04:00
|
|
|
class DatabaseSettingsDialog : public DialogyWidget
|
2012-04-19 10:20:20 -04:00
|
|
|
{
|
2018-03-31 16:01:30 -04:00
|
|
|
Q_OBJECT
|
2012-04-19 10:20:20 -04:00
|
|
|
|
|
|
|
public:
|
2018-05-13 17:21:43 -04:00
|
|
|
explicit DatabaseSettingsDialog(QWidget* parent = nullptr);
|
|
|
|
~DatabaseSettingsDialog() override;
|
|
|
|
Q_DISABLE_COPY(DatabaseSettingsDialog);
|
2012-04-19 10:20:20 -04:00
|
|
|
|
2018-11-22 05:47:31 -05:00
|
|
|
void load(QSharedPointer<Database> db);
|
2018-05-13 17:21:43 -04:00
|
|
|
void showMasterKeySettings();
|
2012-04-19 10:20:20 -04:00
|
|
|
|
2017-03-10 09:58:42 -05:00
|
|
|
signals:
|
2012-04-19 10:20:20 -04:00
|
|
|
void editFinished(bool accepted);
|
|
|
|
|
2017-03-10 09:58:42 -05:00
|
|
|
private slots:
|
2012-05-19 08:52:00 -04:00
|
|
|
void save();
|
2012-04-19 10:20:20 -04:00
|
|
|
void reject();
|
2018-05-13 17:21:43 -04:00
|
|
|
void pageChanged();
|
|
|
|
void toggleAdvancedMode(bool advanced);
|
2012-04-19 10:20:20 -04:00
|
|
|
|
|
|
|
private:
|
2018-05-13 17:21:43 -04:00
|
|
|
enum Page
|
|
|
|
{
|
|
|
|
General = 0,
|
|
|
|
Security = 1
|
|
|
|
};
|
2012-06-06 13:59:10 -04:00
|
|
|
|
2018-11-22 05:47:31 -05:00
|
|
|
QSharedPointer<Database> m_db;
|
2018-05-13 17:21:43 -04:00
|
|
|
const QScopedPointer<Ui::DatabaseSettingsDialog> m_ui;
|
|
|
|
QPointer<DatabaseSettingsWidgetGeneral> m_generalWidget;
|
|
|
|
QPointer<QTabWidget> m_securityTabWidget;
|
|
|
|
QPointer<DatabaseSettingsWidgetMasterKey> m_masterKeyWidget;
|
|
|
|
QPointer<DatabaseSettingsWidgetEncryption> m_encryptionWidget;
|
2018-10-24 10:49:53 -04:00
|
|
|
#ifdef WITH_XC_BROWSER
|
|
|
|
QPointer<DatabaseSettingsWidgetBrowser> m_browserWidget;
|
|
|
|
#endif
|
2012-04-19 10:20:20 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KEEPASSX_DATABASESETTINGSWIDGET_H
|