Debian Codegraph @

src/gui/aboutDialog/AuthorTab.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 2023 Damir Porobic <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #include "AuthorTab.h"
21
22 AuthorTab::AuthorTab()
23 {
24 mLayout = new QVBoxLayout();
25 mContent = new QLabel();
26 mContent->setText(
27 QLatin1String("<b>") + tr("The Authors:") + QLatin1String("</b><br>") +
28 QLatin1String("Damir Porobic ") + createEmailEntry(QLatin1String("[email protected]")) + QLatin1String("<br>") +
29 QLatin1String("Stefan Comanescu") + createEmailEntry(QLatin1String("[email protected]")) + QLatin1String("<br><br>") +
30 QLatin1String("<b>") + tr("Contributors:") + QLatin1String("</b><br>") +
31 createContributorEntry(QLatin1String("Galileo Sartor"), tr("Snap & Flatpak Support")) +
32 createContributorEntry(QLatin1String("Luis Vásquez"), tr("Spanish Translation"), QLatin1String("[email protected]")) +
33 createContributorEntry(QLatin1String("Heimen Stoffels"), tr("Dutch Translation"), QLatin1String("[email protected]")) +
34 createContributorEntry(QLatin1String("Yury Martynov"), tr("Russian Translation"), QLatin1String("[email protected]")) +
35 createContributorEntry(QLatin1String("Allan Nordhøy"), tr("Norwegian Bokmål Translation"), QLatin1String("[email protected]")) +
36 createContributorEntry(QLatin1String("4goodapp"), tr("French Translation")) +
37 createContributorEntry(QLatin1String("epsiloneridani"), tr("Polish Translation")) +
38 createContributorEntry(QLatin1String("YAMADA Shinichirou, maboroshin"), tr("Japanese Translation")) +
39 createContributorEntry(QLatin1String("Milo Ivir, milotype"), tr("Croatian Translation"), QLatin1String("[email protected]"))
40 );
41 mContent->setTextFormat(Qt::RichText);
42 mContent->setTextInteractionFlags(Qt::TextBrowserInteraction);
43 mContent->setOpenExternalLinks(true);
44
45 mLayout->addWidget(mContent);
46
47 setLayout(mLayout);
48 }
49
50 AuthorTab::~AuthorTab()
51 {
52 delete mLayout;
53 delete mContent;
54 }
55
56 QString AuthorTab::createContributorEntry(const QString &name, const QString &role, const QString &email) const
57 {
58 auto baseEntry = name + QLatin1String(" - ") + role;
59 if(!email.isEmpty()) {
60 baseEntry += QLatin1String(" ") + createEmailEntry(email);
61 }
62 return baseEntry + QLatin1String("<br>");
63 }
64
65 QString AuthorTab::createEmailEntry(const QString &email)
66 {
67 return QLatin1String("(<a href=\"mailto:") + email + QLatin1String(R"(" target="_top">Email</a>))");
68 }