changeset 638:94734b9eb54f

Renamed the source files and some classes to have consistent names. What a nice kind of work. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@897 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Tue, 11 Nov 2008 14:56:11 +0000
parents 67a46ff9cac2
children 635ebbce9a60
files UniversalIndentGUI.pro src/AboutDialog.cpp src/AboutDialog.h src/AboutDialog.ui src/AboutDialogGraphicsView.h src/IndentHandler.cpp src/IndentHandler.h src/MainWindow.cpp src/MainWindow.h src/MainWindow.ui src/TemplateBatchScript.cpp src/TemplateBatchScript.h src/ToolBarWidget.ui src/UiGuiErrorMessage.cpp src/UiGuiErrorMessage.h src/UiGuiHighlighter.cpp src/UiGuiHighlighter.h src/UiGuiIndentServer.cpp src/UiGuiIndentServer.h src/UiGuiIniFileParser.cpp src/UiGuiIniFileParser.h src/UiGuiSettings.cpp src/UiGuiSettings.h src/UiGuiSettingsDialog.cpp src/UiGuiSettingsDialog.h src/UiguiHighlighter.cpp src/UiguiHighlighter.h src/UiguiIndentServer.cpp src/UiguiIndentServer.h src/UniversalIndentGUI.vcproj src/UpdateCheckDialog.cpp src/UpdateCheckDialog.h src/aboutdialog.cpp src/aboutdialog.h src/aboutdialog.ui src/indenthandler.cpp src/indenthandler.h src/main.cpp src/mainwindow.cpp src/mainwindow.h src/mainwindow.ui src/templateBatchScript.cpp src/templateBatchScript.h src/toolBarWidget.ui src/uiguiIniFileParser.cpp src/uiguiIniFileParser.h src/uiguierrormessage.cpp src/uiguierrormessage.h src/uiguisettings.cpp src/uiguisettings.h src/uiguisettingsdialog.cpp src/uiguisettingsdialog.h src/updatecheckdialog.cpp src/updatecheckdialog.h
diffstat 54 files changed, 6803 insertions(+), 6806 deletions(-) [+]
line wrap: on
line diff
--- a/UniversalIndentGUI.pro	Tue Nov 11 12:51:02 2008 +0000
+++ b/UniversalIndentGUI.pro	Tue Nov 11 14:56:11 2008 +0000
@@ -164,39 +164,38 @@
 #message ( destdir is $${DESTDIR}. uic is $${UI_DIR}. moc is $${MOC_DIR})
 
 # Input
-HEADERS += src/aboutdialog.h \
-           src/UiguiHighlighter.h \
-           src/indenthandler.h \
-           src/mainwindow.h \
-           src/uiguierrormessage.h \
-           src/uiguiIniFileParser.h \
-           src/uiguisettings.h \
-           src/uiguisettingsdialog.h \
-           src/UiguiIndentServer.h \
-           src/updatecheckdialog.h \
+HEADERS += src/AboutDialog.h \
+           src/UiGuiHighlighter.h \
+           src/IndentHandler.h \
+           src/MainWindow.h \
+           src/UiGuiErrorMessage.h \
+           src/UiGuiSettings.h \
+           src/UiGuiSettingsDialog.h \
+           src/UiGuiIndentServer.h \
+           src/UpdateCheckDialog.h \
            src/SettingsPaths.h \
            src/AboutDialogGraphicsView.h
 
-FORMS += src/mainwindow.ui \
-         src/toolBarWidget.ui \
+FORMS += src/MainWindow.ui \
+         src/ToolBarWidget.ui \
          src/UiGuiSettingsDialog.ui \
-         src/aboutdialog.ui \
+         src/AboutDialog.ui \
          src/UpdateCheckDialog.ui
 
-SOURCES += src/aboutdialog.cpp \
-           src/UiguiHighlighter.cpp \
-           src/indenthandler.cpp \
+SOURCES += src/AboutDialog.cpp \
+           src/UiGuiHighlighter.cpp \
+           src/IndentHandler.cpp \
            src/main.cpp \
-           src/mainwindow.cpp \
-           src/uiguierrormessage.cpp \
-           src/uiguiIniFileParser.cpp \
-           src/uiguisettings.cpp \
-           src/uiguisettingsdialog.cpp \
-           src/UiguiIndentServer.cpp \
-           src/updatecheckdialog.cpp \
+           src/MainWindow.cpp \
+           src/UiGuiErrorMessage.cpp \
+           src/UiGuiIniFileParser.cpp \
+           src/UiGuiSettings.cpp \
+           src/UiGuiSettingsDialog.cpp \
+           src/UiGuiIndentServer.cpp \
+           src/UpdateCheckDialog.cpp \
            src/SettingsPaths.cpp \
            src/AboutDialogGraphicsView.cpp \
-           src/templateBatchScript.cpp
+           src/TemplateBatchScript.cpp
 
 RESOURCES += resources/Icons.qrc
 RC_FILE    = resources/programicon.rc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/AboutDialog.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,151 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "AboutDialog.h"
+
+/*!
+    \class AboutDialog
+    \brief Displays a dialog window with information about UniversalIndentGUI
+*/
+
+/*!
+    \brief The constructor calls the setup function for the ui created by uic and adds
+    the GPL text to the text edit.
+ */
+AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags, QString version, QString revision, QString buildDate) : QDialog(parent, flags) {
+    this->parent = parent;
+    qApp->setStyleSheet("QTextBrowser{background-color:transparent}");
+    setupUi(this);
+    creditsTextBrowser->setStyleSheet("QTextBrowser#creditsTextBrowser{background-color:white}");
+
+    authorTextBrowser->setOpenExternalLinks( true );
+    creditsTextBrowser->setOpenExternalLinks( true );
+
+    this->version = version;
+    this->revision = revision;
+    this->buildDate = buildDate;
+    QString versionString = versionTextBrowser->toHtml();
+    versionString = versionString.arg(version).arg(revision).arg(buildDate);
+    versionTextBrowser->setHtml(versionString);
+
+    creditsTextBrowser->setHtml("<html><head></head><body>"
+        "<pre> </br></pre>"
+        "<h3 align='center'>Thanks go out to</h3>"
+        "<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>"
+        "<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>"
+        "<p align='center'><a href=\"http://korytskyy.lviv.ua/\"><b>Oleksandr</b></a> for Ukrainian and Russian translation.</p></br>"
+        "<p align='center'><b>Erwan &quot;leg&quot;</b> for French translation and the new icon logo.</p></br>"
+        "<p align='center'>The <a href=\"http://www.scintilla.org/\"><b>Scintilla</b></a> project for their great text editing component.</p></br>"
+        "<p align='center'><a href=\"http://www.riverbankcomputing.co.uk/software/qscintilla/\"><b>Riverbank</b></a> for their Scintlla Qt wrapper QScintilla.</p></br>"
+        "<p align='center'>The <a href=\"http://astyle.sourceforge.net/\"><b>Artistic Style</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://invisible-island.net/bcpp/\"><b>BCPP</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://www.siber.com/sct/tools/cbl-beau.html\"><b>Cobol Beautifier</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://csstidy.sourceforge.net/\"><b>CSSTidy</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://www.gnu.org/software/indent/\"><b>GNU Indent</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://sourceforge.net/projects/gcgreatcode/\"><b>GreatCode</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://linux.com.hk/penguin/man/1/hindent.html\"><b>hindent</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://www.digital-mines.com/htb/\"><b>HTB</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://tidy.sourceforge.net/\"><b>HTML Tidy</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://code.gosu.pl/\"><b>JsDecoder</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://jsppp.sourceforge.net/\"><b>JSPPP</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://perltidy.sourceforge.net/\"><b>Perltidy</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://beautifyphp.sourceforge.net/\"><b>PHP_Beautifier</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://www.waterproof.fr/products/phpCodeBeautifier/\"><b>phpCB</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://sourceforge.net/projects/phpstylist/\"><b>PHP Stylist</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://www.arachnoid.com/ruby/rubyBeautifier.html\"><b>Ruby Beautifier</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://raa.ruby-lang.org/project/ruby_formatter/\"><b>Ruby Formatter</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://www.bolthole.com/AWK.html\"><b>Shell Indent</b></a> project.</p></br>"
+        "<p align='center'>The <a href=\"http://uncrustify.sourceforge.net/\"><b>Uncrustify</b></a> project, specially <b>Ben Gardner</b>.</p></br>"
+        "<p align='center'>The <a href=\"http://xmlindent.sourceforge.net/\"><b>XML Indent</b></a> project.</p></br>"
+        "<p align='center'><b>Nirvash</b> for the initial Japanese translation.</p></br>"
+        "<p align='center'>The <a href=\"http://tango.freedesktop.org/Tango_Desktop_Project/\"><b>Tango Project</b></a> for their icons.</p></br>"
+        "<p align='center'><a href=\"http://www.famfamfam.com/\"><b>famfamfam</b></a> for the flag icons.</p></br>"
+        "<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>"
+        "<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>"
+        "</body></html>");
+
+    scrollDirection = 1;
+    scrollSpeed = 100;
+    timer = new QTimer(this);
+    connect( timer, SIGNAL(timeout()), this, SLOT(scroll()) );
+    connect( this, SIGNAL(accepted()), timer, SLOT(stop()) );
+}
+
+
+/*!
+    \brief Catches language change events and retranslates all needed widgets.
+ */
+void AboutDialog::changeEvent(QEvent *event) {
+    if (event->type() == QEvent::LanguageChange) {
+        retranslateUi(this);
+
+        QString versionString = versionTextBrowser->toHtml();
+        versionString = versionString.arg(version).arg(revision).arg(buildDate);
+        versionTextBrowser->setHtml(versionString);
+    }
+    else {
+        QWidget::changeEvent(event);
+    }
+}
+
+
+/*!
+    \brief Reimplements the dialog execution function to init the credits scroller.
+ */
+int AboutDialog::exec() {
+    //creditsTextBrowser->verticalScrollBar()->setValue(0);
+    timer->start(scrollSpeed);
+    return QDialog::exec();
+}
+
+
+/*!
+    \brief This slot is called each timer timeout to scroll the credits textbrowser.
+    Also changes the scroll direction and speed when reaching the start or end.
+ */
+void AboutDialog::scroll() {
+    QScrollBar *scrollBar = creditsTextBrowser->verticalScrollBar();
+    scrollBar->setValue( scrollBar->value()+scrollDirection );
+
+    if ( scrollBar->value() == scrollBar->maximum() ) {
+        // Toggle scroll direction and change scroll speed;
+        scrollDirection = -1;
+        scrollSpeed = 5;
+        timer->stop();
+        timer->start(scrollSpeed);
+    }
+    else if ( scrollBar->value() == scrollBar->minimum() ) {
+        // Toggle scroll direction and change scroll speed;
+        scrollDirection = 1;
+        scrollSpeed = 100;
+        timer->stop();
+        timer->start(scrollSpeed);
+    }
+
+    creditsTextBrowser->update();
+}
+
+
+/*!
+    \brief Shows the about dialog and also starts the credits scroller.
+ */
+void AboutDialog::show() {
+    timer->start(scrollSpeed);
+    QDialog::show();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/AboutDialog.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,61 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef ABOUTDIALOG_H
+#define ABOUTDIALOG_H
+
+#include <QDialog>
+#include <QUrl>
+#include <QDesktopServices>
+#include <QScrollBar>
+#include <QTimer>
+#include "ui_aboutdialog.h"
+
+#include <QLocale>
+
+
+class AboutDialog : public QDialog, private Ui::AboutDialog
+{
+    Q_OBJECT
+
+public:
+    AboutDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0, QString version = "", QString revision = "", QString buildDate = "");
+
+public slots:
+    int exec();
+    void show();
+
+private slots:
+    void scroll();
+
+private:
+    void changeEvent(QEvent *event);
+
+    QString gplText;
+    QString textBrowserSavedContent;
+    QString version;
+    QString revision;
+    QString buildDate;
+    int scrollDirection;
+    int scrollSpeed;
+    QTimer *timer;
+    QWidget *parent;
+};
+
+#endif // ABOUTDIALOG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/AboutDialog.ui	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,211 @@
+<ui version="4.0" >
+ <class>AboutDialog</class>
+ <widget class="QDialog" name="AboutDialog" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>588</width>
+    <height>512</height>
+   </rect>
+  </property>
+  <property name="sizePolicy" >
+   <sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize" >
+   <size>
+    <width>588</width>
+    <height>333</height>
+   </size>
+  </property>
+  <property name="windowTitle" >
+   <string>About UniversalIndentGUI</string>
+  </property>
+  <property name="windowIcon" >
+   <iconset resource="../resources/Icons.qrc" >
+    <normaloff>:/mainWindow/info.png</normaloff>:/mainWindow/info.png</iconset>
+  </property>
+  <layout class="QVBoxLayout" >
+   <property name="margin" >
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QFrame" name="frame" >
+     <property name="styleSheet" >
+      <string notr="true" >QFrame#frame { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #FFFF60, stop:0.5 #D8C304, stop:1 #FFFF60 ); border: 2px solid #A89C57; border-radius: 4px;}</string>
+     </property>
+     <property name="frameShape" >
+      <enum>QFrame::StyledPanel</enum>
+     </property>
+     <layout class="QVBoxLayout" >
+      <item>
+       <widget class="QLabel" name="bannerLabel" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="minimumSize" >
+         <size>
+          <width>570</width>
+          <height>87</height>
+         </size>
+        </property>
+        <property name="maximumSize" >
+         <size>
+          <width>570</width>
+          <height>87</height>
+         </size>
+        </property>
+        <property name="text" >
+         <string/>
+        </property>
+        <property name="pixmap" >
+         <pixmap resource="../resources/Icons.qrc" >:/aboutDialog/banner.png</pixmap>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QTextBrowser" name="versionTextBrowser" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="maximumSize" >
+         <size>
+          <width>16777215</width>
+          <height>25</height>
+         </size>
+        </property>
+        <property name="frameShape" >
+         <enum>QFrame::NoFrame</enum>
+        </property>
+        <property name="verticalScrollBarPolicy" >
+         <enum>Qt::ScrollBarAlwaysOff</enum>
+        </property>
+        <property name="html" >
+         <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
+&lt;p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;">Version %1 rev.%2, %3 &lt;/p>&lt;/body>&lt;/html></string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QTextBrowser" name="authorTextBrowser" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="acceptDrops" >
+         <bool>false</bool>
+        </property>
+        <property name="frameShape" >
+         <enum>QFrame::NoFrame</enum>
+        </property>
+        <property name="verticalScrollBarPolicy" >
+         <enum>Qt::ScrollBarAlwaysOff</enum>
+        </property>
+        <property name="html" >
+         <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">&lt;span style=" font-family:'MS Shell Dlg 2';">... is a cross platform compatible GUI for several code formatter, beautifier and indenter like GreatCode, AStyle (Artistic Styler), GNU Indent, BCPP and so on. Main feature is a live preview to directly see how the selected formatting option affects the source code.&lt;/span>&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">&lt;br />Written by : &lt;a href="http://www.thomas-schweitzer.de">&lt;span style=" text-decoration: underline; color:#0000ff;">Thomas Schweitzer&lt;/span>&lt;/a>&lt;/p>
+&lt;p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">Project Homepage : &lt;a href="http://universalindent.sourceforge.net">&lt;span style=" text-decoration: underline; color:#0000ff;">http://universalindent.sourceforge.net&lt;/span>&lt;/a>&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">License: UniversalIndentGui is released under the GPL 2. For details read the included file LICENSE.GPL visit &lt;a href="http://www.gnu.org/licenses/gpl.html">&lt;span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/gpl.html&lt;/span>&lt;/a>.&lt;/p>
+&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">&lt;/p>
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">Credits:&lt;/p>&lt;/body>&lt;/html></string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QTextBrowser" name="creditsTextBrowser" >
+        <property name="verticalScrollBarPolicy" >
+         <enum>Qt::ScrollBarAlwaysOff</enum>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" >
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <item>
+         <spacer>
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0" >
+           <size>
+            <width>131</width>
+            <height>31</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QPushButton" name="okButton" >
+          <property name="styleSheet" >
+           <string notr="true" >QPushButton#okButton { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #DCB28A, stop:0.5 #B8784B, stop:1 #DCB28A ); border: 2px solid #A89C57; border-radius: 4px;} QPushButton:hover#okButton { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #B8784B, stop:0.5 #DCB28A, stop:1 #B8784B ); } QPushButton:pressed#okButton{ border: 2px solid #D8CB75 }</string>
+          </property>
+          <property name="text" >
+           <string>          OK          </string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer>
+          <property name="orientation" >
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0" >
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../resources/Icons.qrc" />
+ </resources>
+ <connections>
+  <connection>
+   <sender>okButton</sender>
+   <signal>clicked()</signal>
+   <receiver>AboutDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>278</x>
+     <y>253</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>96</x>
+     <y>254</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
--- a/src/AboutDialogGraphicsView.h	Tue Nov 11 12:51:02 2008 +0000
+++ b/src/AboutDialogGraphicsView.h	Tue Nov 11 14:56:11 2008 +0000
@@ -27,7 +27,7 @@
 #include <QPixmap>
 #include <QSplashScreen>
 
-#include "aboutdialog.h"
+#include "AboutDialog.h"
 
 class AboutDialogGraphicsView : public QGraphicsView
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/IndentHandler.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,1574 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "IndentHandler.h"
+
+#include "UiGuiSettings.h"
+
+//! \defgroup grp_Indenter All concerning handling of the indenter.
+
+/*!
+    \class IndentHandler
+    \ingroup grp_Indenter
+    \brief A widget for handling many indenters that are configured by an ini file.
+
+    This is a widget that is used by the main window. It handles access to the
+    indenter config file and calls the chosen indenter to reformat the source text.
+    Calls the indenter each time a setting has been changed and informs
+    the main window about the reformatted source code.
+*/
+
+
+/*!
+    \brief Constructor of the indent handler.
+
+    By calling this constructor the indenter to be loaded, can be selected by setting
+    its \a indenterID, which is the number of found indenter ini files in alphabetic
+    order starting at index 0.
+ */
+IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *parent) : QWidget(parent) {
+    Q_ASSERT_X( indenterID >= 0, "IndentHandler", "the selected indenterID is < 0" );
+
+    setObjectName(QString::fromUtf8("indentHandler"));
+
+    this->mainWindow = mainWindow;
+
+    parameterChangedCallback = NULL;
+    windowClosedCallback = NULL;
+    indenterSettings = NULL;
+    menuIndenter = NULL;
+    actionLoad_Indenter_Config_File = NULL;
+    actionSave_Indenter_Config_File = NULL;
+    actionCreateShellScript = NULL;
+    initIndenterMenu();
+
+    connect( actionLoad_Indenter_Config_File, SIGNAL(triggered()), this, SLOT(openConfigFileDialog()) );
+    connect( actionSave_Indenter_Config_File, SIGNAL(triggered()), this, SLOT(saveasIndentCfgFileDialog()) );
+    connect( actionCreateShellScript, SIGNAL(triggered()), this, SLOT(createIndenterCallShellScript()) );
+    connect( actionResetIndenterParameters, SIGNAL(triggered()), this, SLOT(resetIndenterParameter()) );
+
+    // define this widgets size and resize behavior
+    //this->setMaximumWidth(263);
+    this->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
+
+    // create vertical layout box, into which the toolbox will be added
+    vboxLayout = new QVBoxLayout(this);
+    vboxLayout->setMargin(2);
+
+    // Create horizontal layout for indenter selector and help button.
+    QHBoxLayout *hboxLayout = new QHBoxLayout();
+    //hboxLayout->setMargin(2);
+    vboxLayout->addLayout( hboxLayout );
+
+    // Create the indenter selection combo box.
+    indenterSelectionCombobox = new QComboBox(this);
+    indenterSelectionCombobox->setObjectName(QString::fromUtf8("indenterSelectionCombobox"));
+    indenterSelectionCombobox->setProperty("connectedSettingName", "DONOTTRANSLATE:SelectedIndenter");
+    indenterSelectionCombobox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);
+    indenterSelectionCombobox->setMinimumContentsLength(20);
+    connect( indenterSelectionCombobox, SIGNAL(activated(int)), UiGuiSettings::getInstance(), SLOT(handleValueChangeFromExtern(int)) );
+    connect( UiGuiSettings::getInstance(), SIGNAL(selectedIndenter(int)), this, SLOT(setIndenter(int)) );
+    hboxLayout->addWidget( indenterSelectionCombobox );
+
+    // Create the indenter parameter help button.
+    indenterParameterHelpButton = new QToolButton(this);
+    indenterParameterHelpButton->setObjectName(QString::fromUtf8("indenterParameterHelpButton"));
+    indenterParameterHelpButton->setIcon(QIcon(QString::fromUtf8(":/mainWindow/help.png")));
+    hboxLayout->addWidget( indenterParameterHelpButton );
+    // Handle if the indenter parameter help button is pressed.
+    connect( indenterParameterHelpButton, SIGNAL(clicked()), this, SLOT(showIndenterManual()) );
+
+    // create a toolbox and set its resize behavior
+    toolBox = new QToolBox(this);
+    toolBox->setObjectName(QString::fromUtf8("toolBox"));
+
+#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
+    connect( toolBox, SIGNAL(currentChanged(int)), this, SLOT(repaint()) );
+#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
+
+    //toolBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
+    //toolBox->setMaximumSize(QSize(16777215, 16777215));
+    // insert the toolbox into the vlayout
+    vboxLayout->addWidget(toolBox);
+
+    indenterExecutableCallString = "";
+    indenterExecutableSuffix = "";
+
+    indenterDirctoryStr = SettingsPaths::getIndenterPath();
+    tempDirctoryStr = SettingsPaths::getTempPath();
+    settingsDirctoryStr = SettingsPaths::getSettingsPath();
+    QDir indenterDirctory = QDir(indenterDirctoryStr);
+
+    if ( mainWindow != NULL ) {
+        errorMessageDialog = new UiGuiErrorMessage(mainWindow);
+    }
+    else {
+        errorMessageDialog = new UiGuiErrorMessage(this);
+    }
+
+    indenterIniFileList = indenterDirctory.entryList( QStringList("uigui_*.ini") );
+    if ( indenterIniFileList.count() > 0 ) {
+        // Take care if the selected indenterID is smaller or greater than the number of existing indenters
+        if ( indenterID < 0 ) {
+            indenterID = 0;
+        }
+        if ( indenterID >= indenterIniFileList.count() ) {
+            indenterID = indenterIniFileList.count() - 1;
+        }
+
+        // Reads and parses the by indenterID defined indent ini file and creates toolbox entries
+        readIndentIniFile( indenterDirctoryStr + "/" + indenterIniFileList.at(indenterID) );
+
+        // Find out how the indenter can be executed.
+        createIndenterCallString();
+
+        // Load the users last settings made for this indenter.
+        loadConfigFile( settingsDirctoryStr + "/" + indenterFileName + ".cfg" );
+
+        // Fill the indenter selection combo box with the list of available indenters.
+        if ( !getAvailableIndenters().isEmpty() ) {
+            indenterSelectionCombobox->addItems( getAvailableIndenters() );
+            indenterSelectionCombobox->setCurrentIndex( indenterID );
+            connect( indenterSelectionCombobox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(selectedIndenterIndexChanged(int)) );
+        }
+    }
+    else {
+        errorMessageDialog->showMessage(tr("No indenter ini files"), tr("There exists no indenter ini files in the directory \"") + QDir(indenterDirctoryStr).absolutePath() + "\".");
+    }
+
+    retranslateUi();
+}
+
+
+/*!
+    \brief Implicitly writes the current indenter parameters to the indenters config file.
+ */
+IndentHandler::~IndentHandler() {
+    // Generate the parameter string that will be saved to the indenters config file.
+    QString parameterString = getParameterString();
+    if ( !indenterFileName.isEmpty() ) {
+        saveConfigFile( settingsDirctoryStr + "/" + indenterFileName + ".cfg", parameterString );
+    }
+
+    delete errorMessageDialog;
+}
+
+
+/*!
+    \brief Initializes the context menu used for some actions like saving the indenter config file.
+ */
+void IndentHandler::initIndenterMenu() {
+    if ( menuIndenter == NULL ) {
+        actionLoad_Indenter_Config_File = new QAction(this);
+        actionLoad_Indenter_Config_File->setObjectName(QString::fromUtf8("actionLoad_Indenter_Config_File"));
+        actionLoad_Indenter_Config_File->setIcon(QIcon(QString::fromUtf8(":/mainWindow/load_indent_cfg.png")));
+
+        actionSave_Indenter_Config_File = new QAction(this);
+        actionSave_Indenter_Config_File->setObjectName(QString::fromUtf8("actionSave_Indenter_Config_File"));
+        actionSave_Indenter_Config_File->setIcon(QIcon(QString::fromUtf8(":/mainWindow/save_indent_cfg.png")));
+
+        actionCreateShellScript = new QAction(this);
+        actionCreateShellScript->setObjectName(QString::fromUtf8("actionCreateShellScript"));
+        actionCreateShellScript->setIcon(QIcon(QString::fromUtf8(":/mainWindow/shell.png")));
+
+        actionResetIndenterParameters = new QAction(this);
+        actionResetIndenterParameters->setObjectName(QString::fromUtf8("actionResetIndenterParameters"));
+        actionResetIndenterParameters->setIcon(QIcon(QString::fromUtf8(":/mainWindow/view-refresh.png")));
+
+        menuIndenter = new QMenu(this);
+        menuIndenter->setObjectName(QString::fromUtf8("menuIndenter"));
+        menuIndenter->addAction(actionLoad_Indenter_Config_File);
+        menuIndenter->addAction(actionSave_Indenter_Config_File);
+        menuIndenter->addAction(actionCreateShellScript);
+        menuIndenter->addAction(actionResetIndenterParameters);
+    }
+}
+
+
+/*!
+    \brief Returns the context menu used for some actions like saving the indenter config file.
+ */
+QMenu* IndentHandler::getIndenterMenu() {
+    return menuIndenter;
+}
+
+
+/*!
+    \brief Returns the actions of the context menu used for some actions like saving the indenter config file.
+*/
+QList<QAction*> IndentHandler::getIndenterMenuActions() {
+    QList<QAction*> actionList;
+    actionList << actionLoad_Indenter_Config_File << actionSave_Indenter_Config_File << actionCreateShellScript << actionResetIndenterParameters;
+    return actionList;
+}
+
+
+/*!
+    \brief Opens the context menu, used for some actions like saving the indenter config file, at the event position.
+ */
+void IndentHandler::contextMenuEvent( QContextMenuEvent *event ) {
+    getIndenterMenu()->exec( event->globalPos() );
+}
+
+
+/*!
+    \brief Creates the content for a shell script that can be used as a external tool call
+    to indent an as parameter defined file.
+ */
+QString IndentHandler::generateCommandlineCall() {
+    QString indenterCompleteCallString;
+    QString parameterInputFile;
+    QString parameterOuputFile;
+    QString parameterParameterFile;
+    QString replaceInputFileCommand;
+
+    // Define the placeholder for parameter variables either in batch or bash programming.
+#if defined(Q_OS_WIN32)
+    QString shellParameterPlaceholder = "%1";
+#else
+    QString shellParameterPlaceholder = "$1";
+#endif
+
+    // Generate the parameter string that will be saved to the indenters config file.
+    QString parameterString = getParameterString();
+
+    if ( !configFilename.isEmpty() ) {
+        saveConfigFile( indenterDirctoryStr + "/" + configFilename, parameterString );
+    }
+
+    parameterInputFile = " " + inputFileParameter + "\"" + shellParameterPlaceholder + "\"";
+
+    if ( outputFileParameter != "none" && outputFileParameter != "stdout" ) {
+        if ( outputFileName == inputFileName ) {
+            parameterOuputFile = " " + outputFileParameter + "\"" + shellParameterPlaceholder + "\"";
+        }
+        else {
+            parameterOuputFile = " " + outputFileParameter + outputFileName + ".tmp";
+        }
+    }
+
+    // If the config file name is empty it is assumed that all parameters are sent via command line call
+    if ( configFilename.isEmpty() ) {
+        parameterParameterFile = " " + parameterString;
+    }
+    // else if needed add the parameter to the indenter call string where the config file can be found.
+    else if (useCfgFileParameter != "none") {
+        parameterParameterFile = " " + useCfgFileParameter + "\"" + indenterDirctoryStr + "/" + configFilename + "\"";
+    }
+
+    // Assemble indenter call string for parameters according to the set order.
+    if ( parameterOrder == "ipo" ) {
+        indenterCompleteCallString = parameterInputFile + parameterParameterFile + parameterOuputFile;
+    }
+    else if ( parameterOrder == "pio" ) {
+        indenterCompleteCallString = parameterParameterFile + parameterInputFile + parameterOuputFile;
+    }
+    else if ( parameterOrder == "poi" ) {
+        indenterCompleteCallString = parameterParameterFile + parameterOuputFile + parameterInputFile;
+    }
+    else {
+        indenterCompleteCallString = parameterInputFile + parameterOuputFile + parameterParameterFile;
+    }
+
+    // Generate the indenter call string either for win32 or other systems.
+#if defined(Q_OS_WIN32)
+    indenterCompleteCallString = indenterExecutableCallString + indenterCompleteCallString;
+#else
+    indenterCompleteCallString = "#!/bin/bash\n" + indenterExecutableCallString + indenterCompleteCallString;
+#endif
+
+    // If the indenter writes to stdout pipe the output into a file
+    if ( outputFileParameter == "stdout" ) {
+        indenterCompleteCallString = indenterCompleteCallString + " >" + outputFileName + ".tmp";
+    }
+
+    // If the output filename is not the same as the input filename copy the output over the input.
+    if ( outputFileName != inputFileName ) {
+#if defined(Q_OS_WIN32)
+        replaceInputFileCommand = "move /Y " + outputFileName + ".tmp \"" + shellParameterPlaceholder + "\"\n";
+#else
+        replaceInputFileCommand = "mv " + outputFileName + ".tmp \"" + shellParameterPlaceholder + "\"\n";
+#endif
+    }
+
+#if defined(Q_OS_WIN32)
+    QString shellScript( TemplateBatchScript::getTemplateBatchScript() );
+    shellScript = shellScript.replace("__INDENTERCALLSTRING2__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
+    indenterCompleteCallString = indenterCompleteCallString.replace("%1", "%%G");
+    replaceInputFileCommand = replaceInputFileCommand.replace("%1", "%%G");
+    shellScript = shellScript.replace("__INDENTERCALLSTRING1__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
+#else
+    QString shellScript( TemplateBatchScript::getTemplateBatchScript() );
+    shellScript = shellScript.replace("__INDENTERCALLSTRING2__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
+    indenterCompleteCallString = indenterCompleteCallString.replace("$1", "$file2indent");
+    replaceInputFileCommand = replaceInputFileCommand.replace("$1", "$file2indent");
+    shellScript = shellScript.replace("__INDENTERCALLSTRING1__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
+#endif
+
+    return shellScript;
+}
+
+
+/*!
+    \brief Format \a sourceCode by calling the indenter.
+
+    The \a inputFileExtension has to be given as parameter so the called indenter
+    can identify the programming language if needed.
+ */
+QString IndentHandler::callIndenter(QString sourceCode, QString inputFileExtension) {
+    if ( indenterExecutableSuffix == ".js" ) {
+        return callJavaScriptIndenter(sourceCode);
+    }
+    else {
+        return callExecutableIndenter(sourceCode, inputFileExtension);
+    }
+}
+
+
+/*!
+    \brief Format \a sourceCode by calling the interpreted JavaScript code of the indenter.
+
+    The \a inputFileExtension has to be given as parameter so the called indenter
+    can identify the programming language if needed.
+*/
+QString IndentHandler::callJavaScriptIndenter(QString sourceCode) {
+    QScriptEngine engine;
+
+    QScriptValue unformattedCode(&engine, sourceCode);
+    engine.globalObject().setProperty("unformattedCode", unformattedCode);
+
+    QFile jsDecoderFile( indenterExecutableCallString );
+    QString jsDecoderCode;
+    if (jsDecoderFile.open(QFile::ReadOnly)) {
+        jsDecoderCode = jsDecoderFile.readAll();
+    }
+    jsDecoderFile.close();
+
+    QScriptValue value = engine.evaluate(jsDecoderCode);
+    return value.toString();
+}
+
+
+/*!
+    \brief Format \a sourceCode by calling the binary executable of the indenter.
+
+    The \a inputFileExtension has to be given as parameter so the called indenter
+    can identify the programming language if needed.
+*/
+QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputFileExtension) {
+    Q_ASSERT_X( !inputFileName.isEmpty(), "callIndenter", "inputFileName is empty" );
+//    Q_ASSERT_X( !outputFileName.isEmpty(), "callIndenter", "outputFileName is empty" );
+    Q_ASSERT_X( !indenterFileName.isEmpty(), "callIndenter", "indenterFileName is empty" );
+
+    if ( indenterFileName.isEmpty() ) {
+        return "";
+    }
+
+    QString formattedSourceCode;
+    QString indenterCompleteCallString;
+    QString parameterInputFile;
+    QString parameterOuputFile;
+    QString parameterParameterFile;
+    QProcess indentProcess;
+    QString processReturnString;
+
+    // Generate the parameter string that will be saved to the indenters config file
+    QString parameterString = getParameterString();
+
+    if ( !configFilename.isEmpty() ) {
+        saveConfigFile( tempDirctoryStr + "/" + configFilename, parameterString );
+    }
+
+    // Only add a dot to file extension if the string is not empty
+    if ( !inputFileExtension.isEmpty() ) {
+        inputFileExtension = "." + inputFileExtension;
+    }
+
+    // Delete any previously used input src file and create a new input src file.
+    QFile::remove(tempDirctoryStr + "/" + inputFileName + inputFileExtension);
+    QFile inputSrcFile(tempDirctoryStr + "/" + inputFileName + inputFileExtension);
+    parameterInputFile = " " + inputFileParameter + inputFileName + inputFileExtension;
+
+    if ( outputFileParameter != "none" && outputFileParameter != "stdout" ) {
+        parameterOuputFile = " " + outputFileParameter + outputFileName + inputFileExtension;
+    }
+
+    // If the config file name is empty it is assumed that all parameters are sent via command line call
+    if ( configFilename.isEmpty() ) {
+        parameterParameterFile = " " + parameterString;
+    }
+    // if needed add the parameter to the indenter call string where the config file can be found
+    else if (useCfgFileParameter != "none") {
+        parameterParameterFile = " " + useCfgFileParameter + "\"" + tempDirctoryStr + "/" + configFilename + "\"";
+    }
+
+    // Assemble indenter call string for parameters according to the set order.
+    if ( parameterOrder == "ipo" ) {
+        indenterCompleteCallString = parameterInputFile + parameterParameterFile + parameterOuputFile;
+    }
+    else if ( parameterOrder == "pio" ) {
+        indenterCompleteCallString = parameterParameterFile + parameterInputFile + parameterOuputFile;
+    }
+    else if ( parameterOrder == "poi" ) {
+        indenterCompleteCallString = parameterParameterFile + parameterOuputFile + parameterInputFile;
+    }
+    else {
+        indenterCompleteCallString = parameterInputFile + parameterOuputFile + parameterParameterFile;
+    }
+
+    // If no indenter executable call string could be created before, show an error message.
+    if ( indenterExecutableCallString.isEmpty() ) {
+        errorMessageDialog->showMessage(tr("No indenter executable"),
+            tr("There exists no indenter executable with the name \"%1\" in the directory \"%2\" nor in the global environment.").arg(indenterFileName).arg(indenterDirctoryStr) );
+        return sourceCode;
+    }
+
+    // Generate the indenter call string either for win32 or other systems.
+    indenterCompleteCallString = indenterExecutableCallString + indenterCompleteCallString;
+
+    // Write the source code to the input file for the indenter
+    inputSrcFile.open( QFile::ReadWrite | QFile::Text );
+    inputSrcFile.write( sourceCode.toUtf8() );
+    inputSrcFile.close();
+
+    // errors and standard outputs from the process call are merged together
+    indentProcess.setReadChannelMode(QProcess::MergedChannels);
+
+    // Set the directory for the indenter execution
+    indentProcess.setWorkingDirectory( QFileInfo(tempDirctoryStr).absoluteFilePath() );
+
+    indentProcess.start(indenterCompleteCallString);
+
+    processReturnString = "";
+    // test if there was an error during starting the process of the indenter
+    if ( !indentProcess.waitForFinished(10000) ) {
+        processReturnString = "<html><body>";
+        processReturnString += tr("<b>Returned error message:</b> ") + indentProcess.errorString() + "<br>";
+
+        switch ( indentProcess.error() ) {
+            case QProcess::FailedToStart:
+                processReturnString += tr("<b>Reason could be:</b> ") + "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.<br>";
+                break;
+            case QProcess::Crashed:
+                processReturnString += "The process crashed some time after starting successfully.<br>";
+                break;
+            case QProcess::Timedout:
+                processReturnString += "The called indenter did not response for over 10 seconds, so aborted its execution.<br>";
+                break;
+            case QProcess::WriteError:
+                processReturnString += "An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.<br>";
+                break;
+            case QProcess::ReadError:
+                processReturnString += "An error occurred when attempting to read from the process. For example, the process may not be running.<br>";
+                break;
+            case QProcess::UnknownError:
+                processReturnString += "An unknown error occurred. This is the default return value of error().<br>";
+                break;
+            default:
+                break;
+        }
+        processReturnString += tr("<br><b>Callstring was:</b> ") + indenterCompleteCallString;
+        processReturnString += tr("<br><br><b>Indenter output was:</b><pre>") + indentProcess.readAll() + "</pre></html></body>";
+        QApplication::restoreOverrideCursor();
+        errorMessageDialog->showMessage(tr("Error calling Indenter"), processReturnString);
+    }
+    // there was no problem starting the process/indenter so fetch, what it returned
+    else {
+        processReturnString += indentProcess.readAll();
+    }
+
+    // if the indenter returned an errorcode != 0 show its output
+    if ( indentProcess.exitCode() != 0 ) {
+        QString exitCode;
+        exitCode.setNum(indentProcess.exitCode());
+        processReturnString = tr("<b>Indenter returned with exit code:</b> ") + exitCode + "<br>" +
+                              tr("<b>Indent console output was:</b> ") + processReturnString + "<br>" +
+                              tr("<br><b>Callstring was:</b> ") + indenterCompleteCallString + "</html></body>";
+        QApplication::restoreOverrideCursor();
+        errorMessageDialog->showMessage( tr("Indenter returned error"), processReturnString );
+    }
+
+    // If the indenter results are written to stdout, read them from there...
+    if ( indentProcess.exitCode() == 0 && outputFileParameter == "stdout"  ) {
+        formattedSourceCode = processReturnString;
+    }
+    // ... else read the output file generated by the indenter call.
+    else {
+        QFile outSrcFile(tempDirctoryStr + "/" + outputFileName + inputFileExtension);
+        outSrcFile.open(QFile::ReadOnly | QFile::Text);
+        QTextStream outSrcStrm(&outSrcFile);
+        outSrcStrm.setCodec( QTextCodec::codecForName("UTF-8") );
+        formattedSourceCode = outSrcStrm.readAll();
+        outSrcFile.close();
+    }
+
+    // Delete the temporary input and output files.
+    QFile::remove(tempDirctoryStr + "/" + outputFileName + inputFileExtension);
+    QFile::remove(tempDirctoryStr + "/" + inputFileName + inputFileExtension);
+
+    return formattedSourceCode;
+}
+
+
+/*!
+    \brief Generates and returns a string with all parameters needed to call the indenter.
+ */
+QString IndentHandler::getParameterString() {
+    QString parameterString = "";
+
+    // generate parameter string for all boolean values
+    foreach (ParamBoolean pBoolean, paramBooleans) {
+        if ( pBoolean.checkBox->isChecked() ) {
+            if ( !pBoolean.trueString.isEmpty() ) {
+                parameterString += pBoolean.trueString + cfgFileParameterEnding;
+            }
+        }
+        else {
+            if ( !pBoolean.falseString.isEmpty() ) {
+                parameterString += pBoolean.falseString + cfgFileParameterEnding;
+            }
+        }
+    }
+
+    // generate parameter string for all numeric values
+    foreach (ParamNumeric pNumeric, paramNumerics) {
+        if ( pNumeric.valueEnabledChkBox->isChecked() ) {
+            parameterString += pNumeric.paramCallName + QString::number( pNumeric.spinBox->value() ) + cfgFileParameterEnding;
+        }
+    }
+
+    // generate parameter string for all string values
+    foreach (ParamString pString, paramStrings) {
+        if ( !pString.lineEdit->text().isEmpty() && pString.valueEnabledChkBox->isChecked() ) {
+            // Create parameter definition for each value devided by a | sign.
+            foreach (QString paramValue, pString.lineEdit->text().split("|")) {
+                parameterString += pString.paramCallName + paramValue + cfgFileParameterEnding;
+            }
+        }
+    }
+
+    // generate parameter string for all multiple choice values
+    foreach (ParamMultiple pMultiple, paramMultiples) {
+        if ( pMultiple.valueEnabledChkBox->isChecked() ) {
+            parameterString += pMultiple.choicesStrings.at( pMultiple.comboBox->currentIndex () ) + cfgFileParameterEnding;
+        }
+    }
+
+    return parameterString;
+}
+
+
+/*!
+    \brief Write settings for the indenter to a config file.
+ */
+void IndentHandler::saveConfigFile(QString filePathName, QString paramString) {
+    QFile::remove( filePathName );
+    QFile cfgFile( filePathName );
+
+    cfgFile.open( QFile::ReadWrite | QFile::Text );
+    cfgFile.write( paramString.toAscii() );
+    cfgFile.close();
+}
+
+
+/*!
+    \brief Load the config file for the indenter and apply the settings made there.
+ */
+bool IndentHandler::loadConfigFile(QString filePathName) {
+    QFile cfgFile(filePathName);
+    int index;
+    int crPos;
+    int paramValue = 0;
+    QString paramValueStr;
+    QString cfgFileData = "";
+
+    // If the to be loaded config file does not exist leave all values as they are and return false.
+    if ( !cfgFile.exists() ) {
+        return false;
+    }
+    // else if the to be read config file exists, retrieve its whole content.
+    else {
+        // Open the config file and read all data
+        cfgFile.open( QFile::ReadOnly | QFile::Text );
+        cfgFileData = cfgFile.readAll();
+        cfgFile.close();
+    }
+
+    // Search for name of each boolean parameter and set its value if found.
+    foreach (ParamBoolean pBoolean, paramBooleans) {
+        // boolean value that will be assigned to the checkbox
+        bool paramValue = false;
+
+        // first search for the longer parameter string
+        // the true parameter string is longer than the false string
+        if ( pBoolean.trueString.length() > pBoolean.falseString.length() ) {
+            // search for the true string
+            index = cfgFileData.indexOf( pBoolean.trueString, 0, Qt::CaseInsensitive );
+            // if true string found set the parameter value to true
+            if ( index != -1 ) {
+                paramValue = true;
+            }
+            // if true string not found, search for false string
+            else {
+                index = cfgFileData.indexOf( pBoolean.falseString, 0, Qt::CaseInsensitive );
+                // if false string found set the parameter value to false
+                if ( index != -1 ) {
+                    paramValue = false;
+                }
+                // neither true nor false parameter found so use default value
+                else {
+                    paramValue = indenterSettings->value(pBoolean.paramName + "/ValueDefault").toBool();
+                }
+            }
+        }
+        // the false parameter string is longer than the true string
+        else {
+            // search for the false string
+            index = cfgFileData.indexOf( pBoolean.falseString, 0, Qt::CaseInsensitive );
+            // if false string found set the parameter value to false
+            if ( index != -1 ) {
+                paramValue = false;
+            }
+            // if false string not found, search for true string
+            else {
+                index = cfgFileData.indexOf( pBoolean.trueString, 0, Qt::CaseInsensitive );
+                // if true string found set the parameter value to true
+                if ( index != -1 ) {
+                    paramValue = true;
+                }
+                // neither true nor false parameter found so use default value
+                else {
+                    paramValue = indenterSettings->value(pBoolean.paramName + "/ValueDefault").toBool();
+                }
+            }
+        }
+        pBoolean.checkBox->setChecked(paramValue);
+    }
+
+    // Search for name of each numeric parameter and set the value found behind it.
+    foreach (ParamNumeric pNumeric, paramNumerics) {
+        index = cfgFileData.indexOf( pNumeric.paramCallName, 0, Qt::CaseInsensitive );
+        // parameter was found in config file
+        if ( index != -1 ) {
+            // set index after the parameter name, so in front of the number
+            index += pNumeric.paramCallName.length();
+
+            // Find the end of the parameter by searching for set config file parameter ending. Most of time this is a carriage return.
+            crPos = cfgFileData.indexOf( cfgFileParameterEnding, index+1 );
+
+            // get the number and convert it to int
+            QString test = cfgFileData.mid( index, crPos - index );
+            paramValue = cfgFileData.mid( index, crPos - index ).toInt(NULL);
+
+            // disable the signal-slot connection. Otherwise signal is emmitted each time when value is set
+            QObject::disconnect(pNumeric.spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
+            pNumeric.spinBox->setValue( paramValue );
+            pNumeric.valueEnabledChkBox->setChecked( true );
+            QObject::connect(pNumeric.spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
+        }
+        // parameter was not found in config file
+        else {
+            int defaultValue = indenterSettings->value(pNumeric.paramName + "/ValueDefault").toInt();
+            pNumeric.spinBox->setValue( defaultValue );
+            pNumeric.valueEnabledChkBox->setChecked( false );
+        }
+    }
+
+    // Search for name of each string parameter and set it.
+    foreach (ParamString pString, paramStrings) {
+        paramValueStr = "";
+        // The number of the found values for this parameter name.
+        int numberOfValues = 0;
+        index = cfgFileData.indexOf( pString.paramCallName, 0, Qt::CaseInsensitive );
+        // If parameter was found in config file
+        if ( index != -1 ) {
+            while ( index != -1 ) {
+                numberOfValues++;
+
+                // Set index after the parameter name, so it points to the front of the string value.
+                index += pString.paramCallName.length();
+
+                // Find the end of the parameter by searching for set config file parameter ending. Most of time this is a carriage return.
+                crPos = cfgFileData.indexOf( cfgFileParameterEnding, index+1 );
+
+                // Get the string and remember it.
+                if ( numberOfValues < 2 ) {
+                    paramValueStr = QString( cfgFileData.mid( index, crPos - index ) );
+                }
+                // If the same parameter has been set multiple times, concatenate the strings dvivided by a |.
+                else {
+                    paramValueStr = paramValueStr + "|" + QString( cfgFileData.mid( index, crPos - index ) );
+                }
+
+                // Get next value for this setting, if one exists.
+                index = cfgFileData.indexOf( pString.paramCallName, crPos+1, Qt::CaseInsensitive );
+            }
+            // Set the text for the line edit.
+            pString.lineEdit->setText( paramValueStr );
+            pString.valueEnabledChkBox->setChecked( true );
+        }
+        // Parameter was not found in config file
+        else {
+            paramValueStr = indenterSettings->value(pString.paramName + "/ValueDefault").toString();
+            pString.lineEdit->setText( paramValueStr );
+            pString.valueEnabledChkBox->setChecked( false );
+        }
+    }
+
+    // search for name of each multiple choice parameter and set it
+    foreach (ParamMultiple pMultiple, paramMultiples) {
+        int i = 0;
+        index = -1;
+
+        // search for all parameter names of the multiple choice list
+        // if one is found, set it and leave the while loop
+        while ( i < pMultiple.choicesStrings.count() && index == -1 ) {
+            index = cfgFileData.indexOf( pMultiple.choicesStrings.at(i), 0, Qt::CaseInsensitive );
+            if ( index != -1 ) {
+                pMultiple.comboBox->setCurrentIndex( i );
+                pMultiple.valueEnabledChkBox->setChecked( true );
+            }
+            i++;
+        }
+
+        // parameter was not set in config file, so use default value
+        if ( index == -1 ) {
+            int defaultValue = indenterSettings->value(pMultiple.paramName + "/ValueDefault").toInt();
+            pMultiple.comboBox->setCurrentIndex( defaultValue );
+            pMultiple.valueEnabledChkBox->setChecked( false );
+        }
+    }
+
+    return true;
+}
+
+
+/*!
+    \brief Sets all indenter parameters to their default values defined in the ini file.
+ */
+void IndentHandler::resetToDefaultValues() {
+    // Search for name of each boolean parameter and set its value if found.
+    foreach (ParamBoolean pBoolean, paramBooleans) {
+        // Boolean value that will be assigned to the checkbox.
+        bool defaultValue = indenterSettings->value(pBoolean.paramName + "/ValueDefault").toBool();
+        pBoolean.checkBox->setChecked( defaultValue );
+    }
+
+    // Search for name of each numeric parameter and set the value found behind it.
+    foreach (ParamNumeric pNumeric, paramNumerics) {
+        int defaultValue = indenterSettings->value(pNumeric.paramName + "/ValueDefault").toInt();
+        pNumeric.spinBox->setValue( defaultValue );
+        pNumeric.valueEnabledChkBox->setChecked( indenterSettings->value(pNumeric.paramName + "/Enabled").toBool() );
+    }
+
+    // Search for name of each string parameter and set it.
+    foreach (ParamString pString, paramStrings) {
+        QString defaultValue = indenterSettings->value(pString.paramName + "/ValueDefault").toString();
+        pString.lineEdit->setText( defaultValue );
+        pString.valueEnabledChkBox->setChecked( indenterSettings->value(pString.paramName + "/Enabled").toBool() );
+    }
+
+    // Search for name of each multiple choice parameter and set it.
+    foreach (ParamMultiple pMultiple, paramMultiples) {
+        int defaultValue = indenterSettings->value(pMultiple.paramName + "/ValueDefault").toInt();
+        pMultiple.comboBox->setCurrentIndex( defaultValue );
+        pMultiple.valueEnabledChkBox->setChecked( indenterSettings->value(pMultiple.paramName + "/Enabled").toBool() );
+    }
+}
+
+
+/*!
+    \brief Opens and parses the indenter ini file that is declared by \a iniFilePath.
+ */
+void IndentHandler::readIndentIniFile(QString iniFilePath) {
+    Q_ASSERT_X( !iniFilePath.isEmpty(), "readIndentIniFile", "iniFilePath is empty" );
+
+    // open the ini-file that contains all available indenter settings with their additional infos
+    indenterSettings = new UiGuiIniFileParser(iniFilePath);
+
+    QStringList categories;
+    //QString indenterGroupString = "";
+    QString paramToolTip = "";
+
+
+    //
+    //  parse ini file indenter header
+    //
+
+    indenterName = indenterSettings->value("header/indenterName").toString();
+    indenterFileName = indenterSettings->value("header/indenterFileName").toString();
+    configFilename = indenterSettings->value("header/configFilename").toString();
+    useCfgFileParameter = indenterSettings->value("header/useCfgFileParameter").toString();
+    cfgFileParameterEnding = indenterSettings->value("header/cfgFileParameterEnding").toString();
+    if ( cfgFileParameterEnding == "cr" ) {
+        cfgFileParameterEnding = "\n";
+    }
+    indenterShowHelpParameter = indenterSettings->value("header/showHelpParameter").toString();
+
+    if ( indenterFileName.isEmpty() ) {
+        errorMessageDialog->showMessage( tr("Indenter ini file header error"),
+            tr("The loaded indenter ini file \"%1\"has a faulty header. At least the indenters file name is not set.").arg(iniFilePath) );
+    }
+
+    // Read the parameter order. Possible values are (p=parameter[file] i=inputfile o=outputfile)
+    // pio, ipo, iop
+    parameterOrder = indenterSettings->value("header/parameterOrder", "pio").toString();
+    inputFileParameter = indenterSettings->value("header/inputFileParameter").toString();
+    inputFileName = indenterSettings->value("header/inputFileName").toString();
+    outputFileParameter = indenterSettings->value("header/outputFileParameter").toString();
+    outputFileName = indenterSettings->value("header/outputFileName").toString();
+    fileTypes = indenterSettings->value("header/fileTypes").toString();
+    fileTypes.replace('|', " ");
+
+    // read the categories names which are separated by "|"
+    QString categoriesStr = indenterSettings->value("header/categories").toString();
+    categories = categoriesStr.split("|");
+    // Assure that the category list is never empty. At least contain a "general" section.
+    if ( categories.isEmpty() ) {
+        categories.append("General");
+    }
+
+    ToolBoxPage toolBoxPage;
+
+    // create a page for each category and store its references in a toolboxpage-array
+    foreach (QString category, categories) {
+        toolBoxPage.page = new QWidget();
+        toolBoxPage.page->setObjectName(category);
+        toolBoxPage.page->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+        toolBoxPage.vboxLayout = new QVBoxLayout(toolBoxPage.page);
+        toolBoxPage.vboxLayout->setSpacing(6);
+        toolBoxPage.vboxLayout->setMargin(9);
+        toolBoxPage.vboxLayout->setObjectName(category);
+        toolBoxPages.append(toolBoxPage);
+        toolBox->addItem(toolBoxPage.page, category);
+    }
+
+
+    //
+    //  parse ini file indenter parameters
+    //
+
+    // read all possible parameters written in brackets []
+    indenterParameters = indenterSettings->childGroups();
+
+    // read each parameter to create the corresponding input field
+    foreach (QString indenterParameter, indenterParameters) {
+        // if it is not the indent header definition read the parameter and add it to
+        // the corresponding category toolbox page
+        if ( indenterParameter != "header") {
+            // read to which category the parameter belongs
+            int category = indenterSettings->value(indenterParameter + "/Category").toInt();
+            // Assure that the category number is never greater than the available categories.
+            if ( category > toolBoxPages.size()-1 ) {
+                category = toolBoxPages.size()-1;
+            }
+            // read which type of input field the parameter needs
+            QString editType = indenterSettings->value(indenterParameter + "/EditorType").toString();
+
+            // edit type is numeric so create a spinbox with label
+            if ( editType == "numeric" ) {
+                // read the parameter name as it is used at the command line or in its config file
+                QString parameterCallName = indenterSettings->value(indenterParameter + "/CallName").toString();
+
+                // create checkbox which enables or disables the parameter
+                QCheckBox *chkBox = new QCheckBox( toolBoxPages.at(category).page );
+                chkBox->setChecked( indenterSettings->value(indenterParameter + "/Enabled").toBool() );
+                chkBox->setToolTip( "Enables/disables the parameter. If disabled the indenters default value will be used." );
+                chkBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+                int left, top, right, bottom;
+                chkBox->getContentsMargins( &left, &top, &right, &bottom );
+                chkBox->setContentsMargins( left, top, 0, bottom );
+
+                // create the spinbox
+                QSpinBox *spinBox = new QSpinBox( toolBoxPages.at(category).page );
+                paramToolTip = indenterSettings->value(indenterParameter + "/Description").toString();
+                spinBox->setToolTip( paramToolTip );
+                spinBox->setMaximumWidth(50);
+                spinBox->setMinimumWidth(50);
+                if ( mainWindow != NULL ) {
+                    spinBox->installEventFilter( mainWindow );
+                }
+                if ( indenterSettings->value(indenterParameter + "/MinVal").toString() != "" ) {
+                    spinBox->setMinimum( indenterSettings->value(indenterParameter + "/MinVal").toInt() );
+                }
+                else {
+                    spinBox->setMinimum( 0 );
+                }
+                if ( indenterSettings->value(indenterParameter + "/MaxVal").toString() != "" ) {
+                    spinBox->setMaximum( indenterSettings->value(indenterParameter + "/MaxVal").toInt() );
+                }
+                else {
+                    spinBox->setMaximum( 2000 );
+                }
+
+                // create the label
+                QLabel *label = new QLabel( toolBoxPages.at(category).page );
+                label->setText(indenterParameter);
+                label->setBuddy(spinBox);
+                label->setToolTip( paramToolTip );
+                if ( mainWindow != NULL ) {
+                    label->installEventFilter( mainWindow );
+                }
+
+                // put all into a layout and add it to the toolbox page
+                QHBoxLayout *hboxLayout = new QHBoxLayout();
+                hboxLayout->addWidget(chkBox);
+                hboxLayout->addWidget(spinBox);
+                hboxLayout->addWidget(label);
+                toolBoxPages.at(category).vboxLayout->addLayout(hboxLayout);
+
+                // remember parameter name and reference to its spinbox
+                ParamNumeric paramNumeric;
+                paramNumeric.paramName = indenterParameter;
+                paramNumeric.paramCallName = parameterCallName;
+                paramNumeric.spinBox = spinBox;
+                paramNumeric.label = label;
+                paramNumeric.valueEnabledChkBox = chkBox;
+                paramNumeric.spinBox->setValue( indenterSettings->value(paramNumeric.paramName + "/ValueDefault").toInt() );
+                paramNumerics.append(paramNumeric);
+
+                QObject::connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
+                QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
+            }
+            // edit type is boolean so create a checkbox
+            else if ( editType == "boolean" ) {
+                // create the checkbox, make its settings and add it to the toolbox page
+                QCheckBox *chkBox = new QCheckBox( toolBoxPages.at(category).page );
+                chkBox->setText(indenterParameter);
+                paramToolTip = indenterSettings->value(indenterParameter + "/Description").toString();
+                chkBox->setToolTip( paramToolTip );
+                if ( mainWindow != NULL ) {
+                    chkBox->installEventFilter( mainWindow );
+                }
+                toolBoxPages.at(category).vboxLayout->addWidget(chkBox);
+
+                // remember parameter name and reference to its checkbox
+                ParamBoolean paramBoolean;
+                paramBoolean.paramName = indenterParameter;
+                paramBoolean.checkBox = chkBox;
+                QStringList trueFalseStrings = indenterSettings->value(indenterParameter + "/TrueFalse").toString().split("|");
+                paramBoolean.trueString = trueFalseStrings.at(0);
+                paramBoolean.falseString = trueFalseStrings.at(1);
+                paramBoolean.checkBox->setChecked( indenterSettings->value(paramBoolean.paramName + "/ValueDefault").toBool() );
+                paramBooleans.append(paramBoolean);
+
+                QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
+            }
+            // edit type is numeric so create a line edit with label
+            else if ( editType == "string" ) {
+                // read the parameter name as it is used at the command line or in its config file
+                QString parameterCallName = indenterSettings->value(indenterParameter + "/CallName").toString();
+
+                // create check box which enables or disables the parameter
+                QCheckBox *chkBox = new QCheckBox( toolBoxPages.at(category).page );
+                chkBox->setChecked( indenterSettings->value(indenterParameter + "/Enabled").toBool() );
+                chkBox->setToolTip( "Enables/disables the parameter. If disabled the indenters default value will be used." );
+                chkBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+                int left, top, right, bottom;
+                chkBox->getContentsMargins( &left, &top, &right, &bottom );
+                chkBox->setContentsMargins( left, top, 0, bottom );
+
+                // create the line edit
+                QLineEdit *lineEdit = new QLineEdit( toolBoxPages.at(category).page );
+                paramToolTip = indenterSettings->value(indenterParameter + "/Description").toString();
+                lineEdit->setToolTip( paramToolTip );
+                lineEdit->setMaximumWidth(50);
+                lineEdit->setMinimumWidth(50);
+                if ( mainWindow != NULL ) {
+                    lineEdit->installEventFilter( mainWindow );
+                }
+
+                // create the label
+                QLabel *label = new QLabel( toolBoxPages.at(category).page );
+                label->setText(indenterParameter);
+                label->setBuddy(lineEdit);
+                label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
+                label->setToolTip( paramToolTip );
+                if ( mainWindow != NULL ) {
+                    label->installEventFilter( mainWindow );
+                }
+
+                // put all into a layout and add it to the toolbox page
+                QHBoxLayout *hboxLayout = new QHBoxLayout();
+                hboxLayout->addWidget(chkBox);
+                hboxLayout->addWidget(lineEdit);
+                hboxLayout->addWidget(label);
+                toolBoxPages.at(category).vboxLayout->addLayout(hboxLayout);
+
+                // remember parameter name and reference to its line edit
+                ParamString paramString;
+                paramString.paramName = indenterParameter;
+                paramString.paramCallName = parameterCallName;
+                paramString.lineEdit = lineEdit;
+                paramString.label = label;
+                paramString.valueEnabledChkBox = chkBox;
+                paramString.lineEdit->setText( indenterSettings->value(paramString.paramName + "/ValueDefault").toString() );
+                paramStrings.append(paramString);
+
+                QObject::connect(lineEdit, SIGNAL(editingFinished()), this, SLOT(handleChangedIndenterSettings()));
+                QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
+            }
+            // edit type is multiple so create a combobox with label
+            else if ( editType == "multiple" ) {
+                // read the parameter name as it is used at the command line or in its config file
+                QString parameterCallName = indenterSettings->value(indenterParameter + "/CallName").toString();
+
+                // create checkbox which enables or disables the parameter
+                QCheckBox *chkBox = new QCheckBox( toolBoxPages.at(category).page );
+                chkBox->setChecked( indenterSettings->value(indenterParameter + "/Enabled").toBool() );
+                chkBox->setToolTip( "Enables/disables the parameter. If disabled the indenters default value will be used." );
+                chkBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+                int left, top, right, bottom;
+                chkBox->getContentsMargins( &left, &top, &right, &bottom );
+                chkBox->setContentsMargins( left, top, 0, bottom );
+
+                // create the combo box
+                QComboBox *comboBox = new QComboBox( toolBoxPages.at(category).page );
+                QStringList choicesStrings = indenterSettings->value(indenterParameter + "/Choices").toString().split("|");
+                QStringList choicesStringsReadable = indenterSettings->value(indenterParameter + "/ChoicesReadable").toString().split("|", QString::SkipEmptyParts);
+                if ( choicesStringsReadable.isEmpty() ) {
+                    comboBox->addItems( choicesStrings );
+                }
+                else {
+                    comboBox->addItems( choicesStringsReadable );
+                }
+                paramToolTip = indenterSettings->value(indenterParameter + "/Description").toString();
+                comboBox->setToolTip( paramToolTip );
+                if ( mainWindow != NULL ) {
+                    comboBox->installEventFilter( mainWindow );
+                }
+
+                // put all into a layout and add it to the toolbox page
+                QHBoxLayout *hboxLayout = new QHBoxLayout();
+                hboxLayout->addWidget(chkBox);
+                hboxLayout->addWidget(comboBox);
+                toolBoxPages.at(category).vboxLayout->addLayout(hboxLayout);
+
+                // remember parameter name and reference to its lineedit
+                ParamMultiple paramMultiple;
+                paramMultiple.paramName = indenterParameter;
+                paramMultiple.paramCallName = parameterCallName;
+                paramMultiple.comboBox = comboBox;
+                paramMultiple.choicesStrings = choicesStrings;
+                paramMultiple.choicesStringsReadable = choicesStringsReadable;
+                paramMultiple.valueEnabledChkBox = chkBox;
+                paramMultiple.comboBox->setCurrentIndex( indenterSettings->value(paramMultiple.paramName + "/ValueDefault").toInt() );
+                paramMultiples.append(paramMultiple);
+
+                QObject::connect(comboBox, SIGNAL(activated(int)), this, SLOT(handleChangedIndenterSettings()));
+                QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
+#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
+                connect( comboBox, SIGNAL(activated(int)), comboBox, SLOT(repaint()) );
+#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
+            }
+        }
+    }
+
+    // put a spacer at each page end
+    foreach (ToolBoxPage tbp, toolBoxPages) {
+        tbp.vboxLayout->addStretch();
+    }
+}
+
+
+/*!
+    \brief Searches and returns all indenters a configuration file is found for.
+
+    Opens all uigui ini files found in the list \a indenterIniFileList, opens each ini file
+    and reads the there defined real name of the indenter. These names are being returned as QStringList.
+ */
+QStringList IndentHandler::getAvailableIndenters() {
+    QStringList indenterNamesList;
+
+    // Loop for every existing uigui ini file
+    foreach (QString indenterIniFile, indenterIniFileList) {
+        // Open the ini file and search for the indenter name
+        QFile file(indenterDirctoryStr + "/" + indenterIniFile);
+        if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) {
+            int index = -1;
+            QByteArray line;
+            // Search for the string "indenterName=" and get the following string until line end.
+            while ( index == -1 &&  !file.atEnd() ) {
+                line = file.readLine();
+                index = line.indexOf( "indenterName=", 0);
+            }
+
+            if ( index == 0 ) {
+                line = line.remove(0, 13);
+                indenterNamesList << line.trimmed();
+            }
+        }
+    }
+    return indenterNamesList;
+}
+
+
+/*!
+    \brief Deletes all elements in the toolbox and initializes the indenter selected by \a indenterID.
+ */
+void IndentHandler::setIndenter(int indenterID) {
+    QApplication::setOverrideCursor(Qt::WaitCursor);
+
+#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
+    disconnect( toolBox, SIGNAL(currentChanged(int)), this, SLOT(repaint()) );
+#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
+
+    // Generate the parameter string that will be saved to the indenters config file.
+    QString parameterString = getParameterString();
+    if ( !indenterFileName.isEmpty() ) {
+        saveConfigFile( settingsDirctoryStr + "/" + indenterFileName + ".cfg", parameterString );
+    }
+
+    // Take care if the selected indenterID is smaller or greater than the number of existing indenters
+    if ( indenterID < 0 ) {
+        indenterID = 0;
+    }
+    if ( indenterID >= indenterIniFileList.count() ) {
+        indenterID = indenterIniFileList.count() - 1;
+    }
+
+    // remove all pages from the toolbox
+    for (int i = 0; i < toolBox->count(); i++) {
+        toolBox->removeItem(i);
+    }
+
+    // delete all toolbox pages and by this its children
+    foreach (ToolBoxPage toolBoxPage, toolBoxPages) {
+        delete toolBoxPage.page;
+    }
+
+    // empty all lists, which stored infos for the toolbox pages and its widgets
+    toolBoxPages.clear();
+    paramStrings.clear();
+    paramNumerics.clear();
+    paramBooleans.clear();
+    paramMultiples.clear();
+    delete indenterSettings;
+
+#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
+    QWidget dummyWidget;
+    toolBox->addItem(&dummyWidget, "dummyText");
+#endif
+
+    readIndentIniFile( indenterDirctoryStr + "/" + indenterIniFileList.at(indenterID) );
+
+    // Find out how the indenter can be executed.
+    createIndenterCallString();
+
+    // Load the users last settings made for this indenter.
+    loadConfigFile( settingsDirctoryStr + "/" + indenterFileName + ".cfg" );
+
+    handleChangedIndenterSettings();
+
+    QApplication::restoreOverrideCursor();
+
+#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
+    connect( toolBox, SIGNAL(currentChanged(int)), this, SLOT(repaint()) );
+    toolBox->removeItem( toolBox->indexOf(&dummyWidget) );
+#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
+}
+
+
+/*!
+    \brief Returns a string containing by the indenter supported file types/extensions divided by a space.
+ */
+QString IndentHandler::getPossibleIndenterFileExtensions() {
+    return fileTypes;
+}
+
+
+/*!
+    \brief Returns the path and filename of the current indenter config file.
+ */
+QString IndentHandler::getIndenterCfgFile() {
+    QFileInfo fileInfo( indenterDirctoryStr + "/" + configFilename );
+    return fileInfo.absoluteFilePath();
+}
+
+
+/*!
+    \brief Tries to create a call path string for the indenter executable. If successful returns true.
+ */
+bool IndentHandler::createIndenterCallString() {
+    QProcess indentProcess;
+
+    if ( indenterFileName.isEmpty() ) {
+        return false;
+    }
+
+    // First try to call the indenter inside of the data dir, using some suffix
+    // ------------------------------------------------------------------------
+
+    // Set the directory for the indenter execution
+    indentProcess.setWorkingDirectory( QFileInfo(indenterDirctoryStr).absoluteFilePath() );
+
+    foreach ( QString suffix, QStringList() << "" << ".exe" << ".bat" << ".com" << ".sh" ) {
+        indenterExecutableSuffix = suffix;
+        indenterExecutableCallString = QFileInfo(indenterDirctoryStr).absoluteFilePath() + "/" + indenterFileName;
+        indenterExecutableCallString += suffix;
+
+        // Only try to call the indenter, if the file exists.
+        if ( QFile::exists(indenterExecutableCallString) ) {
+            // Only try to call the indenter directly if it is no php file
+            if ( QFileInfo(indenterExecutableCallString).suffix().toLower() != "php" ) {
+                indentProcess.start( "\"" + indenterExecutableCallString +  + "\" " + indenterShowHelpParameter );
+                if ( indentProcess.waitForFinished(2000) ) {
+                    indenterExecutableCallString = "\"" + indenterExecutableCallString + "\"";
+                    return true;
+                }
+                else if ( indentProcess.error() == QProcess::Timedout ) {
+                    indenterExecutableCallString = "\"" + indenterExecutableCallString + "\"";
+                    return true;
+                }
+            }
+
+            // Test for needed interpreters
+            // ----------------------------
+            // If the file could not be executed, try to find a shebang at its start or test if its a php file.
+            QString interpreterName = "";
+            QFile indenterExecutable( indenterExecutableCallString );
+
+            // If indenter executable file has .php as suffix, use php as default interpreter
+            if ( QFileInfo(indenterExecutableCallString).suffix().toLower() == "php" ) {
+                interpreterName = "php -f";
+            }
+            // Else try to open the file and read the shebang.
+            else if ( indenterExecutable.open(QFile::ReadOnly) ) {
+                // Read the first line of the file.
+                QTextStream indenterExecutableContent(&indenterExecutable);
+                QString firstLineOfIndenterExe = indenterExecutableContent.readLine(75);
+                indenterExecutable.close();
+
+                // If the initial shebang is found, read the named intepreter. e.g. perl
+                if ( firstLineOfIndenterExe.startsWith("#!") ) {
+                    // Get the rightmost word. by splitting the string into only full words.
+                    interpreterName = firstLineOfIndenterExe.split( "/" ).last();
+                }
+            }
+
+            // Try to call the interpreter, if it exists.
+            if ( !interpreterName.isEmpty() ) {
+                indenterExecutableCallString = interpreterName + " \"" + indenterExecutableCallString + "\"";
+                indentProcess.start( interpreterName + " -h");
+                if ( indentProcess.waitForFinished(2000) ) {
+                    return true;
+                }
+                else if ( indentProcess.error() == QProcess::Timedout ) {
+                    return true;
+                }
+                // now we know an interpreter is needed but it could not be called, so inform the user.
+                else {
+                    errorMessageDialog->showMessage( tr("Interpreter needed"),
+                        tr("To use the selected indenter the program \"%1\" needs to be available in the global environment. You should add an entry to your path settings.").arg(interpreterName) );
+                    return true;
+                }
+            }
+        }
+    }
+
+
+    // If unsuccessful try if the indenter executable is a JavaScript file
+    // -------------------------------------------------------------------
+    indenterExecutableSuffix = ".js";
+    indenterExecutableCallString = QFileInfo(indenterDirctoryStr).absoluteFilePath() + "/" + indenterFileName;
+    indenterExecutableCallString += indenterExecutableSuffix;
+    if ( QFile::exists(indenterExecutableCallString) ) {
+        return true;
+    }
+
+
+    // If unsuccessful try to call the indenter global, using some suffix
+    // ------------------------------------------------------------------
+    foreach ( QString suffix, QStringList() << "" << ".exe" << ".bat" << ".com" << ".sh" ) {
+        indenterExecutableSuffix = suffix;
+        indenterExecutableCallString = indenterFileName + suffix;
+        indentProcess.start( indenterExecutableCallString + " " + indenterShowHelpParameter );
+        if ( indentProcess.waitForFinished(2000) ) {
+            return true;
+        }
+        else if ( indentProcess.error() == QProcess::Timedout ) {
+            return true;
+        }
+    }
+
+
+    // If even globally calling the indenter fails, try calling .com and .exe via wine
+    // -------------------------------------------------------------------------------
+    indenterExecutableCallString = "\"" + QFileInfo(indenterDirctoryStr).absoluteFilePath() + "/" + indenterFileName;
+
+    foreach ( QString suffix, QStringList() << ".exe" << ".com" ) {
+        indenterExecutableSuffix = suffix;
+        if ( QFile::exists(indenterDirctoryStr + "/" + indenterFileName + suffix) ) {
+            QProcess wineTestProcess;
+            wineTestProcess.start("wine --version");
+            // if the process of wine was not callable assume that wine is not installed
+            if ( !wineTestProcess.waitForFinished(2000) ) {
+                errorMessageDialog->showMessage(tr("wine not installed"), tr("There exists only a win32 executable of the indenter and wine does not seem to be installed. Please install wine to be able to run the indenter.") );
+                indenterExecutableCallString = "";
+                return false;
+            }
+            else {
+                indenterExecutableCallString = "\"" + QFileInfo(indenterDirctoryStr).absoluteFilePath() + "/";
+                indenterExecutableCallString += indenterFileName + suffix + "\"";
+                indenterExecutableCallString = "wine " + indenterExecutableCallString;
+
+                return true;
+            }
+        }
+    }
+
+    indenterExecutableCallString = "";
+    indenterExecutableSuffix = "";
+    return false;
+}
+
+
+/*!
+    \brief Returns a string that points to where the indenters manual can be found.
+ */
+QString IndentHandler::getManual() {
+    if ( indenterSettings != NULL ) {
+        return indenterSettings->value("header/manual").toString();
+    }
+    else {
+        return "";
+    }
+}
+
+
+/*!
+    \brief This slot gets the reference to the indenters manual and opens it.
+ */
+void IndentHandler::showIndenterManual() {
+    QString manualReference = getManual();
+    QDesktopServices::openUrl( manualReference );
+}
+
+
+/*!
+    \brief Can be called to update all widgets text to the currently selected language.
+ */
+void IndentHandler::retranslateUi() {
+    indenterSelectionCombobox->setToolTip( tr("<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body style=\" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Shows the currently chosen indenters name and lets you choose other available indenters</p></body></html>") );
+    indenterParameterHelpButton->setToolTip( tr("Brings you to the online manual of the currently selected indenter, where you can get further help on the possible parameters.") );
+
+    actionLoad_Indenter_Config_File->setText(QApplication::translate("IndentHandler", "Load Indenter Config File", 0, QApplication::UnicodeUTF8));
+    actionLoad_Indenter_Config_File->setStatusTip(QApplication::translate("IndentHandler", "Opens a file dialog to load the original config file of the indenter.", 0, QApplication::UnicodeUTF8));
+    actionLoad_Indenter_Config_File->setShortcut(QApplication::translate("IndentHandler", "Alt+O", 0, QApplication::UnicodeUTF8));
+
+    actionSave_Indenter_Config_File->setText(QApplication::translate("IndentHandler", "Save Indenter Config File", 0, QApplication::UnicodeUTF8));
+    actionSave_Indenter_Config_File->setStatusTip(QApplication::translate("IndentHandler", "Opens a dialog to save the current indenter configuration to a file.", 0, QApplication::UnicodeUTF8));
+    actionSave_Indenter_Config_File->setShortcut(QApplication::translate("IndentHandler", "Alt+S", 0, QApplication::UnicodeUTF8));
+
+    actionCreateShellScript->setText(QApplication::translate("IndentHandler", "Create Indenter Call Shell Script", 0, QApplication::UnicodeUTF8));
+    actionCreateShellScript->setToolTip(QApplication::translate("IndentHandler", "Create a shell script that calls the current selected indenter for formatting an as parameter given file with the current indent settings", 0, QApplication::UnicodeUTF8));
+    actionCreateShellScript->setStatusTip(QApplication::translate("IndentHandler", "Create a shell script that calls the current selected indenter for formatting an as parameter given file with the current indent settings", 0, QApplication::UnicodeUTF8));
+
+    actionResetIndenterParameters->setText(QApplication::translate("IndentHandler", "Reset indenter parameters", 0, QApplication::UnicodeUTF8));
+    actionResetIndenterParameters->setToolTip(QApplication::translate("IndentHandler", "Resets all indenter parameters to the default values.", 0, QApplication::UnicodeUTF8));
+    actionResetIndenterParameters->setStatusTip(QApplication::translate("IndentHandler", "Resets all indenter parameters to the default values.", 0, QApplication::UnicodeUTF8));
+}
+
+
+/*!
+    \brief Returns the name of the currently selected indenter.
+ */
+QString IndentHandler::getCurrentIndenterName() {
+    QString currentIndenterName = indenterSelectionCombobox->currentText();
+
+    // Remove the supported programming languages from indenters name, which are set in braces.
+    if ( currentIndenterName.indexOf("(") > 0 ) {
+        // Using index-1 to also leave out the blank before the brace.
+        currentIndenterName = currentIndenterName.left( currentIndenterName.indexOf("(")-1 );
+    }
+
+    return currentIndenterName;
+}
+
+
+/*!
+    \brief Shows a file open dialog to open an existing config file for the currently selected indenter.
+
+    If the file was successfully opened the indent handler is called to load the settings and update itself.
+*/
+void IndentHandler::openConfigFileDialog() {
+    QString configFilePath;
+
+    configFilePath = QFileDialog::getOpenFileName( NULL, tr("Choose indenter config file"), getIndenterCfgFile(), "All files (*.*)" );
+
+    if (configFilePath != "") {
+        loadConfigFile(configFilePath);
+    }
+}
+
+
+/*!
+    \brief Calls the indenter config file save as dialog to save the config file under a chosen name.
+
+    If the file already exists and it should be overwritten, a warning is shown before.
+*/
+void IndentHandler::saveasIndentCfgFileDialog() {
+    QString fileExtensions = tr("All files")+" (*.*)";
+
+    //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
+    QString fileName = QFileDialog::getSaveFileName( this, tr("Save indent config file"), getIndenterCfgFile(), fileExtensions);
+
+    if (fileName != "") {
+        QFile::remove(fileName);
+        QFile outCfgFile(fileName);
+        outCfgFile.open( QFile::ReadWrite | QFile::Text );
+        outCfgFile.write( getParameterString().toAscii() );
+        outCfgFile.close();
+    }
+}
+
+
+/*!
+    \brief Invokes the indenter to create a shell script.
+
+    Lets the indenter create a shell script for calling the indenter out of any
+    other application and open a save dialog for saving the shell script.
+*/
+void IndentHandler::createIndenterCallShellScript() {
+    // Get the content of the shell/batch script.
+    QString indenterCallShellScript = generateCommandlineCall();
+
+    QString shellScriptExtension;
+#if defined(Q_OS_WIN32)
+    shellScriptExtension = "bat";
+#else
+    shellScriptExtension = "sh";
+#endif
+
+    QString fileExtensions = tr("Shell Script")+" (*."+shellScriptExtension+");;"+tr("All files")+" (*.*)";
+
+    QString currentIndenterName = getCurrentIndenterName();
+    currentIndenterName = currentIndenterName.replace(" ", "_");
+
+    //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
+    QString fileName = QFileDialog::getSaveFileName( this, tr("Save shell script"), "call_"+currentIndenterName+"."+shellScriptExtension, fileExtensions);
+
+    // Saving has been canceled if the filename is empty
+    if ( fileName.isEmpty() ) {
+        return;
+    }
+
+    // Replace placeholder for script name in script template.
+    indenterCallShellScript = indenterCallShellScript.replace( "__INDENTERCALLSTRINGSCRIPTNAME__", QFileInfo(fileName).fileName() );
+
+    // Delete any old file, write the new contents and set executable permissions.
+    QFile::remove(fileName);
+    QFile outSrcFile(fileName);
+    outSrcFile.open( QFile::ReadWrite | QFile::Text );
+    outSrcFile.write( indenterCallShellScript.toAscii() );
+#if !defined(Q_OS_WIN32)
+    // For none Windows systems set the files executable flag
+    outSrcFile.setPermissions( outSrcFile.permissions() | QFile::ExeOwner | QFile::ExeUser| QFile::ExeGroup );
+#endif
+    outSrcFile.close();
+}
+
+
+/*!
+    \brief Resets all parameters to the indenters default values as they are specified in the uigui ini file
+    but asks the user whether to do it really.
+ */
+void IndentHandler::resetIndenterParameter() {
+    int messageBoxAnswer = QMessageBox::question(this, tr("Really reset parameters?"), tr("Do you really want to reset the indenter parameters to the default values?"), QMessageBox::Yes | QMessageBox::Abort );
+    if ( messageBoxAnswer == QMessageBox::Yes ) {
+        resetToDefaultValues();
+    }
+}
+
+
+/*!
+    \brief Catch some events and let some other be handled by the super class.
+
+    Is needed for use as Notepad++ plugin.
+ */
+bool IndentHandler::event( QEvent *event ) {
+    if ( event->type() == QEvent::WindowActivate ) {
+        event->accept();
+        return true;
+    }
+    else if ( event->type() == QEvent::WindowDeactivate ) {
+        event->accept();
+        return true;
+    }
+    else {
+        event->ignore();
+        return QWidget::event(event);
+    }
+}
+
+
+/*!
+    \brief Sets the function pointer \a parameterChangedCallback to the given callback
+    function \a paramChangedCallback.
+
+    Is needed for use as Notepad++ plugin.
+ */
+void IndentHandler::setParameterChangedCallback( void(*paramChangedCallback)(void) ) {
+    parameterChangedCallback = paramChangedCallback;
+}
+
+
+/*!
+    \brief Emits the \a indenterSettingsChanged signal and if set executes the \a parameterChangedCallback function.
+
+   Is needed for use as Notepad++ plugin.
+ */
+void IndentHandler::handleChangedIndenterSettings() {
+    emit( indenterSettingsChanged() );
+
+    if ( parameterChangedCallback != NULL ) {
+        parameterChangedCallback();
+    }
+}
+
+
+/*!
+    \brief Sets a callback function that shall be called, when the this indenter parameter window gets closed.
+
+   Is needed for use as Notepad++ plugin.
+ */
+void IndentHandler::setWindowClosedCallback( void(*winClosedCallback)(void) ) {
+    windowClosedCallback = winClosedCallback;
+}
+
+
+/*!
+    \brief Is called on this indenter parameter window close and if set calls the function \a windowClosedCallback.
+
+    Is needed for use as Notepad++ plugin.
+ */
+void IndentHandler::closeEvent(QCloseEvent *event) {
+    if ( windowClosedCallback != NULL ) {
+        windowClosedCallback();
+    }
+    event->accept();
+}
+
+
+/*!
+    \brief Returns the id (list index) of the currently selected indenter.
+ */
+int IndentHandler::getIndenterId() {
+    return indenterSelectionCombobox->currentIndex();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/IndentHandler.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,192 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef INDENTHANDLER_H
+#define INDENTHANDLER_H
+
+#include <QWidget>
+#include <QToolBox>
+#include <QVBoxLayout>
+#include <QApplication>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QToolButton>
+#include <QFile>
+#include <QProcess>
+#include <QSettings>
+#include <QStringList>
+#include <QLineEdit>
+#include <QSpinBox>
+#include <QLabel>
+#include <QByteArray>
+#include <QDir>
+#include <QMessageBox>
+#include <QMainWindow>
+#include <QTextStream>
+#include <QTextCodec>
+#include <QtScript>
+#include <QDesktopServices>
+#include <QMenu>
+#include <QAction>
+#include <QContextMenuEvent>
+#include <QFileDialog>
+
+#include "UiGuiErrorMessage.h"
+#include "TemplateBatchScript.h"
+#include "UiGuiIniFileParser.h"
+#include "SettingsPaths.h"
+
+
+class IndentHandler : public QWidget
+{
+    Q_OBJECT
+
+public:
+    IndentHandler(int indenterID, QWidget *mainWindow = NULL, QWidget *parent = NULL);
+    ~IndentHandler();
+
+    QString generateCommandlineCall();
+    QString callIndenter(QString sourceCode, QString inputFileExtension);
+    bool loadConfigFile(QString filePathName);
+    void resetToDefaultValues();
+    QStringList getAvailableIndenters();
+    QString getPossibleIndenterFileExtensions();
+    QString getParameterString();
+    QString getIndenterCfgFile();
+    QString getManual();
+    void retranslateUi();
+    QString getCurrentIndenterName();
+    QMenu* getIndenterMenu();
+    QList<QAction*> getIndenterMenuActions();
+    void contextMenuEvent( QContextMenuEvent *event );
+    void setParameterChangedCallback( void(*paramChangedCallback)(void) );
+    void setWindowClosedCallback( void(*winClosedCallback)(void) );
+    int getIndenterId();
+
+signals:
+    void indenterSettingsChanged();
+    void selectedIndenterIndexChanged(int index);
+
+protected:
+    bool event( QEvent *event );
+    void closeEvent(QCloseEvent *event);
+    
+private slots:
+    void setIndenter(int indenterID);
+    void showIndenterManual();
+    void openConfigFileDialog();
+    void saveasIndentCfgFileDialog();
+    void createIndenterCallShellScript();
+    void resetIndenterParameter();
+    void handleChangedIndenterSettings();
+
+private:
+    QString callExecutableIndenter(QString sourceCode, QString inputFileExtension);
+    QString callJavaScriptIndenter(QString sourceCode);
+    void saveConfigFile(QString filePathName, QString parameterString);
+    void readIndentIniFile(QString iniFilePath);
+    bool createIndenterCallString();
+    void initIndenterMenu();
+
+    //! Holds a reference to all created pages of the toolbox and the pages boxlayout
+    struct ToolBoxPage {
+        QWidget *page;
+        QVBoxLayout *vboxLayout;
+    };
+    QVector<ToolBoxPage> toolBoxPages;
+
+    //! Holds a reference to all checkboxes needed for boolean parameter setting and the parameters name
+    struct ParamBoolean {
+        QString paramName;
+        QString trueString;
+        QString falseString;
+        QCheckBox *checkBox;
+    };
+    QVector<ParamBoolean> paramBooleans;
+
+    //! Holds a reference to all line edits needed for parameter setting and the parameters name
+    struct ParamString {
+        QString paramName;
+        QString paramCallName;
+        QCheckBox *valueEnabledChkBox;
+        QLineEdit *lineEdit;
+        QLabel *label;
+    };
+    QVector<ParamString> paramStrings;
+
+    //! Hold a reference to all spin boxes needed for parameter setting and the parameters name
+    struct ParamNumeric {
+        QString paramName;
+        QString paramCallName;
+        QCheckBox *valueEnabledChkBox;
+        QSpinBox *spinBox;
+        QLabel *label;
+    };
+    QVector<ParamNumeric> paramNumerics;
+
+    //! Hold a reference to all combo boxes needed for parameter setting and the parameters name
+    struct ParamMultiple {
+        QString paramName;
+        QString paramCallName;
+        QCheckBox *valueEnabledChkBox;
+        QComboBox *comboBox;
+        QStringList choicesStrings;
+		QStringList choicesStringsReadable;
+    };
+    QVector<ParamMultiple> paramMultiples;
+
+    QComboBox *indenterSelectionCombobox;
+    QToolButton *indenterParameterHelpButton;
+    QVBoxLayout *vboxLayout;
+    QToolBox *toolBox;
+    UiGuiIniFileParser *indenterSettings;
+    QStringList indenterParameters;
+    //! The indenters name in a descriptive form
+    QString indenterName;
+    //! The indenters file name (w/o extension), that is being called
+    QString indenterFileName;
+    QString indenterDirctoryStr;
+    QString tempDirctoryStr;
+    QString settingsDirctoryStr;
+    QStringList indenterIniFileList;
+	QString parameterOrder;
+    QString configFilename;
+    QString cfgFileParameterEnding;
+    QString inputFileParameter;
+    QString inputFileName;
+    QString outputFileParameter;
+    QString outputFileName;
+    QString fileTypes;
+    QString useCfgFileParameter;
+    QString indenterShowHelpParameter;
+    QWidget *mainWindow;
+    UiGuiErrorMessage *errorMessageDialog;
+    QString indenterExecutableCallString;
+    QString indenterExecutableSuffix;
+
+    QMenu *menuIndenter;
+    QAction *actionLoad_Indenter_Config_File;
+    QAction *actionSave_Indenter_Config_File;
+    QAction *actionCreateShellScript;
+    QAction *actionResetIndenterParameters;
+    void(*parameterChangedCallback)(void);
+    void(*windowClosedCallback)(void);
+};
+
+#endif // INDENTHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/MainWindow.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,1389 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "MainWindow.h"
+
+//! \defgroup grp_MainWindow All concerning main window functionality.
+
+/*!
+    \class MainWindow
+    \ingroup grp_MainWindow
+    \brief Is the main window of UniversalIndentGUI
+
+    The MainWindow class is responsible for generating and displaying most of the gui elements.
+    Its look is set in the file "mainwindow.ui". An object for the indent handler is generated here
+    and user actions are being controlled. Is responsible for file open dialogs and indenter selection.
+ */
+
+/*!
+    \brief Constructs the main window.
+ */
+MainWindow::MainWindow(QString file2OpenOnStart, QWidget *parent) : QMainWindow(parent) {
+    // set the program version, revision and date, which is shown in the main window title and in the about dialog.
+    version = "1.0.2";
+    revision = "888";
+    QDate buildDate(2008, 11, 3);
+    buildDateStr = buildDate.toString("d. MMMM yyyy");
+
+    // Init of some variables.
+    sourceCodeChanged = false;
+    scrollPositionChanged = false;
+
+    // Create the settings object, which loads all UiGui settings from a file.
+    settings = UiGuiSettings::getInstance();
+
+    // Initialize the language of the application.
+    initApplicationLanguage();
+
+    // Creates the main window and initializes it.
+    initMainWindow();
+
+    // Create toolbar and insert it into the main window.
+    initToolBar();
+
+    // Create the text edit component using the QScintilla widget.
+    initTextEditor();
+
+    // Create and init the syntax highlighter.
+    initSyntaxHighlighter();
+
+    // Create and init the indenter.
+    initIndenter();
+
+    // Create some menus.
+    createEncodingMenu();
+    createHighlighterMenu();
+
+
+    // generate about dialog box
+    aboutDialog = new AboutDialog(this, Qt::SplashScreen, version, revision, buildDateStr);
+    aboutDialogGraphicsView = new AboutDialogGraphicsView(aboutDialog, this);
+    connect( toolBarWidget->pbAbout, SIGNAL(clicked()), this, SLOT(showAboutDialog()) );
+    connect( actionAbout_UniversalIndentGUI, SIGNAL(triggered()), this, SLOT(showAboutDialog()) );
+
+    // generate settings dialog box
+    settingsDialog = new UiGuiSettingsDialog(this, settings);
+    connect( actionShowSettings, SIGNAL(triggered()), settingsDialog, SLOT(showDialog()) );
+
+    // If a file that should be opened on start has been handed over to the constructor exists, load it
+    if ( QFile::exists(file2OpenOnStart) ) {
+        openSourceFileDialog(file2OpenOnStart);
+    }
+    // Otherwise load the last opened file, if this is enabled in the settings.
+    else {
+        loadLastOpenedFile();
+    }
+
+    updateSourceView();
+
+    // Check if a newer version is available but only if the setting for that is enabled and today not already a check has been done.
+    if ( settings->getValueByName("CheckForUpdate").toBool() && QDate::currentDate() != settings->getValueByName("LastUpdateCheck").toDate() ) {
+        updateCheckDialog->checkForUpdate();
+    }
+
+    // Enable accept dropping of files.
+    setAcceptDrops(true);
+}
+
+
+/*!
+    \brief Initializes the main window by creating the main gui and make some settings.
+ */
+void MainWindow::initMainWindow() {
+    // Generate gui as it is build in the file "mainwindow.ui"
+    setupUi(this);
+
+    // Handle last opened window size
+    // ------------------------------
+    bool maximized = settings->getValueByName("WindowIsMaximized").toBool();
+    QPoint pos = settings->getValueByName("WindowPosition").toPoint();
+    QSize size = settings->getValueByName("WindowSize").toSize();
+    resize(size);
+    move(pos);
+    if ( maximized ) {
+        showMaximized();
+    }
+#ifndef Q_OS_MAC // On Mac restoring the window state causes the screenshot no longer to work.
+    restoreState( settings->getValueByName("MainWindowState").toByteArray() );
+#endif
+
+    // Handle if first run of this version
+    // -----------------------------------
+    QString readVersion = settings->getValueByName("VersionInSettingsFile").toString();
+    // If version strings are not equal set first run true.
+    if ( readVersion != version ) {
+        isFirstRunOfThisVersion = true;
+    }
+    else {
+        isFirstRunOfThisVersion = false;
+    }
+
+    // Get last selected file encoding
+    // -------------------------------
+    currentEncoding = settings->getValueByName("FileEncoding").toString();
+
+    updateCheckDialog = new UpdateCheckDialog(version, settings, this);
+
+    // Register the syntax highlightning setting in the menu to the settings object.
+    connect( enableSyntaxHighlightningAction, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
+    connect( settings, SIGNAL(syntaxHighlightningEnabled(bool)), enableSyntaxHighlightningAction, SLOT(setChecked(bool)) );
+    enableSyntaxHighlightningAction->setChecked( settings->getValueByName("SyntaxHighlightningEnabled").toBool() );
+    // Tell the highlighter if it has to be enabled or disabled.
+    connect( settings, SIGNAL(syntaxHighlightningEnabled(bool)), this, SLOT(turnHighlightOnOff(bool)) );
+
+    // Register the load last file setting in the menu to the settings object.
+    connect( loadLastOpenedFileOnStartupAction, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
+    connect( settings, SIGNAL(loadLastOpenedFileOnStartup(bool)), loadLastOpenedFileOnStartupAction, SLOT(setChecked(bool)) );
+    loadLastOpenedFileOnStartupAction->setChecked( settings->getValueByName("LoadLastOpenedFileOnStartup").toBool() );
+
+    // Register the white space setting in the menu to the settings object.
+    connect( whiteSpaceIsVisibleAction, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
+    connect( settings, SIGNAL(whiteSpaceIsVisible(bool)), whiteSpaceIsVisibleAction, SLOT(setChecked(bool)) );
+    whiteSpaceIsVisibleAction->setChecked( settings->getValueByName("WhiteSpaceIsVisible").toBool() );
+    // Tell the QScintilla editor if it has to show white space.
+    connect( settings, SIGNAL(whiteSpaceIsVisible(bool)), this, SLOT(setWhiteSpaceVisibility(bool)) );
+
+    // Connect the remaining menu items.
+    connect( actionOpen_Source_File, SIGNAL(triggered()), this, SLOT(openSourceFileDialog()) );
+    connect( actionSave_Source_File_As, SIGNAL(triggered()), this, SLOT(saveasSourceFileDialog()) );
+    connect( actionSave_Source_File, SIGNAL(triggered()), this, SLOT(saveSourceFile()) );
+    connect( actionExportPDF, SIGNAL(triggered()), this, SLOT(exportToPDF()) );
+    connect( actionExportHTML, SIGNAL(triggered()), this, SLOT(exportToHTML()) );
+    connect( actionCheck_for_update, SIGNAL(triggered()), updateCheckDialog, SLOT(checkForUpdateAndShowDialog()) );
+
+    // Init the menu for selecting one of the recently opened files.
+    updateRecentlyOpenedList();
+    connect( menuRecently_Opened_Files, SIGNAL(triggered(QAction*)), this, SLOT(openFileFromRecentlyOpenedList(QAction*)) );
+    connect( settings, SIGNAL(recentlyOpenedListSize(int)), this, SLOT(updateRecentlyOpenedList()) );
+}
+
+
+/*!
+    \brief Creates and inits the tool bar. It is added to the main window.
+ */
+void MainWindow::initToolBar() {
+    // Create the tool bar and add it to the main window.
+    toolBarWidget = new Ui::ToolBarWidget();
+    QWidget* helpWidget = new QWidget();
+    toolBarWidget->setupUi(helpWidget);
+    toolBar->addWidget(helpWidget);
+    toolBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea );
+
+    // Connect the tool bar widgets to their functions.
+    connect( toolBarWidget->enableSyntaxHighlightningCheckBox, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
+    connect( settings, SIGNAL(syntaxHighlightningEnabled(bool)), toolBarWidget->enableSyntaxHighlightningCheckBox, SLOT(setChecked(bool)) );
+    toolBarWidget->enableSyntaxHighlightningCheckBox->setChecked( settings->getValueByName("SyntaxHighlightningEnabled").toBool() );
+    toolBarWidget->enableSyntaxHighlightningCheckBox->hide();
+    connect( toolBarWidget->pbOpen_Source_File, SIGNAL(clicked()), this, SLOT(openSourceFileDialog()) );
+    connect( toolBarWidget->pbExit, SIGNAL(clicked()), this, SLOT(close()));
+    connect( toolBarWidget->cbLivePreview, SIGNAL(toggled(bool)), this, SLOT(previewTurnedOnOff(bool)) );
+    connect( toolBarWidget->cbLivePreview, SIGNAL(toggled(bool)), actionLive_Indent_Preview, SLOT(setChecked(bool)) );
+    connect( actionLive_Indent_Preview, SIGNAL(toggled(bool)), toolBarWidget->cbLivePreview, SLOT(setChecked(bool)) );
+}
+
+
+/*!
+    \brief Create and initialize the text editor component. It uses the QScintilla widget.
+ */
+void MainWindow::initTextEditor() {
+    QMessageBox infoQScintillaLoad(NULL);
+    infoQScintillaLoad.setWindowTitle("Loading QScintilla...");
+    infoQScintillaLoad.setText("Trying to load QScintilla library.\nIf anything fails during loading, it might be possible that the debug and release version of QScintilla are mixed.");
+    infoQScintillaLoad.show();
+    // Create the QScintilla widget and add it to the layout.
+    // Try and catch doesn't seem to catch the runtime error when starting UiGUI release with QScintilla debug lib and the other way around.
+    try {
+        qSciSourceCodeEditor = new QsciScintilla(this);
+    }
+    catch (...) {
+        QMessageBox::critical(this, "Error creating QScintilla text editor component!",
+            "During trying to create the text editor component, that is based on QScintilla, an error occurred. Please make sure that you have installed QScintilla and not mixed release and debug versions." );
+        exit(1);
+    }
+    infoQScintillaLoad.hide();
+
+    hboxLayout1->addWidget(qSciSourceCodeEditor);
+
+    // Make some settings for the QScintilla widget.
+    qSciSourceCodeEditor->setUtf8(true);
+    qSciSourceCodeEditor->setMarginLineNumbers(1, true);
+    qSciSourceCodeEditor->setMarginWidth(1, QString("10000") );
+    qSciSourceCodeEditor->setBraceMatching(qSciSourceCodeEditor->SloppyBraceMatch);
+    qSciSourceCodeEditor->setMatchedBraceForegroundColor( QColor("red") );
+    qSciSourceCodeEditor->setFolding(QsciScintilla::BoxedTreeFoldStyle);
+    qSciSourceCodeEditor->setAutoCompletionSource(QsciScintilla::AcsAll);
+    qSciSourceCodeEditor->setAutoCompletionThreshold(3);
+
+    // Handle if white space is set to be visible
+    bool whiteSpaceIsVisible = settings->getValueByName("WhiteSpaceIsVisible").toBool();
+    setWhiteSpaceVisibility( whiteSpaceIsVisible );
+
+    // Handle the width of tabs in spaces
+    int tabWidth = settings->getValueByName("TabWidth").toInt();
+    qSciSourceCodeEditor->setTabWidth(tabWidth);
+
+    // Remember a pointer to the scrollbar of the QScintilla widget used to keep
+    // on the same line as before when turning preview on/off.
+    textEditVScrollBar = qSciSourceCodeEditor->verticalScrollBar();
+
+    // Add a column row indicator to the status bar.
+    textEditLineColumnInfoLabel = new QLabel( tr("Line %1, Column %2").arg(1).arg(1) );
+    statusbar->addPermanentWidget(textEditLineColumnInfoLabel);
+    connect( qSciSourceCodeEditor, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(setStatusBarCursorPosInfo(int, int)) );
+
+    // Connect the text editor to dependent functions.
+    connect( qSciSourceCodeEditor, SIGNAL(textChanged()), this, SLOT(sourceCodeChangedHelperSlot()) );
+    connect( qSciSourceCodeEditor, SIGNAL(linesChanged()), this, SLOT(numberOfLinesChanged()) );
+    connect( settings, SIGNAL(tabWidth(int)), qSciSourceCodeEditor, SLOT(setTabWidth(int)) );
+    qSciSourceCodeEditor->setTabWidth( settings->getValueByName("TabWidth").toInt() );
+}
+
+
+/*!
+    \brief Create and init the syntax highlighter and set it to use the QScintilla edit component.
+ */
+void MainWindow::initSyntaxHighlighter() {
+    // Create the highlighter.
+    highlighter = new UiGuiHighlighter(qSciSourceCodeEditor);
+
+    // Handle if syntax highlighting is enabled
+    bool syntaxHighlightningEnabled = settings->getValueByName("SyntaxHighlightningEnabled").toBool();
+    if ( syntaxHighlightningEnabled ) {
+        highlighter->turnHighlightOn();
+    }
+    else {
+        highlighter->turnHighlightOff();
+    }
+}
+
+
+/*!
+    \brief Initializes the language of UniversalIndentGUI.
+
+    If the program language is defined in the settings, the corresponding language
+    file will be loaded and set for the application. If not set there, the system
+    default language will be set, if a translation file for that language exists.
+    Returns true, if the translation file could be loaded. Otherwise it returns
+    false and uses the default language, which is English.
+ */
+bool MainWindow::initApplicationLanguage() {
+    QString languageShort;
+
+    // Get the language settings from the settings object.
+    int languageIndex = settings->getValueByName("Language").toInt();
+
+    // If no language was set, indicated by a negative index, use the system language.
+    if ( languageIndex < 0 ) {
+        languageShort = QLocale::system().name();
+
+        // Chinese and Japanese language consist of country and language code.
+        // For all others the language code will be cut off.
+        if ( languageShort.left(2) != "zh" && languageShort.left(2) != "ja" ) {
+            languageShort = languageShort.left(2);
+        }
+
+        // If no translation file for the systems local language exist, fall back to English.
+        if ( settings->getAvailableTranslations().indexOf(languageShort) < 0 ) {
+            languageShort = "en";
+        }
+
+        // Set the language setting to the new language.
+        settings->setValueByName("Language", settings->getAvailableTranslations().indexOf(languageShort) );
+    }
+    // If a language was defined in the settings, get this language mnemonic.
+    else {
+        languageShort = settings->getAvailableTranslations().at(languageIndex);
+    }
+
+    // Load the Qt own translation file and set it for the application.
+    qTTranslator = new QTranslator();
+    bool translationFileLoaded;
+    translationFileLoaded = qTTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/qt_" + languageShort );
+    if ( translationFileLoaded ) {
+        qApp->installTranslator(qTTranslator);
+    }
+
+    // Load the uigui translation file and set it for the application.
+    uiGuiTranslator = new QTranslator();
+    translationFileLoaded = uiGuiTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/universalindent_" + languageShort );
+    if ( translationFileLoaded ) {
+        qApp->installTranslator(uiGuiTranslator);
+    }
+
+    connect( settings, SIGNAL(language(int)), this, SLOT(languageChanged(int)) );
+
+    return translationFileLoaded;
+}
+
+
+/*!
+    \brief Creates and initializes the indenter.
+ */
+void MainWindow::initIndenter() {
+    // Get Id of last selected indenter.
+    currentIndenterID = settings->getValueByName("SelectedIndenter").toInt();
+
+    // Create the indenter widget with the ID and add it to the layout.
+    indentHandler = new IndentHandler(currentIndenterID, this, centralwidget);
+    vboxLayout->addWidget(indentHandler);
+
+    // If settings for the indenter have changed, let the main window know aboud it.
+    connect(indentHandler, SIGNAL(indenterSettingsChanged()), this, SLOT(indentSettingsChangedSlot()));
+
+    // Set this true, so the indenter is called at first program start
+    indentSettingsChanged = true;
+    previewToggled = true;
+
+    // Handle if indenter parameter tool tips are enabled
+    connect( indenterParameterTooltipsEnabledAction, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
+    connect( settings, SIGNAL(indenterParameterTooltipsEnabled(bool)), indenterParameterTooltipsEnabledAction, SLOT(setChecked(bool)) );
+    indenterParameterTooltipsEnabledAction->setChecked( settings->getValueByName("IndenterParameterTooltipsEnabled").toBool() );
+
+    // Add the indenters context menu to the mainwindows menu.
+    menuIndenter->addActions( indentHandler->getIndenterMenuActions() );
+}
+
+
+/*!
+    \brief Tries to load the by \a filePath defined file and returns its content as QString.
+
+    If the file could not be loaded a error dialog will be shown.
+ */
+QString MainWindow::loadFile(QString filePath) {
+    QFile inSrcFile(filePath);
+    QString fileContent = "";
+
+    if ( !inSrcFile.open(QFile::ReadOnly | QFile::Text) ) {
+        QMessageBox::warning(NULL, tr("Error opening file"), tr("Cannot read the file ")+"\""+filePath+"\"." );
+    }
+    else {
+        QTextStream inSrcStrm(&inSrcFile);
+        QApplication::setOverrideCursor(Qt::WaitCursor);
+        inSrcStrm.setCodec( QTextCodec::codecForName(currentEncoding.toAscii()) );
+        fileContent = inSrcStrm.readAll();
+        QApplication::restoreOverrideCursor();
+        inSrcFile.close();
+
+        QFileInfo fileInfo(filePath);
+        currentSourceFileExtension = fileInfo.suffix();
+        int indexOfHighlighter = highlighter->setLexerForExtension( currentSourceFileExtension );
+        highlighterActionGroup->actions().at(indexOfHighlighter)->setChecked(true);
+    }
+    return fileContent;
+}
+
+
+/*!
+    \brief Calls the source file open dialog to load a source file for the formatting preview.
+
+    If the file was successfully loaded the indenter will be called to generate the formatted source code.
+ */
+void MainWindow::openSourceFileDialog(QString fileName) {
+    // If the source code file is changed and the shown dialog for saving the file
+    // is canceled, also stop opening another source file.
+    if ( !maybeSave() ) {
+        return;
+    }
+    QString openedSourceFileContent = "";
+    QString fileExtensions = tr("Supported by indenter")+" ("+indentHandler->getPossibleIndenterFileExtensions()+
+                             ");;"+tr("All files")+" (*.*)";
+
+    //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
+    if ( fileName.isEmpty() ) {
+        fileName = QFileDialog::getOpenFileName( this, tr("Choose source code file"), currentSourceFile, fileExtensions);
+    }
+
+    if (fileName != "") {
+        currentSourceFile = fileName;
+        QFileInfo fileInfo(fileName);
+        currentSourceFileExtension = fileInfo.suffix();
+
+        openedSourceFileContent = loadFile(fileName);
+        sourceFileContent = openedSourceFileContent;
+        if ( toolBarWidget->cbLivePreview->isChecked() ) {
+            callIndenter();
+        }
+        sourceCodeChanged = true;
+        previewToggled = true;
+        updateSourceView();
+        updateWindowTitle();
+        updateRecentlyOpenedList();
+        textEditLastScrollPos = 0;
+        textEditVScrollBar->setValue( textEditLastScrollPos );
+
+        savedSourceContent = openedSourceFileContent;
+        qSciSourceCodeEditor->setModified( false );
+        setWindowModified( false );
+    }
+}
+
+
+/*!
+    \brief Calls the source file save as dialog to save a source file under a chosen name.
+
+    If the file already exists and it should be overwritten, a warning is shown before.
+ */
+bool MainWindow::saveasSourceFileDialog(QAction *chosenEncodingAction) {
+    QString encoding;
+    QString fileExtensions = tr("Supported by indenter")+" ("+indentHandler->getPossibleIndenterFileExtensions()+
+                             ");;"+tr("All files")+" (*.*)";
+
+    //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
+    QString fileName = QFileDialog::getSaveFileName( this, tr("Save source code file"), currentSourceFile, fileExtensions);
+
+    // Saving has been canceled if the filename is empty
+    if ( fileName.isEmpty() ) {
+        return false;
+    }
+
+    savedSourceContent = qSciSourceCodeEditor->text();
+
+    currentSourceFile = fileName;
+    QFile::remove(fileName);
+    QFile outSrcFile(fileName);
+    outSrcFile.open( QFile::ReadWrite | QFile::Text );
+
+    // Get current encoding.
+    if ( chosenEncodingAction != NULL ) {
+        encoding = chosenEncodingAction->text();
+    }
+    else {
+        encoding = encodingActionGroup->checkedAction()->text();
+    }
+    QTextStream outSrcStrm(&outSrcFile);
+    outSrcStrm.setCodec( QTextCodec::codecForName(encoding.toAscii()) );
+    outSrcStrm << savedSourceContent;
+    outSrcFile.close();
+
+    QFileInfo fileInfo(fileName);
+    currentSourceFileExtension = fileInfo.suffix();
+
+    qSciSourceCodeEditor->setModified( false );
+    setWindowModified( false );
+
+    updateWindowTitle();
+    return true;
+}
+
+
+/*!
+    \brief Saves the currently shown source code to the last save or opened source file.
+
+    If no source file has been opened, because only the static example has been loaded,
+    the save as file dialog will be shown.
+ */
+bool MainWindow::saveSourceFile() {
+    if ( currentSourceFile.isEmpty() ) {
+        return saveasSourceFileDialog();
+    }
+    else {
+        QFile::remove(currentSourceFile);
+        QFile outSrcFile(currentSourceFile);
+        savedSourceContent = qSciSourceCodeEditor->text();
+        outSrcFile.open( QFile::ReadWrite | QFile::Text );
+
+        // Get current encoding.
+        QString currentEncoding = encodingActionGroup->checkedAction()->text();
+        QTextStream outSrcStrm(&outSrcFile);
+        outSrcStrm.setCodec( QTextCodec::codecForName(currentEncoding.toAscii()) );
+        outSrcStrm << savedSourceContent;
+        outSrcFile.close();
+
+        qSciSourceCodeEditor->setModified( false );
+        setWindowModified( false );
+    }
+    return true;
+}
+
+
+/*!
+    \brief Shows a file open dialog.
+
+    Shows a file open dialog with the title \a dialogHeaderStr starting in the directory \a startPath
+    and with a file mask defined by \a fileMaskStr. Returns the contents of the file as QString.
+ */
+QString MainWindow::openFileDialog(QString dialogHeaderStr, QString startPath, QString fileMaskStr) {
+    QString fileContent = "";
+
+    QString fileName = QFileDialog::getOpenFileName( NULL, dialogHeaderStr, startPath, fileMaskStr);
+
+    if (fileName != "") {
+        fileContent = loadFile(fileName);
+    }
+
+    return fileContent;
+}
+
+
+/*!
+    \brief Updates the displaying of the source code.
+
+    Updates the text edit field, which is showing the loaded, and if preview is enabled formatted, source code.
+    Reassigns the line numbers and in case of switch between preview and none preview keeps the text field
+    at the same line number.
+ */
+void MainWindow::updateSourceView() {
+    textEditLastScrollPos = textEditVScrollBar->value();
+
+    if ( toolBarWidget->cbLivePreview->isChecked() ) {
+        sourceViewContent = sourceFormattedContent;
+    }
+    else {
+        sourceViewContent = sourceFileContent;
+    }
+
+    if (previewToggled) {
+        disconnect( qSciSourceCodeEditor, SIGNAL(textChanged ()), this, SLOT(sourceCodeChangedHelperSlot()) );
+        bool textIsModified = isWindowModified();
+        qSciSourceCodeEditor->setText(sourceViewContent);
+        setWindowModified(textIsModified);
+        previewToggled = false;
+        connect( qSciSourceCodeEditor, SIGNAL(textChanged ()), this, SLOT(sourceCodeChangedHelperSlot()) );
+    }
+
+    textEditVScrollBar->setValue( textEditLastScrollPos );
+}
+
+
+/*!
+    \brief Calls the selected indenter with the currently loaded source code to retrieve the formatted source code.
+
+    The original loaded source code file will not be changed.
+ */
+void MainWindow::callIndenter() {
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    sourceFormattedContent = indentHandler->callIndenter(sourceFileContent, currentSourceFileExtension);
+    //updateSourceView();
+    QApplication::restoreOverrideCursor();
+}
+
+
+/*!
+    \brief Switches the syntax highlighting corresponding to the value \a turnOn either on or off.
+ */
+void MainWindow::turnHighlightOnOff(bool turnOn) {
+    if ( turnOn ) {
+        highlighter->turnHighlightOn();
+    }
+    else {
+        highlighter->turnHighlightOff();
+    }
+    previewToggled = true;
+    updateSourceView();
+}
+
+
+/*!
+    \brief Added this slot to avoid multiple calls because of changed text.
+ */
+void MainWindow::sourceCodeChangedHelperSlot() {
+    QTimer::singleShot(0, this, SLOT(sourceCodeChangedSlot()));
+}
+
+
+/*!
+    \brief Is emitted whenever the text inside the source view window changes. Calls the indenter
+    to format the changed source code.
+ */
+void MainWindow::sourceCodeChangedSlot() {
+    QChar enteredCharacter;
+    int cursorPos, cursorPosAbsolut, cursorLine;
+    QString text;
+
+    sourceCodeChanged = true;
+    if ( scrollPositionChanged ) {
+        scrollPositionChanged = false;
+    }
+
+    // Get the content text of the text editor.
+    sourceFileContent = qSciSourceCodeEditor->text();
+
+    // Get the position of the cursor in the unindented text.
+    if ( sourceFileContent.isEmpty() ) {
+        // Add this line feed, because AStyle has problems with a totally emtpy file.
+        sourceFileContent += "\n";
+        cursorPosAbsolut = 0;
+        cursorPos = 0;
+        cursorLine = 0;
+        enteredCharacter = sourceFileContent.at(cursorPosAbsolut);
+    }
+    else {
+        qSciSourceCodeEditor->getCursorPosition(&cursorLine, &cursorPos);
+        cursorPosAbsolut = qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_GETCURRENTPOS);
+        text = qSciSourceCodeEditor->text(cursorLine);
+        if ( cursorPosAbsolut > 0 ) {
+            cursorPosAbsolut--;
+        }
+        if ( cursorPos > 0 ) {
+            cursorPos--;
+        }
+        enteredCharacter = sourceFileContent.at(cursorPosAbsolut);
+    }
+
+    // Call the indenter to reformat the text.
+    if ( toolBarWidget->cbLivePreview->isChecked() ) {
+        callIndenter();
+        previewToggled = true;
+    }
+
+    // Update the text editor.
+    updateSourceView();
+
+    if ( toolBarWidget->cbLivePreview->isChecked() && !enteredCharacter.isNull() && enteredCharacter != 10 ) {
+        //const char ch = enteredCharacter.toAscii();
+
+        int saveCursorLine = cursorLine;
+        int saveCursorPos = cursorPos;
+
+        bool charFound = false;
+
+        // Search forward
+        for ( cursorLine = saveCursorLine; cursorLine-saveCursorLine < 6 && cursorLine < qSciSourceCodeEditor->lines(); cursorLine++ ) {
+            text = qSciSourceCodeEditor->text(cursorLine);
+            while ( cursorPos < text.count() && enteredCharacter != text.at(cursorPos)) {
+                cursorPos++;
+            }
+            if ( cursorPos >= text.count() ) {
+                cursorPos = 0;
+            }
+            else {
+                charFound = true;
+                break;
+            }
+        }
+
+        // If foward search did not find the character, search backward
+        if ( !charFound ) {
+            text = qSciSourceCodeEditor->text(saveCursorLine);
+            cursorPos = saveCursorPos;
+            if ( cursorPos >= text.count() ) {
+                cursorPos = text.count() - 1;
+            }
+
+            for ( cursorLine = saveCursorLine; saveCursorLine-cursorLine < 6 && cursorLine >= 0; cursorLine-- ) {
+                text = qSciSourceCodeEditor->text(cursorLine);
+                while ( cursorPos >= 0 && enteredCharacter != text.at(cursorPos)) {
+                    cursorPos--;
+                }
+                if ( cursorPos < 0 ) {
+                    cursorPos = qSciSourceCodeEditor->lineLength(cursorLine-1) - 1;
+                }
+                else {
+                    charFound = true;
+                    break;
+                }
+            }
+        }
+
+        // If the character was found set its new cursor position...
+        if ( charFound ) {
+            qSciSourceCodeEditor->setCursorPosition( cursorLine, cursorPos+1 );
+        }
+        // ...if it was not found, set the previous cursor position.
+        else {
+            qSciSourceCodeEditor->setCursorPosition( saveCursorLine, saveCursorPos+1 );
+        }
+    }
+    // set the previous cursor position.
+    else if ( enteredCharacter == 10 ) {
+        qSciSourceCodeEditor->setCursorPosition( cursorLine, cursorPos );
+    }
+
+
+    if ( toolBarWidget->cbLivePreview->isChecked() ) {
+        sourceCodeChanged = false;
+    }
+
+    if ( savedSourceContent == qSciSourceCodeEditor->text() ) {
+        qSciSourceCodeEditor->setModified( false );
+        setWindowModified( false );
+    }
+    else {
+        qSciSourceCodeEditor->setModified( true ); // Has no effect according to QScintilla docs.
+        setWindowModified( true );
+    }
+
+    // Could set cursor this way and use normal linear search in text instead of columns and rows.
+    //qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_SETCURRENTPOS, 50);
+    //qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_SETANCHOR, 50);
+}
+
+
+/*!
+    \brief This slot is called whenever one of the indenter settings are changed.
+
+    It calls the selected indenter if the preview is turned on. If preview
+    is not active a flag is set, that the settings have changed.
+ */
+void MainWindow::indentSettingsChangedSlot() {
+    indentSettingsChanged = true;
+
+    int cursorLine, cursorPos;
+    qSciSourceCodeEditor->getCursorPosition(&cursorLine, &cursorPos);
+
+    if ( toolBarWidget->cbLivePreview->isChecked() ) {
+        callIndenter();
+        previewToggled = true;
+
+        updateSourceView();
+        if (sourceCodeChanged) {
+/*            savedCursor = qSciSourceCodeEditor->textCursor();
+            if ( cursorPos >= qSciSourceCodeEditor->text().count() ) {
+                cursorPos = qSciSourceCodeEditor->text().count() - 1;
+            }
+            savedCursor.setPosition( cursorPos );
+            qSciSourceCodeEditor->setTextCursor( savedCursor );
+*/
+            sourceCodeChanged = false;
+        }
+        indentSettingsChanged = false;
+    }
+    else {
+        updateSourceView();
+    }
+
+    if ( savedSourceContent == qSciSourceCodeEditor->text() ) {
+        qSciSourceCodeEditor->setModified( false );
+        setWindowModified( false );
+    }
+    else {
+        qSciSourceCodeEditor->setModified( true ); // Has no effect according to QScintilla docs.
+        setWindowModified( true );
+    }
+}
+
+
+/*!
+    \brief This slot is called whenever the preview button is turned on or off.
+
+    It calls the selected indenter to format the current source code if
+    the code has been changed since the last indenter call.
+ */
+void MainWindow::previewTurnedOnOff(bool turnOn) {
+    previewToggled = true;
+
+    int cursorLine, cursorPos;
+    qSciSourceCodeEditor->getCursorPosition(&cursorLine, &cursorPos);
+
+    if ( turnOn && (indentSettingsChanged || sourceCodeChanged) ) {
+        callIndenter();
+    }
+    updateSourceView();
+    if (sourceCodeChanged) {
+/*        savedCursor = qSciSourceCodeEditor->textCursor();
+        if ( cursorPos >= qSciSourceCodeEditor->text().count() ) {
+            cursorPos = qSciSourceCodeEditor->text().count() - 1;
+        }
+        savedCursor.setPosition( cursorPos );
+        qSciSourceCodeEditor->setTextCursor( savedCursor );
+*/
+        sourceCodeChanged = false;
+    }
+    indentSettingsChanged = false;
+
+    if ( savedSourceContent == qSciSourceCodeEditor->text() ) {
+        qSciSourceCodeEditor->setModified( false );
+        setWindowModified( false );
+    }
+    else {
+        qSciSourceCodeEditor->setModified( true );
+        setWindowModified( true );
+    }
+}
+
+
+/*!
+    \brief This slot updates the main window title to show the currently opened
+    source code filename.
+ */
+void MainWindow::updateWindowTitle() {
+    this->setWindowTitle( "UniversalIndentGUI " + version +" [*]"+ currentSourceFile);
+}
+
+
+/*!
+    \brief Opens a dialog to save the current source code as a PDF document.
+ */
+void MainWindow::exportToPDF() {
+    QString fileExtensions = tr("PDF Document")+" (*.pdf)";
+
+    QString fileName = currentSourceFile;
+    QFileInfo fileInfo(fileName);
+    QString fileExtension = fileInfo.suffix();
+
+    fileName.replace( fileName.length()-fileExtension.length(), fileExtension.length(), "pdf" );
+    fileName = QFileDialog::getSaveFileName( this, tr("Export source code file"), fileName, fileExtensions);
+
+    if ( !fileName.isEmpty() ) {
+        QsciPrinter printer(QPrinter::HighResolution);
+        printer.setOutputFormat(QPrinter::PdfFormat);
+        printer.setOutputFileName(fileName);
+        printer.printRange(qSciSourceCodeEditor);
+    }
+}
+
+
+/*!
+    \brief Opens a dialog to save the current source code as a HTML document.
+ */
+void MainWindow::exportToHTML() {
+    QString fileExtensions = tr("HTML Document")+" (*.html)";
+
+    QString fileName = currentSourceFile;
+    QFileInfo fileInfo(fileName);
+    QString fileExtension = fileInfo.suffix();
+
+    fileName.replace( fileName.length()-fileExtension.length(), fileExtension.length(), "html" );
+    fileName = QFileDialog::getSaveFileName( this, tr("Export source code file"), fileName, fileExtensions);
+
+    if ( !fileName.isEmpty() ) {
+        // Create a document from which HTML code can be generated.
+        QTextDocument sourceCodeDocument( qSciSourceCodeEditor->text() );
+        sourceCodeDocument.setDefaultFont( QFont("Courier", 12, QFont::Normal) );
+        QString sourceCodeAsHTML = sourceCodeDocument.toHtml();
+        // To ensure that empty lines are kept in the HTML code make this replacement.
+        sourceCodeAsHTML.replace("\"></p>", "\"><br /></p>");
+
+        // Write the HTML file.
+        QFile::remove(fileName);
+        QFile outSrcFile(fileName);
+        outSrcFile.open( QFile::ReadWrite | QFile::Text );
+        outSrcFile.write( sourceCodeAsHTML.toAscii() );
+        outSrcFile.close();
+    }
+}
+
+
+/*!
+    \brief Loads the last opened file if this option is enabled in the settings.
+
+    If the file does not exist, the default example file is tried to be loaded. If even that
+    fails a very small code example is shown.
+    If the setting for opening the last file is disabled, the editor is empty on startup.
+*/
+void MainWindow::loadLastOpenedFile() {
+    // Get setting for last opened source code file.
+    loadLastSourceCodeFileOnStartup = settings->getValueByName("LoadLastOpenedFileOnStartup").toBool();
+
+    // Only load last source code file if set to do so
+    if ( loadLastSourceCodeFileOnStartup ) {
+        // From the list of last opened files get the first one.
+        currentSourceFile = settings->getValueByName("LastOpenedFiles").toString().split("|").first();
+
+        // If source file exist load it.
+        if ( QFile::exists(currentSourceFile) ) {
+            QFileInfo fileInfo(currentSourceFile);
+            currentSourceFile = fileInfo.absoluteFilePath();
+            sourceFileContent = loadFile(currentSourceFile);
+        }
+        // If the last opened source code file does not exist, try to load the default example.cpp file.
+        else if ( QFile::exists( SettingsPaths::getIndenterPath() + "/example.cpp" ) ) {
+            QFileInfo fileInfo( SettingsPaths::getIndenterPath() + "/example.cpp" );
+            currentSourceFile = fileInfo.absoluteFilePath();
+            sourceFileContent = loadFile(currentSourceFile);
+        }
+        // If neither the example source code file exists show some small code example.
+        else {
+            currentSourceFile = "untitled.cpp";
+            currentSourceFileExtension = "cpp";
+            sourceFileContent = "if(x==\"y\"){x=z;}";
+        }
+    }
+    // if last opened source file should not be loaded make some default settings.
+    else {
+        currentSourceFile = "untitled.cpp";
+        currentSourceFileExtension = "cpp";
+        sourceFileContent = "";
+    }
+    savedSourceContent = sourceFileContent;
+
+    // Update the mainwindow title to show the name of the loaded source code file.
+    updateWindowTitle();
+}
+
+
+/*!
+    \brief Saves the settings for the main application to the file "UniversalIndentGUI.ini".
+
+    Settings are for example last selected indenter, last loaded config file and so on.
+*/
+void MainWindow::saveSettings() {
+    settings->setValueByName( "FileEncoding", currentEncoding );
+    settings->setValueByName( "VersionInSettingsFile", version );
+    settings->setValueByName( "WindowIsMaximized", isMaximized() );
+    if ( !isMaximized() ) {
+        settings->setValueByName( "WindowPosition", pos() );
+        settings->setValueByName( "WindowSize", size() );
+    }
+    settings->setValueByName( "MainWindowState", saveState() );
+
+    // Also save the syntax highlight style for all lexers.
+    highlighter->writeCurrentSettings("");
+}
+
+
+/*!
+    \brief Is always called when the program is quit. Calls the saveSettings function before really quits.
+*/
+void MainWindow::closeEvent( QCloseEvent *event ) {
+    if ( maybeSave() ) {
+        saveSettings();
+        event->accept();
+    }
+    else {
+        event->ignore();
+    }
+}
+
+
+/*!
+    \brief This function is setup to capture tooltip events.
+
+    All widgets that are created by the indentHandler object and are responsible
+    for indenter parameters are connected with this event filter.
+    So depending on the settings the tooltips can be enabled and disabled for these widgets.
+ */
+bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
+    if ( event->type() == QEvent::ToolTip) {
+        if ( indenterParameterTooltipsEnabledAction->isChecked() ) {
+            return QMainWindow::eventFilter(obj, event);
+        }
+        else {
+            //QToolTip::showText( QPoint(100,100) , "Test1");
+            return true;
+        }
+    }
+    else {
+        // pass the event on to the parent class
+        return QMainWindow::eventFilter(obj, event);
+    }
+}
+
+
+/*!
+    \brief Is called at application exit and asks whether to save the source code file, if it has been changed.
+ */
+bool MainWindow::maybeSave() {
+    if ( isWindowModified() ) {
+        int ret = QMessageBox::warning(this, tr("Modified code"),
+            tr("The source code has been modified.\n"
+                "Do you want to save your changes?"),
+            QMessageBox::Yes | QMessageBox::Default,
+            QMessageBox::No,
+            QMessageBox::Cancel | QMessageBox::Escape);
+        if (ret == QMessageBox::Yes) {
+            return saveSourceFile();
+        }
+        else if (ret == QMessageBox::Cancel) {
+            return false;
+        }
+    }
+    return true;
+}
+
+
+/*!
+    \brief This slot is called whenever a language is selected in the menu. It tries to find the
+    corresponding action in the languageInfoList and sets the language.
+ */
+void MainWindow::languageChanged(int languageIndex) {
+    // Get the mnemonic of the new selected language.
+    QString languageShort = settings->getAvailableTranslations().at(languageIndex);
+
+    // Remove the old qt translation.
+    qApp->removeTranslator( qTTranslator );
+
+    // Remove the old uigui translation.
+    qApp->removeTranslator( uiGuiTranslator );
+
+    // Load the Qt own translation file and set it for the application.
+    bool translationFileLoaded;
+    translationFileLoaded = qTTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/qt_" + languageShort );
+    if ( translationFileLoaded ) {
+        qApp->installTranslator(qTTranslator);
+    }
+
+    // Load the uigui translation file and set it for the application.
+    translationFileLoaded = uiGuiTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/universalindent_" + languageShort );
+    if ( translationFileLoaded ) {
+        qApp->installTranslator(uiGuiTranslator);
+    }
+}
+
+
+/*!
+    \brief Creates a menu entries in the file menu for opening and saving a file with different encodings.
+*/
+void MainWindow::createEncodingMenu() {
+    QAction *encodingAction;
+    QString encodingName;
+
+    encodingsList = QStringList() << "UTF-8" << "UTF-16" << "UTF-16BE" << "UTF-16LE"
+                    << "Apple Roman" << "Big5" << "Big5-HKSCS" << "EUC-JP" << "EUC-KR" << "GB18030-0"
+                    << "IBM 850" << "IBM 866" << "IBM 874" << "ISO 2022-JP" << "ISO 8859-1" << "ISO 8859-13"
+                    << "Iscii-Bng" << "JIS X 0201" << "JIS X 0208" << "KOI8-R" << "KOI8-U" << "MuleLao-1"
+                    << "ROMAN8" << "Shift-JIS" << "TIS-620" << "TSCII" << "Windows-1250" << "WINSAMI2";
+
+    encodingActionGroup = new QActionGroup(this);
+    saveEncodedActionGroup = new QActionGroup(this);
+
+    // Loop for each available encoding
+    foreach ( encodingName, encodingsList ) {
+        // Create actions for the "reopen" menu
+        encodingAction = new QAction(encodingName, encodingActionGroup);
+        encodingAction->setStatusTip( tr("Reopen the currently opened source code file by using the text encoding scheme ") + encodingName );
+        encodingAction->setCheckable(true);
+        if ( encodingName == currentEncoding ) {
+            encodingAction->setChecked(true);
+        }
+
+        // Create actions for the "save as encoded" menu
+        encodingAction = new QAction(encodingName, saveEncodedActionGroup);
+        encodingAction->setStatusTip( tr("Save the currently opened source code file by using the text encoding scheme ") + encodingName );
+    }
+
+    encodingMenu->addActions( encodingActionGroup->actions() );
+    connect( encodingActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(encodingChanged(QAction*)) );
+
+    saveEncodedMenu->addActions( saveEncodedActionGroup->actions() );
+    connect( saveEncodedActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(saveAsOtherEncoding(QAction*)) );
+}
+
+
+/*!
+    \brief This slot calls the save dialog to save the current source file with another encoding.
+
+    If the saving is successful and not aborted, the currently used encoding, visible in the
+    "reopen" menu, is also changed to the new encoding.
+*/
+void MainWindow::saveAsOtherEncoding(QAction *chosenEncodingAction) {
+    bool fileWasSaved = saveasSourceFileDialog(chosenEncodingAction);
+
+    // If the file was save with another encoding, change the selected encoding in the reopen menu.
+    if ( fileWasSaved ) {
+        foreach ( QAction *action, encodingActionGroup->actions() ) {
+            if ( action->text() == chosenEncodingAction->text() ) {
+                action->setChecked(true);
+                return;
+            }
+        }
+    }
+}
+
+
+/*!
+    \brief This slot is called whenever an encoding is selected in the settings menu.
+*/
+void MainWindow::encodingChanged(QAction* encodingAction) {
+    if ( maybeSave() ) {
+        QFile inSrcFile(currentSourceFile);
+        QString fileContent = "";
+
+        if ( !inSrcFile.open(QFile::ReadOnly | QFile::Text) ) {
+            QMessageBox::warning(NULL, tr("Error opening file"), tr("Cannot read the file ")+"\""+currentSourceFile+"\"." );
+        }
+        else {
+            QTextStream inSrcStrm(&inSrcFile);
+            QApplication::setOverrideCursor(Qt::WaitCursor);
+            QString encodingName = encodingAction->text();
+            currentEncoding = encodingName;
+            inSrcStrm.setCodec( QTextCodec::codecForName(encodingName.toAscii()) );
+            fileContent = inSrcStrm.readAll();
+            QApplication::restoreOverrideCursor();
+            inSrcFile.close();
+            qSciSourceCodeEditor->setText( fileContent );
+            qSciSourceCodeEditor->setModified(false);
+        }
+    }
+}
+
+
+/*!
+    \brief Creates a menu entry under the settings menu for all available text encodings.
+*/
+void MainWindow::createHighlighterMenu() {
+    QAction *highlighterAction;
+    QString highlighterName;
+
+    highlighterActionGroup = new QActionGroup(this);
+
+    // Loop for each known highlighter
+    foreach ( highlighterName, highlighter->getAvailableHighlighters() ) {
+        highlighterAction = new QAction(highlighterName, highlighterActionGroup);
+        highlighterAction->setStatusTip( tr("Set the syntax highlightning to ") + highlighterName );
+        highlighterAction->setCheckable(true);
+    }
+    highlighterMenu->addActions( highlighterActionGroup->actions() );
+    menuSettings->insertMenu(indenterParameterTooltipsEnabledAction, highlighterMenu );
+
+    connect( highlighterActionGroup, SIGNAL(triggered(QAction*)), highlighter, SLOT(setHighlighterByAction(QAction*)) );
+}
+
+
+/*!
+    \brief Is called whenever the white space visibility is being changed in the menu.
+ */
+void MainWindow::setWhiteSpaceVisibility(bool visible) {
+    if ( visible ) {
+        qSciSourceCodeEditor->setWhitespaceVisibility(QsciScintilla::WsVisible);
+    }
+    else {
+        qSciSourceCodeEditor->setWhitespaceVisibility(QsciScintilla::WsInvisible);
+    }
+}
+
+/*!
+    \brief This slot is called whenever the number of lines in the editor changes
+    and adapts the margin for the displayed line numbers.
+*/
+void MainWindow::numberOfLinesChanged() {
+    QString lineNumbers;
+    lineNumbers.setNum( qSciSourceCodeEditor->lines()*10 );
+    qSciSourceCodeEditor->setMarginWidth(1, lineNumbers);
+}
+
+
+/*!
+    \brief Catches language change events and retranslates all needed widgets.
+ */
+void MainWindow::changeEvent(QEvent *event) {
+    int i = 0;
+
+    if (event->type() == QEvent::LanguageChange) {
+        QString languageName;
+
+        // Translate the main window.
+        retranslateUi(this);
+        updateWindowTitle();
+
+        // Translate the toolbar.
+        toolBarWidget->retranslateUi(toolBar);
+
+        // Translate the indent handler widget.
+        indentHandler->retranslateUi();
+
+        // Translate the load encoding menu.
+        QList<QAction *> encodingActionList = encodingActionGroup->actions();
+        for ( i = 0; i < encodingActionList.size(); i++ ) {
+            encodingActionList.at(i)->setStatusTip( tr("Reopen the currently opened source code file by using the text encoding scheme ") + encodingsList.at(i) );
+        }
+
+        // Translate the save encoding menu.
+        encodingActionList = saveEncodedActionGroup->actions();
+        for ( i = 0; i < encodingActionList.size(); i++ ) {
+            encodingActionList.at(i)->setStatusTip( tr("Save the currently opened source code file by using the text encoding scheme ") + encodingsList.at(i) );
+        }
+
+        // Translate the highlighter menu.
+        QList<QAction *> actionList = highlighterMenu->actions();
+        i = 0;
+        foreach ( QString highlighterName, highlighter->getAvailableHighlighters() ) {
+            QAction *highlighterAction = actionList.at(i);
+            highlighterAction->setStatusTip( tr("Set the syntax highlightning to ") + highlighterName );
+            i++;
+        }
+
+        // Translate the line and column indicators in the statusbar.
+        int line, column;
+        qSciSourceCodeEditor->getCursorPosition( &line, &column );
+        setStatusBarCursorPosInfo( line, column );
+    }
+    else {
+        QWidget::changeEvent(event);
+    }
+}
+
+
+
+/*!
+    \brief Updates the list of recently opened files.
+
+    Therefore the currently open file is set at the lists first position
+    regarding the in the settings set maximum list length. Overheads of the
+    list will be cut off. The new list will be updated to the settings and
+    the recently opened menu will be updated too.
+ */
+void MainWindow::updateRecentlyOpenedList() {
+    QString fileName;
+    QString filePath;
+    QStringList recentlyOpenedList = settings->getValueByName("LastOpenedFiles").toString().split("|");
+    QList<QAction*> recentlyOpenedActionList = menuRecently_Opened_Files->actions();
+
+    // Check if the currently open file is in the list of recently opened.
+    int indexOfCurrentFile = recentlyOpenedList.indexOf( currentSourceFile );
+
+    // If it is in the list of recently opened files and not at the first position, move it to the first pos.
+    if ( indexOfCurrentFile > 0 ) {
+        recentlyOpenedList.move(indexOfCurrentFile, 0);
+        recentlyOpenedActionList.move(indexOfCurrentFile, 0);
+    }
+    // Put the current file at the first position if it not already is and is not empty.
+    else if ( indexOfCurrentFile == -1 && !currentSourceFile.isEmpty() ) {
+        recentlyOpenedList.insert(0, currentSourceFile);
+        QAction *recentlyOpenedAction = new QAction(QFileInfo(currentSourceFile).fileName(), menuRecently_Opened_Files);
+        recentlyOpenedAction->setStatusTip(currentSourceFile);
+        recentlyOpenedActionList.insert(0, recentlyOpenedAction );
+    }
+
+    // Get the maximum recently opened list size.
+    int recentlyOpenedListMaxSize = settings->getValueByName("RecentlyOpenedListSize").toInt();
+
+    // Loop for each filepath in the recently opened list, remove non existing files and
+    // loop only as long as maximum allowed list entries are set.
+    for ( int i = 0; i < recentlyOpenedList.size() && i < recentlyOpenedListMaxSize; ) {
+        filePath = recentlyOpenedList.at(i);
+        QFileInfo fileInfo(filePath);
+
+        // If the file does no longer exist, remove it from the list.
+        if ( !fileInfo.exists() ) {
+            recentlyOpenedList.takeAt(i);
+            if ( i < recentlyOpenedActionList.size()-2 ) {
+                QAction* action = recentlyOpenedActionList.takeAt(i);
+                delete action;
+            }
+        }
+        // else if its not already in the menu, add it to the menu.
+        else {
+            if ( i >= recentlyOpenedActionList.size()-2 ) {
+                QAction *recentlyOpenedAction = new QAction(fileInfo.fileName(), menuRecently_Opened_Files);
+                recentlyOpenedAction->setStatusTip(filePath);
+                recentlyOpenedActionList.insert( recentlyOpenedActionList.size()-2, recentlyOpenedAction );
+            }
+            i++;
+        }
+    }
+
+    // Trim the list to its in the settings allowed maximum size.
+    while ( recentlyOpenedList.size() > recentlyOpenedListMaxSize ) {
+        recentlyOpenedList.takeLast();
+        QAction* action = recentlyOpenedActionList.takeAt( recentlyOpenedActionList.size()-3 );
+        delete action;
+    }
+
+    // Add all actions to the menu.
+    menuRecently_Opened_Files->addActions(recentlyOpenedActionList);
+
+    // Write the new recently opened list to the settings.
+    settings->setValueByName( "LastOpenedFiles", recentlyOpenedList.join("|") );
+
+    // Enable or disable "actionClear_Recently_Opened_List" if list is [not] emtpy
+    if ( recentlyOpenedList.isEmpty() ) {
+        actionClear_Recently_Opened_List->setEnabled(false);
+    }
+    else {
+        actionClear_Recently_Opened_List->setEnabled(true);
+    }
+}
+
+
+/*!
+    \brief This slot empties the list of recently opened files.
+ */
+void MainWindow::clearRecentlyOpenedList() {
+    QStringList recentlyOpenedList = settings->getValueByName("LastOpenedFiles").toString().split("|");
+    QList<QAction*> recentlyOpenedActionList = menuRecently_Opened_Files->actions();
+
+    while ( recentlyOpenedList.size() > 0 ) {
+        recentlyOpenedList.takeLast();
+        QAction* action = recentlyOpenedActionList.takeAt( recentlyOpenedActionList.size()-3 );
+        delete action;
+    }
+
+    // Write the new recently opened list to the settings.
+    settings->setValueByName( "LastOpenedFiles", recentlyOpenedList.join("|") );
+
+    // Disable "actionClear_Recently_Opened_List"
+    actionClear_Recently_Opened_List->setEnabled(false);
+}
+
+
+/*!
+    \brief This slot is called if an entry from the list of recently opened files is
+    being selected.
+ */
+void MainWindow::openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction) {
+    // If the selected action from the recently opened list menu is the clear action
+    // call the slot to clear the list and then leave.
+    if ( recentlyOpenedAction == actionClear_Recently_Opened_List ) {
+        clearRecentlyOpenedList();
+        return;
+    }
+
+    QString fileName = recentlyOpenedAction->text();
+    int indexOfSelectedFile = menuRecently_Opened_Files->actions().indexOf( recentlyOpenedAction );
+    QStringList recentlyOpenedList = settings->getValueByName("LastOpenedFiles").toString().split("|");
+    QString filePath = recentlyOpenedList.at(indexOfSelectedFile);
+    QFileInfo fileInfo(filePath);
+
+    // If the file exists, open it.
+    if ( fileInfo.exists() ) {
+        openSourceFileDialog(filePath);
+    }
+    // If it does not exist, show a warning message and update the list of recently opened files.
+    else {
+        QMessageBox::warning(NULL, tr("File no longer exists"), tr("The file %1 in the list of recently opened files does no longer exist.") );
+        // The function updateRecentlyOpenedList() has to be called via a singleShot so it is executed after this
+        // function (openFileFromRecentlyOpenedList) has already been left. This has to be done because
+        // a Qt3Support function tries to emit a signal based on the existing actions and deleting
+        // any of these actions in updateRecentlyOpenedList() causes an error.
+        QTimer::singleShot(0, this, SLOT(updateRecentlyOpenedList()) );
+    }
+}
+
+
+/*!
+    \brief If the dragged in object contains urls/paths to a file, accept the drag.
+ */
+void MainWindow::dragEnterEvent(QDragEnterEvent *event) {
+    if ( event->mimeData()->hasUrls() ) {
+        event->acceptProposedAction();
+    }
+}
+
+
+/*!
+    \brief If the dropped in object contains urls/paths to a file, open that file.
+ */
+void MainWindow::dropEvent(QDropEvent *event) {
+    if ( event->mimeData()->hasUrls() ) {
+        QString filePathName = event->mimeData()->urls().first().toLocalFile();
+        openSourceFileDialog(filePathName);
+    }
+
+    event->acceptProposedAction();
+}
+
+
+/*!
+    \brief If the dropped in object contains urls/paths to a file, open that file.
+*/
+void MainWindow::showAboutDialog() {
+    QPixmap originalPixmap = QPixmap::grabWindow(QApplication::desktop()->screen()->winId());
+    //qDebug("in main pixmap width %d, numScreens = %d", originalPixmap.size().width(), QApplication::desktop()->availableGeometry().width());
+    aboutDialogGraphicsView->setScreenshotPixmap( originalPixmap );
+    aboutDialogGraphicsView->show();
+}
+
+
+/*!
+    \brief Sets the label in the status bar to show the \a line and \a column number.
+*/
+void MainWindow::setStatusBarCursorPosInfo( int line, int column ) {
+    textEditLineColumnInfoLabel->setText( tr("Line %1, Column %2").arg(line+1).arg(column+1) );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/MainWindow.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,148 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include "ui_MainWindow.h"
+#include "ui_ToolBarWidget.h"
+#include "AboutDialog.h"
+#include "AboutDialogGraphicsView.h"
+#include "UiGuiSettings.h"
+#include "UiGuiSettingsDialog.h"
+#include "UiGuiHighlighter.h"
+#include "IndentHandler.h"
+#include "UpdateCheckDialog.h"
+
+#include <QWidget>
+#include <QString>
+#include <QScrollBar>
+#include <QTextCursor>
+#include <QFileDialog>
+#include <QTextStream>
+#include <QPrinter>
+#include <QPrintDialog>
+#include <QCloseEvent>
+#include <QHelpEvent>
+#include <QToolTip>
+#include <QTranslator>
+#include <QLocale>
+#include <QTextCodec>
+#include <QDate>
+
+#include <Qsci/qsciscintilla.h>
+#include <Qsci/qsciprinter.h>
+
+class MainWindow : public QMainWindow, private Ui::MainWindowUi
+{
+    Q_OBJECT
+
+public:
+    //! Constructor
+    MainWindow(QString file2OpenOnStart = "", QWidget *parent = 0);
+
+private:
+    QString loadFile(QString filePath);
+    QString openFileDialog(QString dialogHeaderStr, QString startPath, QString fileMaskStr);
+    void updateWindowTitle();
+    void loadLastOpenedFile();
+    void saveSettings();
+    bool maybeSave();
+    void createEncodingMenu();
+    void createHighlighterMenu();
+    bool initApplicationLanguage();
+    void initMainWindow();
+    void initToolBar();
+    void initTextEditor();
+    void initSyntaxHighlighter();
+    void initIndenter();
+    void changeEvent(QEvent *event);
+    void dragEnterEvent(QDragEnterEvent *event);
+    void dropEvent(QDropEvent *event);
+
+	QsciScintilla *qSciSourceCodeEditor;
+	UiGuiSettings *settings;
+
+    QString version;
+    QString revision;
+    QString buildDateStr;
+
+	QString currentEncoding;
+    QString sourceFileContent;
+    QString sourceFormattedContent;
+    QString sourceViewContent;
+    UiGuiHighlighter *highlighter;
+    QScrollBar *textEditVScrollBar;
+    AboutDialog *aboutDialog;
+    AboutDialogGraphicsView *aboutDialogGraphicsView;
+	UiGuiSettingsDialog *settingsDialog;
+    int textEditLastScrollPos;
+    int currentIndenterID;
+	bool loadLastSourceCodeFileOnStartup;
+    QString currentSourceFile;
+    QString currentSourceFileExtension;
+    QString savedSourceContent;
+    QActionGroup *encodingActionGroup;
+    QActionGroup *saveEncodedActionGroup;
+    QActionGroup *highlighterActionGroup;
+    QTranslator *uiGuiTranslator;
+    QTranslator *qTTranslator;
+    bool isFirstRunOfThisVersion;
+
+    bool sourceCodeChanged;
+    bool scrollPositionChanged;
+    bool indentSettingsChanged;
+    bool previewToggled;
+	QStringList encodingsList;
+
+    Ui::ToolBarWidget *toolBarWidget;
+    IndentHandler *indentHandler;
+    UpdateCheckDialog *updateCheckDialog;
+    QLabel *textEditLineColumnInfoLabel;
+
+protected:
+    void closeEvent( QCloseEvent *event );
+    bool eventFilter(QObject *obj, QEvent *event);
+
+private slots:
+    void openSourceFileDialog(QString fileName = "");
+    bool saveasSourceFileDialog(QAction *chosenEncodingAction = NULL);
+    void saveAsOtherEncoding(QAction *chosenEncodingAction);
+    bool saveSourceFile();
+    void callIndenter();
+    void updateSourceView();
+    void turnHighlightOnOff(bool turnOn);
+	void setWhiteSpaceVisibility(bool visible);
+	void sourceCodeChangedHelperSlot();
+    void sourceCodeChangedSlot();
+    void indentSettingsChangedSlot();
+    void previewTurnedOnOff(bool turnOn);
+    void exportToPDF();
+    void exportToHTML();
+	void languageChanged(int languageIndex);
+    void encodingChanged(QAction *encodingAction);
+	void numberOfLinesChanged();
+    void updateRecentlyOpenedList();
+    void openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction);
+    void clearRecentlyOpenedList();
+	void showAboutDialog();
+    void setStatusBarCursorPosInfo(int line, int column);
+};
+
+#endif // MAINWINDOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/MainWindow.ui	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,465 @@
+<ui version="4.0" >
+ <author>Thomas_-_S</author>
+ <class>MainWindowUi</class>
+ <widget class="QMainWindow" name="MainWindowUi" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>949</width>
+    <height>633</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>UniversalIndentGUI</string>
+  </property>
+  <property name="windowIcon" >
+   <iconset resource="../resources/Icons.qrc" >
+    <normaloff>:/mainWindow/universalIndentGUI.svg</normaloff>:/mainWindow/universalIndentGUI.svg</iconset>
+  </property>
+  <widget class="QWidget" name="centralwidget" >
+   <layout class="QHBoxLayout" >
+    <property name="spacing" >
+     <number>6</number>
+    </property>
+    <property name="margin" >
+     <number>0</number>
+    </property>
+    <item>
+     <layout class="QHBoxLayout" >
+      <property name="spacing" >
+       <number>0</number>
+      </property>
+      <property name="margin" >
+       <number>2</number>
+      </property>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QStatusBar" name="statusbar" />
+  <widget class="QMenuBar" name="menuBar" >
+   <property name="geometry" >
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>949</width>
+     <height>21</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuIndenter" >
+    <property name="title" >
+     <string>Indenter</string>
+    </property>
+   </widget>
+   <widget class="QMenu" name="menuFile" >
+    <property name="title" >
+     <string>File</string>
+    </property>
+    <widget class="QMenu" name="menuExport" >
+     <property name="title" >
+      <string>Export</string>
+     </property>
+     <addaction name="actionExportPDF" />
+     <addaction name="actionExportHTML" />
+    </widget>
+    <widget class="QMenu" name="menuRecently_Opened_Files" >
+     <property name="title" >
+      <string>Recently Opened Files</string>
+     </property>
+     <addaction name="separator" />
+     <addaction name="actionClear_Recently_Opened_List" />
+    </widget>
+    <widget class="QMenu" name="encodingMenu" >
+     <property name="title" >
+      <string>Reopen File with other Encoding</string>
+     </property>
+    </widget>
+    <widget class="QMenu" name="saveEncodedMenu" >
+     <property name="title" >
+      <string>Save Source File As with other Encoding</string>
+     </property>
+    </widget>
+    <addaction name="actionOpen_Source_File" />
+    <addaction name="menuRecently_Opened_Files" />
+    <addaction name="encodingMenu" />
+    <addaction name="separator" />
+    <addaction name="actionSave_Source_File" />
+    <addaction name="actionSave_Source_File_As" />
+    <addaction name="saveEncodedMenu" />
+    <addaction name="separator" />
+    <addaction name="menuExport" />
+    <addaction name="actionExit" />
+   </widget>
+   <widget class="QMenu" name="menuSettings" >
+    <property name="title" >
+     <string>Settings</string>
+    </property>
+    <widget class="QMenu" name="highlighterMenu" >
+     <property name="title" >
+      <string>Set Syntax Highlighter</string>
+     </property>
+    </widget>
+    <addaction name="actionLive_Indent_Preview" />
+    <addaction name="enableSyntaxHighlightningAction" />
+    <addaction name="whiteSpaceIsVisibleAction" />
+    <addaction name="highlighterMenu" />
+    <addaction name="indenterParameterTooltipsEnabledAction" />
+    <addaction name="loadLastOpenedFileOnStartupAction" />
+    <addaction name="actionShowSettings" />
+   </widget>
+   <widget class="QMenu" name="menuHelp" >
+    <property name="title" >
+     <string>Help</string>
+    </property>
+    <addaction name="actionCheck_for_update" />
+    <addaction name="separator" />
+    <addaction name="actionAbout_UniversalIndentGUI" />
+   </widget>
+   <addaction name="menuFile" />
+   <addaction name="menuIndenter" />
+   <addaction name="menuSettings" />
+   <addaction name="menuHelp" />
+  </widget>
+  <widget class="QDockWidget" name="dockWidget" >
+   <property name="sizePolicy" >
+    <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="features" >
+    <set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
+   </property>
+   <property name="allowedAreas" >
+    <set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
+   </property>
+   <property name="windowTitle" >
+    <string>Indenter Settings</string>
+   </property>
+   <attribute name="dockWidgetArea" >
+    <number>1</number>
+   </attribute>
+   <widget class="QWidget" name="dockWidgetContents" >
+    <layout class="QHBoxLayout" >
+     <property name="spacing" >
+      <number>6</number>
+     </property>
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <item>
+      <layout class="QVBoxLayout" >
+       <property name="spacing" >
+        <number>0</number>
+       </property>
+       <property name="margin" >
+        <number>0</number>
+       </property>
+      </layout>
+     </item>
+    </layout>
+   </widget>
+  </widget>
+  <widget class="QToolBar" name="toolBar" >
+   <property name="contextMenuPolicy" >
+    <enum>Qt::PreventContextMenu</enum>
+   </property>
+   <property name="windowTitle" >
+    <string>Main Toolbar</string>
+   </property>
+   <property name="orientation" >
+    <enum>Qt::Horizontal</enum>
+   </property>
+   <property name="iconSize" >
+    <size>
+     <width>16</width>
+     <height>16</height>
+    </size>
+   </property>
+   <property name="toolButtonStyle" >
+    <enum>Qt::ToolButtonTextBesideIcon</enum>
+   </property>
+   <attribute name="toolBarArea" >
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak" >
+    <bool>false</bool>
+   </attribute>
+  </widget>
+  <action name="actionOpen_Source_File" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/document-open.png</normaloff>:/mainWindow/document-open.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Open Source File</string>
+   </property>
+   <property name="statusTip" >
+    <string>Opens a dialog for selecting a source code file.</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl+O</string>
+   </property>
+  </action>
+  <action name="actionSave_Source_File" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/document-save.png</normaloff>:/mainWindow/document-save.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Save Source File</string>
+   </property>
+   <property name="statusTip" >
+    <string>Saves the currently shown source code to the last opened or saved source file.</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl+S</string>
+   </property>
+  </action>
+  <action name="actionSave_Source_File_As" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/document-save-as.png</normaloff>:/mainWindow/document-save-as.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Save Source File As</string>
+   </property>
+   <property name="statusTip" >
+    <string>Opens a file dialog to save the currently shown source code.</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl+Shift+S</string>
+   </property>
+  </action>
+  <action name="actionAbout_UniversalIndentGUI" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/info.png</normaloff>:/mainWindow/info.png</iconset>
+   </property>
+   <property name="text" >
+    <string>About UniversalIndentGUI</string>
+   </property>
+   <property name="statusTip" >
+    <string>Shows info about UniversalIndentGUI.</string>
+   </property>
+  </action>
+  <action name="actionExit" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/system-log-out.png</normaloff>:/mainWindow/system-log-out.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Exit</string>
+   </property>
+   <property name="statusTip" >
+    <string>Quits the UniversalIndentGUI.</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl+Q</string>
+   </property>
+  </action>
+  <action name="actionExportPDF" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/exportpdf.png</normaloff>:/mainWindow/exportpdf.png</iconset>
+   </property>
+   <property name="text" >
+    <string>PDF</string>
+   </property>
+   <property name="statusTip" >
+    <string>Export the currently visible source code as PDF document</string>
+   </property>
+  </action>
+  <action name="actionExportHTML" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/exporthtml.png</normaloff>:/mainWindow/exporthtml.png</iconset>
+   </property>
+   <property name="text" >
+    <string>HTML</string>
+   </property>
+   <property name="statusTip" >
+    <string>Export the currently visible source code as HTML document</string>
+   </property>
+  </action>
+  <action name="indenterParameterTooltipsEnabledAction" >
+   <property name="checkable" >
+    <bool>true</bool>
+   </property>
+   <property name="checked" >
+    <bool>true</bool>
+   </property>
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/tooltip.png</normaloff>:/mainWindow/tooltip.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Parameter Tooltips</string>
+   </property>
+   <property name="statusTip" >
+    <string>If checked, tool tips will show up if the mouse cursor remains over an indenter parameter for a while.</string>
+   </property>
+   <property name="connectedSettingName" stdset="0" >
+    <string>DONOTTRANSLATE:IndenterParameterTooltipsEnabled</string>
+   </property>
+  </action>
+  <action name="actionLive_Indent_Preview" >
+   <property name="checkable" >
+    <bool>true</bool>
+   </property>
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/live-preview.png</normaloff>:/mainWindow/live-preview.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Live Indent Preview</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl+L</string>
+   </property>
+   <property name="visible" >
+    <bool>false</bool>
+   </property>
+  </action>
+  <action name="enableSyntaxHighlightningAction" >
+   <property name="checkable" >
+    <bool>true</bool>
+   </property>
+   <property name="checked" >
+    <bool>true</bool>
+   </property>
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/syntax-highlight.png</normaloff>:/mainWindow/syntax-highlight.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Syntax Highlighting</string>
+   </property>
+   <property name="iconText" >
+    <string>Syntax Highlighting</string>
+   </property>
+   <property name="toolTip" >
+    <string>Enables or disables syntax highlighting for the source code.</string>
+   </property>
+   <property name="statusTip" >
+    <string>By enabling special key words of the source code are highlighted.</string>
+   </property>
+   <property name="shortcut" >
+    <string>Ctrl+H</string>
+   </property>
+   <property name="connectedSettingName" stdset="0" >
+    <string>DONOTTRANSLATE:SyntaxHighlightningEnabled</string>
+   </property>
+  </action>
+  <action name="whiteSpaceIsVisibleAction" >
+   <property name="checkable" >
+    <bool>true</bool>
+   </property>
+   <property name="text" >
+    <string>White Space Visible</string>
+   </property>
+   <property name="iconText" >
+    <string>White Space Visible</string>
+   </property>
+   <property name="toolTip" >
+    <string>Set white space visible</string>
+   </property>
+   <property name="statusTip" >
+    <string>Enables or disables diplaying of white space characters in the editor.</string>
+   </property>
+   <property name="visible" >
+    <bool>false</bool>
+   </property>
+   <property name="connectedSettingName" stdset="0" >
+    <string>DONOTTRANSLATE:WhiteSpaceIsVisible</string>
+   </property>
+  </action>
+  <action name="loadLastOpenedFileOnStartupAction" >
+   <property name="checkable" >
+    <bool>true</bool>
+   </property>
+   <property name="checked" >
+    <bool>true</bool>
+   </property>
+   <property name="text" >
+    <string>Auto Open Last File</string>
+   </property>
+   <property name="toolTip" >
+    <string>Auto open last source file on startup</string>
+   </property>
+   <property name="statusTip" >
+    <string>If selected opens last source code file on startup</string>
+   </property>
+   <property name="visible" >
+    <bool>false</bool>
+   </property>
+   <property name="connectedSettingName" stdset="0" >
+    <string>DONOTTRANSLATE:LoadLastOpenedFileOnStartup</string>
+   </property>
+  </action>
+  <action name="actionShowSettings" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/preferences-system.png</normaloff>:/mainWindow/preferences-system.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Settings</string>
+   </property>
+   <property name="iconText" >
+    <string>Settings</string>
+   </property>
+   <property name="toolTip" >
+    <string>Opens the settings dialog</string>
+   </property>
+   <property name="statusTip" >
+    <string>Opens the settings dialog, to set language etc.</string>
+   </property>
+  </action>
+  <action name="actionCheck_for_update" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/system-software-update.png</normaloff>:/mainWindow/system-software-update.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Check for update</string>
+   </property>
+   <property name="toolTip" >
+    <string>Checks online whether a new version of UniversalIndentGUI is available.</string>
+   </property>
+   <property name="statusTip" >
+    <string>Checks online whether a new version of UniversalIndentGUI is available.</string>
+   </property>
+  </action>
+  <action name="actionClear_Recently_Opened_List" >
+   <property name="icon" >
+    <iconset resource="../resources/Icons.qrc" >
+     <normaloff>:/mainWindow/edit-clear.png</normaloff>:/mainWindow/edit-clear.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Clear Recently Opened List</string>
+   </property>
+  </action>
+ </widget>
+ <resources>
+  <include location="../resources/Icons.qrc" />
+ </resources>
+ <connections>
+  <connection>
+   <sender>actionExit</sender>
+   <signal>triggered()</signal>
+   <receiver>MainWindowUi</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel" >
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel" >
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/TemplateBatchScript.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,171 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "TemplateBatchScript.h"
+
+// Need to include QObject here so that platform specific defines like Q_OS_WIN32 are set.
+#include <QObject>
+
+/*!
+    \brief The only and static function of this class returns a batch or shell script
+    as string that can be used to call an indenter with the current settings from
+    the command line.
+
+    The returned string contains some placeholders where the indenter name needs to
+    be filled in. The placeholders are "__INDENTERCALLSTRING1__" that should be replaced
+    by the indenter call string that indents a complete directory.
+    "__INDENTERCALLSTRING2__" the call string for indenting only one file.
+    And "__INDENTERCALLSTRINGSCRIPTNAME__" which is only the shown name of the indenter.
+ */
+const char* TemplateBatchScript::getTemplateBatchScript() {
+    static const char* templateBatchScript =
+#if defined(Q_OS_WIN32)
+        "@echo off\n"
+        "\n"
+        "IF (%1)==() GOTO error\n"
+        "dir /b /ad %1 >nul 2>nul && GOTO indentDir\n"
+        "IF NOT EXIST %1 GOTO error\n"
+        "goto indentFile\n"
+        "\n"
+        ":indentDir\n"
+        "set searchdir=%1\n"
+        "\n"
+        "IF (%2)==() GOTO assignDefaultSuffix\n"
+        "set filesuffix=%2\n"
+        "\n"
+        "GOTO run\n"
+        "\n"
+        ":assignDefaultSuffix\n"
+        "::echo !!!!DEFAULT SUFFIX!!!\n"
+        "set filesuffix=*\n"
+        "\n"
+        ":run\n"
+        "FOR /F \"tokens=*\" %%G IN ('DIR /B /S %searchdir%\\*.%filesuffix%') DO (\n"
+        "echo Indenting file \"%%G\"\n"
+        "__INDENTERCALLSTRING1__\n"
+        ")\n"
+        "GOTO ende\n"
+        "\n"
+        ":indentFile\n"
+        "echo Indenting one file %1\n"
+        "__INDENTERCALLSTRING2__\n"
+        "\n"
+        "GOTO ende\n"
+        "\n"
+        ":error\n"
+        "echo .\n"
+        "echo ERROR: As parameter given directory or file does not exist!\n"
+        "echo Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ dirname filesuffix\n"
+        "echo Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ filename\n"
+        "echo Example: __INDENTERCALLSTRINGSCRIPTNAME__ temp cpp\n"
+        "echo .\n"
+        "\n"
+        ":ende\n";
+
+#else
+
+        "#!/bin/sh \n"
+        "\n"
+        "if [ ! -n \"$1\" ]; then\n"
+        "echo \"Syntax is: recurse.sh dirname filesuffix\"\n"
+        "echo \"Syntax is: recurse.sh filename\"\n"
+        "echo \"Example: recurse.sh temp cpp\"\n"
+        "exit 1\n"
+        "fi\n"
+        "\n"
+        "if [ -d \"$1\" ]; then\n"
+        "#echo \"Dir ${1} exists\"\n"
+        "if [ -n \"$2\" ]; then\n"
+        "filesuffix=$2\n"
+        "else\n"
+        "filesuffix=\"*\"\n"
+        "fi\n"
+        "\n"
+        "#echo \"Filtering files using suffix ${filesuffix}\"\n"
+        "\n"
+        "file_list=`find ${1} -name \"*.${filesuffix}\" -type f`\n"
+        "for file2indent in $file_list\n"
+        "do \n"
+        "echo \"Indenting file $file2indent\"\n"
+        "__INDENTERCALLSTRING1__\n"
+        "done\n"
+        "else\n"
+        "if [ -f \"$1\" ]; then\n"
+        "echo \"Indenting one file $1\"\n"
+        "__INDENTERCALLSTRING2__\n"
+        "else\n"
+        "echo \"ERROR: As parameter given directory or file does not exist!\"\n"
+        "echo \"Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ dirname filesuffix\"\n"
+        "echo \"Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ filename\"\n"
+        "echo \"Example: __INDENTERCALLSTRINGSCRIPTNAME__ temp cpp\"\n"
+        "exit 1\n"
+        "fi\n"
+        "fi\n";
+#endif // #if defined(Q_OS_WIN32)
+    return templateBatchScript;
+}
+
+
+/* Here comes the original batch script without the c++ markup
+@echo off
+
+IF (%1)==() GOTO error
+dir /b /ad %1 >nul 2>nul && GOTO indentDir
+IF NOT EXIST %1 GOTO error
+goto indentFile
+
+:indentDir
+set searchdir=%1
+
+IF (%2)==() GOTO assignDefaultSuffix
+set filesuffix=%2
+
+GOTO run
+
+:assignDefaultSuffix
+::echo !!!!DEFAULT SUFFIX!!!
+set filesuffix=*
+
+:run
+FOR /F "tokens=*" %%G IN ('DIR /B /S %searchdir%\*.%filesuffix%') DO (
+    echo Indenting file "%%G"
+    ::call call_CSSTidy.bat "%%G"
+    "C:/Dokumente und Einstellungen/ts/Eigene Dateien/Visual Studio 2005/Projects/UiGuixy/indenters/csstidy.exe" "%%G" --timestamp=true --allow_html_in_templates=false --compress_colors=true --compress_font=true --lowercase_s=false --preserve_css=false --remove_last_;=false --remove_bslash=true --sort_properties=false --sort_selectors=false  indentoutput.css
+    move /Y indentoutput.css "%%G"
+)
+GOTO ende
+
+:indentFile
+echo Indenting one file %1
+"C:/Dokumente und Einstellungen/ts/Eigene Dateien/Visual Studio 2005/Projects/UiGuixy/indenters/csstidy.exe" %1 --timestamp=true --allow_html_in_templates=false --compress_colors=true --compress_font=true --lowercase_s=false --preserve_css=false --remove_last_;=false --remove_bslash=true --sort_properties=false --sort_selectors=false  indentoutput.css
+move /Y indentoutput.css %1
+
+GOTO ende
+
+:error
+echo .
+echo ERROR: As parameter given directory or file does not exist!
+echo Syntax is: recurse.bat dirname filesuffix
+echo Syntax is: recurse.bat filename
+echo Example: recurse.bat temp cpp
+echo .
+
+:ende
+
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/TemplateBatchScript.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,31 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef TEMPLATEBATCHSCRIPT_H
+#define TEMPLATEBATCHSCRIPT_H
+
+class TemplateBatchScript
+{
+private:
+    TemplateBatchScript();
+public:
+    static const char* getTemplateBatchScript();
+};
+
+#endif // TEMPLATEBATCHSCRIPT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ToolBarWidget.ui	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,123 @@
+<ui version="4.0" >
+ <class>ToolBarWidget</class>
+ <widget class="QWidget" name="toolBarWidget" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>775</width>
+    <height>32</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QHBoxLayout" >
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <property name="margin" >
+    <number>0</number>
+   </property>
+   <item>
+    <widget class="QPushButton" name="pbOpen_Source_File" >
+     <property name="toolTip" >
+      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:8pt;">Opens a dialog for selecting a source code file.&lt;/span>&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;">This file will be used to show what the indent tool changes.&lt;/p>&lt;/body>&lt;/html></string>
+     </property>
+     <property name="text" >
+      <string> Open Source File </string>
+     </property>
+     <property name="icon" >
+      <iconset resource="../resources/Icons.qrc" >
+       <normaloff>:/mainWindow/document-open.png</normaloff>:/mainWindow/document-open.png</iconset>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="cbLivePreview" >
+     <property name="toolTip" >
+      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:MS Shell Dlg; font-size:8pt;">Turns the preview of the reformatted source code on and off.&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:MS Shell Dlg; font-size:8pt;">In other words it switches between formatted and nonformatted code. (Ctrl+L)&lt;/p>&lt;/body>&lt;/html></string>
+     </property>
+     <property name="text" >
+      <string>Live Indent Preview</string>
+     </property>
+     <property name="icon" >
+      <iconset resource="../resources/Icons.qrc" >
+       <normaloff>:/mainWindow/live-preview.png</normaloff>:/mainWindow/live-preview.png</iconset>
+     </property>
+     <property name="shortcut" >
+      <string>Ctrl+L</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="enableSyntaxHighlightningCheckBox" >
+     <property name="toolTip" >
+      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:MS Shell Dlg; font-size:8pt;">Enables and disables the highlightning of the source&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:MS Shell Dlg; font-size:8pt;">code shown below. (Still needs some performance improvements) (Ctrl+H)&lt;/p>&lt;/body>&lt;/html></string>
+     </property>
+     <property name="text" >
+      <string>Syntax Highlight</string>
+     </property>
+     <property name="icon" >
+      <iconset resource="../resources/Icons.qrc" >
+       <normaloff>:/mainWindow/syntax-highlight.png</normaloff>:/mainWindow/syntax-highlight.png</iconset>
+     </property>
+     <property name="shortcut" >
+      <string>Ctrl+H</string>
+     </property>
+     <property name="checked" >
+      <bool>true</bool>
+     </property>
+     <property name="connectedSettingName" stdset="0" >
+      <string>DONOTTRANSLATE:SyntaxHighlightningEnabled</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <widget class="QPushButton" name="pbAbout" >
+     <property name="toolTip" >
+      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Shows info about UniversalIndentGUI&lt;/p>&lt;/body>&lt;/html></string>
+     </property>
+     <property name="text" >
+      <string>About</string>
+     </property>
+     <property name="icon" >
+      <iconset resource="../resources/Icons.qrc" >
+       <normaloff>:/mainWindow/info.png</normaloff>:/mainWindow/info.png</iconset>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QPushButton" name="pbExit" >
+     <property name="toolTip" >
+      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Quits the UniversalIndentGUI&lt;/p>&lt;/body>&lt;/html></string>
+     </property>
+     <property name="text" >
+      <string>Exit</string>
+     </property>
+     <property name="icon" >
+      <iconset resource="../resources/Icons.qrc" >
+       <normaloff>:/mainWindow/system-log-out.png</normaloff>:/mainWindow/system-log-out.png</iconset>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../resources/Icons.qrc" />
+ </resources>
+ <connections/>
+</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiErrorMessage.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,85 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "UiGuiErrorMessage.h"
+
+/*!
+    \class UiGuiErrorMessage
+    \ingroup grp_Dialogs
+    \brief UiGuiErrorMessage is a child of QErrorMessage. But QErrorMessages
+    "Do not show again" didn't work with my strings, so this is my own, working
+    implementation of it.
+*/
+
+
+/*!
+    \brief Initializes the dialog.
+
+    Retrieves the object pointer to the \a showAgainCheckBox check box, sets the dialogs
+    modality and for a working translation sets the check box text.
+ */
+UiGuiErrorMessage::UiGuiErrorMessage(QWidget *parent) : QErrorMessage(parent) {
+    showAgainCheckBox = findChild<QCheckBox *>();
+    setWindowModality( Qt::ApplicationModal );
+    showAgainCheckBox->setText( tr("Show this message again") );
+}
+
+
+/*!
+    \brief Just a lazy nothin doin destructive destructor.
+ */
+UiGuiErrorMessage::~UiGuiErrorMessage(void) {
+}
+
+
+/*!
+    \brief Shows an error \a message in a dialog box with \a title.
+
+    The shown \a message is added to a list, if not already in there. If it is
+    already in that list and "Show this message again" is not checked, that
+    message will not be shown.
+ */
+void UiGuiErrorMessage::showMessage( const QString &title, const QString &message ) {
+    bool showAgain = true;
+
+    if ( showAgainCheckBox != 0 ) {
+        showAgain = showAgainCheckBox->isChecked();
+    }
+
+    setWindowTitle(title);
+
+    if ( !errorMessageList.contains(message) ) {
+        errorMessageList << message;
+        if ( showAgainCheckBox != 0 ) {
+            showAgainCheckBox->setChecked(true);
+        }
+        QErrorMessage::showMessage( message );
+    }
+    else if ( showAgain ) {
+        QErrorMessage::showMessage( message );
+    }
+}
+
+
+/*!
+    \brief For convinience, for showing a dialog box with the default title "UniversalIndentGUI".
+ */
+void UiGuiErrorMessage::showMessage( const QString &message ) {
+    showMessage( "UniversalIndentGUI", message );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiErrorMessage.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,41 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef UIGUIERRORMESSAGE_H
+#define UIGUIERRORMESSAGE_H
+
+#include <QErrorMessage>
+#include <QCheckBox>
+
+class UiGuiErrorMessage : public QErrorMessage
+{
+    Q_OBJECT
+
+public:
+    UiGuiErrorMessage(QWidget *parent = 0);
+    ~UiGuiErrorMessage(void);
+    void showMessage( const QString &message );
+    void showMessage( const QString &title, const QString &message );
+
+private:
+    QCheckBox *showAgainCheckBox;
+    QStringList errorMessageList;
+};
+
+#endif // UIGUIERRORMESSAGE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiHighlighter.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,461 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QtGui>
+
+#include "UiGuiHighlighter.h"
+
+#include "SettingsPaths.h"
+
+//! \defgroup grp_EditorComponent All concerning editor widget.
+
+/*!
+    \class UiGuiHighlighter
+    \ingroup grp_EditorComponent
+    \brief UiGuiHighlighter used for selecting the syntax highlighter/lexer for the QsciScintilla component.
+*/
+
+/*!
+    \brief The constructor initializes some regular expressions and keywords to identify cpp tokens
+ */
+UiGuiHighlighter::UiGuiHighlighter(QsciScintilla *parent) : QObject(parent) {
+    this->qsciEditorParent = parent;
+
+    // Create the highlighter settings object from the UiGuiSyntaxHighlightConfig.ini file.
+    this->settings = new QSettings(SettingsPaths::getSettingsPath() + "/UiGuiSyntaxHighlightConfig.ini", QSettings::IniFormat, this);
+
+    highlightningIsOn = true;
+
+    mapHighlighternameToExtension["Bash"] = QStringList() << "sh";
+    mapHighlighternameToExtension["Batch"] = QStringList() << "bat";
+    mapHighlighternameToExtension["CMake"] = QStringList() << "cmake";
+    mapHighlighternameToExtension["C++"] = QStringList() << "c" << "h" << "cpp" << "hpp" << "cxx" << "hxx";
+    mapHighlighternameToExtension["C#"] = QStringList() << "cs";
+    mapHighlighternameToExtension["CSS"] = QStringList() << "css";
+    mapHighlighternameToExtension["D"] = QStringList() << "d";
+    mapHighlighternameToExtension["Diff"] = QStringList() << "diff";
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    mapHighlighternameToExtension["Fortran"] = QStringList() << "f" << "for";
+    mapHighlighternameToExtension["Fortran77"] = QStringList() << "f77";
+#endif
+    mapHighlighternameToExtension["HTML"] = QStringList() << "html" << "htm";
+    mapHighlighternameToExtension["IDL"] = QStringList() << "idl";
+    mapHighlighternameToExtension["Java"] = QStringList() << "java";
+    mapHighlighternameToExtension["JavaScript"] = QStringList() << "js";
+    mapHighlighternameToExtension["LUA"] = QStringList() << "lua";
+    mapHighlighternameToExtension["Makefile"] = QStringList() << "makefile";
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    mapHighlighternameToExtension["Pascal"] = QStringList() << "pas";
+#endif
+    mapHighlighternameToExtension["Perl"] = QStringList() << "perl" << "pl" << "pm";
+    mapHighlighternameToExtension["PHP"] = QStringList() << "php";
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    mapHighlighternameToExtension["PostScript"] = QStringList() << "ps" << "eps" << "pdf" << "ai" << "fh";
+#endif
+    mapHighlighternameToExtension["POV"] = QStringList() << "pov";
+    mapHighlighternameToExtension["Ini"] = QStringList() << "ini";
+    mapHighlighternameToExtension["Python"] = QStringList() << "py";
+    mapHighlighternameToExtension["Ruby"] = QStringList() << "rub" << "rb";
+    mapHighlighternameToExtension["SQL"] = QStringList() << "sql";
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    mapHighlighternameToExtension["TCL"] = QStringList() << "tcl";
+#endif
+    mapHighlighternameToExtension["TeX"] = QStringList() << "tex";
+    mapHighlighternameToExtension["VHDL"] = QStringList() << "vhdl";
+    mapHighlighternameToExtension["XML"] = QStringList() << "xml";
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    mapHighlighternameToExtension["YAML"] = QStringList() << "yaml";
+#endif
+
+    lexer = NULL;
+
+    // This code is only for testing.
+    /*
+    foreach(QStringList extensionList, mapHighlighternameToExtension.values() ) {
+        setLexerForExtension( extensionList.at(0) );
+    }
+    */
+
+    // Set default highlighter to C++ highlighter.
+    setLexerForExtension( "cpp" );
+}
+
+
+/*!
+    \brief Returns the available highlighters as QStringList.
+ */
+QStringList UiGuiHighlighter::getAvailableHighlighters() {
+    return mapHighlighternameToExtension.keys();
+}
+
+
+/*!
+    \brief This slot handles signals coming from selecting another syntax highlighter.
+ */
+void UiGuiHighlighter::setHighlighterByAction(QAction* highlighterAction) {
+    QString highlighterName = highlighterAction->text();
+    setLexerForExtension( mapHighlighternameToExtension[highlighterName].first() );
+    //TODO: This is really no nice way. How do it better?
+    // Need to do this "text update" to update the syntax highlighting. Otherwise highlighting is wrong.
+    int scrollPos = qsciEditorParent->verticalScrollBar()->value();
+    qsciEditorParent->setText( qsciEditorParent->text() );
+    qsciEditorParent->verticalScrollBar()->setValue(scrollPos);
+}
+
+
+/*!
+    \brief Turns the syntax parser on.
+*/
+void UiGuiHighlighter::turnHighlightOn() {
+    highlightningIsOn = true;
+    qsciEditorParent->setLexer(lexer);
+    readCurrentSettings("");
+}
+
+/*!
+    \brief Turns the syntax parser off.
+*/
+void UiGuiHighlighter::turnHighlightOff() {
+    highlightningIsOn = false;
+    qsciEditorParent->setLexer();
+#ifdef Q_OS_WIN
+    qsciEditorParent->setFont( QFont("Courier", 10, QFont::Normal) );
+    qsciEditorParent->setMarginsFont( QFont("Courier", 10, QFont::Normal) );
+#else
+    qsciEditorParent->setFont( QFont("Monospace", 10, QFont::Normal) );
+    qsciEditorParent->setMarginsFont( QFont("Monospace", 10, QFont::Normal) );
+#endif
+}
+
+
+/*!
+    \brief Read the settings for the current lexer from the settings file.
+ */
+//TODO: Refactor this function so that the coding style and variable names suit better.
+bool UiGuiHighlighter::readCurrentSettings( const char *prefix ) {
+    bool ok, flag, rc = true;
+    int num;
+    QString key;
+
+    // Reset lists containing fonts and colors for each style
+    fontForStyles.clear();
+    colorForStyles.clear();
+
+    // Read the styles.
+    for (int i = 0; i < 128; ++i) {
+        // Ignore invalid styles.
+        if ( lexer->description(i).isEmpty() )
+            continue;
+
+        key.sprintf( "%s/%s/style%d/", prefix, lexer->language(), i );
+        key.replace("+", "p");
+
+        // Read the foreground color.
+        ok = settings->contains(key + "color");
+        num = settings->value(key + "color", 0).toInt();
+
+        if (ok)
+            setColor( QColor((num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff), i );
+        else
+            rc = false;
+
+        // Read the end-of-line fill.
+        ok = settings->contains(key + "eolfill");
+        flag = settings->value(key + "eolfill", false).toBool();
+
+        if (ok)
+            lexer->setEolFill( flag, i );
+        else
+            rc = false;
+
+        // Read the font
+        QStringList fdesc;
+
+        ok = settings->contains(key + "font");
+        fdesc = settings->value(key + "font").toStringList();
+
+        if (ok && fdesc.count() == 5) {
+            QFont f;
+
+#ifdef Q_OS_WIN
+            f.setFamily(fdesc[0]);
+#else
+            if ( fdesc[0].contains("courier", Qt::CaseInsensitive) )
+                f.setFamily("Monospace");
+            else
+                f.setFamily(fdesc[0]);
+#endif
+            f.setPointSize(fdesc[1].toInt());
+            f.setBold(fdesc[2].toInt());
+            f.setItalic(fdesc[3].toInt());
+            f.setUnderline(fdesc[4].toInt());
+
+            setFont(f, i);
+        }
+        else
+            rc = false;
+
+        // Read the background color.
+        ok = settings->contains(key + "paper");
+        num = settings->value(key + "paper", 0).toInt();
+
+        if (ok)
+            lexer->setPaper( QColor((num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff), i );
+        else
+            rc = false;
+    }
+
+    // Read the properties.
+    key.sprintf( "%s/%s/properties/", prefix, lexer->language() );
+
+    lexer->refreshProperties();
+
+    return rc;
+}
+
+
+/*!
+    \brief Write the settings for the current lexer to the settings file.
+ */
+void UiGuiHighlighter::writeCurrentSettings( const char *prefix ) {
+    QString key;
+
+    // Write the styles.
+    for (int i = 0; i < 128; ++i) {
+        // Ignore invalid styles.
+        if ( lexer->description(i).isEmpty() )
+            continue;
+
+        int num;
+        QColor c;
+
+        key.sprintf( "%s/%s/style%d/", prefix, lexer->language(), i );
+        key.replace("+", "p");
+
+        // Write style name
+        settings->setValue( key + "", lexer->description(i) );
+
+        // Write the foreground color.
+        if ( colorForStyles.contains(i) ) {
+            c = colorForStyles[i];
+        }
+        else {
+            c = lexer->color(i);
+        }
+        num = (c.red() << 16) | (c.green() << 8) | c.blue();
+
+        settings->setValue(key + "color", num);
+
+        // Write the end-of-line fill.
+        settings->setValue( key + "eolfill", lexer->eolFill(i) );
+
+        // Write the font
+        QStringList fdesc;
+        QString fmt("%1");
+        QFont f;
+
+        if ( fontForStyles.contains(i) ) {
+            f = fontForStyles[i];
+        }
+        else {
+            f = lexer->font(i);
+        }
+
+        fdesc += f.family();
+        fdesc += fmt.arg( f.pointSize() );
+
+        // The casts are for Borland.
+        fdesc += fmt.arg( (int)f.bold() );
+        fdesc += fmt.arg( (int)f.italic() );
+        fdesc += fmt.arg( (int)f.underline() );
+
+        settings->setValue(key + "font", fdesc);
+
+        // Write the background color.
+        c = lexer->paper(i);
+        num = (c.red() << 16) | (c.green() << 8) | c.blue();
+
+        settings->setValue(key + "paper", num);
+    }
+}
+
+
+/*!
+    \brief Sets the \a color for the given \a style.
+ */
+void UiGuiHighlighter::setColor(const QColor &color, int style) {
+    colorForStyles[style] = color;
+    lexer->setColor( color, style );
+}
+
+
+/*!
+    \brief Sets the \a font for the given \a style.
+ */
+void UiGuiHighlighter::setFont(const QFont &font, int style) {
+    fontForStyles[style] = font;
+    lexer->setFont( font, style );
+}
+
+
+/*!
+    \brief Sets the to be used lexer by giving his name.
+ */
+void UiGuiHighlighter::setLexerByName( QString lexerName ) {
+    setLexerForExtension( mapHighlighternameToExtension[lexerName].first() );
+}
+
+
+/*!
+    \brief Sets the proper highlighter / lexer for the given file \a extension. Returns the index of the used lexer in the list.
+ */
+int UiGuiHighlighter::setLexerForExtension( QString extension ) {
+    int indexOfHighlighter = 0;
+    extension = extension.toLower();
+
+    if ( lexer != NULL ) {
+        writeCurrentSettings("");
+        delete lexer;
+    }
+
+    if ( extension == "cpp" || extension == "hpp" || extension == "c" || extension == "h" || extension == "cxx" || extension == "hxx" ) {
+        lexer = new QsciLexerCPP();
+    }
+    else if ( extension == "sh" ) {
+        lexer = new QsciLexerBash();
+    }
+    else if ( extension == "bat" ) {
+        lexer = new QsciLexerBatch();
+    }
+    else if ( extension == "cmake" ) {
+        lexer = new QsciLexerCMake();
+    }
+    else if ( extension == "cs" ) {
+        lexer = new QsciLexerCSharp();
+    }
+    else if ( extension == "css" ) {
+        lexer = new QsciLexerCSS();
+    }
+    else if ( extension == "d" ) {
+        lexer = new QsciLexerD();
+    }
+    else if ( extension == "diff" ) {
+        lexer = new QsciLexerDiff();
+    }
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    else if ( extension == "f" || extension == "for" ) {
+        lexer = new QsciLexerFortran();
+    }
+    else if ( extension == "f77" ) {
+        lexer = new QsciLexerFortran77();
+    }
+#endif
+    else if ( extension == "html" || extension == "htm" ) {
+        lexer = new QsciLexerHTML();
+    }
+    else if ( extension == "idl" ) {
+        lexer = new QsciLexerIDL();
+    }
+    else if ( extension == "java" ) {
+        lexer = new QsciLexerJava();
+    }
+    else if ( extension == "js" ) {
+        lexer = new QsciLexerJavaScript();
+    }
+    else if ( extension == "lua" ) {
+        lexer = new QsciLexerLua();
+    }
+    else if ( extension == "makefile" ) {
+        lexer = new QsciLexerMakefile();
+    }
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    else if ( extension == "pas" ) {
+        lexer = new QsciLexerPascal();
+    }
+#endif
+    else if ( extension == "perl" || extension == "pl" || extension == "pm" ) {
+        lexer = new QsciLexerPerl();
+    }
+    else if ( extension == "php" ) {
+        lexer = new QsciLexerHTML();
+    }
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    else if ( extension == "ps" || extension == "eps" || extension == "pdf" || extension == "ai" || extension == "fh") {
+        lexer = new QsciLexerPostScript();
+    }
+#endif
+    else if ( extension == "pov" ) {
+        lexer = new QsciLexerPOV();
+    }
+    else if ( extension == "ini" ) {
+        lexer = new QsciLexerProperties();
+    }
+    else if ( extension == "py" ) {
+        lexer = new QsciLexerPython();
+    }
+    else if ( extension == "rub" || extension == "rb" ) {
+        lexer = new QsciLexerRuby();
+    }
+    else if ( extension == "sql" ) {
+        lexer = new QsciLexerSQL();
+    }
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    else if ( extension == "tcl" ) {
+        lexer = new QsciLexerTCL();
+    }
+#endif
+    else if ( extension == "tex" ) {
+        lexer = new QsciLexerTeX();
+    }
+    else if ( extension == "vhdl" ) {
+        lexer = new QsciLexerVHDL();
+    }
+    else if ( extension == "xml" ) {
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+        lexer = new QsciLexerXML();
+#else
+        lexer = new QsciLexerHTML();
+#endif
+    }
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+    else if ( extension == "yaml" ) {
+        lexer = new QsciLexerYAML();
+    }
+#endif
+    else {
+        lexer = new QsciLexerCPP();
+        extension = "cpp";
+    }
+
+    // Find the index of the selected lexer.
+    indexOfHighlighter = 0;
+    while ( !mapHighlighternameToExtension.values().at(indexOfHighlighter).contains(extension) ) {
+        indexOfHighlighter++;
+    }
+
+    // Set the lexer for the QScintilla widget.
+    if ( highlightningIsOn ) {
+        qsciEditorParent->setLexer(lexer);
+    }
+
+    // Read the settings for the lexer properties from file.
+    readCurrentSettings("");
+
+    return indexOfHighlighter;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiHighlighter.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,109 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef UIGUIHIGHLIGHTER_H
+#define UIGUIHIGHLIGHTER_H
+
+#include <QObject>
+#include <QMap>
+#include <QMenu>
+#include <QCoreApplication>
+#include <Qsci/qsciscintilla.h>
+#include <Qsci/qscilexer.h>
+#include <Qsci/qscilexerbash.h>
+#include <Qsci/qscilexerbatch.h>
+#include <Qsci/qscilexercmake.h>
+#include <Qsci/qscilexercpp.h>
+#include <Qsci/qscilexercsharp.h>
+#include <Qsci/qscilexercss.h>
+#include <Qsci/qscilexerd.h>
+#include <Qsci/qscilexerdiff.h>
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+#include <Qsci/qscilexerfortran.h>
+#include <Qsci/qscilexerfortran77.h>
+#endif
+#include <Qsci/qscilexerhtml.h>
+#include <Qsci/qscilexeridl.h>
+#include <Qsci/qscilexerjava.h>
+#include <Qsci/qscilexerjavascript.h>
+#include <Qsci/qscilexerlua.h>
+#include <Qsci/qscilexermakefile.h>
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+#include <Qsci/qscilexerpascal.h>
+#endif
+#include <Qsci/qscilexerperl.h>
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+#include <Qsci/qscilexerpostscript.h>
+#endif
+#include <Qsci/qscilexerpov.h>
+#include <Qsci/qscilexerproperties.h>
+#include <Qsci/qscilexerpython.h>
+#include <Qsci/qscilexerruby.h>
+#include <Qsci/qscilexersql.h>
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+#include <Qsci/qscilexertcl.h>
+#endif
+#include <Qsci/qscilexertex.h>
+#include <Qsci/qscilexervhdl.h>
+#if ( QSCINTILLA_VERSION >= 0x020300 )
+#include <Qsci/qscilexerxml.h>
+#include <Qsci/qscilexeryaml.h>
+#endif
+
+
+class UiGuiHighlighter : public QObject
+{
+    Q_OBJECT
+
+public:
+    UiGuiHighlighter(QsciScintilla *parent);
+    void turnHighlightOff();
+    void turnHighlightOn();
+	
+	bool readCurrentSettings(const char *prefix);
+	void writeCurrentSettings(const char *prefix);
+    QStringList getAvailableHighlighters();
+
+private:
+    bool highlightningIsOn;
+    QsciScintilla *qsciEditorParent;
+    QMap<int, QFont> fontForStyles;
+    QMap<int, QColor> colorForStyles;
+    QsciLexer* lexer;
+    QSettings *settings;
+    QMap<QString, QStringList> mapHighlighternameToExtension;
+
+public slots:
+    //! The foreground color for style number \a style is set to \a color.  If
+    //! \a style is -1 then the color is set for all styles.
+    void setColor(const QColor &color, int style = -1);
+
+    //! The font for style number \a style is set to \a font.  If \a style is
+    //! -1 then the font is set for all styles.
+    void setFont(const QFont &font, int style = -1);
+
+	//! Sets the lexer that is responsible for the given \a extension.
+	int setLexerForExtension( QString extension );
+
+    void setLexerByName( QString lexerName );
+
+	void setHighlighterByAction(QAction* highlighterAction);
+};
+
+#endif  // UIGUIHIGHLIGHTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiIndentServer.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,153 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include <QtDebug>
+
+#include "UiGuiIndentServer.h"
+
+//! \defgroup grp_Server All concerning the server component.
+
+/*!
+    \class UiGuiIndentServer
+    \ingroup grp_Server
+    \brief UiGuiIndentServer is in such an early state, that even the communication
+    protocol isn't completely planned. So this class lacks documentation until
+    I really know where all this will lead to.
+
+    The plan however is to have a server that receives commands for selecting an
+    indenter and perhaps load some by the user predefined indenter config file. Then
+    the client can send a text to it and will receive it formatted.
+    The idea behind that is to make UiGUIs use as plugin or whatever more flexible.
+    So the plugin is developed for Eclipse for example and it takes the client role,
+    making it possible to use UiGUI from within Eclipse. Choosing a network protocol
+    makes everything platform and programming language independent, so it doesn't
+    matter for which application the plugin/client is developed.
+*/
+
+UiGuiIndentServer::UiGuiIndentServer(void) : QObject() {
+    tcpServer = NULL;
+    currentClientConnection = NULL;
+    readyForHandleRequest = false;
+}
+
+
+UiGuiIndentServer::~UiGuiIndentServer(void) {
+}
+
+
+void UiGuiIndentServer::startServer() {
+    if ( tcpServer == NULL ) {
+        tcpServer = new QTcpServer(this);
+    }
+
+    if ( !tcpServer->isListening() ) {
+        if ( !tcpServer->listen(QHostAddress::Any, 84484) ) {
+            QMessageBox::critical( NULL, tr("UiGUI Server"), tr("Unable to start the server: %1.").arg(tcpServer->errorString()) );
+            return;
+        }
+    }
+
+    connect( tcpServer, SIGNAL(newConnection()), this, SLOT(handleNewConnection()) );
+    readyForHandleRequest = true;
+    blockSize = 0;
+}
+
+
+void UiGuiIndentServer::stopServer() {
+    if ( tcpServer != NULL ) {
+        tcpServer->close();
+        delete tcpServer;
+        tcpServer = NULL;
+    }
+    currentClientConnection = NULL;
+    readyForHandleRequest = false;
+}
+
+
+void UiGuiIndentServer::handleNewConnection() {
+    QTcpSocket *clientConnection = tcpServer->nextPendingConnection();
+    connect( clientConnection, SIGNAL(disconnected()), clientConnection, SLOT(deleteLater()) );
+
+    connect( clientConnection, SIGNAL(readyRead()), this, SLOT(handleReceivedData()) );
+}
+
+
+void UiGuiIndentServer::handleReceivedData() {
+    if ( !readyForHandleRequest ) {
+        return;
+    }
+
+    currentClientConnection = qobject_cast<QTcpSocket*>( sender() );
+    QString receivedData = "";
+
+    if ( currentClientConnection != NULL ) {
+        QDataStream in(currentClientConnection);
+        in.setVersion(QDataStream::Qt_4_0);
+
+        if ( blockSize == 0 ) {
+            if ( currentClientConnection->bytesAvailable() < (int)sizeof(quint32) )
+                return;
+
+            in >> blockSize;
+        }
+
+        if ( currentClientConnection->bytesAvailable() < blockSize )
+            return;
+
+        QString receivedMessage;
+        in >> receivedMessage;
+
+        blockSize = 0;
+
+        qDebug() << "receivedMessage: " << receivedMessage;
+
+        if ( receivedMessage == "ts" ) {
+            sendMessage("Toll");
+        }
+        else {
+            sendMessage("irgendwas");
+        }
+    }
+}
+
+
+void UiGuiIndentServer::sendMessage( const QString &message ) {
+    readyForHandleRequest = false;
+
+    dataToSend = "";
+    QDataStream out(&dataToSend, QIODevice::WriteOnly);
+    out.setVersion(QDataStream::Qt_4_0);
+    out << (quint32)0;
+    out << message;
+    out.device()->seek(0);
+    out << (quint32)(dataToSend.size() - sizeof(quint32));
+
+    connect(currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest()));
+    currentClientConnection->write(dataToSend);
+}
+
+
+void UiGuiIndentServer::checkIfReadyForHandleRequest() {
+    if ( currentClientConnection->bytesToWrite() == 0 ) {
+        QString dataToSendStr = dataToSend.right( dataToSend.size() - sizeof(quint32) );
+        qDebug() << "checkIfReadyForHandleRequest dataToSend was: " << dataToSendStr;
+        disconnect(currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest()));
+        readyForHandleRequest = true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiIndentServer.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,53 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef UIGUIINDENTSERVER_H
+#define UIGUIINDENTSERVER_H
+
+#include <QTcpServer>
+#include <QTcpSocket>
+#include <QMessageBox>
+
+class UiGuiIndentServer : public QObject
+{
+    Q_OBJECT
+
+public:
+    UiGuiIndentServer(void);
+    ~UiGuiIndentServer(void);
+
+public slots:
+    void startServer();
+    void stopServer();
+
+private slots:
+    void handleNewConnection();
+    void handleReceivedData();
+    void sendMessage(const QString &message);
+    void checkIfReadyForHandleRequest();
+
+private:
+    QTcpServer *tcpServer;
+    QByteArray dataToSend;
+    bool readyForHandleRequest;
+    QTcpSocket *currentClientConnection;
+    quint32 blockSize;
+};
+
+#endif // UIGUIINDENTSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiIniFileParser.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,143 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "UiGuiIniFileParser.h"
+
+#include <QTextStream>
+
+//! \defgroup grp_Settings All concerning applications settings.
+
+/*!
+    \class UiGuiIniFileParser
+    \ingroup grp_Settings
+    \brief UiGuiIniFileParser is a simple ini file format parser.
+
+    These ini files need to have key-value pairs in the style
+    "keyname=keyvalue". Groups can be defined by writing the groupname
+    in the style [groupname] before some key-value pairs.
+
+    The reason why I use my own class instead of QSettings is mainly, that
+    QSettings always internally sorts the groups alphabetically and also
+    rewrites a settings file sorted. Very annoying for me.
+*/
+
+/*!
+    \brief Init and empty all needed lists and strings.
+ */
+UiGuiIniFileParser::UiGuiIniFileParser(void) {
+    sections.clear();
+    keyValueMap.clear();
+    iniFileName = "";
+}
+
+
+/*!
+    \brief Directly loads and parses the file with name \a iniFileName.
+ */
+UiGuiIniFileParser::UiGuiIniFileParser(const QString &iniFileName) {
+    UiGuiIniFileParser::UiGuiIniFileParser();
+    this->iniFileName = iniFileName;
+    parseIniFile();
+}
+
+
+UiGuiIniFileParser::~UiGuiIniFileParser(void) {
+}
+
+
+/*!
+    \brief Returns the group/section names in the same order as they occurr in the ini file as QStringList.
+ */
+QStringList UiGuiIniFileParser::childGroups() {
+    QStringList sectionsStringList;
+
+    for( unsigned int i = 0; i < sections.size(); i++ ) {
+        sectionsStringList << sections[i];
+    }
+
+    return sectionsStringList;
+}
+
+
+/*!
+    \brief Returns the value of the defined \a keyName as QVariant.
+
+    The \a keyName is assembled by a section name, a slash and the key name itself.
+    For example if you wish to access the value of the following setting:
+    <code>[NiceSection]</br>niceKeyName=2</code> you would have to call
+    value("NiceSection/niceKeyName").
+ */
+QVariant UiGuiIniFileParser::value(const QString &keyName, const QString &defaultValue) {
+    return keyValueMap.value( keyName, defaultValue );
+}
+
+
+/*!
+    \brief Parses the ini file and stores the key value pairs in the internal vectors \a keys and \a values.
+ */
+void UiGuiIniFileParser::parseIniFile() {
+    QFile iniFile(iniFileName);
+
+    if ( iniFile.open(QFile::ReadOnly) ) {
+        // Clear the vectors holding the keys and values.
+        sections.clear();
+        keyValueMap.clear();
+
+        QTextStream iniFileStream( &iniFile );
+        QString line;
+        QString currentSectionName = "";
+        QString keyName = "";
+        QString valueAsString = "";
+
+        while ( !iniFileStream.atEnd() ) {
+            line = iniFileStream.readLine().trimmed();
+
+            // Test if the read line is a section name and if so remeber it.
+            if ( line.startsWith("[") && line.endsWith("]") ) {
+                currentSectionName = line.remove(0, 1);
+                currentSectionName.chop(1);
+
+                // Store the section name.
+                sections.push_back( currentSectionName );
+            }
+            // Otherwise test whether the line has a assign char
+            else if ( line.contains("=") ) {
+                int indexOfFirstAssign = line.indexOf("=");
+                keyName = line.left(indexOfFirstAssign);
+
+                if ( !keyName.isEmpty() ) {
+                    valueAsString = line.remove(0, indexOfFirstAssign+1);
+                    // Remove any existing double quotes from the value.
+                    if ( valueAsString.startsWith("\"") && valueAsString.endsWith("\"") ) {
+                        valueAsString = valueAsString.remove(0, 1);
+                        valueAsString.chop(1);
+                    }
+
+                    // Prepend an eventually section name to the key name.
+                    if ( !currentSectionName.isEmpty() ) {
+                        keyName = currentSectionName + "/" + keyName;
+                    }
+
+                    // Store the key and value in the map.
+                    keyValueMap.insert(keyName, valueAsString );
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiIniFileParser.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,52 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef UIGUIINIFILEPARSER_H
+#define UIGUIINIFILEPARSER_H
+
+#include <QFile>
+#include <QString>
+#include <QMap>
+#include <QVariant>
+#include <QStringList>
+#include <vector>
+
+/*!
+    \class UiGuiIniFileParser
+    \brief This class can be used to parse and access the contents of well formed ini files, but only readable.
+ */
+
+class UiGuiIniFileParser
+{
+public:
+    UiGuiIniFileParser(void);
+    UiGuiIniFileParser(const QString &iniFileName);
+    ~UiGuiIniFileParser(void);
+    QVariant value(const QString &keyName, const QString &defaultValue="");
+    QStringList childGroups();
+
+private:
+    void parseIniFile();
+
+    QString iniFileName;
+    std::vector<QString> sections;
+    QMap<QString, QVariant> keyValueMap;
+};
+
+#endif // UIGUIINIFILEPARSER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiSettings.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,384 @@
+/***************************************************************************
+*   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+*   thomas-schweitzer(at)arcor.de                                         *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License version 2.0 as   *
+*   published by the Free Software Foundation.                            *
+*                                                                         *
+*   This program is distributed in the hope that it will be useful,       *
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+*   GNU General Public License for more details.                          *
+*                                                                         *
+*   You should have received a copy of the GNU General Public License     *
+*   along with this program in the file LICENSE.GPL; if not, write to the *
+*   Free Software Foundation, Inc.,                                       *
+*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+***************************************************************************/
+
+#include "UiGuiSettings.h"
+
+#include "SettingsPaths.h"
+
+//! \defgroup grp_Settings All concerning the settings.
+
+/*!
+    \class UiGuiSettings
+    \ingroup grp_Settings
+    \brief Handles the settings of the program. Reads them on startup and saves them on exit.
+    Is a singleton class and can only be accessed via getInstance().
+*/
+
+// Inits the single class instance pointer.
+UiGuiSettings* UiGuiSettings::instance = NULL;
+
+/*!
+    \brief The constructor for the settings.
+*/
+UiGuiSettings::UiGuiSettings() : QObject() {
+    // Create the main application settings object from the UniversalIndentGUI.ini file.
+    qsettings = new QSettings(SettingsPaths::getSettingsPath() + "/UniversalIndentGUI.ini", QSettings::IniFormat, this);
+
+    indenterDirctoryStr = SettingsPaths::getGlobalFilesPath() + "/indenters";
+    readAvailableTranslations();
+    loadSettings();
+}
+
+
+/*!
+    \brief Returns the instance of the settings class. If no instance exists, ONE will be created.
+ */
+UiGuiSettings* UiGuiSettings::getInstance() {
+    if ( instance == NULL ) {
+        // Create the settings object, which loads all UiGui settings from a file.
+        instance = new UiGuiSettings();
+    }
+
+    return instance;
+}
+
+
+void UiGuiSettings::deleteInstance() {
+    if ( instance != NULL ) {
+        delete instance;
+        instance = NULL;
+    }
+}
+
+
+/*!
+    \brief The destructor saves the settings to a file.
+ */
+UiGuiSettings::~UiGuiSettings() {
+    saveSettings();
+}
+
+
+/*!
+    \brief Scans the translations directory for available translation files and
+    stores them in the QList \a availableTranslations.
+ */
+void UiGuiSettings::readAvailableTranslations() {
+    QString languageShort;
+    QStringList languageFileList;
+
+    // English is the default language. A translation file does not exist but to have a menu entry, added here.
+    languageFileList << "universalindent_en.qm";
+
+    // Find all translation files in the "translations" directory.
+    QDir translationDirectory = QDir( SettingsPaths::getGlobalFilesPath() + "/translations" );
+    languageFileList << translationDirectory.entryList( QStringList("universalindent_*.qm") );
+
+    // Loop for each found translation file
+    foreach ( languageShort, languageFileList ) {
+        // Remove the leading string "universalindent_" from the filename.
+        languageShort.remove(0,16);
+        // Remove trailing file extension ".qm".
+        languageShort.chop(3);
+
+        availableTranslations.append(languageShort);
+    }
+}
+
+
+/*!
+    \brief Returns a list of the mnemonics of the available translations.
+ */
+QStringList UiGuiSettings::getAvailableTranslations() {
+    return availableTranslations;
+}
+
+
+/*!
+    \brief Extern widgets can connect to this slot to change settings.
+
+    According to the objects property "connectedSettingName" the corresponding
+    setting is known and set.
+ */
+void UiGuiSettings::handleValueChangeFromExtern(int value) {
+    if ( sender() ) {
+        // Get the corresponding setting name from the sender objects property and remove "DONOTTRANSLATE:" from its beginning..
+        QString settingName = sender()->property("connectedSettingName").toString().remove(0, 15);
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = sender()->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Set the value of the setting to the objects value.
+        setValueByName( settingName, value );
+    }
+}
+
+
+/*!
+    \brief Extern widgets can connect to this slot to change settings.
+
+    According to the objects property "connectedSettingName" the corresponding
+    setting is known and set.
+ */
+void UiGuiSettings::handleValueChangeFromExtern(bool value) {
+    if ( sender() ) {
+        // Get the corresponding setting name from the sender objects property and remove "DONOTTRANSLATE:" from its beginning.
+        QString settingName = sender()->property("connectedSettingName").toString().remove(0, 15);
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = sender()->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Set the value of the setting to the objects value.
+        setValueByName( settingName, value );
+    }
+}
+
+
+/*!
+    \brief Extern widgets can connect to this slot to change settings.
+
+    According to the objects property "connectedSettingName" the corresponding
+    setting is known and set.
+ */
+void UiGuiSettings::handleValueChangeFromExtern(QDate value) {
+    if ( sender() ) {
+        // Get the corresponding setting name from the sender objects property and remove "DONOTTRANSLATE:" from its beginning.
+        QString settingName = sender()->property("connectedSettingName").toString().remove(0, 15);
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = sender()->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Set the value of the setting to the objects value.
+        setValueByName( settingName, value );
+    }
+}
+
+
+/*!
+    \brief Extern widgets can connect to this slot to change settings.
+
+    According to the objects property "connectedSettingName" the corresponding
+    setting is known and set.
+ */
+void UiGuiSettings::handleValueChangeFromExtern(QByteArray value) {
+    if ( sender() ) {
+        // Get the corresponding setting name from the sender objects property.
+        QString settingName = sender()->property("connectedSettingName").toString();
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = sender()->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Set the value of the setting to the objects value.
+        setValueByName( settingName, value );
+    }
+}
+
+
+/*!
+    \brief Sets the value of the by \a settingsName defined setting to the value \a value.
+
+    The to \a settingsName corresponding signal is emitted, if the value has changed.
+ */
+bool UiGuiSettings::setValueByName(QString settingName, QVariant value) {
+    // Test if the named setting really exists.
+    if ( settings.contains(settingName) ) {
+        // Test if the new value is different to the one before.
+        if ( settings[settingName] != value ) {
+            // Set the new value.
+            settings[settingName] = value;
+            // Emit the signal for the changed setting.
+            emitSignalForSetting(settingName);
+        }
+        return true;
+    }
+    return false;
+}
+
+
+/*!
+    \brief Emits the correct signal for the given \a settingName.
+
+    If \a settingName equals "all", all signals are emitted. This can be used to update all
+    dependent widgets. \a value is the new value that is emitted along with the signal.
+ */
+void UiGuiSettings::emitSignalForSetting(QString settingName) {
+    // Emit the signal for the changed value.
+    if ( settingName == "VersionInSettingsFile" ) emit versionInSettingsFile( settings[settingName].toString() );
+    else if ( settingName == "WindowIsMaximized" ) emit windowIsMaximized( settings[settingName].toBool() );
+    else if ( settingName == "WindowPosition" ) emit windowPosition( settings[settingName].toPoint() );
+    else if ( settingName == "WindowSize" ) emit windowSize( settings[settingName].toSize() );
+    else if ( settingName == "FileEncoding" ) emit fileEncoding( settings[settingName].toString() );
+    else if ( settingName == "RecentlyOpenedListSize" ) emit recentlyOpenedListSize( settings[settingName].toInt() );
+    else if ( settingName == "LoadLastOpenedFileOnStartup" ) emit loadLastOpenedFileOnStartup( settings[settingName].toBool() );
+    else if ( settingName == "LastOpenedFiles" ) emit lastOpenedFiles( settings[settingName].toString() );
+    else if ( settingName == "SelectedIndenter" ) emit selectedIndenter( settings[settingName].toInt() );
+    else if ( settingName == "SyntaxHighlightningEnabled" ) emit syntaxHighlightningEnabled( settings[settingName].toBool() );
+    else if ( settingName == "WhiteSpaceIsVisible" ) emit whiteSpaceIsVisible( settings[settingName].toBool() );
+    else if ( settingName == "IndenterParameterTooltipsEnabled" ) emit indenterParameterTooltipsEnabled( settings[settingName].toBool() );
+    else if ( settingName == "TabWidth" ) emit tabWidth( settings[settingName].toInt() );
+    else if ( settingName == "Language" ) emit language( settings[settingName].toInt() );
+    else if ( settingName == "CheckForUpdate" ) emit checkForUpdate( settings[settingName].toBool() );
+    else if ( settingName == "LastUpdateCheck" ) emit lastUpdateCheck( settings[settingName].toDate() );
+    else if ( settingName == "MainWindowState" ) emit mainWindowState( settings[settingName].toByteArray() );
+    else if ( settingName == "all" ) {
+        emit versionInSettingsFile( settings["VersionInSettingsFile"].toString() );
+        emit windowIsMaximized( settings["WindowIsMaximized"].toBool() );
+        emit windowPosition( settings["WindowPosition"].toPoint() );
+        emit windowSize( settings["WindowSize"].toSize() );
+        emit fileEncoding( settings["FileEncoding"].toString() );
+        emit recentlyOpenedListSize( settings["RecentlyOpenedListSize"].toInt() );
+        emit loadLastOpenedFileOnStartup( settings["LoadLastOpenedFileOnStartup"].toBool() );
+        emit lastOpenedFiles( settings["LastOpenedFiles"].toString() );
+        emit selectedIndenter( settings["SelectedIndenter"].toInt() );
+        emit syntaxHighlightningEnabled( settings["SyntaxHighlightningEnabled"].toBool() );
+        emit whiteSpaceIsVisible( settings["WhiteSpaceIsVisible"].toBool() );
+        emit indenterParameterTooltipsEnabled( settings["IndenterParameterTooltipsEnabled"].toBool() );
+        emit tabWidth( settings["TabWidth"].toInt() );
+        emit language( settings["Language"].toInt() );
+        emit checkForUpdate( settings["CheckForUpdate"].toBool() );
+        emit lastUpdateCheck( settings["LastUpdateCheck"].toDate() );
+        emit mainWindowState( settings["MainWindowState"].toByteArray() );
+    }
+}
+
+
+/*!
+    \brief Calls \sa emitSignalForSetting with settingName "all" to update all widgets or whatever
+    is connected to each setting.
+ */
+void UiGuiSettings::updateAllDependend() {
+    emitSignalForSetting("all");
+}
+
+
+/*!
+    \brief Returns the value of the by \a settingsName defined setting as QVariant.
+
+    If the named setting does not exist, 0 is being returned.
+*/
+QVariant UiGuiSettings::getValueByName(QString settingName) {
+    // Test if the named setting really exists.
+    if ( settings.contains(settingName) ) {
+        return settings[settingName];
+    }
+    return QVariant(0);
+}
+
+
+/*!
+    \brief Loads the settings for the main application.
+
+    Settings are for example last selected indenter, last loaded source code file and so on.
+*/
+bool UiGuiSettings::loadSettings() {
+    // Read the version string saved in the settings file.
+    settings["VersionInSettingsFile"] = qsettings->value("UniversalIndentGUI/version", "").toString();
+
+    // Read windows last size and position from the settings file.
+    settings["WindowIsMaximized"] = qsettings->value("UniversalIndentGUI/maximized", false).toBool();
+    settings["WindowPosition"] = qsettings->value("UniversalIndentGUI/position", QPoint(50, 50)).toPoint();
+    settings["WindowSize"] = qsettings->value("UniversalIndentGUI/size", QSize(800, 600)).toSize();
+
+    // Read last selected encoding for the opened source code file.
+    settings["FileEncoding"] = qsettings->value("UniversalIndentGUI/encoding", "UTF-8").toString();
+
+    // Read maximum length of list for recently opened files.
+    settings["RecentlyOpenedListSize"] = qsettings->value("UniversalIndentGUI/recentlyOpenedListSize", 5).toInt();
+
+    // Read if last opened source code file should be loaded on startup.
+    settings["LoadLastOpenedFileOnStartup"] = qsettings->value("UniversalIndentGUI/loadLastSourceCodeFileOnStartup", true).toBool();
+
+    // Read last opened source code file from the settings file.
+    settings["LastOpenedFiles"] = qsettings->value("UniversalIndentGUI/lastSourceCodeFile", indenterDirctoryStr+"/example.cpp").toString();
+
+    // Read last selected indenter from the settings file.
+    int SelectedIndenter = qsettings->value("UniversalIndentGUI/selectedIndenter", 0).toInt();
+    if ( SelectedIndenter < 0 ) {
+        SelectedIndenter = 0;
+    }
+    settings["SelectedIndenter"] = SelectedIndenter;
+
+    // Read if syntax highlighting is enabled.
+    settings["SyntaxHighlightningEnabled"] = qsettings->value("UniversalIndentGUI/SyntaxHighlightningEnabled", true).toBool();
+
+    // Read if white space characters should be displayed.
+    settings["WhiteSpaceIsVisible"] = qsettings->value("UniversalIndentGUI/whiteSpaceIsVisible", false).toBool();
+
+    // Read if indenter parameter tool tips are enabled.
+    settings["IndenterParameterTooltipsEnabled"] = qsettings->value("UniversalIndentGUI/indenterParameterTooltipsEnabled", true).toBool();
+
+    // Read the tab width from the settings file.
+    settings["TabWidth"] = qsettings->value("UniversalIndentGUI/tabWidth", 4).toInt();
+
+    // Read the last selected language and stores the index it has in the list of available translations.
+    settings["Language"] = availableTranslations.indexOf( qsettings->value("UniversalIndentGUI/language", "").toString() );
+
+    // Read the update check settings from the settings file.
+    settings["CheckForUpdate"] = qsettings->value("UniversalIndentGUI/CheckForUpdate", true).toBool();
+    settings["LastUpdateCheck"] = qsettings->value("UniversalIndentGUI/LastUpdateCheck", QDate(1900,1,1)).toDate();
+
+    // Read the main window state.
+    settings["MainWindowState"] = qsettings->value("UniversalIndentGUI/MainWindowState", QByteArray()).toByteArray();
+
+    return true;
+}
+
+
+/*!
+    \brief Saves the settings for the main application.
+
+    Settings are for example last selected indenter, last loaded source code file and so on.
+*/
+bool UiGuiSettings::saveSettings() {
+    qsettings->setValue( "UniversalIndentGUI/recentlyOpenedListSize", settings["RecentlyOpenedListSize"] );
+    qsettings->setValue( "UniversalIndentGUI/lastSourceCodeFile", settings["LastOpenedFiles"] );
+    qsettings->setValue( "UniversalIndentGUI/loadLastSourceCodeFileOnStartup", settings["LoadLastOpenedFileOnStartup"] );
+    qsettings->setValue( "UniversalIndentGUI/selectedIndenter", settings["SelectedIndenter"] );
+    qsettings->setValue( "UniversalIndentGUI/indenterParameterTooltipsEnabled", settings["IndenterParameterTooltipsEnabled"] );
+    qsettings->setValue( "UniversalIndentGUI/language", availableTranslations[ settings["Language"].toInt() ] );
+    qsettings->setValue( "UniversalIndentGUI/encoding", settings["FileEncoding"] );
+    qsettings->setValue( "UniversalIndentGUI/version", settings["VersionInSettingsFile"] );
+    qsettings->setValue( "UniversalIndentGUI/maximized", settings["WindowIsMaximized"] );
+    if ( !settings["WindowIsMaximized"].toBool() ) {
+        qsettings->setValue( "UniversalIndentGUI/position", settings["WindowPosition"] );
+        qsettings->setValue( "UniversalIndentGUI/size", settings["WindowSize"] );
+    }
+    qsettings->setValue( "UniversalIndentGUI/SyntaxHighlightningEnabled", settings["SyntaxHighlightningEnabled"] );
+    qsettings->setValue( "UniversalIndentGUI/whiteSpaceIsVisible", settings["WhiteSpaceIsVisible"] );
+    qsettings->setValue( "UniversalIndentGUI/tabWidth", settings["TabWidth"] );
+    // Write the update check settings to the settings file.
+    qsettings->setValue("UniversalIndentGUI/CheckForUpdate", settings["CheckForUpdate"].toBool() );
+    qsettings->setValue("UniversalIndentGUI/LastUpdateCheck", settings["LastUpdateCheck"].toDate() );
+    // Write the main window state.
+    qsettings->setValue("UniversalIndentGUI/MainWindowState", settings["MainWindowState"].toByteArray() );
+
+    return true;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiSettings.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,95 @@
+/***************************************************************************
+*   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+*   thomas-schweitzer(at)arcor.de                                         *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License version 2.0 as   *
+*   published by the Free Software Foundation.                            *
+*                                                                         *
+*   This program is distributed in the hope that it will be useful,       *
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+*   GNU General Public License for more details.                          *
+*                                                                         *
+*   You should have received a copy of the GNU General Public License     *
+*   along with this program in the file LICENSE.GPL; if not, write to the *
+*   Free Software Foundation, Inc.,                                       *
+*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+***************************************************************************/
+
+#ifndef UIGUISETTINGS_H
+#define UIGUISETTINGS_H
+
+#include <QObject>
+#include <QString>
+#include <QSettings>
+#include <QPoint>
+#include <QSize>
+#include <QDir>
+#include <QDate>
+#include <QStringList>
+#include <QCoreApplication>
+
+class UiGuiSettings : public QObject
+{
+	Q_OBJECT
+private:
+    UiGuiSettings();
+    static UiGuiSettings* instance;
+
+public:
+	static UiGuiSettings* getInstance();
+    static void deleteInstance();
+    ~UiGuiSettings();
+    bool loadSettings();
+    bool saveSettings();
+    bool setValueByName(QString settingName, QVariant value);
+	QVariant getValueByName(QString settingName);
+    void updateAllDependend();
+	QStringList getAvailableTranslations();
+
+// Only one slot per possible value type needed, because wanted setting
+// is recognized by the sender objects name.
+public slots:
+	void handleValueChangeFromExtern(int value);
+    void handleValueChangeFromExtern(bool value);
+    void handleValueChangeFromExtern(QDate value);
+    void handleValueChangeFromExtern(QByteArray value);
+
+// Each possible setting needs an own signal.
+signals:
+    void versionInSettingsFile(QString value);
+    void windowIsMaximized(bool value);
+    void windowPosition(QPoint value);
+    void windowSize(QSize value);
+    void fileEncoding(QString value);
+    void recentlyOpenedListSize(int value);
+    void loadLastOpenedFileOnStartup(bool value);
+    void lastOpenedFiles(QString value);
+    void selectedIndenter(int value);
+    void syntaxHighlightningEnabled(bool value);
+    void whiteSpaceIsVisible(bool value);
+    void indenterParameterTooltipsEnabled(bool value);
+    void tabWidth(int value);
+    void language(int value);
+    void checkForUpdate(bool value);
+    void lastUpdateCheck(QDate value);
+    void mainWindowState(QByteArray value);
+
+private:
+    void emitSignalForSetting(QString settingName);
+	void readAvailableTranslations();
+
+	//! Stores the mnemonics of the available translations.
+	QStringList availableTranslations;
+
+    //! The settings file.
+    QSettings *qsettings;
+
+	//! This map holds all possible settings defined by their name as QString. The value is of the type QVariant.
+	QMap<QString, QVariant> settings;
+
+    QString indenterDirctoryStr;
+};
+
+#endif // UIGUISETTINGS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiSettingsDialog.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,261 @@
+/***************************************************************************
+*   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+*   thomas-schweitzer(at)arcor.de                                         *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License version 2.0 as   *
+*   published by the Free Software Foundation.                            *
+*                                                                         *
+*   This program is distributed in the hope that it will be useful,       *
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+*   GNU General Public License for more details.                          *
+*                                                                         *
+*   You should have received a copy of the GNU General Public License     *
+*   along with this program in the file LICENSE.GPL; if not, write to the *
+*   Free Software Foundation, Inc.,                                       *
+*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+***************************************************************************/
+
+#include "UiGuiSettingsDialog.h"
+
+/*!
+    \class UiGuiSettingsDialog
+    \ingroup grp_Settings
+    \brief Displays a dialog window with settings for UniversalIndentGUI
+*/
+
+/*!
+    \brief The constructor calls the setup function for the ui created by uic. and adds
+*/
+UiGuiSettingsDialog::UiGuiSettingsDialog(QWidget* parent, UiGuiSettings* settings) : QDialog(parent) {
+    // Remember pointer to the UiGuiSettings object.
+    this->settings = settings;
+
+    // Init the user interface created by the UIC.
+    setupUi(this);
+
+    //TODO: This call has to be removed when the properties for the highlighters can be set
+    // with the settings dialog.
+    groupBoxSyntaxHighlighterProperties->setToolTip( "(Will be implemented soon)" + groupBoxSyntaxHighlighterProperties->toolTip() );
+
+    // Get all check boxes that are used for settings.
+    checkBoxes = findChildren<QCheckBox*>( QRegExp("uiGui*") );
+
+    // Get all spin boxes that are used for settings.
+    spinBoxes = findChildren<QSpinBox*>( QRegExp("uiGui*") );
+
+    // Get all combo boxes that are used for settings.
+    comboBoxes = findChildren<QComboBox*>( QRegExp("uiGui*") );
+
+    // Connect the accepted signal to own function, to write values back to the UiGuiSettings object.
+    connect(this, SIGNAL(accepted()), this, SLOT(writeWidgetValuesToSettings()) );
+
+    // Init the language selection combobox.
+    initTranslationSelection();
+}
+
+
+/*!
+    \brief By calling this function the combobox for selecting the application language will
+    be initialized.
+
+    Also the translation itself will be reinitialized.
+ */
+void UiGuiSettingsDialog::initTranslationSelection() {
+    // First empty the combo box.
+    uiGuiLanguageSelectionComboBox->clear();
+
+    // Now add an entry into the box for every language short.
+    foreach (QString languageShort, settings->getAvailableTranslations() ) {
+        // Identify the language mnemonic and set the full name.
+        if ( languageShort == "en" ) {
+            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("English") );
+        }
+        else if ( languageShort == "fr" ) {
+            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("French") );
+        }
+        else if ( languageShort == "de" ) {
+            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("German") );
+        }
+        else if ( languageShort == "zh_TW" ) {
+            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Chinese (Taiwan)") );
+        }
+        else if ( languageShort == "ja_jp" ) {
+            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Japanese") );
+        }
+        else if ( languageShort == "ru" ) {
+            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Russian") );
+        }
+        else if ( languageShort == "uk" ) {
+            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Ukrainian") );
+        }
+
+        else {
+            uiGuiLanguageSelectionComboBox->addItem( tr("Unknown language mnemonic ") + languageShort );
+        }
+    }
+}
+
+
+/*!
+    \brief Displays the dialog by calling the dialogs exec function.
+
+    Before it gets all the values needed from the UiGuiSettings object.
+ */
+int UiGuiSettingsDialog::showDialog() {
+    // Get the values for the check boxes from the settings object.
+    foreach (QCheckBox* checkBox, checkBoxes) {
+        // Get the corresponding setting name from the check boxs property and remove "DONOTTRANSLATE:" from its beginning.
+        QString settingName = checkBox->property("connectedSettingName").toString().remove(0, 15);
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = checkBox->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Get value from settings and assign it to the checkbox.
+        bool value = settings->getValueByName( settingName ).toBool();
+        checkBox->setChecked(value);
+    }
+
+    // Get the values for the spin boxes from the settings object.
+    foreach (QSpinBox* spinBox, spinBoxes) {
+        // Get the corresponding setting name from the spin boxs property and remove "DONOTTRANSLATE:" from its beginning.
+        QString settingName = spinBox->property("connectedSettingName").toString().remove(0, 15);
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = spinBox->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Get value from settings and assign it to the checkbox.
+        int value = settings->getValueByName( settingName ).toInt();
+        spinBox->setValue(value);
+    }
+
+    // Get the values for the combo boxes from the settings object.
+    foreach (QComboBox* comboBox, comboBoxes) {
+        // Get the corresponding setting name from the combo boxs property and remove "DONOTTRANSLATE:" from its beginning.
+        QString settingName = comboBox->property("connectedSettingName").toString().remove(0, 15);
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = comboBox->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Get value from settings and assign it to the checkbox.
+        int value = settings->getValueByName( settingName ).toInt();
+        comboBox->setCurrentIndex(value);
+    }
+
+    // Execute the dialog.
+    return exec();
+}
+
+
+/*!
+    \brief This slot is called when the dialog box is closed by pressing the Ok button.
+
+    Writes all settings to the UiGuiSettings object.
+ */
+void UiGuiSettingsDialog::writeWidgetValuesToSettings() {
+    // Write the values of the check boxes to the settings object.
+    foreach (QCheckBox* checkBox, checkBoxes) {
+        // Get the corresponding setting name from the check boxs property and remove "DONOTTRANSLATE:" from its beginning.
+        QString settingName = checkBox->property("connectedSettingName").toString().remove(0, 15);
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = checkBox->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Write the check box value to the settings.
+        settings->setValueByName( settingName, checkBox->isChecked() );
+    }
+
+    // Write the values for the spin boxes to the settings object.
+    foreach (QSpinBox* spinBox, spinBoxes) {
+        // Get the corresponding setting name from the spin boxs property and remove "DONOTTRANSLATE:" from its beginning.
+        QString settingName = spinBox->property("connectedSettingName").toString().remove(0, 15);
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = spinBox->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Write the spin box value to the settings.
+        settings->setValueByName( settingName, spinBox->value() );
+    }
+
+    // Write the values for the spin boxes to the settings object.
+    foreach (QComboBox* comboBox, comboBoxes) {
+        // Get the corresponding setting name from the combo boxs property and remove "DONOTTRANSLATE:" from its beginning.
+        QString settingName = comboBox->property("connectedSettingName").toString().remove(0, 15);
+        // If the property is not set, try using the objects name for convenience.
+        if ( settingName.isEmpty() ) {
+            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
+            settingName = comboBox->objectName();
+            settingName.remove(0,5);
+        }
+
+        // Write the spin box value to the settings.
+        settings->setValueByName( settingName, comboBox->currentIndex() );
+    }
+}
+
+
+/*!
+    \brief Catches language change events and retranslates all needed widgets.
+ */
+void UiGuiSettingsDialog::changeEvent(QEvent *event) {
+    if (event->type() == QEvent::LanguageChange) {
+        retranslateUi(this);
+        // If this is not explicit set here, Qt < 4.3.0 does not translate the buttons.
+        buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
+
+        //TODO: This has to be removed when the properties for the highlighters can be set.
+        groupBoxSyntaxHighlighterProperties->setToolTip( "(Will be implemented soon)" + groupBoxSyntaxHighlighterProperties->toolTip() );
+
+        QStringList languageShortList = settings->getAvailableTranslations();
+
+        // Now retranslate every entry in the language selection box.
+        for (int i = 0; i < languageShortList.size(); i++ ) {
+            QString languageShort = languageShortList.at(i);
+
+            // Identify the language mnemonic and set the full name.
+            if ( languageShort == "en" ) {
+                uiGuiLanguageSelectionComboBox->setItemText( i, tr("English") );
+            }
+            else if ( languageShort == "fr" ) {
+                uiGuiLanguageSelectionComboBox->setItemText( i, tr("French") );
+            }
+            else if ( languageShort == "de" ) {
+                uiGuiLanguageSelectionComboBox->setItemText( i, tr("German") );
+            }
+            else if ( languageShort == "zh_TW" ) {
+                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Chinese (Taiwan)") );
+            }
+            else if ( languageShort == "ja_jp" ) {
+                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Japanese") );
+            }
+            else if ( languageShort == "ru" ) {
+                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Russian") );
+            }
+            else if ( languageShort == "uk" ) {
+                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Ukrainian") );
+            }
+            else {
+                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Unknown language mnemonic ") + languageShort );
+            }
+        }
+    }
+    else {
+        QWidget::changeEvent(event);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UiGuiSettingsDialog.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,50 @@
+/***************************************************************************
+*   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+*   thomas-schweitzer(at)arcor.de                                         *
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License version 2.0 as   *
+*   published by the Free Software Foundation.                            *
+*                                                                         *
+*   This program is distributed in the hope that it will be useful,       *
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+*   GNU General Public License for more details.                          *
+*                                                                         *
+*   You should have received a copy of the GNU General Public License     *
+*   along with this program in the file LICENSE.GPL; if not, write to the *
+*   Free Software Foundation, Inc.,                                       *
+*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+***************************************************************************/
+
+#ifndef UIGUISETTINGSDIALOG_H
+#define UIGUISETTINGSDIALOG_H
+
+#include <QDialog>
+#include "ui_UiGuiSettingsDialog.h"
+#include "UiGuiSettings.h"
+
+class UiGuiSettingsDialog : public QDialog, private Ui::SettingsDialog
+{
+	Q_OBJECT
+
+public:
+	UiGuiSettingsDialog(QWidget* parent, UiGuiSettings* settings);
+
+public slots:
+    int showDialog();
+
+private slots:
+    void writeWidgetValuesToSettings();
+
+private:
+    void changeEvent(QEvent *event);
+	void initTranslationSelection();
+
+    UiGuiSettings* settings;
+    QList<QCheckBox*> checkBoxes;
+    QList<QSpinBox*> spinBoxes;
+    QList<QComboBox*> comboBoxes;
+};
+
+#endif // UIGUISETTINGSDIALOG_H
--- a/src/UiguiHighlighter.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,461 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#include <QtGui>
-
-#include "UiguiHighlighter.h"
-
-#include "SettingsPaths.h"
-
-//! \defgroup grp_EditorComponent All concerning editor widget.
-
-/*!
-    \class UiguiHighlighter
-    \ingroup grp_EditorComponent
-    \brief UiguiHighlighter used for selecting the syntax highlighter/lexer for the QsciScintilla component.
-*/
-
-/*!
-    \brief The constructor initializes some regular expressions and keywords to identify cpp tokens
- */
-UiguiHighlighter::UiguiHighlighter(QsciScintilla *parent) : QObject(parent) {
-    this->qsciEditorParent = parent;
-
-    // Create the highlighter settings object from the UiGuiSyntaxHighlightConfig.ini file.
-    this->settings = new QSettings(SettingsPaths::getSettingsPath() + "/UiGuiSyntaxHighlightConfig.ini", QSettings::IniFormat, this);
-
-    highlightningIsOn = true;
-
-    mapHighlighternameToExtension["Bash"] = QStringList() << "sh";
-    mapHighlighternameToExtension["Batch"] = QStringList() << "bat";
-    mapHighlighternameToExtension["CMake"] = QStringList() << "cmake";
-    mapHighlighternameToExtension["C++"] = QStringList() << "c" << "h" << "cpp" << "hpp" << "cxx" << "hxx";
-    mapHighlighternameToExtension["C#"] = QStringList() << "cs";
-    mapHighlighternameToExtension["CSS"] = QStringList() << "css";
-    mapHighlighternameToExtension["D"] = QStringList() << "d";
-    mapHighlighternameToExtension["Diff"] = QStringList() << "diff";
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    mapHighlighternameToExtension["Fortran"] = QStringList() << "f" << "for";
-    mapHighlighternameToExtension["Fortran77"] = QStringList() << "f77";
-#endif
-    mapHighlighternameToExtension["HTML"] = QStringList() << "html" << "htm";
-    mapHighlighternameToExtension["IDL"] = QStringList() << "idl";
-    mapHighlighternameToExtension["Java"] = QStringList() << "java";
-    mapHighlighternameToExtension["JavaScript"] = QStringList() << "js";
-    mapHighlighternameToExtension["LUA"] = QStringList() << "lua";
-    mapHighlighternameToExtension["Makefile"] = QStringList() << "makefile";
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    mapHighlighternameToExtension["Pascal"] = QStringList() << "pas";
-#endif
-    mapHighlighternameToExtension["Perl"] = QStringList() << "perl" << "pl" << "pm";
-    mapHighlighternameToExtension["PHP"] = QStringList() << "php";
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    mapHighlighternameToExtension["PostScript"] = QStringList() << "ps" << "eps" << "pdf" << "ai" << "fh";
-#endif
-    mapHighlighternameToExtension["POV"] = QStringList() << "pov";
-    mapHighlighternameToExtension["Ini"] = QStringList() << "ini";
-    mapHighlighternameToExtension["Python"] = QStringList() << "py";
-    mapHighlighternameToExtension["Ruby"] = QStringList() << "rub" << "rb";
-    mapHighlighternameToExtension["SQL"] = QStringList() << "sql";
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    mapHighlighternameToExtension["TCL"] = QStringList() << "tcl";
-#endif
-    mapHighlighternameToExtension["TeX"] = QStringList() << "tex";
-    mapHighlighternameToExtension["VHDL"] = QStringList() << "vhdl";
-    mapHighlighternameToExtension["XML"] = QStringList() << "xml";
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    mapHighlighternameToExtension["YAML"] = QStringList() << "yaml";
-#endif
-
-    lexer = NULL;
-
-    // This code is only for testing.
-    /*
-    foreach(QStringList extensionList, mapHighlighternameToExtension.values() ) {
-        setLexerForExtension( extensionList.at(0) );
-    }
-    */
-
-    // Set default highlighter to C++ highlighter.
-    setLexerForExtension( "cpp" );
-}
-
-
-/*!
-    \brief Returns the available highlighters as QStringList.
- */
-QStringList UiguiHighlighter::getAvailableHighlighters() {
-    return mapHighlighternameToExtension.keys();
-}
-
-
-/*!
-    \brief This slot handles signals coming from selecting another syntax highlighter.
- */
-void UiguiHighlighter::setHighlighterByAction(QAction* highlighterAction) {
-    QString highlighterName = highlighterAction->text();
-    setLexerForExtension( mapHighlighternameToExtension[highlighterName].first() );
-    //TODO: This is really no nice way. How do it better?
-    // Need to do this "text update" to update the syntax highlighting. Otherwise highlighting is wrong.
-    int scrollPos = qsciEditorParent->verticalScrollBar()->value();
-    qsciEditorParent->setText( qsciEditorParent->text() );
-    qsciEditorParent->verticalScrollBar()->setValue(scrollPos);
-}
-
-
-/*!
-    \brief Turns the syntax parser on.
-*/
-void UiguiHighlighter::turnHighlightOn() {
-    highlightningIsOn = true;
-    qsciEditorParent->setLexer(lexer);
-    readCurrentSettings("");
-}
-
-/*!
-    \brief Turns the syntax parser off.
-*/
-void UiguiHighlighter::turnHighlightOff() {
-    highlightningIsOn = false;
-    qsciEditorParent->setLexer();
-#ifdef Q_OS_WIN
-    qsciEditorParent->setFont( QFont("Courier", 10, QFont::Normal) );
-    qsciEditorParent->setMarginsFont( QFont("Courier", 10, QFont::Normal) );
-#else
-    qsciEditorParent->setFont( QFont("Monospace", 10, QFont::Normal) );
-    qsciEditorParent->setMarginsFont( QFont("Monospace", 10, QFont::Normal) );
-#endif
-}
-
-
-/*!
-    \brief Read the settings for the current lexer from the settings file.
- */
-//TODO: Refactor this function so that the coding style and variable names suit better.
-bool UiguiHighlighter::readCurrentSettings( const char *prefix ) {
-    bool ok, flag, rc = true;
-    int num;
-    QString key;
-
-    // Reset lists containing fonts and colors for each style
-    fontForStyles.clear();
-    colorForStyles.clear();
-
-    // Read the styles.
-    for (int i = 0; i < 128; ++i) {
-        // Ignore invalid styles.
-        if ( lexer->description(i).isEmpty() )
-            continue;
-
-        key.sprintf( "%s/%s/style%d/", prefix, lexer->language(), i );
-        key.replace("+", "p");
-
-        // Read the foreground color.
-        ok = settings->contains(key + "color");
-        num = settings->value(key + "color", 0).toInt();
-
-        if (ok)
-            setColor( QColor((num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff), i );
-        else
-            rc = false;
-
-        // Read the end-of-line fill.
-        ok = settings->contains(key + "eolfill");
-        flag = settings->value(key + "eolfill", false).toBool();
-
-        if (ok)
-            lexer->setEolFill( flag, i );
-        else
-            rc = false;
-
-        // Read the font
-        QStringList fdesc;
-
-        ok = settings->contains(key + "font");
-        fdesc = settings->value(key + "font").toStringList();
-
-        if (ok && fdesc.count() == 5) {
-            QFont f;
-
-#ifdef Q_OS_WIN
-            f.setFamily(fdesc[0]);
-#else
-            if ( fdesc[0].contains("courier", Qt::CaseInsensitive) )
-                f.setFamily("Monospace");
-            else
-                f.setFamily(fdesc[0]);
-#endif
-            f.setPointSize(fdesc[1].toInt());
-            f.setBold(fdesc[2].toInt());
-            f.setItalic(fdesc[3].toInt());
-            f.setUnderline(fdesc[4].toInt());
-
-            setFont(f, i);
-        }
-        else
-            rc = false;
-
-        // Read the background color.
-        ok = settings->contains(key + "paper");
-        num = settings->value(key + "paper", 0).toInt();
-
-        if (ok)
-            lexer->setPaper( QColor((num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff), i );
-        else
-            rc = false;
-    }
-
-    // Read the properties.
-    key.sprintf( "%s/%s/properties/", prefix, lexer->language() );
-
-    lexer->refreshProperties();
-
-    return rc;
-}
-
-
-/*!
-    \brief Write the settings for the current lexer to the settings file.
- */
-void UiguiHighlighter::writeCurrentSettings( const char *prefix ) {
-    QString key;
-
-    // Write the styles.
-    for (int i = 0; i < 128; ++i) {
-        // Ignore invalid styles.
-        if ( lexer->description(i).isEmpty() )
-            continue;
-
-        int num;
-        QColor c;
-
-        key.sprintf( "%s/%s/style%d/", prefix, lexer->language(), i );
-        key.replace("+", "p");
-
-        // Write style name
-        settings->setValue( key + "", lexer->description(i) );
-
-        // Write the foreground color.
-        if ( colorForStyles.contains(i) ) {
-            c = colorForStyles[i];
-        }
-        else {
-            c = lexer->color(i);
-        }
-        num = (c.red() << 16) | (c.green() << 8) | c.blue();
-
-        settings->setValue(key + "color", num);
-
-        // Write the end-of-line fill.
-        settings->setValue( key + "eolfill", lexer->eolFill(i) );
-
-        // Write the font
-        QStringList fdesc;
-        QString fmt("%1");
-        QFont f;
-
-        if ( fontForStyles.contains(i) ) {
-            f = fontForStyles[i];
-        }
-        else {
-            f = lexer->font(i);
-        }
-
-        fdesc += f.family();
-        fdesc += fmt.arg( f.pointSize() );
-
-        // The casts are for Borland.
-        fdesc += fmt.arg( (int)f.bold() );
-        fdesc += fmt.arg( (int)f.italic() );
-        fdesc += fmt.arg( (int)f.underline() );
-
-        settings->setValue(key + "font", fdesc);
-
-        // Write the background color.
-        c = lexer->paper(i);
-        num = (c.red() << 16) | (c.green() << 8) | c.blue();
-
-        settings->setValue(key + "paper", num);
-    }
-}
-
-
-/*!
-    \brief Sets the \a color for the given \a style.
- */
-void UiguiHighlighter::setColor(const QColor &color, int style) {
-    colorForStyles[style] = color;
-    lexer->setColor( color, style );
-}
-
-
-/*!
-    \brief Sets the \a font for the given \a style.
- */
-void UiguiHighlighter::setFont(const QFont &font, int style) {
-    fontForStyles[style] = font;
-    lexer->setFont( font, style );
-}
-
-
-/*!
-    \brief Sets the to be used lexer by giving his name.
- */
-void UiguiHighlighter::setLexerByName( QString lexerName ) {
-    setLexerForExtension( mapHighlighternameToExtension[lexerName].first() );
-}
-
-
-/*!
-    \brief Sets the proper highlighter / lexer for the given file \a extension. Returns the index of the used lexer in the list.
- */
-int UiguiHighlighter::setLexerForExtension( QString extension ) {
-    int indexOfHighlighter = 0;
-    extension = extension.toLower();
-
-    if ( lexer != NULL ) {
-        writeCurrentSettings("");
-        delete lexer;
-    }
-
-    if ( extension == "cpp" || extension == "hpp" || extension == "c" || extension == "h" || extension == "cxx" || extension == "hxx" ) {
-        lexer = new QsciLexerCPP();
-    }
-    else if ( extension == "sh" ) {
-        lexer = new QsciLexerBash();
-    }
-    else if ( extension == "bat" ) {
-        lexer = new QsciLexerBatch();
-    }
-    else if ( extension == "cmake" ) {
-        lexer = new QsciLexerCMake();
-    }
-    else if ( extension == "cs" ) {
-        lexer = new QsciLexerCSharp();
-    }
-    else if ( extension == "css" ) {
-        lexer = new QsciLexerCSS();
-    }
-    else if ( extension == "d" ) {
-        lexer = new QsciLexerD();
-    }
-    else if ( extension == "diff" ) {
-        lexer = new QsciLexerDiff();
-    }
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    else if ( extension == "f" || extension == "for" ) {
-        lexer = new QsciLexerFortran();
-    }
-    else if ( extension == "f77" ) {
-        lexer = new QsciLexerFortran77();
-    }
-#endif
-    else if ( extension == "html" || extension == "htm" ) {
-        lexer = new QsciLexerHTML();
-    }
-    else if ( extension == "idl" ) {
-        lexer = new QsciLexerIDL();
-    }
-    else if ( extension == "java" ) {
-        lexer = new QsciLexerJava();
-    }
-    else if ( extension == "js" ) {
-        lexer = new QsciLexerJavaScript();
-    }
-    else if ( extension == "lua" ) {
-        lexer = new QsciLexerLua();
-    }
-    else if ( extension == "makefile" ) {
-        lexer = new QsciLexerMakefile();
-    }
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    else if ( extension == "pas" ) {
-        lexer = new QsciLexerPascal();
-    }
-#endif
-    else if ( extension == "perl" || extension == "pl" || extension == "pm" ) {
-        lexer = new QsciLexerPerl();
-    }
-    else if ( extension == "php" ) {
-        lexer = new QsciLexerHTML();
-    }
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    else if ( extension == "ps" || extension == "eps" || extension == "pdf" || extension == "ai" || extension == "fh") {
-        lexer = new QsciLexerPostScript();
-    }
-#endif
-    else if ( extension == "pov" ) {
-        lexer = new QsciLexerPOV();
-    }
-    else if ( extension == "ini" ) {
-        lexer = new QsciLexerProperties();
-    }
-    else if ( extension == "py" ) {
-        lexer = new QsciLexerPython();
-    }
-    else if ( extension == "rub" || extension == "rb" ) {
-        lexer = new QsciLexerRuby();
-    }
-    else if ( extension == "sql" ) {
-        lexer = new QsciLexerSQL();
-    }
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    else if ( extension == "tcl" ) {
-        lexer = new QsciLexerTCL();
-    }
-#endif
-    else if ( extension == "tex" ) {
-        lexer = new QsciLexerTeX();
-    }
-    else if ( extension == "vhdl" ) {
-        lexer = new QsciLexerVHDL();
-    }
-    else if ( extension == "xml" ) {
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-        lexer = new QsciLexerXML();
-#else
-        lexer = new QsciLexerHTML();
-#endif
-    }
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-    else if ( extension == "yaml" ) {
-        lexer = new QsciLexerYAML();
-    }
-#endif
-    else {
-        lexer = new QsciLexerCPP();
-        extension = "cpp";
-    }
-
-    // Find the index of the selected lexer.
-    indexOfHighlighter = 0;
-    while ( !mapHighlighternameToExtension.values().at(indexOfHighlighter).contains(extension) ) {
-        indexOfHighlighter++;
-    }
-
-    // Set the lexer for the QScintilla widget.
-    if ( highlightningIsOn ) {
-        qsciEditorParent->setLexer(lexer);
-    }
-
-    // Read the settings for the lexer properties from file.
-    readCurrentSettings("");
-
-    return indexOfHighlighter;
-}
--- a/src/UiguiHighlighter.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#ifndef UIGUIHIGHLIGHTER_H
-#define UIGUIHIGHLIGHTER_H
-
-#include <QObject>
-#include <QMap>
-#include <QMenu>
-#include <QCoreApplication>
-#include <Qsci/qsciscintilla.h>
-#include <Qsci/qscilexer.h>
-#include <Qsci/qscilexerbash.h>
-#include <Qsci/qscilexerbatch.h>
-#include <Qsci/qscilexercmake.h>
-#include <Qsci/qscilexercpp.h>
-#include <Qsci/qscilexercsharp.h>
-#include <Qsci/qscilexercss.h>
-#include <Qsci/qscilexerd.h>
-#include <Qsci/qscilexerdiff.h>
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-#include <Qsci/qscilexerfortran.h>
-#include <Qsci/qscilexerfortran77.h>
-#endif
-#include <Qsci/qscilexerhtml.h>
-#include <Qsci/qscilexeridl.h>
-#include <Qsci/qscilexerjava.h>
-#include <Qsci/qscilexerjavascript.h>
-#include <Qsci/qscilexerlua.h>
-#include <Qsci/qscilexermakefile.h>
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-#include <Qsci/qscilexerpascal.h>
-#endif
-#include <Qsci/qscilexerperl.h>
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-#include <Qsci/qscilexerpostscript.h>
-#endif
-#include <Qsci/qscilexerpov.h>
-#include <Qsci/qscilexerproperties.h>
-#include <Qsci/qscilexerpython.h>
-#include <Qsci/qscilexerruby.h>
-#include <Qsci/qscilexersql.h>
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-#include <Qsci/qscilexertcl.h>
-#endif
-#include <Qsci/qscilexertex.h>
-#include <Qsci/qscilexervhdl.h>
-#if ( QSCINTILLA_VERSION >= 0x020300 )
-#include <Qsci/qscilexerxml.h>
-#include <Qsci/qscilexeryaml.h>
-#endif
-
-
-class UiguiHighlighter : public QObject
-{
-    Q_OBJECT
-
-public:
-    UiguiHighlighter(QsciScintilla *parent);
-    void turnHighlightOff();
-    void turnHighlightOn();
-	
-	bool readCurrentSettings(const char *prefix);
-	void writeCurrentSettings(const char *prefix);
-    QStringList getAvailableHighlighters();
-
-private:
-    bool highlightningIsOn;
-    QsciScintilla *qsciEditorParent;
-    QMap<int, QFont> fontForStyles;
-    QMap<int, QColor> colorForStyles;
-    QsciLexer* lexer;
-    QSettings *settings;
-    QMap<QString, QStringList> mapHighlighternameToExtension;
-
-public slots:
-    //! The foreground color for style number \a style is set to \a color.  If
-    //! \a style is -1 then the color is set for all styles.
-    void setColor(const QColor &color, int style = -1);
-
-    //! The font for style number \a style is set to \a font.  If \a style is
-    //! -1 then the font is set for all styles.
-    void setFont(const QFont &font, int style = -1);
-
-	//! Sets the lexer that is responsible for the given \a extension.
-	int setLexerForExtension( QString extension );
-
-    void setLexerByName( QString lexerName );
-
-	void setHighlighterByAction(QAction* highlighterAction);
-};
-
-#endif  // UIGUIHIGHLIGHTER_H
--- a/src/UiguiIndentServer.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#include <QtDebug>
-
-#include "UiguiIndentServer.h"
-
-//! \defgroup grp_Server All concerning the server component.
-
-/*!
-    \class UiguiIndentServer
-    \ingroup grp_Server
-    \brief UiguiIndentServer is in such an early state, that even the communication
-    protocol isn't completely planned. So this class lacks documentation until
-    I really know where all this will lead to.
-
-    The plan however is to have a server that receives commands for selecting an
-    indenter and perhaps load some by the user predefined indenter config file. Then
-    the client can send a text to it and will receive it formatted.
-    The idea behind that is to make UiGUIs use as plugin or whatever more flexible.
-    So the plugin is developed for Eclipse for example and it takes the client role,
-    making it possible to use UiGUI from within Eclipse. Choosing a network protocol
-    makes everything platform and programming language independent, so it doesn't
-    matter for which application the plugin/client is developed.
-*/
-
-UiguiIndentServer::UiguiIndentServer(void) : QObject() {
-    tcpServer = NULL;
-    currentClientConnection = NULL;
-    readyForHandleRequest = false;
-}
-
-
-UiguiIndentServer::~UiguiIndentServer(void) {
-}
-
-
-void UiguiIndentServer::startServer() {
-    if ( tcpServer == NULL ) {
-        tcpServer = new QTcpServer(this);
-    }
-
-    if ( !tcpServer->isListening() ) {
-        if ( !tcpServer->listen(QHostAddress::Any, 84484) ) {
-            QMessageBox::critical( NULL, tr("UiGUI Server"), tr("Unable to start the server: %1.").arg(tcpServer->errorString()) );
-            return;
-        }
-    }
-
-    connect( tcpServer, SIGNAL(newConnection()), this, SLOT(handleNewConnection()) );
-    readyForHandleRequest = true;
-    blockSize = 0;
-}
-
-
-void UiguiIndentServer::stopServer() {
-    if ( tcpServer != NULL ) {
-        tcpServer->close();
-        delete tcpServer;
-        tcpServer = NULL;
-    }
-    currentClientConnection = NULL;
-    readyForHandleRequest = false;
-}
-
-
-void UiguiIndentServer::handleNewConnection() {
-    QTcpSocket *clientConnection = tcpServer->nextPendingConnection();
-    connect( clientConnection, SIGNAL(disconnected()), clientConnection, SLOT(deleteLater()) );
-
-    connect( clientConnection, SIGNAL(readyRead()), this, SLOT(handleReceivedData()) );
-}
-
-
-void UiguiIndentServer::handleReceivedData() {
-    if ( !readyForHandleRequest ) {
-        return;
-    }
-
-    currentClientConnection = qobject_cast<QTcpSocket*>( sender() );
-    QString receivedData = "";
-
-    if ( currentClientConnection != NULL ) {
-        QDataStream in(currentClientConnection);
-        in.setVersion(QDataStream::Qt_4_0);
-
-        if ( blockSize == 0 ) {
-            if ( currentClientConnection->bytesAvailable() < (int)sizeof(quint32) )
-                return;
-
-            in >> blockSize;
-        }
-
-        if ( currentClientConnection->bytesAvailable() < blockSize )
-            return;
-
-        QString receivedMessage;
-        in >> receivedMessage;
-
-        blockSize = 0;
-
-        qDebug() << "receivedMessage: " << receivedMessage;
-
-        if ( receivedMessage == "ts" ) {
-            sendMessage("Toll");
-        }
-        else {
-            sendMessage("irgendwas");
-        }
-    }
-}
-
-
-void UiguiIndentServer::sendMessage( const QString &message ) {
-    readyForHandleRequest = false;
-
-    dataToSend = "";
-    QDataStream out(&dataToSend, QIODevice::WriteOnly);
-    out.setVersion(QDataStream::Qt_4_0);
-    out << (quint32)0;
-    out << message;
-    out.device()->seek(0);
-    out << (quint32)(dataToSend.size() - sizeof(quint32));
-
-    connect(currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest()));
-    currentClientConnection->write(dataToSend);
-}
-
-
-void UiguiIndentServer::checkIfReadyForHandleRequest() {
-    if ( currentClientConnection->bytesToWrite() == 0 ) {
-        QString dataToSendStr = dataToSend.right( dataToSend.size() - sizeof(quint32) );
-        qDebug() << "checkIfReadyForHandleRequest dataToSend was: " << dataToSendStr;
-        disconnect(currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest()));
-        readyForHandleRequest = true;
-    }
-}
--- a/src/UiguiIndentServer.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#ifndef UIGUIINDENTSERVER_H
-#define UIGUIINDENTSERVER_H
-
-#include <QTcpServer>
-#include <QTcpSocket>
-#include <QMessageBox>
-
-class UiguiIndentServer : public QObject
-{
-    Q_OBJECT
-
-public:
-    UiguiIndentServer(void);
-    ~UiguiIndentServer(void);
-
-public slots:
-    void startServer();
-    void stopServer();
-
-private slots:
-    void handleNewConnection();
-    void handleReceivedData();
-    void sendMessage(const QString &message);
-    void checkIfReadyForHandleRequest();
-
-private:
-    QTcpServer *tcpServer;
-    QByteArray dataToSend;
-    bool readyForHandleRequest;
-    QTcpSocket *currentClientConnection;
-    quint32 blockSize;
-};
-
-#endif // UIGUIINDENTSERVER_H
--- a/src/UniversalIndentGUI.vcproj	Tue Nov 11 12:51:02 2008 +0000
+++ b/src/UniversalIndentGUI.vcproj	Tue Nov 11 14:56:11 2008 +0000
@@ -209,7 +209,7 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
 			<File
-				RelativePath=".\aboutdialog.cpp"
+				RelativePath=".\AboutDialog.cpp"
 				>
 			</File>
 			<File
@@ -224,11 +224,11 @@
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath=".\UiguiHighlighter.cpp"
+				RelativePath=".\UiGuiHighlighter.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\indenthandler.cpp"
+				RelativePath=".\IndentHandler.cpp"
 				>
 			</File>
 			<File
@@ -236,7 +236,7 @@
 				>
 			</File>
 			<File
-				RelativePath=".\mainwindow.cpp"
+				RelativePath=".\MainWindow.cpp"
 				>
 			</File>
 			<File
@@ -244,31 +244,31 @@
 				>
 			</File>
             <File
-				RelativePath=".\templateBatchScript.cpp"
+				RelativePath=".\TemplateBatchScript.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\uiguierrormessage.cpp"
+				RelativePath=".\UiGuiErrorMessage.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\UiguiIndentServer.cpp"
+				RelativePath=".\UiGuiIndentServer.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\uiguiIniFileParser.cpp"
+				RelativePath=".\UiGuiIniFileParser.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\uiguisettings.cpp"
+				RelativePath=".\UiGuiSettings.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\uiguisettingsdialog.cpp"
+				RelativePath=".\UiGuiSettingsDialog.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\updatecheckdialog.cpp"
+				RelativePath=".\UpdateCheckDialog.cpp"
 				>
 			</File>
 		</Filter>
@@ -278,7 +278,7 @@
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
 			>
 			<File
-				RelativePath=".\aboutdialog.h"
+				RelativePath=".\AboutDialog.h"
 				>
 			</File>
 			<File
@@ -293,15 +293,14 @@
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath=".\UiguiHighlighter.h"
 				>
 			</File>
 			<File
-				RelativePath=".\indenthandler.h"
+				RelativePath=".\IndentHandler.h"
 				>
 			</File>
 			<File
-				RelativePath=".\mainwindow.h"
+				RelativePath=".\MainWindow.h"
 				>
 			</File>
 			<File
@@ -309,31 +308,31 @@
 				>
 			</File>
 			<File
-				RelativePath=".\templateBatchScript.h"
+				RelativePath=".\TemplateBatchScript.h"
 				>
 			</File>
 			<File
-				RelativePath=".\uiguierrormessage.h"
+				RelativePath=".\UiGuiErrorMessage.h"
 				>
 			</File>
 			<File
-				RelativePath=".\UiguiIndentServer.h"
+				RelativePath=".\UiGuiIndentServer.h"
 				>
 			</File>
 			<File
-				RelativePath=".\uiguiIniFileParser.h"
+				RelativePath=".\UiGuiIniFileParser.h"
 				>
 			</File>
 			<File
-				RelativePath=".\uiguisettings.h"
+				RelativePath=".\UiGuiSettings.h"
 				>
 			</File>
 			<File
-				RelativePath=".\uiguisettingsdialog.h"
+				RelativePath=".\UiGuiSettingsDialog.h"
 				>
 			</File>
 			<File
-				RelativePath=".\updatecheckdialog.h"
+				RelativePath=".\UpdateCheckDialog.h"
 				>
 			</File>
 		</Filter>
@@ -355,15 +354,15 @@
 			Name="Forms (UI)"
 			>
 			<File
-				RelativePath=".\aboutdialog.ui"
+				RelativePath=".\AboutDialog.ui"
 				>
 			</File>
 			<File
-				RelativePath=".\mainwindow.ui"
+				RelativePath=".\MainWindow.ui"
 				>
 			</File>
 			<File
-				RelativePath=".\toolBarWidget.ui"
+				RelativePath=".\ToolBarWidget.ui"
 				>
 			</File>
 			<File
@@ -379,7 +378,7 @@
 			Name="Generated"
 			>
 			<File
-				RelativePath="$(OutDir)\tmp\moc\moc_aboutdialog.cpp"
+				RelativePath="$(OutDir)\tmp\moc\moc_AboutDialog.cpp"
 				>
 			</File>
 			<File
@@ -394,35 +393,34 @@
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\moc\moc_UiguiHighlighter.cpp"
+				RelativePath="$(OutDir)\tmp\moc\moc_UiGuiHighlighter.cpp"
 				>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\moc\moc_indenthandler.cpp"
+				RelativePath="$(OutDir)\tmp\moc\moc_IndentHandler.cpp"
 				>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\moc\moc_mainwindow.cpp"
+				RelativePath="$(OutDir)\tmp\moc\moc_MainWindow.cpp"
 				>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\moc\moc_uiguierrormessage.cpp"
+				RelativePath="$(OutDir)\tmp\moc\moc_UiGuiErrorMessage.cpp"
 				>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\moc\moc_UiguiIndentServer.cpp"
 				>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\moc\moc_uiguisettings.cpp"
+				RelativePath="$(OutDir)\tmp\moc\moc_UiGuiSettings.cpp"
 				>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\moc\moc_uiguisettingsdialog.cpp"
+				RelativePath="$(OutDir)\tmp\moc\moc_UiGuiSettingsDialog.cpp"
 				>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\moc\moc_updatecheckdialog.cpp"
+				RelativePath="$(OutDir)\tmp\moc\moc_UpdateCheckDialog.cpp"
 				>
 			</File>
 			<File
@@ -430,7 +428,7 @@
 				>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\uic\ui_aboutdialog.h"
+				RelativePath="$(OutDir)\tmp\uic\ui_AboutDialog.h"
 				>
 				<FileConfiguration
 					Name="Debug|Win32"
@@ -450,7 +448,7 @@
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\uic\ui_mainwindow.h"
+				RelativePath="$(OutDir)\tmp\uic\ui_MainWindow.h"
 				>
 				<FileConfiguration
 					Name="Debug|Win32"
@@ -470,7 +468,7 @@
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="$(OutDir)\tmp\uic\ui_toolBarWidget.h"
+				RelativePath="$(OutDir)\tmp\uic\ui_ToolBarWidget.h"
 				>
 				<FileConfiguration
 					Name="Debug|Win32"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UpdateCheckDialog.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,267 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "UpdateCheckDialog.h"
+
+#include <QRegExpValidator>
+
+/*!
+    \class UpdateCheckDialog
+    \ingroup grp_MainWindow
+    \brief UpdateCheckDialog is a dialog widget that contains functions
+    for online checking for a new version of UniversalIndentGUI.
+*/
+
+/*!
+    \brief Initializes member variables and stores the version of UiGui and a pointer to the settings object.
+ */
+UpdateCheckDialog::UpdateCheckDialog(QString currentVersion, UiGuiSettings *settings, QWidget *parent) : QDialog(parent) {
+    setupUi(this);
+
+    manualUpdateRequested = false;
+    roleOfClickedButton = QDialogButtonBox::InvalidRole;
+
+    // Create object for http request and connect it with the request return handler.
+    http = new QHttp(this);
+    connect( http, SIGNAL(done(bool)), this, SLOT(checkResultsOfFetchedPadXMLFile(bool)) );
+
+    // Create a timer object used for the progress bar.
+    updateCheckProgressTimer = new QTimer(this);
+    updateCheckProgressTimer->setInterval(5);
+    connect( updateCheckProgressTimer, SIGNAL(timeout()), this, SLOT(updateUpdateCheckProgressBar()) );
+    updateCheckProgressCounter = 0;
+
+    // Connect the dialogs buttonbox with a button click handler.
+    connect( buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(handleUpdateCheckDialogButtonClicked(QAbstractButton*)) );
+
+    this->currentVersion = currentVersion;
+    this->settings = settings;
+
+    // This dialog is always modal.
+    setModal(true);
+}
+
+
+/*!
+    \brief This slot should be called, if an update check is manually invoked.
+
+    In difference to the automatic update check, during manual update check request
+    a modal progress indicator dialog will be shown.
+ */
+void UpdateCheckDialog::checkForUpdateAndShowDialog() {
+    manualUpdateRequested = true;
+    getPadXMLFile();
+    showCheckingForUpdateDialog();
+}
+
+
+/*!
+    \brief This slot should be called, if an update check is automatically invoked.
+
+    An automatic invoked update check should run in background, so the user
+    gets not interrupted by a dialog box.
+ */
+void UpdateCheckDialog::checkForUpdate() {
+    manualUpdateRequested = false;
+    getPadXMLFile();
+}
+
+
+/*!
+    \brief This function tries to download the UniversalIndentGui pad file from the SourceForge server
+ */
+void UpdateCheckDialog::getPadXMLFile() {
+    http->setHost("universalindent.sourceforge.net");
+    http->get("/universalindentgui_pad.xml");
+}
+
+
+/*!
+    \brief This slot is called after the update check has returned, either by successfully
+    retrieving the pad file, or on any kind of network error.
+
+    Shows a message if check was successful or not. Offers the user to go to the
+    download page if a newer version exists. In case of an error during update
+    check, a message box with the error will be displayed.
+ */
+void UpdateCheckDialog::checkResultsOfFetchedPadXMLFile(bool errorOccurred) {
+    // Stop the progress bar timer.
+    updateCheckProgressTimer->stop();
+
+    if ( !errorOccurred ) {
+        // Try to find the version string.
+        QString returnedString = http->readAll();
+        int leftPosition = returnedString.indexOf("<Program_Version>");
+        int rightPosition = returnedString.indexOf("</Program_Version>");
+
+        // If the version string could be found in the returned string, show an update dialog and set last update check date.
+        if ( leftPosition != -1 && rightPosition != -1 ) {
+            // Get the pure version string from returned string.
+            returnedString = returnedString.mid( leftPosition+17, rightPosition-(leftPosition+17) );
+
+            // Create integer values from the version strings.
+            int versionOnServerInt = convertVersionStringToNumber( returnedString );
+            int currentVersionInt = convertVersionStringToNumber( currentVersion );
+
+            // Only show update dialog, if the current version number is lower than the one received from the server.
+            if ( versionOnServerInt > currentVersionInt && currentVersionInt >= 0 && versionOnServerInt >= 0 ) {
+                // Show message box whether to download the new version.
+                showNewVersionAvailableDialog(returnedString);
+
+                // If yes clicked, open the download url in the default browser.
+                if ( roleOfClickedButton == QDialogButtonBox::YesRole ) {
+                    QDesktopServices::openUrl( QUrl("http://sourceforge.net/project/showfiles.php?group_id=167482") );
+                }
+            }
+            else if ( manualUpdateRequested ) {
+                showNoNewVersionAvailableDialog();
+            }
+            // Set last update check date.
+            settings->setValueByName("LastUpdateCheck", QDate::currentDate());
+        }
+        // In the returned string, the version string could not be found.
+        else {
+            QMessageBox::warning(this, "Update check error", "There was an error while trying to check for an update! The retrieved file did not contain expected content." );
+        }
+    }
+    // If there was some error while trying to retrieve the update info from server and not cancel was pressed.
+    else if ( roleOfClickedButton != QDialogButtonBox::RejectRole ) {
+        QMessageBox::warning(this, "Update check error", "There was an error while trying to check for an update! Error was : " + http->errorString() );
+    }
+    manualUpdateRequested = false;
+}
+
+
+/*!
+    \brief Displays the progress bar during update check.
+
+    For displaying activity during update check, a timer is started to
+    updated the progress bar. The user can press a cancel button to
+    stop the update check.
+ */
+void UpdateCheckDialog::showCheckingForUpdateDialog() {
+    // Reset the progress bar.
+    updateCheckProgressCounter = 0;
+    progressBar->setValue(updateCheckProgressCounter);
+    progressBar->setInvertedAppearance( false );
+
+    updateCheckProgressTimer->start();
+    progressBar->show();
+    setWindowTitle( tr("Checking for update...") );
+    label->setText( tr("Checking whether a newer version is available") );
+    buttonBox->setStandardButtons(QDialogButtonBox::Cancel);
+    show();
+}
+
+
+/*!
+    \brief Displays the dialog with info about the new available version.
+ */
+void UpdateCheckDialog::showNewVersionAvailableDialog(QString newVersion) {
+    progressBar->hide();
+    setWindowTitle( tr("Update available") );
+    label->setText( tr("A newer version of UniversalIndentGUI is available.\nYour version is %1. New version is %2.\nDo you want to go to the download website?").arg(currentVersion).arg(newVersion) );
+    buttonBox->setStandardButtons(QDialogButtonBox::No|QDialogButtonBox::NoButton|QDialogButtonBox::Yes);
+    exec();
+}
+
+
+/*!
+    \brief Displays the dialog, that no new version is available.
+ */
+void UpdateCheckDialog::showNoNewVersionAvailableDialog() {
+    progressBar->hide();
+    setWindowTitle( tr("No new update available") );
+    label->setText( tr("You already have the latest version of UniversalIndentGUI.") );
+    buttonBox->setStandardButtons(QDialogButtonBox::Ok);
+    exec();
+}
+
+
+/*!
+    \brief This slot is called, when a button in the dialog is clicked.
+
+    If the clicked button was the cancel button, the user wants to cancel
+    the update check. So the http request is aborted and the timer for the
+    progress bar animation is stopped.
+
+    In any case if a button is clicked, the dialog box will be closed.
+ */
+void UpdateCheckDialog::handleUpdateCheckDialogButtonClicked(QAbstractButton *clickedButton) {
+    roleOfClickedButton = buttonBox->buttonRole(clickedButton);
+
+    if ( roleOfClickedButton == QDialogButtonBox::RejectRole ) {
+        // Abort the http request.
+        http->abort();
+        // Stop the progress bar timer.
+        updateCheckProgressTimer->stop();
+    }
+
+    accept();
+}
+
+
+/*!
+    \brief This slot is responsible for the animation of the update check progress bar.
+ */
+void UpdateCheckDialog::updateUpdateCheckProgressBar() {
+    // Depending on the progress bar direction, decrease or increase the progressbar value.
+    if ( progressBar->invertedAppearance() ) {
+        updateCheckProgressCounter--;
+    }
+    else {
+        updateCheckProgressCounter++;
+    }
+
+    // If the progress bar reaches 0 or 100 as value, swap the animation direction.
+    if ( updateCheckProgressCounter == 0 || updateCheckProgressCounter == 100 ) {
+        progressBar->setInvertedAppearance( !progressBar->invertedAppearance() );
+    }
+
+    // Update the progress bar value.
+    progressBar->setValue(updateCheckProgressCounter);
+}
+
+
+/*!
+    \brief Converts the as string given version \a versionString to an integer number.
+
+    The \a versionString must have the format x.x.x where each x represents a number
+    of a maximum of 999. If the input format is wrong, -1 will be returned.The first
+    number will be multiplied by 1000000 the second by 1000 and then all three will
+    be summarized.
+
+    Thus for example 12.5.170 will result in 12005170.
+ */
+int UpdateCheckDialog::convertVersionStringToNumber(QString versionString) {
+    int versionInteger = 0;
+    int pos = 0;
+
+    QRegExp regEx("\\d{1,3}.\\d{1,3}.\\d{1,3}");
+    QRegExpValidator validator(regEx, NULL);
+
+    if ( validator.validate(versionString, pos) == QValidator::Acceptable ) {
+        QStringList versionNumberStringList = versionString.split(".");
+    }
+    else {
+        versionInteger = -1;
+    }
+
+    return versionInteger;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/UpdateCheckDialog.h	Tue Nov 11 14:56:11 2008 +0000
@@ -0,0 +1,68 @@
+/***************************************************************************
+ *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
+ *   thomas-schweitzer(at)arcor.de                                         *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License version 2.0 as   *
+ *   published by the Free Software Foundation.                            *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program in the file LICENSE.GPL; if not, write to the *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef UPDATECHECKDIALOG_H
+#define UPDATECHECKDIALOG_H
+
+#include <QDialog>
+#include <QMessageBox>
+#include <QDesktopServices>
+#include <QHttp>
+#include <QUrl>
+#include <QDate>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QTimer>
+
+#include "ui_UpdateCheckDialog.h"
+#include "UiGuiSettings.h"
+
+class UpdateCheckDialog : public QDialog, public Ui::UpdateCheckDialog
+{
+    Q_OBJECT
+
+public:
+    UpdateCheckDialog(QString currentVersion, UiGuiSettings *settings, QWidget *parent=0);
+
+public slots:
+    void checkForUpdateAndShowDialog();
+    void checkForUpdate();
+
+private:
+    void getPadXMLFile();
+    void showCheckingForUpdateDialog();
+    void showNewVersionAvailableDialog(QString newVersion);
+    void showNoNewVersionAvailableDialog();
+
+    UiGuiSettings *settings;
+    bool manualUpdateRequested;
+    QHttp *http;
+    QString currentVersion;
+    QDialogButtonBox::ButtonRole roleOfClickedButton;
+    QTimer *updateCheckProgressTimer;
+    int updateCheckProgressCounter;
+    int convertVersionStringToNumber(QString versionString);
+
+private slots:
+    void checkResultsOfFetchedPadXMLFile(bool errorOccurred);
+    void handleUpdateCheckDialogButtonClicked(QAbstractButton *clickedButton);
+    void updateUpdateCheckProgressBar();
+};
+
+#endif // UPDATECHECKDIALOG_H
--- a/src/aboutdialog.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#include "aboutdialog.h"
-
-/*!
-    \class AboutDialog
-    \brief Displays a dialog window with information about UniversalIndentGUI
-*/
-
-/*!
-    \brief The constructor calls the setup function for the ui created by uic and adds
-    the GPL text to the text edit.
- */
-AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags, QString version, QString revision, QString buildDate) : QDialog(parent, flags) {
-    this->parent = parent;
-    qApp->setStyleSheet("QTextBrowser{background-color:transparent}");
-    setupUi(this);
-    creditsTextBrowser->setStyleSheet("QTextBrowser#creditsTextBrowser{background-color:white}");
-
-    authorTextBrowser->setOpenExternalLinks( true );
-    creditsTextBrowser->setOpenExternalLinks( true );
-
-    this->version = version;
-    this->revision = revision;
-    this->buildDate = buildDate;
-    QString versionString = versionTextBrowser->toHtml();
-    versionString = versionString.arg(version).arg(revision).arg(buildDate);
-    versionTextBrowser->setHtml(versionString);
-
-    creditsTextBrowser->setHtml("<html><head></head><body>"
-        "<pre> </br></pre>"
-        "<h3 align='center'>Thanks go out to</h3>"
-        "<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>"
-        "<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>"
-        "<p align='center'><a href=\"http://korytskyy.lviv.ua/\"><b>Oleksandr</b></a> for Ukrainian and Russian translation.</p></br>"
-        "<p align='center'><b>Erwan &quot;leg&quot;</b> for French translation and the new icon logo.</p></br>"
-        "<p align='center'>The <a href=\"http://www.scintilla.org/\"><b>Scintilla</b></a> project for their great text editing component.</p></br>"
-        "<p align='center'><a href=\"http://www.riverbankcomputing.co.uk/software/qscintilla/\"><b>Riverbank</b></a> for their Scintlla Qt wrapper QScintilla.</p></br>"
-        "<p align='center'>The <a href=\"http://astyle.sourceforge.net/\"><b>Artistic Style</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://invisible-island.net/bcpp/\"><b>BCPP</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://www.siber.com/sct/tools/cbl-beau.html\"><b>Cobol Beautifier</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://csstidy.sourceforge.net/\"><b>CSSTidy</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://www.gnu.org/software/indent/\"><b>GNU Indent</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://sourceforge.net/projects/gcgreatcode/\"><b>GreatCode</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://linux.com.hk/penguin/man/1/hindent.html\"><b>hindent</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://www.digital-mines.com/htb/\"><b>HTB</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://tidy.sourceforge.net/\"><b>HTML Tidy</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://code.gosu.pl/\"><b>JsDecoder</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://jsppp.sourceforge.net/\"><b>JSPPP</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://perltidy.sourceforge.net/\"><b>Perltidy</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://beautifyphp.sourceforge.net/\"><b>PHP_Beautifier</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://www.waterproof.fr/products/phpCodeBeautifier/\"><b>phpCB</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://sourceforge.net/projects/phpstylist/\"><b>PHP Stylist</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://www.arachnoid.com/ruby/rubyBeautifier.html\"><b>Ruby Beautifier</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://raa.ruby-lang.org/project/ruby_formatter/\"><b>Ruby Formatter</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://www.bolthole.com/AWK.html\"><b>Shell Indent</b></a> project.</p></br>"
-        "<p align='center'>The <a href=\"http://uncrustify.sourceforge.net/\"><b>Uncrustify</b></a> project, specially <b>Ben Gardner</b>.</p></br>"
-        "<p align='center'>The <a href=\"http://xmlindent.sourceforge.net/\"><b>XML Indent</b></a> project.</p></br>"
-        "<p align='center'><b>Nirvash</b> for the initial Japanese translation.</p></br>"
-        "<p align='center'>The <a href=\"http://tango.freedesktop.org/Tango_Desktop_Project/\"><b>Tango Project</b></a> for their icons.</p></br>"
-        "<p align='center'><a href=\"http://www.famfamfam.com/\"><b>famfamfam</b></a> for the flag icons.</p></br>"
-        "<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>"
-        "<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>"
-        "</body></html>");
-
-    scrollDirection = 1;
-    scrollSpeed = 100;
-    timer = new QTimer(this);
-    connect( timer, SIGNAL(timeout()), this, SLOT(scroll()) );
-    connect( this, SIGNAL(accepted()), timer, SLOT(stop()) );
-}
-
-
-/*!
-    \brief Catches language change events and retranslates all needed widgets.
- */
-void AboutDialog::changeEvent(QEvent *event) {
-    if (event->type() == QEvent::LanguageChange) {
-        retranslateUi(this);
-
-        QString versionString = versionTextBrowser->toHtml();
-        versionString = versionString.arg(version).arg(revision).arg(buildDate);
-        versionTextBrowser->setHtml(versionString);
-    }
-    else {
-        QWidget::changeEvent(event);
-    }
-}
-
-
-/*!
-    \brief Reimplements the dialog execution function to init the credits scroller.
- */
-int AboutDialog::exec() {
-    //creditsTextBrowser->verticalScrollBar()->setValue(0);
-    timer->start(scrollSpeed);
-    return QDialog::exec();
-}
-
-
-/*!
-    \brief This slot is called each timer timeout to scroll the credits textbrowser.
-    Also changes the scroll direction and speed when reaching the start or end.
- */
-void AboutDialog::scroll() {
-    QScrollBar *scrollBar = creditsTextBrowser->verticalScrollBar();
-    scrollBar->setValue( scrollBar->value()+scrollDirection );
-
-    if ( scrollBar->value() == scrollBar->maximum() ) {
-        // Toggle scroll direction and change scroll speed;
-        scrollDirection = -1;
-        scrollSpeed = 5;
-        timer->stop();
-        timer->start(scrollSpeed);
-    }
-    else if ( scrollBar->value() == scrollBar->minimum() ) {
-        // Toggle scroll direction and change scroll speed;
-        scrollDirection = 1;
-        scrollSpeed = 100;
-        timer->stop();
-        timer->start(scrollSpeed);
-    }
-
-    creditsTextBrowser->update();
-}
-
-
-/*!
-    \brief Shows the about dialog and also starts the credits scroller.
- */
-void AboutDialog::show() {
-    timer->start(scrollSpeed);
-    QDialog::show();
-}
--- a/src/aboutdialog.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#ifndef ABOUTDIALOG_H
-#define ABOUTDIALOG_H
-
-#include <QDialog>
-#include <QUrl>
-#include <QDesktopServices>
-#include <QScrollBar>
-#include <QTimer>
-#include "ui_aboutdialog.h"
-
-#include <QLocale>
-
-
-class AboutDialog : public QDialog, private Ui::AboutDialog
-{
-    Q_OBJECT
-
-public:
-    AboutDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0, QString version = "", QString revision = "", QString buildDate = "");
-
-public slots:
-    int exec();
-    void show();
-
-private slots:
-    void scroll();
-
-private:
-    void changeEvent(QEvent *event);
-
-    QString gplText;
-    QString textBrowserSavedContent;
-    QString version;
-    QString revision;
-    QString buildDate;
-    int scrollDirection;
-    int scrollSpeed;
-    QTimer *timer;
-    QWidget *parent;
-};
-
-#endif // ABOUTDIALOG_H
--- a/src/aboutdialog.ui	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +0,0 @@
-<ui version="4.0" >
- <class>AboutDialog</class>
- <widget class="QDialog" name="AboutDialog" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>588</width>
-    <height>512</height>
-   </rect>
-  </property>
-  <property name="sizePolicy" >
-   <sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="minimumSize" >
-   <size>
-    <width>588</width>
-    <height>333</height>
-   </size>
-  </property>
-  <property name="windowTitle" >
-   <string>About UniversalIndentGUI</string>
-  </property>
-  <property name="windowIcon" >
-   <iconset resource="../resources/Icons.qrc" >
-    <normaloff>:/mainWindow/info.png</normaloff>:/mainWindow/info.png</iconset>
-  </property>
-  <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QFrame" name="frame" >
-     <property name="styleSheet" >
-      <string notr="true" >QFrame#frame { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #FFFF60, stop:0.5 #D8C304, stop:1 #FFFF60 ); border: 2px solid #A89C57; border-radius: 4px;}</string>
-     </property>
-     <property name="frameShape" >
-      <enum>QFrame::StyledPanel</enum>
-     </property>
-     <layout class="QVBoxLayout" >
-      <item>
-       <widget class="QLabel" name="bannerLabel" >
-        <property name="sizePolicy" >
-         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="minimumSize" >
-         <size>
-          <width>570</width>
-          <height>87</height>
-         </size>
-        </property>
-        <property name="maximumSize" >
-         <size>
-          <width>570</width>
-          <height>87</height>
-         </size>
-        </property>
-        <property name="text" >
-         <string/>
-        </property>
-        <property name="pixmap" >
-         <pixmap resource="../resources/Icons.qrc" >:/aboutDialog/banner.png</pixmap>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QTextBrowser" name="versionTextBrowser" >
-        <property name="sizePolicy" >
-         <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="maximumSize" >
-         <size>
-          <width>16777215</width>
-          <height>25</height>
-         </size>
-        </property>
-        <property name="frameShape" >
-         <enum>QFrame::NoFrame</enum>
-        </property>
-        <property name="verticalScrollBarPolicy" >
-         <enum>Qt::ScrollBarAlwaysOff</enum>
-        </property>
-        <property name="html" >
-         <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
-p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-&lt;p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;">Version %1 rev.%2, %3 &lt;/p>&lt;/body>&lt;/html></string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QTextBrowser" name="authorTextBrowser" >
-        <property name="sizePolicy" >
-         <sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="acceptDrops" >
-         <bool>false</bool>
-        </property>
-        <property name="frameShape" >
-         <enum>QFrame::NoFrame</enum>
-        </property>
-        <property name="verticalScrollBarPolicy" >
-         <enum>Qt::ScrollBarAlwaysOff</enum>
-        </property>
-        <property name="html" >
-         <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
-p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">&lt;span style=" font-family:'MS Shell Dlg 2';">... is a cross platform compatible GUI for several code formatter, beautifier and indenter like GreatCode, AStyle (Artistic Styler), GNU Indent, BCPP and so on. Main feature is a live preview to directly see how the selected formatting option affects the source code.&lt;/span>&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">&lt;br />Written by : &lt;a href="http://www.thomas-schweitzer.de">&lt;span style=" text-decoration: underline; color:#0000ff;">Thomas Schweitzer&lt;/span>&lt;/a>&lt;/p>
-&lt;p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">Project Homepage : &lt;a href="http://universalindent.sourceforge.net">&lt;span style=" text-decoration: underline; color:#0000ff;">http://universalindent.sourceforge.net&lt;/span>&lt;/a>&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">License: UniversalIndentGui is released under the GPL 2. For details read the included file LICENSE.GPL visit &lt;a href="http://www.gnu.org/licenses/gpl.html">&lt;span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/gpl.html&lt;/span>&lt;/a>.&lt;/p>
-&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;">Credits:&lt;/p>&lt;/body>&lt;/html></string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QTextBrowser" name="creditsTextBrowser" >
-        <property name="verticalScrollBarPolicy" >
-         <enum>Qt::ScrollBarAlwaysOff</enum>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" >
-        <property name="spacing" >
-         <number>6</number>
-        </property>
-        <property name="margin" >
-         <number>0</number>
-        </property>
-        <item>
-         <spacer>
-          <property name="orientation" >
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0" >
-           <size>
-            <width>131</width>
-            <height>31</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QPushButton" name="okButton" >
-          <property name="styleSheet" >
-           <string notr="true" >QPushButton#okButton { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #DCB28A, stop:0.5 #B8784B, stop:1 #DCB28A ); border: 2px solid #A89C57; border-radius: 4px;} QPushButton:hover#okButton { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #B8784B, stop:0.5 #DCB28A, stop:1 #B8784B ); } QPushButton:pressed#okButton{ border: 2px solid #D8CB75 }</string>
-          </property>
-          <property name="text" >
-           <string>          OK          </string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer>
-          <property name="orientation" >
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0" >
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../resources/Icons.qrc" />
- </resources>
- <connections>
-  <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
-   <receiver>AboutDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>278</x>
-     <y>253</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>96</x>
-     <y>254</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
--- a/src/indenthandler.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1574 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#include "indenthandler.h"
-
-#include "uiguisettings.h"
-
-//! \defgroup grp_Indenter All concerning handling of the indenter.
-
-/*!
-    \class IndentHandler
-    \ingroup grp_Indenter
-    \brief A widget for handling many indenters that are configured by an ini file.
-
-    This is a widget that is used by the main window. It handles access to the
-    indenter config file and calls the chosen indenter to reformat the source text.
-    Calls the indenter each time a setting has been changed and informs
-    the main window about the reformatted source code.
-*/
-
-
-/*!
-    \brief Constructor of the indent handler.
-
-    By calling this constructor the indenter to be loaded, can be selected by setting
-    its \a indenterID, which is the number of found indenter ini files in alphabetic
-    order starting at index 0.
- */
-IndentHandler::IndentHandler(int indenterID, QWidget *mainWindow, QWidget *parent) : QWidget(parent) {
-    Q_ASSERT_X( indenterID >= 0, "IndentHandler", "the selected indenterID is < 0" );
-
-    setObjectName(QString::fromUtf8("indentHandler"));
-
-    this->mainWindow = mainWindow;
-
-    parameterChangedCallback = NULL;
-    windowClosedCallback = NULL;
-    indenterSettings = NULL;
-    menuIndenter = NULL;
-    actionLoad_Indenter_Config_File = NULL;
-    actionSave_Indenter_Config_File = NULL;
-    actionCreateShellScript = NULL;
-    initIndenterMenu();
-
-    connect( actionLoad_Indenter_Config_File, SIGNAL(triggered()), this, SLOT(openConfigFileDialog()) );
-    connect( actionSave_Indenter_Config_File, SIGNAL(triggered()), this, SLOT(saveasIndentCfgFileDialog()) );
-    connect( actionCreateShellScript, SIGNAL(triggered()), this, SLOT(createIndenterCallShellScript()) );
-    connect( actionResetIndenterParameters, SIGNAL(triggered()), this, SLOT(resetIndenterParameter()) );
-
-    // define this widgets size and resize behavior
-    //this->setMaximumWidth(263);
-    this->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
-
-    // create vertical layout box, into which the toolbox will be added
-    vboxLayout = new QVBoxLayout(this);
-    vboxLayout->setMargin(2);
-
-    // Create horizontal layout for indenter selector and help button.
-    QHBoxLayout *hboxLayout = new QHBoxLayout();
-    //hboxLayout->setMargin(2);
-    vboxLayout->addLayout( hboxLayout );
-
-    // Create the indenter selection combo box.
-    indenterSelectionCombobox = new QComboBox(this);
-    indenterSelectionCombobox->setObjectName(QString::fromUtf8("indenterSelectionCombobox"));
-    indenterSelectionCombobox->setProperty("connectedSettingName", "DONOTTRANSLATE:SelectedIndenter");
-    indenterSelectionCombobox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);
-    indenterSelectionCombobox->setMinimumContentsLength(20);
-    connect( indenterSelectionCombobox, SIGNAL(activated(int)), UiguiSettings::getInstance(), SLOT(handleValueChangeFromExtern(int)) );
-    connect( UiguiSettings::getInstance(), SIGNAL(selectedIndenter(int)), this, SLOT(setIndenter(int)) );
-    hboxLayout->addWidget( indenterSelectionCombobox );
-
-    // Create the indenter parameter help button.
-    indenterParameterHelpButton = new QToolButton(this);
-    indenterParameterHelpButton->setObjectName(QString::fromUtf8("indenterParameterHelpButton"));
-    indenterParameterHelpButton->setIcon(QIcon(QString::fromUtf8(":/mainWindow/help.png")));
-    hboxLayout->addWidget( indenterParameterHelpButton );
-    // Handle if the indenter parameter help button is pressed.
-    connect( indenterParameterHelpButton, SIGNAL(clicked()), this, SLOT(showIndenterManual()) );
-
-    // create a toolbox and set its resize behavior
-    toolBox = new QToolBox(this);
-    toolBox->setObjectName(QString::fromUtf8("toolBox"));
-
-#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
-    connect( toolBox, SIGNAL(currentChanged(int)), this, SLOT(repaint()) );
-#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
-
-    //toolBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
-    //toolBox->setMaximumSize(QSize(16777215, 16777215));
-    // insert the toolbox into the vlayout
-    vboxLayout->addWidget(toolBox);
-
-    indenterExecutableCallString = "";
-    indenterExecutableSuffix = "";
-
-    indenterDirctoryStr = SettingsPaths::getIndenterPath();
-    tempDirctoryStr = SettingsPaths::getTempPath();
-    settingsDirctoryStr = SettingsPaths::getSettingsPath();
-    QDir indenterDirctory = QDir(indenterDirctoryStr);
-
-    if ( mainWindow != NULL ) {
-        errorMessageDialog = new UiguiErrorMessage(mainWindow);
-    }
-    else {
-        errorMessageDialog = new UiguiErrorMessage(this);
-    }
-
-    indenterIniFileList = indenterDirctory.entryList( QStringList("uigui_*.ini") );
-    if ( indenterIniFileList.count() > 0 ) {
-        // Take care if the selected indenterID is smaller or greater than the number of existing indenters
-        if ( indenterID < 0 ) {
-            indenterID = 0;
-        }
-        if ( indenterID >= indenterIniFileList.count() ) {
-            indenterID = indenterIniFileList.count() - 1;
-        }
-
-        // Reads and parses the by indenterID defined indent ini file and creates toolbox entries
-        readIndentIniFile( indenterDirctoryStr + "/" + indenterIniFileList.at(indenterID) );
-
-        // Find out how the indenter can be executed.
-        createIndenterCallString();
-
-        // Load the users last settings made for this indenter.
-        loadConfigFile( settingsDirctoryStr + "/" + indenterFileName + ".cfg" );
-
-        // Fill the indenter selection combo box with the list of available indenters.
-        if ( !getAvailableIndenters().isEmpty() ) {
-            indenterSelectionCombobox->addItems( getAvailableIndenters() );
-            indenterSelectionCombobox->setCurrentIndex( indenterID );
-            connect( indenterSelectionCombobox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(selectedIndenterIndexChanged(int)) );
-        }
-    }
-    else {
-        errorMessageDialog->showMessage(tr("No indenter ini files"), tr("There exists no indenter ini files in the directory \"") + QDir(indenterDirctoryStr).absolutePath() + "\".");
-    }
-
-    retranslateUi();
-}
-
-
-/*!
-    \brief Implicitly writes the current indenter parameters to the indenters config file.
- */
-IndentHandler::~IndentHandler() {
-    // Generate the parameter string that will be saved to the indenters config file.
-    QString parameterString = getParameterString();
-    if ( !indenterFileName.isEmpty() ) {
-        saveConfigFile( settingsDirctoryStr + "/" + indenterFileName + ".cfg", parameterString );
-    }
-
-    delete errorMessageDialog;
-}
-
-
-/*!
-    \brief Initializes the context menu used for some actions like saving the indenter config file.
- */
-void IndentHandler::initIndenterMenu() {
-    if ( menuIndenter == NULL ) {
-        actionLoad_Indenter_Config_File = new QAction(this);
-        actionLoad_Indenter_Config_File->setObjectName(QString::fromUtf8("actionLoad_Indenter_Config_File"));
-        actionLoad_Indenter_Config_File->setIcon(QIcon(QString::fromUtf8(":/mainWindow/load_indent_cfg.png")));
-
-        actionSave_Indenter_Config_File = new QAction(this);
-        actionSave_Indenter_Config_File->setObjectName(QString::fromUtf8("actionSave_Indenter_Config_File"));
-        actionSave_Indenter_Config_File->setIcon(QIcon(QString::fromUtf8(":/mainWindow/save_indent_cfg.png")));
-
-        actionCreateShellScript = new QAction(this);
-        actionCreateShellScript->setObjectName(QString::fromUtf8("actionCreateShellScript"));
-        actionCreateShellScript->setIcon(QIcon(QString::fromUtf8(":/mainWindow/shell.png")));
-
-        actionResetIndenterParameters = new QAction(this);
-        actionResetIndenterParameters->setObjectName(QString::fromUtf8("actionResetIndenterParameters"));
-        actionResetIndenterParameters->setIcon(QIcon(QString::fromUtf8(":/mainWindow/view-refresh.png")));
-
-        menuIndenter = new QMenu(this);
-        menuIndenter->setObjectName(QString::fromUtf8("menuIndenter"));
-        menuIndenter->addAction(actionLoad_Indenter_Config_File);
-        menuIndenter->addAction(actionSave_Indenter_Config_File);
-        menuIndenter->addAction(actionCreateShellScript);
-        menuIndenter->addAction(actionResetIndenterParameters);
-    }
-}
-
-
-/*!
-    \brief Returns the context menu used for some actions like saving the indenter config file.
- */
-QMenu* IndentHandler::getIndenterMenu() {
-    return menuIndenter;
-}
-
-
-/*!
-    \brief Returns the actions of the context menu used for some actions like saving the indenter config file.
-*/
-QList<QAction*> IndentHandler::getIndenterMenuActions() {
-    QList<QAction*> actionList;
-    actionList << actionLoad_Indenter_Config_File << actionSave_Indenter_Config_File << actionCreateShellScript << actionResetIndenterParameters;
-    return actionList;
-}
-
-
-/*!
-    \brief Opens the context menu, used for some actions like saving the indenter config file, at the event position.
- */
-void IndentHandler::contextMenuEvent( QContextMenuEvent *event ) {
-    getIndenterMenu()->exec( event->globalPos() );
-}
-
-
-/*!
-    \brief Creates the content for a shell script that can be used as a external tool call
-    to indent an as parameter defined file.
- */
-QString IndentHandler::generateCommandlineCall() {
-    QString indenterCompleteCallString;
-    QString parameterInputFile;
-    QString parameterOuputFile;
-    QString parameterParameterFile;
-    QString replaceInputFileCommand;
-
-    // Define the placeholder for parameter variables either in batch or bash programming.
-#if defined(Q_OS_WIN32)
-    QString shellParameterPlaceholder = "%1";
-#else
-    QString shellParameterPlaceholder = "$1";
-#endif
-
-    // Generate the parameter string that will be saved to the indenters config file.
-    QString parameterString = getParameterString();
-
-    if ( !configFilename.isEmpty() ) {
-        saveConfigFile( indenterDirctoryStr + "/" + configFilename, parameterString );
-    }
-
-    parameterInputFile = " " + inputFileParameter + "\"" + shellParameterPlaceholder + "\"";
-
-    if ( outputFileParameter != "none" && outputFileParameter != "stdout" ) {
-        if ( outputFileName == inputFileName ) {
-            parameterOuputFile = " " + outputFileParameter + "\"" + shellParameterPlaceholder + "\"";
-        }
-        else {
-            parameterOuputFile = " " + outputFileParameter + outputFileName + ".tmp";
-        }
-    }
-
-    // If the config file name is empty it is assumed that all parameters are sent via command line call
-    if ( configFilename.isEmpty() ) {
-        parameterParameterFile = " " + parameterString;
-    }
-    // else if needed add the parameter to the indenter call string where the config file can be found.
-    else if (useCfgFileParameter != "none") {
-        parameterParameterFile = " " + useCfgFileParameter + "\"" + indenterDirctoryStr + "/" + configFilename + "\"";
-    }
-
-    // Assemble indenter call string for parameters according to the set order.
-    if ( parameterOrder == "ipo" ) {
-        indenterCompleteCallString = parameterInputFile + parameterParameterFile + parameterOuputFile;
-    }
-    else if ( parameterOrder == "pio" ) {
-        indenterCompleteCallString = parameterParameterFile + parameterInputFile + parameterOuputFile;
-    }
-    else if ( parameterOrder == "poi" ) {
-        indenterCompleteCallString = parameterParameterFile + parameterOuputFile + parameterInputFile;
-    }
-    else {
-        indenterCompleteCallString = parameterInputFile + parameterOuputFile + parameterParameterFile;
-    }
-
-    // Generate the indenter call string either for win32 or other systems.
-#if defined(Q_OS_WIN32)
-    indenterCompleteCallString = indenterExecutableCallString + indenterCompleteCallString;
-#else
-    indenterCompleteCallString = "#!/bin/bash\n" + indenterExecutableCallString + indenterCompleteCallString;
-#endif
-
-    // If the indenter writes to stdout pipe the output into a file
-    if ( outputFileParameter == "stdout" ) {
-        indenterCompleteCallString = indenterCompleteCallString + " >" + outputFileName + ".tmp";
-    }
-
-    // If the output filename is not the same as the input filename copy the output over the input.
-    if ( outputFileName != inputFileName ) {
-#if defined(Q_OS_WIN32)
-        replaceInputFileCommand = "move /Y " + outputFileName + ".tmp \"" + shellParameterPlaceholder + "\"\n";
-#else
-        replaceInputFileCommand = "mv " + outputFileName + ".tmp \"" + shellParameterPlaceholder + "\"\n";
-#endif
-    }
-
-#if defined(Q_OS_WIN32)
-    QString shellScript( TemplateBatchScript::getTemplateBatchScript() );
-    shellScript = shellScript.replace("__INDENTERCALLSTRING2__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
-    indenterCompleteCallString = indenterCompleteCallString.replace("%1", "%%G");
-    replaceInputFileCommand = replaceInputFileCommand.replace("%1", "%%G");
-    shellScript = shellScript.replace("__INDENTERCALLSTRING1__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
-#else
-    QString shellScript( TemplateBatchScript::getTemplateBatchScript() );
-    shellScript = shellScript.replace("__INDENTERCALLSTRING2__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
-    indenterCompleteCallString = indenterCompleteCallString.replace("$1", "$file2indent");
-    replaceInputFileCommand = replaceInputFileCommand.replace("$1", "$file2indent");
-    shellScript = shellScript.replace("__INDENTERCALLSTRING1__", indenterCompleteCallString + "\n" + replaceInputFileCommand);
-#endif
-
-    return shellScript;
-}
-
-
-/*!
-    \brief Format \a sourceCode by calling the indenter.
-
-    The \a inputFileExtension has to be given as parameter so the called indenter
-    can identify the programming language if needed.
- */
-QString IndentHandler::callIndenter(QString sourceCode, QString inputFileExtension) {
-    if ( indenterExecutableSuffix == ".js" ) {
-        return callJavaScriptIndenter(sourceCode);
-    }
-    else {
-        return callExecutableIndenter(sourceCode, inputFileExtension);
-    }
-}
-
-
-/*!
-    \brief Format \a sourceCode by calling the interpreted JavaScript code of the indenter.
-
-    The \a inputFileExtension has to be given as parameter so the called indenter
-    can identify the programming language if needed.
-*/
-QString IndentHandler::callJavaScriptIndenter(QString sourceCode) {
-    QScriptEngine engine;
-
-    QScriptValue unformattedCode(&engine, sourceCode);
-    engine.globalObject().setProperty("unformattedCode", unformattedCode);
-
-    QFile jsDecoderFile( indenterExecutableCallString );
-    QString jsDecoderCode;
-    if (jsDecoderFile.open(QFile::ReadOnly)) {
-        jsDecoderCode = jsDecoderFile.readAll();
-    }
-    jsDecoderFile.close();
-
-    QScriptValue value = engine.evaluate(jsDecoderCode);
-    return value.toString();
-}
-
-
-/*!
-    \brief Format \a sourceCode by calling the binary executable of the indenter.
-
-    The \a inputFileExtension has to be given as parameter so the called indenter
-    can identify the programming language if needed.
-*/
-QString IndentHandler::callExecutableIndenter(QString sourceCode, QString inputFileExtension) {
-    Q_ASSERT_X( !inputFileName.isEmpty(), "callIndenter", "inputFileName is empty" );
-//    Q_ASSERT_X( !outputFileName.isEmpty(), "callIndenter", "outputFileName is empty" );
-    Q_ASSERT_X( !indenterFileName.isEmpty(), "callIndenter", "indenterFileName is empty" );
-
-    if ( indenterFileName.isEmpty() ) {
-        return "";
-    }
-
-    QString formattedSourceCode;
-    QString indenterCompleteCallString;
-    QString parameterInputFile;
-    QString parameterOuputFile;
-    QString parameterParameterFile;
-    QProcess indentProcess;
-    QString processReturnString;
-
-    // Generate the parameter string that will be saved to the indenters config file
-    QString parameterString = getParameterString();
-
-    if ( !configFilename.isEmpty() ) {
-        saveConfigFile( tempDirctoryStr + "/" + configFilename, parameterString );
-    }
-
-    // Only add a dot to file extension if the string is not empty
-    if ( !inputFileExtension.isEmpty() ) {
-        inputFileExtension = "." + inputFileExtension;
-    }
-
-    // Delete any previously used input src file and create a new input src file.
-    QFile::remove(tempDirctoryStr + "/" + inputFileName + inputFileExtension);
-    QFile inputSrcFile(tempDirctoryStr + "/" + inputFileName + inputFileExtension);
-    parameterInputFile = " " + inputFileParameter + inputFileName + inputFileExtension;
-
-    if ( outputFileParameter != "none" && outputFileParameter != "stdout" ) {
-        parameterOuputFile = " " + outputFileParameter + outputFileName + inputFileExtension;
-    }
-
-    // If the config file name is empty it is assumed that all parameters are sent via command line call
-    if ( configFilename.isEmpty() ) {
-        parameterParameterFile = " " + parameterString;
-    }
-    // if needed add the parameter to the indenter call string where the config file can be found
-    else if (useCfgFileParameter != "none") {
-        parameterParameterFile = " " + useCfgFileParameter + "\"" + tempDirctoryStr + "/" + configFilename + "\"";
-    }
-
-    // Assemble indenter call string for parameters according to the set order.
-    if ( parameterOrder == "ipo" ) {
-        indenterCompleteCallString = parameterInputFile + parameterParameterFile + parameterOuputFile;
-    }
-    else if ( parameterOrder == "pio" ) {
-        indenterCompleteCallString = parameterParameterFile + parameterInputFile + parameterOuputFile;
-    }
-    else if ( parameterOrder == "poi" ) {
-        indenterCompleteCallString = parameterParameterFile + parameterOuputFile + parameterInputFile;
-    }
-    else {
-        indenterCompleteCallString = parameterInputFile + parameterOuputFile + parameterParameterFile;
-    }
-
-    // If no indenter executable call string could be created before, show an error message.
-    if ( indenterExecutableCallString.isEmpty() ) {
-        errorMessageDialog->showMessage(tr("No indenter executable"),
-            tr("There exists no indenter executable with the name \"%1\" in the directory \"%2\" nor in the global environment.").arg(indenterFileName).arg(indenterDirctoryStr) );
-        return sourceCode;
-    }
-
-    // Generate the indenter call string either for win32 or other systems.
-    indenterCompleteCallString = indenterExecutableCallString + indenterCompleteCallString;
-
-    // Write the source code to the input file for the indenter
-    inputSrcFile.open( QFile::ReadWrite | QFile::Text );
-    inputSrcFile.write( sourceCode.toUtf8() );
-    inputSrcFile.close();
-
-    // errors and standard outputs from the process call are merged together
-    indentProcess.setReadChannelMode(QProcess::MergedChannels);
-
-    // Set the directory for the indenter execution
-    indentProcess.setWorkingDirectory( QFileInfo(tempDirctoryStr).absoluteFilePath() );
-
-    indentProcess.start(indenterCompleteCallString);
-
-    processReturnString = "";
-    // test if there was an error during starting the process of the indenter
-    if ( !indentProcess.waitForFinished(10000) ) {
-        processReturnString = "<html><body>";
-        processReturnString += tr("<b>Returned error message:</b> ") + indentProcess.errorString() + "<br>";
-
-        switch ( indentProcess.error() ) {
-            case QProcess::FailedToStart:
-                processReturnString += tr("<b>Reason could be:</b> ") + "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.<br>";
-                break;
-            case QProcess::Crashed:
-                processReturnString += "The process crashed some time after starting successfully.<br>";
-                break;
-            case QProcess::Timedout:
-                processReturnString += "The called indenter did not response for over 10 seconds, so aborted its execution.<br>";
-                break;
-            case QProcess::WriteError:
-                processReturnString += "An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.<br>";
-                break;
-            case QProcess::ReadError:
-                processReturnString += "An error occurred when attempting to read from the process. For example, the process may not be running.<br>";
-                break;
-            case QProcess::UnknownError:
-                processReturnString += "An unknown error occurred. This is the default return value of error().<br>";
-                break;
-            default:
-                break;
-        }
-        processReturnString += tr("<br><b>Callstring was:</b> ") + indenterCompleteCallString;
-        processReturnString += tr("<br><br><b>Indenter output was:</b><pre>") + indentProcess.readAll() + "</pre></html></body>";
-        QApplication::restoreOverrideCursor();
-        errorMessageDialog->showMessage(tr("Error calling Indenter"), processReturnString);
-    }
-    // there was no problem starting the process/indenter so fetch, what it returned
-    else {
-        processReturnString += indentProcess.readAll();
-    }
-
-    // if the indenter returned an errorcode != 0 show its output
-    if ( indentProcess.exitCode() != 0 ) {
-        QString exitCode;
-        exitCode.setNum(indentProcess.exitCode());
-        processReturnString = tr("<b>Indenter returned with exit code:</b> ") + exitCode + "<br>" +
-                              tr("<b>Indent console output was:</b> ") + processReturnString + "<br>" +
-                              tr("<br><b>Callstring was:</b> ") + indenterCompleteCallString + "</html></body>";
-        QApplication::restoreOverrideCursor();
-        errorMessageDialog->showMessage( tr("Indenter returned error"), processReturnString );
-    }
-
-    // If the indenter results are written to stdout, read them from there...
-    if ( indentProcess.exitCode() == 0 && outputFileParameter == "stdout"  ) {
-        formattedSourceCode = processReturnString;
-    }
-    // ... else read the output file generated by the indenter call.
-    else {
-        QFile outSrcFile(tempDirctoryStr + "/" + outputFileName + inputFileExtension);
-        outSrcFile.open(QFile::ReadOnly | QFile::Text);
-        QTextStream outSrcStrm(&outSrcFile);
-        outSrcStrm.setCodec( QTextCodec::codecForName("UTF-8") );
-        formattedSourceCode = outSrcStrm.readAll();
-        outSrcFile.close();
-    }
-
-    // Delete the temporary input and output files.
-    QFile::remove(tempDirctoryStr + "/" + outputFileName + inputFileExtension);
-    QFile::remove(tempDirctoryStr + "/" + inputFileName + inputFileExtension);
-
-    return formattedSourceCode;
-}
-
-
-/*!
-    \brief Generates and returns a string with all parameters needed to call the indenter.
- */
-QString IndentHandler::getParameterString() {
-    QString parameterString = "";
-
-    // generate parameter string for all boolean values
-    foreach (ParamBoolean pBoolean, paramBooleans) {
-        if ( pBoolean.checkBox->isChecked() ) {
-            if ( !pBoolean.trueString.isEmpty() ) {
-                parameterString += pBoolean.trueString + cfgFileParameterEnding;
-            }
-        }
-        else {
-            if ( !pBoolean.falseString.isEmpty() ) {
-                parameterString += pBoolean.falseString + cfgFileParameterEnding;
-            }
-        }
-    }
-
-    // generate parameter string for all numeric values
-    foreach (ParamNumeric pNumeric, paramNumerics) {
-        if ( pNumeric.valueEnabledChkBox->isChecked() ) {
-            parameterString += pNumeric.paramCallName + QString::number( pNumeric.spinBox->value() ) + cfgFileParameterEnding;
-        }
-    }
-
-    // generate parameter string for all string values
-    foreach (ParamString pString, paramStrings) {
-        if ( !pString.lineEdit->text().isEmpty() && pString.valueEnabledChkBox->isChecked() ) {
-            // Create parameter definition for each value devided by a | sign.
-            foreach (QString paramValue, pString.lineEdit->text().split("|")) {
-                parameterString += pString.paramCallName + paramValue + cfgFileParameterEnding;
-            }
-        }
-    }
-
-    // generate parameter string for all multiple choice values
-    foreach (ParamMultiple pMultiple, paramMultiples) {
-        if ( pMultiple.valueEnabledChkBox->isChecked() ) {
-            parameterString += pMultiple.choicesStrings.at( pMultiple.comboBox->currentIndex () ) + cfgFileParameterEnding;
-        }
-    }
-
-    return parameterString;
-}
-
-
-/*!
-    \brief Write settings for the indenter to a config file.
- */
-void IndentHandler::saveConfigFile(QString filePathName, QString paramString) {
-    QFile::remove( filePathName );
-    QFile cfgFile( filePathName );
-
-    cfgFile.open( QFile::ReadWrite | QFile::Text );
-    cfgFile.write( paramString.toAscii() );
-    cfgFile.close();
-}
-
-
-/*!
-    \brief Load the config file for the indenter and apply the settings made there.
- */
-bool IndentHandler::loadConfigFile(QString filePathName) {
-    QFile cfgFile(filePathName);
-    int index;
-    int crPos;
-    int paramValue = 0;
-    QString paramValueStr;
-    QString cfgFileData = "";
-
-    // If the to be loaded config file does not exist leave all values as they are and return false.
-    if ( !cfgFile.exists() ) {
-        return false;
-    }
-    // else if the to be read config file exists, retrieve its whole content.
-    else {
-        // Open the config file and read all data
-        cfgFile.open( QFile::ReadOnly | QFile::Text );
-        cfgFileData = cfgFile.readAll();
-        cfgFile.close();
-    }
-
-    // Search for name of each boolean parameter and set its value if found.
-    foreach (ParamBoolean pBoolean, paramBooleans) {
-        // boolean value that will be assigned to the checkbox
-        bool paramValue = false;
-
-        // first search for the longer parameter string
-        // the true parameter string is longer than the false string
-        if ( pBoolean.trueString.length() > pBoolean.falseString.length() ) {
-            // search for the true string
-            index = cfgFileData.indexOf( pBoolean.trueString, 0, Qt::CaseInsensitive );
-            // if true string found set the parameter value to true
-            if ( index != -1 ) {
-                paramValue = true;
-            }
-            // if true string not found, search for false string
-            else {
-                index = cfgFileData.indexOf( pBoolean.falseString, 0, Qt::CaseInsensitive );
-                // if false string found set the parameter value to false
-                if ( index != -1 ) {
-                    paramValue = false;
-                }
-                // neither true nor false parameter found so use default value
-                else {
-                    paramValue = indenterSettings->value(pBoolean.paramName + "/ValueDefault").toBool();
-                }
-            }
-        }
-        // the false parameter string is longer than the true string
-        else {
-            // search for the false string
-            index = cfgFileData.indexOf( pBoolean.falseString, 0, Qt::CaseInsensitive );
-            // if false string found set the parameter value to false
-            if ( index != -1 ) {
-                paramValue = false;
-            }
-            // if false string not found, search for true string
-            else {
-                index = cfgFileData.indexOf( pBoolean.trueString, 0, Qt::CaseInsensitive );
-                // if true string found set the parameter value to true
-                if ( index != -1 ) {
-                    paramValue = true;
-                }
-                // neither true nor false parameter found so use default value
-                else {
-                    paramValue = indenterSettings->value(pBoolean.paramName + "/ValueDefault").toBool();
-                }
-            }
-        }
-        pBoolean.checkBox->setChecked(paramValue);
-    }
-
-    // Search for name of each numeric parameter and set the value found behind it.
-    foreach (ParamNumeric pNumeric, paramNumerics) {
-        index = cfgFileData.indexOf( pNumeric.paramCallName, 0, Qt::CaseInsensitive );
-        // parameter was found in config file
-        if ( index != -1 ) {
-            // set index after the parameter name, so in front of the number
-            index += pNumeric.paramCallName.length();
-
-            // Find the end of the parameter by searching for set config file parameter ending. Most of time this is a carriage return.
-            crPos = cfgFileData.indexOf( cfgFileParameterEnding, index+1 );
-
-            // get the number and convert it to int
-            QString test = cfgFileData.mid( index, crPos - index );
-            paramValue = cfgFileData.mid( index, crPos - index ).toInt(NULL);
-
-            // disable the signal-slot connection. Otherwise signal is emmitted each time when value is set
-            QObject::disconnect(pNumeric.spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
-            pNumeric.spinBox->setValue( paramValue );
-            pNumeric.valueEnabledChkBox->setChecked( true );
-            QObject::connect(pNumeric.spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
-        }
-        // parameter was not found in config file
-        else {
-            int defaultValue = indenterSettings->value(pNumeric.paramName + "/ValueDefault").toInt();
-            pNumeric.spinBox->setValue( defaultValue );
-            pNumeric.valueEnabledChkBox->setChecked( false );
-        }
-    }
-
-    // Search for name of each string parameter and set it.
-    foreach (ParamString pString, paramStrings) {
-        paramValueStr = "";
-        // The number of the found values for this parameter name.
-        int numberOfValues = 0;
-        index = cfgFileData.indexOf( pString.paramCallName, 0, Qt::CaseInsensitive );
-        // If parameter was found in config file
-        if ( index != -1 ) {
-            while ( index != -1 ) {
-                numberOfValues++;
-
-                // Set index after the parameter name, so it points to the front of the string value.
-                index += pString.paramCallName.length();
-
-                // Find the end of the parameter by searching for set config file parameter ending. Most of time this is a carriage return.
-                crPos = cfgFileData.indexOf( cfgFileParameterEnding, index+1 );
-
-                // Get the string and remember it.
-                if ( numberOfValues < 2 ) {
-                    paramValueStr = QString( cfgFileData.mid( index, crPos - index ) );
-                }
-                // If the same parameter has been set multiple times, concatenate the strings dvivided by a |.
-                else {
-                    paramValueStr = paramValueStr + "|" + QString( cfgFileData.mid( index, crPos - index ) );
-                }
-
-                // Get next value for this setting, if one exists.
-                index = cfgFileData.indexOf( pString.paramCallName, crPos+1, Qt::CaseInsensitive );
-            }
-            // Set the text for the line edit.
-            pString.lineEdit->setText( paramValueStr );
-            pString.valueEnabledChkBox->setChecked( true );
-        }
-        // Parameter was not found in config file
-        else {
-            paramValueStr = indenterSettings->value(pString.paramName + "/ValueDefault").toString();
-            pString.lineEdit->setText( paramValueStr );
-            pString.valueEnabledChkBox->setChecked( false );
-        }
-    }
-
-    // search for name of each multiple choice parameter and set it
-    foreach (ParamMultiple pMultiple, paramMultiples) {
-        int i = 0;
-        index = -1;
-
-        // search for all parameter names of the multiple choice list
-        // if one is found, set it and leave the while loop
-        while ( i < pMultiple.choicesStrings.count() && index == -1 ) {
-            index = cfgFileData.indexOf( pMultiple.choicesStrings.at(i), 0, Qt::CaseInsensitive );
-            if ( index != -1 ) {
-                pMultiple.comboBox->setCurrentIndex( i );
-                pMultiple.valueEnabledChkBox->setChecked( true );
-            }
-            i++;
-        }
-
-        // parameter was not set in config file, so use default value
-        if ( index == -1 ) {
-            int defaultValue = indenterSettings->value(pMultiple.paramName + "/ValueDefault").toInt();
-            pMultiple.comboBox->setCurrentIndex( defaultValue );
-            pMultiple.valueEnabledChkBox->setChecked( false );
-        }
-    }
-
-    return true;
-}
-
-
-/*!
-    \brief Sets all indenter parameters to their default values defined in the ini file.
- */
-void IndentHandler::resetToDefaultValues() {
-    // Search for name of each boolean parameter and set its value if found.
-    foreach (ParamBoolean pBoolean, paramBooleans) {
-        // Boolean value that will be assigned to the checkbox.
-        bool defaultValue = indenterSettings->value(pBoolean.paramName + "/ValueDefault").toBool();
-        pBoolean.checkBox->setChecked( defaultValue );
-    }
-
-    // Search for name of each numeric parameter and set the value found behind it.
-    foreach (ParamNumeric pNumeric, paramNumerics) {
-        int defaultValue = indenterSettings->value(pNumeric.paramName + "/ValueDefault").toInt();
-        pNumeric.spinBox->setValue( defaultValue );
-        pNumeric.valueEnabledChkBox->setChecked( indenterSettings->value(pNumeric.paramName + "/Enabled").toBool() );
-    }
-
-    // Search for name of each string parameter and set it.
-    foreach (ParamString pString, paramStrings) {
-        QString defaultValue = indenterSettings->value(pString.paramName + "/ValueDefault").toString();
-        pString.lineEdit->setText( defaultValue );
-        pString.valueEnabledChkBox->setChecked( indenterSettings->value(pString.paramName + "/Enabled").toBool() );
-    }
-
-    // Search for name of each multiple choice parameter and set it.
-    foreach (ParamMultiple pMultiple, paramMultiples) {
-        int defaultValue = indenterSettings->value(pMultiple.paramName + "/ValueDefault").toInt();
-        pMultiple.comboBox->setCurrentIndex( defaultValue );
-        pMultiple.valueEnabledChkBox->setChecked( indenterSettings->value(pMultiple.paramName + "/Enabled").toBool() );
-    }
-}
-
-
-/*!
-    \brief Opens and parses the indenter ini file that is declared by \a iniFilePath.
- */
-void IndentHandler::readIndentIniFile(QString iniFilePath) {
-    Q_ASSERT_X( !iniFilePath.isEmpty(), "readIndentIniFile", "iniFilePath is empty" );
-
-    // open the ini-file that contains all available indenter settings with their additional infos
-    indenterSettings = new UiguiIniFileParser(iniFilePath);
-
-    QStringList categories;
-    //QString indenterGroupString = "";
-    QString paramToolTip = "";
-
-
-    //
-    //  parse ini file indenter header
-    //
-
-    indenterName = indenterSettings->value("header/indenterName").toString();
-    indenterFileName = indenterSettings->value("header/indenterFileName").toString();
-    configFilename = indenterSettings->value("header/configFilename").toString();
-    useCfgFileParameter = indenterSettings->value("header/useCfgFileParameter").toString();
-    cfgFileParameterEnding = indenterSettings->value("header/cfgFileParameterEnding").toString();
-    if ( cfgFileParameterEnding == "cr" ) {
-        cfgFileParameterEnding = "\n";
-    }
-    indenterShowHelpParameter = indenterSettings->value("header/showHelpParameter").toString();
-
-    if ( indenterFileName.isEmpty() ) {
-        errorMessageDialog->showMessage( tr("Indenter ini file header error"),
-            tr("The loaded indenter ini file \"%1\"has a faulty header. At least the indenters file name is not set.").arg(iniFilePath) );
-    }
-
-    // Read the parameter order. Possible values are (p=parameter[file] i=inputfile o=outputfile)
-    // pio, ipo, iop
-    parameterOrder = indenterSettings->value("header/parameterOrder", "pio").toString();
-    inputFileParameter = indenterSettings->value("header/inputFileParameter").toString();
-    inputFileName = indenterSettings->value("header/inputFileName").toString();
-    outputFileParameter = indenterSettings->value("header/outputFileParameter").toString();
-    outputFileName = indenterSettings->value("header/outputFileName").toString();
-    fileTypes = indenterSettings->value("header/fileTypes").toString();
-    fileTypes.replace('|', " ");
-
-    // read the categories names which are separated by "|"
-    QString categoriesStr = indenterSettings->value("header/categories").toString();
-    categories = categoriesStr.split("|");
-    // Assure that the category list is never empty. At least contain a "general" section.
-    if ( categories.isEmpty() ) {
-        categories.append("General");
-    }
-
-    ToolBoxPage toolBoxPage;
-
-    // create a page for each category and store its references in a toolboxpage-array
-    foreach (QString category, categories) {
-        toolBoxPage.page = new QWidget();
-        toolBoxPage.page->setObjectName(category);
-        toolBoxPage.page->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-        toolBoxPage.vboxLayout = new QVBoxLayout(toolBoxPage.page);
-        toolBoxPage.vboxLayout->setSpacing(6);
-        toolBoxPage.vboxLayout->setMargin(9);
-        toolBoxPage.vboxLayout->setObjectName(category);
-        toolBoxPages.append(toolBoxPage);
-        toolBox->addItem(toolBoxPage.page, category);
-    }
-
-
-    //
-    //  parse ini file indenter parameters
-    //
-
-    // read all possible parameters written in brackets []
-    indenterParameters = indenterSettings->childGroups();
-
-    // read each parameter to create the corresponding input field
-    foreach (QString indenterParameter, indenterParameters) {
-        // if it is not the indent header definition read the parameter and add it to
-        // the corresponding category toolbox page
-        if ( indenterParameter != "header") {
-            // read to which category the parameter belongs
-            int category = indenterSettings->value(indenterParameter + "/Category").toInt();
-            // Assure that the category number is never greater than the available categories.
-            if ( category > toolBoxPages.size()-1 ) {
-                category = toolBoxPages.size()-1;
-            }
-            // read which type of input field the parameter needs
-            QString editType = indenterSettings->value(indenterParameter + "/EditorType").toString();
-
-            // edit type is numeric so create a spinbox with label
-            if ( editType == "numeric" ) {
-                // read the parameter name as it is used at the command line or in its config file
-                QString parameterCallName = indenterSettings->value(indenterParameter + "/CallName").toString();
-
-                // create checkbox which enables or disables the parameter
-                QCheckBox *chkBox = new QCheckBox( toolBoxPages.at(category).page );
-                chkBox->setChecked( indenterSettings->value(indenterParameter + "/Enabled").toBool() );
-                chkBox->setToolTip( "Enables/disables the parameter. If disabled the indenters default value will be used." );
-                chkBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
-                int left, top, right, bottom;
-                chkBox->getContentsMargins( &left, &top, &right, &bottom );
-                chkBox->setContentsMargins( left, top, 0, bottom );
-
-                // create the spinbox
-                QSpinBox *spinBox = new QSpinBox( toolBoxPages.at(category).page );
-                paramToolTip = indenterSettings->value(indenterParameter + "/Description").toString();
-                spinBox->setToolTip( paramToolTip );
-                spinBox->setMaximumWidth(50);
-                spinBox->setMinimumWidth(50);
-                if ( mainWindow != NULL ) {
-                    spinBox->installEventFilter( mainWindow );
-                }
-                if ( indenterSettings->value(indenterParameter + "/MinVal").toString() != "" ) {
-                    spinBox->setMinimum( indenterSettings->value(indenterParameter + "/MinVal").toInt() );
-                }
-                else {
-                    spinBox->setMinimum( 0 );
-                }
-                if ( indenterSettings->value(indenterParameter + "/MaxVal").toString() != "" ) {
-                    spinBox->setMaximum( indenterSettings->value(indenterParameter + "/MaxVal").toInt() );
-                }
-                else {
-                    spinBox->setMaximum( 2000 );
-                }
-
-                // create the label
-                QLabel *label = new QLabel( toolBoxPages.at(category).page );
-                label->setText(indenterParameter);
-                label->setBuddy(spinBox);
-                label->setToolTip( paramToolTip );
-                if ( mainWindow != NULL ) {
-                    label->installEventFilter( mainWindow );
-                }
-
-                // put all into a layout and add it to the toolbox page
-                QHBoxLayout *hboxLayout = new QHBoxLayout();
-                hboxLayout->addWidget(chkBox);
-                hboxLayout->addWidget(spinBox);
-                hboxLayout->addWidget(label);
-                toolBoxPages.at(category).vboxLayout->addLayout(hboxLayout);
-
-                // remember parameter name and reference to its spinbox
-                ParamNumeric paramNumeric;
-                paramNumeric.paramName = indenterParameter;
-                paramNumeric.paramCallName = parameterCallName;
-                paramNumeric.spinBox = spinBox;
-                paramNumeric.label = label;
-                paramNumeric.valueEnabledChkBox = chkBox;
-                paramNumeric.spinBox->setValue( indenterSettings->value(paramNumeric.paramName + "/ValueDefault").toInt() );
-                paramNumerics.append(paramNumeric);
-
-                QObject::connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(handleChangedIndenterSettings()));
-                QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
-            }
-            // edit type is boolean so create a checkbox
-            else if ( editType == "boolean" ) {
-                // create the checkbox, make its settings and add it to the toolbox page
-                QCheckBox *chkBox = new QCheckBox( toolBoxPages.at(category).page );
-                chkBox->setText(indenterParameter);
-                paramToolTip = indenterSettings->value(indenterParameter + "/Description").toString();
-                chkBox->setToolTip( paramToolTip );
-                if ( mainWindow != NULL ) {
-                    chkBox->installEventFilter( mainWindow );
-                }
-                toolBoxPages.at(category).vboxLayout->addWidget(chkBox);
-
-                // remember parameter name and reference to its checkbox
-                ParamBoolean paramBoolean;
-                paramBoolean.paramName = indenterParameter;
-                paramBoolean.checkBox = chkBox;
-                QStringList trueFalseStrings = indenterSettings->value(indenterParameter + "/TrueFalse").toString().split("|");
-                paramBoolean.trueString = trueFalseStrings.at(0);
-                paramBoolean.falseString = trueFalseStrings.at(1);
-                paramBoolean.checkBox->setChecked( indenterSettings->value(paramBoolean.paramName + "/ValueDefault").toBool() );
-                paramBooleans.append(paramBoolean);
-
-                QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
-            }
-            // edit type is numeric so create a line edit with label
-            else if ( editType == "string" ) {
-                // read the parameter name as it is used at the command line or in its config file
-                QString parameterCallName = indenterSettings->value(indenterParameter + "/CallName").toString();
-
-                // create check box which enables or disables the parameter
-                QCheckBox *chkBox = new QCheckBox( toolBoxPages.at(category).page );
-                chkBox->setChecked( indenterSettings->value(indenterParameter + "/Enabled").toBool() );
-                chkBox->setToolTip( "Enables/disables the parameter. If disabled the indenters default value will be used." );
-                chkBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
-                int left, top, right, bottom;
-                chkBox->getContentsMargins( &left, &top, &right, &bottom );
-                chkBox->setContentsMargins( left, top, 0, bottom );
-
-                // create the line edit
-                QLineEdit *lineEdit = new QLineEdit( toolBoxPages.at(category).page );
-                paramToolTip = indenterSettings->value(indenterParameter + "/Description").toString();
-                lineEdit->setToolTip( paramToolTip );
-                lineEdit->setMaximumWidth(50);
-                lineEdit->setMinimumWidth(50);
-                if ( mainWindow != NULL ) {
-                    lineEdit->installEventFilter( mainWindow );
-                }
-
-                // create the label
-                QLabel *label = new QLabel( toolBoxPages.at(category).page );
-                label->setText(indenterParameter);
-                label->setBuddy(lineEdit);
-                label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
-                label->setToolTip( paramToolTip );
-                if ( mainWindow != NULL ) {
-                    label->installEventFilter( mainWindow );
-                }
-
-                // put all into a layout and add it to the toolbox page
-                QHBoxLayout *hboxLayout = new QHBoxLayout();
-                hboxLayout->addWidget(chkBox);
-                hboxLayout->addWidget(lineEdit);
-                hboxLayout->addWidget(label);
-                toolBoxPages.at(category).vboxLayout->addLayout(hboxLayout);
-
-                // remember parameter name and reference to its line edit
-                ParamString paramString;
-                paramString.paramName = indenterParameter;
-                paramString.paramCallName = parameterCallName;
-                paramString.lineEdit = lineEdit;
-                paramString.label = label;
-                paramString.valueEnabledChkBox = chkBox;
-                paramString.lineEdit->setText( indenterSettings->value(paramString.paramName + "/ValueDefault").toString() );
-                paramStrings.append(paramString);
-
-                QObject::connect(lineEdit, SIGNAL(editingFinished()), this, SLOT(handleChangedIndenterSettings()));
-                QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
-            }
-            // edit type is multiple so create a combobox with label
-            else if ( editType == "multiple" ) {
-                // read the parameter name as it is used at the command line or in its config file
-                QString parameterCallName = indenterSettings->value(indenterParameter + "/CallName").toString();
-
-                // create checkbox which enables or disables the parameter
-                QCheckBox *chkBox = new QCheckBox( toolBoxPages.at(category).page );
-                chkBox->setChecked( indenterSettings->value(indenterParameter + "/Enabled").toBool() );
-                chkBox->setToolTip( "Enables/disables the parameter. If disabled the indenters default value will be used." );
-                chkBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
-                int left, top, right, bottom;
-                chkBox->getContentsMargins( &left, &top, &right, &bottom );
-                chkBox->setContentsMargins( left, top, 0, bottom );
-
-                // create the combo box
-                QComboBox *comboBox = new QComboBox( toolBoxPages.at(category).page );
-                QStringList choicesStrings = indenterSettings->value(indenterParameter + "/Choices").toString().split("|");
-                QStringList choicesStringsReadable = indenterSettings->value(indenterParameter + "/ChoicesReadable").toString().split("|", QString::SkipEmptyParts);
-                if ( choicesStringsReadable.isEmpty() ) {
-                    comboBox->addItems( choicesStrings );
-                }
-                else {
-                    comboBox->addItems( choicesStringsReadable );
-                }
-                paramToolTip = indenterSettings->value(indenterParameter + "/Description").toString();
-                comboBox->setToolTip( paramToolTip );
-                if ( mainWindow != NULL ) {
-                    comboBox->installEventFilter( mainWindow );
-                }
-
-                // put all into a layout and add it to the toolbox page
-                QHBoxLayout *hboxLayout = new QHBoxLayout();
-                hboxLayout->addWidget(chkBox);
-                hboxLayout->addWidget(comboBox);
-                toolBoxPages.at(category).vboxLayout->addLayout(hboxLayout);
-
-                // remember parameter name and reference to its lineedit
-                ParamMultiple paramMultiple;
-                paramMultiple.paramName = indenterParameter;
-                paramMultiple.paramCallName = parameterCallName;
-                paramMultiple.comboBox = comboBox;
-                paramMultiple.choicesStrings = choicesStrings;
-                paramMultiple.choicesStringsReadable = choicesStringsReadable;
-                paramMultiple.valueEnabledChkBox = chkBox;
-                paramMultiple.comboBox->setCurrentIndex( indenterSettings->value(paramMultiple.paramName + "/ValueDefault").toInt() );
-                paramMultiples.append(paramMultiple);
-
-                QObject::connect(comboBox, SIGNAL(activated(int)), this, SLOT(handleChangedIndenterSettings()));
-                QObject::connect(chkBox, SIGNAL(clicked()), this, SLOT(handleChangedIndenterSettings()));
-#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
-                connect( comboBox, SIGNAL(activated(int)), comboBox, SLOT(repaint()) );
-#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
-            }
-        }
-    }
-
-    // put a spacer at each page end
-    foreach (ToolBoxPage tbp, toolBoxPages) {
-        tbp.vboxLayout->addStretch();
-    }
-}
-
-
-/*!
-    \brief Searches and returns all indenters a configuration file is found for.
-
-    Opens all uigui ini files found in the list \a indenterIniFileList, opens each ini file
-    and reads the there defined real name of the indenter. These names are being returned as QStringList.
- */
-QStringList IndentHandler::getAvailableIndenters() {
-    QStringList indenterNamesList;
-
-    // Loop for every existing uigui ini file
-    foreach (QString indenterIniFile, indenterIniFileList) {
-        // Open the ini file and search for the indenter name
-        QFile file(indenterDirctoryStr + "/" + indenterIniFile);
-        if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) {
-            int index = -1;
-            QByteArray line;
-            // Search for the string "indenterName=" and get the following string until line end.
-            while ( index == -1 &&  !file.atEnd() ) {
-                line = file.readLine();
-                index = line.indexOf( "indenterName=", 0);
-            }
-
-            if ( index == 0 ) {
-                line = line.remove(0, 13);
-                indenterNamesList << line.trimmed();
-            }
-        }
-    }
-    return indenterNamesList;
-}
-
-
-/*!
-    \brief Deletes all elements in the toolbox and initializes the indenter selected by \a indenterID.
- */
-void IndentHandler::setIndenter(int indenterID) {
-    QApplication::setOverrideCursor(Qt::WaitCursor);
-
-#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
-    disconnect( toolBox, SIGNAL(currentChanged(int)), this, SLOT(repaint()) );
-#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
-
-    // Generate the parameter string that will be saved to the indenters config file.
-    QString parameterString = getParameterString();
-    if ( !indenterFileName.isEmpty() ) {
-        saveConfigFile( settingsDirctoryStr + "/" + indenterFileName + ".cfg", parameterString );
-    }
-
-    // Take care if the selected indenterID is smaller or greater than the number of existing indenters
-    if ( indenterID < 0 ) {
-        indenterID = 0;
-    }
-    if ( indenterID >= indenterIniFileList.count() ) {
-        indenterID = indenterIniFileList.count() - 1;
-    }
-
-    // remove all pages from the toolbox
-    for (int i = 0; i < toolBox->count(); i++) {
-        toolBox->removeItem(i);
-    }
-
-    // delete all toolbox pages and by this its children
-    foreach (ToolBoxPage toolBoxPage, toolBoxPages) {
-        delete toolBoxPage.page;
-    }
-
-    // empty all lists, which stored infos for the toolbox pages and its widgets
-    toolBoxPages.clear();
-    paramStrings.clear();
-    paramNumerics.clear();
-    paramBooleans.clear();
-    paramMultiples.clear();
-    delete indenterSettings;
-
-#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
-    QWidget dummyWidget;
-    toolBox->addItem(&dummyWidget, "dummyText");
-#endif
-
-    readIndentIniFile( indenterDirctoryStr + "/" + indenterIniFileList.at(indenterID) );
-
-    // Find out how the indenter can be executed.
-    createIndenterCallString();
-
-    // Load the users last settings made for this indenter.
-    loadConfigFile( settingsDirctoryStr + "/" + indenterFileName + ".cfg" );
-
-    handleChangedIndenterSettings();
-
-    QApplication::restoreOverrideCursor();
-
-#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS
-    connect( toolBox, SIGNAL(currentChanged(int)), this, SLOT(repaint()) );
-    toolBox->removeItem( toolBox->indexOf(&dummyWidget) );
-#endif // UNIVERSALINDENTGUI_NPP_EXPORTS
-}
-
-
-/*!
-    \brief Returns a string containing by the indenter supported file types/extensions divided by a space.
- */
-QString IndentHandler::getPossibleIndenterFileExtensions() {
-    return fileTypes;
-}
-
-
-/*!
-    \brief Returns the path and filename of the current indenter config file.
- */
-QString IndentHandler::getIndenterCfgFile() {
-    QFileInfo fileInfo( indenterDirctoryStr + "/" + configFilename );
-    return fileInfo.absoluteFilePath();
-}
-
-
-/*!
-    \brief Tries to create a call path string for the indenter executable. If successful returns true.
- */
-bool IndentHandler::createIndenterCallString() {
-    QProcess indentProcess;
-
-    if ( indenterFileName.isEmpty() ) {
-        return false;
-    }
-
-    // First try to call the indenter inside of the data dir, using some suffix
-    // ------------------------------------------------------------------------
-
-    // Set the directory for the indenter execution
-    indentProcess.setWorkingDirectory( QFileInfo(indenterDirctoryStr).absoluteFilePath() );
-
-    foreach ( QString suffix, QStringList() << "" << ".exe" << ".bat" << ".com" << ".sh" ) {
-        indenterExecutableSuffix = suffix;
-        indenterExecutableCallString = QFileInfo(indenterDirctoryStr).absoluteFilePath() + "/" + indenterFileName;
-        indenterExecutableCallString += suffix;
-
-        // Only try to call the indenter, if the file exists.
-        if ( QFile::exists(indenterExecutableCallString) ) {
-            // Only try to call the indenter directly if it is no php file
-            if ( QFileInfo(indenterExecutableCallString).suffix().toLower() != "php" ) {
-                indentProcess.start( "\"" + indenterExecutableCallString +  + "\" " + indenterShowHelpParameter );
-                if ( indentProcess.waitForFinished(2000) ) {
-                    indenterExecutableCallString = "\"" + indenterExecutableCallString + "\"";
-                    return true;
-                }
-                else if ( indentProcess.error() == QProcess::Timedout ) {
-                    indenterExecutableCallString = "\"" + indenterExecutableCallString + "\"";
-                    return true;
-                }
-            }
-
-            // Test for needed interpreters
-            // ----------------------------
-            // If the file could not be executed, try to find a shebang at its start or test if its a php file.
-            QString interpreterName = "";
-            QFile indenterExecutable( indenterExecutableCallString );
-
-            // If indenter executable file has .php as suffix, use php as default interpreter
-            if ( QFileInfo(indenterExecutableCallString).suffix().toLower() == "php" ) {
-                interpreterName = "php -f";
-            }
-            // Else try to open the file and read the shebang.
-            else if ( indenterExecutable.open(QFile::ReadOnly) ) {
-                // Read the first line of the file.
-                QTextStream indenterExecutableContent(&indenterExecutable);
-                QString firstLineOfIndenterExe = indenterExecutableContent.readLine(75);
-                indenterExecutable.close();
-
-                // If the initial shebang is found, read the named intepreter. e.g. perl
-                if ( firstLineOfIndenterExe.startsWith("#!") ) {
-                    // Get the rightmost word. by splitting the string into only full words.
-                    interpreterName = firstLineOfIndenterExe.split( "/" ).last();
-                }
-            }
-
-            // Try to call the interpreter, if it exists.
-            if ( !interpreterName.isEmpty() ) {
-                indenterExecutableCallString = interpreterName + " \"" + indenterExecutableCallString + "\"";
-                indentProcess.start( interpreterName + " -h");
-                if ( indentProcess.waitForFinished(2000) ) {
-                    return true;
-                }
-                else if ( indentProcess.error() == QProcess::Timedout ) {
-                    return true;
-                }
-                // now we know an interpreter is needed but it could not be called, so inform the user.
-                else {
-                    errorMessageDialog->showMessage( tr("Interpreter needed"),
-                        tr("To use the selected indenter the program \"%1\" needs to be available in the global environment. You should add an entry to your path settings.").arg(interpreterName) );
-                    return true;
-                }
-            }
-        }
-    }
-
-
-    // If unsuccessful try if the indenter executable is a JavaScript file
-    // -------------------------------------------------------------------
-    indenterExecutableSuffix = ".js";
-    indenterExecutableCallString = QFileInfo(indenterDirctoryStr).absoluteFilePath() + "/" + indenterFileName;
-    indenterExecutableCallString += indenterExecutableSuffix;
-    if ( QFile::exists(indenterExecutableCallString) ) {
-        return true;
-    }
-
-
-    // If unsuccessful try to call the indenter global, using some suffix
-    // ------------------------------------------------------------------
-    foreach ( QString suffix, QStringList() << "" << ".exe" << ".bat" << ".com" << ".sh" ) {
-        indenterExecutableSuffix = suffix;
-        indenterExecutableCallString = indenterFileName + suffix;
-        indentProcess.start( indenterExecutableCallString + " " + indenterShowHelpParameter );
-        if ( indentProcess.waitForFinished(2000) ) {
-            return true;
-        }
-        else if ( indentProcess.error() == QProcess::Timedout ) {
-            return true;
-        }
-    }
-
-
-    // If even globally calling the indenter fails, try calling .com and .exe via wine
-    // -------------------------------------------------------------------------------
-    indenterExecutableCallString = "\"" + QFileInfo(indenterDirctoryStr).absoluteFilePath() + "/" + indenterFileName;
-
-    foreach ( QString suffix, QStringList() << ".exe" << ".com" ) {
-        indenterExecutableSuffix = suffix;
-        if ( QFile::exists(indenterDirctoryStr + "/" + indenterFileName + suffix) ) {
-            QProcess wineTestProcess;
-            wineTestProcess.start("wine --version");
-            // if the process of wine was not callable assume that wine is not installed
-            if ( !wineTestProcess.waitForFinished(2000) ) {
-                errorMessageDialog->showMessage(tr("wine not installed"), tr("There exists only a win32 executable of the indenter and wine does not seem to be installed. Please install wine to be able to run the indenter.") );
-                indenterExecutableCallString = "";
-                return false;
-            }
-            else {
-                indenterExecutableCallString = "\"" + QFileInfo(indenterDirctoryStr).absoluteFilePath() + "/";
-                indenterExecutableCallString += indenterFileName + suffix + "\"";
-                indenterExecutableCallString = "wine " + indenterExecutableCallString;
-
-                return true;
-            }
-        }
-    }
-
-    indenterExecutableCallString = "";
-    indenterExecutableSuffix = "";
-    return false;
-}
-
-
-/*!
-    \brief Returns a string that points to where the indenters manual can be found.
- */
-QString IndentHandler::getManual() {
-    if ( indenterSettings != NULL ) {
-        return indenterSettings->value("header/manual").toString();
-    }
-    else {
-        return "";
-    }
-}
-
-
-/*!
-    \brief This slot gets the reference to the indenters manual and opens it.
- */
-void IndentHandler::showIndenterManual() {
-    QString manualReference = getManual();
-    QDesktopServices::openUrl( manualReference );
-}
-
-
-/*!
-    \brief Can be called to update all widgets text to the currently selected language.
- */
-void IndentHandler::retranslateUi() {
-    indenterSelectionCombobox->setToolTip( tr("<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body style=\" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Shows the currently chosen indenters name and lets you choose other available indenters</p></body></html>") );
-    indenterParameterHelpButton->setToolTip( tr("Brings you to the online manual of the currently selected indenter, where you can get further help on the possible parameters.") );
-
-    actionLoad_Indenter_Config_File->setText(QApplication::translate("IndentHandler", "Load Indenter Config File", 0, QApplication::UnicodeUTF8));
-    actionLoad_Indenter_Config_File->setStatusTip(QApplication::translate("IndentHandler", "Opens a file dialog to load the original config file of the indenter.", 0, QApplication::UnicodeUTF8));
-    actionLoad_Indenter_Config_File->setShortcut(QApplication::translate("IndentHandler", "Alt+O", 0, QApplication::UnicodeUTF8));
-
-    actionSave_Indenter_Config_File->setText(QApplication::translate("IndentHandler", "Save Indenter Config File", 0, QApplication::UnicodeUTF8));
-    actionSave_Indenter_Config_File->setStatusTip(QApplication::translate("IndentHandler", "Opens a dialog to save the current indenter configuration to a file.", 0, QApplication::UnicodeUTF8));
-    actionSave_Indenter_Config_File->setShortcut(QApplication::translate("IndentHandler", "Alt+S", 0, QApplication::UnicodeUTF8));
-
-    actionCreateShellScript->setText(QApplication::translate("IndentHandler", "Create Indenter Call Shell Script", 0, QApplication::UnicodeUTF8));
-    actionCreateShellScript->setToolTip(QApplication::translate("IndentHandler", "Create a shell script that calls the current selected indenter for formatting an as parameter given file with the current indent settings", 0, QApplication::UnicodeUTF8));
-    actionCreateShellScript->setStatusTip(QApplication::translate("IndentHandler", "Create a shell script that calls the current selected indenter for formatting an as parameter given file with the current indent settings", 0, QApplication::UnicodeUTF8));
-
-    actionResetIndenterParameters->setText(QApplication::translate("IndentHandler", "Reset indenter parameters", 0, QApplication::UnicodeUTF8));
-    actionResetIndenterParameters->setToolTip(QApplication::translate("IndentHandler", "Resets all indenter parameters to the default values.", 0, QApplication::UnicodeUTF8));
-    actionResetIndenterParameters->setStatusTip(QApplication::translate("IndentHandler", "Resets all indenter parameters to the default values.", 0, QApplication::UnicodeUTF8));
-}
-
-
-/*!
-    \brief Returns the name of the currently selected indenter.
- */
-QString IndentHandler::getCurrentIndenterName() {
-    QString currentIndenterName = indenterSelectionCombobox->currentText();
-
-    // Remove the supported programming languages from indenters name, which are set in braces.
-    if ( currentIndenterName.indexOf("(") > 0 ) {
-        // Using index-1 to also leave out the blank before the brace.
-        currentIndenterName = currentIndenterName.left( currentIndenterName.indexOf("(")-1 );
-    }
-
-    return currentIndenterName;
-}
-
-
-/*!
-    \brief Shows a file open dialog to open an existing config file for the currently selected indenter.
-
-    If the file was successfully opened the indent handler is called to load the settings and update itself.
-*/
-void IndentHandler::openConfigFileDialog() {
-    QString configFilePath;
-
-    configFilePath = QFileDialog::getOpenFileName( NULL, tr("Choose indenter config file"), getIndenterCfgFile(), "All files (*.*)" );
-
-    if (configFilePath != "") {
-        loadConfigFile(configFilePath);
-    }
-}
-
-
-/*!
-    \brief Calls the indenter config file save as dialog to save the config file under a chosen name.
-
-    If the file already exists and it should be overwritten, a warning is shown before.
-*/
-void IndentHandler::saveasIndentCfgFileDialog() {
-    QString fileExtensions = tr("All files")+" (*.*)";
-
-    //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
-    QString fileName = QFileDialog::getSaveFileName( this, tr("Save indent config file"), getIndenterCfgFile(), fileExtensions);
-
-    if (fileName != "") {
-        QFile::remove(fileName);
-        QFile outCfgFile(fileName);
-        outCfgFile.open( QFile::ReadWrite | QFile::Text );
-        outCfgFile.write( getParameterString().toAscii() );
-        outCfgFile.close();
-    }
-}
-
-
-/*!
-    \brief Invokes the indenter to create a shell script.
-
-    Lets the indenter create a shell script for calling the indenter out of any
-    other application and open a save dialog for saving the shell script.
-*/
-void IndentHandler::createIndenterCallShellScript() {
-    // Get the content of the shell/batch script.
-    QString indenterCallShellScript = generateCommandlineCall();
-
-    QString shellScriptExtension;
-#if defined(Q_OS_WIN32)
-    shellScriptExtension = "bat";
-#else
-    shellScriptExtension = "sh";
-#endif
-
-    QString fileExtensions = tr("Shell Script")+" (*."+shellScriptExtension+");;"+tr("All files")+" (*.*)";
-
-    QString currentIndenterName = getCurrentIndenterName();
-    currentIndenterName = currentIndenterName.replace(" ", "_");
-
-    //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
-    QString fileName = QFileDialog::getSaveFileName( this, tr("Save shell script"), "call_"+currentIndenterName+"."+shellScriptExtension, fileExtensions);
-
-    // Saving has been canceled if the filename is empty
-    if ( fileName.isEmpty() ) {
-        return;
-    }
-
-    // Replace placeholder for script name in script template.
-    indenterCallShellScript = indenterCallShellScript.replace( "__INDENTERCALLSTRINGSCRIPTNAME__", QFileInfo(fileName).fileName() );
-
-    // Delete any old file, write the new contents and set executable permissions.
-    QFile::remove(fileName);
-    QFile outSrcFile(fileName);
-    outSrcFile.open( QFile::ReadWrite | QFile::Text );
-    outSrcFile.write( indenterCallShellScript.toAscii() );
-#if !defined(Q_OS_WIN32)
-    // For none Windows systems set the files executable flag
-    outSrcFile.setPermissions( outSrcFile.permissions() | QFile::ExeOwner | QFile::ExeUser| QFile::ExeGroup );
-#endif
-    outSrcFile.close();
-}
-
-
-/*!
-    \brief Resets all parameters to the indenters default values as they are specified in the uigui ini file
-    but asks the user whether to do it really.
- */
-void IndentHandler::resetIndenterParameter() {
-    int messageBoxAnswer = QMessageBox::question(this, tr("Really reset parameters?"), tr("Do you really want to reset the indenter parameters to the default values?"), QMessageBox::Yes | QMessageBox::Abort );
-    if ( messageBoxAnswer == QMessageBox::Yes ) {
-        resetToDefaultValues();
-    }
-}
-
-
-/*!
-    \brief Catch some events and let some other be handled by the super class.
-
-    Is needed for use as Notepad++ plugin.
- */
-bool IndentHandler::event( QEvent *event ) {
-    if ( event->type() == QEvent::WindowActivate ) {
-        event->accept();
-        return true;
-    }
-    else if ( event->type() == QEvent::WindowDeactivate ) {
-        event->accept();
-        return true;
-    }
-    else {
-        event->ignore();
-        return QWidget::event(event);
-    }
-}
-
-
-/*!
-    \brief Sets the function pointer \a parameterChangedCallback to the given callback
-    function \a paramChangedCallback.
-
-    Is needed for use as Notepad++ plugin.
- */
-void IndentHandler::setParameterChangedCallback( void(*paramChangedCallback)(void) ) {
-    parameterChangedCallback = paramChangedCallback;
-}
-
-
-/*!
-    \brief Emits the \a indenterSettingsChanged signal and if set executes the \a parameterChangedCallback function.
-
-   Is needed for use as Notepad++ plugin.
- */
-void IndentHandler::handleChangedIndenterSettings() {
-    emit( indenterSettingsChanged() );
-
-    if ( parameterChangedCallback != NULL ) {
-        parameterChangedCallback();
-    }
-}
-
-
-/*!
-    \brief Sets a callback function that shall be called, when the this indenter parameter window gets closed.
-
-   Is needed for use as Notepad++ plugin.
- */
-void IndentHandler::setWindowClosedCallback( void(*winClosedCallback)(void) ) {
-    windowClosedCallback = winClosedCallback;
-}
-
-
-/*!
-    \brief Is called on this indenter parameter window close and if set calls the function \a windowClosedCallback.
-
-    Is needed for use as Notepad++ plugin.
- */
-void IndentHandler::closeEvent(QCloseEvent *event) {
-    if ( windowClosedCallback != NULL ) {
-        windowClosedCallback();
-    }
-    event->accept();
-}
-
-
-/*!
-    \brief Returns the id (list index) of the currently selected indenter.
- */
-int IndentHandler::getIndenterId() {
-    return indenterSelectionCombobox->currentIndex();
-}
--- a/src/indenthandler.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#ifndef INDENTHANDLER_H
-#define INDENTHANDLER_H
-
-#include <QWidget>
-#include <QToolBox>
-#include <QVBoxLayout>
-#include <QApplication>
-#include <QCheckBox>
-#include <QComboBox>
-#include <QToolButton>
-#include <QFile>
-#include <QProcess>
-#include <QSettings>
-#include <QStringList>
-#include <QLineEdit>
-#include <QSpinBox>
-#include <QLabel>
-#include <QByteArray>
-#include <QDir>
-#include <QMessageBox>
-#include <QMainWindow>
-#include <QTextStream>
-#include <QTextCodec>
-#include <QtScript>
-#include <QDesktopServices>
-#include <QMenu>
-#include <QAction>
-#include <QContextMenuEvent>
-#include <QFileDialog>
-
-#include "uiguierrormessage.h"
-#include "templateBatchScript.h"
-#include "uiguiIniFileParser.h"
-#include "SettingsPaths.h"
-
-
-class IndentHandler : public QWidget
-{
-    Q_OBJECT
-
-public:
-    IndentHandler(int indenterID, QWidget *mainWindow = NULL, QWidget *parent = NULL);
-    ~IndentHandler();
-
-    QString generateCommandlineCall();
-    QString callIndenter(QString sourceCode, QString inputFileExtension);
-    bool loadConfigFile(QString filePathName);
-    void resetToDefaultValues();
-    QStringList getAvailableIndenters();
-    QString getPossibleIndenterFileExtensions();
-    QString getParameterString();
-    QString getIndenterCfgFile();
-    QString getManual();
-    void retranslateUi();
-    QString getCurrentIndenterName();
-    QMenu* getIndenterMenu();
-    QList<QAction*> getIndenterMenuActions();
-    void contextMenuEvent( QContextMenuEvent *event );
-    void setParameterChangedCallback( void(*paramChangedCallback)(void) );
-    void setWindowClosedCallback( void(*winClosedCallback)(void) );
-    int getIndenterId();
-
-signals:
-    void indenterSettingsChanged();
-    void selectedIndenterIndexChanged(int index);
-
-protected:
-    bool event( QEvent *event );
-    void closeEvent(QCloseEvent *event);
-    
-private slots:
-    void setIndenter(int indenterID);
-    void showIndenterManual();
-    void openConfigFileDialog();
-    void saveasIndentCfgFileDialog();
-    void createIndenterCallShellScript();
-    void resetIndenterParameter();
-    void handleChangedIndenterSettings();
-
-private:
-    QString callExecutableIndenter(QString sourceCode, QString inputFileExtension);
-    QString callJavaScriptIndenter(QString sourceCode);
-    void saveConfigFile(QString filePathName, QString parameterString);
-    void readIndentIniFile(QString iniFilePath);
-    bool createIndenterCallString();
-    void initIndenterMenu();
-
-    //! Holds a reference to all created pages of the toolbox and the pages boxlayout
-    struct ToolBoxPage {
-        QWidget *page;
-        QVBoxLayout *vboxLayout;
-    };
-    QVector<ToolBoxPage> toolBoxPages;
-
-    //! Holds a reference to all checkboxes needed for boolean parameter setting and the parameters name
-    struct ParamBoolean {
-        QString paramName;
-        QString trueString;
-        QString falseString;
-        QCheckBox *checkBox;
-    };
-    QVector<ParamBoolean> paramBooleans;
-
-    //! Holds a reference to all line edits needed for parameter setting and the parameters name
-    struct ParamString {
-        QString paramName;
-        QString paramCallName;
-        QCheckBox *valueEnabledChkBox;
-        QLineEdit *lineEdit;
-        QLabel *label;
-    };
-    QVector<ParamString> paramStrings;
-
-    //! Hold a reference to all spin boxes needed for parameter setting and the parameters name
-    struct ParamNumeric {
-        QString paramName;
-        QString paramCallName;
-        QCheckBox *valueEnabledChkBox;
-        QSpinBox *spinBox;
-        QLabel *label;
-    };
-    QVector<ParamNumeric> paramNumerics;
-
-    //! Hold a reference to all combo boxes needed for parameter setting and the parameters name
-    struct ParamMultiple {
-        QString paramName;
-        QString paramCallName;
-        QCheckBox *valueEnabledChkBox;
-        QComboBox *comboBox;
-        QStringList choicesStrings;
-		QStringList choicesStringsReadable;
-    };
-    QVector<ParamMultiple> paramMultiples;
-
-    QComboBox *indenterSelectionCombobox;
-    QToolButton *indenterParameterHelpButton;
-    QVBoxLayout *vboxLayout;
-    QToolBox *toolBox;
-    UiguiIniFileParser *indenterSettings;
-    QStringList indenterParameters;
-    //! The indenters name in a descriptive form
-    QString indenterName;
-    //! The indenters file name (w/o extension), that is being called
-    QString indenterFileName;
-    QString indenterDirctoryStr;
-    QString tempDirctoryStr;
-    QString settingsDirctoryStr;
-    QStringList indenterIniFileList;
-	QString parameterOrder;
-    QString configFilename;
-    QString cfgFileParameterEnding;
-    QString inputFileParameter;
-    QString inputFileName;
-    QString outputFileParameter;
-    QString outputFileName;
-    QString fileTypes;
-    QString useCfgFileParameter;
-    QString indenterShowHelpParameter;
-    QWidget *mainWindow;
-    UiguiErrorMessage *errorMessageDialog;
-    QString indenterExecutableCallString;
-    QString indenterExecutableSuffix;
-
-    QMenu *menuIndenter;
-    QAction *actionLoad_Indenter_Config_File;
-    QAction *actionSave_Indenter_Config_File;
-    QAction *actionCreateShellScript;
-    QAction *actionResetIndenterParameters;
-    void(*parameterChangedCallback)(void);
-    void(*windowClosedCallback)(void);
-};
-
-#endif // INDENTHANDLER_H
--- a/src/main.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ b/src/main.cpp	Tue Nov 11 14:56:11 2008 +0000
@@ -17,13 +17,13 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-#include "mainwindow.h"
+#include "MainWindow.h"
 #include <QApplication>
 
-#include "UiguiIndentServer.h"
+#include "UiGuiIndentServer.h"
 
-#include "uiguiIniFileParser.h"
-#include "uiguisettings.h"
+#include "UiGuiIniFileParser.h"
+#include "UiGuiSettings.h"
 
 /*!
     /brief Entry point to UniversalIndentGUI application.
@@ -41,7 +41,7 @@
     bool startAsPlugin = false;
     bool startAsServer = false;
 
-    UiguiIndentServer server;
+    UiGuiIndentServer server;
     MainWindow *mainWindow = NULL;
     IndentHandler *indentHandler = NULL;
 
@@ -117,7 +117,7 @@
         server.stopServer();
     }
 
-    UiguiSettings::deleteInstance();
+    UiGuiSettings::deleteInstance();
 
     return returnValue;
 }
--- a/src/mainwindow.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1389 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#include "mainwindow.h"
-
-//! \defgroup grp_MainWindow All concerning main window functionality.
-
-/*!
-    \class MainWindow
-    \ingroup grp_MainWindow
-    \brief Is the main window of UniversalIndentGUI
-
-    The MainWindow class is responsible for generating and displaying most of the gui elements.
-    Its look is set in the file "mainwindow.ui". An object for the indent handler is generated here
-    and user actions are being controlled. Is responsible for file open dialogs and indenter selection.
- */
-
-/*!
-    \brief Constructs the main window.
- */
-MainWindow::MainWindow(QString file2OpenOnStart, QWidget *parent) : QMainWindow(parent) {
-    // set the program version, revision and date, which is shown in the main window title and in the about dialog.
-    version = "1.0.2";
-    revision = "888";
-    QDate buildDate(2008, 11, 3);
-    buildDateStr = buildDate.toString("d. MMMM yyyy");
-
-    // Init of some variables.
-    sourceCodeChanged = false;
-    scrollPositionChanged = false;
-
-    // Create the settings object, which loads all UiGui settings from a file.
-    settings = UiguiSettings::getInstance();
-
-    // Initialize the language of the application.
-    initApplicationLanguage();
-
-    // Creates the main window and initializes it.
-    initMainWindow();
-
-    // Create toolbar and insert it into the main window.
-    initToolBar();
-
-    // Create the text edit component using the QScintilla widget.
-    initTextEditor();
-
-    // Create and init the syntax highlighter.
-    initSyntaxHighlighter();
-
-    // Create and init the indenter.
-    initIndenter();
-
-    // Create some menus.
-    createEncodingMenu();
-    createHighlighterMenu();
-
-
-    // generate about dialog box
-    aboutDialog = new AboutDialog(this, Qt::SplashScreen, version, revision, buildDateStr);
-    aboutDialogGraphicsView = new AboutDialogGraphicsView(aboutDialog, this);
-    connect( toolBarWidget->pbAbout, SIGNAL(clicked()), this, SLOT(showAboutDialog()) );
-    connect( actionAbout_UniversalIndentGUI, SIGNAL(triggered()), this, SLOT(showAboutDialog()) );
-
-    // generate settings dialog box
-    settingsDialog = new UiguiSettingsDialog(this, settings);
-    connect( actionShowSettings, SIGNAL(triggered()), settingsDialog, SLOT(showDialog()) );
-
-    // If a file that should be opened on start has been handed over to the constructor exists, load it
-    if ( QFile::exists(file2OpenOnStart) ) {
-        openSourceFileDialog(file2OpenOnStart);
-    }
-    // Otherwise load the last opened file, if this is enabled in the settings.
-    else {
-        loadLastOpenedFile();
-    }
-
-    updateSourceView();
-
-    // Check if a newer version is available but only if the setting for that is enabled and today not already a check has been done.
-    if ( settings->getValueByName("CheckForUpdate").toBool() && QDate::currentDate() != settings->getValueByName("LastUpdateCheck").toDate() ) {
-        updateCheckDialog->checkForUpdate();
-    }
-
-    // Enable accept dropping of files.
-    setAcceptDrops(true);
-}
-
-
-/*!
-    \brief Initializes the main window by creating the main gui and make some settings.
- */
-void MainWindow::initMainWindow() {
-    // Generate gui as it is build in the file "mainwindow.ui"
-    setupUi(this);
-
-    // Handle last opened window size
-    // ------------------------------
-    bool maximized = settings->getValueByName("WindowIsMaximized").toBool();
-    QPoint pos = settings->getValueByName("WindowPosition").toPoint();
-    QSize size = settings->getValueByName("WindowSize").toSize();
-    resize(size);
-    move(pos);
-    if ( maximized ) {
-        showMaximized();
-    }
-#ifndef Q_OS_MAC // On Mac restoring the window state causes the screenshot no longer to work.
-    restoreState( settings->getValueByName("MainWindowState").toByteArray() );
-#endif
-
-    // Handle if first run of this version
-    // -----------------------------------
-    QString readVersion = settings->getValueByName("VersionInSettingsFile").toString();
-    // If version strings are not equal set first run true.
-    if ( readVersion != version ) {
-        isFirstRunOfThisVersion = true;
-    }
-    else {
-        isFirstRunOfThisVersion = false;
-    }
-
-    // Get last selected file encoding
-    // -------------------------------
-    currentEncoding = settings->getValueByName("FileEncoding").toString();
-
-    updateCheckDialog = new UpdateCheckDialog(version, settings, this);
-
-    // Register the syntax highlightning setting in the menu to the settings object.
-    connect( enableSyntaxHighlightningAction, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
-    connect( settings, SIGNAL(syntaxHighlightningEnabled(bool)), enableSyntaxHighlightningAction, SLOT(setChecked(bool)) );
-    enableSyntaxHighlightningAction->setChecked( settings->getValueByName("SyntaxHighlightningEnabled").toBool() );
-    // Tell the highlighter if it has to be enabled or disabled.
-    connect( settings, SIGNAL(syntaxHighlightningEnabled(bool)), this, SLOT(turnHighlightOnOff(bool)) );
-
-    // Register the load last file setting in the menu to the settings object.
-    connect( loadLastOpenedFileOnStartupAction, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
-    connect( settings, SIGNAL(loadLastOpenedFileOnStartup(bool)), loadLastOpenedFileOnStartupAction, SLOT(setChecked(bool)) );
-    loadLastOpenedFileOnStartupAction->setChecked( settings->getValueByName("LoadLastOpenedFileOnStartup").toBool() );
-
-    // Register the white space setting in the menu to the settings object.
-    connect( whiteSpaceIsVisibleAction, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
-    connect( settings, SIGNAL(whiteSpaceIsVisible(bool)), whiteSpaceIsVisibleAction, SLOT(setChecked(bool)) );
-    whiteSpaceIsVisibleAction->setChecked( settings->getValueByName("WhiteSpaceIsVisible").toBool() );
-    // Tell the QScintilla editor if it has to show white space.
-    connect( settings, SIGNAL(whiteSpaceIsVisible(bool)), this, SLOT(setWhiteSpaceVisibility(bool)) );
-
-    // Connect the remaining menu items.
-    connect( actionOpen_Source_File, SIGNAL(triggered()), this, SLOT(openSourceFileDialog()) );
-    connect( actionSave_Source_File_As, SIGNAL(triggered()), this, SLOT(saveasSourceFileDialog()) );
-    connect( actionSave_Source_File, SIGNAL(triggered()), this, SLOT(saveSourceFile()) );
-    connect( actionExportPDF, SIGNAL(triggered()), this, SLOT(exportToPDF()) );
-    connect( actionExportHTML, SIGNAL(triggered()), this, SLOT(exportToHTML()) );
-    connect( actionCheck_for_update, SIGNAL(triggered()), updateCheckDialog, SLOT(checkForUpdateAndShowDialog()) );
-
-    // Init the menu for selecting one of the recently opened files.
-    updateRecentlyOpenedList();
-    connect( menuRecently_Opened_Files, SIGNAL(triggered(QAction*)), this, SLOT(openFileFromRecentlyOpenedList(QAction*)) );
-    connect( settings, SIGNAL(recentlyOpenedListSize(int)), this, SLOT(updateRecentlyOpenedList()) );
-}
-
-
-/*!
-    \brief Creates and inits the tool bar. It is added to the main window.
- */
-void MainWindow::initToolBar() {
-    // Create the tool bar and add it to the main window.
-    toolBarWidget = new Ui::toolBarWidget();
-    QWidget* helpWidget = new QWidget();
-    toolBarWidget->setupUi(helpWidget);
-    toolBar->addWidget(helpWidget);
-    toolBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea );
-
-    // Connect the tool bar widgets to their functions.
-    connect( toolBarWidget->enableSyntaxHighlightningCheckBox, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
-    connect( settings, SIGNAL(syntaxHighlightningEnabled(bool)), toolBarWidget->enableSyntaxHighlightningCheckBox, SLOT(setChecked(bool)) );
-    toolBarWidget->enableSyntaxHighlightningCheckBox->setChecked( settings->getValueByName("SyntaxHighlightningEnabled").toBool() );
-    toolBarWidget->enableSyntaxHighlightningCheckBox->hide();
-    connect( toolBarWidget->pbOpen_Source_File, SIGNAL(clicked()), this, SLOT(openSourceFileDialog()) );
-    connect( toolBarWidget->pbExit, SIGNAL(clicked()), this, SLOT(close()));
-    connect( toolBarWidget->cbLivePreview, SIGNAL(toggled(bool)), this, SLOT(previewTurnedOnOff(bool)) );
-    connect( toolBarWidget->cbLivePreview, SIGNAL(toggled(bool)), actionLive_Indent_Preview, SLOT(setChecked(bool)) );
-    connect( actionLive_Indent_Preview, SIGNAL(toggled(bool)), toolBarWidget->cbLivePreview, SLOT(setChecked(bool)) );
-}
-
-
-/*!
-    \brief Create and initialize the text editor component. It uses the QScintilla widget.
- */
-void MainWindow::initTextEditor() {
-    QMessageBox infoQScintillaLoad(NULL);
-    infoQScintillaLoad.setWindowTitle("Loading QScintilla...");
-    infoQScintillaLoad.setText("Trying to load QScintilla library.\nIf anything fails during loading, it might be possible that the debug and release version of QScintilla are mixed.");
-    infoQScintillaLoad.show();
-    // Create the QScintilla widget and add it to the layout.
-    // Try and catch doesn't seem to catch the runtime error when starting UiGUI release with QScintilla debug lib and the other way around.
-    try {
-        qSciSourceCodeEditor = new QsciScintilla(this);
-    }
-    catch (...) {
-        QMessageBox::critical(this, "Error creating QScintilla text editor component!",
-            "During trying to create the text editor component, that is based on QScintilla, an error occurred. Please make sure that you have installed QScintilla and not mixed release and debug versions." );
-        exit(1);
-    }
-    infoQScintillaLoad.hide();
-
-    hboxLayout1->addWidget(qSciSourceCodeEditor);
-
-    // Make some settings for the QScintilla widget.
-    qSciSourceCodeEditor->setUtf8(true);
-    qSciSourceCodeEditor->setMarginLineNumbers(1, true);
-    qSciSourceCodeEditor->setMarginWidth(1, QString("10000") );
-    qSciSourceCodeEditor->setBraceMatching(qSciSourceCodeEditor->SloppyBraceMatch);
-    qSciSourceCodeEditor->setMatchedBraceForegroundColor( QColor("red") );
-    qSciSourceCodeEditor->setFolding(QsciScintilla::BoxedTreeFoldStyle);
-    qSciSourceCodeEditor->setAutoCompletionSource(QsciScintilla::AcsAll);
-    qSciSourceCodeEditor->setAutoCompletionThreshold(3);
-
-    // Handle if white space is set to be visible
-    bool whiteSpaceIsVisible = settings->getValueByName("WhiteSpaceIsVisible").toBool();
-    setWhiteSpaceVisibility( whiteSpaceIsVisible );
-
-    // Handle the width of tabs in spaces
-    int tabWidth = settings->getValueByName("TabWidth").toInt();
-    qSciSourceCodeEditor->setTabWidth(tabWidth);
-
-    // Remember a pointer to the scrollbar of the QScintilla widget used to keep
-    // on the same line as before when turning preview on/off.
-    textEditVScrollBar = qSciSourceCodeEditor->verticalScrollBar();
-
-    // Add a column row indicator to the status bar.
-    textEditLineColumnInfoLabel = new QLabel( tr("Line %1, Column %2").arg(1).arg(1) );
-    statusbar->addPermanentWidget(textEditLineColumnInfoLabel);
-    connect( qSciSourceCodeEditor, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(setStatusBarCursorPosInfo(int, int)) );
-
-    // Connect the text editor to dependent functions.
-    connect( qSciSourceCodeEditor, SIGNAL(textChanged()), this, SLOT(sourceCodeChangedHelperSlot()) );
-    connect( qSciSourceCodeEditor, SIGNAL(linesChanged()), this, SLOT(numberOfLinesChanged()) );
-    connect( settings, SIGNAL(tabWidth(int)), qSciSourceCodeEditor, SLOT(setTabWidth(int)) );
-    qSciSourceCodeEditor->setTabWidth( settings->getValueByName("TabWidth").toInt() );
-}
-
-
-/*!
-    \brief Create and init the syntax highlighter and set it to use the QScintilla edit component.
- */
-void MainWindow::initSyntaxHighlighter() {
-    // Create the highlighter.
-    highlighter = new UiguiHighlighter(qSciSourceCodeEditor);
-
-    // Handle if syntax highlighting is enabled
-    bool syntaxHighlightningEnabled = settings->getValueByName("SyntaxHighlightningEnabled").toBool();
-    if ( syntaxHighlightningEnabled ) {
-        highlighter->turnHighlightOn();
-    }
-    else {
-        highlighter->turnHighlightOff();
-    }
-}
-
-
-/*!
-    \brief Initializes the language of UniversalIndentGUI.
-
-    If the program language is defined in the settings, the corresponding language
-    file will be loaded and set for the application. If not set there, the system
-    default language will be set, if a translation file for that language exists.
-    Returns true, if the translation file could be loaded. Otherwise it returns
-    false and uses the default language, which is English.
- */
-bool MainWindow::initApplicationLanguage() {
-    QString languageShort;
-
-    // Get the language settings from the settings object.
-    int languageIndex = settings->getValueByName("Language").toInt();
-
-    // If no language was set, indicated by a negative index, use the system language.
-    if ( languageIndex < 0 ) {
-        languageShort = QLocale::system().name();
-
-        // Chinese and Japanese language consist of country and language code.
-        // For all others the language code will be cut off.
-        if ( languageShort.left(2) != "zh" && languageShort.left(2) != "ja" ) {
-            languageShort = languageShort.left(2);
-        }
-
-        // If no translation file for the systems local language exist, fall back to English.
-        if ( settings->getAvailableTranslations().indexOf(languageShort) < 0 ) {
-            languageShort = "en";
-        }
-
-        // Set the language setting to the new language.
-        settings->setValueByName("Language", settings->getAvailableTranslations().indexOf(languageShort) );
-    }
-    // If a language was defined in the settings, get this language mnemonic.
-    else {
-        languageShort = settings->getAvailableTranslations().at(languageIndex);
-    }
-
-    // Load the Qt own translation file and set it for the application.
-    qTTranslator = new QTranslator();
-    bool translationFileLoaded;
-    translationFileLoaded = qTTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/qt_" + languageShort );
-    if ( translationFileLoaded ) {
-        qApp->installTranslator(qTTranslator);
-    }
-
-    // Load the uigui translation file and set it for the application.
-    uiGuiTranslator = new QTranslator();
-    translationFileLoaded = uiGuiTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/universalindent_" + languageShort );
-    if ( translationFileLoaded ) {
-        qApp->installTranslator(uiGuiTranslator);
-    }
-
-    connect( settings, SIGNAL(language(int)), this, SLOT(languageChanged(int)) );
-
-    return translationFileLoaded;
-}
-
-
-/*!
-    \brief Creates and initializes the indenter.
- */
-void MainWindow::initIndenter() {
-    // Get Id of last selected indenter.
-    currentIndenterID = settings->getValueByName("SelectedIndenter").toInt();
-
-    // Create the indenter widget with the ID and add it to the layout.
-    indentHandler = new IndentHandler(currentIndenterID, this, centralwidget);
-    vboxLayout->addWidget(indentHandler);
-
-    // If settings for the indenter have changed, let the main window know aboud it.
-    connect(indentHandler, SIGNAL(indenterSettingsChanged()), this, SLOT(indentSettingsChangedSlot()));
-
-    // Set this true, so the indenter is called at first program start
-    indentSettingsChanged = true;
-    previewToggled = true;
-
-    // Handle if indenter parameter tool tips are enabled
-    connect( indenterParameterTooltipsEnabledAction, SIGNAL(toggled(bool)), settings, SLOT(handleValueChangeFromExtern(bool)) );
-    connect( settings, SIGNAL(indenterParameterTooltipsEnabled(bool)), indenterParameterTooltipsEnabledAction, SLOT(setChecked(bool)) );
-    indenterParameterTooltipsEnabledAction->setChecked( settings->getValueByName("IndenterParameterTooltipsEnabled").toBool() );
-
-    // Add the indenters context menu to the mainwindows menu.
-    menuIndenter->addActions( indentHandler->getIndenterMenuActions() );
-}
-
-
-/*!
-    \brief Tries to load the by \a filePath defined file and returns its content as QString.
-
-    If the file could not be loaded a error dialog will be shown.
- */
-QString MainWindow::loadFile(QString filePath) {
-    QFile inSrcFile(filePath);
-    QString fileContent = "";
-
-    if ( !inSrcFile.open(QFile::ReadOnly | QFile::Text) ) {
-        QMessageBox::warning(NULL, tr("Error opening file"), tr("Cannot read the file ")+"\""+filePath+"\"." );
-    }
-    else {
-        QTextStream inSrcStrm(&inSrcFile);
-        QApplication::setOverrideCursor(Qt::WaitCursor);
-        inSrcStrm.setCodec( QTextCodec::codecForName(currentEncoding.toAscii()) );
-        fileContent = inSrcStrm.readAll();
-        QApplication::restoreOverrideCursor();
-        inSrcFile.close();
-
-        QFileInfo fileInfo(filePath);
-        currentSourceFileExtension = fileInfo.suffix();
-        int indexOfHighlighter = highlighter->setLexerForExtension( currentSourceFileExtension );
-        highlighterActionGroup->actions().at(indexOfHighlighter)->setChecked(true);
-    }
-    return fileContent;
-}
-
-
-/*!
-    \brief Calls the source file open dialog to load a source file for the formatting preview.
-
-    If the file was successfully loaded the indenter will be called to generate the formatted source code.
- */
-void MainWindow::openSourceFileDialog(QString fileName) {
-    // If the source code file is changed and the shown dialog for saving the file
-    // is canceled, also stop opening another source file.
-    if ( !maybeSave() ) {
-        return;
-    }
-    QString openedSourceFileContent = "";
-    QString fileExtensions = tr("Supported by indenter")+" ("+indentHandler->getPossibleIndenterFileExtensions()+
-                             ");;"+tr("All files")+" (*.*)";
-
-    //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
-    if ( fileName.isEmpty() ) {
-        fileName = QFileDialog::getOpenFileName( this, tr("Choose source code file"), currentSourceFile, fileExtensions);
-    }
-
-    if (fileName != "") {
-        currentSourceFile = fileName;
-        QFileInfo fileInfo(fileName);
-        currentSourceFileExtension = fileInfo.suffix();
-
-        openedSourceFileContent = loadFile(fileName);
-        sourceFileContent = openedSourceFileContent;
-        if ( toolBarWidget->cbLivePreview->isChecked() ) {
-            callIndenter();
-        }
-        sourceCodeChanged = true;
-        previewToggled = true;
-        updateSourceView();
-        updateWindowTitle();
-        updateRecentlyOpenedList();
-        textEditLastScrollPos = 0;
-        textEditVScrollBar->setValue( textEditLastScrollPos );
-
-        savedSourceContent = openedSourceFileContent;
-        qSciSourceCodeEditor->setModified( false );
-        setWindowModified( false );
-    }
-}
-
-
-/*!
-    \brief Calls the source file save as dialog to save a source file under a chosen name.
-
-    If the file already exists and it should be overwritten, a warning is shown before.
- */
-bool MainWindow::saveasSourceFileDialog(QAction *chosenEncodingAction) {
-    QString encoding;
-    QString fileExtensions = tr("Supported by indenter")+" ("+indentHandler->getPossibleIndenterFileExtensions()+
-                             ");;"+tr("All files")+" (*.*)";
-
-    //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
-    QString fileName = QFileDialog::getSaveFileName( this, tr("Save source code file"), currentSourceFile, fileExtensions);
-
-    // Saving has been canceled if the filename is empty
-    if ( fileName.isEmpty() ) {
-        return false;
-    }
-
-    savedSourceContent = qSciSourceCodeEditor->text();
-
-    currentSourceFile = fileName;
-    QFile::remove(fileName);
-    QFile outSrcFile(fileName);
-    outSrcFile.open( QFile::ReadWrite | QFile::Text );
-
-    // Get current encoding.
-    if ( chosenEncodingAction != NULL ) {
-        encoding = chosenEncodingAction->text();
-    }
-    else {
-        encoding = encodingActionGroup->checkedAction()->text();
-    }
-    QTextStream outSrcStrm(&outSrcFile);
-    outSrcStrm.setCodec( QTextCodec::codecForName(encoding.toAscii()) );
-    outSrcStrm << savedSourceContent;
-    outSrcFile.close();
-
-    QFileInfo fileInfo(fileName);
-    currentSourceFileExtension = fileInfo.suffix();
-
-    qSciSourceCodeEditor->setModified( false );
-    setWindowModified( false );
-
-    updateWindowTitle();
-    return true;
-}
-
-
-/*!
-    \brief Saves the currently shown source code to the last save or opened source file.
-
-    If no source file has been opened, because only the static example has been loaded,
-    the save as file dialog will be shown.
- */
-bool MainWindow::saveSourceFile() {
-    if ( currentSourceFile.isEmpty() ) {
-        return saveasSourceFileDialog();
-    }
-    else {
-        QFile::remove(currentSourceFile);
-        QFile outSrcFile(currentSourceFile);
-        savedSourceContent = qSciSourceCodeEditor->text();
-        outSrcFile.open( QFile::ReadWrite | QFile::Text );
-
-        // Get current encoding.
-        QString currentEncoding = encodingActionGroup->checkedAction()->text();
-        QTextStream outSrcStrm(&outSrcFile);
-        outSrcStrm.setCodec( QTextCodec::codecForName(currentEncoding.toAscii()) );
-        outSrcStrm << savedSourceContent;
-        outSrcFile.close();
-
-        qSciSourceCodeEditor->setModified( false );
-        setWindowModified( false );
-    }
-    return true;
-}
-
-
-/*!
-    \brief Shows a file open dialog.
-
-    Shows a file open dialog with the title \a dialogHeaderStr starting in the directory \a startPath
-    and with a file mask defined by \a fileMaskStr. Returns the contents of the file as QString.
- */
-QString MainWindow::openFileDialog(QString dialogHeaderStr, QString startPath, QString fileMaskStr) {
-    QString fileContent = "";
-
-    QString fileName = QFileDialog::getOpenFileName( NULL, dialogHeaderStr, startPath, fileMaskStr);
-
-    if (fileName != "") {
-        fileContent = loadFile(fileName);
-    }
-
-    return fileContent;
-}
-
-
-/*!
-    \brief Updates the displaying of the source code.
-
-    Updates the text edit field, which is showing the loaded, and if preview is enabled formatted, source code.
-    Reassigns the line numbers and in case of switch between preview and none preview keeps the text field
-    at the same line number.
- */
-void MainWindow::updateSourceView() {
-    textEditLastScrollPos = textEditVScrollBar->value();
-
-    if ( toolBarWidget->cbLivePreview->isChecked() ) {
-        sourceViewContent = sourceFormattedContent;
-    }
-    else {
-        sourceViewContent = sourceFileContent;
-    }
-
-    if (previewToggled) {
-        disconnect( qSciSourceCodeEditor, SIGNAL(textChanged ()), this, SLOT(sourceCodeChangedHelperSlot()) );
-        bool textIsModified = isWindowModified();
-        qSciSourceCodeEditor->setText(sourceViewContent);
-        setWindowModified(textIsModified);
-        previewToggled = false;
-        connect( qSciSourceCodeEditor, SIGNAL(textChanged ()), this, SLOT(sourceCodeChangedHelperSlot()) );
-    }
-
-    textEditVScrollBar->setValue( textEditLastScrollPos );
-}
-
-
-/*!
-    \brief Calls the selected indenter with the currently loaded source code to retrieve the formatted source code.
-
-    The original loaded source code file will not be changed.
- */
-void MainWindow::callIndenter() {
-    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-    sourceFormattedContent = indentHandler->callIndenter(sourceFileContent, currentSourceFileExtension);
-    //updateSourceView();
-    QApplication::restoreOverrideCursor();
-}
-
-
-/*!
-    \brief Switches the syntax highlighting corresponding to the value \a turnOn either on or off.
- */
-void MainWindow::turnHighlightOnOff(bool turnOn) {
-    if ( turnOn ) {
-        highlighter->turnHighlightOn();
-    }
-    else {
-        highlighter->turnHighlightOff();
-    }
-    previewToggled = true;
-    updateSourceView();
-}
-
-
-/*!
-    \brief Added this slot to avoid multiple calls because of changed text.
- */
-void MainWindow::sourceCodeChangedHelperSlot() {
-    QTimer::singleShot(0, this, SLOT(sourceCodeChangedSlot()));
-}
-
-
-/*!
-    \brief Is emitted whenever the text inside the source view window changes. Calls the indenter
-    to format the changed source code.
- */
-void MainWindow::sourceCodeChangedSlot() {
-    QChar enteredCharacter;
-    int cursorPos, cursorPosAbsolut, cursorLine;
-    QString text;
-
-    sourceCodeChanged = true;
-    if ( scrollPositionChanged ) {
-        scrollPositionChanged = false;
-    }
-
-    // Get the content text of the text editor.
-    sourceFileContent = qSciSourceCodeEditor->text();
-
-    // Get the position of the cursor in the unindented text.
-    if ( sourceFileContent.isEmpty() ) {
-        // Add this line feed, because AStyle has problems with a totally emtpy file.
-        sourceFileContent += "\n";
-        cursorPosAbsolut = 0;
-        cursorPos = 0;
-        cursorLine = 0;
-        enteredCharacter = sourceFileContent.at(cursorPosAbsolut);
-    }
-    else {
-        qSciSourceCodeEditor->getCursorPosition(&cursorLine, &cursorPos);
-        cursorPosAbsolut = qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_GETCURRENTPOS);
-        text = qSciSourceCodeEditor->text(cursorLine);
-        if ( cursorPosAbsolut > 0 ) {
-            cursorPosAbsolut--;
-        }
-        if ( cursorPos > 0 ) {
-            cursorPos--;
-        }
-        enteredCharacter = sourceFileContent.at(cursorPosAbsolut);
-    }
-
-    // Call the indenter to reformat the text.
-    if ( toolBarWidget->cbLivePreview->isChecked() ) {
-        callIndenter();
-        previewToggled = true;
-    }
-
-    // Update the text editor.
-    updateSourceView();
-
-    if ( toolBarWidget->cbLivePreview->isChecked() && !enteredCharacter.isNull() && enteredCharacter != 10 ) {
-        //const char ch = enteredCharacter.toAscii();
-
-        int saveCursorLine = cursorLine;
-        int saveCursorPos = cursorPos;
-
-        bool charFound = false;
-
-        // Search forward
-        for ( cursorLine = saveCursorLine; cursorLine-saveCursorLine < 6 && cursorLine < qSciSourceCodeEditor->lines(); cursorLine++ ) {
-            text = qSciSourceCodeEditor->text(cursorLine);
-            while ( cursorPos < text.count() && enteredCharacter != text.at(cursorPos)) {
-                cursorPos++;
-            }
-            if ( cursorPos >= text.count() ) {
-                cursorPos = 0;
-            }
-            else {
-                charFound = true;
-                break;
-            }
-        }
-
-        // If foward search did not find the character, search backward
-        if ( !charFound ) {
-            text = qSciSourceCodeEditor->text(saveCursorLine);
-            cursorPos = saveCursorPos;
-            if ( cursorPos >= text.count() ) {
-                cursorPos = text.count() - 1;
-            }
-
-            for ( cursorLine = saveCursorLine; saveCursorLine-cursorLine < 6 && cursorLine >= 0; cursorLine-- ) {
-                text = qSciSourceCodeEditor->text(cursorLine);
-                while ( cursorPos >= 0 && enteredCharacter != text.at(cursorPos)) {
-                    cursorPos--;
-                }
-                if ( cursorPos < 0 ) {
-                    cursorPos = qSciSourceCodeEditor->lineLength(cursorLine-1) - 1;
-                }
-                else {
-                    charFound = true;
-                    break;
-                }
-            }
-        }
-
-        // If the character was found set its new cursor position...
-        if ( charFound ) {
-            qSciSourceCodeEditor->setCursorPosition( cursorLine, cursorPos+1 );
-        }
-        // ...if it was not found, set the previous cursor position.
-        else {
-            qSciSourceCodeEditor->setCursorPosition( saveCursorLine, saveCursorPos+1 );
-        }
-    }
-    // set the previous cursor position.
-    else if ( enteredCharacter == 10 ) {
-        qSciSourceCodeEditor->setCursorPosition( cursorLine, cursorPos );
-    }
-
-
-    if ( toolBarWidget->cbLivePreview->isChecked() ) {
-        sourceCodeChanged = false;
-    }
-
-    if ( savedSourceContent == qSciSourceCodeEditor->text() ) {
-        qSciSourceCodeEditor->setModified( false );
-        setWindowModified( false );
-    }
-    else {
-        qSciSourceCodeEditor->setModified( true ); // Has no effect according to QScintilla docs.
-        setWindowModified( true );
-    }
-
-    // Could set cursor this way and use normal linear search in text instead of columns and rows.
-    //qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_SETCURRENTPOS, 50);
-    //qSciSourceCodeEditor->SendScintilla(QsciScintillaBase::SCI_SETANCHOR, 50);
-}
-
-
-/*!
-    \brief This slot is called whenever one of the indenter settings are changed.
-
-    It calls the selected indenter if the preview is turned on. If preview
-    is not active a flag is set, that the settings have changed.
- */
-void MainWindow::indentSettingsChangedSlot() {
-    indentSettingsChanged = true;
-
-    int cursorLine, cursorPos;
-    qSciSourceCodeEditor->getCursorPosition(&cursorLine, &cursorPos);
-
-    if ( toolBarWidget->cbLivePreview->isChecked() ) {
-        callIndenter();
-        previewToggled = true;
-
-        updateSourceView();
-        if (sourceCodeChanged) {
-/*            savedCursor = qSciSourceCodeEditor->textCursor();
-            if ( cursorPos >= qSciSourceCodeEditor->text().count() ) {
-                cursorPos = qSciSourceCodeEditor->text().count() - 1;
-            }
-            savedCursor.setPosition( cursorPos );
-            qSciSourceCodeEditor->setTextCursor( savedCursor );
-*/
-            sourceCodeChanged = false;
-        }
-        indentSettingsChanged = false;
-    }
-    else {
-        updateSourceView();
-    }
-
-    if ( savedSourceContent == qSciSourceCodeEditor->text() ) {
-        qSciSourceCodeEditor->setModified( false );
-        setWindowModified( false );
-    }
-    else {
-        qSciSourceCodeEditor->setModified( true ); // Has no effect according to QScintilla docs.
-        setWindowModified( true );
-    }
-}
-
-
-/*!
-    \brief This slot is called whenever the preview button is turned on or off.
-
-    It calls the selected indenter to format the current source code if
-    the code has been changed since the last indenter call.
- */
-void MainWindow::previewTurnedOnOff(bool turnOn) {
-    previewToggled = true;
-
-    int cursorLine, cursorPos;
-    qSciSourceCodeEditor->getCursorPosition(&cursorLine, &cursorPos);
-
-    if ( turnOn && (indentSettingsChanged || sourceCodeChanged) ) {
-        callIndenter();
-    }
-    updateSourceView();
-    if (sourceCodeChanged) {
-/*        savedCursor = qSciSourceCodeEditor->textCursor();
-        if ( cursorPos >= qSciSourceCodeEditor->text().count() ) {
-            cursorPos = qSciSourceCodeEditor->text().count() - 1;
-        }
-        savedCursor.setPosition( cursorPos );
-        qSciSourceCodeEditor->setTextCursor( savedCursor );
-*/
-        sourceCodeChanged = false;
-    }
-    indentSettingsChanged = false;
-
-    if ( savedSourceContent == qSciSourceCodeEditor->text() ) {
-        qSciSourceCodeEditor->setModified( false );
-        setWindowModified( false );
-    }
-    else {
-        qSciSourceCodeEditor->setModified( true );
-        setWindowModified( true );
-    }
-}
-
-
-/*!
-    \brief This slot updates the main window title to show the currently opened
-    source code filename.
- */
-void MainWindow::updateWindowTitle() {
-    this->setWindowTitle( "UniversalIndentGUI " + version +" [*]"+ currentSourceFile);
-}
-
-
-/*!
-    \brief Opens a dialog to save the current source code as a PDF document.
- */
-void MainWindow::exportToPDF() {
-    QString fileExtensions = tr("PDF Document")+" (*.pdf)";
-
-    QString fileName = currentSourceFile;
-    QFileInfo fileInfo(fileName);
-    QString fileExtension = fileInfo.suffix();
-
-    fileName.replace( fileName.length()-fileExtension.length(), fileExtension.length(), "pdf" );
-    fileName = QFileDialog::getSaveFileName( this, tr("Export source code file"), fileName, fileExtensions);
-
-    if ( !fileName.isEmpty() ) {
-        QsciPrinter printer(QPrinter::HighResolution);
-        printer.setOutputFormat(QPrinter::PdfFormat);
-        printer.setOutputFileName(fileName);
-        printer.printRange(qSciSourceCodeEditor);
-    }
-}
-
-
-/*!
-    \brief Opens a dialog to save the current source code as a HTML document.
- */
-void MainWindow::exportToHTML() {
-    QString fileExtensions = tr("HTML Document")+" (*.html)";
-
-    QString fileName = currentSourceFile;
-    QFileInfo fileInfo(fileName);
-    QString fileExtension = fileInfo.suffix();
-
-    fileName.replace( fileName.length()-fileExtension.length(), fileExtension.length(), "html" );
-    fileName = QFileDialog::getSaveFileName( this, tr("Export source code file"), fileName, fileExtensions);
-
-    if ( !fileName.isEmpty() ) {
-        // Create a document from which HTML code can be generated.
-        QTextDocument sourceCodeDocument( qSciSourceCodeEditor->text() );
-        sourceCodeDocument.setDefaultFont( QFont("Courier", 12, QFont::Normal) );
-        QString sourceCodeAsHTML = sourceCodeDocument.toHtml();
-        // To ensure that empty lines are kept in the HTML code make this replacement.
-        sourceCodeAsHTML.replace("\"></p>", "\"><br /></p>");
-
-        // Write the HTML file.
-        QFile::remove(fileName);
-        QFile outSrcFile(fileName);
-        outSrcFile.open( QFile::ReadWrite | QFile::Text );
-        outSrcFile.write( sourceCodeAsHTML.toAscii() );
-        outSrcFile.close();
-    }
-}
-
-
-/*!
-    \brief Loads the last opened file if this option is enabled in the settings.
-
-    If the file does not exist, the default example file is tried to be loaded. If even that
-    fails a very small code example is shown.
-    If the setting for opening the last file is disabled, the editor is empty on startup.
-*/
-void MainWindow::loadLastOpenedFile() {
-    // Get setting for last opened source code file.
-    loadLastSourceCodeFileOnStartup = settings->getValueByName("LoadLastOpenedFileOnStartup").toBool();
-
-    // Only load last source code file if set to do so
-    if ( loadLastSourceCodeFileOnStartup ) {
-        // From the list of last opened files get the first one.
-        currentSourceFile = settings->getValueByName("LastOpenedFiles").toString().split("|").first();
-
-        // If source file exist load it.
-        if ( QFile::exists(currentSourceFile) ) {
-            QFileInfo fileInfo(currentSourceFile);
-            currentSourceFile = fileInfo.absoluteFilePath();
-            sourceFileContent = loadFile(currentSourceFile);
-        }
-        // If the last opened source code file does not exist, try to load the default example.cpp file.
-        else if ( QFile::exists( SettingsPaths::getIndenterPath() + "/example.cpp" ) ) {
-            QFileInfo fileInfo( SettingsPaths::getIndenterPath() + "/example.cpp" );
-            currentSourceFile = fileInfo.absoluteFilePath();
-            sourceFileContent = loadFile(currentSourceFile);
-        }
-        // If neither the example source code file exists show some small code example.
-        else {
-            currentSourceFile = "untitled.cpp";
-            currentSourceFileExtension = "cpp";
-            sourceFileContent = "if(x==\"y\"){x=z;}";
-        }
-    }
-    // if last opened source file should not be loaded make some default settings.
-    else {
-        currentSourceFile = "untitled.cpp";
-        currentSourceFileExtension = "cpp";
-        sourceFileContent = "";
-    }
-    savedSourceContent = sourceFileContent;
-
-    // Update the mainwindow title to show the name of the loaded source code file.
-    updateWindowTitle();
-}
-
-
-/*!
-    \brief Saves the settings for the main application to the file "UniversalIndentGUI.ini".
-
-    Settings are for example last selected indenter, last loaded config file and so on.
-*/
-void MainWindow::saveSettings() {
-    settings->setValueByName( "FileEncoding", currentEncoding );
-    settings->setValueByName( "VersionInSettingsFile", version );
-    settings->setValueByName( "WindowIsMaximized", isMaximized() );
-    if ( !isMaximized() ) {
-        settings->setValueByName( "WindowPosition", pos() );
-        settings->setValueByName( "WindowSize", size() );
-    }
-    settings->setValueByName( "MainWindowState", saveState() );
-
-    // Also save the syntax highlight style for all lexers.
-    highlighter->writeCurrentSettings("");
-}
-
-
-/*!
-    \brief Is always called when the program is quit. Calls the saveSettings function before really quits.
-*/
-void MainWindow::closeEvent( QCloseEvent *event ) {
-    if ( maybeSave() ) {
-        saveSettings();
-        event->accept();
-    }
-    else {
-        event->ignore();
-    }
-}
-
-
-/*!
-    \brief This function is setup to capture tooltip events.
-
-    All widgets that are created by the indentHandler object and are responsible
-    for indenter parameters are connected with this event filter.
-    So depending on the settings the tooltips can be enabled and disabled for these widgets.
- */
-bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
-    if ( event->type() == QEvent::ToolTip) {
-        if ( indenterParameterTooltipsEnabledAction->isChecked() ) {
-            return QMainWindow::eventFilter(obj, event);
-        }
-        else {
-            //QToolTip::showText( QPoint(100,100) , "Test1");
-            return true;
-        }
-    }
-    else {
-        // pass the event on to the parent class
-        return QMainWindow::eventFilter(obj, event);
-    }
-}
-
-
-/*!
-    \brief Is called at application exit and asks whether to save the source code file, if it has been changed.
- */
-bool MainWindow::maybeSave() {
-    if ( isWindowModified() ) {
-        int ret = QMessageBox::warning(this, tr("Modified code"),
-            tr("The source code has been modified.\n"
-                "Do you want to save your changes?"),
-            QMessageBox::Yes | QMessageBox::Default,
-            QMessageBox::No,
-            QMessageBox::Cancel | QMessageBox::Escape);
-        if (ret == QMessageBox::Yes) {
-            return saveSourceFile();
-        }
-        else if (ret == QMessageBox::Cancel) {
-            return false;
-        }
-    }
-    return true;
-}
-
-
-/*!
-    \brief This slot is called whenever a language is selected in the menu. It tries to find the
-    corresponding action in the languageInfoList and sets the language.
- */
-void MainWindow::languageChanged(int languageIndex) {
-    // Get the mnemonic of the new selected language.
-    QString languageShort = settings->getAvailableTranslations().at(languageIndex);
-
-    // Remove the old qt translation.
-    qApp->removeTranslator( qTTranslator );
-
-    // Remove the old uigui translation.
-    qApp->removeTranslator( uiGuiTranslator );
-
-    // Load the Qt own translation file and set it for the application.
-    bool translationFileLoaded;
-    translationFileLoaded = qTTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/qt_" + languageShort );
-    if ( translationFileLoaded ) {
-        qApp->installTranslator(qTTranslator);
-    }
-
-    // Load the uigui translation file and set it for the application.
-    translationFileLoaded = uiGuiTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/universalindent_" + languageShort );
-    if ( translationFileLoaded ) {
-        qApp->installTranslator(uiGuiTranslator);
-    }
-}
-
-
-/*!
-    \brief Creates a menu entries in the file menu for opening and saving a file with different encodings.
-*/
-void MainWindow::createEncodingMenu() {
-    QAction *encodingAction;
-    QString encodingName;
-
-    encodingsList = QStringList() << "UTF-8" << "UTF-16" << "UTF-16BE" << "UTF-16LE"
-                    << "Apple Roman" << "Big5" << "Big5-HKSCS" << "EUC-JP" << "EUC-KR" << "GB18030-0"
-                    << "IBM 850" << "IBM 866" << "IBM 874" << "ISO 2022-JP" << "ISO 8859-1" << "ISO 8859-13"
-                    << "Iscii-Bng" << "JIS X 0201" << "JIS X 0208" << "KOI8-R" << "KOI8-U" << "MuleLao-1"
-                    << "ROMAN8" << "Shift-JIS" << "TIS-620" << "TSCII" << "Windows-1250" << "WINSAMI2";
-
-    encodingActionGroup = new QActionGroup(this);
-    saveEncodedActionGroup = new QActionGroup(this);
-
-    // Loop for each available encoding
-    foreach ( encodingName, encodingsList ) {
-        // Create actions for the "reopen" menu
-        encodingAction = new QAction(encodingName, encodingActionGroup);
-        encodingAction->setStatusTip( tr("Reopen the currently opened source code file by using the text encoding scheme ") + encodingName );
-        encodingAction->setCheckable(true);
-        if ( encodingName == currentEncoding ) {
-            encodingAction->setChecked(true);
-        }
-
-        // Create actions for the "save as encoded" menu
-        encodingAction = new QAction(encodingName, saveEncodedActionGroup);
-        encodingAction->setStatusTip( tr("Save the currently opened source code file by using the text encoding scheme ") + encodingName );
-    }
-
-    encodingMenu->addActions( encodingActionGroup->actions() );
-    connect( encodingActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(encodingChanged(QAction*)) );
-
-    saveEncodedMenu->addActions( saveEncodedActionGroup->actions() );
-    connect( saveEncodedActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(saveAsOtherEncoding(QAction*)) );
-}
-
-
-/*!
-    \brief This slot calls the save dialog to save the current source file with another encoding.
-
-    If the saving is successful and not aborted, the currently used encoding, visible in the
-    "reopen" menu, is also changed to the new encoding.
-*/
-void MainWindow::saveAsOtherEncoding(QAction *chosenEncodingAction) {
-    bool fileWasSaved = saveasSourceFileDialog(chosenEncodingAction);
-
-    // If the file was save with another encoding, change the selected encoding in the reopen menu.
-    if ( fileWasSaved ) {
-        foreach ( QAction *action, encodingActionGroup->actions() ) {
-            if ( action->text() == chosenEncodingAction->text() ) {
-                action->setChecked(true);
-                return;
-            }
-        }
-    }
-}
-
-
-/*!
-    \brief This slot is called whenever an encoding is selected in the settings menu.
-*/
-void MainWindow::encodingChanged(QAction* encodingAction) {
-    if ( maybeSave() ) {
-        QFile inSrcFile(currentSourceFile);
-        QString fileContent = "";
-
-        if ( !inSrcFile.open(QFile::ReadOnly | QFile::Text) ) {
-            QMessageBox::warning(NULL, tr("Error opening file"), tr("Cannot read the file ")+"\""+currentSourceFile+"\"." );
-        }
-        else {
-            QTextStream inSrcStrm(&inSrcFile);
-            QApplication::setOverrideCursor(Qt::WaitCursor);
-            QString encodingName = encodingAction->text();
-            currentEncoding = encodingName;
-            inSrcStrm.setCodec( QTextCodec::codecForName(encodingName.toAscii()) );
-            fileContent = inSrcStrm.readAll();
-            QApplication::restoreOverrideCursor();
-            inSrcFile.close();
-            qSciSourceCodeEditor->setText( fileContent );
-            qSciSourceCodeEditor->setModified(false);
-        }
-    }
-}
-
-
-/*!
-    \brief Creates a menu entry under the settings menu for all available text encodings.
-*/
-void MainWindow::createHighlighterMenu() {
-    QAction *highlighterAction;
-    QString highlighterName;
-
-    highlighterActionGroup = new QActionGroup(this);
-
-    // Loop for each known highlighter
-    foreach ( highlighterName, highlighter->getAvailableHighlighters() ) {
-        highlighterAction = new QAction(highlighterName, highlighterActionGroup);
-        highlighterAction->setStatusTip( tr("Set the syntax highlightning to ") + highlighterName );
-        highlighterAction->setCheckable(true);
-    }
-    highlighterMenu->addActions( highlighterActionGroup->actions() );
-    menuSettings->insertMenu(indenterParameterTooltipsEnabledAction, highlighterMenu );
-
-    connect( highlighterActionGroup, SIGNAL(triggered(QAction*)), highlighter, SLOT(setHighlighterByAction(QAction*)) );
-}
-
-
-/*!
-    \brief Is called whenever the white space visibility is being changed in the menu.
- */
-void MainWindow::setWhiteSpaceVisibility(bool visible) {
-    if ( visible ) {
-        qSciSourceCodeEditor->setWhitespaceVisibility(QsciScintilla::WsVisible);
-    }
-    else {
-        qSciSourceCodeEditor->setWhitespaceVisibility(QsciScintilla::WsInvisible);
-    }
-}
-
-/*!
-    \brief This slot is called whenever the number of lines in the editor changes
-    and adapts the margin for the displayed line numbers.
-*/
-void MainWindow::numberOfLinesChanged() {
-    QString lineNumbers;
-    lineNumbers.setNum( qSciSourceCodeEditor->lines()*10 );
-    qSciSourceCodeEditor->setMarginWidth(1, lineNumbers);
-}
-
-
-/*!
-    \brief Catches language change events and retranslates all needed widgets.
- */
-void MainWindow::changeEvent(QEvent *event) {
-    int i = 0;
-
-    if (event->type() == QEvent::LanguageChange) {
-        QString languageName;
-
-        // Translate the main window.
-        retranslateUi(this);
-        updateWindowTitle();
-
-        // Translate the toolbar.
-        toolBarWidget->retranslateUi(toolBar);
-
-        // Translate the indent handler widget.
-        indentHandler->retranslateUi();
-
-        // Translate the load encoding menu.
-        QList<QAction *> encodingActionList = encodingActionGroup->actions();
-        for ( i = 0; i < encodingActionList.size(); i++ ) {
-            encodingActionList.at(i)->setStatusTip( tr("Reopen the currently opened source code file by using the text encoding scheme ") + encodingsList.at(i) );
-        }
-
-        // Translate the save encoding menu.
-        encodingActionList = saveEncodedActionGroup->actions();
-        for ( i = 0; i < encodingActionList.size(); i++ ) {
-            encodingActionList.at(i)->setStatusTip( tr("Save the currently opened source code file by using the text encoding scheme ") + encodingsList.at(i) );
-        }
-
-        // Translate the highlighter menu.
-        QList<QAction *> actionList = highlighterMenu->actions();
-        i = 0;
-        foreach ( QString highlighterName, highlighter->getAvailableHighlighters() ) {
-            QAction *highlighterAction = actionList.at(i);
-            highlighterAction->setStatusTip( tr("Set the syntax highlightning to ") + highlighterName );
-            i++;
-        }
-
-        // Translate the line and column indicators in the statusbar.
-        int line, column;
-        qSciSourceCodeEditor->getCursorPosition( &line, &column );
-        setStatusBarCursorPosInfo( line, column );
-    }
-    else {
-        QWidget::changeEvent(event);
-    }
-}
-
-
-
-/*!
-    \brief Updates the list of recently opened files.
-
-    Therefore the currently open file is set at the lists first position
-    regarding the in the settings set maximum list length. Overheads of the
-    list will be cut off. The new list will be updated to the settings and
-    the recently opened menu will be updated too.
- */
-void MainWindow::updateRecentlyOpenedList() {
-    QString fileName;
-    QString filePath;
-    QStringList recentlyOpenedList = settings->getValueByName("LastOpenedFiles").toString().split("|");
-    QList<QAction*> recentlyOpenedActionList = menuRecently_Opened_Files->actions();
-
-    // Check if the currently open file is in the list of recently opened.
-    int indexOfCurrentFile = recentlyOpenedList.indexOf( currentSourceFile );
-
-    // If it is in the list of recently opened files and not at the first position, move it to the first pos.
-    if ( indexOfCurrentFile > 0 ) {
-        recentlyOpenedList.move(indexOfCurrentFile, 0);
-        recentlyOpenedActionList.move(indexOfCurrentFile, 0);
-    }
-    // Put the current file at the first position if it not already is and is not empty.
-    else if ( indexOfCurrentFile == -1 && !currentSourceFile.isEmpty() ) {
-        recentlyOpenedList.insert(0, currentSourceFile);
-        QAction *recentlyOpenedAction = new QAction(QFileInfo(currentSourceFile).fileName(), menuRecently_Opened_Files);
-        recentlyOpenedAction->setStatusTip(currentSourceFile);
-        recentlyOpenedActionList.insert(0, recentlyOpenedAction );
-    }
-
-    // Get the maximum recently opened list size.
-    int recentlyOpenedListMaxSize = settings->getValueByName("RecentlyOpenedListSize").toInt();
-
-    // Loop for each filepath in the recently opened list, remove non existing files and
-    // loop only as long as maximum allowed list entries are set.
-    for ( int i = 0; i < recentlyOpenedList.size() && i < recentlyOpenedListMaxSize; ) {
-        filePath = recentlyOpenedList.at(i);
-        QFileInfo fileInfo(filePath);
-
-        // If the file does no longer exist, remove it from the list.
-        if ( !fileInfo.exists() ) {
-            recentlyOpenedList.takeAt(i);
-            if ( i < recentlyOpenedActionList.size()-2 ) {
-                QAction* action = recentlyOpenedActionList.takeAt(i);
-                delete action;
-            }
-        }
-        // else if its not already in the menu, add it to the menu.
-        else {
-            if ( i >= recentlyOpenedActionList.size()-2 ) {
-                QAction *recentlyOpenedAction = new QAction(fileInfo.fileName(), menuRecently_Opened_Files);
-                recentlyOpenedAction->setStatusTip(filePath);
-                recentlyOpenedActionList.insert( recentlyOpenedActionList.size()-2, recentlyOpenedAction );
-            }
-            i++;
-        }
-    }
-
-    // Trim the list to its in the settings allowed maximum size.
-    while ( recentlyOpenedList.size() > recentlyOpenedListMaxSize ) {
-        recentlyOpenedList.takeLast();
-        QAction* action = recentlyOpenedActionList.takeAt( recentlyOpenedActionList.size()-3 );
-        delete action;
-    }
-
-    // Add all actions to the menu.
-    menuRecently_Opened_Files->addActions(recentlyOpenedActionList);
-
-    // Write the new recently opened list to the settings.
-    settings->setValueByName( "LastOpenedFiles", recentlyOpenedList.join("|") );
-
-    // Enable or disable "actionClear_Recently_Opened_List" if list is [not] emtpy
-    if ( recentlyOpenedList.isEmpty() ) {
-        actionClear_Recently_Opened_List->setEnabled(false);
-    }
-    else {
-        actionClear_Recently_Opened_List->setEnabled(true);
-    }
-}
-
-
-/*!
-    \brief This slot empties the list of recently opened files.
- */
-void MainWindow::clearRecentlyOpenedList() {
-    QStringList recentlyOpenedList = settings->getValueByName("LastOpenedFiles").toString().split("|");
-    QList<QAction*> recentlyOpenedActionList = menuRecently_Opened_Files->actions();
-
-    while ( recentlyOpenedList.size() > 0 ) {
-        recentlyOpenedList.takeLast();
-        QAction* action = recentlyOpenedActionList.takeAt( recentlyOpenedActionList.size()-3 );
-        delete action;
-    }
-
-    // Write the new recently opened list to the settings.
-    settings->setValueByName( "LastOpenedFiles", recentlyOpenedList.join("|") );
-
-    // Disable "actionClear_Recently_Opened_List"
-    actionClear_Recently_Opened_List->setEnabled(false);
-}
-
-
-/*!
-    \brief This slot is called if an entry from the list of recently opened files is
-    being selected.
- */
-void MainWindow::openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction) {
-    // If the selected action from the recently opened list menu is the clear action
-    // call the slot to clear the list and then leave.
-    if ( recentlyOpenedAction == actionClear_Recently_Opened_List ) {
-        clearRecentlyOpenedList();
-        return;
-    }
-
-    QString fileName = recentlyOpenedAction->text();
-    int indexOfSelectedFile = menuRecently_Opened_Files->actions().indexOf( recentlyOpenedAction );
-    QStringList recentlyOpenedList = settings->getValueByName("LastOpenedFiles").toString().split("|");
-    QString filePath = recentlyOpenedList.at(indexOfSelectedFile);
-    QFileInfo fileInfo(filePath);
-
-    // If the file exists, open it.
-    if ( fileInfo.exists() ) {
-        openSourceFileDialog(filePath);
-    }
-    // If it does not exist, show a warning message and update the list of recently opened files.
-    else {
-        QMessageBox::warning(NULL, tr("File no longer exists"), tr("The file %1 in the list of recently opened files does no longer exist.") );
-        // The function updateRecentlyOpenedList() has to be called via a singleShot so it is executed after this
-        // function (openFileFromRecentlyOpenedList) has already been left. This has to be done because
-        // a Qt3Support function tries to emit a signal based on the existing actions and deleting
-        // any of these actions in updateRecentlyOpenedList() causes an error.
-        QTimer::singleShot(0, this, SLOT(updateRecentlyOpenedList()) );
-    }
-}
-
-
-/*!
-    \brief If the dragged in object contains urls/paths to a file, accept the drag.
- */
-void MainWindow::dragEnterEvent(QDragEnterEvent *event) {
-    if ( event->mimeData()->hasUrls() ) {
-        event->acceptProposedAction();
-    }
-}
-
-
-/*!
-    \brief If the dropped in object contains urls/paths to a file, open that file.
- */
-void MainWindow::dropEvent(QDropEvent *event) {
-    if ( event->mimeData()->hasUrls() ) {
-        QString filePathName = event->mimeData()->urls().first().toLocalFile();
-        openSourceFileDialog(filePathName);
-    }
-
-    event->acceptProposedAction();
-}
-
-
-/*!
-    \brief If the dropped in object contains urls/paths to a file, open that file.
-*/
-void MainWindow::showAboutDialog() {
-    QPixmap originalPixmap = QPixmap::grabWindow(QApplication::desktop()->screen()->winId());
-    //qDebug("in main pixmap width %d, numScreens = %d", originalPixmap.size().width(), QApplication::desktop()->availableGeometry().width());
-    aboutDialogGraphicsView->setScreenshotPixmap( originalPixmap );
-    aboutDialogGraphicsView->show();
-}
-
-
-/*!
-    \brief Sets the label in the status bar to show the \a line and \a column number.
-*/
-void MainWindow::setStatusBarCursorPosInfo( int line, int column ) {
-    textEditLineColumnInfoLabel->setText( tr("Line %1, Column %2").arg(line+1).arg(column+1) );
-}
--- a/src/mainwindow.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include "ui_mainwindow.h"
-#include "ui_toolBarWidget.h"
-#include "aboutdialog.h"
-#include "AboutDialogGraphicsView.h"
-#include "uiguisettings.h"
-#include "uiguisettingsdialog.h"
-#include "UiguiHighlighter.h"
-#include "indenthandler.h"
-#include "updatecheckdialog.h"
-
-#include <QWidget>
-#include <QString>
-#include <QScrollBar>
-#include <QTextCursor>
-#include <QFileDialog>
-#include <QTextStream>
-#include <QPrinter>
-#include <QPrintDialog>
-#include <QCloseEvent>
-#include <QHelpEvent>
-#include <QToolTip>
-#include <QTranslator>
-#include <QLocale>
-#include <QTextCodec>
-#include <QDate>
-
-#include <Qsci/qsciscintilla.h>
-#include <Qsci/qsciprinter.h>
-
-class MainWindow : public QMainWindow, private Ui::MainWindowUi
-{
-    Q_OBJECT
-
-public:
-    //! Constructor
-    MainWindow(QString file2OpenOnStart = "", QWidget *parent = 0);
-
-private:
-    QString loadFile(QString filePath);
-    QString openFileDialog(QString dialogHeaderStr, QString startPath, QString fileMaskStr);
-    void updateWindowTitle();
-    void loadLastOpenedFile();
-    void saveSettings();
-    bool maybeSave();
-    void createEncodingMenu();
-    void createHighlighterMenu();
-    bool initApplicationLanguage();
-    void initMainWindow();
-    void initToolBar();
-    void initTextEditor();
-    void initSyntaxHighlighter();
-    void initIndenter();
-    void changeEvent(QEvent *event);
-    void dragEnterEvent(QDragEnterEvent *event);
-    void dropEvent(QDropEvent *event);
-
-	QsciScintilla *qSciSourceCodeEditor;
-	UiguiSettings *settings;
-
-    QString version;
-    QString revision;
-    QString buildDateStr;
-
-	QString currentEncoding;
-    QString sourceFileContent;
-    QString sourceFormattedContent;
-    QString sourceViewContent;
-    UiguiHighlighter *highlighter;
-    QScrollBar *textEditVScrollBar;
-    AboutDialog *aboutDialog;
-    AboutDialogGraphicsView *aboutDialogGraphicsView;
-	UiguiSettingsDialog *settingsDialog;
-    int textEditLastScrollPos;
-    int currentIndenterID;
-	bool loadLastSourceCodeFileOnStartup;
-    QString currentSourceFile;
-    QString currentSourceFileExtension;
-    QString savedSourceContent;
-    QActionGroup *encodingActionGroup;
-    QActionGroup *saveEncodedActionGroup;
-    QActionGroup *highlighterActionGroup;
-    QTranslator *uiGuiTranslator;
-    QTranslator *qTTranslator;
-    bool isFirstRunOfThisVersion;
-
-    bool sourceCodeChanged;
-    bool scrollPositionChanged;
-    bool indentSettingsChanged;
-    bool previewToggled;
-	QStringList encodingsList;
-
-    Ui::toolBarWidget *toolBarWidget;
-    IndentHandler *indentHandler;
-    UpdateCheckDialog *updateCheckDialog;
-    QLabel *textEditLineColumnInfoLabel;
-
-protected:
-    void closeEvent( QCloseEvent *event );
-    bool eventFilter(QObject *obj, QEvent *event);
-
-private slots:
-    void openSourceFileDialog(QString fileName = "");
-    bool saveasSourceFileDialog(QAction *chosenEncodingAction = NULL);
-    void saveAsOtherEncoding(QAction *chosenEncodingAction);
-    bool saveSourceFile();
-    void callIndenter();
-    void updateSourceView();
-    void turnHighlightOnOff(bool turnOn);
-	void setWhiteSpaceVisibility(bool visible);
-	void sourceCodeChangedHelperSlot();
-    void sourceCodeChangedSlot();
-    void indentSettingsChangedSlot();
-    void previewTurnedOnOff(bool turnOn);
-    void exportToPDF();
-    void exportToHTML();
-	void languageChanged(int languageIndex);
-    void encodingChanged(QAction *encodingAction);
-	void numberOfLinesChanged();
-    void updateRecentlyOpenedList();
-    void openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction);
-    void clearRecentlyOpenedList();
-	void showAboutDialog();
-    void setStatusBarCursorPosInfo(int line, int column);
-};
-
-#endif // MAINWINDOW_H
--- a/src/mainwindow.ui	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,465 +0,0 @@
-<ui version="4.0" >
- <author>Thomas_-_S</author>
- <class>MainWindowUi</class>
- <widget class="QMainWindow" name="MainWindowUi" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>949</width>
-    <height>633</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>UniversalIndentGUI</string>
-  </property>
-  <property name="windowIcon" >
-   <iconset resource="../resources/Icons.qrc" >
-    <normaloff>:/mainWindow/universalIndentGUI.svg</normaloff>:/mainWindow/universalIndentGUI.svg</iconset>
-  </property>
-  <widget class="QWidget" name="centralwidget" >
-   <layout class="QHBoxLayout" >
-    <property name="spacing" >
-     <number>6</number>
-    </property>
-    <property name="margin" >
-     <number>0</number>
-    </property>
-    <item>
-     <layout class="QHBoxLayout" >
-      <property name="spacing" >
-       <number>0</number>
-      </property>
-      <property name="margin" >
-       <number>2</number>
-      </property>
-     </layout>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QStatusBar" name="statusbar" />
-  <widget class="QMenuBar" name="menuBar" >
-   <property name="geometry" >
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>949</width>
-     <height>21</height>
-    </rect>
-   </property>
-   <widget class="QMenu" name="menuIndenter" >
-    <property name="title" >
-     <string>Indenter</string>
-    </property>
-   </widget>
-   <widget class="QMenu" name="menuFile" >
-    <property name="title" >
-     <string>File</string>
-    </property>
-    <widget class="QMenu" name="menuExport" >
-     <property name="title" >
-      <string>Export</string>
-     </property>
-     <addaction name="actionExportPDF" />
-     <addaction name="actionExportHTML" />
-    </widget>
-    <widget class="QMenu" name="menuRecently_Opened_Files" >
-     <property name="title" >
-      <string>Recently Opened Files</string>
-     </property>
-     <addaction name="separator" />
-     <addaction name="actionClear_Recently_Opened_List" />
-    </widget>
-    <widget class="QMenu" name="encodingMenu" >
-     <property name="title" >
-      <string>Reopen File with other Encoding</string>
-     </property>
-    </widget>
-    <widget class="QMenu" name="saveEncodedMenu" >
-     <property name="title" >
-      <string>Save Source File As with other Encoding</string>
-     </property>
-    </widget>
-    <addaction name="actionOpen_Source_File" />
-    <addaction name="menuRecently_Opened_Files" />
-    <addaction name="encodingMenu" />
-    <addaction name="separator" />
-    <addaction name="actionSave_Source_File" />
-    <addaction name="actionSave_Source_File_As" />
-    <addaction name="saveEncodedMenu" />
-    <addaction name="separator" />
-    <addaction name="menuExport" />
-    <addaction name="actionExit" />
-   </widget>
-   <widget class="QMenu" name="menuSettings" >
-    <property name="title" >
-     <string>Settings</string>
-    </property>
-    <widget class="QMenu" name="highlighterMenu" >
-     <property name="title" >
-      <string>Set Syntax Highlighter</string>
-     </property>
-    </widget>
-    <addaction name="actionLive_Indent_Preview" />
-    <addaction name="enableSyntaxHighlightningAction" />
-    <addaction name="whiteSpaceIsVisibleAction" />
-    <addaction name="highlighterMenu" />
-    <addaction name="indenterParameterTooltipsEnabledAction" />
-    <addaction name="loadLastOpenedFileOnStartupAction" />
-    <addaction name="actionShowSettings" />
-   </widget>
-   <widget class="QMenu" name="menuHelp" >
-    <property name="title" >
-     <string>Help</string>
-    </property>
-    <addaction name="actionCheck_for_update" />
-    <addaction name="separator" />
-    <addaction name="actionAbout_UniversalIndentGUI" />
-   </widget>
-   <addaction name="menuFile" />
-   <addaction name="menuIndenter" />
-   <addaction name="menuSettings" />
-   <addaction name="menuHelp" />
-  </widget>
-  <widget class="QDockWidget" name="dockWidget" >
-   <property name="sizePolicy" >
-    <sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
-     <horstretch>0</horstretch>
-     <verstretch>0</verstretch>
-    </sizepolicy>
-   </property>
-   <property name="features" >
-    <set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
-   </property>
-   <property name="allowedAreas" >
-    <set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
-   </property>
-   <property name="windowTitle" >
-    <string>Indenter Settings</string>
-   </property>
-   <attribute name="dockWidgetArea" >
-    <number>1</number>
-   </attribute>
-   <widget class="QWidget" name="dockWidgetContents" >
-    <layout class="QHBoxLayout" >
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <item>
-      <layout class="QVBoxLayout" >
-       <property name="spacing" >
-        <number>0</number>
-       </property>
-       <property name="margin" >
-        <number>0</number>
-       </property>
-      </layout>
-     </item>
-    </layout>
-   </widget>
-  </widget>
-  <widget class="QToolBar" name="toolBar" >
-   <property name="contextMenuPolicy" >
-    <enum>Qt::PreventContextMenu</enum>
-   </property>
-   <property name="windowTitle" >
-    <string>Main Toolbar</string>
-   </property>
-   <property name="orientation" >
-    <enum>Qt::Horizontal</enum>
-   </property>
-   <property name="iconSize" >
-    <size>
-     <width>16</width>
-     <height>16</height>
-    </size>
-   </property>
-   <property name="toolButtonStyle" >
-    <enum>Qt::ToolButtonTextBesideIcon</enum>
-   </property>
-   <attribute name="toolBarArea" >
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak" >
-    <bool>false</bool>
-   </attribute>
-  </widget>
-  <action name="actionOpen_Source_File" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/document-open.png</normaloff>:/mainWindow/document-open.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Open Source File</string>
-   </property>
-   <property name="statusTip" >
-    <string>Opens a dialog for selecting a source code file.</string>
-   </property>
-   <property name="shortcut" >
-    <string>Ctrl+O</string>
-   </property>
-  </action>
-  <action name="actionSave_Source_File" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/document-save.png</normaloff>:/mainWindow/document-save.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Save Source File</string>
-   </property>
-   <property name="statusTip" >
-    <string>Saves the currently shown source code to the last opened or saved source file.</string>
-   </property>
-   <property name="shortcut" >
-    <string>Ctrl+S</string>
-   </property>
-  </action>
-  <action name="actionSave_Source_File_As" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/document-save-as.png</normaloff>:/mainWindow/document-save-as.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Save Source File As</string>
-   </property>
-   <property name="statusTip" >
-    <string>Opens a file dialog to save the currently shown source code.</string>
-   </property>
-   <property name="shortcut" >
-    <string>Ctrl+Shift+S</string>
-   </property>
-  </action>
-  <action name="actionAbout_UniversalIndentGUI" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/info.png</normaloff>:/mainWindow/info.png</iconset>
-   </property>
-   <property name="text" >
-    <string>About UniversalIndentGUI</string>
-   </property>
-   <property name="statusTip" >
-    <string>Shows info about UniversalIndentGUI.</string>
-   </property>
-  </action>
-  <action name="actionExit" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/system-log-out.png</normaloff>:/mainWindow/system-log-out.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Exit</string>
-   </property>
-   <property name="statusTip" >
-    <string>Quits the UniversalIndentGUI.</string>
-   </property>
-   <property name="shortcut" >
-    <string>Ctrl+Q</string>
-   </property>
-  </action>
-  <action name="actionExportPDF" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/exportpdf.png</normaloff>:/mainWindow/exportpdf.png</iconset>
-   </property>
-   <property name="text" >
-    <string>PDF</string>
-   </property>
-   <property name="statusTip" >
-    <string>Export the currently visible source code as PDF document</string>
-   </property>
-  </action>
-  <action name="actionExportHTML" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/exporthtml.png</normaloff>:/mainWindow/exporthtml.png</iconset>
-   </property>
-   <property name="text" >
-    <string>HTML</string>
-   </property>
-   <property name="statusTip" >
-    <string>Export the currently visible source code as HTML document</string>
-   </property>
-  </action>
-  <action name="indenterParameterTooltipsEnabledAction" >
-   <property name="checkable" >
-    <bool>true</bool>
-   </property>
-   <property name="checked" >
-    <bool>true</bool>
-   </property>
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/tooltip.png</normaloff>:/mainWindow/tooltip.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Parameter Tooltips</string>
-   </property>
-   <property name="statusTip" >
-    <string>If checked, tool tips will show up if the mouse cursor remains over an indenter parameter for a while.</string>
-   </property>
-   <property name="connectedSettingName" stdset="0" >
-    <string>DONOTTRANSLATE:IndenterParameterTooltipsEnabled</string>
-   </property>
-  </action>
-  <action name="actionLive_Indent_Preview" >
-   <property name="checkable" >
-    <bool>true</bool>
-   </property>
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/live-preview.png</normaloff>:/mainWindow/live-preview.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Live Indent Preview</string>
-   </property>
-   <property name="shortcut" >
-    <string>Ctrl+L</string>
-   </property>
-   <property name="visible" >
-    <bool>false</bool>
-   </property>
-  </action>
-  <action name="enableSyntaxHighlightningAction" >
-   <property name="checkable" >
-    <bool>true</bool>
-   </property>
-   <property name="checked" >
-    <bool>true</bool>
-   </property>
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/syntax-highlight.png</normaloff>:/mainWindow/syntax-highlight.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Syntax Highlighting</string>
-   </property>
-   <property name="iconText" >
-    <string>Syntax Highlighting</string>
-   </property>
-   <property name="toolTip" >
-    <string>Enables or disables syntax highlighting for the source code.</string>
-   </property>
-   <property name="statusTip" >
-    <string>By enabling special key words of the source code are highlighted.</string>
-   </property>
-   <property name="shortcut" >
-    <string>Ctrl+H</string>
-   </property>
-   <property name="connectedSettingName" stdset="0" >
-    <string>DONOTTRANSLATE:SyntaxHighlightningEnabled</string>
-   </property>
-  </action>
-  <action name="whiteSpaceIsVisibleAction" >
-   <property name="checkable" >
-    <bool>true</bool>
-   </property>
-   <property name="text" >
-    <string>White Space Visible</string>
-   </property>
-   <property name="iconText" >
-    <string>White Space Visible</string>
-   </property>
-   <property name="toolTip" >
-    <string>Set white space visible</string>
-   </property>
-   <property name="statusTip" >
-    <string>Enables or disables diplaying of white space characters in the editor.</string>
-   </property>
-   <property name="visible" >
-    <bool>false</bool>
-   </property>
-   <property name="connectedSettingName" stdset="0" >
-    <string>DONOTTRANSLATE:WhiteSpaceIsVisible</string>
-   </property>
-  </action>
-  <action name="loadLastOpenedFileOnStartupAction" >
-   <property name="checkable" >
-    <bool>true</bool>
-   </property>
-   <property name="checked" >
-    <bool>true</bool>
-   </property>
-   <property name="text" >
-    <string>Auto Open Last File</string>
-   </property>
-   <property name="toolTip" >
-    <string>Auto open last source file on startup</string>
-   </property>
-   <property name="statusTip" >
-    <string>If selected opens last source code file on startup</string>
-   </property>
-   <property name="visible" >
-    <bool>false</bool>
-   </property>
-   <property name="connectedSettingName" stdset="0" >
-    <string>DONOTTRANSLATE:LoadLastOpenedFileOnStartup</string>
-   </property>
-  </action>
-  <action name="actionShowSettings" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/preferences-system.png</normaloff>:/mainWindow/preferences-system.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Settings</string>
-   </property>
-   <property name="iconText" >
-    <string>Settings</string>
-   </property>
-   <property name="toolTip" >
-    <string>Opens the settings dialog</string>
-   </property>
-   <property name="statusTip" >
-    <string>Opens the settings dialog, to set language etc.</string>
-   </property>
-  </action>
-  <action name="actionCheck_for_update" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/system-software-update.png</normaloff>:/mainWindow/system-software-update.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Check for update</string>
-   </property>
-   <property name="toolTip" >
-    <string>Checks online whether a new version of UniversalIndentGUI is available.</string>
-   </property>
-   <property name="statusTip" >
-    <string>Checks online whether a new version of UniversalIndentGUI is available.</string>
-   </property>
-  </action>
-  <action name="actionClear_Recently_Opened_List" >
-   <property name="icon" >
-    <iconset resource="../resources/Icons.qrc" >
-     <normaloff>:/mainWindow/edit-clear.png</normaloff>:/mainWindow/edit-clear.png</iconset>
-   </property>
-   <property name="text" >
-    <string>Clear Recently Opened List</string>
-   </property>
-  </action>
- </widget>
- <resources>
-  <include location="../resources/Icons.qrc" />
- </resources>
- <connections>
-  <connection>
-   <sender>actionExit</sender>
-   <signal>triggered()</signal>
-   <receiver>MainWindowUi</receiver>
-   <slot>close()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>-1</x>
-     <y>-1</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>399</x>
-     <y>299</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
--- a/src/templateBatchScript.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#include "templateBatchScript.h"
-
-// Need to include QObject here so that platform specific defines like Q_OS_WIN32 are set.
-#include <QObject>
-
-/*!
-    \brief The only and static function of this class returns a batch or shell script
-    as string that can be used to call an indenter with the current settings from
-    the command line.
-
-    The returned string contains some placeholders where the indenter name needs to
-    be filled in. The placeholders are "__INDENTERCALLSTRING1__" that should be replaced
-    by the indenter call string that indents a complete directory.
-    "__INDENTERCALLSTRING2__" the call string for indenting only one file.
-    And "__INDENTERCALLSTRINGSCRIPTNAME__" which is only the shown name of the indenter.
- */
-const char* TemplateBatchScript::getTemplateBatchScript() {
-    static const char* templateBatchScript =
-#if defined(Q_OS_WIN32)
-        "@echo off\n"
-        "\n"
-        "IF (%1)==() GOTO error\n"
-        "dir /b /ad %1 >nul 2>nul && GOTO indentDir\n"
-        "IF NOT EXIST %1 GOTO error\n"
-        "goto indentFile\n"
-        "\n"
-        ":indentDir\n"
-        "set searchdir=%1\n"
-        "\n"
-        "IF (%2)==() GOTO assignDefaultSuffix\n"
-        "set filesuffix=%2\n"
-        "\n"
-        "GOTO run\n"
-        "\n"
-        ":assignDefaultSuffix\n"
-        "::echo !!!!DEFAULT SUFFIX!!!\n"
-        "set filesuffix=*\n"
-        "\n"
-        ":run\n"
-        "FOR /F \"tokens=*\" %%G IN ('DIR /B /S %searchdir%\\*.%filesuffix%') DO (\n"
-        "echo Indenting file \"%%G\"\n"
-        "__INDENTERCALLSTRING1__\n"
-        ")\n"
-        "GOTO ende\n"
-        "\n"
-        ":indentFile\n"
-        "echo Indenting one file %1\n"
-        "__INDENTERCALLSTRING2__\n"
-        "\n"
-        "GOTO ende\n"
-        "\n"
-        ":error\n"
-        "echo .\n"
-        "echo ERROR: As parameter given directory or file does not exist!\n"
-        "echo Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ dirname filesuffix\n"
-        "echo Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ filename\n"
-        "echo Example: __INDENTERCALLSTRINGSCRIPTNAME__ temp cpp\n"
-        "echo .\n"
-        "\n"
-        ":ende\n";
-
-#else
-
-        "#!/bin/sh \n"
-        "\n"
-        "if [ ! -n \"$1\" ]; then\n"
-        "echo \"Syntax is: recurse.sh dirname filesuffix\"\n"
-        "echo \"Syntax is: recurse.sh filename\"\n"
-        "echo \"Example: recurse.sh temp cpp\"\n"
-        "exit 1\n"
-        "fi\n"
-        "\n"
-        "if [ -d \"$1\" ]; then\n"
-        "#echo \"Dir ${1} exists\"\n"
-        "if [ -n \"$2\" ]; then\n"
-        "filesuffix=$2\n"
-        "else\n"
-        "filesuffix=\"*\"\n"
-        "fi\n"
-        "\n"
-        "#echo \"Filtering files using suffix ${filesuffix}\"\n"
-        "\n"
-        "file_list=`find ${1} -name \"*.${filesuffix}\" -type f`\n"
-        "for file2indent in $file_list\n"
-        "do \n"
-        "echo \"Indenting file $file2indent\"\n"
-        "__INDENTERCALLSTRING1__\n"
-        "done\n"
-        "else\n"
-        "if [ -f \"$1\" ]; then\n"
-        "echo \"Indenting one file $1\"\n"
-        "__INDENTERCALLSTRING2__\n"
-        "else\n"
-        "echo \"ERROR: As parameter given directory or file does not exist!\"\n"
-        "echo \"Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ dirname filesuffix\"\n"
-        "echo \"Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ filename\"\n"
-        "echo \"Example: __INDENTERCALLSTRINGSCRIPTNAME__ temp cpp\"\n"
-        "exit 1\n"
-        "fi\n"
-        "fi\n";
-#endif // #if defined(Q_OS_WIN32)
-    return templateBatchScript;
-}
-
-
-/* Here comes the original batch script without the c++ markup
-@echo off
-
-IF (%1)==() GOTO error
-dir /b /ad %1 >nul 2>nul && GOTO indentDir
-IF NOT EXIST %1 GOTO error
-goto indentFile
-
-:indentDir
-set searchdir=%1
-
-IF (%2)==() GOTO assignDefaultSuffix
-set filesuffix=%2
-
-GOTO run
-
-:assignDefaultSuffix
-::echo !!!!DEFAULT SUFFIX!!!
-set filesuffix=*
-
-:run
-FOR /F "tokens=*" %%G IN ('DIR /B /S %searchdir%\*.%filesuffix%') DO (
-    echo Indenting file "%%G"
-    ::call call_CSSTidy.bat "%%G"
-    "C:/Dokumente und Einstellungen/ts/Eigene Dateien/Visual Studio 2005/Projects/UiGuixy/indenters/csstidy.exe" "%%G" --timestamp=true --allow_html_in_templates=false --compress_colors=true --compress_font=true --lowercase_s=false --preserve_css=false --remove_last_;=false --remove_bslash=true --sort_properties=false --sort_selectors=false  indentoutput.css
-    move /Y indentoutput.css "%%G"
-)
-GOTO ende
-
-:indentFile
-echo Indenting one file %1
-"C:/Dokumente und Einstellungen/ts/Eigene Dateien/Visual Studio 2005/Projects/UiGuixy/indenters/csstidy.exe" %1 --timestamp=true --allow_html_in_templates=false --compress_colors=true --compress_font=true --lowercase_s=false --preserve_css=false --remove_last_;=false --remove_bslash=true --sort_properties=false --sort_selectors=false  indentoutput.css
-move /Y indentoutput.css %1
-
-GOTO ende
-
-:error
-echo .
-echo ERROR: As parameter given directory or file does not exist!
-echo Syntax is: recurse.bat dirname filesuffix
-echo Syntax is: recurse.bat filename
-echo Example: recurse.bat temp cpp
-echo .
-
-:ende
-
-*/
--- a/src/templateBatchScript.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#ifndef TEMPLATEBATCHSCRIPT_H
-#define TEMPLATEBATCHSCRIPT_H
-
-class TemplateBatchScript
-{
-private:
-    TemplateBatchScript();
-public:
-    static const char* getTemplateBatchScript();
-};
-
-#endif // TEMPLATEBATCHSCRIPT_H
--- a/src/toolBarWidget.ui	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-<ui version="4.0" >
- <class>toolBarWidget</class>
- <widget class="QWidget" name="toolBarWidget" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>775</width>
-    <height>32</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Form</string>
-  </property>
-  <layout class="QHBoxLayout" >
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <property name="margin" >
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QPushButton" name="pbOpen_Source_File" >
-     <property name="toolTip" >
-      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:8pt;">Opens a dialog for selecting a source code file.&lt;/span>&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;">This file will be used to show what the indent tool changes.&lt;/p>&lt;/body>&lt;/html></string>
-     </property>
-     <property name="text" >
-      <string> Open Source File </string>
-     </property>
-     <property name="icon" >
-      <iconset resource="../resources/Icons.qrc" >
-       <normaloff>:/mainWindow/document-open.png</normaloff>:/mainWindow/document-open.png</iconset>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QCheckBox" name="cbLivePreview" >
-     <property name="toolTip" >
-      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:MS Shell Dlg; font-size:8pt;">Turns the preview of the reformatted source code on and off.&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:MS Shell Dlg; font-size:8pt;">In other words it switches between formatted and nonformatted code. (Ctrl+L)&lt;/p>&lt;/body>&lt;/html></string>
-     </property>
-     <property name="text" >
-      <string>Live Indent Preview</string>
-     </property>
-     <property name="icon" >
-      <iconset resource="../resources/Icons.qrc" >
-       <normaloff>:/mainWindow/live-preview.png</normaloff>:/mainWindow/live-preview.png</iconset>
-     </property>
-     <property name="shortcut" >
-      <string>Ctrl+L</string>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QCheckBox" name="enableSyntaxHighlightningCheckBox" >
-     <property name="toolTip" >
-      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:MS Shell Dlg; font-size:8pt;">Enables and disables the highlightning of the source&lt;/p>&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:MS Shell Dlg; font-size:8pt;">code shown below. (Still needs some performance improvements) (Ctrl+H)&lt;/p>&lt;/body>&lt;/html></string>
-     </property>
-     <property name="text" >
-      <string>Syntax Highlight</string>
-     </property>
-     <property name="icon" >
-      <iconset resource="../resources/Icons.qrc" >
-       <normaloff>:/mainWindow/syntax-highlight.png</normaloff>:/mainWindow/syntax-highlight.png</iconset>
-     </property>
-     <property name="shortcut" >
-      <string>Ctrl+H</string>
-     </property>
-     <property name="checked" >
-      <bool>true</bool>
-     </property>
-     <property name="connectedSettingName" stdset="0" >
-      <string>DONOTTRANSLATE:SyntaxHighlightningEnabled</string>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0" >
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <widget class="QPushButton" name="pbAbout" >
-     <property name="toolTip" >
-      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Shows info about UniversalIndentGUI&lt;/p>&lt;/body>&lt;/html></string>
-     </property>
-     <property name="text" >
-      <string>About</string>
-     </property>
-     <property name="icon" >
-      <iconset resource="../resources/Icons.qrc" >
-       <normaloff>:/mainWindow/info.png</normaloff>:/mainWindow/info.png</iconset>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QPushButton" name="pbExit" >
-     <property name="toolTip" >
-      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;/head>&lt;body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;">&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Quits the UniversalIndentGUI&lt;/p>&lt;/body>&lt;/html></string>
-     </property>
-     <property name="text" >
-      <string>Exit</string>
-     </property>
-     <property name="icon" >
-      <iconset resource="../resources/Icons.qrc" >
-       <normaloff>:/mainWindow/system-log-out.png</normaloff>:/mainWindow/system-log-out.png</iconset>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../resources/Icons.qrc" />
- </resources>
- <connections/>
-</ui>
--- a/src/uiguiIniFileParser.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#include "uiguiIniFileParser.h"
-
-#include <QTextStream>
-
-//! \defgroup grp_Settings All concerning applications settings.
-
-/*!
-    \class UiguiIniFileParser
-    \ingroup grp_Settings
-    \brief UiguiIniFileParser is a simple ini file format parser.
-
-    These ini files need to have key-value pairs in the style
-    "keyname=keyvalue". Groups can be defined by writing the groupname
-    in the style [groupname] before some key-value pairs.
-
-    The reason why I use my own class instead of QSettings is mainly, that
-    QSettings always internally sorts the groups alphabetically and also
-    rewrites a settings file sorted. Very annoying for me.
-*/
-
-/*!
-    \brief Init and empty all needed lists and strings.
- */
-UiguiIniFileParser::UiguiIniFileParser(void) {
-    sections.clear();
-    keyValueMap.clear();
-    iniFileName = "";
-}
-
-
-/*!
-    \brief Directly loads and parses the file with name \a iniFileName.
- */
-UiguiIniFileParser::UiguiIniFileParser(const QString &iniFileName) {
-    UiguiIniFileParser::UiguiIniFileParser();
-    this->iniFileName = iniFileName;
-    parseIniFile();
-}
-
-
-UiguiIniFileParser::~UiguiIniFileParser(void) {
-}
-
-
-/*!
-    \brief Returns the group/section names in the same order as they occurr in the ini file as QStringList.
- */
-QStringList UiguiIniFileParser::childGroups() {
-    QStringList sectionsStringList;
-
-    for( unsigned int i = 0; i < sections.size(); i++ ) {
-        sectionsStringList << sections[i];
-    }
-
-    return sectionsStringList;
-}
-
-
-/*!
-    \brief Returns the value of the defined \a keyName as QVariant.
-
-    The \a keyName is assembled by a section name, a slash and the key name itself.
-    For example if you wish to access the value of the following setting:
-    <code>[NiceSection]</br>niceKeyName=2</code> you would have to call
-    value("NiceSection/niceKeyName").
- */
-QVariant UiguiIniFileParser::value(const QString &keyName, const QString &defaultValue) {
-    return keyValueMap.value( keyName, defaultValue );
-}
-
-
-/*!
-    \brief Parses the ini file and stores the key value pairs in the internal vectors \a keys and \a values.
- */
-void UiguiIniFileParser::parseIniFile() {
-    QFile iniFile(iniFileName);
-
-    if ( iniFile.open(QFile::ReadOnly) ) {
-        // Clear the vectors holding the keys and values.
-        sections.clear();
-        keyValueMap.clear();
-
-        QTextStream iniFileStream( &iniFile );
-        QString line;
-        QString currentSectionName = "";
-        QString keyName = "";
-        QString valueAsString = "";
-
-        while ( !iniFileStream.atEnd() ) {
-            line = iniFileStream.readLine().trimmed();
-
-            // Test if the read line is a section name and if so remeber it.
-            if ( line.startsWith("[") && line.endsWith("]") ) {
-                currentSectionName = line.remove(0, 1);
-                currentSectionName.chop(1);
-
-                // Store the section name.
-                sections.push_back( currentSectionName );
-            }
-            // Otherwise test whether the line has a assign char
-            else if ( line.contains("=") ) {
-                int indexOfFirstAssign = line.indexOf("=");
-                keyName = line.left(indexOfFirstAssign);
-
-                if ( !keyName.isEmpty() ) {
-                    valueAsString = line.remove(0, indexOfFirstAssign+1);
-                    // Remove any existing double quotes from the value.
-                    if ( valueAsString.startsWith("\"") && valueAsString.endsWith("\"") ) {
-                        valueAsString = valueAsString.remove(0, 1);
-                        valueAsString.chop(1);
-                    }
-
-                    // Prepend an eventually section name to the key name.
-                    if ( !currentSectionName.isEmpty() ) {
-                        keyName = currentSectionName + "/" + keyName;
-                    }
-
-                    // Store the key and value in the map.
-                    keyValueMap.insert(keyName, valueAsString );
-                }
-            }
-        }
-    }
-}
--- a/src/uiguiIniFileParser.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#ifndef UIGUIINIFILEPARSER_H
-#define UIGUIINIFILEPARSER_H
-
-#include <QFile>
-#include <QString>
-#include <QMap>
-#include <QVariant>
-#include <QStringList>
-#include <vector>
-
-/*!
-    \class UiguiIniFileParser
-    \brief This class can be used to parse and access the contents of well formed ini files, but only readable.
- */
-
-class UiguiIniFileParser
-{
-public:
-    UiguiIniFileParser(void);
-    UiguiIniFileParser(const QString &iniFileName);
-    ~UiguiIniFileParser(void);
-    QVariant value(const QString &keyName, const QString &defaultValue="");
-    QStringList childGroups();
-
-private:
-    void parseIniFile();
-
-    QString iniFileName;
-    std::vector<QString> sections;
-    QMap<QString, QVariant> keyValueMap;
-};
-
-#endif // UIGUIINIFILEPARSER_H
--- a/src/uiguierrormessage.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#include "uiguierrormessage.h"
-
-/*!
-    \class UiguiErrorMessage
-    \ingroup grp_Dialogs
-    \brief UiguiErrorMessage is a child of QErrorMessage. But QErrorMessages
-    "Do not show again" didn't work with my strings, so this is my own, working
-    implementation of it.
-*/
-
-
-/*!
-    \brief Initializes the dialog.
-
-    Retrieves the object pointer to the \a showAgainCheckBox check box, sets the dialogs
-    modality and for a working translation sets the check box text.
- */
-UiguiErrorMessage::UiguiErrorMessage(QWidget *parent) : QErrorMessage(parent) {
-    showAgainCheckBox = findChild<QCheckBox *>();
-    setWindowModality( Qt::ApplicationModal );
-    showAgainCheckBox->setText( tr("Show this message again") );
-}
-
-
-/*!
-    \brief Just a lazy nothin doin destructive destructor.
- */
-UiguiErrorMessage::~UiguiErrorMessage(void) {
-}
-
-
-/*!
-    \brief Shows an error \a message in a dialog box with \a title.
-
-    The shown \a message is added to a list, if not already in there. If it is
-    already in that list and "Show this message again" is not checked, that
-    message will not be shown.
- */
-void UiguiErrorMessage::showMessage( const QString &title, const QString &message ) {
-    bool showAgain = true;
-
-    if ( showAgainCheckBox != 0 ) {
-        showAgain = showAgainCheckBox->isChecked();
-    }
-
-    setWindowTitle(title);
-
-    if ( !errorMessageList.contains(message) ) {
-        errorMessageList << message;
-        if ( showAgainCheckBox != 0 ) {
-            showAgainCheckBox->setChecked(true);
-        }
-        QErrorMessage::showMessage( message );
-    }
-    else if ( showAgain ) {
-        QErrorMessage::showMessage( message );
-    }
-}
-
-
-/*!
-    \brief For convinience, for showing a dialog box with the default title "UniversalIndentGUI".
- */
-void UiguiErrorMessage::showMessage( const QString &message ) {
-    showMessage( "UniversalIndentGUI", message );
-}
--- a/src/uiguierrormessage.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#ifndef UIGUIERRORMESSAGE_H
-#define UIGUIERRORMESSAGE_H
-
-#include <QErrorMessage>
-#include <QCheckBox>
-
-class UiguiErrorMessage : public QErrorMessage
-{
-    Q_OBJECT
-
-public:
-    UiguiErrorMessage(QWidget *parent = 0);
-    ~UiguiErrorMessage(void);
-    void showMessage( const QString &message );
-    void showMessage( const QString &title, const QString &message );
-
-private:
-    QCheckBox *showAgainCheckBox;
-    QStringList errorMessageList;
-};
-
-#endif // UIGUIERRORMESSAGE_H
--- a/src/uiguisettings.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,384 +0,0 @@
-/***************************************************************************
-*   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
-*   thomas-schweitzer(at)arcor.de                                         *
-*                                                                         *
-*   This program is free software; you can redistribute it and/or modify  *
-*   it under the terms of the GNU General Public License version 2.0 as   *
-*   published by the Free Software Foundation.                            *
-*                                                                         *
-*   This program is distributed in the hope that it will be useful,       *
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
-*   GNU General Public License for more details.                          *
-*                                                                         *
-*   You should have received a copy of the GNU General Public License     *
-*   along with this program in the file LICENSE.GPL; if not, write to the *
-*   Free Software Foundation, Inc.,                                       *
-*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
-***************************************************************************/
-
-#include "uiguisettings.h"
-
-#include "SettingsPaths.h"
-
-//! \defgroup grp_Settings All concerning the settings.
-
-/*!
-    \class UiguiSettings
-    \ingroup grp_Settings
-    \brief Handles the settings of the program. Reads them on startup and saves them on exit.
-    Is a singleton class and can only be accessed via getInstance().
-*/
-
-// Inits the single class instance pointer.
-UiguiSettings* UiguiSettings::instance = NULL;
-
-/*!
-    \brief The constructor for the settings.
-*/
-UiguiSettings::UiguiSettings() : QObject() {
-    // Create the main application settings object from the UniversalIndentGUI.ini file.
-    qsettings = new QSettings(SettingsPaths::getSettingsPath() + "/UniversalIndentGUI.ini", QSettings::IniFormat, this);
-
-    indenterDirctoryStr = SettingsPaths::getGlobalFilesPath() + "/indenters";
-    readAvailableTranslations();
-    loadSettings();
-}
-
-
-/*!
-    \brief Returns the instance of the settings class. If no instance exists, ONE will be created.
- */
-UiguiSettings* UiguiSettings::getInstance() {
-    if ( instance == NULL ) {
-        // Create the settings object, which loads all UiGui settings from a file.
-        instance = new UiguiSettings();
-    }
-
-    return instance;
-}
-
-
-void UiguiSettings::deleteInstance() {
-    if ( instance != NULL ) {
-        delete instance;
-        instance = NULL;
-    }
-}
-
-
-/*!
-    \brief The destructor saves the settings to a file.
- */
-UiguiSettings::~UiguiSettings() {
-    saveSettings();
-}
-
-
-/*!
-    \brief Scans the translations directory for available translation files and
-    stores them in the QList \a availableTranslations.
- */
-void UiguiSettings::readAvailableTranslations() {
-    QString languageShort;
-    QStringList languageFileList;
-
-    // English is the default language. A translation file does not exist but to have a menu entry, added here.
-    languageFileList << "universalindent_en.qm";
-
-    // Find all translation files in the "translations" directory.
-    QDir translationDirectory = QDir( SettingsPaths::getGlobalFilesPath() + "/translations" );
-    languageFileList << translationDirectory.entryList( QStringList("universalindent_*.qm") );
-
-    // Loop for each found translation file
-    foreach ( languageShort, languageFileList ) {
-        // Remove the leading string "universalindent_" from the filename.
-        languageShort.remove(0,16);
-        // Remove trailing file extension ".qm".
-        languageShort.chop(3);
-
-        availableTranslations.append(languageShort);
-    }
-}
-
-
-/*!
-    \brief Returns a list of the mnemonics of the available translations.
- */
-QStringList UiguiSettings::getAvailableTranslations() {
-    return availableTranslations;
-}
-
-
-/*!
-    \brief Extern widgets can connect to this slot to change settings.
-
-    According to the objects property "connectedSettingName" the corresponding
-    setting is known and set.
- */
-void UiguiSettings::handleValueChangeFromExtern(int value) {
-    if ( sender() ) {
-        // Get the corresponding setting name from the sender objects property and remove "DONOTTRANSLATE:" from its beginning..
-        QString settingName = sender()->property("connectedSettingName").toString().remove(0, 15);
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = sender()->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Set the value of the setting to the objects value.
-        setValueByName( settingName, value );
-    }
-}
-
-
-/*!
-    \brief Extern widgets can connect to this slot to change settings.
-
-    According to the objects property "connectedSettingName" the corresponding
-    setting is known and set.
- */
-void UiguiSettings::handleValueChangeFromExtern(bool value) {
-    if ( sender() ) {
-        // Get the corresponding setting name from the sender objects property and remove "DONOTTRANSLATE:" from its beginning.
-        QString settingName = sender()->property("connectedSettingName").toString().remove(0, 15);
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = sender()->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Set the value of the setting to the objects value.
-        setValueByName( settingName, value );
-    }
-}
-
-
-/*!
-    \brief Extern widgets can connect to this slot to change settings.
-
-    According to the objects property "connectedSettingName" the corresponding
-    setting is known and set.
- */
-void UiguiSettings::handleValueChangeFromExtern(QDate value) {
-    if ( sender() ) {
-        // Get the corresponding setting name from the sender objects property and remove "DONOTTRANSLATE:" from its beginning.
-        QString settingName = sender()->property("connectedSettingName").toString().remove(0, 15);
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = sender()->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Set the value of the setting to the objects value.
-        setValueByName( settingName, value );
-    }
-}
-
-
-/*!
-    \brief Extern widgets can connect to this slot to change settings.
-
-    According to the objects property "connectedSettingName" the corresponding
-    setting is known and set.
- */
-void UiguiSettings::handleValueChangeFromExtern(QByteArray value) {
-    if ( sender() ) {
-        // Get the corresponding setting name from the sender objects property.
-        QString settingName = sender()->property("connectedSettingName").toString();
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = sender()->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Set the value of the setting to the objects value.
-        setValueByName( settingName, value );
-    }
-}
-
-
-/*!
-    \brief Sets the value of the by \a settingsName defined setting to the value \a value.
-
-    The to \a settingsName corresponding signal is emitted, if the value has changed.
- */
-bool UiguiSettings::setValueByName(QString settingName, QVariant value) {
-    // Test if the named setting really exists.
-    if ( settings.contains(settingName) ) {
-        // Test if the new value is different to the one before.
-        if ( settings[settingName] != value ) {
-            // Set the new value.
-            settings[settingName] = value;
-            // Emit the signal for the changed setting.
-            emitSignalForSetting(settingName);
-        }
-        return true;
-    }
-    return false;
-}
-
-
-/*!
-    \brief Emits the correct signal for the given \a settingName.
-
-    If \a settingName equals "all", all signals are emitted. This can be used to update all
-    dependent widgets. \a value is the new value that is emitted along with the signal.
- */
-void UiguiSettings::emitSignalForSetting(QString settingName) {
-    // Emit the signal for the changed value.
-    if ( settingName == "VersionInSettingsFile" ) emit versionInSettingsFile( settings[settingName].toString() );
-    else if ( settingName == "WindowIsMaximized" ) emit windowIsMaximized( settings[settingName].toBool() );
-    else if ( settingName == "WindowPosition" ) emit windowPosition( settings[settingName].toPoint() );
-    else if ( settingName == "WindowSize" ) emit windowSize( settings[settingName].toSize() );
-    else if ( settingName == "FileEncoding" ) emit fileEncoding( settings[settingName].toString() );
-    else if ( settingName == "RecentlyOpenedListSize" ) emit recentlyOpenedListSize( settings[settingName].toInt() );
-    else if ( settingName == "LoadLastOpenedFileOnStartup" ) emit loadLastOpenedFileOnStartup( settings[settingName].toBool() );
-    else if ( settingName == "LastOpenedFiles" ) emit lastOpenedFiles( settings[settingName].toString() );
-    else if ( settingName == "SelectedIndenter" ) emit selectedIndenter( settings[settingName].toInt() );
-    else if ( settingName == "SyntaxHighlightningEnabled" ) emit syntaxHighlightningEnabled( settings[settingName].toBool() );
-    else if ( settingName == "WhiteSpaceIsVisible" ) emit whiteSpaceIsVisible( settings[settingName].toBool() );
-    else if ( settingName == "IndenterParameterTooltipsEnabled" ) emit indenterParameterTooltipsEnabled( settings[settingName].toBool() );
-    else if ( settingName == "TabWidth" ) emit tabWidth( settings[settingName].toInt() );
-    else if ( settingName == "Language" ) emit language( settings[settingName].toInt() );
-    else if ( settingName == "CheckForUpdate" ) emit checkForUpdate( settings[settingName].toBool() );
-    else if ( settingName == "LastUpdateCheck" ) emit lastUpdateCheck( settings[settingName].toDate() );
-    else if ( settingName == "MainWindowState" ) emit mainWindowState( settings[settingName].toByteArray() );
-    else if ( settingName == "all" ) {
-        emit versionInSettingsFile( settings["VersionInSettingsFile"].toString() );
-        emit windowIsMaximized( settings["WindowIsMaximized"].toBool() );
-        emit windowPosition( settings["WindowPosition"].toPoint() );
-        emit windowSize( settings["WindowSize"].toSize() );
-        emit fileEncoding( settings["FileEncoding"].toString() );
-        emit recentlyOpenedListSize( settings["RecentlyOpenedListSize"].toInt() );
-        emit loadLastOpenedFileOnStartup( settings["LoadLastOpenedFileOnStartup"].toBool() );
-        emit lastOpenedFiles( settings["LastOpenedFiles"].toString() );
-        emit selectedIndenter( settings["SelectedIndenter"].toInt() );
-        emit syntaxHighlightningEnabled( settings["SyntaxHighlightningEnabled"].toBool() );
-        emit whiteSpaceIsVisible( settings["WhiteSpaceIsVisible"].toBool() );
-        emit indenterParameterTooltipsEnabled( settings["IndenterParameterTooltipsEnabled"].toBool() );
-        emit tabWidth( settings["TabWidth"].toInt() );
-        emit language( settings["Language"].toInt() );
-        emit checkForUpdate( settings["CheckForUpdate"].toBool() );
-        emit lastUpdateCheck( settings["LastUpdateCheck"].toDate() );
-        emit mainWindowState( settings["MainWindowState"].toByteArray() );
-    }
-}
-
-
-/*!
-    \brief Calls \sa emitSignalForSetting with settingName "all" to update all widgets or whatever
-    is connected to each setting.
- */
-void UiguiSettings::updateAllDependend() {
-    emitSignalForSetting("all");
-}
-
-
-/*!
-    \brief Returns the value of the by \a settingsName defined setting as QVariant.
-
-    If the named setting does not exist, 0 is being returned.
-*/
-QVariant UiguiSettings::getValueByName(QString settingName) {
-    // Test if the named setting really exists.
-    if ( settings.contains(settingName) ) {
-        return settings[settingName];
-    }
-    return QVariant(0);
-}
-
-
-/*!
-    \brief Loads the settings for the main application.
-
-    Settings are for example last selected indenter, last loaded source code file and so on.
-*/
-bool UiguiSettings::loadSettings() {
-    // Read the version string saved in the settings file.
-    settings["VersionInSettingsFile"] = qsettings->value("UniversalIndentGUI/version", "").toString();
-
-    // Read windows last size and position from the settings file.
-    settings["WindowIsMaximized"] = qsettings->value("UniversalIndentGUI/maximized", false).toBool();
-    settings["WindowPosition"] = qsettings->value("UniversalIndentGUI/position", QPoint(50, 50)).toPoint();
-    settings["WindowSize"] = qsettings->value("UniversalIndentGUI/size", QSize(800, 600)).toSize();
-
-    // Read last selected encoding for the opened source code file.
-    settings["FileEncoding"] = qsettings->value("UniversalIndentGUI/encoding", "UTF-8").toString();
-
-    // Read maximum length of list for recently opened files.
-    settings["RecentlyOpenedListSize"] = qsettings->value("UniversalIndentGUI/recentlyOpenedListSize", 5).toInt();
-
-    // Read if last opened source code file should be loaded on startup.
-    settings["LoadLastOpenedFileOnStartup"] = qsettings->value("UniversalIndentGUI/loadLastSourceCodeFileOnStartup", true).toBool();
-
-    // Read last opened source code file from the settings file.
-    settings["LastOpenedFiles"] = qsettings->value("UniversalIndentGUI/lastSourceCodeFile", indenterDirctoryStr+"/example.cpp").toString();
-
-    // Read last selected indenter from the settings file.
-    int SelectedIndenter = qsettings->value("UniversalIndentGUI/selectedIndenter", 0).toInt();
-    if ( SelectedIndenter < 0 ) {
-        SelectedIndenter = 0;
-    }
-    settings["SelectedIndenter"] = SelectedIndenter;
-
-    // Read if syntax highlighting is enabled.
-    settings["SyntaxHighlightningEnabled"] = qsettings->value("UniversalIndentGUI/SyntaxHighlightningEnabled", true).toBool();
-
-    // Read if white space characters should be displayed.
-    settings["WhiteSpaceIsVisible"] = qsettings->value("UniversalIndentGUI/whiteSpaceIsVisible", false).toBool();
-
-    // Read if indenter parameter tool tips are enabled.
-    settings["IndenterParameterTooltipsEnabled"] = qsettings->value("UniversalIndentGUI/indenterParameterTooltipsEnabled", true).toBool();
-
-    // Read the tab width from the settings file.
-    settings["TabWidth"] = qsettings->value("UniversalIndentGUI/tabWidth", 4).toInt();
-
-    // Read the last selected language and stores the index it has in the list of available translations.
-    settings["Language"] = availableTranslations.indexOf( qsettings->value("UniversalIndentGUI/language", "").toString() );
-
-    // Read the update check settings from the settings file.
-    settings["CheckForUpdate"] = qsettings->value("UniversalIndentGUI/CheckForUpdate", true).toBool();
-    settings["LastUpdateCheck"] = qsettings->value("UniversalIndentGUI/LastUpdateCheck", QDate(1900,1,1)).toDate();
-
-    // Read the main window state.
-    settings["MainWindowState"] = qsettings->value("UniversalIndentGUI/MainWindowState", QByteArray()).toByteArray();
-
-    return true;
-}
-
-
-/*!
-    \brief Saves the settings for the main application.
-
-    Settings are for example last selected indenter, last loaded source code file and so on.
-*/
-bool UiguiSettings::saveSettings() {
-    qsettings->setValue( "UniversalIndentGUI/recentlyOpenedListSize", settings["RecentlyOpenedListSize"] );
-    qsettings->setValue( "UniversalIndentGUI/lastSourceCodeFile", settings["LastOpenedFiles"] );
-    qsettings->setValue( "UniversalIndentGUI/loadLastSourceCodeFileOnStartup", settings["LoadLastOpenedFileOnStartup"] );
-    qsettings->setValue( "UniversalIndentGUI/selectedIndenter", settings["SelectedIndenter"] );
-    qsettings->setValue( "UniversalIndentGUI/indenterParameterTooltipsEnabled", settings["IndenterParameterTooltipsEnabled"] );
-    qsettings->setValue( "UniversalIndentGUI/language", availableTranslations[ settings["Language"].toInt() ] );
-    qsettings->setValue( "UniversalIndentGUI/encoding", settings["FileEncoding"] );
-    qsettings->setValue( "UniversalIndentGUI/version", settings["VersionInSettingsFile"] );
-    qsettings->setValue( "UniversalIndentGUI/maximized", settings["WindowIsMaximized"] );
-    if ( !settings["WindowIsMaximized"].toBool() ) {
-        qsettings->setValue( "UniversalIndentGUI/position", settings["WindowPosition"] );
-        qsettings->setValue( "UniversalIndentGUI/size", settings["WindowSize"] );
-    }
-    qsettings->setValue( "UniversalIndentGUI/SyntaxHighlightningEnabled", settings["SyntaxHighlightningEnabled"] );
-    qsettings->setValue( "UniversalIndentGUI/whiteSpaceIsVisible", settings["WhiteSpaceIsVisible"] );
-    qsettings->setValue( "UniversalIndentGUI/tabWidth", settings["TabWidth"] );
-    // Write the update check settings to the settings file.
-    qsettings->setValue("UniversalIndentGUI/CheckForUpdate", settings["CheckForUpdate"].toBool() );
-    qsettings->setValue("UniversalIndentGUI/LastUpdateCheck", settings["LastUpdateCheck"].toDate() );
-    // Write the main window state.
-    qsettings->setValue("UniversalIndentGUI/MainWindowState", settings["MainWindowState"].toByteArray() );
-
-    return true;
-}
--- a/src/uiguisettings.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/***************************************************************************
-*   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
-*   thomas-schweitzer(at)arcor.de                                         *
-*                                                                         *
-*   This program is free software; you can redistribute it and/or modify  *
-*   it under the terms of the GNU General Public License version 2.0 as   *
-*   published by the Free Software Foundation.                            *
-*                                                                         *
-*   This program is distributed in the hope that it will be useful,       *
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
-*   GNU General Public License for more details.                          *
-*                                                                         *
-*   You should have received a copy of the GNU General Public License     *
-*   along with this program in the file LICENSE.GPL; if not, write to the *
-*   Free Software Foundation, Inc.,                                       *
-*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
-***************************************************************************/
-
-#ifndef UIGUISETTINGS_H
-#define UIGUISETTINGS_H
-
-#include <QObject>
-#include <QString>
-#include <QSettings>
-#include <QPoint>
-#include <QSize>
-#include <QDir>
-#include <QDate>
-#include <QStringList>
-#include <QCoreApplication>
-
-class UiguiSettings : public QObject
-{
-	Q_OBJECT
-private:
-    UiguiSettings();
-    static UiguiSettings* instance;
-
-public:
-	static UiguiSettings* getInstance();
-    static void deleteInstance();
-    ~UiguiSettings();
-    bool loadSettings();
-    bool saveSettings();
-    bool setValueByName(QString settingName, QVariant value);
-	QVariant getValueByName(QString settingName);
-    void updateAllDependend();
-	QStringList getAvailableTranslations();
-
-// Only one slot per possible value type needed, because wanted setting
-// is recognized by the sender objects name.
-public slots:
-	void handleValueChangeFromExtern(int value);
-    void handleValueChangeFromExtern(bool value);
-    void handleValueChangeFromExtern(QDate value);
-    void handleValueChangeFromExtern(QByteArray value);
-
-// Each possible setting needs an own signal.
-signals:
-    void versionInSettingsFile(QString value);
-    void windowIsMaximized(bool value);
-    void windowPosition(QPoint value);
-    void windowSize(QSize value);
-    void fileEncoding(QString value);
-    void recentlyOpenedListSize(int value);
-    void loadLastOpenedFileOnStartup(bool value);
-    void lastOpenedFiles(QString value);
-    void selectedIndenter(int value);
-    void syntaxHighlightningEnabled(bool value);
-    void whiteSpaceIsVisible(bool value);
-    void indenterParameterTooltipsEnabled(bool value);
-    void tabWidth(int value);
-    void language(int value);
-    void checkForUpdate(bool value);
-    void lastUpdateCheck(QDate value);
-    void mainWindowState(QByteArray value);
-
-private:
-    void emitSignalForSetting(QString settingName);
-	void readAvailableTranslations();
-
-	//! Stores the mnemonics of the available translations.
-	QStringList availableTranslations;
-
-    //! The settings file.
-    QSettings *qsettings;
-
-	//! This map holds all possible settings defined by their name as QString. The value is of the type QVariant.
-	QMap<QString, QVariant> settings;
-
-    QString indenterDirctoryStr;
-};
-
-#endif // UIGUISETTINGS_H
--- a/src/uiguisettingsdialog.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +0,0 @@
-/***************************************************************************
-*   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
-*   thomas-schweitzer(at)arcor.de                                         *
-*                                                                         *
-*   This program is free software; you can redistribute it and/or modify  *
-*   it under the terms of the GNU General Public License version 2.0 as   *
-*   published by the Free Software Foundation.                            *
-*                                                                         *
-*   This program is distributed in the hope that it will be useful,       *
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
-*   GNU General Public License for more details.                          *
-*                                                                         *
-*   You should have received a copy of the GNU General Public License     *
-*   along with this program in the file LICENSE.GPL; if not, write to the *
-*   Free Software Foundation, Inc.,                                       *
-*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
-***************************************************************************/
-
-#include "uiguisettingsdialog.h"
-
-/*!
-    \class UiguiSettingsDialog
-    \ingroup grp_Settings
-    \brief Displays a dialog window with settings for UniversalIndentGUI
-*/
-
-/*!
-    \brief The constructor calls the setup function for the ui created by uic. and adds
-*/
-UiguiSettingsDialog::UiguiSettingsDialog(QWidget* parent, UiguiSettings* settings) : QDialog(parent) {
-    // Remember pointer to the UiguiSettings object.
-    this->settings = settings;
-
-    // Init the user interface created by the UIC.
-    setupUi(this);
-
-    //TODO: This call has to be removed when the properties for the highlighters can be set
-    // with the settings dialog.
-    groupBoxSyntaxHighlighterProperties->setToolTip( "(Will be implemented soon)" + groupBoxSyntaxHighlighterProperties->toolTip() );
-
-    // Get all check boxes that are used for settings.
-    checkBoxes = findChildren<QCheckBox*>( QRegExp("uiGui*") );
-
-    // Get all spin boxes that are used for settings.
-    spinBoxes = findChildren<QSpinBox*>( QRegExp("uiGui*") );
-
-    // Get all combo boxes that are used for settings.
-    comboBoxes = findChildren<QComboBox*>( QRegExp("uiGui*") );
-
-    // Connect the accepted signal to own function, to write values back to the UiguiSettings object.
-    connect(this, SIGNAL(accepted()), this, SLOT(writeWidgetValuesToSettings()) );
-
-    // Init the language selection combobox.
-    initTranslationSelection();
-}
-
-
-/*!
-    \brief By calling this function the combobox for selecting the application language will
-    be initialized.
-
-    Also the translation itself will be reinitialized.
- */
-void UiguiSettingsDialog::initTranslationSelection() {
-    // First empty the combo box.
-    uiGuiLanguageSelectionComboBox->clear();
-
-    // Now add an entry into the box for every language short.
-    foreach (QString languageShort, settings->getAvailableTranslations() ) {
-        // Identify the language mnemonic and set the full name.
-        if ( languageShort == "en" ) {
-            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("English") );
-        }
-        else if ( languageShort == "fr" ) {
-            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("French") );
-        }
-        else if ( languageShort == "de" ) {
-            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("German") );
-        }
-        else if ( languageShort == "zh_TW" ) {
-            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Chinese (Taiwan)") );
-        }
-        else if ( languageShort == "ja_jp" ) {
-            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Japanese") );
-        }
-        else if ( languageShort == "ru" ) {
-            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Russian") );
-        }
-        else if ( languageShort == "uk" ) {
-            uiGuiLanguageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Ukrainian") );
-        }
-
-        else {
-            uiGuiLanguageSelectionComboBox->addItem( tr("Unknown language mnemonic ") + languageShort );
-        }
-    }
-}
-
-
-/*!
-    \brief Displays the dialog by calling the dialogs exec function.
-
-    Before it gets all the values needed from the UiguiSettings object.
- */
-int UiguiSettingsDialog::showDialog() {
-    // Get the values for the check boxes from the settings object.
-    foreach (QCheckBox* checkBox, checkBoxes) {
-        // Get the corresponding setting name from the check boxs property and remove "DONOTTRANSLATE:" from its beginning.
-        QString settingName = checkBox->property("connectedSettingName").toString().remove(0, 15);
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = checkBox->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Get value from settings and assign it to the checkbox.
-        bool value = settings->getValueByName( settingName ).toBool();
-        checkBox->setChecked(value);
-    }
-
-    // Get the values for the spin boxes from the settings object.
-    foreach (QSpinBox* spinBox, spinBoxes) {
-        // Get the corresponding setting name from the spin boxs property and remove "DONOTTRANSLATE:" from its beginning.
-        QString settingName = spinBox->property("connectedSettingName").toString().remove(0, 15);
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = spinBox->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Get value from settings and assign it to the checkbox.
-        int value = settings->getValueByName( settingName ).toInt();
-        spinBox->setValue(value);
-    }
-
-    // Get the values for the combo boxes from the settings object.
-    foreach (QComboBox* comboBox, comboBoxes) {
-        // Get the corresponding setting name from the combo boxs property and remove "DONOTTRANSLATE:" from its beginning.
-        QString settingName = comboBox->property("connectedSettingName").toString().remove(0, 15);
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = comboBox->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Get value from settings and assign it to the checkbox.
-        int value = settings->getValueByName( settingName ).toInt();
-        comboBox->setCurrentIndex(value);
-    }
-
-    // Execute the dialog.
-    return exec();
-}
-
-
-/*!
-    \brief This slot is called when the dialog box is closed by pressing the Ok button.
-
-    Writes all settings to the UiguiSettings object.
- */
-void UiguiSettingsDialog::writeWidgetValuesToSettings() {
-    // Write the values of the check boxes to the settings object.
-    foreach (QCheckBox* checkBox, checkBoxes) {
-        // Get the corresponding setting name from the check boxs property and remove "DONOTTRANSLATE:" from its beginning.
-        QString settingName = checkBox->property("connectedSettingName").toString().remove(0, 15);
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = checkBox->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Write the check box value to the settings.
-        settings->setValueByName( settingName, checkBox->isChecked() );
-    }
-
-    // Write the values for the spin boxes to the settings object.
-    foreach (QSpinBox* spinBox, spinBoxes) {
-        // Get the corresponding setting name from the spin boxs property and remove "DONOTTRANSLATE:" from its beginning.
-        QString settingName = spinBox->property("connectedSettingName").toString().remove(0, 15);
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = spinBox->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Write the spin box value to the settings.
-        settings->setValueByName( settingName, spinBox->value() );
-    }
-
-    // Write the values for the spin boxes to the settings object.
-    foreach (QComboBox* comboBox, comboBoxes) {
-        // Get the corresponding setting name from the combo boxs property and remove "DONOTTRANSLATE:" from its beginning.
-        QString settingName = comboBox->property("connectedSettingName").toString().remove(0, 15);
-        // If the property is not set, try using the objects name for convenience.
-        if ( settingName.isEmpty() ) {
-            // Get the objects name and remove "uiGui" from its beginning and use that as setting name.
-            settingName = comboBox->objectName();
-            settingName.remove(0,5);
-        }
-
-        // Write the spin box value to the settings.
-        settings->setValueByName( settingName, comboBox->currentIndex() );
-    }
-}
-
-
-/*!
-    \brief Catches language change events and retranslates all needed widgets.
- */
-void UiguiSettingsDialog::changeEvent(QEvent *event) {
-    if (event->type() == QEvent::LanguageChange) {
-        retranslateUi(this);
-        // If this is not explicit set here, Qt < 4.3.0 does not translate the buttons.
-        buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
-
-        //TODO: This has to be removed when the properties for the highlighters can be set.
-        groupBoxSyntaxHighlighterProperties->setToolTip( "(Will be implemented soon)" + groupBoxSyntaxHighlighterProperties->toolTip() );
-
-        QStringList languageShortList = settings->getAvailableTranslations();
-
-        // Now retranslate every entry in the language selection box.
-        for (int i = 0; i < languageShortList.size(); i++ ) {
-            QString languageShort = languageShortList.at(i);
-
-            // Identify the language mnemonic and set the full name.
-            if ( languageShort == "en" ) {
-                uiGuiLanguageSelectionComboBox->setItemText( i, tr("English") );
-            }
-            else if ( languageShort == "fr" ) {
-                uiGuiLanguageSelectionComboBox->setItemText( i, tr("French") );
-            }
-            else if ( languageShort == "de" ) {
-                uiGuiLanguageSelectionComboBox->setItemText( i, tr("German") );
-            }
-            else if ( languageShort == "zh_TW" ) {
-                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Chinese (Taiwan)") );
-            }
-            else if ( languageShort == "ja_jp" ) {
-                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Japanese") );
-            }
-            else if ( languageShort == "ru" ) {
-                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Russian") );
-            }
-            else if ( languageShort == "uk" ) {
-                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Ukrainian") );
-            }
-            else {
-                uiGuiLanguageSelectionComboBox->setItemText( i, tr("Unknown language mnemonic ") + languageShort );
-            }
-        }
-    }
-    else {
-        QWidget::changeEvent(event);
-    }
-}
--- a/src/uiguisettingsdialog.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/***************************************************************************
-*   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
-*   thomas-schweitzer(at)arcor.de                                         *
-*                                                                         *
-*   This program is free software; you can redistribute it and/or modify  *
-*   it under the terms of the GNU General Public License version 2.0 as   *
-*   published by the Free Software Foundation.                            *
-*                                                                         *
-*   This program is distributed in the hope that it will be useful,       *
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
-*   GNU General Public License for more details.                          *
-*                                                                         *
-*   You should have received a copy of the GNU General Public License     *
-*   along with this program in the file LICENSE.GPL; if not, write to the *
-*   Free Software Foundation, Inc.,                                       *
-*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
-***************************************************************************/
-
-#ifndef UIGUISETTINGSDIALOG_H
-#define UIGUISETTINGSDIALOG_H
-
-#include <QDialog>
-#include "ui_UiGuiSettingsDialog.h"
-#include "uiguisettings.h"
-
-class UiguiSettingsDialog : public QDialog, private Ui::SettingsDialog
-{
-	Q_OBJECT
-
-public:
-	UiguiSettingsDialog(QWidget* parent, UiguiSettings* settings);
-
-public slots:
-    int showDialog();
-
-private slots:
-    void writeWidgetValuesToSettings();
-
-private:
-    void changeEvent(QEvent *event);
-	void initTranslationSelection();
-
-    UiguiSettings* settings;
-    QList<QCheckBox*> checkBoxes;
-    QList<QSpinBox*> spinBoxes;
-    QList<QComboBox*> comboBoxes;
-};
-
-#endif // UIGUISETTINGSDIALOG_H
--- a/src/updatecheckdialog.cpp	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#include "updatecheckdialog.h"
-
-#include <QRegExpValidator>
-
-/*!
-    \class UpdateCheckDialog
-    \ingroup grp_MainWindow
-    \brief UpdateCheckDialog is a dialog widget that contains functions
-    for online checking for a new version of UniversalIndentGUI.
-*/
-
-/*!
-    \brief Initializes member variables and stores the version of UiGui and a pointer to the settings object.
- */
-UpdateCheckDialog::UpdateCheckDialog(QString currentVersion, UiguiSettings *settings, QWidget *parent) : QDialog(parent) {
-    setupUi(this);
-
-    manualUpdateRequested = false;
-    roleOfClickedButton = QDialogButtonBox::InvalidRole;
-
-    // Create object for http request and connect it with the request return handler.
-    http = new QHttp(this);
-    connect( http, SIGNAL(done(bool)), this, SLOT(checkResultsOfFetchedPadXMLFile(bool)) );
-
-    // Create a timer object used for the progress bar.
-    updateCheckProgressTimer = new QTimer(this);
-    updateCheckProgressTimer->setInterval(5);
-    connect( updateCheckProgressTimer, SIGNAL(timeout()), this, SLOT(updateUpdateCheckProgressBar()) );
-    updateCheckProgressCounter = 0;
-
-    // Connect the dialogs buttonbox with a button click handler.
-    connect( buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(handleUpdateCheckDialogButtonClicked(QAbstractButton*)) );
-
-    this->currentVersion = currentVersion;
-    this->settings = settings;
-
-    // This dialog is always modal.
-    setModal(true);
-}
-
-
-/*!
-    \brief This slot should be called, if an update check is manually invoked.
-
-    In difference to the automatic update check, during manual update check request
-    a modal progress indicator dialog will be shown.
- */
-void UpdateCheckDialog::checkForUpdateAndShowDialog() {
-    manualUpdateRequested = true;
-    getPadXMLFile();
-    showCheckingForUpdateDialog();
-}
-
-
-/*!
-    \brief This slot should be called, if an update check is automatically invoked.
-
-    An automatic invoked update check should run in background, so the user
-    gets not interrupted by a dialog box.
- */
-void UpdateCheckDialog::checkForUpdate() {
-    manualUpdateRequested = false;
-    getPadXMLFile();
-}
-
-
-/*!
-    \brief This function tries to download the UniversalIndentGui pad file from the SourceForge server
- */
-void UpdateCheckDialog::getPadXMLFile() {
-    http->setHost("universalindent.sourceforge.net");
-    http->get("/universalindentgui_pad.xml");
-}
-
-
-/*!
-    \brief This slot is called after the update check has returned, either by successfully
-    retrieving the pad file, or on any kind of network error.
-
-    Shows a message if check was successful or not. Offers the user to go to the
-    download page if a newer version exists. In case of an error during update
-    check, a message box with the error will be displayed.
- */
-void UpdateCheckDialog::checkResultsOfFetchedPadXMLFile(bool errorOccurred) {
-    // Stop the progress bar timer.
-    updateCheckProgressTimer->stop();
-
-    if ( !errorOccurred ) {
-        // Try to find the version string.
-        QString returnedString = http->readAll();
-        int leftPosition = returnedString.indexOf("<Program_Version>");
-        int rightPosition = returnedString.indexOf("</Program_Version>");
-
-        // If the version string could be found in the returned string, show an update dialog and set last update check date.
-        if ( leftPosition != -1 && rightPosition != -1 ) {
-            // Get the pure version string from returned string.
-            returnedString = returnedString.mid( leftPosition+17, rightPosition-(leftPosition+17) );
-
-            // Create integer values from the version strings.
-            int versionOnServerInt = convertVersionStringToNumber( returnedString );
-            int currentVersionInt = convertVersionStringToNumber( currentVersion );
-
-            // Only show update dialog, if the current version number is lower than the one received from the server.
-            if ( versionOnServerInt > currentVersionInt && currentVersionInt >= 0 && versionOnServerInt >= 0 ) {
-                // Show message box whether to download the new version.
-                showNewVersionAvailableDialog(returnedString);
-
-                // If yes clicked, open the download url in the default browser.
-                if ( roleOfClickedButton == QDialogButtonBox::YesRole ) {
-                    QDesktopServices::openUrl( QUrl("http://sourceforge.net/project/showfiles.php?group_id=167482") );
-                }
-            }
-            else if ( manualUpdateRequested ) {
-                showNoNewVersionAvailableDialog();
-            }
-            // Set last update check date.
-            settings->setValueByName("LastUpdateCheck", QDate::currentDate());
-        }
-        // In the returned string, the version string could not be found.
-        else {
-            QMessageBox::warning(this, "Update check error", "There was an error while trying to check for an update! The retrieved file did not contain expected content." );
-        }
-    }
-    // If there was some error while trying to retrieve the update info from server and not cancel was pressed.
-    else if ( roleOfClickedButton != QDialogButtonBox::RejectRole ) {
-        QMessageBox::warning(this, "Update check error", "There was an error while trying to check for an update! Error was : " + http->errorString() );
-    }
-    manualUpdateRequested = false;
-}
-
-
-/*!
-    \brief Displays the progress bar during update check.
-
-    For displaying activity during update check, a timer is started to
-    updated the progress bar. The user can press a cancel button to
-    stop the update check.
- */
-void UpdateCheckDialog::showCheckingForUpdateDialog() {
-    // Reset the progress bar.
-    updateCheckProgressCounter = 0;
-    progressBar->setValue(updateCheckProgressCounter);
-    progressBar->setInvertedAppearance( false );
-
-    updateCheckProgressTimer->start();
-    progressBar->show();
-    setWindowTitle( tr("Checking for update...") );
-    label->setText( tr("Checking whether a newer version is available") );
-    buttonBox->setStandardButtons(QDialogButtonBox::Cancel);
-    show();
-}
-
-
-/*!
-    \brief Displays the dialog with info about the new available version.
- */
-void UpdateCheckDialog::showNewVersionAvailableDialog(QString newVersion) {
-    progressBar->hide();
-    setWindowTitle( tr("Update available") );
-    label->setText( tr("A newer version of UniversalIndentGUI is available.\nYour version is %1. New version is %2.\nDo you want to go to the download website?").arg(currentVersion).arg(newVersion) );
-    buttonBox->setStandardButtons(QDialogButtonBox::No|QDialogButtonBox::NoButton|QDialogButtonBox::Yes);
-    exec();
-}
-
-
-/*!
-    \brief Displays the dialog, that no new version is available.
- */
-void UpdateCheckDialog::showNoNewVersionAvailableDialog() {
-    progressBar->hide();
-    setWindowTitle( tr("No new update available") );
-    label->setText( tr("You already have the latest version of UniversalIndentGUI.") );
-    buttonBox->setStandardButtons(QDialogButtonBox::Ok);
-    exec();
-}
-
-
-/*!
-    \brief This slot is called, when a button in the dialog is clicked.
-
-    If the clicked button was the cancel button, the user wants to cancel
-    the update check. So the http request is aborted and the timer for the
-    progress bar animation is stopped.
-
-    In any case if a button is clicked, the dialog box will be closed.
- */
-void UpdateCheckDialog::handleUpdateCheckDialogButtonClicked(QAbstractButton *clickedButton) {
-    roleOfClickedButton = buttonBox->buttonRole(clickedButton);
-
-    if ( roleOfClickedButton == QDialogButtonBox::RejectRole ) {
-        // Abort the http request.
-        http->abort();
-        // Stop the progress bar timer.
-        updateCheckProgressTimer->stop();
-    }
-
-    accept();
-}
-
-
-/*!
-    \brief This slot is responsible for the animation of the update check progress bar.
- */
-void UpdateCheckDialog::updateUpdateCheckProgressBar() {
-    // Depending on the progress bar direction, decrease or increase the progressbar value.
-    if ( progressBar->invertedAppearance() ) {
-        updateCheckProgressCounter--;
-    }
-    else {
-        updateCheckProgressCounter++;
-    }
-
-    // If the progress bar reaches 0 or 100 as value, swap the animation direction.
-    if ( updateCheckProgressCounter == 0 || updateCheckProgressCounter == 100 ) {
-        progressBar->setInvertedAppearance( !progressBar->invertedAppearance() );
-    }
-
-    // Update the progress bar value.
-    progressBar->setValue(updateCheckProgressCounter);
-}
-
-
-/*!
-    \brief Converts the as string given version \a versionString to an integer number.
-
-    The \a versionString must have the format x.x.x where each x represents a number
-    of a maximum of 999. If the input format is wrong, -1 will be returned.The first
-    number will be multiplied by 1000000 the second by 1000 and then all three will
-    be summarized.
-
-    Thus for example 12.5.170 will result in 12005170.
- */
-int UpdateCheckDialog::convertVersionStringToNumber(QString versionString) {
-    int versionInteger = 0;
-    int pos = 0;
-
-    QRegExp regEx("\\d{1,3}.\\d{1,3}.\\d{1,3}");
-    QRegExpValidator validator(regEx, NULL);
-
-    if ( validator.validate(versionString, pos) == QValidator::Acceptable ) {
-        QStringList versionNumberStringList = versionString.split(".");
-    }
-    else {
-        versionInteger = -1;
-    }
-
-    return versionInteger;
-}
--- a/src/updatecheckdialog.h	Tue Nov 11 12:51:02 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
- *   thomas-schweitzer(at)arcor.de                                         *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License version 2.0 as   *
- *   published by the Free Software Foundation.                            *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program in the file LICENSE.GPL; if not, write to the *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-
-#ifndef UPDATECHECKDIALOG_H
-#define UPDATECHECKDIALOG_H
-
-#include <QDialog>
-#include <QMessageBox>
-#include <QDesktopServices>
-#include <QHttp>
-#include <QUrl>
-#include <QDate>
-#include <QHBoxLayout>
-#include <QLabel>
-#include <QTimer>
-
-#include "ui_UpdateCheckDialog.h"
-#include "uiguisettings.h"
-
-class UpdateCheckDialog : public QDialog, public Ui::UpdateCheckDialog
-{
-    Q_OBJECT
-
-public:
-    UpdateCheckDialog(QString currentVersion, UiguiSettings *settings, QWidget *parent=0);
-
-public slots:
-    void checkForUpdateAndShowDialog();
-    void checkForUpdate();
-
-private:
-    void getPadXMLFile();
-    void showCheckingForUpdateDialog();
-    void showNewVersionAvailableDialog(QString newVersion);
-    void showNoNewVersionAvailableDialog();
-
-    UiguiSettings *settings;
-    bool manualUpdateRequested;
-    QHttp *http;
-    QString currentVersion;
-    QDialogButtonBox::ButtonRole roleOfClickedButton;
-    QTimer *updateCheckProgressTimer;
-    int updateCheckProgressCounter;
-    int convertVersionStringToNumber(QString versionString);
-
-private slots:
-    void checkResultsOfFetchedPadXMLFile(bool errorOccurred);
-    void handleUpdateCheckDialogButtonClicked(QAbstractButton *clickedButton);
-    void updateUpdateCheckProgressBar();
-};
-
-#endif // UPDATECHECKDIALOG_H