File indexing completed on 2025-01-05 04:55:46
0001 /* 0002 SPDX-FileCopyrightText: 2015-2021 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "kleo_export.h" 0010 0011 #include <QDialog> 0012 0013 #ifdef HAVE_PIMTEXTEDIT 0014 #include <TextCustomEditor/RichTextEditorWidget> 0015 #else 0016 0017 class QTextEdit; 0018 #endif // HAVE_PIMTEXTEDIT 0019 0020 namespace Kleo 0021 { 0022 class AuditLogEntry; 0023 0024 class KLEO_EXPORT AuditLogViewer : public QDialog 0025 { 0026 Q_OBJECT 0027 public: 0028 explicit AuditLogViewer(const QString &log, QWidget *parent = nullptr); 0029 0030 ~AuditLogViewer() override; 0031 0032 static void showAuditLog(QWidget *parent, const AuditLogEntry &auditLog, const QString &title = {}); 0033 0034 void setAuditLog(const QString &log); 0035 0036 private Q_SLOTS: 0037 void slotSaveAs(); 0038 void slotCopyClip(); 0039 0040 private: 0041 void writeConfig(); 0042 void readConfig(); 0043 0044 QString m_log; 0045 #ifdef HAVE_PIMTEXTEDIT 0046 TextCustomEditor::RichTextEditorWidget *m_textEdit = nullptr; 0047 #else 0048 QTextEdit *m_textEdit = nullptr; 0049 #endif 0050 }; 0051 0052 }