2017-08-17 21:02:21 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
|
|
|
|
*
|
|
|
|
* 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_DETAILSWIDGET_H
|
|
|
|
#define KEEPASSX_DETAILSWIDGET_H
|
|
|
|
|
2018-10-01 10:26:24 -04:00
|
|
|
#include "config-keepassx.h"
|
2017-08-17 21:02:21 +02:00
|
|
|
#include "gui/DatabaseWidget.h"
|
2017-12-25 15:53:22 +02:00
|
|
|
|
2018-03-31 16:01:30 -04:00
|
|
|
namespace Ui
|
|
|
|
{
|
2018-10-08 18:11:44 -07:00
|
|
|
class EntryPreviewWidget;
|
2017-08-17 21:02:21 +02:00
|
|
|
}
|
|
|
|
|
2023-08-27 21:54:53 -04:00
|
|
|
class QTabWidget;
|
2019-11-09 12:16:05 -05:00
|
|
|
class QTextEdit;
|
|
|
|
|
2018-10-08 18:11:44 -07:00
|
|
|
class EntryPreviewWidget : public QWidget
|
2017-08-17 21:02:21 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-10-08 18:11:44 -07:00
|
|
|
explicit EntryPreviewWidget(QWidget* parent = nullptr);
|
|
|
|
~EntryPreviewWidget() override;
|
2017-08-17 21:02:21 +02:00
|
|
|
|
2017-12-25 15:53:22 +02:00
|
|
|
public slots:
|
|
|
|
void setEntry(Entry* selectedEntry);
|
|
|
|
void setGroup(Group* selectedGroup);
|
|
|
|
void setDatabaseMode(DatabaseWidget::Mode mode);
|
2022-09-07 19:25:23 -04:00
|
|
|
void refresh();
|
2021-06-08 19:54:36 +02:00
|
|
|
void clear();
|
2017-09-27 19:18:13 +02:00
|
|
|
|
2017-12-13 22:22:31 +02:00
|
|
|
signals:
|
2019-05-18 10:55:57 -04:00
|
|
|
void entryUrlActivated(Entry* entry);
|
2024-05-25 09:13:43 -04:00
|
|
|
void copyTextRequested(const QString& text);
|
2017-12-13 22:22:31 +02:00
|
|
|
|
2023-07-19 21:27:53 -04:00
|
|
|
protected:
|
|
|
|
bool eventFilter(QObject* object, QEvent* event) override;
|
|
|
|
|
2017-08-17 21:02:21 +02:00
|
|
|
private slots:
|
2017-12-25 15:53:22 +02:00
|
|
|
void updateEntryHeaderLine();
|
|
|
|
void updateEntryTotp();
|
|
|
|
void updateEntryGeneralTab();
|
2019-06-23 15:02:02 +01:00
|
|
|
void updateEntryAdvancedTab();
|
2017-12-25 15:53:22 +02:00
|
|
|
void updateEntryAutotypeTab();
|
2022-10-18 19:00:12 -04:00
|
|
|
void setUsernameVisible(bool state);
|
2018-11-16 10:00:59 -05:00
|
|
|
void setPasswordVisible(bool state);
|
2019-06-29 02:48:25 +01:00
|
|
|
void setEntryNotesVisible(bool state);
|
|
|
|
void setGroupNotesVisible(bool state);
|
2019-11-09 12:16:05 -05:00
|
|
|
void setNotesVisible(QTextEdit* notesWidget, const QString& notes, bool state);
|
2017-12-25 15:53:22 +02:00
|
|
|
|
|
|
|
void updateGroupHeaderLine();
|
|
|
|
void updateGroupGeneralTab();
|
2019-01-03 08:46:32 +01:00
|
|
|
#if defined(WITH_XC_KEESHARE)
|
2018-10-01 10:26:24 -04:00
|
|
|
void updateGroupSharingTab();
|
|
|
|
#endif
|
2017-12-25 15:53:22 +02:00
|
|
|
|
|
|
|
void updateTotpLabel();
|
|
|
|
void updateTabIndexes();
|
2019-05-18 10:55:57 -04:00
|
|
|
void openEntryUrl();
|
2017-08-17 21:02:21 +02:00
|
|
|
|
|
|
|
private:
|
2019-10-22 17:47:43 +02:00
|
|
|
void removeTab(QTabWidget* tabWidget, QWidget* widget);
|
2017-12-29 10:46:16 +02:00
|
|
|
void setTabEnabled(QTabWidget* tabWidget, QWidget* widget, bool enabled);
|
|
|
|
|
2017-12-25 15:53:22 +02:00
|
|
|
static QString hierarchy(const Group* group, const QString& title);
|
|
|
|
|
2018-10-08 18:11:44 -07:00
|
|
|
const QScopedPointer<Ui::EntryPreviewWidget> m_ui;
|
2017-09-27 19:18:13 +02:00
|
|
|
bool m_locked;
|
2020-01-10 22:28:31 -05:00
|
|
|
QPointer<Entry> m_currentEntry;
|
|
|
|
QPointer<Group> m_currentGroup;
|
2018-09-05 16:20:57 -04:00
|
|
|
QTimer m_totpTimer;
|
2017-09-29 22:02:07 +02:00
|
|
|
quint8 m_selectedTabEntry;
|
|
|
|
quint8 m_selectedTabGroup;
|
2017-08-17 21:02:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KEEPASSX_DETAILSWIDGET_H
|