2 Copyright (C) <2010> <Markus Scharnowski markus.scharnowski@gmail.com>
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 3 of the License, or
7 (at your option) any later version.
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.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include <QPushButton>
19 #include <QHBoxLayout>
22 #include "aboutdialog.hpp"
24 AboutDialog::AboutDialog(QString name, QString customUrl, QWidget *parent) :
27 browserGeneral = new QTextBrowser;
28 browserGeneral->setOpenExternalLinks(true);
29 browserDonate = new QTextBrowser;
30 browserDonate->setOpenExternalLinks(true);
31 browserWebsite = new QTextBrowser;
32 browserWebsite->setOpenExternalLinks(true);
33 browserFeedback = new QTextBrowser;
34 browserFeedback->setOpenExternalLinks(true);
36 tabs = new QTabWidget;
37 tabs->insertTab(1,browserGeneral,tr("&General"));
38 tabs->insertTab(2,browserDonate,tr("&Donate"));
39 tabs->insertTab(3,browserWebsite,tr("&Website"));
40 tabs->insertTab(4,browserFeedback,tr("&Feedback"));
42 QHBoxLayout *layout = new QHBoxLayout();
43 layout->addWidget(tabs);
48 // setMinimumHeight(400);
51 setProgramUrl(customUrl);
55 setFeedbackHtmlText();
59 AboutDialog::~AboutDialog()
63 int AboutDialog::setProgramName(QString name)
67 QString wTitle = "About " + name;
68 setWindowTitle(tr(wTitle.toStdString().c_str()));
70 refreshDefaultTexts();
74 int AboutDialog::setProgramUrl(QString url)
77 refreshDefaultTexts();
81 int AboutDialog::setGeneralHtmlText(QString htmlText)
86 "<p>" + programName + "</p>"
87 "<p>Idea and programming: <a href=\"mailto:markus.scharnowski@gmail.com?subject=Thank you for " + programName +
88 "&body=Hello Markus,\">Markus Scharnowski</a></p>"
93 textGeneral = htmlText;
96 browserGeneral->setText(tr(textGeneral.toStdString().c_str()));
100 int AboutDialog::setDonateHtmlText(QString htmlText)
105 "You like what you have in your hands? You use it on regular basis? Support the devolpment by making a donation."
107 "<a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TPX9PV29D4L9Y\">paypal</a></p>"
108 "<p>Visit the projects <a href=\"https://sites.google.com/site/markusscharnowski/donate\">donation website</a></p>"
113 textDonate = htmlText;
116 browserDonate->setText(tr(textDonate.toStdString().c_str()));
120 int AboutDialog::setWebsiteHtmlText(QString htmlText)
127 "<a href=\""+ programUrl + "\">" + programUrl + "</a><br>"
128 "<a href=\"http://sites.google.com/site/markusscharnowski\">http://sites.google.com/site/markusscharnowski</a>"
134 textWebsite = htmlText;
137 browserWebsite->setText(tr(textWebsite.toStdString().c_str()));
141 int AboutDialog::setFeedbackHtmlText(QString htmlText)
146 "<p>Do you have ideas for improving the program? You want a specific functionality? "
148 "You have found a bug?</p>"
149 "<p>Email <a href=\"mailto:markus.scharnowski@gmail.com?subject=SW Feedback " + programName +
150 " &body=Hello Markus,\">Feedback</a></p>"
155 textFeedback = htmlText;
158 browserFeedback->setText(tr(textFeedback.toStdString().c_str()));
162 int AboutDialog::refreshDefaultTexts()
164 setGeneralHtmlText("");
165 setWebsiteHtmlText("");
166 setDonateHtmlText("");
167 setFeedbackHtmlText("");