-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDlgAbout.h
133 lines (108 loc) · 3.46 KB
/
DlgAbout.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
Copyright (c) Kang Lin studio, All Rights Reserved
Author:
Kang Lin <[email protected]>
Module Name:
DlgAbout.h
Abstract:
About dialog
User must install the follow file to install root:
ChangeLog: ChangeLog.md or ChangeLog[_locale].md
License: License.md or License[_locale].md
Authors: Authors.md or Authors[_locale].md
locale is the language used. eg:
Chines language: ChangeLog_zh_CN.md
English language: ChangeLog_en.md
*/
#ifndef RABBITCOMMON_DLGABOUT_H
#define RABBITCOMMON_DLGABOUT_H
#include <QDialog>
#include "rabbitcommon_export.h"
namespace Ui {
class CDlgAbout;
}
namespace RabbitCommon {
class CDownload;
}
/*!
* \~chinese
* \brief 关于对话框
* \details
* 用户必须安装下列文件到 ${CMAKE_INSTALL_DOCDIR}
* \li ChangeLog: ChangeLog.md or ChangeLog[_locale].md
* \li License: License.md or License[_locale].md
* \li Authors: Authors.md or Authors[_locale].md
*
* locale 是使用的语言。例如:
* \li 中文: ChangeLog_zh_CN.md
* \li 英文: ChangeLog_en.md
*
* \~english
* \brief About dialog
* \details User must install the follow file to ${CMAKE_INSTALL_DOCDIR}:
* \li ChangeLog: ChangeLog.md or ChangeLog[_locale].md
* \li License: License.md or License[_locale].md
* \li Authors: Authors.md or Authors[_locale].md
*
* locale is the language used. eg:
* \li Chines language: ChangeLog_zh_CN.md
* \li English language: ChangeLog_en.md
* \~
* \see
* - [GNU installation Directories in cmake](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#module:GNUInstallDirs)
* - [GNU installation Directories](https://www.gnu.org/prep/standards/html_node/Directory-Variables.html)
*
* \ingroup API
*/
class RABBITCOMMON_EXPORT CDlgAbout : public QDialog
{
Q_OBJECT
public:
explicit CDlgAbout(QWidget *parent = nullptr);
virtual ~CDlgAbout() override;
public:
QString m_szAppName;
QImage m_AppIcon;
//! The application version, it is different RabbitCommon::CTools::Version()
QString m_szVersion;
QString m_szVersionRevision;
QString m_szVersionRevisionUrl;
QString m_szArch;
QString m_szBuildTime;
QString m_szDetails; // The applaction's information append to details dialog
QString m_szAuthor;
QString m_szEmail;
QString m_szHomePage;
QString m_szCopyright;
QImage m_CopyrightIcon;
QString m_szCopyrightTime;
QString m_szCopyrightStartTime;
QString m_szCopyrightOwner;
int SetDonationIcon(const QImage& img);
#if defined(Q_OS_ANDROID)
protected:
virtual bool eventFilter(QObject *watched, QEvent *event) override;
#endif
protected Q_SLOTS:
void on_pbOK_clicked();
void on_pbDetails_clicked();
void slotDonation(const QPoint &pos);
void slotSaveDonation();
void slotDownloadError(int nErr, const QString szError);
void slotDownloadFileFinished(const QString szFile);
private:
Ui::CDlgAbout *ui;
QImage m_DonationIcon;
QSharedPointer<RabbitCommon::CDownload> m_Download;
QString BuildTime();
QString Version();
QWidget* m_pLicense;
QWidget* m_pChangeLog;
QWidget* m_pThanks;
int AppendFile(QWidget *pWidget, const QString &szFile, const QString &szTitle);
static QString MarkDownToHtml(const QString &szText);
friend class CInformation;
protected:
virtual void showEvent(QShowEvent *event) override;
};
#endif // RABBITCOMMON_DLGABOUT_H