1
/***************************************************************************
2
* Copyright (C) 2006-2009 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"
22
#include "UiGuiVersion.h"
26
\brief Displays a dialog window with information about UniversalIndentGUI
30
\brief The constructor calls the setup function for the ui created by uic and adds
31
the GPL text to the text edit.
33
AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags) {
34
this->parent = parent;
35
qApp->setStyleSheet("QTextBrowser{background-color:transparent}");
37
creditsTextBrowser->setStyleSheet("QTextBrowser#creditsTextBrowser{background-color:white}");
39
authorTextBrowser->setOpenExternalLinks( true );
40
creditsTextBrowser->setOpenExternalLinks( true );
42
QString versionString = versionTextBrowser->toHtml();
43
versionString = versionString.arg(PROGRAM_VERSION_STRING).arg( UiGuiVersion::getBuildRevision() ).arg( UiGuiVersion::getBuildDate() );
44
versionTextBrowser->setHtml(versionString);
46
creditsTextBrowser->setHtml("<html><head></head><body>"
48
"<h3 align='center'>Thanks go out to</h3>"
49
"<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>"
50
"<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>"
51
"<p align='center'><a href=\"http://korytskyy.lviv.ua/\"><b>Oleksandr</b></a> for Ukrainian and Russian translation.</p></br>"
52
"<p align='center'><b>Erwan "leg"</b> for French translation and the new icon logo.</p></br>"
53
"<p align='center'>The <a href=\"http://www.scintilla.org/\"><b>Scintilla</b></a> project for their great text editing component.</p></br>"
54
"<p align='center'><a href=\"http://www.riverbankcomputing.co.uk/software/qscintilla/\"><b>Riverbank</b></a> for their Scintlla Qt wrapper QScintilla.</p></br>"
55
"<p align='center'>The <a href=\"http://astyle.sourceforge.net/\"><b>Artistic Style</b></a> project.</p></br>"
56
"<p align='center'>The <a href=\"http://invisible-island.net/bcpp/\"><b>BCPP</b></a> project.</p></br>"
57
"<p align='center'>The <a href=\"http://www.siber.com/sct/tools/cbl-beau.html\"><b>Cobol Beautifier</b></a> project.</p></br>"
58
"<p align='center'>The <a href=\"http://csstidy.sourceforge.net/\"><b>CSSTidy</b></a> project.</p></br>"
59
"<p align='center'>The <a href=\"ftp://ftp.ifremer.fr/ifremer/ditigo/fortran90/\"><b>Fortran 90 PPR</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://coverage.livinglogic.de/Tools/scripts/pindent.py.html\"><b>pindent</b></a> project.</p></br>"
72
"<p align='center'>The <a href=\"http://www.arachnoid.com/ruby/rubyBeautifier.html\"><b>Ruby Beautifier</b></a> project.</p></br>"
73
"<p align='center'>The <a href=\"http://raa.ruby-lang.org/project/ruby_formatter/\"><b>Ruby Formatter</b></a> project.</p></br>"
74
"<p align='center'>The <a href=\"http://www.bolthole.com/AWK.html\"><b>Shell Indent</b></a> project.</p></br>"
75
"<p align='center'>The <a href=\"http://uncrustify.sourceforge.net/\"><b>Uncrustify</b></a> project, specially <b>Ben Gardner</b>.</p></br>"
76
"<p align='center'>The <a href=\"http://xmlindent.sourceforge.net/\"><b>XML Indent</b></a> project.</p></br>"
77
"<p align='center'><b>Nirvash</b> for the initial Japanese translation.</p></br>"
78
"<p align='center'>The <a href=\"http://tango.freedesktop.org/Tango_Desktop_Project/\"><b>Tango Project</b></a> for their icons.</p></br>"
79
"<p align='center'><a href=\"http://www.famfamfam.com/\"><b>famfamfam</b></a> for the flag icons.</p></br>"
80
"<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>"
81
"<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>"
86
timer = new QTimer(this);
87
connect( timer, SIGNAL(timeout()), this, SLOT(scroll()) );
88
connect( this, SIGNAL(accepted()), timer, SLOT(stop()) );
93
\brief Catches language change events and retranslates all needed widgets.
95
void AboutDialog::changeEvent(QEvent *event) {
96
if (event->type() == QEvent::LanguageChange) {
99
QString versionString = versionTextBrowser->toHtml();
100
versionString = versionString.arg(PROGRAM_VERSION_STRING).arg( UiGuiVersion::getBuildRevision() ).arg( UiGuiVersion::getBuildDate() );
101
versionTextBrowser->setHtml(versionString);
104
QWidget::changeEvent(event);
110
\brief Reimplements the dialog execution function to init the credits scroller.
112
int AboutDialog::exec() {
113
//creditsTextBrowser->verticalScrollBar()->setValue(0);
114
timer->start(scrollSpeed);
115
return QDialog::exec();
120
\brief This slot is called each timer timeout to scroll the credits textbrowser.
121
Also changes the scroll direction and speed when reaching the start or end.
123
void AboutDialog::scroll() {
124
QScrollBar *scrollBar = creditsTextBrowser->verticalScrollBar();
125
scrollBar->setValue( scrollBar->value()+scrollDirection );
127
if ( scrollBar->value() == scrollBar->maximum() ) {
128
// Toggle scroll direction and change scroll speed;
129
scrollDirection = -1;
132
timer->start(scrollSpeed);
134
else if ( scrollBar->value() == scrollBar->minimum() ) {
135
// Toggle scroll direction and change scroll speed;
139
timer->start(scrollSpeed);
142
creditsTextBrowser->update();
147
\brief Shows the about dialog and also starts the credits scroller.
149
void AboutDialog::show() {
150
timer->start(scrollSpeed);