1
/***************************************************************************
2
* Copyright (C) 2006-2008 by Thomas Schweitzer *
3
* thomas-schweitzer(at)arcor.de *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License version 2.0 as *
7
* published by the Free Software Foundation. *
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 in the file LICENSE.GPL; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18
***************************************************************************/
20
#include "aboutdialog.h"
24
\brief Displays a dialog window with information about UniversalIndentGUI
28
\brief The constructor calls the setup function for the ui created by uic and adds
29
the GPL text to the text edit.
31
AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags, QString version, QString revision, QString buildDate) : QDialog(parent, flags) {
32
this->parent = parent;
33
qApp->setStyleSheet("QTextBrowser{background-color:transparent}");
35
creditsTextBrowser->setStyleSheet("QTextBrowser#creditsTextBrowser{background-color:white}");
37
authorTextBrowser->setOpenExternalLinks( true );
38
creditsTextBrowser->setOpenExternalLinks( true );
40
this->version = version;
41
this->revision = revision;
42
this->buildDate = buildDate;
43
QString versionString = versionTextBrowser->toHtml();
44
versionString = versionString.arg(version).arg(revision).arg(buildDate);
45
versionTextBrowser->setHtml(versionString);
47
creditsTextBrowser->setHtml("<html><head></head><body>"
49
"<h3 align='center'>Thanks go out to</h3>"
50
"<p align='center'><a href=\"http://www.csie.nctu.edu.tw/~chtai/\"><b>Nelson Tai</b></a> for Chinese translation, good ideas and always fast answers.</p></br>"
51
"<p align='center'><a href=\"http://www.hartwork.org/\"><b>Sebastian Pipping</b></a> for helping me bring UiGUI into the Debian repository and other good ideas.</p></br>"
52
"<p align='center'><a href=\"http://korytskyy.lviv.ua/\"><b>Oleksandr</b></a> for Ukrainian and Russian translation.</p></br>"
53
"<p align='center'><b>Erwan "leg"</b> for French translation and the new icon logo.</p></br>"
54
"<p align='center'>The <a href=\"http://www.scintilla.org/\"><b>Scintilla</b></a> project for their great text editing component.</p></br>"
55
"<p align='center'><a href=\"http://www.riverbankcomputing.co.uk/software/qscintilla/\"><b>Riverbank</b></a> for their Scintlla Qt wrapper QScintilla.</p></br>"
56
"<p align='center'>The <a href=\"http://astyle.sourceforge.net/\"><b>Artistic Style</b></a> project.</p></br>"
57
"<p align='center'>The <a href=\"http://invisible-island.net/bcpp/\"><b>BCPP</b></a> project.</p></br>"
58
"<p align='center'>The <a href=\"http://www.siber.com/sct/tools/cbl-beau.html\"><b>Cobol Beautifier</b></a> project.</p></br>"
59
"<p align='center'>The <a href=\"http://csstidy.sourceforge.net/\"><b>CSSTidy</b></a> project.</p></br>"
60
"<p align='center'>The <a href=\"http://www.gnu.org/software/indent/\"><b>GNU Indent</b></a> project.</p></br>"
61
"<p align='center'>The <a href=\"http://sourceforge.net/projects/gcgreatcode/\"><b>GreatCode</b></a> project.</p></br>"
62
"<p align='center'>The <a href=\"http://linux.com.hk/penguin/man/1/hindent.html\"><b>hindent</b></a> project.</p></br>"
63
"<p align='center'>The <a href=\"http://www.digital-mines.com/htb/\"><b>HTB</b></a> project.</p></br>"
64
"<p align='center'>The <a href=\"http://tidy.sourceforge.net/\"><b>HTML Tidy</b></a> project.</p></br>"
65
"<p align='center'>The <a href=\"http://code.gosu.pl/\"><b>JsDecoder</b></a> project.</p></br>"
66
"<p align='center'>The <a href=\"http://jsppp.sourceforge.net/\"><b>JSPPP</b></a> project.</p></br>"
67
"<p align='center'>The <a href=\"http://perltidy.sourceforge.net/\"><b>Perltidy</b></a> project.</p></br>"
68
"<p align='center'>The <a href=\"http://beautifyphp.sourceforge.net/\"><b>PHP_Beautifier</b></a> project.</p></br>"
69
"<p align='center'>The <a href=\"http://www.waterproof.fr/products/phpCodeBeautifier/\"><b>phpCB</b></a> project.</p></br>"
70
"<p align='center'>The <a href=\"http://sourceforge.net/projects/phpstylist/\"><b>PHP Stylist</b></a> project.</p></br>"
71
"<p align='center'>The <a href=\"http://www.arachnoid.com/ruby/rubyBeautifier.html\"><b>Ruby Beautifier</b></a> project.</p></br>"
72
"<p align='center'>The <a href=\"http://raa.ruby-lang.org/project/ruby_formatter/\"><b>Ruby Formatter</b></a> project.</p></br>"
73
"<p align='center'>The <a href=\"http://www.bolthole.com/AWK.html\"><b>Shell Indent</b></a> project.</p></br>"
74
"<p align='center'>The <a href=\"http://uncrustify.sourceforge.net/\"><b>Uncrustify</b></a> project, specially <b>Ben Gardner</b>.</p></br>"
75
"<p align='center'>The <a href=\"http://xmlindent.sourceforge.net/\"><b>XML Indent</b></a> project.</p></br>"
76
"<p align='center'><b>Nirvash</b> for the initial Japanese translation.</p></br>"
77
"<p align='center'>The <a href=\"http://tango.freedesktop.org/Tango_Desktop_Project/\"><b>Tango Project</b></a> for their icons.</p></br>"
78
"<p align='center'><a href=\"http://www.famfamfam.com/\"><b>famfamfam</b></a> for the flag icons.</p></br>"
79
"<p align='center'><a href=\"http://trolltech.com/\"><b>Trolltech</b></a> for their really great GUI framework <img src=\":/aboutDialog/qt_logo.png\"/>.</p></br>"
80
"<h3 align='center'>My girlfriend (meanwhile also wife) for putting my head right and not sit all the time in front of my computer ;-)</h3>"
85
timer = new QTimer(this);
86
connect( timer, SIGNAL(timeout()), this, SLOT(scroll()) );
87
connect( this, SIGNAL(accepted()), timer, SLOT(stop()) );
92
\brief Catches language change events and retranslates all needed widgets.
94
void AboutDialog::changeEvent(QEvent *event) {
95
if (event->type() == QEvent::LanguageChange) {
98
QString versionString = versionTextBrowser->toHtml();
99
versionString = versionString.arg(version).arg(revision).arg(buildDate);
100
versionTextBrowser->setHtml(versionString);
103
QWidget::changeEvent(event);
109
\brief Reimplements the dialog execution function to init the credits scroller.
111
int AboutDialog::exec() {
112
//creditsTextBrowser->verticalScrollBar()->setValue(0);
113
timer->start(scrollSpeed);
114
return QDialog::exec();
119
\brief This slot is called each timer timeout to scroll the credits textbrowser.
120
Also changes the scroll direction and speed when reaching the start or end.
122
void AboutDialog::scroll() {
123
QScrollBar *scrollBar = creditsTextBrowser->verticalScrollBar();
124
scrollBar->setValue( scrollBar->value()+scrollDirection );
126
if ( scrollBar->value() == scrollBar->maximum() ) {
127
// Toggle scroll direction and change scroll speed;
128
scrollDirection = -1;
131
timer->start(scrollSpeed);
133
else if ( scrollBar->value() == scrollBar->minimum() ) {
134
// Toggle scroll direction and change scroll speed;
138
timer->start(scrollSpeed);
141
creditsTextBrowser->update();
146
\brief Shows the about dialog and also starts the credits scroller.
148
void AboutDialog::show() {
149
timer->start(scrollSpeed);