1 
2 /***************************************************************************
3                           aboutdialog.cpp  -  description
4                              -------------------
5     begin                : feb 2017
6     copyright            : (C) 2017 by Jaime Robles
7     email                : jaime@robles.es
8  ***************************************************************************/
9 
10 /*****************************************************************************
11  * This file is part of KLog.                                                *
12  *                                                                           *
13  *    KLog is free software: you can redistribute it and/or modify           *
14  *    it under the terms of the GNU General Public License as published by   *
15  *    the Free Software Foundation, either version 3 of the License, or      *
16  *    (at your option) any later version.                                    *
17  *                                                                           *
18  *    KLog is distributed in the hope that it will be useful,                *
19  *    but WITHOUT ANY WARRANTY; without even the implied warranty of         *
20  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
21  *    GNU General Public License for more details.                           *
22  *                                                                           *
23  *    You should have received a copy of the GNU General Public License      *
24  *    along with KLog.  If not, see <https://www.gnu.org/licenses/>.         *
25  *                                                                           *
26  *****************************************************************************/
27 
28 #include "aboutdialog.h"
29 #include <QDialogButtonBox>
30 #include <QGridLayout>
31 #include <QKeyEvent>
32 #include <QLabel>
33 #include <QPushButton>
34 #include <QDebug>
35 
AboutDialog(const QString & tversion,QWidget * parent)36 AboutDialog::AboutDialog(const QString &tversion, QWidget *parent)
37     : QDialog(parent)
38 {
39       //qDebug() << "AboutDialog::AboutDialog" << QT_ENDL;
40 
41     QPixmap pixmap(":/img/klog_256x256.png");
42 
43 
44     setWindowTitle(tr("About KLog"));
45     setWindowFlags(windowFlags() & Qt::WindowContextHelpButtonHint);
46     QGridLayout *layout = new QGridLayout(this);
47     layout->setSizeConstraint(QLayout::SetFixedSize);
48 
49     const QString br = QLatin1String("<br/>");
50 
51     const QString description = "<center><h2>KLog " + tversion + "</h2><h4> " +tr("By") +
52             " <a href=\"https://www.qrz.com/db/ea4k\">EA4K</a> - 2002-2021</h4></center><br>" +
53             tr("KLog is a free logbook for hamradio operators.") +"<br><br><b>" +
54             tr("Please be aware that this is a development release and it may contain many bugs.<br>Backup your data before using this software!") +
55             "</b><br><br>" +
56             tr("Since 0.6.2, KLog has been fully rewritten to provide a cross-platform application that runs on all major operating systems (GNU/Linux, macOS and Windows) and to support new functionality.") +
57             "<br><br>" +
58             tr("Please provide your review in KLog's eHam review page:") +
59             "<bR>" +
60             "<a href=https://www.eham.net/reviews/detail/3118>https://www.eham.net/reviews/detail/3118</a><br><br>" +
61             tr("Find more information and the latest release at") + "<br><a href=https://www.klog.xyz>https://www.klog.xyz</a><br><br>" +
62             tr("Author") + ": <a href=https://jaime.robles.es/klog>Jaime Robles</a>, <a href=\"https://www.qrz.com/db/ea4k\">EA4K</a><br><a href=mailto:jaime@robles.es>jaime@robles.es</a>";
63 
64 
65     QLabel *copyRightLabel = new QLabel(description);
66     copyRightLabel->setWordWrap(true);
67     copyRightLabel->setOpenExternalLinks(true);
68     copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
69 
70     QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
71     QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
72 
73     buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
74     connect(buttonBox , &QDialogButtonBox::rejected, this, &QDialog::reject);
75 
76     QLabel *logoLabel = new QLabel;
77     logoLabel->setPixmap(pixmap);
78     QLabel *logoLabel2 = new QLabel;
79     logoLabel2->setPixmap(pixmap);
80     QLabel *logoLabel3 = new QLabel;
81     logoLabel3->setPixmap(pixmap);
82     QLabel *logoLabel4 = new QLabel;
83     logoLabel4->setPixmap(pixmap);
84 
85     QString author1 = QString("<tr><td>Jaime Robles</td>") + QString("<td><a href=\"https://www.qrz.com/db/ea4k\">EA4K</a></td>") + "<td>(2002-" + tr("today") +") " +tr("Main developer") + "</td></tr>";
86     QString author2 = QString("<tr><td>Juan Carlos Reig</td>")  + QString("<td><a href=\"https://www.qrz.com/db/ea5wa\">EA5WA</a></td>") + "<td>(2021-" + tr("today") + ")</td></tr>";
87     QString author3 = QString("<tr><td>Ladislav Foldyna</td>")  + QString("<td><a href=\"https://www.qrz.com/db/ok1mlg\">OK1MLG</a></td>") + "<td>(2021-" + tr("today") + ")</td></tr>";
88     QString author4 = QString("<tr><td>Akihiro Koda</td>")  + QString("<td><a href=\"https://www.qrz.com/db/jl3oxr\">JL3OXR</a></td>") + "<td>(2016-2017)</td></tr>";
89     QString author5 = QString("<tr><td>Andrew Goldie</td>") + QString("<td><a href=\"https://www.qrz.com/db/zl2agc\">ZL2ACG</a></td>") + "<td>(2009-2010)</td></tr>";
90 
91     QString authorText = tr("KLog is developed by a very small team and you are invited to join!") + "<br><br>" + tr("If you want to provide support you are welcome to join the <a href=\"https://groups.io/g/klog\">KLog mailing list</a>!") + "<br><br>" + tr("You can also help us by sending bug reports or small code contributions, ideas or whatever you think may improve KLog.");
92     QString authors = "<center><h2>" + tr("Authors") + "</h2></center><br>" + authorText + "<br><table>" + author1 + author2 + author3 + author4 + author5 + "</table>";
93 
94     QString translator1 = QString("<tr><td>Catalan</td>")  + QString("<td>Josep Ma. Ferrer</td>") + QString("<td><a href=\"mailto://kde-i18n-ca@kde.org\">KDE Catalan translation team</a></td></tr>");
95     QString translator2 = QString("<tr><td>Croatian</td>")  + QString("<td>Kristijan Conkas</td>") + QString("<td><a href=\"https://www.qrz.com/db/m0nkc\">M0NKC</a></td></tr>");
96     QString translator3 = QString("<tr><td>Czech</td>")  + QString("<td>Ladislav Foldyna</td>") + QString("<td><a href=\"https://www.qrz.com/db/ok1mlg\">OK1MLG</a></td></tr>");
97     QString translator4 = QString("<tr><td>Finnish</td>")  + QString("<td>Kristjan Lorents</td>") + QString("<td><a href=\"debian-i18n@lists.debian.org\">Finnish Debian translation team</a></td></tr>");
98     QString translator5 = QString("<tr><td>French</td>") + QString("<td>Christophe Lefebvre</td>") + QString("<td><a href=\"https://www.qrz.com/db/f4hwl\">F4HWL</a></td></tr>");
99     QString translator6 = QString("<tr><td>Danish</td>")  + QString("<td>Joe Hansen</td>") + QString("<td><a href=\"mailto://debian-l10n-danish@list.debian.org\">Danish Debian translation team</a></td></tr>");
100     QString translator7 = QString("<tr><td>German</td>") + QString("<td>Burhard Lück</td>") + QString("<td><a href=\"mailto://kde-i18n-de@kde.org\">KDE German translation team</a></td></tr>");
101     QString translator8 = QString("<tr><td>Italian</td>")  + QString("<td>Simona Pisano</td>") + QString("<td><a href=\"https://www.qrz.com/db/iu5hiu\">IU5HIU</a></td></tr>");
102     QString translator9 = QString("<tr><td>Japanese</td>")  + QString("<td>Akihiro Koda</td>") + QString("<td><a href=\"https://www.qrz.com/db/jl3oxr\">JL3OXR</a></td></tr>");
103     QString translator10 = QString("<tr><td>Polish</td>")  + QString("<td>Piotr Ludwig</td>") + QString("<td><a href=\"https://www.qrz.com/db/la7rra\">LA7RRA</a></td></tr>");
104     QString translator11 = QString("<tr><td>Spanish</td>") + QString("<td>Jaime Robles</td>") + QString("<td><a href=\"https://www.qrz.com/db/ea4k\">EA4K</a></td></tr>");
105 
106 
107     QString translatorsText = tr("Translators bring KLog into your language. They are really an important part of the KLog development team.") + "<br><br>" + tr("If KLog is still not in your language and you want to help us, you are welcome to contact us through the <a href=\"https://groups.io/g/klog\">KLog mailing list</a>!");
108     QString translators = "<center><h2>" + tr("Translators") + "</h2></center><br>" + translatorsText + "<br><table>" + translator1 + translator2 + translator3
109                                                                                                                       + translator4 + translator5 + translator6
110                                                                                                                       + translator7 + translator8 + translator9
111                                                                                                                       + translator10 + translator11 + "</table>";
112     QLabel *authorsLabel = new QLabel(authors);
113     authorsLabel->setWordWrap(true);
114     authorsLabel->setOpenExternalLinks(true);
115     authorsLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
116 
117     QLabel *translatorsLabel = new QLabel(translators);
118     translatorsLabel->setWordWrap(true);
119     translatorsLabel->setOpenExternalLinks(true);
120     translatorsLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
121 
122     QString privacy = "<center><h2>" + tr("Privacy advisory") + "</h2></h4></center><br>" +
123             tr("KLog developers have included a feature that reports some user data to the KLog server with the sole purpose of identifying the number of installed versions, to focus development in one direction or another taking into account users' needs.") +
124             "<br><br>" + tr("At present, the data that is provided is the following:") +
125             "<ul><li>" + tr("Callsign") + "</li><li>" + tr("KLog version") + "</li><li>" + tr("Operating system") + "</li></ul><br><br><b>" +
126             tr("Be aware that you can enable/disable this feature from the Misc tab in the Setup page.") + "</b>";
127 
128     QLabel *privacyLabel = new QLabel(privacy);
129     privacyLabel->setAlignment(Qt::AlignJustify);
130     privacyLabel->setWordWrap(true);
131     privacyLabel->setOpenExternalLinks(true);
132     privacyLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
133 
134     tab1 = new QWidget;
135     tab2 = new QWidget;
136     tab3 = new QWidget;
137     tab4 = new QWidget;
138 
139 
140     QGridLayout *layout1 = new QGridLayout;
141     layout1->addWidget(logoLabel , 0, 0, 1, 1);
142     layout1->addWidget(copyRightLabel, 0, 1, 4, 4);
143     tab1->setLayout(layout1);
144 
145 
146     QGridLayout *layout2 = new QGridLayout;
147     layout2->addWidget(logoLabel2 , 0, 0, 1, 1);
148     layout2->addWidget(authorsLabel, 0, 1, 4, 4);
149     tab2->setLayout(layout2);
150 
151 
152     QGridLayout *layout3 = new QGridLayout;
153     layout3->addWidget(logoLabel3 , 0, 0, 1, 1);
154     layout3->addWidget(translatorsLabel, 0, 1, 4, 4);
155     tab3->setLayout(layout3);
156 
157     QGridLayout *layout4 = new QGridLayout;
158     layout4->addWidget(logoLabel4 , 0, 0, 1, 1);
159     layout4->addWidget(privacyLabel, 0, 1, 4, 4);
160     tab4->setLayout(layout4);
161 
162     tabw = new QTabWidget;
163 
164     tabw->addTab(tab1, tr("KLog"));
165     tabw->addTab(tab2, tr("Authors"));
166     tabw->addTab(tab3, tr("Translators"));
167     tabw->addTab(tab4, tr("Privacy"));
168 
169     layout->addWidget(tabw);
170     layout->addWidget(buttonBox, 1, 0, Qt::AlignRight);
171 
172     setLayout(layout);
173 
174 
175        //qDebug() << "AboutDialog::AboutDialog - END" << QT_ENDL;
176 
177 }
~AboutDialog()178 AboutDialog::~AboutDialog()
179 {
180 
181 }
182 
event(QEvent * event)183 bool AboutDialog::event(QEvent *event)
184 {
185     if (event->type() == QEvent::ShortcutOverride) {
186         QKeyEvent *ke = static_cast<QKeyEvent *>(event);
187         if (ke->key() == Qt::Key_Escape && !ke->modifiers()) {
188             ke->accept();
189             return true;
190         }
191     }
192     return QDialog::event(event);
193 }
194 
195