Raw Qt->TQt conversion using tde/scripts/conversions/qt3-tqt3/convert_existing_qt3_app_to_tqt3.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
master
Michele Calgaro 2 years ago
parent d017bd3725
commit a30a266067
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -159,10 +159,10 @@ a.external
But if you'd like to build UiGUI from source, follow these steps: But if you'd like to build UiGUI from source, follow these steps:
<ol> <ol>
<li>Download, unpack, configure and compile <li>Download, unpack, configure and compile
<a class="external" href="http://www.qtsoftware.com/downloads/opensource/appdev">Qt</a> <a class="external" href="http://www.qtsoftware.com/downloads/opensource/appdev">TQt</a>
>= 4.4.0. Make your QTDIR and QMAKESPEC settings. Or install Qt via a package manager.</li> >= 4.4.0. Make your QTDIR and QMAKESPEC settings. Or install TQt via a package manager.</li>
<li>Download, unpack, compile and install <li>Download, unpack, compile and install
<a class="external" href="http://www.riverbankcomputing.com/software/qscintilla/download">QScintilla</a> <a class="external" href="http://www.riverbankcomputing.com/software/qscintilla/download">TQScintilla</a>
>= 2.2.</li> >= 2.2.</li>
<li>Checkout UiGUI: svn co https://universalindent.svn.sourceforge.net/svnroot/universalindent/trunk universalindentgui</li> <li>Checkout UiGUI: svn co https://universalindent.svn.sourceforge.net/svnroot/universalindent/trunk universalindentgui</li>
<li>In the checked out directory run "qmake UniversalIndentGUI.pro".</li> <li>In the checked out directory run "qmake UniversalIndentGUI.pro".</li>
@ -192,32 +192,32 @@ a.external
and XCode are included.</p> and XCode are included.</p>
</p> </p>
<h3>Used Qt techniques</h3> <h3>Used TQt techniques</h3>
<p>This list shows some selected functionalities that Qt offers and that I use with UiGUI.</p> <p>This list shows some selected functionalities that TQt offers and that I use with UiGUI.</p>
<ul> <ul>
<li>Translations are done with <li>Translations are done with
<a class="external" href="http://doc.trolltech.com/4.4/qtranslator.html">QTranslator</a>, <a class="external" href="http://doc.trolltech.com/4.4/ntqtranslator.html">TQTranslator</a>,
<a class="external" href="http://doc.trolltech.com/4.4/qlocale.html">QLocale</a> and Linguist.</li> <a class="external" href="http://doc.trolltech.com/4.4/ntqlocale.html">TQLocale</a> and Linguist.</li>
<li>File encodings are supported by using <li>File encodings are supported by using
<a class="external" href="http://doc.trolltech.com/4.4/qtextcodec.html">QTextCodec</a> <a class="external" href="http://doc.trolltech.com/4.4/ntqtextcodec.html">TQTextCodec</a>
and <a class="external" href="http://doc.trolltech.com/4.4/qtextstream.html">QTextStream</a>.</li> and <a class="external" href="http://doc.trolltech.com/4.4/ntqtextstream.html">TQTextStream</a>.</li>
<li><a class="external" href="http://doc.trolltech.com/4.4/qscriptengine.html">QScriptEngine</a> <li><a class="external" href="http://doc.trolltech.com/4.4/qscriptengine.html">TQScriptEngine</a>
and <a class="external" href="http://doc.trolltech.com/4.4/qscriptvalue.html">QScriptValue</a> and <a class="external" href="http://doc.trolltech.com/4.4/qscriptvalue.html">TQScriptValue</a>
is included for executing JavaScript files used as indenters.</li> is included for executing JavaScript files used as indenters.</li>
<li><a class="external" href="http://doc.trolltech.com/4.4/qgraphicsview.html">QGraphicsView</a> <li><a class="external" href="http://doc.trolltech.com/4.4/qgraphicsview.html">TQGraphicsView</a>
and <a class="external" href="http://doc.trolltech.com/4.4/qgraphicsproxywidget.html">QGraphicsProxyWidget</a> and <a class="external" href="http://doc.trolltech.com/4.4/qgraphicsproxywidget.html">TQGraphicsProxyWidget</a>
for creating an animated 3D about dialog, simulating that is done on the whole desktop by using for creating an animated 3D about dialog, simulating that is done on the whole desktop by using
the screenshot capability of Qt.</li> the screenshot capability of TQt.</li>
<li>Stylesheet settings give the about dialog a special look. Also gradients are used.</li> <li>Stylesheet settings give the about dialog a special look. Also gradients are used.</li>
<li><a class="external" href="http://doc.trolltech.com/4.4/qhttp.html">QHttp</a> <li><a class="external" href="http://doc.trolltech.com/4.4/ntqhttp.html">TQHttp</a>
and <a class="external" href="http://doc.trolltech.com/4.4/qurl.html">QUrl</a> and <a class="external" href="http://doc.trolltech.com/4.4/ntqurl.html">TQUrl</a>
are used for the update check.</li> are used for the update check.</li>
<li><a class="external" href="http://doc.trolltech.com/4.4/qsettings.html">QSettings</a> <li><a class="external" href="http://doc.trolltech.com/4.4/ntqsettings.html">TQSettings</a>
is responsible for storing the application and syntax highlighter settings.</li> is responsible for storing the application and syntax highlighter settings.</li>
<li><a class="external" href="http://doc.trolltech.com/4.4/qtcpserver.html">QTcpServer</a> <li><a class="external" href="http://doc.trolltech.com/4.4/qtcpserver.html">TQTcpServer</a>
and <a class="external" href="http://doc.trolltech.com/4.4/qtcpsocket.html">QTcpSocket</a> and <a class="external" href="http://doc.trolltech.com/4.4/qtcpsocket.html">TQTcpSocket</a>
build the base for the UiGUI Server.</li> build the base for the UiGUI Server.</li>
<li>Of course I use the Qt tools qmake, lupdate, lrelease, Designer, Linguist and my very best friend the Assistant.</li> <li>Of course I use the TQt tools qmake, lupdate, lrelease, Designer, Linguist and my very best friend the Assistant.</li>
</ul> </ul>
<h3>Future plans</h3> <h3>Future plans</h3>

@ -22,11 +22,11 @@
#include "UiGuiVersion.h" #include "UiGuiVersion.h"
#include <tqurl.h> #include <tntqurl.h>
#include <tqdesktopservices.h> #include <tqdesktopservices.h>
#include <tqscrollbar.h> #include <tntqscrollbar.h>
#include <tqtimer.h> #include <tntqtimer.h>
#include <tqlocale.h> #include <tntqlocale.h>
/*! /*!
\class AboutDialog \class AboutDialog
@ -37,7 +37,7 @@
\brief The constructor calls the setup function for the ui created by uic and adds \brief The constructor calls the setup function for the ui created by uic and adds
the GPL text to the text edit. the GPL text to the text edit.
*/ */
AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags) AboutDialog::AboutDialog(TQWidget *parent, TQt::WindowFlags flags) : TQDialog(parent, flags)
, _dialogForm(NULL) , _dialogForm(NULL)
, _timer(NULL) , _timer(NULL)
{ {
@ -47,7 +47,7 @@ AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(paren
_dialogForm->authorTextBrowser->setOpenExternalLinks( true ); _dialogForm->authorTextBrowser->setOpenExternalLinks( true );
_dialogForm->creditsTextBrowser->setOpenExternalLinks( true ); _dialogForm->creditsTextBrowser->setOpenExternalLinks( true );
QString versionString = _dialogForm->versionTextBrowser->toHtml(); TQString versionString = _dialogForm->versionTextBrowser->toHtml();
versionString = versionString.arg(PROGRAM_VERSION_STRING).arg( UiGuiVersion::getBuildRevision() ).arg( UiGuiVersion::getBuildDate() ); versionString = versionString.arg(PROGRAM_VERSION_STRING).arg( UiGuiVersion::getBuildRevision() ).arg( UiGuiVersion::getBuildDate() );
_dialogForm->versionTextBrowser->setHtml(versionString); _dialogForm->versionTextBrowser->setHtml(versionString);
@ -59,7 +59,7 @@ AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(paren
"<p align='center'><a href=\"http://korytskyy.lviv.ua/\"><b>Oleksandr</b></a> for Ukrainian and Russian translation.</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 icon logo.</p></br>" "<p align='center'><b>Erwan &quot;leg&quot;</b> for French translation and the 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'>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 Scintilla Qt wrapper QScintilla.</p></br>" "<p align='center'><a href=\"http://www.riverbankcomputing.co.uk/software/qscintilla/\"><b>Riverbank</b></a> for their Scintilla TQt wrapper TQScintilla.</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://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://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://www.siber.com/sct/tools/cbl-beau.html\"><b>Cobol Beautifier</b></a> project.</p></br>"
@ -77,7 +77,7 @@ AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(paren
"<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://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://sourceforge.net/projects/phpstylist/\"><b>PHP Stylist</b></a> project.</p></br>"
"<p align='center'>The <a href=\"http://coverage.livinglogic.de/Tools/scripts/pindent.py.html\"><b>pindent</b></a> project.</p></br>" "<p align='center'>The <a href=\"http://coverage.livinglogic.de/Tools/scripts/pindent.py.html\"><b>pindent</b></a> project.</p></br>"
"<p align='center'>The <a href=\"http://psti.equinoxbase.com/\"><b>Pl/Sql tidy</b></a> project.</p></br>" "<p align='center'>The <a href=\"http://psti.etquinoxbase.com/\"><b>Pl/Sql tidy</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://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://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://www.bolthole.com/AWK.html\"><b>Shell Indent</b></a> project.</p></br>"
@ -93,7 +93,7 @@ AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(paren
_scrollDirection = 1; _scrollDirection = 1;
_scrollSpeed = 100; _scrollSpeed = 100;
_timer = new QTimer(this); _timer = new TQTimer(this);
connect( _timer, SIGNAL(timeout()), this, SLOT(scroll()) ); connect( _timer, SIGNAL(timeout()), this, SLOT(scroll()) );
connect( this, SIGNAL(accepted()), _timer, SLOT(stop()) ); connect( this, SIGNAL(accepted()), _timer, SLOT(stop()) );
} }
@ -102,16 +102,16 @@ AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(paren
/*! /*!
\brief Catches language change events and retranslates all needed widgets. \brief Catches language change events and retranslates all needed widgets.
*/ */
void AboutDialog::changeEvent(QEvent *event) { void AboutDialog::changeEvent(TQEvent *event) {
if (event->type() == QEvent::LanguageChange) { if (event->type() == TQEvent::LanguageChange) {
_dialogForm->retranslateUi(this); _dialogForm->retranslateUi(this);
QString versionString = _dialogForm->versionTextBrowser->toHtml(); TQString versionString = _dialogForm->versionTextBrowser->toHtml();
versionString = versionString.arg(PROGRAM_VERSION_STRING).arg( UiGuiVersion::getBuildRevision() ).arg( UiGuiVersion::getBuildDate() ); versionString = versionString.arg(PROGRAM_VERSION_STRING).arg( UiGuiVersion::getBuildRevision() ).arg( UiGuiVersion::getBuildDate() );
_dialogForm->versionTextBrowser->setHtml(versionString); _dialogForm->versionTextBrowser->setHtml(versionString);
} }
else { else {
QWidget::changeEvent(event); TQWidget::changeEvent(event);
} }
} }
@ -122,7 +122,7 @@ void AboutDialog::changeEvent(QEvent *event) {
int AboutDialog::exec() { int AboutDialog::exec() {
//creditsTextBrowser->verticalScrollBar()->setValue(0); //creditsTextBrowser->verticalScrollBar()->setValue(0);
_timer->start(_scrollSpeed); _timer->start(_scrollSpeed);
return QDialog::exec(); return TQDialog::exec();
} }
@ -131,7 +131,7 @@ int AboutDialog::exec() {
Also changes the scroll direction and speed when reaching the start or end. Also changes the scroll direction and speed when reaching the start or end.
*/ */
void AboutDialog::scroll() { void AboutDialog::scroll() {
QScrollBar *scrollBar = _dialogForm->creditsTextBrowser->verticalScrollBar(); TQScrollBar *scrollBar = _dialogForm->creditsTextBrowser->verticalScrollBar();
scrollBar->setValue( scrollBar->value()+_scrollDirection ); scrollBar->setValue( scrollBar->value()+_scrollDirection );
if ( scrollBar->value() == scrollBar->maximum() ) { if ( scrollBar->value() == scrollBar->maximum() ) {
@ -158,5 +158,5 @@ void AboutDialog::scroll() {
*/ */
void AboutDialog::show() { void AboutDialog::show() {
_timer->start(_scrollSpeed); _timer->start(_scrollSpeed);
QDialog::show(); TQDialog::show();
} }

@ -20,19 +20,19 @@
#ifndef ABOUTDIALOG_H #ifndef ABOUTDIALOG_H
#define ABOUTDIALOG_H #define ABOUTDIALOG_H
#include <tqdialog.h> #include <tntqdialog.h>
namespace Ui { namespace Ui {
class AboutDialog; class AboutDialog;
} }
class AboutDialog : public QDialog class AboutDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
AboutDialog(QWidget *parent = NULL, Qt::WindowFlags flags = 0); AboutDialog(TQWidget *parent = NULL, TQt::WindowFlags flags = 0);
public slots: public slots:
int exec(); int exec();
@ -42,12 +42,12 @@ private slots:
void scroll(); void scroll();
private: private:
void changeEvent(QEvent *event); void changeEvent(TQEvent *event);
Ui::AboutDialog* _dialogForm; Ui::AboutDialog* _dialogForm;
int _scrollDirection; int _scrollDirection;
int _scrollSpeed; int _scrollSpeed;
QTimer *_timer; TQTimer *_timer;
}; };
#endif // ABOUTDIALOG_H #endif // ABOUTDIALOG_H

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>AboutDialog</class> <class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog"> <widget class="TQDialog" name="AboutDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -29,21 +29,21 @@
<iconset resource="../resources/Icons.qrc"> <iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/info.png</normaloff>:/mainWindow/info.png</iconset> <normaloff>:/mainWindow/info.png</normaloff>:/mainWindow/info.png</iconset>
</property> </property>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QFrame" name="frame"> <widget class="TQFrame" name="frame">
<property name="styleSheet"> <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> <string notr="true">TQFrame#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>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>TQFrame::StyledPanel</enum>
</property> </property>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<item> <item>
<widget class="QLabel" name="bannerLabel"> <widget class="TQLabel" name="bannerLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -71,7 +71,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextBrowser" name="versionTextBrowser"> <widget class="TQTextBrowser" name="versionTextBrowser">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -85,13 +85,13 @@
</size> </size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QTextBrowser{background-color:transparent}</string> <string notr="true">TQTextBrowser{background-color:transparent}</string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>TQFrame::NoFrame</enum>
</property> </property>
<property name="verticalScrollBarPolicy"> <property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>TQt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="html"> <property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
@ -103,7 +103,7 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextBrowser" name="authorTextBrowser"> <widget class="TQTextBrowser" name="authorTextBrowser">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -114,13 +114,13 @@ p, li { white-space: pre-wrap; }
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QTextBrowser{background-color:transparent}</string> <string notr="true">TQTextBrowser{background-color:transparent}</string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>TQFrame::NoFrame</enum>
</property> </property>
<property name="verticalScrollBarPolicy"> <property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>TQt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="html"> <property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
@ -137,24 +137,24 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextBrowser" name="creditsTextBrowser"> <widget class="TQTextBrowser" name="creditsTextBrowser">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QTextBrowser#creditsTextBrowser{border:2px solid rgba(0,0,0,10%); background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0,0,0,80%), stop:0.1 rgba(0,0,0,15%), stop:0.9 rgba(0,0,0,15%), stop:1 rgba(0,0,0,80%) )}</string> <string notr="true">TQTextBrowser#creditsTextBrowser{border:2px solid rgba(0,0,0,10%); background-color:qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0,0,0,80%), stop:0.1 rgba(0,0,0,15%), stop:0.9 rgba(0,0,0,15%), stop:1 rgba(0,0,0,80%) )}</string>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>TQFrame::NoFrame</enum>
</property> </property>
<property name="verticalScrollBarPolicy"> <property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>TQt::ScrollBarAlwaysOff</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout"> <layout class="TQHBoxLayout">
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -165,9 +165,9 @@ p, li { white-space: pre-wrap; }
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="okButton"> <widget class="TQPushButton" name="okButton">
<property name="styleSheet"> <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> <string notr="true">TQPushButton#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;} TQPushButton:hover#okButton { background-color: qlineargradient( x1:0, y1:0, x2:0, y2:1, stop:0 #B8784B, stop:0.5 #DCB28A, stop:1 #B8784B ); } TQPushButton:pressed#okButton{ border: 2px solid #D8CB75 }</string>
</property> </property>
<property name="text"> <property name="text">
<string> OK </string> <string> OK </string>
@ -177,7 +177,7 @@ p, li { white-space: pre-wrap; }
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>

@ -22,10 +22,10 @@
#include "AboutDialog.h" #include "AboutDialog.h"
#include <tqtgui.h> #include <tqtgui.h>
#include <tqdesktopwidget.h> #include <tntqdesktopwidget.h>
#include <tqdate.h> #include <tqdate.h>
#include <tqtimeline.h> #include <tqtimeline.h>
#include <tqsplashscreen.h> #include <tntqsplashscreen.h>
/*! /*!
\class AboutDialogGraphicsView \class AboutDialogGraphicsView
@ -39,7 +39,7 @@
/*! /*!
\brief The constructor initializes everything needed for the 3D animation. \brief The constructor initializes everything needed for the 3D animation.
*/ */
AboutDialogGraphicsView::AboutDialogGraphicsView(AboutDialog *aboutDialog, QWidget *parentWindow) : QGraphicsView(parentWindow) AboutDialogGraphicsView::AboutDialogGraphicsView(AboutDialog *aboutDialog, TQWidget *parentWindow) : TQGraphicsView(parentWindow)
, _aboutDialog(NULL) , _aboutDialog(NULL)
, _graphicsProxyWidget(NULL) , _graphicsProxyWidget(NULL)
, _parentWindow(NULL) , _parentWindow(NULL)
@ -47,13 +47,13 @@ AboutDialogGraphicsView::AboutDialogGraphicsView(AboutDialog *aboutDialog, QWidg
, _aboutDialogAsSplashScreen(NULL) , _aboutDialogAsSplashScreen(NULL)
{ {
_parentWindow = parentWindow; _parentWindow = parentWindow;
setWindowFlags(Qt::SplashScreen); setWindowFlags(TQt::SplashScreen);
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
QRect availableGeometry = QApplication::desktop()->availableGeometry(); TQRect availableGeometry = TQApplication::desktop()->availableGeometry();
QRect newGeometry = QRect( availableGeometry.x(), availableGeometry.y(), availableGeometry.width(), availableGeometry.height() ); TQRect newGeometry = TQRect( availableGeometry.x(), availableGeometry.y(), availableGeometry.width(), availableGeometry.height() );
#else #else
QRect newGeometry = QRect( -1,-1, QApplication::desktop()->rect().width()+2, QApplication::desktop()->rect().height()+2 ); TQRect newGeometry = TQRect( -1,-1, TQApplication::desktop()->rect().width()+2, TQApplication::desktop()->rect().height()+2 );
#endif #endif
setGeometry( newGeometry ); setGeometry( newGeometry );
@ -62,30 +62,30 @@ AboutDialogGraphicsView::AboutDialogGraphicsView(AboutDialog *aboutDialog, QWidg
_windowTitleBarWidth = 0; _windowTitleBarWidth = 0;
_windowPosOffset = 0; _windowPosOffset = 0;
QGraphicsScene *scene = new QGraphicsScene(this); TQGraphicsScene *scene = new TQGraphicsScene(this);
setSceneRect( newGeometry ); setSceneRect( newGeometry );
_aboutDialogAsSplashScreen = new QSplashScreen(this); _aboutDialogAsSplashScreen = new TQSplashScreen(this);
_graphicsProxyWidget = scene->addWidget(_aboutDialogAsSplashScreen); _graphicsProxyWidget = scene->addWidget(_aboutDialogAsSplashScreen);
_graphicsProxyWidget->setWindowFlags( Qt::ToolTip ); _graphicsProxyWidget->setWindowFlags( TQt::ToolTip );
setScene( scene ); setScene( scene );
setRenderHint(QPainter::Antialiasing); setRenderHint(TQPainter::Antialiasing);
setCacheMode(QGraphicsView::CacheBackground); setCacheMode(TQGraphicsView::CacheBackground);
setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); setViewportUpdateMode(TQGraphicsView::BoundingRectViewportUpdate);
connect(_aboutDialog, SIGNAL(finished(int)), this, SLOT(hide())); connect(_aboutDialog, SIGNAL(finished(int)), this, SLOT(hide()));
//setWindowOpacity(0.9); //setWindowOpacity(0.9);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(TQt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(TQt::ScrollBarAlwaysOff);
setStyleSheet("AboutDialogGraphicsView { border: 0px; }"); setStyleSheet("AboutDialogGraphicsView { border: 0px; }");
_timeLine = new QTimeLine(1000, this); _timeLine = new TQTimeLine(1000, this);
_timeLine->setFrameRange(270, 0); _timeLine->setFrameRange(270, 0);
//_timeLine->setUpdateInterval(10); //_timeLine->setUpdateInterval(10);
//_timeLine->setCurveShape(QTimeLine::EaseInCurve); //_timeLine->setCurveShape(TQTimeLine::EaseInCurve);
connect(_timeLine, SIGNAL(frameChanged(int)), this, SLOT(updateStep(int))); connect(_timeLine, SIGNAL(frameChanged(int)), this, SLOT(updateStep(int)));
} }
@ -112,34 +112,34 @@ void AboutDialogGraphicsView::show() {
_windowTitleBarWidth = 27; _windowTitleBarWidth = 27;
} }
#endif #endif
QPixmap originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId(), QApplication::desktop()->availableGeometry().x(), QApplication::desktop()->availableGeometry().y(), geometry().width(), geometry().height() ); TQPixmap originalPixmap = TQPixmap::grabWindow(TQApplication::desktop()->winId(), TQApplication::desktop()->availableGeometry().x(), TQApplication::desktop()->availableGeometry().y(), geometry().width(), geometry().height() );
QBrush brush(originalPixmap); TQBrush brush(originalPixmap);
QTransform transform; TQTransform transform;
transform.translate(0, QApplication::desktop()->availableGeometry().y()); transform.translate(0, TQApplication::desktop()->availableGeometry().y());
brush.setTransform(transform); brush.setTransform(transform);
setBackgroundBrush(brush); setBackgroundBrush(brush);
_aboutDialogAsSplashScreen->setPixmap( QPixmap::grabWidget(_aboutDialog) ); _aboutDialogAsSplashScreen->setPixmap( TQPixmap::grabWidget(_aboutDialog) );
_graphicsProxyWidget->setGeometry( _aboutDialog->geometry() ); _graphicsProxyWidget->setGeometry( _aboutDialog->geometry() );
_aboutDialog->hide(); _aboutDialog->hide();
_graphicsProxyWidget->setPos( _parentWindow->geometry().x()+(_parentWindow->geometry().width()-_graphicsProxyWidget->geometry().width()) / 2, _parentWindow->y()+_windowTitleBarWidth-_windowPosOffset); _graphicsProxyWidget->setPos( _parentWindow->geometry().x()+(_parentWindow->geometry().width()-_graphicsProxyWidget->geometry().width()) / 2, _parentWindow->y()+_windowTitleBarWidth-_windowPosOffset);
QRectF r = _graphicsProxyWidget->boundingRect(); TQRectF r = _graphicsProxyWidget->boundingRect();
_graphicsProxyWidget->setTransform(QTransform() _graphicsProxyWidget->setTransform(TQTransform()
.translate(r.width() / 2, -_windowTitleBarWidth) .translate(r.width() / 2, -_windowTitleBarWidth)
.rotate(270, Qt::XAxis) .rotate(270, TQt::XAxis)
//.rotate(90, Qt::YAxis) //.rotate(90, TQt::YAxis)
//.rotate(5, Qt::ZAxis) //.rotate(5, TQt::ZAxis)
//.scale(1 + 1.5 * step, 1 + 1.5 * step) //.scale(1 + 1.5 * step, 1 + 1.5 * step)
.translate(-r.width() / 2, _windowTitleBarWidth)); .translate(-r.width() / 2, _windowTitleBarWidth));
_graphicsProxyWidget->show(); _graphicsProxyWidget->show();
//_aboutDialogAsSplashScreen->show(); //_aboutDialogAsSplashScreen->show();
QGraphicsView::show(); TQGraphicsView::show();
connect(_timeLine, SIGNAL(finished()), this, SLOT(showAboutDialog())); connect(_timeLine, SIGNAL(finished()), this, SLOT(showAboutDialog()));
_timeLine->setDirection(QTimeLine::Forward); _timeLine->setDirection(TQTimeLine::Forward);
_timeLine->start(); _timeLine->start();
} }
@ -148,12 +148,12 @@ void AboutDialogGraphicsView::show() {
\brief Does the next calculation/transformation step. \brief Does the next calculation/transformation step.
*/ */
void AboutDialogGraphicsView::updateStep(int step) { void AboutDialogGraphicsView::updateStep(int step) {
QRectF r = _graphicsProxyWidget->boundingRect(); TQRectF r = _graphicsProxyWidget->boundingRect();
_graphicsProxyWidget->setTransform(QTransform() _graphicsProxyWidget->setTransform(TQTransform()
.translate(r.width() / 2, -_windowTitleBarWidth) .translate(r.width() / 2, -_windowTitleBarWidth)
.rotate(step, Qt::XAxis) .rotate(step, TQt::XAxis)
//.rotate(step, Qt::YAxis) //.rotate(step, TQt::YAxis)
//.rotate(step * 5, Qt::ZAxis) //.rotate(step * 5, TQt::ZAxis)
//.scale(1 + 1.5 * step, 1 + 1.5 * step) //.scale(1 + 1.5 * step, 1 + 1.5 * step)
.translate(-r.width() / 2, _windowTitleBarWidth)); .translate(-r.width() / 2, _windowTitleBarWidth));
//update(); //update();
@ -177,21 +177,21 @@ void AboutDialogGraphicsView::showAboutDialog() {
void AboutDialogGraphicsView::hide() { void AboutDialogGraphicsView::hide() {
_graphicsProxyWidget->setPos( _parentWindow->geometry().x()+(_parentWindow->geometry().width()-_graphicsProxyWidget->geometry().width()) / 2, _parentWindow->y()+_windowTitleBarWidth-_windowPosOffset); _graphicsProxyWidget->setPos( _parentWindow->geometry().x()+(_parentWindow->geometry().width()-_graphicsProxyWidget->geometry().width()) / 2, _parentWindow->y()+_windowTitleBarWidth-_windowPosOffset);
QRectF r = _graphicsProxyWidget->boundingRect(); TQRectF r = _graphicsProxyWidget->boundingRect();
_graphicsProxyWidget->setTransform(QTransform() _graphicsProxyWidget->setTransform(TQTransform()
.translate(r.width() / 2, -_windowTitleBarWidth) .translate(r.width() / 2, -_windowTitleBarWidth)
.rotate(0, Qt::XAxis) .rotate(0, TQt::XAxis)
//.rotate(90, Qt::YAxis) //.rotate(90, TQt::YAxis)
//.rotate(5, Qt::ZAxis) //.rotate(5, TQt::ZAxis)
//.scale(1 + 1.5 * step, 1 + 1.5 * step) //.scale(1 + 1.5 * step, 1 + 1.5 * step)
.translate(-r.width() / 2, _windowTitleBarWidth)); .translate(-r.width() / 2, _windowTitleBarWidth));
_graphicsProxyWidget->show(); _graphicsProxyWidget->show();
//_aboutDialogAsSplashScreen->show(); //_aboutDialogAsSplashScreen->show();
QGraphicsView::show(); TQGraphicsView::show();
connect(_timeLine, SIGNAL(finished()), this, SLOT(hideReally())); connect(_timeLine, SIGNAL(finished()), this, SLOT(hideReally()));
_timeLine->setDirection(QTimeLine::Backward); _timeLine->setDirection(TQTimeLine::Backward);
_timeLine->start(); _timeLine->start();
} }
@ -201,6 +201,6 @@ void AboutDialogGraphicsView::hide() {
*/ */
void AboutDialogGraphicsView::hideReally() { void AboutDialogGraphicsView::hideReally() {
disconnect(_timeLine, SIGNAL(finished()), this, SLOT(hideReally())); disconnect(_timeLine, SIGNAL(finished()), this, SLOT(hideReally()));
QGraphicsView::hide(); TQGraphicsView::hide();
_parentWindow->activateWindow(); _parentWindow->activateWindow();
} }

@ -23,15 +23,15 @@
class AboutDialog; class AboutDialog;
class QTimeLine; class TQTimeLine;
class QSplashScreen; class TQSplashScreen;
class AboutDialogGraphicsView : public QGraphicsView class AboutDialogGraphicsView : public TQGraphicsView
{ {
Q_OBJECT Q_OBJECT
public: public:
AboutDialogGraphicsView(AboutDialog *aboutDialog, QWidget *parentWindow = NULL); AboutDialogGraphicsView(AboutDialog *aboutDialog, TQWidget *parentWindow = NULL);
~AboutDialogGraphicsView(void); ~AboutDialogGraphicsView(void);
public slots: public slots:
@ -45,10 +45,10 @@ private slots:
private: private:
AboutDialog *_aboutDialog; AboutDialog *_aboutDialog;
QGraphicsProxyWidget *_graphicsProxyWidget; TQGraphicsProxyWidget *_graphicsProxyWidget;
QWidget *_parentWindow; TQWidget *_parentWindow;
QTimeLine *_timeLine; TQTimeLine *_timeLine;
QSplashScreen *_aboutDialogAsSplashScreen; TQSplashScreen *_aboutDialogAsSplashScreen;
int _windowTitleBarWidth; int _windowTitleBarWidth;
int _windowPosOffset; int _windowPosOffset;
}; };

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>FindDialog</class> <class>FindDialog</class>
<widget class="QDialog" name="FindDialog"> <widget class="TQDialog" name="FindDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -13,9 +13,9 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Find</string> <string>Find</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="TQVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="TQLabel" name="label">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -28,14 +28,14 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="comboBox"> <widget class="TQComboBox" name="comboBox">
<property name="editable"> <property name="editable">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="TQGroupBox" name="groupBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -45,23 +45,23 @@
<property name="title"> <property name="title">
<string>Find options</string> <string>Find options</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="TQVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QCheckBox" name="checkBox"> <widget class="TQCheckBox" name="checkBox">
<property name="text"> <property name="text">
<string>Match case</string> <string>Match case</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_2"> <widget class="TQCheckBox" name="checkBox_2">
<property name="text"> <property name="text">
<string>Match whole word</string> <string>Match whole word</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_3"> <widget class="TQCheckBox" name="checkBox_3">
<property name="text"> <property name="text">
<string>Search forward</string> <string>Search forward</string>
</property> </property>
@ -71,7 +71,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_4"> <widget class="TQCheckBox" name="checkBox_4">
<property name="text"> <property name="text">
<string>Use Regular Expressions</string> <string>Use Regular Expressions</string>
</property> </property>
@ -83,7 +83,7 @@
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>TQt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -94,19 +94,19 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="TQHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum> <enum>TQLayout::SetMaximumSize</enum>
</property> </property>
<item> <item>
<widget class="QPushButton" name="pushButton"> <widget class="TQPushButton" name="pushButton">
<property name="text"> <property name="text">
<string>Find Next</string> <string>Find Next</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_2"> <widget class="TQPushButton" name="pushButton_2">
<property name="text"> <property name="text">
<string>Close</string> <string>Close</string>
</property> </property>

File diff suppressed because it is too large Load Diff

@ -20,44 +20,44 @@
#ifndef INDENTHANDLER_H #ifndef INDENTHANDLER_H
#define INDENTHANDLER_H #define INDENTHANDLER_H
#include <tqwidget.h> #include <tntqwidget.h>
class UiGuiErrorMessage; class UiGuiErrorMessage;
class UiGuiIniFileParser; class UiGuiIniFileParser;
class QMenu; class TQMenu;
class QVBoxLayout; class TQVBoxLayout;
class QLabel; class TQLabel;
class QSpinBox; class TQSpinBox;
class QComboBox; class TQComboBox;
class QCheckBox; class TQCheckBox;
class QLineEdit; class TQLineEdit;
class QToolButton; class TQToolButton;
class QToolBox; class TQToolBox;
class IndentHandler : public QWidget class IndentHandler : public TQWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
IndentHandler(int indenterID, QWidget *mainWindow = NULL, QWidget *parent = NULL); IndentHandler(int indenterID, TQWidget *mainWindow = NULL, TQWidget *parent = NULL);
~IndentHandler(); ~IndentHandler();
QString generateShellScript(const QString &configFilename); TQString generateShellScript(const TQString &configFilename);
QString callIndenter(QString sourceCode, QString inputFileExtension); TQString callIndenter(TQString sourceCode, TQString inputFileExtension);
bool loadConfigFile(QString filePathName); bool loadConfigFile(TQString filePathName);
void resetToDefaultValues(); void resetToDefaultValues();
QStringList getAvailableIndenters(); TQStringList getAvailableIndenters();
QString getPossibleIndenterFileExtensions(); TQString getPossibleIndenterFileExtensions();
QString getParameterString(); TQString getParameterString();
QString getIndenterCfgFile(); TQString getIndenterCfgFile();
QString getManual(); TQString getManual();
void retranslateUi(); void retranslateUi();
QString getCurrentIndenterName(); TQString getCurrentIndenterName();
QMenu* getIndenterMenu(); TQMenu* getIndenterMenu();
QList<QAction*> getIndenterMenuActions(); TQList<TQAction*> getIndenterMenuActions();
void contextMenuEvent( QContextMenuEvent *event ); void contextMenuEvent( TQContextMenuEvent *event );
void setParameterChangedCallback( void(*paramChangedCallback)(void) ); void setParameterChangedCallback( void(*paramChangedCallback)(void) );
void setWindowClosedCallback( void(*winClosedCallback)(void) ); void setWindowClosedCallback( void(*winClosedCallback)(void) );
int getIndenterId(); int getIndenterId();
@ -67,9 +67,9 @@ signals:
void selectedIndenterIndexChanged(int index); void selectedIndenterIndexChanged(int index);
protected: protected:
bool event( QEvent *event ); bool event( TQEvent *event );
void closeEvent(QCloseEvent *event); void closeEvent(TQCloseEvent *event);
void wheelEvent( QWheelEvent *event ); void wheelEvent( TQWheelEvent *event );
private slots: private slots:
void setIndenter(int indenterID); void setIndenter(int indenterID);
@ -82,102 +82,102 @@ private slots:
void updateDrawing(); void updateDrawing();
private: private:
QString callExecutableIndenter(QString sourceCode, QString inputFileExtension); TQString callExecutableIndenter(TQString sourceCode, TQString inputFileExtension);
QString callJavaScriptIndenter(QString sourceCode); TQString callJavaScriptIndenter(TQString sourceCode);
void saveConfigFile(QString filePathName, QString parameterString); void saveConfigFile(TQString filePathName, TQString parameterString);
void readIndentIniFile(QString iniFilePath); void readIndentIniFile(TQString iniFilePath);
bool createIndenterCallString(); bool createIndenterCallString();
void initIndenterMenu(); void initIndenterMenu();
//! Holds a reference to all created pages of the parameter categories toolbox and the pages boxlayout //! Holds a reference to all created pages of the parameter categories toolbox and the pages boxlayout
struct IndenterParameterCategoryPage { struct IndenterParameterCategoryPage {
QWidget *widget; TQWidget *widget;
QVBoxLayout *vboxLayout; TQVBoxLayout *vboxLayout;
}; };
QVector<IndenterParameterCategoryPage> _indenterParameterCategoryPages; TQVector<IndenterParameterCategoryPage> _indenterParameterCategoryPages;
//! Holds a reference to all checkboxes needed for boolean parameter setting and the parameters name //! Holds a reference to all checkboxes needed for boolean parameter setting and the parameters name
struct ParamBoolean { struct ParamBoolean {
QString paramName; TQString paramName;
QString trueString; TQString trueString;
QString falseString; TQString falseString;
QCheckBox *checkBox; TQCheckBox *checkBox;
}; };
QVector<ParamBoolean> _paramBooleans; TQVector<ParamBoolean> _paramBooleans;
//! Holds a reference to all line edits needed for parameter setting and the parameters name //! Holds a reference to all line edits needed for parameter setting and the parameters name
struct ParamString { struct ParamString {
QString paramName; TQString paramName;
QString paramCallName; TQString paramCallName;
QCheckBox *valueEnabledChkBox; TQCheckBox *valueEnabledChkBox;
QLineEdit *lineEdit; TQLineEdit *lineEdit;
QLabel *label; TQLabel *label;
}; };
QVector<ParamString> _paramStrings; TQVector<ParamString> _paramStrings;
//! Hold a reference to all spin boxes needed for parameter setting and the parameters name //! Hold a reference to all spin boxes needed for parameter setting and the parameters name
struct ParamNumeric { struct ParamNumeric {
QString paramName; TQString paramName;
QString paramCallName; TQString paramCallName;
QCheckBox *valueEnabledChkBox; TQCheckBox *valueEnabledChkBox;
QSpinBox *spinBox; TQSpinBox *spinBox;
QLabel *label; TQLabel *label;
}; };
QVector<ParamNumeric> _paramNumerics; TQVector<ParamNumeric> _paramNumerics;
//! Hold a reference to all combo boxes needed for parameter setting and the parameters name //! Hold a reference to all combo boxes needed for parameter setting and the parameters name
struct ParamMultiple { struct ParamMultiple {
QString paramName; TQString paramName;
QString paramCallName; TQString paramCallName;
QCheckBox *valueEnabledChkBox; TQCheckBox *valueEnabledChkBox;
QComboBox *comboBox; TQComboBox *comboBox;
QStringList choicesStrings; TQStringList choicesStrings;
QStringList choicesStringsReadable; TQStringList choicesStringsReadable;
}; };
QVector<ParamMultiple> _paramMultiples; TQVector<ParamMultiple> _paramMultiples;
QComboBox *_indenterSelectionCombobox; TQComboBox *_indenterSelectionCombobox;
QToolButton *_indenterParameterHelpButton; TQToolButton *_indenterParameterHelpButton;
//! Vertical layout box, into which the toolbox will be added //! Vertical layout box, into which the toolbox will be added
QVBoxLayout *_toolBoxContainerLayout; TQVBoxLayout *_toolBoxContainerLayout;
QToolBox *_indenterParameterCategoriesToolBox; TQToolBox *_indenterParameterCategoriesToolBox;
UiGuiIniFileParser *_indenterSettings; UiGuiIniFileParser *_indenterSettings;
QStringList _indenterParameters; TQStringList _indenterParameters;
//! The indenters name in a descriptive form //! The indenters name in a descriptive form
QString _indenterName; TQString _indenterName;
//! The indenters file name (w/o extension), that is being called //! The indenters file name (w/o extension), that is being called
QString _indenterFileName; TQString _indenterFileName;
QString _indenterDirctoryStr; TQString _indenterDirctoryStr;
QString _tempDirctoryStr; TQString _tempDirctoryStr;
QString _settingsDirctoryStr; TQString _settingsDirctoryStr;
QStringList _indenterIniFileList; TQStringList _indenterIniFileList;
QString _parameterOrder; TQString _parameterOrder;
QString _globalConfigFilename; TQString _globalConfigFilename;
QString _cfgFileParameterEnding; TQString _cfgFileParameterEnding;
QString _inputFileParameter; TQString _inputFileParameter;
QString _inputFileName; TQString _inputFileName;
QString _outputFileParameter; TQString _outputFileParameter;
QString _outputFileName; TQString _outputFileName;
QString _fileTypes; TQString _fileTypes;
QString _useCfgFileParameter; TQString _useCfgFileParameter;
QString _indenterShowHelpParameter; TQString _indenterShowHelpParameter;
QWidget *_mainWindow; TQWidget *_mainWindow;
UiGuiErrorMessage *_errorMessageDialog; UiGuiErrorMessage *_errorMessageDialog;
QString _indenterExecutableCallString; TQString _indenterExecutableCallString;
QString _indenterExecutableSuffix; TQString _indenterExecutableSuffix;
QMenu *_menuIndenter; TQMenu *_menuIndenter;
QAction *_actionLoadIndenterConfigFile; TQAction *_actionLoadIndenterConfigFile;
QAction *_actionSaveIndenterConfigFile; TQAction *_actionSaveIndenterConfigFile;
QAction *_actionCreateShellScript; TQAction *_actionCreateShellScript;
QAction *_actionResetIndenterParameters; TQAction *_actionResetIndenterParameters;
//! Needed for the NPP plugin. //! Needed for the NPP plugin.
void(*_parameterChangedCallback)(void); void(*_parameterChangedCallback)(void);
//! Needed for the NPP plugin. //! Needed for the NPP plugin.
void(*_windowClosedCallback)(void); void(*_windowClosedCallback)(void);
//TODO: This function should go into a string helper/tool class/file. //TODO: This function should go into a string helper/tool class/file.
QString encodeToHTML(const QString &text); TQString encodeToHTML(const TQString &text);
}; };
#endif // INDENTHANDLER_H #endif // INDENTHANDLER_H

@ -33,25 +33,25 @@
#include "IndentHandler.h" #include "IndentHandler.h"
#include "UpdateCheckDialog.h" #include "UpdateCheckDialog.h"
#include <tqwidget.h> #include <tntqwidget.h>
#include <tqlabel.h> #include <tntqlabel.h>
#include <tqstring.h> #include <tntqstring.h>
#include <tqscrollbar.h> #include <tntqscrollbar.h>
#include <tqtextcursor.h> #include <tqtextcursor.h>
#include <tqfiledialog.h> #include <tntqfiledialog.h>
#include <tqtextstream.h> #include <tntqtextstream.h>
#include <tqtextdocument.h> #include <tqtextdocument.h>
#include <tqprinter.h> #include <tntqprinter.h>
#include <tqprintdialog.h> #include <tntqprintdialog.h>
#include <tqcloseevent.h> #include <tqcloseevent.h>
#include <tqhelpevent.h> #include <tqhelpevent.h>
#include <tqtooltip.h> #include <tntqtooltip.h>
#include <tqtranslator.h> #include <tntqtranslator.h>
#include <tqlocale.h> #include <tntqlocale.h>
#include <tqtextcodec.h> #include <tntqtextcodec.h>
#include <tqdate.h> #include <tqdate.h>
#include <tqurl.h> #include <tntqurl.h>
#include <tqmessagebox.h> #include <tntqmessagebox.h>
#include <tqtdebug.h> #include <tqtdebug.h>
#include <Qsci/qsciscintilla.h> #include <Qsci/qsciscintilla.h>
@ -74,7 +74,7 @@ using namespace tschweitzer;
/*! /*!
\brief Constructs the main window. \brief Constructs the main window.
*/ */
MainWindow::MainWindow(QString file2OpenOnStart, QWidget *parent) : QMainWindow(parent) MainWindow::MainWindow(TQString file2OpenOnStart, TQWidget *parent) : TQMainWindow(parent)
, _mainWindowForm(NULL) , _mainWindowForm(NULL)
, _qSciSourceCodeEditor(NULL) , _qSciSourceCodeEditor(NULL)
, _settings(NULL) , _settings(NULL)
@ -109,7 +109,7 @@ MainWindow::MainWindow(QString file2OpenOnStart, QWidget *parent) : QMainWindow(
// Create toolbar and insert it into the main window. // Create toolbar and insert it into the main window.
initToolBar(); initToolBar();
// Create the text edit component using the QScintilla widget. // Create the text edit component using the TQScintilla widget.
initTextEditor(); initTextEditor();
// Create and init the syntax highlighter. // Create and init the syntax highlighter.
@ -124,7 +124,7 @@ MainWindow::MainWindow(QString file2OpenOnStart, QWidget *parent) : QMainWindow(
// Generate about dialog box // Generate about dialog box
_aboutDialog = new AboutDialog(this, Qt::SplashScreen); _aboutDialog = new AboutDialog(this, TQt::SplashScreen);
_aboutDialogGraphicsView = new AboutDialogGraphicsView(_aboutDialog, this); _aboutDialogGraphicsView = new AboutDialogGraphicsView(_aboutDialog, this);
connect( _toolBarWidget->pbAbout, SIGNAL(clicked()), this, SLOT(showAboutDialog()) ); connect( _toolBarWidget->pbAbout, SIGNAL(clicked()), this, SLOT(showAboutDialog()) );
connect( _mainWindowForm->actionAbout_UniversalIndentGUI, SIGNAL(triggered()), this, SLOT(showAboutDialog()) ); connect( _mainWindowForm->actionAbout_UniversalIndentGUI, SIGNAL(triggered()), this, SLOT(showAboutDialog()) );
@ -134,7 +134,7 @@ MainWindow::MainWindow(QString file2OpenOnStart, QWidget *parent) : QMainWindow(
connect( _mainWindowForm->actionShowSettings, SIGNAL(triggered()), _settingsDialog, SLOT(showDialog()) ); connect( _mainWindowForm->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 a file that should be opened on start has been handed over to the constructor exists, load it
if ( QFile::exists(file2OpenOnStart) ) { if ( TQFile::exists(file2OpenOnStart) ) {
openSourceFileDialog(file2OpenOnStart); openSourceFileDialog(file2OpenOnStart);
} }
// Otherwise load the last opened file, if this is enabled in the settings. // Otherwise load the last opened file, if this is enabled in the settings.
@ -145,7 +145,7 @@ MainWindow::MainWindow(QString file2OpenOnStart, QWidget *parent) : QMainWindow(
updateSourceView(); 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. // 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() ) { if ( _settings->getValueByName("CheckForUpdate").toBool() && TQDate::currentDate() != _settings->getValueByName("LastUpdateCheck").toDate() ) {
_updateCheckDialog->checkForUpdate(); _updateCheckDialog->checkForUpdate();
} }
@ -165,8 +165,8 @@ void MainWindow::initMainWindow() {
// Handle last opened window size // Handle last opened window size
// ------------------------------ // ------------------------------
bool maximized = _settings->getValueByName("maximized").toBool(); bool maximized = _settings->getValueByName("maximized").toBool();
QPoint pos = _settings->getValueByName("position").toPoint(); TQPoint pos = _settings->getValueByName("position").toPoint();
QSize size = _settings->getValueByName("size").toSize(); TQSize size = _settings->getValueByName("size").toSize();
resize(size); resize(size);
move(pos); move(pos);
if ( maximized ) { if ( maximized ) {
@ -178,7 +178,7 @@ void MainWindow::initMainWindow() {
// Handle if first run of this version // Handle if first run of this version
// ----------------------------------- // -----------------------------------
QString readVersion = _settings->getValueByName("version").toString(); TQString readVersion = _settings->getValueByName("version").toString();
// If version strings are not equal set first run true. // If version strings are not equal set first run true.
if ( readVersion != PROGRAM_VERSION_STRING ) { if ( readVersion != PROGRAM_VERSION_STRING ) {
_isFirstRunOfThisVersion = true; _isFirstRunOfThisVersion = true;
@ -196,7 +196,7 @@ void MainWindow::initMainWindow() {
// Register the load last file setting in the menu to the _settings object. // Register the load last file setting in the menu to the _settings object.
_settings->registerObjectProperty(_mainWindowForm->loadLastOpenedFileOnStartupAction, "checked", "loadLastSourceCodeFileOnStartup"); _settings->registerObjectProperty(_mainWindowForm->loadLastOpenedFileOnStartupAction, "checked", "loadLastSourceCodeFileOnStartup");
// Tell the QScintilla editor if it has to show white space. // Tell the TQScintilla editor if it has to show white space.
connect( _mainWindowForm->whiteSpaceIsVisibleAction, SIGNAL(toggled(bool)), this, SLOT(setWhiteSpaceVisibility(bool)) ); connect( _mainWindowForm->whiteSpaceIsVisibleAction, SIGNAL(toggled(bool)), this, SLOT(setWhiteSpaceVisibility(bool)) );
// Register the white space setting in the menu to the _settings object. // Register the white space setting in the menu to the _settings object.
_settings->registerObjectProperty(_mainWindowForm->whiteSpaceIsVisibleAction, "checked", "whiteSpaceIsVisible"); _settings->registerObjectProperty(_mainWindowForm->whiteSpaceIsVisibleAction, "checked", "whiteSpaceIsVisible");
@ -212,7 +212,7 @@ void MainWindow::initMainWindow() {
// Init the menu for selecting one of the recently opened files. // Init the menu for selecting one of the recently opened files.
updateRecentlyOpenedList(); updateRecentlyOpenedList();
connect( _mainWindowForm->menuRecently_Opened_Files, SIGNAL(triggered(QAction*)), this, SLOT(openFileFromRecentlyOpenedList(QAction*)) ); connect( _mainWindowForm->menuRecently_Opened_Files, SIGNAL(triggered(TQAction*)), this, SLOT(openFileFromRecentlyOpenedList(TQAction*)) );
//connect( _settings, SIGNAL(recentlyOpenedListSize(int)), this, SLOT(updateRecentlyOpenedList()) ); //connect( _settings, SIGNAL(recentlyOpenedListSize(int)), this, SLOT(updateRecentlyOpenedList()) );
_settings->registerObjectSlot(this, "updateRecentlyOpenedList()", "recentlyOpenedListSize"); _settings->registerObjectSlot(this, "updateRecentlyOpenedList()", "recentlyOpenedListSize");
} }
@ -224,10 +224,10 @@ void MainWindow::initMainWindow() {
void MainWindow::initToolBar() { void MainWindow::initToolBar() {
// Create the tool bar and add it to the main window. // Create the tool bar and add it to the main window.
_toolBarWidget = new Ui::ToolBarWidget(); _toolBarWidget = new Ui::ToolBarWidget();
QWidget* helpWidget = new QWidget(); TQWidget* helpWidget = new TQWidget();
_toolBarWidget->setupUi(helpWidget); _toolBarWidget->setupUi(helpWidget);
_mainWindowForm->toolBar->addWidget(helpWidget); _mainWindowForm->toolBar->addWidget(helpWidget);
_mainWindowForm->toolBar->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea ); _mainWindowForm->toolBar->setAllowedAreas( TQt::TopToolBarArea | TQt::BottomToolBarArea );
// Connect the tool bar widgets to their functions. // Connect the tool bar widgets to their functions.
_settings->registerObjectProperty(_toolBarWidget->enableSyntaxHighlightningCheckBox, "checked", "SyntaxHighlightingEnabled"); _settings->registerObjectProperty(_toolBarWidget->enableSyntaxHighlightningCheckBox, "checked", "SyntaxHighlightingEnabled");
@ -241,29 +241,29 @@ void MainWindow::initToolBar() {
/*! /*!
\brief Create and initialize the text editor component. It uses the QScintilla widget. \brief Create and initialize the text editor component. It uses the TQScintilla widget.
*/ */
void MainWindow::initTextEditor() { void MainWindow::initTextEditor() {
// Create the QScintilla widget and add it to the layout. // Create the TQScintilla widget and add it to the layout.
qDebug() << "Trying to load QScintilla library. If anything fails during loading, it might be possible that" tqDebug() << "Trying to load TQScintilla library. If anything fails during loading, it might be possible that"
<< " the debug and release version of QScintilla are mixed or the library cannot be found at all."; << " the debug and release version of TQScintilla are mixed or the library cannot be found at all.";
// 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 and catch doesn't seem to catch the runtime error when starting UiGUI release with TQScintilla debug lib and the other way around.
try { try {
_qSciSourceCodeEditor = new QsciScintilla(this); _qSciSourceCodeEditor = new QsciScintilla(this);
} }
catch (...) { catch (...) {
QMessageBox::critical(this, "Error creating QScintilla text editor component!", TQMessageBox::critical(this, "Error creating TQScintilla 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." ); "During trying to create the text editor component, that is based on TQScintilla, an error occurred. Please make sure that you have installed TQScintilla and not mixed release and debug versions." );
exit(1); exit(1);
} }
_mainWindowForm->hboxLayout1->addWidget(_qSciSourceCodeEditor); _mainWindowForm->hboxLayout1->addWidget(_qSciSourceCodeEditor);
// Make some _settings for the QScintilla widget. // Make some _settings for the TQScintilla widget.
_qSciSourceCodeEditor->setUtf8(true); _qSciSourceCodeEditor->setUtf8(true);
_qSciSourceCodeEditor->setMarginLineNumbers(1, true); _qSciSourceCodeEditor->setMarginLineNumbers(1, true);
_qSciSourceCodeEditor->setMarginWidth(1, QString("10000") ); _qSciSourceCodeEditor->setMarginWidth(1, TQString("10000") );
_qSciSourceCodeEditor->setBraceMatching(_qSciSourceCodeEditor->SloppyBraceMatch); _qSciSourceCodeEditor->setBraceMatching(_qSciSourceCodeEditor->SloppyBraceMatch);
_qSciSourceCodeEditor->setMatchedBraceForegroundColor( QColor("red") ); _qSciSourceCodeEditor->setMatchedBraceForegroundColor( TQColor("red") );
_qSciSourceCodeEditor->setFolding(QsciScintilla::BoxedTreeFoldStyle); _qSciSourceCodeEditor->setFolding(QsciScintilla::BoxedTreeFoldStyle);
_qSciSourceCodeEditor->setAutoCompletionSource(QsciScintilla::AcsAll); _qSciSourceCodeEditor->setAutoCompletionSource(QsciScintilla::AcsAll);
_qSciSourceCodeEditor->setAutoCompletionThreshold(3); _qSciSourceCodeEditor->setAutoCompletionThreshold(3);
@ -276,12 +276,12 @@ void MainWindow::initTextEditor() {
int tabWidth = _settings->getValueByName("tabWidth").toInt(); int tabWidth = _settings->getValueByName("tabWidth").toInt();
_qSciSourceCodeEditor->setTabWidth(tabWidth); _qSciSourceCodeEditor->setTabWidth(tabWidth);
// Remember a pointer to the scrollbar of the QScintilla widget used to keep // Remember a pointer to the scrollbar of the TQScintilla widget used to keep
// on the same line as before when turning preview on/off. // on the same line as before when turning preview on/off.
_textEditVScrollBar = _qSciSourceCodeEditor->verticalScrollBar(); _textEditVScrollBar = _qSciSourceCodeEditor->verticalScrollBar();
// Add a column row indicator to the status bar. // Add a column row indicator to the status bar.
_textEditLineColumnInfoLabel = new QLabel( tr("Line %1, Column %2").arg(1).arg(1) ); _textEditLineColumnInfoLabel = new TQLabel( tr("Line %1, Column %2").arg(1).arg(1) );
_mainWindowForm->statusbar->addPermanentWidget(_textEditLineColumnInfoLabel); _mainWindowForm->statusbar->addPermanentWidget(_textEditLineColumnInfoLabel);
connect( _qSciSourceCodeEditor, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(setStatusBarCursorPosInfo(int, int)) ); connect( _qSciSourceCodeEditor, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(setStatusBarCursorPosInfo(int, int)) );
@ -295,7 +295,7 @@ void MainWindow::initTextEditor() {
/*! /*!
\brief Create and init the syntax _highlighter and set it to use the QScintilla edit component. \brief Create and init the syntax _highlighter and set it to use the TQScintilla edit component.
*/ */
void MainWindow::initSyntaxHighlighter() { void MainWindow::initSyntaxHighlighter() {
// Create the _highlighter. // Create the _highlighter.
@ -319,14 +319,14 @@ void MainWindow::initSyntaxHighlighter() {
false and uses the default language, which is English. false and uses the default language, which is English.
*/ */
bool MainWindow::initApplicationLanguage() { bool MainWindow::initApplicationLanguage() {
QString languageShort; TQString languageShort;
// Get the language _settings from the _settings object. // Get the language _settings from the _settings object.
int languageIndex = _settings->getValueByName("language").toInt(); int languageIndex = _settings->getValueByName("language").toInt();
// If no language was set, indicated by a negative index, use the system language. // If no language was set, indicated by a negative index, use the system language.
if ( languageIndex < 0 ) { if ( languageIndex < 0 ) {
languageShort = QLocale::system().name(); languageShort = TQLocale::system().name();
// Chinese and Japanese language consist of country and language code. // Chinese and Japanese language consist of country and language code.
// For all others the language code will be cut off. // For all others the language code will be cut off.
@ -347,19 +347,19 @@ bool MainWindow::initApplicationLanguage() {
languageShort = _settings->getAvailableTranslations().at(languageIndex); languageShort = _settings->getAvailableTranslations().at(languageIndex);
} }
// Load the Qt own translation file and set it for the application. // Load the TQt own translation file and set it for the application.
_qTTranslator = new QTranslator(); _qTTranslator = new TQTranslator();
bool translationFileLoaded; bool translationFileLoaded;
translationFileLoaded = _qTTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/qt_" + languageShort ); translationFileLoaded = _qTTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/qt_" + languageShort );
if ( translationFileLoaded ) { if ( translationFileLoaded ) {
qApp->installTranslator(_qTTranslator); tqApp->installTranslator(_qTTranslator);
} }
// Load the uigui translation file and set it for the application. // Load the uigui translation file and set it for the application.
_uiGuiTranslator = new QTranslator(); _uiGuiTranslator = new TQTranslator();
translationFileLoaded = _uiGuiTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/universalindent_" + languageShort ); translationFileLoaded = _uiGuiTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/universalindent_" + languageShort );
if ( translationFileLoaded ) { if ( translationFileLoaded ) {
qApp->installTranslator(_uiGuiTranslator); tqApp->installTranslator(_uiGuiTranslator);
} }
//connect( _settings, SIGNAL(language(int)), this, SLOT(languageChanged(int)) ); //connect( _settings, SIGNAL(language(int)), this, SLOT(languageChanged(int)) );
@ -396,26 +396,26 @@ void MainWindow::initIndenter() {
/*! /*!
\brief Tries to load the by \a filePath defined file and returns its content as QString. \brief Tries to load the by \a filePath defined file and returns its content as TQString.
If the file could not be loaded a error dialog will be shown. If the file could not be loaded a error dialog will be shown.
*/ */
QString MainWindow::loadFile(QString filePath) { TQString MainWindow::loadFile(TQString filePath) {
QFile inSrcFile(filePath); TQFile inSrcFile(filePath);
QString fileContent = ""; TQString fileContent = "";
if ( !inSrcFile.open(QFile::ReadOnly | QFile::Text) ) { if ( !inSrcFile.open(TQFile::ReadOnly | TQFile::Text) ) {
QMessageBox::warning(NULL, tr("Error opening file"), tr("Cannot read the file ")+"\""+filePath+"\"." ); TQMessageBox::warning(NULL, tr("Error opening file"), tr("Cannot read the file ")+"\""+filePath+"\"." );
} }
else { else {
QTextStream inSrcStrm(&inSrcFile); TQTextStream inSrcStrm(&inSrcFile);
QApplication::setOverrideCursor(Qt::WaitCursor); TQApplication::setOverrideCursor(TQt::WaitCursor);
inSrcStrm.setCodec( QTextCodec::codecForName(_currentEncoding.toAscii()) ); inSrcStrm.setCodec( TQTextCodec::codecForName(_currentEncoding.toAscii()) );
fileContent = inSrcStrm.readAll(); fileContent = inSrcStrm.readAll();
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
inSrcFile.close(); inSrcFile.close();
QFileInfo fileInfo(filePath); TQFileInfo fileInfo(filePath);
_currentSourceFileExtension = fileInfo.suffix(); _currentSourceFileExtension = fileInfo.suffix();
int indexOfHighlighter = _highlighter->setLexerForExtension( _currentSourceFileExtension ); int indexOfHighlighter = _highlighter->setLexerForExtension( _currentSourceFileExtension );
_highlighterActionGroup->actions().at(indexOfHighlighter)->setChecked(true); _highlighterActionGroup->actions().at(indexOfHighlighter)->setChecked(true);
@ -429,24 +429,24 @@ QString MainWindow::loadFile(QString filePath) {
If the file was successfully loaded the indenter will be called to generate the formatted source code. If the file was successfully loaded the indenter will be called to generate the formatted source code.
*/ */
void MainWindow::openSourceFileDialog(QString fileName) { void MainWindow::openSourceFileDialog(TQString fileName) {
// If the source code file is changed and the shown dialog for saving the file // If the source code file is changed and the shown dialog for saving the file
// is canceled, also stop opening another source file. // is canceled, also stop opening another source file.
if ( !maybeSave() ) { if ( !maybeSave() ) {
return; return;
} }
QString openedSourceFileContent = ""; TQString openedSourceFileContent = "";
QString fileExtensions = tr("Supported by indenter")+" ("+_indentHandler->getPossibleIndenterFileExtensions()+ TQString fileExtensions = tr("Supported by indenter")+" ("+_indentHandler->getPossibleIndenterFileExtensions()+
");;"+tr("All files")+" (*.*)"; ");;"+tr("All files")+" (*.*)";
//QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions ); //TQString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
if ( fileName.isEmpty() ) { if ( fileName.isEmpty() ) {
fileName = QFileDialog::getOpenFileName( this, tr("Choose source code file"), _currentSourceFile, fileExtensions); fileName = TQFileDialog::getOpenFileName( this, tr("Choose source code file"), _currentSourceFile, fileExtensions);
} }
if (fileName != "") { if (fileName != "") {
_currentSourceFile = fileName; _currentSourceFile = fileName;
QFileInfo fileInfo(fileName); TQFileInfo fileInfo(fileName);
_currentSourceFileExtension = fileInfo.suffix(); _currentSourceFileExtension = fileInfo.suffix();
openedSourceFileContent = loadFile(fileName); openedSourceFileContent = loadFile(fileName);
@ -474,13 +474,13 @@ void MainWindow::openSourceFileDialog(QString fileName) {
If the file already exists and it should be overwritten, a warning is shown before. If the file already exists and it should be overwritten, a warning is shown before.
*/ */
bool MainWindow::saveasSourceFileDialog(QAction *chosenEncodingAction) { bool MainWindow::saveasSourceFileDialog(TQAction *chosenEncodingAction) {
QString encoding; TQString encoding;
QString fileExtensions = tr("Supported by indenter")+" ("+_indentHandler->getPossibleIndenterFileExtensions()+ TQString fileExtensions = tr("Supported by indenter")+" ("+_indentHandler->getPossibleIndenterFileExtensions()+
");;"+tr("All files")+" (*.*)"; ");;"+tr("All files")+" (*.*)";
//QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions ); //TQString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
QString fileName = QFileDialog::getSaveFileName( this, tr("Save source code file"), _currentSourceFile, fileExtensions); TQString fileName = TQFileDialog::getSaveFileName( this, tr("Save source code file"), _currentSourceFile, fileExtensions);
// Saving has been canceled if the filename is empty // Saving has been canceled if the filename is empty
if ( fileName.isEmpty() ) { if ( fileName.isEmpty() ) {
@ -490,9 +490,9 @@ bool MainWindow::saveasSourceFileDialog(QAction *chosenEncodingAction) {
_savedSourceContent = _qSciSourceCodeEditor->text(); _savedSourceContent = _qSciSourceCodeEditor->text();
_currentSourceFile = fileName; _currentSourceFile = fileName;
QFile::remove(fileName); TQFile::remove(fileName);
QFile outSrcFile(fileName); TQFile outSrcFile(fileName);
outSrcFile.open( QFile::ReadWrite | QFile::Text ); outSrcFile.open( TQFile::ReadWrite | TQFile::Text );
// Get current encoding. // Get current encoding.
if ( chosenEncodingAction != NULL ) { if ( chosenEncodingAction != NULL ) {
@ -501,12 +501,12 @@ bool MainWindow::saveasSourceFileDialog(QAction *chosenEncodingAction) {
else { else {
encoding = _encodingActionGroup->checkedAction()->text(); encoding = _encodingActionGroup->checkedAction()->text();
} }
QTextStream outSrcStrm(&outSrcFile); TQTextStream outSrcStrm(&outSrcFile);
outSrcStrm.setCodec( QTextCodec::codecForName(encoding.toAscii()) ); outSrcStrm.setCodec( TQTextCodec::codecForName(encoding.toAscii()) );
outSrcStrm << _savedSourceContent; outSrcStrm << _savedSourceContent;
outSrcFile.close(); outSrcFile.close();
QFileInfo fileInfo(fileName); TQFileInfo fileInfo(fileName);
_currentSourceFileExtension = fileInfo.suffix(); _currentSourceFileExtension = fileInfo.suffix();
_qSciSourceCodeEditor->setModified( false ); _qSciSourceCodeEditor->setModified( false );
@ -528,15 +528,15 @@ bool MainWindow::saveSourceFile() {
return saveasSourceFileDialog(); return saveasSourceFileDialog();
} }
else { else {
QFile::remove(_currentSourceFile); TQFile::remove(_currentSourceFile);
QFile outSrcFile(_currentSourceFile); TQFile outSrcFile(_currentSourceFile);
_savedSourceContent = _qSciSourceCodeEditor->text(); _savedSourceContent = _qSciSourceCodeEditor->text();
outSrcFile.open( QFile::ReadWrite | QFile::Text ); outSrcFile.open( TQFile::ReadWrite | TQFile::Text );
// Get current encoding. // Get current encoding.
QString _currentEncoding = _encodingActionGroup->checkedAction()->text(); TQString _currentEncoding = _encodingActionGroup->checkedAction()->text();
QTextStream outSrcStrm(&outSrcFile); TQTextStream outSrcStrm(&outSrcFile);
outSrcStrm.setCodec( QTextCodec::codecForName(_currentEncoding.toAscii()) ); outSrcStrm.setCodec( TQTextCodec::codecForName(_currentEncoding.toAscii()) );
outSrcStrm << _savedSourceContent; outSrcStrm << _savedSourceContent;
outSrcFile.close(); outSrcFile.close();
@ -551,12 +551,12 @@ bool MainWindow::saveSourceFile() {
\brief Shows a file open dialog. \brief Shows a file open dialog.
Shows a file open dialog with the title \a dialogHeaderStr starting in the directory \a startPath 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. and with a file mask defined by \a fileMaskStr. Returns the contents of the file as TQString.
*/ */
QString MainWindow::openFileDialog(QString dialogHeaderStr, QString startPath, QString fileMaskStr) { TQString MainWindow::openFileDialog(TQString dialogHeaderStr, TQString startPath, TQString fileMaskStr) {
QString fileContent = ""; TQString fileContent = "";
QString fileName = QFileDialog::getOpenFileName( NULL, dialogHeaderStr, startPath, fileMaskStr); TQString fileName = TQFileDialog::getOpenFileName( NULL, dialogHeaderStr, startPath, fileMaskStr);
if (fileName != "") { if (fileName != "") {
fileContent = loadFile(fileName); fileContent = loadFile(fileName);
@ -602,10 +602,10 @@ void MainWindow::updateSourceView() {
The original loaded source code file will not be changed. The original loaded source code file will not be changed.
*/ */
void MainWindow::callIndenter() { void MainWindow::callIndenter() {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); TQApplication::setOverrideCursor(TQCursor(TQt::WaitCursor));
_sourceFormattedContent = _indentHandler->callIndenter(_sourceFileContent, _currentSourceFileExtension); _sourceFormattedContent = _indentHandler->callIndenter(_sourceFileContent, _currentSourceFileExtension);
//updateSourceView(); //updateSourceView();
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
} }
@ -628,7 +628,7 @@ void MainWindow::turnHighlightOnOff(bool turnOn) {
\brief Added this slot to avoid multiple calls because of changed text. \brief Added this slot to avoid multiple calls because of changed text.
*/ */
void MainWindow::sourceCodeChangedHelperSlot() { void MainWindow::sourceCodeChangedHelperSlot() {
QTimer::singleShot(0, this, SLOT(sourceCodeChangedSlot())); TQTimer::singleShot(0, this, SLOT(sourceCodeChangedSlot()));
} }
@ -637,9 +637,9 @@ void MainWindow::sourceCodeChangedHelperSlot() {
to format the changed source code. to format the changed source code.
*/ */
void MainWindow::sourceCodeChangedSlot() { void MainWindow::sourceCodeChangedSlot() {
QChar enteredCharacter; TQChar enteredCharacter;
int cursorPos, cursorPosAbsolut, cursorLine; int cursorPos, cursorPosAbsolut, cursorLine;
QString text; TQString text;
_sourceCodeChanged = true; _sourceCodeChanged = true;
if ( _scrollPositionChanged ) { if ( _scrollPositionChanged ) {
@ -750,7 +750,7 @@ void MainWindow::sourceCodeChangedSlot() {
setWindowModified( false ); setWindowModified( false );
} }
else { else {
_qSciSourceCodeEditor->setModified( true ); // Has no effect according to QScintilla docs. _qSciSourceCodeEditor->setModified( true ); // Has no effect according to TQScintilla docs.
setWindowModified( true ); setWindowModified( true );
} }
@ -798,7 +798,7 @@ void MainWindow::indentSettingsChangedSlot() {
setWindowModified( false ); setWindowModified( false );
} }
else { else {
_qSciSourceCodeEditor->setModified( true ); // Has no effect according to QScintilla docs. _qSciSourceCodeEditor->setModified( true ); // Has no effect according to TQScintilla docs.
setWindowModified( true ); setWindowModified( true );
} }
} }
@ -848,7 +848,7 @@ void MainWindow::previewTurnedOnOff(bool turnOn) {
source code filename. source code filename.
*/ */
void MainWindow::updateWindowTitle() { void MainWindow::updateWindowTitle() {
this->setWindowTitle( "UniversalIndentGUI " + QString(PROGRAM_VERSION_STRING) + " [*]" + _currentSourceFile ); this->setWindowTitle( "UniversalIndentGUI " + TQString(PROGRAM_VERSION_STRING) + " [*]" + _currentSourceFile );
} }
@ -856,18 +856,18 @@ void MainWindow::updateWindowTitle() {
\brief Opens a dialog to save the current source code as a PDF document. \brief Opens a dialog to save the current source code as a PDF document.
*/ */
void MainWindow::exportToPDF() { void MainWindow::exportToPDF() {
QString fileExtensions = tr("PDF Document")+" (*.pdf)"; TQString fileExtensions = tr("PDF Document")+" (*.pdf)";
QString fileName = _currentSourceFile; TQString fileName = _currentSourceFile;
QFileInfo fileInfo(fileName); TQFileInfo fileInfo(fileName);
QString fileExtension = fileInfo.suffix(); TQString fileExtension = fileInfo.suffix();
fileName.replace( fileName.length()-fileExtension.length(), fileExtension.length(), "pdf" ); fileName.replace( fileName.length()-fileExtension.length(), fileExtension.length(), "pdf" );
fileName = QFileDialog::getSaveFileName( this, tr("Export source code file"), fileName, fileExtensions); fileName = TQFileDialog::getSaveFileName( this, tr("Export source code file"), fileName, fileExtensions);
if ( !fileName.isEmpty() ) { if ( !fileName.isEmpty() ) {
QsciPrinter printer(QPrinter::HighResolution); QsciPrinter printer(TQPrinter::HighResolution);
printer.setOutputFormat(QPrinter::PdfFormat); printer.setOutputFormat(TQPrinter::PdfFormat);
printer.setOutputFileName(fileName); printer.setOutputFileName(fileName);
printer.printRange(_qSciSourceCodeEditor); printer.printRange(_qSciSourceCodeEditor);
} }
@ -878,27 +878,27 @@ void MainWindow::exportToPDF() {
\brief Opens a dialog to save the current source code as a HTML document. \brief Opens a dialog to save the current source code as a HTML document.
*/ */
void MainWindow::exportToHTML() { void MainWindow::exportToHTML() {
QString fileExtensions = tr("HTML Document")+" (*.html)"; TQString fileExtensions = tr("HTML Document")+" (*.html)";
QString fileName = _currentSourceFile; TQString fileName = _currentSourceFile;
QFileInfo fileInfo(fileName); TQFileInfo fileInfo(fileName);
QString fileExtension = fileInfo.suffix(); TQString fileExtension = fileInfo.suffix();
fileName.replace( fileName.length()-fileExtension.length(), fileExtension.length(), "html" ); fileName.replace( fileName.length()-fileExtension.length(), fileExtension.length(), "html" );
fileName = QFileDialog::getSaveFileName( this, tr("Export source code file"), fileName, fileExtensions); fileName = TQFileDialog::getSaveFileName( this, tr("Export source code file"), fileName, fileExtensions);
if ( !fileName.isEmpty() ) { if ( !fileName.isEmpty() ) {
// Create a document from which HTML code can be generated. // Create a document from which HTML code can be generated.
QTextDocument sourceCodeDocument( _qSciSourceCodeEditor->text() ); TQTextDocument sourceCodeDocument( _qSciSourceCodeEditor->text() );
sourceCodeDocument.setDefaultFont( QFont("Courier", 12, QFont::Normal) ); sourceCodeDocument.setDefaultFont( TQFont("Courier", 12, TQFont::Normal) );
QString sourceCodeAsHTML = sourceCodeDocument.toHtml(); TQString sourceCodeAsHTML = sourceCodeDocument.toHtml();
// To ensure that empty lines are kept in the HTML code make this replacement. // To ensure that empty lines are kept in the HTML code make this replacement.
sourceCodeAsHTML.replace("\"></p>", "\"><br /></p>"); sourceCodeAsHTML.replace("\"></p>", "\"><br /></p>");
// Write the HTML file. // Write the HTML file.
QFile::remove(fileName); TQFile::remove(fileName);
QFile outSrcFile(fileName); TQFile outSrcFile(fileName);
outSrcFile.open( QFile::ReadWrite | QFile::Text ); outSrcFile.open( TQFile::ReadWrite | TQFile::Text );
outSrcFile.write( sourceCodeAsHTML.toAscii() ); outSrcFile.write( sourceCodeAsHTML.toAscii() );
outSrcFile.close(); outSrcFile.close();
} }
@ -922,14 +922,14 @@ void MainWindow::loadLastOpenedFile() {
_currentSourceFile = _settings->getValueByName("lastSourceCodeFile").toString().split("|").first(); _currentSourceFile = _settings->getValueByName("lastSourceCodeFile").toString().split("|").first();
// If source file exist load it. // If source file exist load it.
if ( QFile::exists(_currentSourceFile) ) { if ( TQFile::exists(_currentSourceFile) ) {
QFileInfo fileInfo(_currentSourceFile); TQFileInfo fileInfo(_currentSourceFile);
_currentSourceFile = fileInfo.absoluteFilePath(); _currentSourceFile = fileInfo.absoluteFilePath();
_sourceFileContent = loadFile(_currentSourceFile); _sourceFileContent = loadFile(_currentSourceFile);
} }
// If the last opened source code file does not exist, try to load the default example.cpp file. // 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" ) ) { else if ( TQFile::exists( SettingsPaths::getIndenterPath() + "/example.cpp" ) ) {
QFileInfo fileInfo( SettingsPaths::getIndenterPath() + "/example.cpp" ); TQFileInfo fileInfo( SettingsPaths::getIndenterPath() + "/example.cpp" );
_currentSourceFile = fileInfo.absoluteFilePath(); _currentSourceFile = fileInfo.absoluteFilePath();
_sourceFileContent = loadFile(_currentSourceFile); _sourceFileContent = loadFile(_currentSourceFile);
} }
@ -976,7 +976,7 @@ void MainWindow::saveSettings() {
/*! /*!
\brief Is always called when the program is quit. Calls the saveSettings function before really quits. \brief Is always called when the program is quit. Calls the saveSettings function before really quits.
*/ */
void MainWindow::closeEvent( QCloseEvent *event ) { void MainWindow::closeEvent( TQCloseEvent *event ) {
if ( maybeSave() ) { if ( maybeSave() ) {
saveSettings(); saveSettings();
event->accept(); event->accept();
@ -994,19 +994,19 @@ void MainWindow::closeEvent( QCloseEvent *event ) {
for indenter parameters are connected with this event filter. for indenter parameters are connected with this event filter.
So depending on the _settings the tooltips can be enabled and disabled for these widgets. So depending on the _settings the tooltips can be enabled and disabled for these widgets.
*/ */
bool MainWindow::eventFilter(QObject *obj, QEvent *event) { bool MainWindow::eventFilter(TQObject *obj, TQEvent *event) {
if ( event->type() == QEvent::ToolTip) { if ( event->type() == TQEvent::ToolTip) {
if ( _mainWindowForm->indenterParameterTooltipsEnabledAction->isChecked() ) { if ( _mainWindowForm->indenterParameterTooltipsEnabledAction->isChecked() ) {
return QMainWindow::eventFilter(obj, event); return TQMainWindow::eventFilter(obj, event);
} }
else { else {
//QToolTip::showText( QPoint(100,100) , "Test1"); //TQToolTip::showText( TQPoint(100,100) , "Test1");
return true; return true;
} }
} }
else { else {
// pass the event on to the parent class // pass the event on to the parent class
return QMainWindow::eventFilter(obj, event); return TQMainWindow::eventFilter(obj, event);
} }
} }
@ -1016,15 +1016,15 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
*/ */
bool MainWindow::maybeSave() { bool MainWindow::maybeSave() {
if ( isWindowModified() ) { if ( isWindowModified() ) {
int ret = QMessageBox::warning(this, tr("Modified code"), int ret = TQMessageBox::warning(this, tr("Modified code"),
tr("The source code has been modified.\nDo you want to save your changes?"), tr("The source code has been modified.\nDo you want to save your changes?"),
QMessageBox::Yes | QMessageBox::Default, TQMessageBox::Yes | TQMessageBox::Default,
QMessageBox::No, TQMessageBox::No,
QMessageBox::Cancel | QMessageBox::Escape); TQMessageBox::Cancel | TQMessageBox::Escape);
if (ret == QMessageBox::Yes) { if (ret == TQMessageBox::Yes) {
return saveSourceFile(); return saveSourceFile();
} }
else if (ret == QMessageBox::Cancel) { else if (ret == TQMessageBox::Cancel) {
return false; return false;
} }
} }
@ -1039,25 +1039,25 @@ bool MainWindow::maybeSave() {
void MainWindow::languageChanged(int languageIndex) { void MainWindow::languageChanged(int languageIndex) {
if ( languageIndex < _settings->getAvailableTranslations().size() ) { if ( languageIndex < _settings->getAvailableTranslations().size() ) {
// Get the mnemonic of the new selected language. // Get the mnemonic of the new selected language.
QString languageShort = _settings->getAvailableTranslations().at(languageIndex); TQString languageShort = _settings->getAvailableTranslations().at(languageIndex);
// Remove the old qt translation. // Remove the old qt translation.
qApp->removeTranslator( _qTTranslator ); tqApp->removeTranslator( _qTTranslator );
// Remove the old uigui translation. // Remove the old uigui translation.
qApp->removeTranslator( _uiGuiTranslator ); tqApp->removeTranslator( _uiGuiTranslator );
// Load the Qt own translation file and set it for the application. // Load the TQt own translation file and set it for the application.
bool translationFileLoaded; bool translationFileLoaded;
translationFileLoaded = _qTTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/qt_" + languageShort ); translationFileLoaded = _qTTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/qt_" + languageShort );
if ( translationFileLoaded ) { if ( translationFileLoaded ) {
qApp->installTranslator(_qTTranslator); tqApp->installTranslator(_qTTranslator);
} }
// Load the uigui translation file and set it for the application. // Load the uigui translation file and set it for the application.
translationFileLoaded = _uiGuiTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/universalindent_" + languageShort ); translationFileLoaded = _uiGuiTranslator->load( SettingsPaths::getGlobalFilesPath() + "/translations/universalindent_" + languageShort );
if ( translationFileLoaded ) { if ( translationFileLoaded ) {
qApp->installTranslator(_uiGuiTranslator); tqApp->installTranslator(_uiGuiTranslator);
} }
} }
} }
@ -1067,22 +1067,22 @@ void MainWindow::languageChanged(int languageIndex) {
\brief Creates a menu entries in the file menu for opening and saving a file with different encodings. \brief Creates a menu entries in the file menu for opening and saving a file with different encodings.
*/ */
void MainWindow::createEncodingMenu() { void MainWindow::createEncodingMenu() {
QAction *encodingAction; TQAction *encodingAction;
QString encodingName; TQString encodingName;
_encodingsList = QStringList() << "UTF-8" << "UTF-16" << "UTF-16BE" << "UTF-16LE" _encodingsList = TQStringList() << "UTF-8" << "UTF-16" << "UTF-16BE" << "UTF-16LE"
<< "Apple Roman" << "Big5" << "Big5-HKSCS" << "EUC-JP" << "EUC-KR" << "GB18030-0" << "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" << "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" << "Iscii-Bng" << "JIS X 0201" << "JIS X 0208" << "KOI8-R" << "KOI8-U" << "MuleLao-1"
<< "ROMAN8" << "Shift-JIS" << "TIS-620" << "TSCII" << "Windows-1250" << "WINSAMI2"; << "ROMAN8" << "Shift-JIS" << "TIS-620" << "TSCII" << "Windows-1250" << "WINSAMI2";
_encodingActionGroup = new QActionGroup(this); _encodingActionGroup = new TQActionGroup(this);
_saveEncodedActionGroup = new QActionGroup(this); _saveEncodedActionGroup = new TQActionGroup(this);
// Loop for each available encoding // Loop for each available encoding
foreach ( encodingName, _encodingsList ) { foreach ( encodingName, _encodingsList ) {
// Create actions for the "reopen" menu // Create actions for the "reopen" menu
encodingAction = new QAction(encodingName, _encodingActionGroup); encodingAction = new TQAction(encodingName, _encodingActionGroup);
encodingAction->setStatusTip( tr("Reopen the currently opened source code file by using the text encoding scheme ") + encodingName ); encodingAction->setStatusTip( tr("Reopen the currently opened source code file by using the text encoding scheme ") + encodingName );
encodingAction->setCheckable(true); encodingAction->setCheckable(true);
if ( encodingName == _currentEncoding ) { if ( encodingName == _currentEncoding ) {
@ -1090,15 +1090,15 @@ void MainWindow::createEncodingMenu() {
} }
// Create actions for the "save as encoded" menu // Create actions for the "save as encoded" menu
encodingAction = new QAction(encodingName, _saveEncodedActionGroup); encodingAction = new TQAction(encodingName, _saveEncodedActionGroup);
encodingAction->setStatusTip( tr("Save the currently opened source code file by using the text encoding scheme ") + encodingName ); encodingAction->setStatusTip( tr("Save the currently opened source code file by using the text encoding scheme ") + encodingName );
} }
_mainWindowForm->encodingMenu->addActions( _encodingActionGroup->actions() ); _mainWindowForm->encodingMenu->addActions( _encodingActionGroup->actions() );
connect( _encodingActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(encodingChanged(QAction*)) ); connect( _encodingActionGroup, SIGNAL(triggered(TQAction*)), this, SLOT(encodingChanged(TQAction*)) );
_mainWindowForm->saveEncodedMenu->addActions( _saveEncodedActionGroup->actions() ); _mainWindowForm->saveEncodedMenu->addActions( _saveEncodedActionGroup->actions() );
connect( _saveEncodedActionGroup, SIGNAL(triggered(QAction*)), this, SLOT(saveAsOtherEncoding(QAction*)) ); connect( _saveEncodedActionGroup, SIGNAL(triggered(TQAction*)), this, SLOT(saveAsOtherEncoding(TQAction*)) );
} }
@ -1108,12 +1108,12 @@ void MainWindow::createEncodingMenu() {
If the saving is successful and not aborted, the currently used encoding, visible in the If the saving is successful and not aborted, the currently used encoding, visible in the
"reopen" menu, is also changed to the new encoding. "reopen" menu, is also changed to the new encoding.
*/ */
void MainWindow::saveAsOtherEncoding(QAction *chosenEncodingAction) { void MainWindow::saveAsOtherEncoding(TQAction *chosenEncodingAction) {
bool fileWasSaved = saveasSourceFileDialog(chosenEncodingAction); bool fileWasSaved = saveasSourceFileDialog(chosenEncodingAction);
// If the file was save with another encoding, change the selected encoding in the reopen menu. // If the file was save with another encoding, change the selected encoding in the reopen menu.
if ( fileWasSaved ) { if ( fileWasSaved ) {
foreach ( QAction *action, _encodingActionGroup->actions() ) { foreach ( TQAction *action, _encodingActionGroup->actions() ) {
if ( action->text() == chosenEncodingAction->text() ) { if ( action->text() == chosenEncodingAction->text() ) {
action->setChecked(true); action->setChecked(true);
return; return;
@ -1126,22 +1126,22 @@ void MainWindow::saveAsOtherEncoding(QAction *chosenEncodingAction) {
/*! /*!
\brief This slot is called whenever an encoding is selected in the settings menu. \brief This slot is called whenever an encoding is selected in the settings menu.
*/ */
void MainWindow::encodingChanged(QAction* encodingAction) { void MainWindow::encodingChanged(TQAction* encodingAction) {
if ( maybeSave() ) { if ( maybeSave() ) {
QFile inSrcFile(_currentSourceFile); TQFile inSrcFile(_currentSourceFile);
QString fileContent = ""; TQString fileContent = "";
if ( !inSrcFile.open(QFile::ReadOnly | QFile::Text) ) { if ( !inSrcFile.open(TQFile::ReadOnly | TQFile::Text) ) {
QMessageBox::warning(NULL, tr("Error opening file"), tr("Cannot read the file ")+"\""+_currentSourceFile+"\"." ); TQMessageBox::warning(NULL, tr("Error opening file"), tr("Cannot read the file ")+"\""+_currentSourceFile+"\"." );
} }
else { else {
QTextStream inSrcStrm(&inSrcFile); TQTextStream inSrcStrm(&inSrcFile);
QApplication::setOverrideCursor(Qt::WaitCursor); TQApplication::setOverrideCursor(TQt::WaitCursor);
QString encodingName = encodingAction->text(); TQString encodingName = encodingAction->text();
_currentEncoding = encodingName; _currentEncoding = encodingName;
inSrcStrm.setCodec( QTextCodec::codecForName(encodingName.toAscii()) ); inSrcStrm.setCodec( TQTextCodec::codecForName(encodingName.toAscii()) );
fileContent = inSrcStrm.readAll(); fileContent = inSrcStrm.readAll();
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
inSrcFile.close(); inSrcFile.close();
_qSciSourceCodeEditor->setText( fileContent ); _qSciSourceCodeEditor->setText( fileContent );
_qSciSourceCodeEditor->setModified(false); _qSciSourceCodeEditor->setModified(false);
@ -1154,21 +1154,21 @@ void MainWindow::encodingChanged(QAction* encodingAction) {
\brief Creates a menu entry under the settings menu for all available text encodings. \brief Creates a menu entry under the settings menu for all available text encodings.
*/ */
void MainWindow::createHighlighterMenu() { void MainWindow::createHighlighterMenu() {
QAction *highlighterAction; TQAction *highlighterAction;
QString highlighterName; TQString highlighterName;
_highlighterActionGroup = new QActionGroup(this); _highlighterActionGroup = new TQActionGroup(this);
// Loop for each known highlighter // Loop for each known highlighter
foreach ( highlighterName, _highlighter->getAvailableHighlighters() ) { foreach ( highlighterName, _highlighter->getAvailableHighlighters() ) {
highlighterAction = new QAction(highlighterName, _highlighterActionGroup); highlighterAction = new TQAction(highlighterName, _highlighterActionGroup);
highlighterAction->setStatusTip( tr("Set the syntax highlightning to ") + highlighterName ); highlighterAction->setStatusTip( tr("Set the syntax highlightning to ") + highlighterName );
highlighterAction->setCheckable(true); highlighterAction->setCheckable(true);
} }
_mainWindowForm->highlighterMenu->addActions( _highlighterActionGroup->actions() ); _mainWindowForm->highlighterMenu->addActions( _highlighterActionGroup->actions() );
_mainWindowForm->menuSettings->insertMenu(_mainWindowForm->indenterParameterTooltipsEnabledAction, _mainWindowForm->highlighterMenu ); _mainWindowForm->menuSettings->insertMenu(_mainWindowForm->indenterParameterTooltipsEnabledAction, _mainWindowForm->highlighterMenu );
connect( _highlighterActionGroup, SIGNAL(triggered(QAction*)), _highlighter, SLOT(setHighlighterByAction(QAction*)) ); connect( _highlighterActionGroup, SIGNAL(triggered(TQAction*)), _highlighter, SLOT(setHighlighterByAction(TQAction*)) );
} }
@ -1191,7 +1191,7 @@ void MainWindow::setWhiteSpaceVisibility(bool visible) {
and adapts the margin for the displayed line numbers. and adapts the margin for the displayed line numbers.
*/ */
void MainWindow::numberOfLinesChanged() { void MainWindow::numberOfLinesChanged() {
QString lineNumbers; TQString lineNumbers;
lineNumbers.setNum( _qSciSourceCodeEditor->lines()*10 ); lineNumbers.setNum( _qSciSourceCodeEditor->lines()*10 );
_qSciSourceCodeEditor->setMarginWidth(1, lineNumbers); _qSciSourceCodeEditor->setMarginWidth(1, lineNumbers);
} }
@ -1200,11 +1200,11 @@ void MainWindow::numberOfLinesChanged() {
/*! /*!
\brief Catches language change events and retranslates all needed widgets. \brief Catches language change events and retranslates all needed widgets.
*/ */
void MainWindow::changeEvent(QEvent *event) { void MainWindow::changeEvent(TQEvent *event) {
int i = 0; int i = 0;
if (event->type() == QEvent::LanguageChange) { if (event->type() == TQEvent::LanguageChange) {
QString languageName; TQString languageName;
// Translate the main window. // Translate the main window.
_mainWindowForm->retranslateUi(this); _mainWindowForm->retranslateUi(this);
@ -1217,7 +1217,7 @@ void MainWindow::changeEvent(QEvent *event) {
_indentHandler->retranslateUi(); _indentHandler->retranslateUi();
// Translate the load encoding menu. // Translate the load encoding menu.
QList<QAction *> encodingActionList = _encodingActionGroup->actions(); TQList<TQAction *> encodingActionList = _encodingActionGroup->actions();
for ( i = 0; i < encodingActionList.size(); i++ ) { 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) ); encodingActionList.at(i)->setStatusTip( tr("Reopen the currently opened source code file by using the text encoding scheme ") + _encodingsList.at(i) );
} }
@ -1229,10 +1229,10 @@ void MainWindow::changeEvent(QEvent *event) {
} }
// Translate the _highlighter menu. // Translate the _highlighter menu.
QList<QAction *> actionList = _mainWindowForm->highlighterMenu->actions(); TQList<TQAction *> actionList = _mainWindowForm->highlighterMenu->actions();
i = 0; i = 0;
foreach ( QString highlighterName, _highlighter->getAvailableHighlighters() ) { foreach ( TQString highlighterName, _highlighter->getAvailableHighlighters() ) {
QAction *highlighterAction = actionList.at(i); TQAction *highlighterAction = actionList.at(i);
highlighterAction->setStatusTip( tr("Set the syntax highlightning to ") + highlighterName ); highlighterAction->setStatusTip( tr("Set the syntax highlightning to ") + highlighterName );
i++; i++;
} }
@ -1243,7 +1243,7 @@ void MainWindow::changeEvent(QEvent *event) {
setStatusBarCursorPosInfo( line, column ); setStatusBarCursorPosInfo( line, column );
} }
else { else {
QWidget::changeEvent(event); TQWidget::changeEvent(event);
} }
} }
@ -1258,10 +1258,10 @@ void MainWindow::changeEvent(QEvent *event) {
the recently opened menu will be updated too. the recently opened menu will be updated too.
*/ */
void MainWindow::updateRecentlyOpenedList() { void MainWindow::updateRecentlyOpenedList() {
QString fileName; TQString fileName;
QString filePath; TQString filePath;
QStringList recentlyOpenedList = _settings->getValueByName("lastSourceCodeFile").toString().split("|"); TQStringList recentlyOpenedList = _settings->getValueByName("lastSourceCodeFile").toString().split("|");
QList<QAction*> recentlyOpenedActionList = _mainWindowForm->menuRecently_Opened_Files->actions(); TQList<TQAction*> recentlyOpenedActionList = _mainWindowForm->menuRecently_Opened_Files->actions();
// Check if the currently open file is in the list of recently opened. // Check if the currently open file is in the list of recently opened.
int indexOfCurrentFile = recentlyOpenedList.indexOf( _currentSourceFile ); int indexOfCurrentFile = recentlyOpenedList.indexOf( _currentSourceFile );
@ -1274,7 +1274,7 @@ void MainWindow::updateRecentlyOpenedList() {
// Put the current file at the first position if it not already is and is not empty. // Put the current file at the first position if it not already is and is not empty.
else if ( indexOfCurrentFile == -1 && !_currentSourceFile.isEmpty() ) { else if ( indexOfCurrentFile == -1 && !_currentSourceFile.isEmpty() ) {
recentlyOpenedList.insert(0, _currentSourceFile); recentlyOpenedList.insert(0, _currentSourceFile);
QAction *recentlyOpenedAction = new QAction(QFileInfo(_currentSourceFile).fileName(), _mainWindowForm->menuRecently_Opened_Files); TQAction *recentlyOpenedAction = new TQAction(TQFileInfo(_currentSourceFile).fileName(), _mainWindowForm->menuRecently_Opened_Files);
recentlyOpenedAction->setStatusTip(_currentSourceFile); recentlyOpenedAction->setStatusTip(_currentSourceFile);
recentlyOpenedActionList.insert(0, recentlyOpenedAction ); recentlyOpenedActionList.insert(0, recentlyOpenedAction );
} }
@ -1286,20 +1286,20 @@ void MainWindow::updateRecentlyOpenedList() {
// loop only as long as maximum allowed list entries are set. // loop only as long as maximum allowed list entries are set.
for ( int i = 0; i < recentlyOpenedList.size() && i < recentlyOpenedListMaxSize; ) { for ( int i = 0; i < recentlyOpenedList.size() && i < recentlyOpenedListMaxSize; ) {
filePath = recentlyOpenedList.at(i); filePath = recentlyOpenedList.at(i);
QFileInfo fileInfo(filePath); TQFileInfo fileInfo(filePath);
// If the file does no longer exist, remove it from the list. // If the file does no longer exist, remove it from the list.
if ( !fileInfo.exists() ) { if ( !fileInfo.exists() ) {
recentlyOpenedList.takeAt(i); recentlyOpenedList.takeAt(i);
if ( i < recentlyOpenedActionList.size()-2 ) { if ( i < recentlyOpenedActionList.size()-2 ) {
QAction* action = recentlyOpenedActionList.takeAt(i); TQAction* action = recentlyOpenedActionList.takeAt(i);
delete action; delete action;
} }
} }
// else if its not already in the menu, add it to the menu. // else if its not already in the menu, add it to the menu.
else { else {
if ( i >= recentlyOpenedActionList.size()-2 ) { if ( i >= recentlyOpenedActionList.size()-2 ) {
QAction *recentlyOpenedAction = new QAction(fileInfo.fileName(), _mainWindowForm->menuRecently_Opened_Files); TQAction *recentlyOpenedAction = new TQAction(fileInfo.fileName(), _mainWindowForm->menuRecently_Opened_Files);
recentlyOpenedAction->setStatusTip(filePath); recentlyOpenedAction->setStatusTip(filePath);
recentlyOpenedActionList.insert( recentlyOpenedActionList.size()-2, recentlyOpenedAction ); recentlyOpenedActionList.insert( recentlyOpenedActionList.size()-2, recentlyOpenedAction );
} }
@ -1310,7 +1310,7 @@ void MainWindow::updateRecentlyOpenedList() {
// Trim the list to its in the _settings allowed maximum size. // Trim the list to its in the _settings allowed maximum size.
while ( recentlyOpenedList.size() > recentlyOpenedListMaxSize ) { while ( recentlyOpenedList.size() > recentlyOpenedListMaxSize ) {
recentlyOpenedList.takeLast(); recentlyOpenedList.takeLast();
QAction* action = recentlyOpenedActionList.takeAt( recentlyOpenedActionList.size()-3 ); TQAction* action = recentlyOpenedActionList.takeAt( recentlyOpenedActionList.size()-3 );
delete action; delete action;
} }
@ -1335,12 +1335,12 @@ void MainWindow::updateRecentlyOpenedList() {
\brief This slot empties the list of recently opened files. \brief This slot empties the list of recently opened files.
*/ */
void MainWindow::clearRecentlyOpenedList() { void MainWindow::clearRecentlyOpenedList() {
QStringList recentlyOpenedList = _settings->getValueByName("lastSourceCodeFile").toString().split("|"); TQStringList recentlyOpenedList = _settings->getValueByName("lastSourceCodeFile").toString().split("|");
QList<QAction*> recentlyOpenedActionList = _mainWindowForm->menuRecently_Opened_Files->actions(); TQList<TQAction*> recentlyOpenedActionList = _mainWindowForm->menuRecently_Opened_Files->actions();
while ( recentlyOpenedList.size() > 0 ) { while ( recentlyOpenedList.size() > 0 ) {
recentlyOpenedList.takeLast(); recentlyOpenedList.takeLast();
QAction* action = recentlyOpenedActionList.takeAt( recentlyOpenedActionList.size()-3 ); TQAction* action = recentlyOpenedActionList.takeAt( recentlyOpenedActionList.size()-3 );
delete action; delete action;
} }
@ -1356,7 +1356,7 @@ void MainWindow::clearRecentlyOpenedList() {
\brief This slot is called if an entry from the list of recently opened files is \brief This slot is called if an entry from the list of recently opened files is
being selected. being selected.
*/ */
void MainWindow::openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction) { void MainWindow::openFileFromRecentlyOpenedList(TQAction* recentlyOpenedAction) {
// If the selected action from the recently opened list menu is the clear action // If the selected action from the recently opened list menu is the clear action
// call the slot to clear the list and then leave. // call the slot to clear the list and then leave.
if ( recentlyOpenedAction == _mainWindowForm->actionClear_Recently_Opened_List ) { if ( recentlyOpenedAction == _mainWindowForm->actionClear_Recently_Opened_List ) {
@ -1364,11 +1364,11 @@ void MainWindow::openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction) {
return; return;
} }
QString fileName = recentlyOpenedAction->text(); TQString fileName = recentlyOpenedAction->text();
int indexOfSelectedFile = _mainWindowForm->menuRecently_Opened_Files->actions().indexOf( recentlyOpenedAction ); int indexOfSelectedFile = _mainWindowForm->menuRecently_Opened_Files->actions().indexOf( recentlyOpenedAction );
QStringList recentlyOpenedList = _settings->getValueByName("lastSourceCodeFile").toString().split("|"); TQStringList recentlyOpenedList = _settings->getValueByName("lastSourceCodeFile").toString().split("|");
QString filePath = recentlyOpenedList.at(indexOfSelectedFile); TQString filePath = recentlyOpenedList.at(indexOfSelectedFile);
QFileInfo fileInfo(filePath); TQFileInfo fileInfo(filePath);
// If the file exists, open it. // If the file exists, open it.
if ( fileInfo.exists() ) { if ( fileInfo.exists() ) {
@ -1376,12 +1376,12 @@ void MainWindow::openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction) {
} }
// If it does not exist, show a warning message and update the list of recently opened files. // If it does not exist, show a warning message and update the list of recently opened files.
else { else {
QMessageBox::warning(NULL, tr("File no longer exists"), tr("The file %1 in the list of recently opened files does no longer exist.") ); TQMessageBox::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 // 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 // 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 // a TQt3Support function tries to emit a signal based on the existing actions and deleting
// any of these actions in updateRecentlyOpenedList() causes an error. // any of these actions in updateRecentlyOpenedList() causes an error.
QTimer::singleShot(0, this, SLOT(updateRecentlyOpenedList()) ); TQTimer::singleShot(0, this, SLOT(updateRecentlyOpenedList()) );
} }
} }
@ -1389,7 +1389,7 @@ void MainWindow::openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction) {
/*! /*!
\brief If the dragged in object contains urls/paths to a file, accept the drag. \brief If the dragged in object contains urls/paths to a file, accept the drag.
*/ */
void MainWindow::dragEnterEvent(QDragEnterEvent *event) { void MainWindow::dragEnterEvent(TQDragEnterEvent *event) {
if ( event->mimeData()->hasUrls() ) { if ( event->mimeData()->hasUrls() ) {
event->acceptProposedAction(); event->acceptProposedAction();
} }
@ -1399,9 +1399,9 @@ void MainWindow::dragEnterEvent(QDragEnterEvent *event) {
/*! /*!
\brief If the dropped in object contains urls/paths to a file, open that file. \brief If the dropped in object contains urls/paths to a file, open that file.
*/ */
void MainWindow::dropEvent(QDropEvent *event) { void MainWindow::dropEvent(TQDropEvent *event) {
if ( event->mimeData()->hasUrls() ) { if ( event->mimeData()->hasUrls() ) {
QString filePathName = event->mimeData()->urls().first().toLocalFile(); TQString filePathName = event->mimeData()->urls().first().toLocalFile();
openSourceFileDialog(filePathName); openSourceFileDialog(filePathName);
} }
@ -1413,8 +1413,8 @@ void MainWindow::dropEvent(QDropEvent *event) {
\brief If the dropped in object contains urls/paths to a file, open that file. \brief If the dropped in object contains urls/paths to a file, open that file.
*/ */
void MainWindow::showAboutDialog() { void MainWindow::showAboutDialog() {
//QPixmap originalPixmap = QPixmap::grabWindow(QApplication::desktop()->screen()->winId()); //TQPixmap originalPixmap = TQPixmap::grabWindow(TQApplication::desktop()->screen()->winId());
//qDebug("in main pixmap width %d, numScreens = %d", originalPixmap.size().width(), QApplication::desktop()->availableGeometry().width()); //tqDebug("in main pixmap width %d, numScreens = %d", originalPixmap.size().width(), TQApplication::desktop()->availableGeometry().width());
//_aboutDialogGraphicsView->setScreenshotPixmap( originalPixmap ); //_aboutDialogGraphicsView->setScreenshotPixmap( originalPixmap );
_aboutDialogGraphicsView->show(); _aboutDialogGraphicsView->show();
} }

@ -20,7 +20,7 @@
#ifndef MAINWINDOW_H #ifndef MAINWINDOW_H
#define MAINWINDOW_H #define MAINWINDOW_H
#include <tqmainwindow.h> #include <tntqmainwindow.h>
#include "UiGuiSettings.h" #include "UiGuiSettings.h"
@ -35,33 +35,33 @@ namespace Ui {
class MainWindowUi; class MainWindowUi;
} }
class QLabel; class TQLabel;
class QScrollBar; class TQScrollBar;
class QActionGroup; class TQActionGroup;
class QTranslator; class TQTranslator;
class QsciScintilla; class QsciScintilla;
class MainWindow : public QMainWindow class MainWindow : public TQMainWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
//! Constructor //! Constructor
MainWindow(QString file2OpenOnStart = "", QWidget *parent = NULL); MainWindow(TQString file2OpenOnStart = "", TQWidget *parent = NULL);
~MainWindow() { ~MainWindow() {
_settings.clear(); _settings.clear();
} }
protected: protected:
void closeEvent( QCloseEvent *event ); void closeEvent( TQCloseEvent *event );
bool eventFilter(QObject *obj, QEvent *event); bool eventFilter(TQObject *obj, TQEvent *event);
private slots: private slots:
void openSourceFileDialog(QString fileName = ""); void openSourceFileDialog(TQString fileName = "");
bool saveasSourceFileDialog(QAction *chosenEncodingAction = NULL); bool saveasSourceFileDialog(TQAction *chosenEncodingAction = NULL);
void saveAsOtherEncoding(QAction *chosenEncodingAction); void saveAsOtherEncoding(TQAction *chosenEncodingAction);
bool saveSourceFile(); bool saveSourceFile();
void callIndenter(); void callIndenter();
void updateSourceView(); void updateSourceView();
@ -74,10 +74,10 @@ private slots:
void exportToPDF(); void exportToPDF();
void exportToHTML(); void exportToHTML();
void languageChanged(int languageIndex); void languageChanged(int languageIndex);
void encodingChanged(QAction *encodingAction); void encodingChanged(TQAction *encodingAction);
void numberOfLinesChanged(); void numberOfLinesChanged();
void updateRecentlyOpenedList(); void updateRecentlyOpenedList();
void openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction); void openFileFromRecentlyOpenedList(TQAction* recentlyOpenedAction);
void clearRecentlyOpenedList(); void clearRecentlyOpenedList();
void showAboutDialog(); void showAboutDialog();
void setStatusBarCursorPosInfo(int line, int column); void setStatusBarCursorPosInfo(int line, int column);
@ -85,8 +85,8 @@ private slots:
private: private:
Ui::MainWindowUi *_mainWindowForm; Ui::MainWindowUi *_mainWindowForm;
QString loadFile(QString filePath); TQString loadFile(TQString filePath);
QString openFileDialog(QString dialogHeaderStr, QString startPath, QString fileMaskStr); TQString openFileDialog(TQString dialogHeaderStr, TQString startPath, TQString fileMaskStr);
void updateWindowTitle(); void updateWindowTitle();
void loadLastOpenedFile(); void loadLastOpenedFile();
void saveSettings(); void saveSettings();
@ -99,45 +99,45 @@ private:
void initTextEditor(); void initTextEditor();
void initSyntaxHighlighter(); void initSyntaxHighlighter();
void initIndenter(); void initIndenter();
void changeEvent(QEvent *event); void changeEvent(TQEvent *event);
void dragEnterEvent(QDragEnterEvent *event); void dragEnterEvent(TQDragEnterEvent *event);
void dropEvent(QDropEvent *event); void dropEvent(TQDropEvent *event);
QsciScintilla *_qSciSourceCodeEditor; QsciScintilla *_qSciSourceCodeEditor;
QSharedPointer<UiGuiSettings> _settings; TQSharedPointer<UiGuiSettings> _settings;
QString _currentEncoding; TQString _currentEncoding;
QString _sourceFileContent; TQString _sourceFileContent;
QString _sourceFormattedContent; TQString _sourceFormattedContent;
QString _sourceViewContent; TQString _sourceViewContent;
UiGuiHighlighter *_highlighter; UiGuiHighlighter *_highlighter;
QScrollBar *_textEditVScrollBar; TQScrollBar *_textEditVScrollBar;
AboutDialog *_aboutDialog; AboutDialog *_aboutDialog;
AboutDialogGraphicsView *_aboutDialogGraphicsView; AboutDialogGraphicsView *_aboutDialogGraphicsView;
UiGuiSettingsDialog *_settingsDialog; UiGuiSettingsDialog *_settingsDialog;
int _textEditLastScrollPos; int _textEditLastScrollPos;
int _currentIndenterID; int _currentIndenterID;
bool _loadLastSourceCodeFileOnStartup; bool _loadLastSourceCodeFileOnStartup;
QString _currentSourceFile; TQString _currentSourceFile;
QString _currentSourceFileExtension; TQString _currentSourceFileExtension;
QString _savedSourceContent; TQString _savedSourceContent;
QActionGroup *_encodingActionGroup; TQActionGroup *_encodingActionGroup;
QActionGroup *_saveEncodedActionGroup; TQActionGroup *_saveEncodedActionGroup;
QActionGroup *_highlighterActionGroup; TQActionGroup *_highlighterActionGroup;
QTranslator *_uiGuiTranslator; TQTranslator *_uiGuiTranslator;
QTranslator *_qTTranslator; TQTranslator *_qTTranslator;
bool _isFirstRunOfThisVersion; bool _isFirstRunOfThisVersion;
bool _sourceCodeChanged; bool _sourceCodeChanged;
bool _scrollPositionChanged; bool _scrollPositionChanged;
bool _indentSettingsChanged; bool _indentSettingsChanged;
bool _previewToggled; bool _previewToggled;
QStringList _encodingsList; TQStringList _encodingsList;
Ui::ToolBarWidget *_toolBarWidget; Ui::ToolBarWidget *_toolBarWidget;
IndentHandler *_indentHandler; IndentHandler *_indentHandler;
UpdateCheckDialog *_updateCheckDialog; UpdateCheckDialog *_updateCheckDialog;
QLabel *_textEditLineColumnInfoLabel; TQLabel *_textEditLineColumnInfoLabel;
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

@ -2,7 +2,7 @@
<ui version="4.0"> <ui version="4.0">
<author>Thomas_-_S</author> <author>Thomas_-_S</author>
<class>MainWindowUi</class> <class>MainWindowUi</class>
<widget class="QMainWindow" name="MainWindowUi"> <widget class="TQMainWindow" name="MainWindowUi">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -18,8 +18,8 @@
<iconset resource="../resources/Icons.qrc"> <iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/universalIndentGUI.svg</normaloff>:/mainWindow/universalIndentGUI.svg</iconset> <normaloff>:/mainWindow/universalIndentGUI.svg</normaloff>:/mainWindow/universalIndentGUI.svg</iconset>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="TQWidget" name="centralwidget">
<layout class="QHBoxLayout"> <layout class="TQHBoxLayout">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
@ -27,7 +27,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout"> <layout class="TQHBoxLayout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
@ -38,8 +38,8 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="TQStatusBar" name="statusbar"/>
<widget class="QMenuBar" name="menuBar"> <widget class="TQMenuBar" name="menuBar">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -48,35 +48,35 @@
<height>21</height> <height>21</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuIndenter"> <widget class="TQMenu" name="menuIndenter">
<property name="title"> <property name="title">
<string>Indenter</string> <string>Indenter</string>
</property> </property>
</widget> </widget>
<widget class="QMenu" name="menuFile"> <widget class="TQMenu" name="menuFile">
<property name="title"> <property name="title">
<string>File</string> <string>File</string>
</property> </property>
<widget class="QMenu" name="menuExport"> <widget class="TQMenu" name="menuExport">
<property name="title"> <property name="title">
<string>Export</string> <string>Export</string>
</property> </property>
<addaction name="actionExportPDF"/> <addaction name="actionExportPDF"/>
<addaction name="actionExportHTML"/> <addaction name="actionExportHTML"/>
</widget> </widget>
<widget class="QMenu" name="menuRecently_Opened_Files"> <widget class="TQMenu" name="menuRecently_Opened_Files">
<property name="title"> <property name="title">
<string>Recently Opened Files</string> <string>Recently Opened Files</string>
</property> </property>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionClear_Recently_Opened_List"/> <addaction name="actionClear_Recently_Opened_List"/>
</widget> </widget>
<widget class="QMenu" name="encodingMenu"> <widget class="TQMenu" name="encodingMenu">
<property name="title"> <property name="title">
<string>Reopen File with other Encoding</string> <string>Reopen File with other Encoding</string>
</property> </property>
</widget> </widget>
<widget class="QMenu" name="saveEncodedMenu"> <widget class="TQMenu" name="saveEncodedMenu">
<property name="title"> <property name="title">
<string>Save Source File As with other Encoding</string> <string>Save Source File As with other Encoding</string>
</property> </property>
@ -92,11 +92,11 @@
<addaction name="menuExport"/> <addaction name="menuExport"/>
<addaction name="actionExit"/> <addaction name="actionExit"/>
</widget> </widget>
<widget class="QMenu" name="menuSettings"> <widget class="TQMenu" name="menuSettings">
<property name="title"> <property name="title">
<string>Settings</string> <string>Settings</string>
</property> </property>
<widget class="QMenu" name="highlighterMenu"> <widget class="TQMenu" name="highlighterMenu">
<property name="title"> <property name="title">
<string>Set Syntax Highlighter</string> <string>Set Syntax Highlighter</string>
</property> </property>
@ -109,7 +109,7 @@
<addaction name="loadLastOpenedFileOnStartupAction"/> <addaction name="loadLastOpenedFileOnStartupAction"/>
<addaction name="actionShowSettings"/> <addaction name="actionShowSettings"/>
</widget> </widget>
<widget class="QMenu" name="menuHelp"> <widget class="TQMenu" name="menuHelp">
<property name="title"> <property name="title">
<string>Help</string> <string>Help</string>
</property> </property>
@ -123,7 +123,7 @@
<addaction name="menuSettings"/> <addaction name="menuSettings"/>
<addaction name="menuHelp"/> <addaction name="menuHelp"/>
</widget> </widget>
<widget class="QDockWidget" name="dockWidget"> <widget class="TQDockWidget" name="dockWidget">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -131,10 +131,10 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="features"> <property name="features">
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set> <set>TQDockWidget::DockWidgetFloatable|TQDockWidget::DockWidgetMovable</set>
</property> </property>
<property name="allowedAreas"> <property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set> <set>TQt::LeftDockWidgetArea|TQt::RightDockWidgetArea</set>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Indenter Settings</string> <string>Indenter Settings</string>
@ -142,8 +142,8 @@
<attribute name="dockWidgetArea"> <attribute name="dockWidgetArea">
<number>1</number> <number>1</number>
</attribute> </attribute>
<widget class="QWidget" name="dockWidgetContents"> <widget class="TQWidget" name="dockWidgetContents">
<layout class="QHBoxLayout"> <layout class="TQHBoxLayout">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
@ -151,7 +151,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
@ -163,15 +163,15 @@
</layout> </layout>
</widget> </widget>
</widget> </widget>
<widget class="QToolBar" name="toolBar"> <widget class="TQToolBar" name="toolBar">
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::PreventContextMenu</enum> <enum>TQt::PreventContextMenu</enum>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Main Toolbar</string> <string>Main Toolbar</string>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -180,7 +180,7 @@
</size> </size>
</property> </property>
<property name="toolButtonStyle"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum> <enum>TQt::ToolButtonTextBesideIcon</enum>
</property> </property>
<attribute name="toolBarArea"> <attribute name="toolBarArea">
<enum>TopToolBarArea</enum> <enum>TopToolBarArea</enum>

@ -20,10 +20,10 @@
#include "SettingsPaths.h" #include "SettingsPaths.h"
#include <tqcoreapplication.h> #include <tqcoreapplication.h>
#include <tqfile.h> #include <tntqfile.h>
#include <tqdir.h> #include <tntqdir.h>
#include <tqdiriterator.h> #include <tqdiriterator.h>
#include <tqstack.h> #include <tntqstack.h>
#include <tqtdebug.h> #include <tqtdebug.h>
#include <stdlib.h> #include <stdlib.h>
@ -38,11 +38,11 @@
*/ */
bool SettingsPaths::_alreadyInitialized = false; bool SettingsPaths::_alreadyInitialized = false;
QString SettingsPaths::_applicationBinaryPath = ""; TQString SettingsPaths::_applicationBinaryPath = "";
QString SettingsPaths::_settingsPath = ""; TQString SettingsPaths::_settingsPath = "";
QString SettingsPaths::_globalFilesPath = ""; TQString SettingsPaths::_globalFilesPath = "";
QString SettingsPaths::_indenterPath = ""; TQString SettingsPaths::_indenterPath = "";
QString SettingsPaths::_tempPath = ""; TQString SettingsPaths::_tempPath = "";
bool SettingsPaths::_portableMode = false; bool SettingsPaths::_portableMode = false;
@ -59,10 +59,10 @@ bool SettingsPaths::_portableMode = false;
void SettingsPaths::init() { void SettingsPaths::init() {
_alreadyInitialized = true; _alreadyInitialized = true;
qDebug() << __LINE__ << " " << __FUNCTION__ << ": Initializing application paths."; tqDebug() << __LINE__ << " " << __FUNCTION__ << ": Initializing application paths.";
// Get the applications binary path, with respect to MacOSXs use of the .app folder. // Get the applications binary path, with respect to MacOSXs use of the .app folder.
_applicationBinaryPath = QCoreApplication::applicationDirPath(); _applicationBinaryPath = TQCoreApplication::applicationDirPath();
// Remove any trailing slashes // Remove any trailing slashes
while ( _applicationBinaryPath.right(1) == "/" ) { while ( _applicationBinaryPath.right(1) == "/" ) {
_applicationBinaryPath.chop(1); _applicationBinaryPath.chop(1);
@ -86,9 +86,9 @@ void SettingsPaths::init() {
// If the "config" directory is a subdir of the applications binary path, use this one (portable mode) // If the "config" directory is a subdir of the applications binary path, use this one (portable mode)
_settingsPath = _applicationBinaryPath + "/config"; _settingsPath = _applicationBinaryPath + "/config";
if ( QFile::exists( _settingsPath ) ) { if ( TQFile::exists( _settingsPath ) ) {
_portableMode = true; _portableMode = true;
QDir dirCreator; TQDir dirCreator;
_globalFilesPath = _applicationBinaryPath; _globalFilesPath = _applicationBinaryPath;
_indenterPath = _applicationBinaryPath + "/indenters"; _indenterPath = _applicationBinaryPath + "/indenters";
dirCreator.mkpath( _settingsPath ); dirCreator.mkpath( _settingsPath );
@ -99,11 +99,11 @@ void SettingsPaths::init() {
// ... otherwise use the system specific global application data path. // ... otherwise use the system specific global application data path.
else { else {
_portableMode = false; _portableMode = false;
QDir dirCreator; TQDir dirCreator;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
// Get the local users application settings directory. // Get the local users application settings directory.
// Remove any trailing slashes. // Remove any trailing slashes.
_settingsPath = QDir::fromNativeSeparators( qgetenv("APPDATA") ); _settingsPath = TQDir::fromNativeSeparators( qgetenv("APPDATA") );
while ( _settingsPath.right(1) == "/" ) { while ( _settingsPath.right(1) == "/" ) {
_settingsPath.chop(1); _settingsPath.chop(1);
} }
@ -113,7 +113,7 @@ void SettingsPaths::init() {
_globalFilesPath = _applicationBinaryPath; _globalFilesPath = _applicationBinaryPath;
#else #else
// Remove any trailing slashes. // Remove any trailing slashes.
_settingsPath = QDir::homePath(); _settingsPath = TQDir::homePath();
while ( _settingsPath.right(1) == "/" ) { while ( _settingsPath.right(1) == "/" ) {
_settingsPath.chop(1); _settingsPath.chop(1);
} }
@ -123,14 +123,14 @@ void SettingsPaths::init() {
dirCreator.mkpath( _settingsPath ); dirCreator.mkpath( _settingsPath );
// If a highlighter config file does not exist in the users home config dir // If a highlighter config file does not exist in the users home config dir
// copy the default config file over there. // copy the default config file over there.
if ( !QFile::exists(_settingsPath+"/UiGuiSyntaxHighlightConfig.ini") ) { if ( !TQFile::exists(_settingsPath+"/UiGuiSyntaxHighlightConfig.ini") ) {
QFile::copy( _globalFilesPath+"/config/UiGuiSyntaxHighlightConfig.ini", _settingsPath+"/UiGuiSyntaxHighlightConfig.ini" ); TQFile::copy( _globalFilesPath+"/config/UiGuiSyntaxHighlightConfig.ini", _settingsPath+"/UiGuiSyntaxHighlightConfig.ini" );
} }
_indenterPath = _globalFilesPath + "/indenters"; _indenterPath = _globalFilesPath + "/indenters";
// On different systems it may be that "QDir::tempPath()" ends with a "/" or not. So check this. // On different systems it may be that "TQDir::tempPath()" ends with a "/" or not. So check this.
// Remove any trailing slashes. // Remove any trailing slashes.
_tempPath = QDir::tempPath(); _tempPath = TQDir::tempPath();
while ( _tempPath.right(1) == "/" ) { while ( _tempPath.right(1) == "/" ) {
_tempPath.chop(1); _tempPath.chop(1);
} }
@ -144,15 +144,15 @@ void SettingsPaths::init() {
// to an important existing file which gets overwritten when UiGUI writes // to an important existing file which gets overwritten when UiGUI writes
// into this normally temporary but linked file. // into this normally temporary but linked file.
char *pathTemplate = new char[_tempPath.length()+8]; char *pathTemplate = new char[_tempPath.length()+8];
QByteArray pathTemplateQBA = QString(_tempPath + "-XXXXXX").toAscii(); TQByteArray pathTemplateTQBA = TQString(_tempPath + "-XXXXXX").toAscii();
delete [] pathTemplate; delete [] pathTemplate;
pathTemplate = pathTemplateQBA.data(); pathTemplate = pathTemplateTQBA.data();
pathTemplate = mkdtemp( pathTemplate ); pathTemplate = mkdtemp( pathTemplate );
_tempPath = pathTemplate; _tempPath = pathTemplate;
#endif #endif
} }
qDebug() << __LINE__ << " " << __FUNCTION__ << ": Paths are:" \ tqDebug() << __LINE__ << " " << __FUNCTION__ << ": Paths are:" \
"<ul><li>_applicationBinaryPath=" << _applicationBinaryPath \ "<ul><li>_applicationBinaryPath=" << _applicationBinaryPath \
<< "</li><li>_settingsPath=" << _settingsPath \ << "</li><li>_settingsPath=" << _settingsPath \
<< "</li><li>_globalFilesPath=" << _globalFilesPath \ << "</li><li>_globalFilesPath=" << _globalFilesPath \
@ -165,7 +165,7 @@ void SettingsPaths::init() {
/*! /*!
\brief Returns the path of the applications executable. \brief Returns the path of the applications executable.
*/ */
const QString SettingsPaths::getApplicationBinaryPath() { const TQString SettingsPaths::getApplicationBinaryPath() {
if ( !_alreadyInitialized ) { if ( !_alreadyInitialized ) {
SettingsPaths::init(); SettingsPaths::init();
} }
@ -176,7 +176,7 @@ const QString SettingsPaths::getApplicationBinaryPath() {
/*! /*!
\brief Returns the path where all settings are being/should be written to. \brief Returns the path where all settings are being/should be written to.
*/ */
const QString SettingsPaths::getSettingsPath() { const TQString SettingsPaths::getSettingsPath() {
if ( !_alreadyInitialized ) { if ( !_alreadyInitialized ) {
SettingsPaths::init(); SettingsPaths::init();
} }
@ -187,7 +187,7 @@ const QString SettingsPaths::getSettingsPath() {
/*! /*!
\brief Returns the path where the files concerning all users reside. For example translations. \brief Returns the path where the files concerning all users reside. For example translations.
*/ */
const QString SettingsPaths::getGlobalFilesPath() { const TQString SettingsPaths::getGlobalFilesPath() {
if ( !_alreadyInitialized ) { if ( !_alreadyInitialized ) {
SettingsPaths::init(); SettingsPaths::init();
} }
@ -198,7 +198,7 @@ const QString SettingsPaths::getGlobalFilesPath() {
/*! /*!
\brief Returns the path where the indenter executables reside. \brief Returns the path where the indenter executables reside.
*/ */
const QString SettingsPaths::getIndenterPath() { const TQString SettingsPaths::getIndenterPath() {
if ( !_alreadyInitialized ) { if ( !_alreadyInitialized ) {
SettingsPaths::init(); SettingsPaths::init();
} }
@ -209,7 +209,7 @@ const QString SettingsPaths::getIndenterPath() {
/*! /*!
\brief Returns the path where the where all temporary data should be written to. \brief Returns the path where the where all temporary data should be written to.
*/ */
const QString SettingsPaths::getTempPath() { const TQString SettingsPaths::getTempPath() {
if ( !_alreadyInitialized ) { if ( !_alreadyInitialized ) {
SettingsPaths::init(); SettingsPaths::init();
} }
@ -232,12 +232,12 @@ bool SettingsPaths::getPortableMode() {
\brief Completely deletes the created temporary directory with all of its content. \brief Completely deletes the created temporary directory with all of its content.
*/ */
void SettingsPaths::cleanAndRemoveTempDir() { void SettingsPaths::cleanAndRemoveTempDir() {
QDirIterator dirIterator(_tempPath, QDirIterator::Subdirectories); TQDirIterator dirIterator(_tempPath, TQDirIterator::Subdirectories);
QStack<QString> directoryStack; TQStack<TQString> directoryStack;
bool noErrorsOccurred = true; bool noErrorsOccurred = true;
while ( dirIterator.hasNext() ) { while ( dirIterator.hasNext() ) {
QString currentDirOrFile = dirIterator.next(); TQString currentDirOrFile = dirIterator.next();
// If this dummy call isn't done here, calling "dirIterator.fileInfo().isDir()" later somehow fails. // If this dummy call isn't done here, calling "dirIterator.fileInfo().isDir()" later somehow fails.
dirIterator.fileInfo(); dirIterator.fileInfo();
@ -246,30 +246,30 @@ void SettingsPaths::cleanAndRemoveTempDir() {
// So we changed into another parent directory and the one on the stack can be deleted // So we changed into another parent directory and the one on the stack can be deleted
// since it must be empty. // since it must be empty.
if ( !directoryStack.isEmpty() && !currentDirOrFile.startsWith(directoryStack.top()) ) { if ( !directoryStack.isEmpty() && !currentDirOrFile.startsWith(directoryStack.top()) ) {
QString dirToBeRemoved = directoryStack.pop(); TQString dirToBeRemoved = directoryStack.pop();
bool couldRemoveDir = QDir(dirToBeRemoved).rmdir(dirToBeRemoved); bool couldRemoveDir = TQDir(dirToBeRemoved).rmdir(dirToBeRemoved);
noErrorsOccurred &= couldRemoveDir; noErrorsOccurred &= couldRemoveDir;
if ( couldRemoveDir == false ) if ( couldRemoveDir == false )
qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the directory: " << dirToBeRemoved; tqWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the directory: " << dirToBeRemoved;
//qDebug() << "Removing Dir " << directoryStack.pop(); //tqDebug() << "Removing Dir " << directoryStack.pop();
} }
// If the iterator currently points to a directory push it onto the stack. // If the iterator currently points to a directory push it onto the stack.
if ( dirIterator.fileInfo().isDir() ) { if ( dirIterator.fileInfo().isDir() ) {
directoryStack.push( currentDirOrFile ); directoryStack.push( currentDirOrFile );
//qDebug() << "Pushing onto Stack " << currentDirOrFile; //tqDebug() << "Pushing onto Stack " << currentDirOrFile;
} }
// otherwise it must be a file, so delete it. // otherwise it must be a file, so delete it.
else { else {
bool couldRemoveFile = QFile::remove( currentDirOrFile ); bool couldRemoveFile = TQFile::remove( currentDirOrFile );
noErrorsOccurred &= couldRemoveFile; noErrorsOccurred &= couldRemoveFile;
if ( couldRemoveFile == false ) if ( couldRemoveFile == false )
qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the file: " << currentDirOrFile; tqWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the file: " << currentDirOrFile;
//qDebug() << "Removing File " << currentDirOrFile; //tqDebug() << "Removing File " << currentDirOrFile;
} }
} }
} }
noErrorsOccurred &= QDir(_tempPath).rmdir(_tempPath); noErrorsOccurred &= TQDir(_tempPath).rmdir(_tempPath);
if ( noErrorsOccurred == false ) if ( noErrorsOccurred == false )
qWarning() << __LINE__ << " " << __FUNCTION__ << "While cleaning up the temp dir an error occurred."; tqWarning() << __LINE__ << " " << __FUNCTION__ << "While cleaning up the temp dir an error occurred.";
} }

@ -20,18 +20,18 @@
#ifndef SETTINGSPATHS_H #ifndef SETTINGSPATHS_H
#define SETTINGSPATHS_H #define SETTINGSPATHS_H
class QString; class TQString;
class SettingsPaths class SettingsPaths
{ {
public: public:
static void init(); static void init();
static const QString getApplicationBinaryPath(); static const TQString getApplicationBinaryPath();
static const QString getSettingsPath(); static const TQString getSettingsPath();
static const QString getGlobalFilesPath(); static const TQString getGlobalFilesPath();
static const QString getIndenterPath(); static const TQString getIndenterPath();
static const QString getTempPath(); static const TQString getTempPath();
static bool getPortableMode(); static bool getPortableMode();
static void cleanAndRemoveTempDir(); static void cleanAndRemoveTempDir();
@ -39,11 +39,11 @@ private:
SettingsPaths(); SettingsPaths();
static bool _alreadyInitialized; static bool _alreadyInitialized;
static QString _applicationBinaryPath; static TQString _applicationBinaryPath;
static QString _settingsPath; static TQString _settingsPath;
static QString _globalFilesPath; static TQString _globalFilesPath;
static QString _indenterPath; static TQString _indenterPath;
static QString _tempPath; static TQString _tempPath;
static bool _portableMode; static bool _portableMode;
}; };

@ -19,8 +19,8 @@
#include "TemplateBatchScript.h" #include "TemplateBatchScript.h"
// Need to include QObject here so that platform specific defines like Q_OS_WIN32 are set. // Need to include TQObject here so that platform specific defines like Q_OS_WIN32 are set.
#include <tqobject.h> #include <tntqobject.h>
/*! /*!
\brief The only and static function of this class returns a batch or shell script \brief The only and static function of this class returns a batch or shell script

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>ToolBarWidget</class> <class>ToolBarWidget</class>
<widget class="QWidget" name="ToolBarWidget"> <widget class="TQWidget" name="ToolBarWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -13,7 +13,7 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout"> <layout class="TQHBoxLayout">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
@ -21,7 +21,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QPushButton" name="pbOpen_Source_File"> <widget class="TQPushButton" name="pbOpen_Source_File">
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Opens a dialog for selecting a source code file.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;This file will be used to show what the indent tool changes.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Opens a dialog for selecting a source code file.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;This file will be used to show what the indent tool changes.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
@ -35,7 +35,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="cbLivePreview"> <widget class="TQCheckBox" name="cbLivePreview">
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; 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;&quot;&gt;Turns the preview of the reformatted source code on and off.&lt;/p&gt;&lt;p style=&quot; 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;&quot;&gt;In other words it switches between formatted and nonformatted code. (Ctrl+L)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; 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;&quot;&gt;Turns the preview of the reformatted source code on and off.&lt;/p&gt;&lt;p style=&quot; 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;&quot;&gt;In other words it switches between formatted and nonformatted code. (Ctrl+L)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
@ -52,7 +52,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="enableSyntaxHighlightningCheckBox"> <widget class="TQCheckBox" name="enableSyntaxHighlightningCheckBox">
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; 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;&quot;&gt;Enables and disables the highlightning of the source&lt;/p&gt;&lt;p style=&quot; 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;&quot;&gt;code shown below. (Still needs some performance improvements) (Ctrl+H)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; 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;&quot;&gt;Enables and disables the highlightning of the source&lt;/p&gt;&lt;p style=&quot; 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;&quot;&gt;code shown below. (Still needs some performance improvements) (Ctrl+H)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
@ -77,7 +77,7 @@
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -88,7 +88,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pbAbout"> <widget class="TQPushButton" name="pbAbout">
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Shows info about UniversalIndentGUI&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Shows info about UniversalIndentGUI&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
@ -102,7 +102,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pbExit"> <widget class="TQPushButton" name="pbExit">
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Quits the UniversalIndentGUI&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;/head&gt;&lt;body style=&quot; white-space: pre-wrap; font-family:MS Shell Dlg; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Quits the UniversalIndentGUI&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>

@ -19,12 +19,12 @@
#include "UiGuiErrorMessage.h" #include "UiGuiErrorMessage.h"
#include <tqcheckbox.h> #include <tntqcheckbox.h>
/*! /*!
\class UiGuiErrorMessage \class UiGuiErrorMessage
\ingroup grp_Dialogs \ingroup grp_Dialogs
\brief UiGuiErrorMessage is a child of QErrorMessage. But QErrorMessages \brief UiGuiErrorMessage is a child of TQErrorMessage. But TQErrorMessages
"Do not show again" didn't work with my strings, so this is my own, working "Do not show again" didn't work with my strings, so this is my own, working
implementation of it. implementation of it.
*/ */
@ -36,9 +36,9 @@
Retrieves the object pointer to the \a _showAgainCheckBox check box, sets the dialogs Retrieves the object pointer to the \a _showAgainCheckBox check box, sets the dialogs
modality and for a working translation sets the check box text. modality and for a working translation sets the check box text.
*/ */
UiGuiErrorMessage::UiGuiErrorMessage(QWidget *parent) : QErrorMessage(parent) { UiGuiErrorMessage::UiGuiErrorMessage(TQWidget *parent) : TQErrorMessage(parent) {
_showAgainCheckBox = findChild<QCheckBox *>(); _showAgainCheckBox = findChild<TQCheckBox *>();
setWindowModality( Qt::ApplicationModal ); setWindowModality( TQt::ApplicationModal );
_showAgainCheckBox->setText( tr("Show this message again") ); _showAgainCheckBox->setText( tr("Show this message again") );
} }
@ -57,7 +57,7 @@ UiGuiErrorMessage::~UiGuiErrorMessage(void) {
already in that list and "Show this message again" is not checked, that already in that list and "Show this message again" is not checked, that
message will not be shown. message will not be shown.
*/ */
void UiGuiErrorMessage::showMessage( const QString &title, const QString &message ) { void UiGuiErrorMessage::showMessage( const TQString &title, const TQString &message ) {
bool showAgain = true; bool showAgain = true;
if ( _showAgainCheckBox != 0 ) { if ( _showAgainCheckBox != 0 ) {
@ -71,10 +71,10 @@ void UiGuiErrorMessage::showMessage( const QString &title, const QString &messag
if ( _showAgainCheckBox != 0 ) { if ( _showAgainCheckBox != 0 ) {
_showAgainCheckBox->setChecked(true); _showAgainCheckBox->setChecked(true);
} }
QErrorMessage::showMessage( message ); TQErrorMessage::showMessage( message );
} }
else if ( showAgain ) { else if ( showAgain ) {
QErrorMessage::showMessage( message ); TQErrorMessage::showMessage( message );
} }
} }
@ -82,6 +82,6 @@ void UiGuiErrorMessage::showMessage( const QString &title, const QString &messag
/*! /*!
\brief For convinience, for showing a dialog box with the default title "UniversalIndentGUI". \brief For convinience, for showing a dialog box with the default title "UniversalIndentGUI".
*/ */
void UiGuiErrorMessage::showMessage( const QString &message ) { void UiGuiErrorMessage::showMessage( const TQString &message ) {
showMessage( "UniversalIndentGUI", message ); showMessage( "UniversalIndentGUI", message );
} }

@ -20,24 +20,24 @@
#ifndef UIGUIERRORMESSAGE_H #ifndef UIGUIERRORMESSAGE_H
#define UIGUIERRORMESSAGE_H #define UIGUIERRORMESSAGE_H
#include <tqerrormessage.h> #include <tntqerrormessage.h>
class QCheckBox; class TQCheckBox;
class UiGuiErrorMessage : public QErrorMessage class UiGuiErrorMessage : public TQErrorMessage
{ {
Q_OBJECT Q_OBJECT
public: public:
UiGuiErrorMessage(QWidget *parent = 0); UiGuiErrorMessage(TQWidget *parent = 0);
~UiGuiErrorMessage(void); ~UiGuiErrorMessage(void);
void showMessage( const QString &message ); void showMessage( const TQString &message );
void showMessage( const QString &title, const QString &message ); void showMessage( const TQString &title, const TQString &message );
private: private:
QCheckBox *_showAgainCheckBox; TQCheckBox *_showAgainCheckBox;
QStringList _errorMessageList; TQStringList _errorMessageList;
}; };
#endif // UIGUIERRORMESSAGE_H #endif // UIGUIERRORMESSAGE_H

@ -21,9 +21,9 @@
#include "SettingsPaths.h" #include "SettingsPaths.h"
#include <tqsettings.h> #include <tntqsettings.h>
#include <tqmenu.h> #include <tqmenu.h>
#include <tqscrollbar.h> #include <tntqscrollbar.h>
#include <tqcoreapplication.h> #include <tqcoreapplication.h>
#include <Qsci/qsciscintilla.h> #include <Qsci/qsciscintilla.h>
@ -36,7 +36,7 @@
#include <Qsci/qscilexercss.h> #include <Qsci/qscilexercss.h>
#include <Qsci/qscilexerd.h> #include <Qsci/qscilexerd.h>
#include <Qsci/qscilexerdiff.h> #include <Qsci/qscilexerdiff.h>
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
#include <Qsci/qscilexerfortran.h> #include <Qsci/qscilexerfortran.h>
#include <Qsci/qscilexerfortran77.h> #include <Qsci/qscilexerfortran77.h>
#endif #endif
@ -46,30 +46,30 @@
#include <Qsci/qscilexerjavascript.h> #include <Qsci/qscilexerjavascript.h>
#include <Qsci/qscilexerlua.h> #include <Qsci/qscilexerlua.h>
#include <Qsci/qscilexermakefile.h> #include <Qsci/qscilexermakefile.h>
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
#include <Qsci/qscilexerpascal.h> #include <Qsci/qscilexerpascal.h>
#endif #endif
#include <Qsci/qscilexerperl.h> #include <Qsci/qscilexerperl.h>
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
#include <Qsci/qscilexerpostscript.h> #include <Qsci/qscilexerpostscript.h>
#endif #endif
#include <Qsci/qscilexerpov.h> #include <Qsci/qscilexerpov.h>
#include <Qsci/qscilexerproperties.h> #include <Qsci/qscilexerproperties.h>
#include <Qsci/qscilexerpython.h> #include <Qsci/qscilexerpython.h>
#include <Qsci/qscilexerruby.h> #include <Qsci/qscilexerruby.h>
#if ( QSCINTILLA_VERSION >= 0x020400 ) #if ( TQSCINTILLA_VERSION >= 0x020400 )
#include <Qsci/qscilexerspice.h> #include <Qsci/qscilexerspice.h>
#endif #endif
#include <Qsci/qscilexersql.h> #include <Qsci/qscilexersql.h>
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
#include <Qsci/qscilexertcl.h> #include <Qsci/qscilexertcl.h>
#endif #endif
#include <Qsci/qscilexertex.h> #include <Qsci/qscilexertex.h>
#if ( QSCINTILLA_VERSION >= 0x020400 ) #if ( TQSCINTILLA_VERSION >= 0x020400 )
#include <Qsci/qscilexerverilog.h> #include <Qsci/qscilexerverilog.h>
#endif #endif
#include <Qsci/qscilexervhdl.h> #include <Qsci/qscilexervhdl.h>
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
#include <Qsci/qscilexerxml.h> #include <Qsci/qscilexerxml.h>
#include <Qsci/qscilexeryaml.h> #include <Qsci/qscilexeryaml.h>
#endif #endif
@ -85,66 +85,66 @@
/*! /*!
\brief The constructor initializes some regular expressions and keywords to identify cpp tokens \brief The constructor initializes some regular expressions and keywords to identify cpp tokens
*/ */
UiGuiHighlighter::UiGuiHighlighter(QsciScintilla *parent) : QObject(parent) { UiGuiHighlighter::UiGuiHighlighter(QsciScintilla *parent) : TQObject(parent) {
_qsciEditorParent = parent; _qsciEditorParent = parent;
// Create the highlighter _settings object from the UiGuiSyntaxHighlightConfig.ini file. // Create the highlighter _settings object from the UiGuiSyntaxHighlightConfig.ini file.
_settings = new QSettings(SettingsPaths::getSettingsPath() + "/UiGuiSyntaxHighlightConfig.ini", QSettings::IniFormat, this); _settings = new TQSettings(SettingsPaths::getSettingsPath() + "/UiGuiSyntaxHighlightConfig.ini", TQSettings::IniFormat, this);
_highlightningIsOn = true; _highlightningIsOn = true;
_mapHighlighternameToExtension["Bash"] = QStringList() << "sh"; _mapHighlighternameToExtension["Bash"] = TQStringList() << "sh";
_mapHighlighternameToExtension["Batch"] = QStringList() << "bat"; _mapHighlighternameToExtension["Batch"] = TQStringList() << "bat";
_mapHighlighternameToExtension["CMake"] = QStringList() << "cmake"; _mapHighlighternameToExtension["CMake"] = TQStringList() << "cmake";
_mapHighlighternameToExtension["C++"] = QStringList() << "c" << "h" << "cpp" << "hpp" << "cxx" << "hxx"; _mapHighlighternameToExtension["C++"] = TQStringList() << "c" << "h" << "cpp" << "hpp" << "cxx" << "hxx";
_mapHighlighternameToExtension["C#"] = QStringList() << "cs"; _mapHighlighternameToExtension["C#"] = TQStringList() << "cs";
_mapHighlighternameToExtension["CSS"] = QStringList() << "css"; _mapHighlighternameToExtension["CSS"] = TQStringList() << "css";
_mapHighlighternameToExtension["D"] = QStringList() << "d"; _mapHighlighternameToExtension["D"] = TQStringList() << "d";
_mapHighlighternameToExtension["Diff"] = QStringList() << "diff"; _mapHighlighternameToExtension["Diff"] = TQStringList() << "diff";
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
_mapHighlighternameToExtension["Fortran"] = QStringList() << "f" << "for" << "f90"; _mapHighlighternameToExtension["Fortran"] = TQStringList() << "f" << "for" << "f90";
_mapHighlighternameToExtension["Fortran77"] = QStringList() << "f77"; _mapHighlighternameToExtension["Fortran77"] = TQStringList() << "f77";
#endif #endif
_mapHighlighternameToExtension["HTML"] = QStringList() << "html" << "htm"; _mapHighlighternameToExtension["HTML"] = TQStringList() << "html" << "htm";
_mapHighlighternameToExtension["IDL"] = QStringList() << "idl"; _mapHighlighternameToExtension["IDL"] = TQStringList() << "idl";
_mapHighlighternameToExtension["Java"] = QStringList() << "java"; _mapHighlighternameToExtension["Java"] = TQStringList() << "java";
_mapHighlighternameToExtension["JavaScript"] = QStringList() << "js"; _mapHighlighternameToExtension["JavaScript"] = TQStringList() << "js";
_mapHighlighternameToExtension["LUA"] = QStringList() << "lua"; _mapHighlighternameToExtension["LUA"] = TQStringList() << "lua";
_mapHighlighternameToExtension["Makefile"] = QStringList() << "makefile"; _mapHighlighternameToExtension["Makefile"] = TQStringList() << "makefile";
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
_mapHighlighternameToExtension["Pascal"] = QStringList() << "pas"; _mapHighlighternameToExtension["Pascal"] = TQStringList() << "pas";
#endif #endif
_mapHighlighternameToExtension["Perl"] = QStringList() << "perl" << "pl" << "pm"; _mapHighlighternameToExtension["Perl"] = TQStringList() << "perl" << "pl" << "pm";
_mapHighlighternameToExtension["PHP"] = QStringList() << "php"; _mapHighlighternameToExtension["PHP"] = TQStringList() << "php";
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
_mapHighlighternameToExtension["PostScript"] = QStringList() << "ps" << "eps" << "pdf" << "ai" << "fh"; _mapHighlighternameToExtension["PostScript"] = TQStringList() << "ps" << "eps" << "pdf" << "ai" << "fh";
#endif #endif
_mapHighlighternameToExtension["POV"] = QStringList() << "pov"; _mapHighlighternameToExtension["POV"] = TQStringList() << "pov";
_mapHighlighternameToExtension["Ini"] = QStringList() << "ini"; _mapHighlighternameToExtension["Ini"] = TQStringList() << "ini";
_mapHighlighternameToExtension["Python"] = QStringList() << "py"; _mapHighlighternameToExtension["Python"] = TQStringList() << "py";
_mapHighlighternameToExtension["Ruby"] = QStringList() << "rub" << "rb"; _mapHighlighternameToExtension["Ruby"] = TQStringList() << "rub" << "rb";
#if ( QSCINTILLA_VERSION >= 0x020400 ) #if ( TQSCINTILLA_VERSION >= 0x020400 )
_mapHighlighternameToExtension["Spice"] = QStringList() << "cir"; _mapHighlighternameToExtension["Spice"] = TQStringList() << "cir";
#endif #endif
_mapHighlighternameToExtension["SQL"] = QStringList() << "sql"; _mapHighlighternameToExtension["SQL"] = TQStringList() << "sql";
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
_mapHighlighternameToExtension["TCL"] = QStringList() << "tcl"; _mapHighlighternameToExtension["TCL"] = TQStringList() << "tcl";
#endif #endif
_mapHighlighternameToExtension["TeX"] = QStringList() << "tex"; _mapHighlighternameToExtension["TeX"] = TQStringList() << "tex";
#if ( QSCINTILLA_VERSION >= 0x020400 ) #if ( TQSCINTILLA_VERSION >= 0x020400 )
_mapHighlighternameToExtension["Verilog"] = QStringList() << "v" << "vh"; _mapHighlighternameToExtension["Verilog"] = TQStringList() << "v" << "vh";
#endif #endif
_mapHighlighternameToExtension["VHDL"] = QStringList() << "vhdl"; _mapHighlighternameToExtension["VHDL"] = TQStringList() << "vhdl";
_mapHighlighternameToExtension["XML"] = QStringList() << "xml"; _mapHighlighternameToExtension["XML"] = TQStringList() << "xml";
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
_mapHighlighternameToExtension["YAML"] = QStringList() << "yaml"; _mapHighlighternameToExtension["YAML"] = TQStringList() << "yaml";
#endif #endif
_lexer = NULL; _lexer = NULL;
// This code is only for testing. // This code is only for testing.
/* /*
foreach(QStringList extensionList, _mapHighlighternameToExtension.values() ) { foreach(TQStringList extensionList, _mapHighlighternameToExtension.values() ) {
setLexerForExtension( extensionList.at(0) ); setLexerForExtension( extensionList.at(0) );
} }
*/ */
@ -155,9 +155,9 @@ UiGuiHighlighter::UiGuiHighlighter(QsciScintilla *parent) : QObject(parent) {
/*! /*!
\brief Returns the available highlighters as QStringList. \brief Returns the available highlighters as TQStringList.
*/ */
QStringList UiGuiHighlighter::getAvailableHighlighters() { TQStringList UiGuiHighlighter::getAvailableHighlighters() {
return _mapHighlighternameToExtension.keys(); return _mapHighlighternameToExtension.keys();
} }
@ -165,8 +165,8 @@ QStringList UiGuiHighlighter::getAvailableHighlighters() {
/*! /*!
\brief This slot handles signals coming from selecting another syntax highlighter. \brief This slot handles signals coming from selecting another syntax highlighter.
*/ */
void UiGuiHighlighter::setHighlighterByAction(QAction* highlighterAction) { void UiGuiHighlighter::setHighlighterByAction(TQAction* highlighterAction) {
QString highlighterName = highlighterAction->text(); TQString highlighterName = highlighterAction->text();
setLexerForExtension( _mapHighlighternameToExtension[highlighterName].first() ); setLexerForExtension( _mapHighlighternameToExtension[highlighterName].first() );
//TODO: This is really no nice way. How do it better? //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. // Need to do this "text update" to update the syntax highlighting. Otherwise highlighting is wrong.
@ -192,11 +192,11 @@ void UiGuiHighlighter::turnHighlightOff() {
_highlightningIsOn = false; _highlightningIsOn = false;
_qsciEditorParent->setLexer(); _qsciEditorParent->setLexer();
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) #if defined(Q_OS_WIN) || defined(Q_OS_MAC)
_qsciEditorParent->setFont( QFont("Courier", 10, QFont::Normal) ); _qsciEditorParent->setFont( TQFont("Courier", 10, TQFont::Normal) );
_qsciEditorParent->setMarginsFont( QFont("Courier", 10, QFont::Normal) ); _qsciEditorParent->setMarginsFont( TQFont("Courier", 10, TQFont::Normal) );
#else #else
_qsciEditorParent->setFont( QFont("Monospace", 10, QFont::Normal) ); _qsciEditorParent->setFont( TQFont("Monospace", 10, TQFont::Normal) );
_qsciEditorParent->setMarginsFont( QFont("Monospace", 10, QFont::Normal) ); _qsciEditorParent->setMarginsFont( TQFont("Monospace", 10, TQFont::Normal) );
#endif #endif
} }
@ -208,7 +208,7 @@ void UiGuiHighlighter::turnHighlightOff() {
bool UiGuiHighlighter::readCurrentSettings( const char *prefix ) { bool UiGuiHighlighter::readCurrentSettings( const char *prefix ) {
bool ok, flag, rc = true; bool ok, flag, rc = true;
int num; int num;
QString key; TQString key;
// Reset lists containing fonts and colors for each style // Reset lists containing fonts and colors for each style
_fontForStyles.clear(); _fontForStyles.clear();
@ -228,7 +228,7 @@ bool UiGuiHighlighter::readCurrentSettings( const char *prefix ) {
num = _settings->value(key + "color", 0).toInt(); num = _settings->value(key + "color", 0).toInt();
if (ok) if (ok)
setColor( QColor((num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff), i ); setColor( TQColor((num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff), i );
else else
rc = false; rc = false;
@ -242,18 +242,18 @@ bool UiGuiHighlighter::readCurrentSettings( const char *prefix ) {
rc = false; rc = false;
// Read the font // Read the font
QStringList fdesc; TQStringList fdesc;
ok = _settings->contains(key + "font"); ok = _settings->contains(key + "font");
fdesc = _settings->value(key + "font").toStringList(); fdesc = _settings->value(key + "font").toStringList();
if (ok && fdesc.count() == 5) { if (ok && fdesc.count() == 5) {
QFont f; TQFont f;
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) #if defined(Q_OS_WIN) || defined(Q_OS_MAC)
f.setFamily(fdesc[0]); f.setFamily(fdesc[0]);
#else #else
if ( fdesc[0].contains("courier", Qt::CaseInsensitive) ) if ( fdesc[0].contains("courier", TQt::CaseInsensitive) )
f.setFamily("Monospace"); f.setFamily("Monospace");
else else
f.setFamily(fdesc[0]); f.setFamily(fdesc[0]);
@ -273,7 +273,7 @@ bool UiGuiHighlighter::readCurrentSettings( const char *prefix ) {
num = _settings->value(key + "paper", 0).toInt(); num = _settings->value(key + "paper", 0).toInt();
if (ok) if (ok)
_lexer->setPaper( QColor((num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff), i ); _lexer->setPaper( TQColor((num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff), i );
else else
rc = false; rc = false;
} }
@ -291,7 +291,7 @@ bool UiGuiHighlighter::readCurrentSettings( const char *prefix ) {
\brief Write the settings for the current lexer to the settings file. \brief Write the settings for the current lexer to the settings file.
*/ */
void UiGuiHighlighter::writeCurrentSettings( const char *prefix ) { void UiGuiHighlighter::writeCurrentSettings( const char *prefix ) {
QString key; TQString key;
// Write the styles. // Write the styles.
for (int i = 0; i < 128; ++i) { for (int i = 0; i < 128; ++i) {
@ -300,7 +300,7 @@ void UiGuiHighlighter::writeCurrentSettings( const char *prefix ) {
continue; continue;
int num; int num;
QColor c; TQColor c;
key.sprintf( "%s/%s/style%d/", prefix, _lexer->language(), i ); key.sprintf( "%s/%s/style%d/", prefix, _lexer->language(), i );
key.replace("+", "p"); key.replace("+", "p");
@ -323,9 +323,9 @@ void UiGuiHighlighter::writeCurrentSettings( const char *prefix ) {
_settings->setValue( key + "eolfill", _lexer->eolFill(i) ); _settings->setValue( key + "eolfill", _lexer->eolFill(i) );
// Write the font // Write the font
QStringList fdesc; TQStringList fdesc;
QString fmt("%1"); TQString fmt("%1");
QFont f; TQFont f;
if ( _fontForStyles.contains(i) ) { if ( _fontForStyles.contains(i) ) {
f = _fontForStyles[i]; f = _fontForStyles[i];
@ -356,7 +356,7 @@ void UiGuiHighlighter::writeCurrentSettings( const char *prefix ) {
/*! /*!
\brief Sets the \a color for the given \a style. \brief Sets the \a color for the given \a style.
*/ */
void UiGuiHighlighter::setColor(const QColor &color, int style) { void UiGuiHighlighter::setColor(const TQColor &color, int style) {
_colorForStyles[style] = color; _colorForStyles[style] = color;
_lexer->setColor( color, style ); _lexer->setColor( color, style );
} }
@ -365,7 +365,7 @@ void UiGuiHighlighter::setColor(const QColor &color, int style) {
/*! /*!
\brief Sets the \a font for the given \a style. \brief Sets the \a font for the given \a style.
*/ */
void UiGuiHighlighter::setFont(const QFont &font, int style) { void UiGuiHighlighter::setFont(const TQFont &font, int style) {
_fontForStyles[style] = font; _fontForStyles[style] = font;
_lexer->setFont( font, style ); _lexer->setFont( font, style );
} }
@ -374,7 +374,7 @@ void UiGuiHighlighter::setFont(const QFont &font, int style) {
/*! /*!
\brief Sets the to be used lexer by giving his name. \brief Sets the to be used lexer by giving his name.
*/ */
void UiGuiHighlighter::setLexerByName( QString lexerName ) { void UiGuiHighlighter::setLexerByName( TQString lexerName ) {
setLexerForExtension( _mapHighlighternameToExtension[lexerName].first() ); setLexerForExtension( _mapHighlighternameToExtension[lexerName].first() );
} }
@ -382,7 +382,7 @@ void UiGuiHighlighter::setLexerByName( QString lexerName ) {
/*! /*!
\brief Sets the proper highlighter / lexer for the given file \a extension. Returns the index of the used lexer in the list. \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 UiGuiHighlighter::setLexerForExtension( TQString extension ) {
int indexOfHighlighter = 0; int indexOfHighlighter = 0;
extension = extension.toLower(); extension = extension.toLower();
@ -415,7 +415,7 @@ int UiGuiHighlighter::setLexerForExtension( QString extension ) {
else if ( extension == "diff" ) { else if ( extension == "diff" ) {
_lexer = new QsciLexerDiff(); _lexer = new QsciLexerDiff();
} }
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
else if ( extension == "f" || extension == "for" || extension == "f90" ) { else if ( extension == "f" || extension == "for" || extension == "f90" ) {
_lexer = new QsciLexerFortran(); _lexer = new QsciLexerFortran();
} }
@ -441,7 +441,7 @@ int UiGuiHighlighter::setLexerForExtension( QString extension ) {
else if ( extension == "makefile" ) { else if ( extension == "makefile" ) {
_lexer = new QsciLexerMakefile(); _lexer = new QsciLexerMakefile();
} }
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
else if ( extension == "pas" ) { else if ( extension == "pas" ) {
_lexer = new QsciLexerPascal(); _lexer = new QsciLexerPascal();
} }
@ -452,7 +452,7 @@ int UiGuiHighlighter::setLexerForExtension( QString extension ) {
else if ( extension == "php" ) { else if ( extension == "php" ) {
_lexer = new QsciLexerHTML(); _lexer = new QsciLexerHTML();
} }
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
else if ( extension == "ps" || extension == "eps" || extension == "pdf" || extension == "ai" || extension == "fh") { else if ( extension == "ps" || extension == "eps" || extension == "pdf" || extension == "ai" || extension == "fh") {
_lexer = new QsciLexerPostScript(); _lexer = new QsciLexerPostScript();
} }
@ -469,7 +469,7 @@ int UiGuiHighlighter::setLexerForExtension( QString extension ) {
else if ( extension == "rub" || extension == "rb" ) { else if ( extension == "rub" || extension == "rb" ) {
_lexer = new QsciLexerRuby(); _lexer = new QsciLexerRuby();
} }
#if ( QSCINTILLA_VERSION >= 0x020400 ) #if ( TQSCINTILLA_VERSION >= 0x020400 )
else if ( extension == "spice?" ) { else if ( extension == "spice?" ) {
_lexer = new QsciLexerSpice(); _lexer = new QsciLexerSpice();
} }
@ -477,7 +477,7 @@ int UiGuiHighlighter::setLexerForExtension( QString extension ) {
else if ( extension == "sql" ) { else if ( extension == "sql" ) {
_lexer = new QsciLexerSQL(); _lexer = new QsciLexerSQL();
} }
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
else if ( extension == "tcl" ) { else if ( extension == "tcl" ) {
_lexer = new QsciLexerTCL(); _lexer = new QsciLexerTCL();
} }
@ -485,7 +485,7 @@ int UiGuiHighlighter::setLexerForExtension( QString extension ) {
else if ( extension == "tex" ) { else if ( extension == "tex" ) {
_lexer = new QsciLexerTeX(); _lexer = new QsciLexerTeX();
} }
#if ( QSCINTILLA_VERSION >= 0x020400 ) #if ( TQSCINTILLA_VERSION >= 0x020400 )
else if ( extension == "vlog?" ) { else if ( extension == "vlog?" ) {
_lexer = new QsciLexerVerilog(); _lexer = new QsciLexerVerilog();
} }
@ -494,13 +494,13 @@ int UiGuiHighlighter::setLexerForExtension( QString extension ) {
_lexer = new QsciLexerVHDL(); _lexer = new QsciLexerVHDL();
} }
else if ( extension == "xml" ) { else if ( extension == "xml" ) {
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
_lexer = new QsciLexerXML(); _lexer = new QsciLexerXML();
#else #else
_lexer = new QsciLexerHTML(); _lexer = new QsciLexerHTML();
#endif #endif
} }
#if ( QSCINTILLA_VERSION >= 0x020300 ) #if ( TQSCINTILLA_VERSION >= 0x020300 )
else if ( extension == "yaml" ) { else if ( extension == "yaml" ) {
_lexer = new QsciLexerYAML(); _lexer = new QsciLexerYAML();
} }
@ -516,7 +516,7 @@ int UiGuiHighlighter::setLexerForExtension( QString extension ) {
indexOfHighlighter++; indexOfHighlighter++;
} }
// Set the _lexer for the QScintilla widget. // Set the _lexer for the TQScintilla widget.
if ( _highlightningIsOn ) { if ( _highlightningIsOn ) {
_qsciEditorParent->setLexer(_lexer); _qsciEditorParent->setLexer(_lexer);
} }

@ -20,19 +20,19 @@
#ifndef UIGUIHIGHLIGHTER_H #ifndef UIGUIHIGHLIGHTER_H
#define UIGUIHIGHLIGHTER_H #define UIGUIHIGHLIGHTER_H
#include <tqobject.h> #include <tntqobject.h>
#include <tqmap.h> #include <tntqmap.h>
#include <tqfont.h> #include <tntqfont.h>
#include <tqcolor.h> #include <tntqcolor.h>
class QAction; class TQAction;
class QSettings; class TQSettings;
class QsciScintilla; class QsciScintilla;
class QsciLexer; class QsciLexer;
class UiGuiHighlighter : public QObject class UiGuiHighlighter : public TQObject
{ {
Q_OBJECT Q_OBJECT
@ -43,32 +43,32 @@ public:
bool readCurrentSettings(const char *prefix); bool readCurrentSettings(const char *prefix);
void writeCurrentSettings(const char *prefix); void writeCurrentSettings(const char *prefix);
QStringList getAvailableHighlighters(); TQStringList getAvailableHighlighters();
public slots: public slots:
//! The foreground color for style number \a style is set to \a color. If //! 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. //! \a style is -1 then the color is set for all styles.
void setColor(const QColor &color, int style = -1); void setColor(const TQColor &color, int style = -1);
//! The font for style number \a style is set to \a font. If \a style is //! 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. //! -1 then the font is set for all styles.
void setFont(const QFont &font, int style = -1); void setFont(const TQFont &font, int style = -1);
//! Sets the lexer that is responsible for the given \a extension. //! Sets the lexer that is responsible for the given \a extension.
int setLexerForExtension( QString extension ); int setLexerForExtension( TQString extension );
void setLexerByName( QString lexerName ); void setLexerByName( TQString lexerName );
void setHighlighterByAction(QAction* highlighterAction); void setHighlighterByAction(TQAction* highlighterAction);
private: private:
bool _highlightningIsOn; bool _highlightningIsOn;
QsciScintilla *_qsciEditorParent; QsciScintilla *_qsciEditorParent;
QMap<int, QFont> _fontForStyles; TQMap<int, TQFont> _fontForStyles;
QMap<int, QColor> _colorForStyles; TQMap<int, TQColor> _colorForStyles;
QsciLexer* _lexer; QsciLexer* _lexer;
QSettings *_settings; TQSettings *_settings;
QMap<QString, QStringList> _mapHighlighternameToExtension; TQMap<TQString, TQStringList> _mapHighlighternameToExtension;
}; };
#endif // UIGUIHIGHLIGHTER_H #endif // UIGUIHIGHLIGHTER_H

@ -21,7 +21,7 @@
#include <tqtcpserver.h> #include <tqtcpserver.h>
#include <tqtcpsocket.h> #include <tqtcpsocket.h>
#include <tqmessagebox.h> #include <tntqmessagebox.h>
#include <tqtdebug.h> #include <tqtdebug.h>
//! \defgroup grp_Server All concerning the server component. //! \defgroup grp_Server All concerning the server component.
@ -43,7 +43,7 @@
matter for which application the plugin/client is developed. matter for which application the plugin/client is developed.
*/ */
UiGuiIndentServer::UiGuiIndentServer(void) : QObject() { UiGuiIndentServer::UiGuiIndentServer(void) : TQObject() {
_tcpServer = NULL; _tcpServer = NULL;
_currentClientConnection = NULL; _currentClientConnection = NULL;
_readyForHandleRequest = false; _readyForHandleRequest = false;
@ -56,12 +56,12 @@ UiGuiIndentServer::~UiGuiIndentServer(void) {
void UiGuiIndentServer::startServer() { void UiGuiIndentServer::startServer() {
if ( _tcpServer == NULL ) { if ( _tcpServer == NULL ) {
_tcpServer = new QTcpServer(this); _tcpServer = new TQTcpServer(this);
} }
if ( !_tcpServer->isListening() ) { if ( !_tcpServer->isListening() ) {
if ( !_tcpServer->listen(QHostAddress::Any, quint16(84484)) ) { if ( !_tcpServer->listen(TQHostAddress::Any, tquint16(84484)) ) {
QMessageBox::critical( NULL, tr("UiGUI Server"), tr("Unable to start the server: %1.").arg(_tcpServer->errorString()) ); TQMessageBox::critical( NULL, tr("UiGUI Server"), tr("Unable to start the server: %1.").arg(_tcpServer->errorString()) );
return; return;
} }
} }
@ -84,7 +84,7 @@ void UiGuiIndentServer::stopServer() {
void UiGuiIndentServer::handleNewConnection() { void UiGuiIndentServer::handleNewConnection() {
QTcpSocket *clientConnection = _tcpServer->nextPendingConnection(); TQTcpSocket *clientConnection = _tcpServer->nextPendingConnection();
connect( clientConnection, SIGNAL(disconnected()), clientConnection, SLOT(deleteLater()) ); connect( clientConnection, SIGNAL(disconnected()), clientConnection, SLOT(deleteLater()) );
connect( clientConnection, SIGNAL(readyRead()), this, SLOT(handleReceivedData()) ); connect( clientConnection, SIGNAL(readyRead()), this, SLOT(handleReceivedData()) );
@ -96,15 +96,15 @@ void UiGuiIndentServer::handleReceivedData() {
return; return;
} }
_currentClientConnection = qobject_cast<QTcpSocket*>( sender() ); _currentClientConnection = qobject_cast<TQTcpSocket*>( sender() );
QString receivedData = ""; TQString receivedData = "";
if ( _currentClientConnection != NULL ) { if ( _currentClientConnection != NULL ) {
QDataStream in(_currentClientConnection); TQDataStream in(_currentClientConnection);
in.setVersion(QDataStream::Qt_4_0); in.setVersion(TQDataStream::TQt_4_0);
if ( _blockSize == 0 ) { if ( _blockSize == 0 ) {
if ( _currentClientConnection->bytesAvailable() < (int)sizeof(quint32) ) if ( _currentClientConnection->bytesAvailable() < (int)sizeof(tquint32) )
return; return;
in >> _blockSize; in >> _blockSize;
@ -113,12 +113,12 @@ void UiGuiIndentServer::handleReceivedData() {
if ( _currentClientConnection->bytesAvailable() < _blockSize ) if ( _currentClientConnection->bytesAvailable() < _blockSize )
return; return;
QString receivedMessage; TQString receivedMessage;
in >> receivedMessage; in >> receivedMessage;
_blockSize = 0; _blockSize = 0;
qDebug() << "receivedMessage: " << receivedMessage; tqDebug() << "receivedMessage: " << receivedMessage;
if ( receivedMessage == "ts" ) { if ( receivedMessage == "ts" ) {
sendMessage("Toll"); sendMessage("Toll");
@ -130,16 +130,16 @@ void UiGuiIndentServer::handleReceivedData() {
} }
void UiGuiIndentServer::sendMessage( const QString &message ) { void UiGuiIndentServer::sendMessage( const TQString &message ) {
_readyForHandleRequest = false; _readyForHandleRequest = false;
_dataToSend = ""; _dataToSend = "";
QDataStream out(&_dataToSend, QIODevice::WriteOnly); TQDataStream out(&_dataToSend, TQIODevice::WriteOnly);
out.setVersion(QDataStream::Qt_4_0); out.setVersion(TQDataStream::TQt_4_0);
out << (quint32)0; out << (tquint32)0;
out << message; out << message;
out.device()->seek(0); out.device()->seek(0);
out << (quint32)(_dataToSend.size() - sizeof(quint32)); out << (tquint32)(_dataToSend.size() - sizeof(tquint32));
connect(_currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest())); connect(_currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest()));
_currentClientConnection->write(_dataToSend); _currentClientConnection->write(_dataToSend);
@ -148,8 +148,8 @@ void UiGuiIndentServer::sendMessage( const QString &message ) {
void UiGuiIndentServer::checkIfReadyForHandleRequest() { void UiGuiIndentServer::checkIfReadyForHandleRequest() {
if ( _currentClientConnection->bytesToWrite() == 0 ) { if ( _currentClientConnection->bytesToWrite() == 0 ) {
QString dataToSendStr = _dataToSend.right( _dataToSend.size() - sizeof(quint32) ); TQString dataToSendStr = _dataToSend.right( _dataToSend.size() - sizeof(tquint32) );
qDebug() << "checkIfReadyForHandleRequest _dataToSend was: " << dataToSendStr; tqDebug() << "checkIfReadyForHandleRequest _dataToSend was: " << dataToSendStr;
disconnect(_currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest())); disconnect(_currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest()));
_readyForHandleRequest = true; _readyForHandleRequest = true;
} }

@ -20,13 +20,13 @@
#ifndef UIGUIINDENTSERVER_H #ifndef UIGUIINDENTSERVER_H
#define UIGUIINDENTSERVER_H #define UIGUIINDENTSERVER_H
#include <tqobject.h> #include <tntqobject.h>
class QTcpServer; class TQTcpServer;
class QTcpSocket; class TQTcpSocket;
class UiGuiIndentServer : public QObject class UiGuiIndentServer : public TQObject
{ {
Q_OBJECT Q_OBJECT
@ -41,15 +41,15 @@ public slots:
private slots: private slots:
void handleNewConnection(); void handleNewConnection();
void handleReceivedData(); void handleReceivedData();
void sendMessage(const QString &message); void sendMessage(const TQString &message);
void checkIfReadyForHandleRequest(); void checkIfReadyForHandleRequest();
private: private:
QTcpServer *_tcpServer; TQTcpServer *_tcpServer;
QByteArray _dataToSend; TQByteArray _dataToSend;
bool _readyForHandleRequest; bool _readyForHandleRequest;
QTcpSocket *_currentClientConnection; TQTcpSocket *_currentClientConnection;
quint32 _blockSize; tquint32 _blockSize;
}; };
#endif // UIGUIINDENTSERVER_H #endif // UIGUIINDENTSERVER_H

@ -19,10 +19,10 @@
#include "UiGuiIniFileParser.h" #include "UiGuiIniFileParser.h"
#include <tqfile.h> #include <tntqfile.h>
#include <tqstringlist.h> #include <tntqstringlist.h>
#include <tqvariant.h> #include <tntqvariant.h>
#include <tqtextstream.h> #include <tntqtextstream.h>
//! \defgroup grp_Settings All concerning applications settings. //! \defgroup grp_Settings All concerning applications settings.
@ -35,8 +35,8 @@
"keyname=keyvalue". Groups can be defined by writing the groupname "keyname=keyvalue". Groups can be defined by writing the groupname
in the style [groupname] before some key-value pairs. in the style [groupname] before some key-value pairs.
The reason why I use my own class instead of QSettings is mainly, that The reason why I use my own class instead of TQSettings is mainly, that
QSettings always internally sorts the groups alphabetically and also TQSettings always internally sorts the groups alphabetically and also
rewrites a settings file sorted. Very annoying for me. rewrites a settings file sorted. Very annoying for me.
*/ */
@ -51,7 +51,7 @@ UiGuiIniFileParser::UiGuiIniFileParser(void) {
/*! /*!
\brief Directly loads and parses the file with name \a iniFileName. \brief Directly loads and parses the file with name \a iniFileName.
*/ */
UiGuiIniFileParser::UiGuiIniFileParser(const QString &iniFileName) { UiGuiIniFileParser::UiGuiIniFileParser(const TQString &iniFileName) {
init(); init();
_iniFileName = iniFileName; _iniFileName = iniFileName;
parseIniFile(); parseIniFile();
@ -70,10 +70,10 @@ UiGuiIniFileParser::~UiGuiIniFileParser(void) {
/*! /*!
\brief Returns the group/section names in the same order as they occurr in the ini file as QStringList. \brief Returns the group/section names in the same order as they occurr in the ini file as TQStringList.
*/ */
QStringList UiGuiIniFileParser::childGroups() { TQStringList UiGuiIniFileParser::childGroups() {
QStringList sectionsStringList; TQStringList sectionsStringList;
for( unsigned int i = 0; i < _sections.size(); i++ ) { for( unsigned int i = 0; i < _sections.size(); i++ ) {
sectionsStringList << _sections[i]; sectionsStringList << _sections[i];
@ -84,14 +84,14 @@ QStringList UiGuiIniFileParser::childGroups() {
/*! /*!
\brief Returns the value of the defined \a keyName as QVariant. \brief Returns the value of the defined \a keyName as TQVariant.
The \a keyName is assembled by a section name, a slash and the key name itself. 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: For example if you wish to access the value of the following setting:
<code>[NiceSection]</br>niceKeyName=2</code> you would have to call <code>[NiceSection]</br>niceKeyName=2</code> you would have to call
value("NiceSection/niceKeyName"). value("NiceSection/niceKeyName").
*/ */
QVariant UiGuiIniFileParser::value(const QString &keyName, const QString &defaultValue) { TQVariant UiGuiIniFileParser::value(const TQString &keyName, const TQString &defaultValue) {
return _keyValueMap.value( keyName, defaultValue ); return _keyValueMap.value( keyName, defaultValue );
} }
@ -100,18 +100,18 @@ QVariant UiGuiIniFileParser::value(const QString &keyName, const QString &defaul
\brief Parses the ini file and stores the key value pairs in the internal vectors \a keys and \a values. \brief Parses the ini file and stores the key value pairs in the internal vectors \a keys and \a values.
*/ */
void UiGuiIniFileParser::parseIniFile() { void UiGuiIniFileParser::parseIniFile() {
QFile iniFile(_iniFileName); TQFile iniFile(_iniFileName);
if ( iniFile.open(QFile::ReadOnly) ) { if ( iniFile.open(TQFile::ReadOnly) ) {
// Clear the vectors holding the keys and values. // Clear the vectors holding the keys and values.
_sections.clear(); _sections.clear();
_keyValueMap.clear(); _keyValueMap.clear();
QTextStream iniFileStream( &iniFile ); TQTextStream iniFileStream( &iniFile );
QString line; TQString line;
QString currentSectionName = ""; TQString currentSectionName = "";
QString keyName = ""; TQString keyName = "";
QString valueAsString = ""; TQString valueAsString = "";
while ( !iniFileStream.atEnd() ) { while ( !iniFileStream.atEnd() ) {
line = iniFileStream.readLine().trimmed(); line = iniFileStream.readLine().trimmed();

@ -20,23 +20,23 @@
#ifndef UIGUIINIFILEPARSER_H #ifndef UIGUIINIFILEPARSER_H
#define UIGUIINIFILEPARSER_H #define UIGUIINIFILEPARSER_H
#include <tqmap.h> #include <tntqmap.h>
#include <tqstring.h> #include <tntqstring.h>
#include <vector> #include <vector>
class QStringList; class TQStringList;
class QVariant; class TQVariant;
class UiGuiIniFileParser class UiGuiIniFileParser
{ {
public: public:
UiGuiIniFileParser(void); UiGuiIniFileParser(void);
UiGuiIniFileParser(const QString &iniFileName); UiGuiIniFileParser(const TQString &iniFileName);
~UiGuiIniFileParser(void); ~UiGuiIniFileParser(void);
QVariant value(const QString &keyName, const QString &defaultValue = ""); TQVariant value(const TQString &keyName, const TQString &defaultValue = "");
QStringList childGroups(); TQStringList childGroups();
protected: protected:
void init(); void init();
@ -44,9 +44,9 @@ protected:
private: private:
void parseIniFile(); void parseIniFile();
QString _iniFileName; TQString _iniFileName;
std::vector<QString> _sections; std::vector<TQString> _sections;
QMap<QString, QVariant> _keyValueMap; TQMap<TQString, TQVariant> _keyValueMap;
}; };
#endif // UIGUIINIFILEPARSER_H #endif // UIGUIINIFILEPARSER_H

@ -21,16 +21,16 @@
#include "SettingsPaths.h" #include "SettingsPaths.h"
#include <tqsettings.h> #include <tntqsettings.h>
#include <tqpoint.h> #include <tntqpoint.h>
#include <tqsize.h> #include <tntqsize.h>
#include <tqdir.h> #include <tntqdir.h>
#include <tqdate.h> #include <tqdate.h>
#include <tqstringlist.h> #include <tntqstringlist.h>
#include <tqcoreapplication.h> #include <tqcoreapplication.h>
#include <tqmetamethod.h> #include <tqmetamethod.h>
#include <tqmetaproperty.h> #include <tqmetaproperty.h>
#include <tqwidget.h> #include <tntqwidget.h>
//! \defgroup grp_Settings All concerning the settings. //! \defgroup grp_Settings All concerning the settings.
@ -42,15 +42,15 @@
*/ */
// Inits the single class instance pointer. // Inits the single class instance pointer.
QWeakPointer<UiGuiSettings> UiGuiSettings::_instance; TQWeakPointer<UiGuiSettings> UiGuiSettings::_instance;
/*! /*!
\brief The constructor for the settings. \brief The constructor for the settings.
*/ */
UiGuiSettings::UiGuiSettings() : QObject() { UiGuiSettings::UiGuiSettings() : TQObject() {
// Create the main application settings object from the UniversalIndentGUI.ini file. // Create the main application settings object from the UniversalIndentGUI.ini file.
_qsettings = new QSettings(SettingsPaths::getSettingsPath() + "/UniversalIndentGUI.ini", QSettings::IniFormat, this); _qsettings = new TQSettings(SettingsPaths::getSettingsPath() + "/UniversalIndentGUI.ini", TQSettings::IniFormat, this);
_indenterDirctoryStr = SettingsPaths::getGlobalFilesPath() + "/indenters"; _indenterDirctoryStr = SettingsPaths::getGlobalFilesPath() + "/indenters";
readAvailableTranslations(); readAvailableTranslations();
@ -61,11 +61,11 @@ UiGuiSettings::UiGuiSettings() : QObject() {
/*! /*!
\brief Returns the instance of the settings class. If no instance exists, ONE will be created. \brief Returns the instance of the settings class. If no instance exists, ONE will be created.
*/ */
QSharedPointer<UiGuiSettings> UiGuiSettings::getInstance() { TQSharedPointer<UiGuiSettings> UiGuiSettings::getInstance() {
QSharedPointer<UiGuiSettings> sharedInstance = _instance.toStrongRef(); TQSharedPointer<UiGuiSettings> sharedInstance = _instance.toStrongRef();
if ( sharedInstance.isNull() ) { if ( sharedInstance.isNull() ) {
// Create the settings object, which loads all UiGui settings from a file. // Create the settings object, which loads all UiGui settings from a file.
sharedInstance = QSharedPointer<UiGuiSettings>(new UiGuiSettings()); sharedInstance = TQSharedPointer<UiGuiSettings>(new UiGuiSettings());
_instance = sharedInstance.toWeakRef(); _instance = sharedInstance.toWeakRef();
} }
@ -88,18 +88,18 @@ UiGuiSettings::~UiGuiSettings() {
/*! /*!
\brief Scans the translations directory for available translation files and \brief Scans the translations directory for available translation files and
stores them in the QList \a _availableTranslations. stores them in the TQList \a _availableTranslations.
*/ */
void UiGuiSettings::readAvailableTranslations() { void UiGuiSettings::readAvailableTranslations() {
QString languageShort; TQString languageShort;
QStringList languageFileList; TQStringList languageFileList;
// English is the default language. A translation file does not exist but to have a menu entry, added here. // English is the default language. A translation file does not exist but to have a menu entry, added here.
languageFileList << "universalindent_en.qm"; languageFileList << "universalindent_en.qm";
// Find all translation files in the "translations" directory. // Find all translation files in the "translations" directory.
QDir translationDirectory = QDir( SettingsPaths::getGlobalFilesPath() + "/translations" ); TQDir translationDirectory = TQDir( SettingsPaths::getGlobalFilesPath() + "/translations" );
languageFileList << translationDirectory.entryList( QStringList("universalindent_*.qm") ); languageFileList << translationDirectory.entryList( TQStringList("universalindent_*.qm") );
// Loop for each found translation file // Loop for each found translation file
foreach ( languageShort, languageFileList ) { foreach ( languageShort, languageFileList ) {
@ -116,17 +116,17 @@ void UiGuiSettings::readAvailableTranslations() {
/*! /*!
\brief Returns a list of the mnemonics of the available translations. \brief Returns a list of the mnemonics of the available translations.
*/ */
QStringList UiGuiSettings::getAvailableTranslations() { TQStringList UiGuiSettings::getAvailableTranslations() {
return _availableTranslations; return _availableTranslations;
} }
/*! /*!
\brief Returns the value of the by \a settingsName defined setting as QVariant. \brief Returns the value of the by \a settingsName defined setting as TQVariant.
If the named setting does not exist, 0 is being returned. If the named setting does not exist, 0 is being returned.
*/ */
QVariant UiGuiSettings::getValueByName(QString settingName) { TQVariant UiGuiSettings::getValueByName(TQString settingName) {
return _qsettings->value("UniversalIndentGUI/" + settingName); return _qsettings->value("UniversalIndentGUI/" + settingName);
} }
@ -143,8 +143,8 @@ bool UiGuiSettings::initSettings()
// Read windows last size and position from the settings file. // Read windows last size and position from the settings file.
_qsettings->setValue( "UniversalIndentGUI/maximized", _qsettings->value("UniversalIndentGUI/maximized", false) ); _qsettings->setValue( "UniversalIndentGUI/maximized", _qsettings->value("UniversalIndentGUI/maximized", false) );
_qsettings->setValue( "UniversalIndentGUI/position", _qsettings->value("UniversalIndentGUI/position", QPoint(50, 50)) ); _qsettings->setValue( "UniversalIndentGUI/position", _qsettings->value("UniversalIndentGUI/position", TQPoint(50, 50)) );
_qsettings->setValue( "UniversalIndentGUI/size", _qsettings->value("UniversalIndentGUI/size", QSize(800, 600)) ); _qsettings->setValue( "UniversalIndentGUI/size", _qsettings->value("UniversalIndentGUI/size", TQSize(800, 600)) );
// Read last selected encoding for the opened source code file. // Read last selected encoding for the opened source code file.
_qsettings->setValue( "UniversalIndentGUI/encoding", _qsettings->value("UniversalIndentGUI/encoding", "UTF-8") ); _qsettings->setValue( "UniversalIndentGUI/encoding", _qsettings->value("UniversalIndentGUI/encoding", "UTF-8") );
@ -182,10 +182,10 @@ bool UiGuiSettings::initSettings()
// Read the update check settings from the settings file. // Read the update check settings from the settings file.
_qsettings->setValue( "UniversalIndentGUI/CheckForUpdate", _qsettings->value("UniversalIndentGUI/CheckForUpdate", false) ); _qsettings->setValue( "UniversalIndentGUI/CheckForUpdate", _qsettings->value("UniversalIndentGUI/CheckForUpdate", false) );
_qsettings->setValue( "UniversalIndentGUI/LastUpdateCheck", _qsettings->value("UniversalIndentGUI/LastUpdateCheck", QDate(1900,1,1)) ); _qsettings->setValue( "UniversalIndentGUI/LastUpdateCheck", _qsettings->value("UniversalIndentGUI/LastUpdateCheck", TQDate(1900,1,1)) );
// Read the main window state. // Read the main window state.
_qsettings->setValue( "UniversalIndentGUI/MainWindowState", _qsettings->value("UniversalIndentGUI/MainWindowState", QByteArray()) ); _qsettings->setValue( "UniversalIndentGUI/MainWindowState", _qsettings->value("UniversalIndentGUI/MainWindowState", TQByteArray()) );
return true; return true;
} }
@ -194,35 +194,35 @@ bool UiGuiSettings::initSettings()
/*! /*!
\brief Register the by \a propertyName defined property of \a obj to be connected to the setting defined by \a settingName. \brief Register the by \a propertyName defined property of \a obj to be connected to the setting defined by \a settingName.
The \a propertyName must be one of those that are listed in the Qt "Properties" documentation section of a Qt Object. The \a propertyName must be one of those that are listed in the TQt "Properties" documentation section of a TQt Object.
All further needed info is retrieved via the \a obj's MetaObject, like the to the property bound signal. All further needed info is retrieved via the \a obj's MetaObject, like the to the property bound signal.
*/ */
bool UiGuiSettings::registerObjectProperty( QObject *obj, const QString &propertyName, const QString &settingName ) bool UiGuiSettings::registerObjectProperty( TQObject *obj, const TQString &propertyName, const TQString &settingName )
{ {
const QMetaObject *metaObject = obj->metaObject(); const TQMetaObject *metaObject = obj->metaObject();
bool connectSuccess = false; bool connectSuccess = false;
// Connect to the objects destroyed signal, so that it will be correctly unregistered. // Connect to the objects destroyed signal, so that it will be correctly unregistered.
connectSuccess = connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectProperty(QObject*))); connectSuccess = connect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectProperty(TQObject*)));
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) ); int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( connectSuccess && indexOfProp > -1 ) { if ( connectSuccess && indexOfProp > -1 ) {
QMetaProperty mProp = metaObject->property(indexOfProp); TQMetaProperty mProp = metaObject->property(indexOfProp);
// Connect to the property's value changed signal. // Connect to the property's value changed signal.
if ( mProp.hasNotifySignal() ) { if ( mProp.hasNotifySignal() ) {
QMetaMethod signal = mProp.notifySignal(); TQMetaMethod signal = mProp.notifySignal();
//QString teststr = qPrintable(SIGNAL() + QString(signal.signature())); //TQString teststr = qPrintable(SIGNAL() + TQString(signal.signature()));
// The command "SIGNAL() + QString(signal.signature())" assembles the signal methods signature to a valid Qt SIGNAL. // The command "SIGNAL() + TQString(signal.signature())" assembles the signal methods signature to a valid TQt SIGNAL.
connectSuccess = connect(obj, qPrintable(SIGNAL() + QString(signal.signature())), this, SLOT(handleObjectPropertyChange())); connectSuccess = connect(obj, qPrintable(SIGNAL() + TQString(signal.signature())), this, SLOT(handleObjectPropertyChange()));
} }
if ( connectSuccess ) { if ( connectSuccess ) {
_registeredObjectProperties[obj] = QStringList() << propertyName << settingName; _registeredObjectProperties[obj] = TQStringList() << propertyName << settingName;
} }
else { else {
//TODO: Write a debug warning to the log. //TODO: Write a debug warning to the log.
disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectProperty(QObject*))); disconnect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectProperty(TQObject*)));
return false; return false;
} }
@ -237,7 +237,7 @@ bool UiGuiSettings::registerObjectProperty( QObject *obj, const QString &propert
} }
else { else {
//TODO: Write a debug warning to the log. //TODO: Write a debug warning to the log.
disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectProperty(QObject*))); disconnect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectProperty(TQObject*)));
return false; return false;
} }
@ -246,18 +246,18 @@ bool UiGuiSettings::registerObjectProperty( QObject *obj, const QString &propert
/*! /*!
\brief Searches the child QObjects of \a obj for a property name and setting name definition within \brief Searches the child TQObjects of \a obj for a property name and setting name definition within
their custom properties and registers this property name to that setting name if both were found. their custom properties and registers this property name to that setting name if both were found.
The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName", The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName",
where "connectedPropertyName" is the name of a QObject property as it is documented in the QtDocs, and where "connectedPropertyName" is the name of a TQObject property as it is documented in the TQtDocs, and
"connectedSettingName" is the name of a setting here within UiGuiSettings. If the mentioned setting "connectedSettingName" is the name of a setting here within UiGuiSettings. If the mentioned setting
name doesn't exist, it will be created. name doesn't exist, it will be created.
Returns true, if all found property and setting definitions could be successfully registered. Returns true, if all found property and setting definitions could be successfully registered.
Returns false, if any of those registrations fails. Returns false, if any of those registrations fails.
*/ */
bool UiGuiSettings::registerObjectPropertyRecursive(QObject *obj) { bool UiGuiSettings::registerObjectPropertyRecursive(TQObject *obj) {
return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::registerObjectProperty); return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::registerObjectProperty);
} }
@ -268,13 +268,13 @@ bool UiGuiSettings::registerObjectPropertyRecursive(QObject *obj) {
Returns true, if the value could be assigned, otherwise returns false, which is the case if settingName doesn't exist Returns true, if the value could be assigned, otherwise returns false, which is the case if settingName doesn't exist
within the settings or if the mentioned propertyName wasn't found for the \a obj. within the settings or if the mentioned propertyName wasn't found for the \a obj.
*/ */
bool UiGuiSettings::setObjectPropertyToSettingValue( QObject *obj, const QString &propertyName, const QString &settingName ) bool UiGuiSettings::setObjectPropertyToSettingValue( TQObject *obj, const TQString &propertyName, const TQString &settingName )
{ {
const QMetaObject *metaObject = obj->metaObject(); const TQMetaObject *metaObject = obj->metaObject();
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) ); int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) { if ( indexOfProp > -1 ) {
QMetaProperty mProp = metaObject->property(indexOfProp); TQMetaProperty mProp = metaObject->property(indexOfProp);
// If setting already exists, set the objects property to the setting value. // If setting already exists, set the objects property to the setting value.
if ( _qsettings->contains("UniversalIndentGUI/" + settingName) ) { if ( _qsettings->contains("UniversalIndentGUI/" + settingName) ) {
@ -296,17 +296,17 @@ bool UiGuiSettings::setObjectPropertyToSettingValue( QObject *obj, const QString
/*! /*!
\brief Searches the child QObjects of \a obj for a property name and setting name definition within \brief Searches the child TQObjects of \a obj for a property name and setting name definition within
their custom properties and sets each property to settings value. their custom properties and sets each property to settings value.
The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName", The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName",
where "connectedPropertyName" is the name of a QObject property as it is documented in the QtDocs, and where "connectedPropertyName" is the name of a TQObject property as it is documented in the TQtDocs, and
"connectedSettingName" is the name of a setting here within UiGuiSettings. "connectedSettingName" is the name of a setting here within UiGuiSettings.
Returns true, if all found property and setting definitions could be successfully registered. Returns true, if all found property and setting definitions could be successfully registered.
Returns false, if any of those registrations fails. Returns false, if any of those registrations fails.
*/ */
bool UiGuiSettings::setObjectPropertyToSettingValueRecursive(QObject *obj) { bool UiGuiSettings::setObjectPropertyToSettingValueRecursive(TQObject *obj) {
return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::setObjectPropertyToSettingValue); return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::setObjectPropertyToSettingValue);
} }
@ -319,13 +319,13 @@ bool UiGuiSettings::setObjectPropertyToSettingValueRecursive(QObject *obj) {
Returns true, if the value could be assigned, otherwise returns false, which is the case if the mentioned Returns true, if the value could be assigned, otherwise returns false, which is the case if the mentioned
propertyName wasn't found for the \a obj. propertyName wasn't found for the \a obj.
*/ */
bool UiGuiSettings::setSettingToObjectPropertyValue( QObject *obj, const QString &propertyName, const QString &settingName ) bool UiGuiSettings::setSettingToObjectPropertyValue( TQObject *obj, const TQString &propertyName, const TQString &settingName )
{ {
const QMetaObject *metaObject = obj->metaObject(); const TQMetaObject *metaObject = obj->metaObject();
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) ); int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) { if ( indexOfProp > -1 ) {
QMetaProperty mProp = metaObject->property(indexOfProp); TQMetaProperty mProp = metaObject->property(indexOfProp);
setValueByName(settingName, mProp.read(obj)); setValueByName(settingName, mProp.read(obj));
} }
@ -339,35 +339,35 @@ bool UiGuiSettings::setSettingToObjectPropertyValue( QObject *obj, const QString
/*! /*!
\brief Searches the child QObjects of \a obj for a property name and setting name definition within \brief Searches the child TQObjects of \a obj for a property name and setting name definition within
their custom properties and sets each setting to the property value. their custom properties and sets each setting to the property value.
The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName", The custom properties, for which are searched, are "connectedPropertyName" and "connectedSettingName",
where "connectedPropertyName" is the name of a QObject property as it is documented in the QtDocs, and where "connectedPropertyName" is the name of a TQObject property as it is documented in the TQtDocs, and
"connectedSettingName" is the name of a setting here within UiGuiSettings. If the settingName "connectedSettingName" is the name of a setting here within UiGuiSettings. If the settingName
didn't exist yet, it will be created. didn't exist yet, it will be created.
Returns true, if all found property and setting definitions could be successfully registered. Returns true, if all found property and setting definitions could be successfully registered.
Returns false, if any of those registrations fails. Returns false, if any of those registrations fails.
*/ */
bool UiGuiSettings::setSettingToObjectPropertyValueRecursive(QObject *obj) { bool UiGuiSettings::setSettingToObjectPropertyValueRecursive(TQObject *obj) {
return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::setSettingToObjectPropertyValue); return checkCustomPropertiesAndCallFunction(obj, &UiGuiSettings::setSettingToObjectPropertyValue);
} }
/*! /*!
\brief Iterates over all \a objs child QObjects and checks whether they have the custom properties \brief Iterates over all \a objs child TQObjects and checks whether they have the custom properties
"connectedPropertyName" and "connectedSettingName" set. If both are set, it invokes the \a callBackFunc "connectedPropertyName" and "connectedSettingName" set. If both are set, it invokes the \a callBackFunc
with both. with both.
*/ */
bool UiGuiSettings::checkCustomPropertiesAndCallFunction(QObject *obj, bool (UiGuiSettings::*callBackFunc)(QObject *obj, const QString &propertyName, const QString &settingName)) { bool UiGuiSettings::checkCustomPropertiesAndCallFunction(TQObject *obj, bool (UiGuiSettings::*callBackFunc)(TQObject *obj, const TQString &propertyName, const TQString &settingName)) {
bool success = true; bool success = true;
// Find all widgets that have PropertyName and SettingName defined in their style sheet. // Find all widgets that have PropertyName and SettingName defined in their style sheet.
QList<QObject *> allObjects = obj->findChildren<QObject *>(); TQList<TQObject *> allObjects = obj->findChildren<TQObject *>();
foreach (QObject *object, allObjects) { foreach (TQObject *object, allObjects) {
QString propertyName = object->property("connectedPropertyName").toString(); TQString propertyName = object->property("connectedPropertyName").toString();
QString settingName = object->property("connectedSettingName").toString(); TQString settingName = object->property("connectedSettingName").toString();
// If property and setting name were found, register that widget with the settings. // If property and setting name were found, register that widget with the settings.
if ( !propertyName.isEmpty() && !settingName.isEmpty() ) { if ( !propertyName.isEmpty() && !settingName.isEmpty() ) {
@ -382,22 +382,22 @@ bool UiGuiSettings::checkCustomPropertiesAndCallFunction(QObject *obj, bool (UiG
/*! /*!
\brief The with a certain property registered \a obj gets unregistered. \brief The with a certain property registered \a obj gets unregistered.
*/ */
void UiGuiSettings::unregisterObjectProperty(QObject *obj) { void UiGuiSettings::unregisterObjectProperty(TQObject *obj) {
if ( _registeredObjectProperties.contains(obj) ) { if ( _registeredObjectProperties.contains(obj) ) {
const QMetaObject *metaObject = obj->metaObject(); const TQMetaObject *metaObject = obj->metaObject();
QString propertyName = _registeredObjectProperties[obj].first(); TQString propertyName = _registeredObjectProperties[obj].first();
QString settingName = _registeredObjectProperties[obj].last(); TQString settingName = _registeredObjectProperties[obj].last();
bool connectSuccess = false; bool connectSuccess = false;
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) ); int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) { if ( indexOfProp > -1 ) {
QMetaProperty mProp = metaObject->property(indexOfProp); TQMetaProperty mProp = metaObject->property(indexOfProp);
// Disconnect to the property's value changed signal. // Disconnect to the property's value changed signal.
if ( mProp.hasNotifySignal() ) { if ( mProp.hasNotifySignal() ) {
QMetaMethod signal = mProp.notifySignal(); TQMetaMethod signal = mProp.notifySignal();
// The command "SIGNAL() + QString(signal.signature())" assembles the signal methods signature to a valid Qt SIGNAL. // The command "SIGNAL() + TQString(signal.signature())" assembles the signal methods signature to a valid TQt SIGNAL.
connectSuccess = disconnect(obj, qPrintable(SIGNAL() + QString(signal.signature())), this, SLOT(handleObjectPropertyChange())); connectSuccess = disconnect(obj, qPrintable(SIGNAL() + TQString(signal.signature())), this, SLOT(handleObjectPropertyChange()));
} }
} }
_registeredObjectProperties.remove(obj); _registeredObjectProperties.remove(obj);
@ -413,35 +413,35 @@ void UiGuiSettings::unregisterObjectProperty(QObject *obj) {
\a settingName changes the slot gets tried to be invoked with the settings value as parameter. This only works, \a settingName changes the slot gets tried to be invoked with the settings value as parameter. This only works,
if the slot parameter is of the same type as the setting. if the slot parameter is of the same type as the setting.
*/ */
bool UiGuiSettings::registerObjectSlot(QObject *obj, const QString &slotName, const QString &settingName) { bool UiGuiSettings::registerObjectSlot(TQObject *obj, const TQString &slotName, const TQString &settingName) {
const QMetaObject *metaObject = obj->metaObject(); const TQMetaObject *metaObject = obj->metaObject();
bool connectSuccess = false; bool connectSuccess = false;
// Connect to the objects destroyed signal, so that it will be correctly unregistered. // Connect to the objects destroyed signal, so that it will be correctly unregistered.
connectSuccess = connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectSlot(QObject*))); connectSuccess = connect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectSlot(TQObject*)));
QString normalizedSlotName = QMetaObject::normalizedSignature( qPrintable(slotName) ); TQString normalizedSlotName = TQMetaObject::normalizedSignature( qPrintable(slotName) );
int indexOfMethod = metaObject->indexOfMethod( qPrintable(normalizedSlotName) ); int indexOfMethod = metaObject->indexOfMethod( qPrintable(normalizedSlotName) );
if ( connectSuccess && indexOfMethod > -1 ) { if ( connectSuccess && indexOfMethod > -1 ) {
QMetaMethod mMethod = metaObject->method(indexOfMethod); TQMetaMethod mMethod = metaObject->method(indexOfMethod);
//QMetaMethod::Access access = mMethod.access(); //TQMetaMethod::Access access = mMethod.access();
//QMetaMethod::MethodType methType = mMethod.methodType(); //TQMetaMethod::MethodType methType = mMethod.methodType();
// Since the method can at maximum be invoked with the setting value as argument, // Since the method can at maximum be invoked with the setting value as argument,
// only methods taking max one argument are allowed. // only methods taking max one argument are allowed.
if ( mMethod.parameterTypes().size() <= 1 ) { if ( mMethod.parameterTypes().size() <= 1 ) {
_registeredObjectSlots.insert(obj, QStringList() << normalizedSlotName << settingName); _registeredObjectSlots.insert(obj, TQStringList() << normalizedSlotName << settingName);
} }
else { else {
//TODO: Write a debug warning to the log. //TODO: Write a debug warning to the log.
disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectSlot(QObject*))); disconnect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectSlot(TQObject*)));
return false; return false;
} }
} }
else { else {
//TODO: Write a debug warning to the log. //TODO: Write a debug warning to the log.
disconnect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterObjectSlot(QObject*))); disconnect(obj, SIGNAL(destroyed(TQObject*)), this, SLOT(unregisterObjectSlot(TQObject*)));
return false; return false;
} }
@ -453,10 +453,10 @@ bool UiGuiSettings::registerObjectSlot(QObject *obj, const QString &slotName, co
\brief If \a obj, \a slotName and \a settingName are given, that certain connection is unregistered. \brief If \a obj, \a slotName and \a settingName are given, that certain connection is unregistered.
If only \a obj is given, all to this object registered slot-setting connections are unregistered. If only \a obj is given, all to this object registered slot-setting connections are unregistered.
*/ */
void UiGuiSettings::unregisterObjectSlot(QObject *obj, const QString &slotName, const QString &settingName) { void UiGuiSettings::unregisterObjectSlot(TQObject *obj, const TQString &slotName, const TQString &settingName) {
//const QMetaObject *metaObject = obj->metaObject(); //const TQMetaObject *metaObject = obj->metaObject();
QString normalizedSlotName = QMetaObject::normalizedSignature( qPrintable(slotName) ); TQString normalizedSlotName = TQMetaObject::normalizedSignature( qPrintable(slotName) );
QMutableMapIterator<QObject*, QStringList> it(_registeredObjectSlots); TQMutableMapIterator<TQObject*, TQStringList> it(_registeredObjectSlots);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
if (it.key() == obj && slotName.isEmpty() && settingName.isEmpty()) if (it.key() == obj && slotName.isEmpty() && settingName.isEmpty())
@ -472,15 +472,15 @@ void UiGuiSettings::unregisterObjectSlot(QObject *obj, const QString &slotName,
and distributes the new value to all other to the same settingName registered objects. and distributes the new value to all other to the same settingName registered objects.
*/ */
void UiGuiSettings::handleObjectPropertyChange() { void UiGuiSettings::handleObjectPropertyChange() {
QObject *obj = QObject::sender(); TQObject *obj = TQObject::sender();
QString className = obj->metaObject()->className(); TQString className = obj->metaObject()->className();
const QMetaObject *metaObject = obj->metaObject(); const TQMetaObject *metaObject = obj->metaObject();
QString propertyName = _registeredObjectProperties[obj].first(); TQString propertyName = _registeredObjectProperties[obj].first();
QString settingName = _registeredObjectProperties[obj].last(); TQString settingName = _registeredObjectProperties[obj].last();
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) ); int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) { if ( indexOfProp > -1 ) {
QMetaProperty mProp = metaObject->property(indexOfProp); TQMetaProperty mProp = metaObject->property(indexOfProp);
setValueByName(settingName, mProp.read(obj)); setValueByName(settingName, mProp.read(obj));
} }
} }
@ -493,38 +493,38 @@ void UiGuiSettings::handleObjectPropertyChange() {
the changed value set too. the changed value set too.
If the \a settingName didn't exist yet, it will be created. If the \a settingName didn't exist yet, it will be created.
*/ */
void UiGuiSettings::setValueByName(const QString &settingName, const QVariant &value) { void UiGuiSettings::setValueByName(const TQString &settingName, const TQVariant &value) {
// Do the updating only, if the setting was really changed. // Do the updating only, if the setting was really changed.
if ( _qsettings->value("UniversalIndentGUI/" + settingName) != value ) { if ( _qsettings->value("UniversalIndentGUI/" + settingName) != value ) {
_qsettings->setValue("UniversalIndentGUI/" + settingName, value); _qsettings->setValue("UniversalIndentGUI/" + settingName, value);
// Set the new value for all registered object properties for settingName. // Set the new value for all registered object properties for settingName.
for ( QMap<QObject*, QStringList>::ConstIterator it = _registeredObjectProperties.begin(); it != _registeredObjectProperties.end(); ++it ) { for ( TQMap<TQObject*, TQStringList>::ConstIterator it = _registeredObjectProperties.begin(); it != _registeredObjectProperties.end(); ++it ) {
if ( it.value().last() == settingName ) { if ( it.value().last() == settingName ) {
QObject *obj = it.key(); TQObject *obj = it.key();
const QMetaObject *metaObject = obj->metaObject(); const TQMetaObject *metaObject = obj->metaObject();
QString propertyName = it.value().first(); TQString propertyName = it.value().first();
int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) ); int indexOfProp = metaObject->indexOfProperty( qPrintable(propertyName) );
if ( indexOfProp > -1 ) { if ( indexOfProp > -1 ) {
QMetaProperty mProp = metaObject->property(indexOfProp); TQMetaProperty mProp = metaObject->property(indexOfProp);
mProp.write(obj, value); mProp.write(obj, value);
} }
} }
} }
// Invoke all registered object methods for settingName. // Invoke all registered object methods for settingName.
for ( QMap<QObject*, QStringList>::ConstIterator it = _registeredObjectSlots.begin(); it != _registeredObjectSlots.end(); ++it ) { for ( TQMap<TQObject*, TQStringList>::ConstIterator it = _registeredObjectSlots.begin(); it != _registeredObjectSlots.end(); ++it ) {
if ( it.value().last() == settingName ) { if ( it.value().last() == settingName ) {
QObject *obj = it.key(); TQObject *obj = it.key();
const QMetaObject *metaObject = obj->metaObject(); const TQMetaObject *metaObject = obj->metaObject();
QString slotName = it.value().first(); TQString slotName = it.value().first();
int indexOfMethod = metaObject->indexOfMethod( qPrintable(slotName) ); int indexOfMethod = metaObject->indexOfMethod( qPrintable(slotName) );
if ( indexOfMethod > -1 ) { if ( indexOfMethod > -1 ) {
QMetaMethod mMethod = metaObject->method(indexOfMethod); TQMetaMethod mMethod = metaObject->method(indexOfMethod);
//QMetaMethod::Access access = mMethod.access(); //TQMetaMethod::Access access = mMethod.access();
//QMetaMethod::MethodType methType = mMethod.methodType(); //TQMetaMethod::MethodType methType = mMethod.methodType();
bool success = false; bool success = false;
@ -536,7 +536,7 @@ void UiGuiSettings::setValueByName(const QString &settingName, const QVariant &v
} }
// Handle registered slots taking zero parameters. // Handle registered slots taking zero parameters.
else { else {
success = mMethod.invoke( obj, Qt::DirectConnection ); success = mMethod.invoke( obj, TQt::DirectConnection );
} }
if ( success == false ) { if ( success == false ) {
@ -549,138 +549,138 @@ void UiGuiSettings::setValueByName(const QString &settingName, const QVariant &v
} }
#include <tqbitarray.h> #include <tntqbitarray.h>
#include <tqbitmap.h> #include <tntqbitmap.h>
#include <tqbrush.h> #include <tntqbrush.h>
#include <tqcursor.h> #include <tntqcursor.h>
#include <tqdatetime.h> #include <tntqdatetime.h>
#include <tqfont.h> #include <tntqfont.h>
#include <tqicon.h> #include <tqicon.h>
#include <tqkeysequence.h> #include <tntqkeysequence.h>
#include <tqlocale.h> #include <tntqlocale.h>
#include <tqpalette.h> #include <tntqpalette.h>
#include <tqpen.h> #include <tntqpen.h>
#include <tqsizepolicy.h> #include <tntqsizepolicy.h>
#include <tqtextformat.h> #include <tqtextformat.h>
#include <tqtextlength.h> #include <tqtextlength.h>
#include <tqurl.h> #include <tntqurl.h>
#if QT_VERSION >= 0x040600 #if TQT_VERSION >= 0x040600
#include <tqmatrix4x4.h> #include <tqmatrix4x4.h>
#include <tqvector2d.h> #include <tqvector2d.h>
#endif #endif
bool UiGuiSettings::invokeMethodWithValue( QObject *obj, QMetaMethod mMethod, QVariant value ) bool UiGuiSettings::invokeMethodWithValue( TQObject *obj, TQMetaMethod mMethod, TQVariant value )
{ {
switch (value.type()) { switch (value.type()) {
case QVariant::BitArray : case TQVariant::BitArray :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QBitArray, value.toBitArray()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQBitArray, value.toBitArray()) );
case QVariant::Bitmap : case TQVariant::Bitmap :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QBitmap, value.value<QBitmap>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQBitmap, value.value<TQBitmap>()) );
case QVariant::Bool : case TQVariant::Bool :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(bool, value.toBool()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(bool, value.toBool()) );
case QVariant::Brush : case TQVariant::Brush :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QBrush, value.value<QBrush>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQBrush, value.value<TQBrush>()) );
case QVariant::ByteArray : case TQVariant::ByteArray :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QByteArray, value.toByteArray()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQByteArray, value.toByteArray()) );
case QVariant::Char : case TQVariant::Char :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QChar, value.toChar()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQChar, value.toChar()) );
case QVariant::Color : case TQVariant::Color :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QColor, value.value<QColor>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQColor, value.value<TQColor>()) );
case QVariant::Cursor : case TQVariant::Cursor :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QCursor, value.value<QCursor>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQCursor, value.value<TQCursor>()) );
case QVariant::Date : case TQVariant::Date :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QDate, value.toDate()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQDate, value.toDate()) );
case QVariant::DateTime : case TQVariant::DateTime :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QDateTime, value.toDateTime()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQDateTime, value.toDateTime()) );
case QVariant::Double : case TQVariant::Double :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(double, value.toDouble()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(double, value.toDouble()) );
case QVariant::Font : case TQVariant::Font :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QFont, value.value<QFont>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQFont, value.value<TQFont>()) );
case QVariant::Hash : case TQVariant::Hash :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVariantHash, value.toHash()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVariantHash, value.toHash()) );
case QVariant::Icon : case TQVariant::Icon :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QIcon, value.value<QIcon>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQIcon, value.value<TQIcon>()) );
case QVariant::Image : case TQVariant::Image :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QImage, value.value<QImage>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQImage, value.value<TQImage>()) );
case QVariant::Int : case TQVariant::Int :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(int, value.toInt()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(int, value.toInt()) );
case QVariant::KeySequence : case TQVariant::KeySequence :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QKeySequence, value.value<QKeySequence>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQKeySequence, value.value<TQKeySequence>()) );
case QVariant::Line : case TQVariant::Line :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QLine, value.toLine()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQLine, value.toLine()) );
case QVariant::LineF : case TQVariant::LineF :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QLineF, value.toLineF()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQLineF, value.toLineF()) );
case QVariant::List : case TQVariant::List :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVariantList, value.toList()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVariantList, value.toList()) );
case QVariant::Locale : case TQVariant::Locale :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QLocale, value.toLocale()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQLocale, value.toLocale()) );
case QVariant::LongLong : case TQVariant::LongLong :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(qlonglong, value.toLongLong()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(qlonglong, value.toLongLong()) );
case QVariant::Map : case TQVariant::Map :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVariantMap, value.toMap()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVariantMap, value.toMap()) );
case QVariant::Matrix : case TQVariant::Matrix :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QMatrix, value.value<QMatrix>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQMatrix, value.value<TQMatrix>()) );
case QVariant::Transform : case TQVariant::Transform :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTransform, value.value<QTransform>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQTransform, value.value<TQTransform>()) );
#if QT_VERSION >= 0x040600 #if TQT_VERSION >= 0x040600
case QVariant::Matrix4x4 : case TQVariant::Matrix4x4 :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QMatrix4x4, value.value<QMatrix4x4>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQMatrix4x4, value.value<TQMatrix4x4>()) );
#endif #endif
case QVariant::Palette : case TQVariant::Palette :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPalette, value.value<QPalette>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPalette, value.value<TQPalette>()) );
case QVariant::Pen : case TQVariant::Pen :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPen, value.value<QPen>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPen, value.value<TQPen>()) );
case QVariant::Pixmap : case TQVariant::Pixmap :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPixmap, value.value<QPixmap>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPixmap, value.value<TQPixmap>()) );
case QVariant::Point : case TQVariant::Point :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPoint, value.toPoint()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPoint, value.toPoint()) );
// case QVariant::PointArray : // case TQVariant::PointArray :
// return Q_ARG(QPointArray, value.value<QPointArray>()) ); // return Q_ARG(TQPointArray, value.value<TQPointArray>()) );
case QVariant::PointF : case TQVariant::PointF :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPointF, value.toPointF()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPointF, value.toPointF()) );
case QVariant::Polygon : case TQVariant::Polygon :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QPolygon, value.value<QPolygon>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQPolygon, value.value<TQPolygon>()) );
#if QT_VERSION >= 0x040600 #if TQT_VERSION >= 0x040600
case QVariant::Quaternion : case TQVariant::Quaternion :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QQuaternion, value.value<QQuaternion>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQQuaternion, value.value<TQQuaternion>()) );
#endif #endif
case QVariant::Rect : case TQVariant::Rect :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRect, value.toRect()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQRect, value.toRect()) );
case QVariant::RectF : case TQVariant::RectF :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRectF, value.toRectF()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQRectF, value.toRectF()) );
case QVariant::RegExp : case TQVariant::RegExp :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRegExp, value.toRegExp()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQRegExp, value.toRegExp()) );
case QVariant::Region : case TQVariant::Region :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QRegion, value.value<QRegion>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQRegion, value.value<TQRegion>()) );
case QVariant::Size : case TQVariant::Size :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QSize, value.toSize()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQSize, value.toSize()) );
case QVariant::SizeF : case TQVariant::SizeF :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QSizeF, value.toSizeF()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQSizeF, value.toSizeF()) );
case QVariant::SizePolicy : case TQVariant::SizePolicy :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QSizePolicy, value.value<QSizePolicy>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQSizePolicy, value.value<TQSizePolicy>()) );
case QVariant::String : case TQVariant::String :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QString, value.toString()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQString, value.toString()) );
case QVariant::StringList : case TQVariant::StringList :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QStringList, value.toStringList()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQStringList, value.toStringList()) );
case QVariant::TextFormat : case TQVariant::TextFormat :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTextFormat, value.value<QTextFormat>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQTextFormat, value.value<TQTextFormat>()) );
case QVariant::TextLength : case TQVariant::TextLength :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTextLength, value.value<QTextLength>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQTextLength, value.value<TQTextLength>()) );
case QVariant::Time : case TQVariant::Time :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QTime, value.toTime()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQTime, value.toTime()) );
case QVariant::UInt : case TQVariant::UInt :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(uint, value.toUInt()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(uint, value.toUInt()) );
case QVariant::ULongLong : case TQVariant::ULongLong :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(qulonglong, value.toULongLong()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(qulonglong, value.toULongLong()) );
case QVariant::Url : case TQVariant::Url :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QUrl, value.toUrl()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQUrl, value.toUrl()) );
#if QT_VERSION >= 0x040600 #if TQT_VERSION >= 0x040600
case QVariant::Vector2D : case TQVariant::Vector2D :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVector2D, value.value<QVector2D>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVector2D, value.value<TQVector2D>()) );
case QVariant::Vector3D : case TQVariant::Vector3D :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVector3D, value.value<QVector3D>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVector3D, value.value<TQVector3D>()) );
case QVariant::Vector4D : case TQVariant::Vector4D :
return mMethod.invoke( obj, Qt::DirectConnection, Q_ARG(QVector4D, value.value<QVector4D>()) ); return mMethod.invoke( obj, TQt::DirectConnection, Q_ARG(TQVector4D, value.value<TQVector4D>()) );
#endif #endif
default: default:
return false; return false;

@ -20,44 +20,44 @@
#ifndef UIGUISETTINGS_H #ifndef UIGUISETTINGS_H
#define UIGUISETTINGS_H #define UIGUISETTINGS_H
#include <tqobject.h> #include <tntqobject.h>
#include <tqstringlist.h> #include <tntqstringlist.h>
#include <tqmultimap.h> #include <tqmultimap.h>
#include <tqsharedpointer.h> #include <tqsharedpointer.h>
class QSettings; class TQSettings;
class UiGuiSettings : public QObject class UiGuiSettings : public TQObject
{ {
Q_OBJECT Q_OBJECT
private: private:
UiGuiSettings(); UiGuiSettings();
static QWeakPointer<UiGuiSettings> _instance; static TQWeakPointer<UiGuiSettings> _instance;
public: public:
static QSharedPointer<UiGuiSettings> getInstance(); static TQSharedPointer<UiGuiSettings> getInstance();
~UiGuiSettings(); ~UiGuiSettings();
bool registerObjectProperty(QObject *obj, const QString &propertyName, const QString &settingName); bool registerObjectProperty(TQObject *obj, const TQString &propertyName, const TQString &settingName);
bool registerObjectPropertyRecursive(QObject *obj); bool registerObjectPropertyRecursive(TQObject *obj);
bool setObjectPropertyToSettingValue(QObject *obj, const QString &propertyName, const QString &settingName); bool setObjectPropertyToSettingValue(TQObject *obj, const TQString &propertyName, const TQString &settingName);
bool setObjectPropertyToSettingValueRecursive(QObject *obj); bool setObjectPropertyToSettingValueRecursive(TQObject *obj);
bool setSettingToObjectPropertyValue(QObject *obj, const QString &propertyName, const QString &settingName); bool setSettingToObjectPropertyValue(TQObject *obj, const TQString &propertyName, const TQString &settingName);
bool setSettingToObjectPropertyValueRecursive(QObject *obj); bool setSettingToObjectPropertyValueRecursive(TQObject *obj);
bool registerObjectSlot(QObject *obj, const QString &slotName, const QString &settingName); bool registerObjectSlot(TQObject *obj, const TQString &slotName, const TQString &settingName);
QVariant getValueByName(QString settingName); TQVariant getValueByName(TQString settingName);
QStringList getAvailableTranslations(); TQStringList getAvailableTranslations();
public slots: public slots:
void setValueByName(const QString &settingName, const QVariant &value); void setValueByName(const TQString &settingName, const TQVariant &value);
void unregisterObjectProperty(QObject *obj); void unregisterObjectProperty(TQObject *obj);
void unregisterObjectSlot(QObject *obj, const QString &slotName = "", const QString &settingName = ""); void unregisterObjectSlot(TQObject *obj, const TQString &slotName = "", const TQString &settingName = "");
protected: protected:
bool initSettings(); bool initSettings();
bool invokeMethodWithValue(QObject *obj, QMetaMethod mMethod, QVariant value); bool invokeMethodWithValue(TQObject *obj, TQMetaMethod mMethod, TQVariant value);
bool checkCustomPropertiesAndCallFunction(QObject *obj, bool (UiGuiSettings::*callBackFunc)(QObject *obj, const QString &propertyName, const QString &settingName)); bool checkCustomPropertiesAndCallFunction(TQObject *obj, bool (UiGuiSettings::*callBackFunc)(TQObject *obj, const TQString &propertyName, const TQString &settingName));
private slots: private slots:
void handleObjectPropertyChange(); void handleObjectPropertyChange();
@ -66,18 +66,18 @@ private:
void readAvailableTranslations(); void readAvailableTranslations();
//! Stores the mnemonics of the available translations. //! Stores the mnemonics of the available translations.
QStringList _availableTranslations; TQStringList _availableTranslations;
//! The settings file. //! The settings file.
QSettings *_qsettings; TQSettings *_qsettings;
//! Maps an QObject to a string list containing the property name and the associated setting name. //! Maps an TQObject to a string list containing the property name and the associated setting name.
QMap<QObject*, QStringList> _registeredObjectProperties; TQMap<TQObject*, TQStringList> _registeredObjectProperties;
//! Maps QObjects to a string list containing the method name and the associated setting name. //! Maps TQObjects to a string list containing the method name and the associated setting name.
QMultiMap<QObject*, QStringList> _registeredObjectSlots; TQMultiMap<TQObject*, TQStringList> _registeredObjectSlots;
QString _indenterDirctoryStr; TQString _indenterDirctoryStr;
}; };
#endif // UIGUISETTINGS_H #endif // UIGUISETTINGS_H

@ -31,7 +31,7 @@
/*! /*!
\brief The constructor calls the setup function for the ui created by uic. \brief The constructor calls the setup function for the ui created by uic.
*/ */
UiGuiSettingsDialog::UiGuiSettingsDialog(QWidget* parent, QSharedPointer<UiGuiSettings> settings) : QDialog(parent) { UiGuiSettingsDialog::UiGuiSettingsDialog(TQWidget* parent, TQSharedPointer<UiGuiSettings> settings) : TQDialog(parent) {
// Remember pointer to the UiGuiSettings object. // Remember pointer to the UiGuiSettings object.
_settings = settings; _settings = settings;
@ -62,28 +62,28 @@ void UiGuiSettingsDialog::initTranslationSelection() {
_settingsDialogForm->languageSelectionComboBox->clear(); _settingsDialogForm->languageSelectionComboBox->clear();
// Now add an entry into the box for every language short. // Now add an entry into the box for every language short.
foreach (QString languageShort, _settings->getAvailableTranslations() ) { foreach (TQString languageShort, _settings->getAvailableTranslations() ) {
// Identify the language mnemonic and set the full name. // Identify the language mnemonic and set the full name.
if ( languageShort == "en" ) { if ( languageShort == "en" ) {
_settingsDialogForm->languageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("English") ); _settingsDialogForm->languageSelectionComboBox->addItem( TQIcon(TQString(":/language/language-"+languageShort+".png")), tr("English") );
} }
else if ( languageShort == "fr" ) { else if ( languageShort == "fr" ) {
_settingsDialogForm->languageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("French") ); _settingsDialogForm->languageSelectionComboBox->addItem( TQIcon(TQString(":/language/language-"+languageShort+".png")), tr("French") );
} }
else if ( languageShort == "de" ) { else if ( languageShort == "de" ) {
_settingsDialogForm->languageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("German") ); _settingsDialogForm->languageSelectionComboBox->addItem( TQIcon(TQString(":/language/language-"+languageShort+".png")), tr("German") );
} }
else if ( languageShort == "zh_TW" ) { else if ( languageShort == "zh_TW" ) {
_settingsDialogForm->languageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Chinese (Taiwan)") ); _settingsDialogForm->languageSelectionComboBox->addItem( TQIcon(TQString(":/language/language-"+languageShort+".png")), tr("Chinese (Taiwan)") );
} }
else if ( languageShort == "ja" ) { else if ( languageShort == "ja" ) {
_settingsDialogForm->languageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Japanese") ); _settingsDialogForm->languageSelectionComboBox->addItem( TQIcon(TQString(":/language/language-"+languageShort+".png")), tr("Japanese") );
} }
else if ( languageShort == "ru" ) { else if ( languageShort == "ru" ) {
_settingsDialogForm->languageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Russian") ); _settingsDialogForm->languageSelectionComboBox->addItem( TQIcon(TQString(":/language/language-"+languageShort+".png")), tr("Russian") );
} }
else if ( languageShort == "uk" ) { else if ( languageShort == "uk" ) {
_settingsDialogForm->languageSelectionComboBox->addItem( QIcon(QString(":/language/language-"+languageShort+".png")), tr("Ukrainian") ); _settingsDialogForm->languageSelectionComboBox->addItem( TQIcon(TQString(":/language/language-"+languageShort+".png")), tr("Ukrainian") );
} }
else { else {
@ -121,20 +121,20 @@ void UiGuiSettingsDialog::writeWidgetValuesToSettings() {
/*! /*!
\brief Catches language change events and retranslates all needed widgets. \brief Catches language change events and retranslates all needed widgets.
*/ */
void UiGuiSettingsDialog::changeEvent(QEvent *event) { void UiGuiSettingsDialog::changeEvent(TQEvent *event) {
if (event->type() == QEvent::LanguageChange) { if (event->type() == TQEvent::LanguageChange) {
_settingsDialogForm->retranslateUi(this); _settingsDialogForm->retranslateUi(this);
// If this is not explicit set here, Qt < 4.3.0 does not translate the buttons. // If this is not explicit set here, TQt < 4.3.0 does not translate the buttons.
_settingsDialogForm->buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::NoButton|QDialogButtonBox::Ok); _settingsDialogForm->buttonBox->setStandardButtons(TQDialogButtonBox::Cancel | TQDialogButtonBox::NoButton|TQDialogButtonBox::Ok);
//TODO: This has to be removed when the properties for the highlighters can be set. //TODO: This has to be removed when the properties for the highlighters can be set.
_settingsDialogForm->groupBoxSyntaxHighlighterProperties->setToolTip( "(Will be implemented soon)" + _settingsDialogForm->groupBoxSyntaxHighlighterProperties->toolTip() ); _settingsDialogForm->groupBoxSyntaxHighlighterProperties->setToolTip( "(Will be implemented soon)" + _settingsDialogForm->groupBoxSyntaxHighlighterProperties->toolTip() );
QStringList languageShortList = _settings->getAvailableTranslations(); TQStringList languageShortList = _settings->getAvailableTranslations();
// Now retranslate every entry in the language selection box. // Now retranslate every entry in the language selection box.
for (int i = 0; i < languageShortList.size(); i++ ) { for (int i = 0; i < languageShortList.size(); i++ ) {
QString languageShort = languageShortList.at(i); TQString languageShort = languageShortList.at(i);
// Identify the language mnemonic and set the full name. // Identify the language mnemonic and set the full name.
if ( languageShort == "en" ) { if ( languageShort == "en" ) {
@ -164,6 +164,6 @@ void UiGuiSettingsDialog::changeEvent(QEvent *event) {
} }
} }
else { else {
QWidget::changeEvent(event); TQWidget::changeEvent(event);
} }
} }

@ -20,7 +20,7 @@
#ifndef UIGUISETTINGSDIALOG_H #ifndef UIGUISETTINGSDIALOG_H
#define UIGUISETTINGSDIALOG_H #define UIGUISETTINGSDIALOG_H
#include <tqdialog.h> #include <tntqdialog.h>
#include "UiGuiSettings.h" #include "UiGuiSettings.h"
@ -29,12 +29,12 @@ namespace Ui {
} }
class UiGuiSettingsDialog : public QDialog class UiGuiSettingsDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
UiGuiSettingsDialog(QWidget* parent, QSharedPointer<UiGuiSettings> settings); UiGuiSettingsDialog(TQWidget* parent, TQSharedPointer<UiGuiSettings> settings);
public slots: public slots:
int showDialog(); int showDialog();
@ -45,10 +45,10 @@ private slots:
private: private:
Ui::SettingsDialog *_settingsDialogForm; Ui::SettingsDialog *_settingsDialogForm;
void changeEvent(QEvent *event); void changeEvent(TQEvent *event);
void initTranslationSelection(); void initTranslationSelection();
QSharedPointer<UiGuiSettings> _settings; TQSharedPointer<UiGuiSettings> _settings;
}; };
#endif // UIGUISETTINGSDIALOG_H #endif // UIGUISETTINGSDIALOG_H

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>SettingsDialog</class> <class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog"> <widget class="TQDialog" name="SettingsDialog">
<property name="windowModality"> <property name="windowModality">
<enum>Qt::ApplicationModal</enum> <enum>TQt::ApplicationModal</enum>
</property> </property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -20,13 +20,13 @@
<iconset resource="../resources/Icons.qrc"> <iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/preferences-system.png</normaloff>:/mainWindow/preferences-system.png</iconset> <normaloff>:/mainWindow/preferences-system.png</normaloff>:/mainWindow/preferences-system.png</iconset>
</property> </property>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="TQTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="TQWidget" name="tab">
<attribute name="icon"> <attribute name="icon">
<iconset resource="../resources/Icons.qrc"> <iconset resource="../resources/Icons.qrc">
<normaloff>:/settingsDialog/applications-system.png</normaloff>:/settingsDialog/applications-system.png</iconset> <normaloff>:/settingsDialog/applications-system.png</normaloff>:/settingsDialog/applications-system.png</iconset>
@ -34,11 +34,11 @@
<attribute name="title"> <attribute name="title">
<string>Common</string> <string>Common</string>
</attribute> </attribute>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<item> <item>
<layout class="QHBoxLayout"> <layout class="TQHBoxLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="TQLabel" name="label">
<property name="toolTip"> <property name="toolTip">
<string>Displays all available translations for UniversalIndentGui and lets you choose one.</string> <string>Displays all available translations for UniversalIndentGui and lets you choose one.</string>
</property> </property>
@ -51,7 +51,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="languageSelectionComboBox"> <widget class="TQComboBox" name="languageSelectionComboBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -72,7 +72,7 @@
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -85,7 +85,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="loadLastOpenedFileOnStartupComboBox"> <widget class="TQCheckBox" name="loadLastOpenedFileOnStartupComboBox">
<property name="toolTip"> <property name="toolTip">
<string>If selected opens the source code file on startup that was opened last time.</string> <string>If selected opens the source code file on startup that was opened last time.</string>
</property> </property>
@ -101,7 +101,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="enableIndenterParameterTooltipsCheckBox"> <widget class="TQCheckBox" name="enableIndenterParameterTooltipsCheckBox">
<property name="toolTip"> <property name="toolTip">
<string>If checked, tool tips will show up if the mouse cursor remains over an indenter parameter for a while.</string> <string>If checked, tool tips will show up if the mouse cursor remains over an indenter parameter for a while.</string>
</property> </property>
@ -117,9 +117,9 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout"> <layout class="TQHBoxLayout">
<item> <item>
<widget class="QLabel" name="labelRecentlyOpenedListSize"> <widget class="TQLabel" name="labelRecentlyOpenedListSize">
<property name="toolTip"> <property name="toolTip">
<string>Sets how many files should be remembered in the list of recently opened files.</string> <string>Sets how many files should be remembered in the list of recently opened files.</string>
</property> </property>
@ -129,7 +129,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="recentlyOpenedListSizeSpinBox"> <widget class="TQSpinBox" name="recentlyOpenedListSizeSpinBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -159,7 +159,7 @@
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -174,7 +174,7 @@
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>TQt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -186,7 +186,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_2"> <widget class="TQWidget" name="tab_2">
<attribute name="icon"> <attribute name="icon">
<iconset resource="../resources/Icons.qrc"> <iconset resource="../resources/Icons.qrc">
<normaloff>:/settingsDialog/accessories-text-editor.png</normaloff>:/settingsDialog/accessories-text-editor.png</iconset> <normaloff>:/settingsDialog/accessories-text-editor.png</normaloff>:/settingsDialog/accessories-text-editor.png</iconset>
@ -194,9 +194,9 @@
<attribute name="title"> <attribute name="title">
<string>Editor</string> <string>Editor</string>
</attribute> </attribute>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<item> <item>
<widget class="QCheckBox" name="whiteSpaceIsVisibleCheckBox"> <widget class="TQCheckBox" name="whiteSpaceIsVisibleCheckBox">
<property name="toolTip"> <property name="toolTip">
<string>Enables or disables displaying of white space characters in the editor.</string> <string>Enables or disables displaying of white space characters in the editor.</string>
</property> </property>
@ -212,9 +212,9 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout"> <layout class="TQHBoxLayout">
<item> <item>
<widget class="QLabel" name="labelTabWidth"> <widget class="TQLabel" name="labelTabWidth">
<property name="toolTip"> <property name="toolTip">
<string>Sets width in single spaces used for tabs</string> <string>Sets width in single spaces used for tabs</string>
</property> </property>
@ -227,7 +227,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="tabWidthSpinBox"> <widget class="TQSpinBox" name="tabWidthSpinBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -257,7 +257,7 @@
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -272,7 +272,7 @@
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>TQt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -284,7 +284,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_4"> <widget class="TQWidget" name="tab_4">
<attribute name="icon"> <attribute name="icon">
<iconset resource="../resources/Icons.qrc"> <iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/system-software-update.png</normaloff>:/mainWindow/system-software-update.png</iconset> <normaloff>:/mainWindow/system-software-update.png</normaloff>:/mainWindow/system-software-update.png</iconset>
@ -292,9 +292,9 @@
<attribute name="title"> <attribute name="title">
<string>Network</string> <string>Network</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="TQVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QCheckBox" name="checkForUpdateCheckBox"> <widget class="TQCheckBox" name="checkForUpdateCheckBox">
<property name="toolTip"> <property name="toolTip">
<string>Checks whether a new version of UniversalIndentGUI exists on program start, but only once a day.</string> <string>Checks whether a new version of UniversalIndentGUI exists on program start, but only once a day.</string>
</property> </property>
@ -310,13 +310,13 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="TQGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string/> <string/>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="TQVBoxLayout" name="verticalLayout_5">
<item> <item>
<widget class="QCheckBox" name="enableProxyCheckBox"> <widget class="TQCheckBox" name="enableProxyCheckBox">
<property name="toolTip"> <property name="toolTip">
<string>If checked, the made proxy settings will be applied for all network connections. Type of the used proxy is SOCKS5.</string> <string>If checked, the made proxy settings will be applied for all network connections. Type of the used proxy is SOCKS5.</string>
</property> </property>
@ -332,13 +332,13 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="TQWidget" name="widget" native="true">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="TQGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_2"> <widget class="TQLabel" name="label_2">
<property name="text"> <property name="text">
<string>Host name:</string> <string>Host name:</string>
</property> </property>
@ -348,7 +348,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="proxyHostNameLineEdit"> <widget class="TQLineEdit" name="proxyHostNameLineEdit">
<property name="toolTip"> <property name="toolTip">
<string>Host name of the to be used proxy. E.g.: proxy.example.com</string> <string>Host name of the to be used proxy. E.g.: proxy.example.com</string>
</property> </property>
@ -361,7 +361,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_3"> <widget class="TQLabel" name="label_3">
<property name="text"> <property name="text">
<string>Port:</string> <string>Port:</string>
</property> </property>
@ -371,15 +371,15 @@
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QSpinBox" name="proxyPortSpinBox"> <widget class="TQSpinBox" name="proxyPortSpinBox">
<property name="toolTip"> <property name="toolTip">
<string>Port number to connect to the before named proxy.</string> <string>Port number to connect to the before named proxy.</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>TQt::AlignRight|TQt::AlignTrailing|TQt::AlignVCenter</set>
</property> </property>
<property name="buttonSymbols"> <property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum> <enum>TQAbstractSpinBox::NoButtons</enum>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>99999</number> <number>99999</number>
@ -393,7 +393,7 @@
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_4"> <widget class="TQLabel" name="label_4">
<property name="text"> <property name="text">
<string>User name:</string> <string>User name:</string>
</property> </property>
@ -403,7 +403,7 @@
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLineEdit" name="proxyUserNameLineEdit"> <widget class="TQLineEdit" name="proxyUserNameLineEdit">
<property name="toolTip"> <property name="toolTip">
<string>If the proxy needs authentification, enter the login name here.</string> <string>If the proxy needs authentification, enter the login name here.</string>
</property> </property>
@ -416,7 +416,7 @@
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_6"> <widget class="TQLabel" name="label_6">
<property name="text"> <property name="text">
<string>Password:</string> <string>Password:</string>
</property> </property>
@ -426,12 +426,12 @@
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QLineEdit" name="proxyPasswordLineEdit"> <widget class="TQLineEdit" name="proxyPasswordLineEdit">
<property name="toolTip"> <property name="toolTip">
<string>If the proxy needs authentification, enter the password here.</string> <string>If the proxy needs authentification, enter the password here.</string>
</property> </property>
<property name="echoMode"> <property name="echoMode">
<enum>QLineEdit::Password</enum> <enum>TQLineEdit::Password</enum>
</property> </property>
<property name="connectedSettingName" stdset="0"> <property name="connectedSettingName" stdset="0">
<string notr="true">ProxyPassword</string> <string notr="true">ProxyPassword</string>
@ -449,7 +449,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_3"> <widget class="TQWidget" name="tab_3">
<attribute name="icon"> <attribute name="icon">
<iconset resource="../resources/Icons.qrc"> <iconset resource="../resources/Icons.qrc">
<normaloff>:/settingsDialog/syntax-highlight.png</normaloff>:/settingsDialog/syntax-highlight.png</iconset> <normaloff>:/settingsDialog/syntax-highlight.png</normaloff>:/settingsDialog/syntax-highlight.png</iconset>
@ -457,9 +457,9 @@
<attribute name="title"> <attribute name="title">
<string>Syntax Highlighting</string> <string>Syntax Highlighting</string>
</attribute> </attribute>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<item> <item>
<widget class="QCheckBox" name="enableSyntaxHighlightningCheckBox"> <widget class="TQCheckBox" name="enableSyntaxHighlightningCheckBox">
<property name="toolTip"> <property name="toolTip">
<string>By enabling special key words of the source code are highlighted.</string> <string>By enabling special key words of the source code are highlighted.</string>
</property> </property>
@ -475,7 +475,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBoxSyntaxHighlighterProperties"> <widget class="TQGroupBox" name="groupBoxSyntaxHighlighterProperties">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -485,25 +485,25 @@
<property name="title"> <property name="title">
<string>Highlighter settings</string> <string>Highlighter settings</string>
</property> </property>
<layout class="QHBoxLayout"> <layout class="TQHBoxLayout">
<item> <item>
<widget class="QListWidget" name="listWidget"> <widget class="TQListWidget" name="listWidget">
<property name="currentRow"> <property name="currentRow">
<number>-1</number> <number>-1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QListWidget" name="listWidget_2"> <widget class="TQListWidget" name="listWidget_2">
<property name="currentRow"> <property name="currentRow">
<number>-1</number> <number>-1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<item> <item>
<widget class="QPushButton" name="pushButton_2"> <widget class="TQPushButton" name="pushButton_2">
<property name="toolTip"> <property name="toolTip">
<string>Set the font for the current selected highlighter property.</string> <string>Set the font for the current selected highlighter property.</string>
</property> </property>
@ -513,7 +513,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton"> <widget class="TQPushButton" name="pushButton">
<property name="toolTip"> <property name="toolTip">
<string>Set the color for the current selected highlighter property.</string> <string>Set the color for the current selected highlighter property.</string>
</property> </property>
@ -525,7 +525,7 @@
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>TQt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -543,7 +543,7 @@
<item> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>TQt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -558,12 +558,12 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="TQDialogButtonBox" name="buttonBox">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> <set>TQDialogButtonBox::Cancel|TQDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>

@ -19,10 +19,10 @@
#include "UiGuiSystemInfo.h" #include "UiGuiSystemInfo.h"
#include <tqstring.h> #include <tntqstring.h>
#include <tqsysinfo.h> #include <tqsysinfo.h>
#include <tqprocess.h> #include <tntqprocess.h>
#include <tqfile.h> #include <tntqfile.h>
UiGuiSystemInfo::UiGuiSystemInfo() { UiGuiSystemInfo::UiGuiSystemInfo() {
} }
@ -33,51 +33,51 @@ UiGuiSystemInfo::UiGuiSystemInfo() {
The String contains name and version of the os. E.g. Linux Ubuntu 9.04. The String contains name and version of the os. E.g. Linux Ubuntu 9.04.
*/ */
QString UiGuiSystemInfo::getOperatingSystem() { TQString UiGuiSystemInfo::getOperatingSystem() {
QString operatingSystemString = ""; TQString operatingSystemString = "";
#if defined(Q_WS_WIN) #if defined(Q_WS_WIN)
switch ( QSysInfo::WindowsVersion ) { switch ( TQSysInfo::WindowsVersion ) {
case QSysInfo::WV_32s : case TQSysInfo::WV_32s :
operatingSystemString = "Windows 3.1 with Win 32s"; operatingSystemString = "Windows 3.1 with Win 32s";
break; break;
case QSysInfo::WV_95 : case TQSysInfo::WV_95 :
operatingSystemString = "Windows 95"; operatingSystemString = "Windows 95";
break; break;
case QSysInfo::WV_98 : case TQSysInfo::WV_98 :
operatingSystemString = "Windows 98"; operatingSystemString = "Windows 98";
break; break;
case QSysInfo::WV_Me : case TQSysInfo::WV_Me :
operatingSystemString = "Windows Me"; operatingSystemString = "Windows Me";
break; break;
case QSysInfo::WV_NT : case TQSysInfo::WV_NT :
operatingSystemString = "Windows NT (operating system version 4.0)"; operatingSystemString = "Windows NT (operating system version 4.0)";
break; break;
case QSysInfo::WV_2000 : case TQSysInfo::WV_2000 :
operatingSystemString = "Windows 2000 (operating system version 5.0)"; operatingSystemString = "Windows 2000 (operating system version 5.0)";
break; break;
case QSysInfo::WV_XP : case TQSysInfo::WV_XP :
operatingSystemString = "Windows XP (operating system version 5.1)"; operatingSystemString = "Windows XP (operating system version 5.1)";
break; break;
case QSysInfo::WV_2003 : case TQSysInfo::WV_2003 :
operatingSystemString = "Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (operating system version 5.2)"; operatingSystemString = "Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (operating system version 5.2)";
break; break;
case QSysInfo::WV_VISTA : case TQSysInfo::WV_VISTA :
operatingSystemString = "Windows Vista, Windows Server 2008 (operating system version 6.0)"; operatingSystemString = "Windows Vista, Windows Server 2008 (operating system version 6.0)";
break; break;
case QSysInfo::WV_WINDOWS7 : case TQSysInfo::WV_WINDOWS7 :
operatingSystemString = "Windows 7 (operating system version 6.1)"; operatingSystemString = "Windows 7 (operating system version 6.1)";
break; break;
case QSysInfo::WV_CE : case TQSysInfo::WV_CE :
operatingSystemString = "Windows CE"; operatingSystemString = "Windows CE";
break; break;
case QSysInfo::WV_CENET : case TQSysInfo::WV_CENET :
operatingSystemString = "Windows CE .NET"; operatingSystemString = "Windows CE .NET";
break; break;
case QSysInfo::WV_CE_5 : case TQSysInfo::WV_CE_5 :
operatingSystemString = "Windows CE 5.x"; operatingSystemString = "Windows CE 5.x";
break; break;
case QSysInfo::WV_CE_6 : case TQSysInfo::WV_CE_6 :
operatingSystemString = "Windows CE 6.x"; operatingSystemString = "Windows CE 6.x";
break; break;
default : default :
@ -85,32 +85,32 @@ QString UiGuiSystemInfo::getOperatingSystem() {
break; break;
} }
#elif defined(Q_WS_MAC) #elif defined(Q_WS_MAC)
switch ( QSysInfo::MacintoshVersion ) { switch ( TQSysInfo::MacintoshVersion ) {
case QSysInfo::MV_9 : case TQSysInfo::MV_9 :
operatingSystemString = "Mac OS 9 (unsupported)"; operatingSystemString = "Mac OS 9 (unsupported)";
break; break;
case QSysInfo::MV_10_0 : case TQSysInfo::MV_10_0 :
operatingSystemString = "Mac OS X 10.0 Cheetah (unsupported)"; operatingSystemString = "Mac OS X 10.0 Cheetah (unsupported)";
break; break;
case QSysInfo::MV_10_1 : case TQSysInfo::MV_10_1 :
operatingSystemString = "Mac OS X 10.1 Puma (unsupported)"; operatingSystemString = "Mac OS X 10.1 Puma (unsupported)";
break; break;
case QSysInfo::MV_10_2 : case TQSysInfo::MV_10_2 :
operatingSystemString = "Mac OS X 10.2 Jaguar (unsupported)"; operatingSystemString = "Mac OS X 10.2 Jaguar (unsupported)";
break; break;
case QSysInfo::MV_10_3 : case TQSysInfo::MV_10_3 :
operatingSystemString = "Mac OS X 10.3 Panther"; operatingSystemString = "Mac OS X 10.3 Panther";
break; break;
case QSysInfo::MV_10_4 : case TQSysInfo::MV_10_4 :
operatingSystemString = "Mac OS X 10.4 Tiger"; operatingSystemString = "Mac OS X 10.4 Tiger";
break; break;
case QSysInfo::MV_10_5 : case TQSysInfo::MV_10_5 :
operatingSystemString = "Mac OS X 10.5 Leopard"; operatingSystemString = "Mac OS X 10.5 Leopard";
break; break;
case QSysInfo::MV_10_6 : case TQSysInfo::MV_10_6 :
operatingSystemString = "Mac OS X 10.6 Snow Leopard"; operatingSystemString = "Mac OS X 10.6 Snow Leopard";
break; break;
case QSysInfo::MV_Unknown : case TQSysInfo::MV_Unknown :
operatingSystemString = "An unknown and currently unsupported platform"; operatingSystemString = "An unknown and currently unsupported platform";
break; break;
default : default :
@ -120,46 +120,46 @@ QString UiGuiSystemInfo::getOperatingSystem() {
#else #else
//TODO: Detect Unix, Linux etc. distro as described on http://www.novell.com/coolsolutions/feature/11251.html //TODO: Detect Unix, Linux etc. distro as described on http://www.novell.com/coolsolutions/feature/11251.html
operatingSystemString = "Linux"; operatingSystemString = "Linux";
QProcess process; TQProcess process;
process.start("uname -s"); process.start("uname -s");
bool result = process.waitForFinished(1000); bool result = process.waitForFinished(1000);
QString os = process.readAllStandardOutput().trimmed(); TQString os = process.readAllStandardOutput().trimmed();
process.start("uname -r"); process.start("uname -r");
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
QString rev = process.readAllStandardOutput().trimmed(); TQString rev = process.readAllStandardOutput().trimmed();
process.start("uname -m"); process.start("uname -m");
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
QString mach = process.readAllStandardOutput().trimmed(); TQString mach = process.readAllStandardOutput().trimmed();
if ( os == "SunOS" ) { if ( os == "SunOS" ) {
os = "Solaris"; os = "Solaris";
process.start("uname -p"); process.start("uname -p");
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
QString arch = process.readAllStandardOutput().trimmed(); TQString arch = process.readAllStandardOutput().trimmed();
process.start("uname -v"); process.start("uname -v");
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
QString timestamp = process.readAllStandardOutput().trimmed(); TQString timestamp = process.readAllStandardOutput().trimmed();
operatingSystemString = os + " " + rev + " (" + arch + " " + timestamp + ")"; operatingSystemString = os + " " + rev + " (" + arch + " " + timestamp + ")";
} }
else if ( os == "AIX" ) { else if ( os == "AIX" ) {
process.start("oslevel -r"); process.start("oslevel -r");
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
QString oslevel = process.readAllStandardOutput().trimmed(); TQString oslevel = process.readAllStandardOutput().trimmed();
operatingSystemString = os + "oslevel " + oslevel; operatingSystemString = os + "oslevel " + oslevel;
} }
else if ( os == "Linux" ) { else if ( os == "Linux" ) {
QString dist; TQString dist;
QString pseudoname; TQString pseudoname;
QString kernel = rev; TQString kernel = rev;
if ( QFile::exists("/etc/redhat-release") ) { if ( TQFile::exists("/etc/redhat-release") ) {
dist = "RedHat"; dist = "RedHat";
process.start("sh -c \"cat /etc/redhat-release | sed s/.*\\(// | sed s/\\)//\""); process.start("sh -c \"cat /etc/redhat-release | sed s/.*\\(// | sed s/\\)//\"");
@ -170,7 +170,7 @@ QString UiGuiSystemInfo::getOperatingSystem() {
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
rev = process.readAllStandardOutput().trimmed(); rev = process.readAllStandardOutput().trimmed();
} }
else if ( QFile::exists("/etc/SUSE-release") ) { else if ( TQFile::exists("/etc/SUSE-release") ) {
process.start("sh -c \"cat /etc/SUSE-release | tr '\\n' ' '| sed s/VERSION.*//\""); process.start("sh -c \"cat /etc/SUSE-release | tr '\\n' ' '| sed s/VERSION.*//\"");
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
dist = process.readAllStandardOutput().trimmed(); dist = process.readAllStandardOutput().trimmed();
@ -179,7 +179,7 @@ QString UiGuiSystemInfo::getOperatingSystem() {
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
rev = process.readAllStandardOutput().trimmed(); rev = process.readAllStandardOutput().trimmed();
} }
else if ( QFile::exists("/etc/mandrake-release") ) { else if ( TQFile::exists("/etc/mandrake-release") ) {
dist = "Mandrake"; dist = "Mandrake";
process.start("sh -c \"cat /etc/mandrake-release | sed s/.*\\(// | sed s/\\)//\""); process.start("sh -c \"cat /etc/mandrake-release | sed s/.*\\(// | sed s/\\)//\"");
@ -190,20 +190,20 @@ QString UiGuiSystemInfo::getOperatingSystem() {
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
rev = process.readAllStandardOutput().trimmed(); rev = process.readAllStandardOutput().trimmed();
} }
else if ( QFile::exists("/etc/lsb-release") ) { else if ( TQFile::exists("/etc/lsb-release") ) {
dist = "Ubuntu"; dist = "Ubuntu";
QString processCall = "sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_RELEASE=// | sed s/\\ .*//\""; TQString processCall = "sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_RELEASE=// | sed s/\\ .*//\"";
process.start( processCall ); process.start( processCall );
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
rev = process.readAllStandardOutput().trimmed(); rev = process.readAllStandardOutput().trimmed();
QString errorStr = process.readAllStandardError(); TQString errorStr = process.readAllStandardError();
process.start("sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_CODENAME=// | sed s/\\ .*//\""); process.start("sh -c \"cat /etc/lsb-release | tr '\\n' ' ' | sed s/.*DISTRIB_CODENAME=// | sed s/\\ .*//\"");
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
pseudoname = process.readAllStandardOutput().trimmed(); pseudoname = process.readAllStandardOutput().trimmed();
} }
else if ( QFile::exists("/etc/debian_version") ) { else if ( TQFile::exists("/etc/debian_version") ) {
dist = "Debian"; dist = "Debian";
process.start("cat /etc/debian_version"); process.start("cat /etc/debian_version");
@ -213,7 +213,7 @@ QString UiGuiSystemInfo::getOperatingSystem() {
rev = ""; rev = "";
} }
if ( QFile::exists("/etc/UnitedLinux-release") ) { if ( TQFile::exists("/etc/UnitedLinux-release") ) {
process.start("sh -c \"cat /etc/UnitedLinux-release | tr '\\n' ' ' | sed s/VERSION.*//\""); process.start("sh -c \"cat /etc/UnitedLinux-release | tr '\\n' ' ' | sed s/VERSION.*//\"");
result = process.waitForFinished(1000); result = process.waitForFinished(1000);
dist += process.readAllStandardOutput().trimmed(); dist += process.readAllStandardOutput().trimmed();

@ -20,13 +20,13 @@
#ifndef UIGUISYSTEMINFO_H #ifndef UIGUISYSTEMINFO_H
#define UIGUISYSTEMINFO_H #define UIGUISYSTEMINFO_H
class QString; class TQString;
class UiGuiSystemInfo class UiGuiSystemInfo
{ {
public: public:
static QString getOperatingSystem(); static TQString getOperatingSystem();
private: private:
UiGuiSystemInfo(); UiGuiSystemInfo();

@ -19,8 +19,8 @@
#include "UiGuiVersion.h" #include "UiGuiVersion.h"
#include <tqstring.h> #include <tntqstring.h>
#include <tqstringlist.h> #include <tntqstringlist.h>
#include <tqdate.h> #include <tqdate.h>
namespace UiGuiVersion { namespace UiGuiVersion {
@ -28,15 +28,15 @@ namespace UiGuiVersion {
\brief Returns the build date as a localized string, e.g. "9. Februar 2009". If \brief Returns the build date as a localized string, e.g. "9. Februar 2009". If
there was some kind of error, the returned string is empty. there was some kind of error, the returned string is empty.
*/ */
QString getBuildDate() { TQString getBuildDate() {
QStringList monthNames; TQStringList monthNames;
QString buildDateString = ""; TQString buildDateString = "";
monthNames << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dez"; monthNames << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dez";
QStringList buildDateStringList = QString(__DATE__).simplified().split(' '); // __DATE__ returns eg "Feb 4 2009" TQStringList buildDateStringList = TQString(__DATE__).simplified().split(' '); // __DATE__ returns eg "Feb 4 2009"
if ( buildDateStringList.count() == 3 ) { if ( buildDateStringList.count() == 3 ) {
QDate buildDate(buildDateStringList.last().toInt(), monthNames.indexOf( buildDateStringList.first() )+1, buildDateStringList.at(1).toInt()); TQDate buildDate(buildDateStringList.last().toInt(), monthNames.indexOf( buildDateStringList.first() )+1, buildDateStringList.at(1).toInt());
buildDateString = buildDate.toString("d. MMMM yyyy"); buildDateString = buildDate.toString("d. MMMM yyyy");
} }
@ -48,9 +48,9 @@ QString getBuildDate() {
\brief Returns the revision number, that the current build is based on, as string. If \brief Returns the revision number, that the current build is based on, as string. If
there was some kind of error, the returned string is empty. there was some kind of error, the returned string is empty.
*/ */
QString getBuildRevision() { TQString getBuildRevision() {
QString buildRevision = ""; TQString buildRevision = "";
QStringList buildRevisionStringList = QString(PROGRAM_REVISION).simplified().split(' '); TQStringList buildRevisionStringList = TQString(PROGRAM_REVISION).simplified().split(' ');
if ( buildRevisionStringList.count() == 3 ) { if ( buildRevisionStringList.count() == 3 ) {
buildRevision = buildRevisionStringList.at(1); // PROGRAM_REVISION is eg "$Revision: 907 $" buildRevision = buildRevisionStringList.at(1); // PROGRAM_REVISION is eg "$Revision: 907 $"

@ -20,7 +20,7 @@
#ifndef UIGUIVERSION_H #ifndef UIGUIVERSION_H
#define UIGUIVERSION_H #define UIGUIVERSION_H
class QString; class TQString;
// Define the version number here. Update this as the last file before a release. // Define the version number here. Update this as the last file before a release.
#define PROGRAM_VERSION 1.2.0 #define PROGRAM_VERSION 1.2.0
@ -31,8 +31,8 @@ class QString;
namespace UiGuiVersion { namespace UiGuiVersion {
QString getBuildDate(); TQString getBuildDate();
QString getBuildRevision(); TQString getBuildRevision();
} }

@ -23,12 +23,12 @@
#include "UiGuiSettings.h" #include "UiGuiSettings.h"
#include "UiGuiVersion.h" #include "UiGuiVersion.h"
#include <tqmessagebox.h> #include <tntqmessagebox.h>
#include <tqdesktopservices.h> #include <tqdesktopservices.h>
#include <tqnetworkaccessmanager.h> #include <tqnetworkaccessmanager.h>
#include <tqtimer.h> #include <tntqtimer.h>
#include <tqdate.h> #include <tqdate.h>
#include <tqurl.h> #include <tntqurl.h>
#include <tqregexpvalidator.h> #include <tqregexpvalidator.h>
#include <tqnetworkrequest.h> #include <tqnetworkrequest.h>
#include <tqnetworkreply.h> #include <tqnetworkreply.h>
@ -44,26 +44,26 @@
/*! /*!
\brief Initializes member variables and stores the version of UiGui and a pointer to the _settings object. \brief Initializes member variables and stores the version of UiGui and a pointer to the _settings object.
*/ */
UpdateCheckDialog::UpdateCheckDialog(QSharedPointer<UiGuiSettings> settings, QWidget *parent) : QDialog(parent), UpdateCheckDialog::UpdateCheckDialog(TQSharedPointer<UiGuiSettings> settings, TQWidget *parent) : TQDialog(parent),
_manualUpdateRequested(false), _manualUpdateRequested(false),
_currentNetworkReply(NULL), _currentNetworkReply(NULL),
_roleOfClickedButton(QDialogButtonBox::InvalidRole) _roleOfClickedButton(TQDialogButtonBox::InvalidRole)
{ {
_updateCheckDialogForm = new Ui::UpdateCheckDialog(); _updateCheckDialogForm = new Ui::UpdateCheckDialog();
_updateCheckDialogForm->setupUi(this); _updateCheckDialogForm->setupUi(this);
// Create object for _networkAccessManager request and connect it with the request return handler. // Create object for _networkAccessManager request and connect it with the request return handler.
_networkAccessManager = new QNetworkAccessManager(this); _networkAccessManager = new TQNetworkAccessManager(this);
connect( _networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(checkResultsOfFetchedPadXMLFile(QNetworkReply*)) ); connect( _networkAccessManager, SIGNAL(finished(TQNetworkReply*)), this, SLOT(checkResultsOfFetchedPadXMLFile(TQNetworkReply*)) );
// Create a timer object used for the progress bar. // Create a timer object used for the progress bar.
_updateCheckProgressTimer = new QTimer(this); _updateCheckProgressTimer = new TQTimer(this);
_updateCheckProgressTimer->setInterval(5); _updateCheckProgressTimer->setInterval(5);
connect( _updateCheckProgressTimer, SIGNAL(timeout()), this, SLOT(updateUpdateCheckProgressBar()) ); connect( _updateCheckProgressTimer, SIGNAL(timeout()), this, SLOT(updateUpdateCheckProgressBar()) );
_updateCheckProgressCounter = 0; _updateCheckProgressCounter = 0;
// Connect the dialogs buttonbox with a button click handler. // Connect the dialogs buttonbox with a button click handler.
connect( _updateCheckDialogForm->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(handleUpdateCheckDialogButtonClicked(QAbstractButton*)) ); connect( _updateCheckDialogForm->buttonBox, SIGNAL(clicked(TQAbstractButton*)), this, SLOT(handleUpdateCheckDialogButtonClicked(TQAbstractButton*)) );
settings->registerObjectSlot(this, "initProxySettings()", "ProxyEnabled"); settings->registerObjectSlot(this, "initProxySettings()", "ProxyEnabled");
settings->registerObjectSlot(this, "initProxySettings()", "ProxyHostName"); settings->registerObjectSlot(this, "initProxySettings()", "ProxyHostName");
@ -84,7 +84,7 @@ UpdateCheckDialog::UpdateCheckDialog(QSharedPointer<UiGuiSettings> settings, QWi
\brief On destroy cancels any currently running network request. \brief On destroy cancels any currently running network request.
*/ */
UpdateCheckDialog::~UpdateCheckDialog() { UpdateCheckDialog::~UpdateCheckDialog() {
disconnect( _networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(checkResultsOfFetchedPadXMLFile(QNetworkReply*)) ); disconnect( _networkAccessManager, SIGNAL(finished(TQNetworkReply*)), this, SLOT(checkResultsOfFetchedPadXMLFile(TQNetworkReply*)) );
if (_currentNetworkReply != NULL) if (_currentNetworkReply != NULL)
_currentNetworkReply->abort(); _currentNetworkReply->abort();
} }
@ -121,7 +121,7 @@ void UpdateCheckDialog::checkForUpdate() {
void UpdateCheckDialog::getPadXMLFile() { void UpdateCheckDialog::getPadXMLFile() {
//_networkAccessManager->setHost("universalindent.sourceforge.net"); //_networkAccessManager->setHost("universalindent.sourceforge.net");
//_networkAccessManager->get("/universalindentgui_pad.xml"); //_networkAccessManager->get("/universalindentgui_pad.xml");
_currentNetworkReply = _networkAccessManager->get(QNetworkRequest(QUrl("http://universalindent.sourceforge.net/universalindentgui_pad.xml"))); _currentNetworkReply = _networkAccessManager->get(TQNetworkRequest(TQUrl("http://universalindent.sourceforge.net/universalindentgui_pad.xml")));
} }
@ -133,15 +133,15 @@ void UpdateCheckDialog::getPadXMLFile() {
download page if a newer version exists. In case of an error during update download page if a newer version exists. In case of an error during update
check, a message box with the error will be displayed. check, a message box with the error will be displayed.
*/ */
void UpdateCheckDialog::checkResultsOfFetchedPadXMLFile(QNetworkReply *networkReply) { void UpdateCheckDialog::checkResultsOfFetchedPadXMLFile(TQNetworkReply *networkReply) {
Q_ASSERT(_currentNetworkReply == networkReply); Q_ASSERT(_currentNetworkReply == networkReply);
// Stop the progress bar timer. // Stop the progress bar timer.
_updateCheckProgressTimer->stop(); _updateCheckProgressTimer->stop();
if ( networkReply->error() == QNetworkReply::NoError ) { if ( networkReply->error() == TQNetworkReply::NoError ) {
// Try to find the version string. // Try to find the version string.
QString returnedString = networkReply->readAll(); TQString returnedString = networkReply->readAll();
int leftPosition = returnedString.indexOf("<Program_Version>"); int leftPosition = returnedString.indexOf("<Program_Version>");
int rightPosition = returnedString.indexOf("</Program_Version>"); int rightPosition = returnedString.indexOf("</Program_Version>");
@ -160,24 +160,24 @@ void UpdateCheckDialog::checkResultsOfFetchedPadXMLFile(QNetworkReply *networkRe
showNewVersionAvailableDialog(returnedString); showNewVersionAvailableDialog(returnedString);
// If yes clicked, open the download url in the default browser. // If yes clicked, open the download url in the default browser.
if ( _roleOfClickedButton == QDialogButtonBox::YesRole ) { if ( _roleOfClickedButton == TQDialogButtonBox::YesRole ) {
QDesktopServices::openUrl( QUrl("_networkAccessManager://sourceforge.net/project/showfiles.php?group_id=167482") ); TQDesktopServices::openUrl( TQUrl("_networkAccessManager://sourceforge.net/project/showfiles.php?group_id=167482") );
} }
} }
else if ( _manualUpdateRequested ) { else if ( _manualUpdateRequested ) {
showNoNewVersionAvailableDialog(); showNoNewVersionAvailableDialog();
} }
// Set last update check date. // Set last update check date.
_settings->setValueByName("LastUpdateCheck", QDate::currentDate()); _settings->setValueByName("LastUpdateCheck", TQDate::currentDate());
} }
// In the returned string, the version string could not be found. // In the returned string, the version string could not be found.
else { else {
QMessageBox::warning(this, tr("Update check error"), tr("There was an error while trying to check for an update! The retrieved file did not contain expected content.") ); TQMessageBox::warning(this, tr("Update check error"), tr("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. // If there was some error while trying to retrieve the update info from server and not cancel was pressed.
else if ( _roleOfClickedButton != QDialogButtonBox::RejectRole ) { else if ( _roleOfClickedButton != TQDialogButtonBox::RejectRole ) {
QMessageBox::warning(this, tr("Update check error"), tr("There was an error while trying to check for an update! Error was : %1").arg(networkReply->errorString()) ); TQMessageBox::warning(this, tr("Update check error"), tr("There was an error while trying to check for an update! Error was : %1").arg(networkReply->errorString()) );
hide(); hide();
} }
_manualUpdateRequested = false; _manualUpdateRequested = false;
@ -203,7 +203,7 @@ void UpdateCheckDialog::showCheckingForUpdateDialog() {
_updateCheckDialogForm->progressBar->show(); _updateCheckDialogForm->progressBar->show();
setWindowTitle( tr("Checking for update...") ); setWindowTitle( tr("Checking for update...") );
_updateCheckDialogForm->label->setText( tr("Checking whether a newer version is available") ); _updateCheckDialogForm->label->setText( tr("Checking whether a newer version is available") );
_updateCheckDialogForm->buttonBox->setStandardButtons(QDialogButtonBox::Cancel); _updateCheckDialogForm->buttonBox->setStandardButtons(TQDialogButtonBox::Cancel);
show(); show();
} }
@ -211,11 +211,11 @@ void UpdateCheckDialog::showCheckingForUpdateDialog() {
/*! /*!
\brief Displays the dialog with info about the new available version. \brief Displays the dialog with info about the new available version.
*/ */
void UpdateCheckDialog::showNewVersionAvailableDialog(QString newVersion) { void UpdateCheckDialog::showNewVersionAvailableDialog(TQString newVersion) {
_updateCheckDialogForm->progressBar->hide(); _updateCheckDialogForm->progressBar->hide();
setWindowTitle( tr("Update available") ); setWindowTitle( tr("Update available") );
_updateCheckDialogForm->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(PROGRAM_VERSION_STRING).arg(newVersion) ); _updateCheckDialogForm->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(PROGRAM_VERSION_STRING).arg(newVersion) );
_updateCheckDialogForm->buttonBox->setStandardButtons(QDialogButtonBox::No|QDialogButtonBox::NoButton|QDialogButtonBox::Yes); _updateCheckDialogForm->buttonBox->setStandardButtons(TQDialogButtonBox::No|TQDialogButtonBox::NoButton|TQDialogButtonBox::Yes);
exec(); exec();
} }
@ -227,7 +227,7 @@ void UpdateCheckDialog::showNoNewVersionAvailableDialog() {
_updateCheckDialogForm->progressBar->hide(); _updateCheckDialogForm->progressBar->hide();
setWindowTitle( tr("No new update available") ); setWindowTitle( tr("No new update available") );
_updateCheckDialogForm->label->setText( tr("You already have the latest version of UniversalIndentGUI.") ); _updateCheckDialogForm->label->setText( tr("You already have the latest version of UniversalIndentGUI.") );
_updateCheckDialogForm->buttonBox->setStandardButtons(QDialogButtonBox::Ok); _updateCheckDialogForm->buttonBox->setStandardButtons(TQDialogButtonBox::Ok);
exec(); exec();
} }
@ -241,10 +241,10 @@ void UpdateCheckDialog::showNoNewVersionAvailableDialog() {
In any case if a button is clicked, the dialog box will be closed. In any case if a button is clicked, the dialog box will be closed.
*/ */
void UpdateCheckDialog::handleUpdateCheckDialogButtonClicked(QAbstractButton *clickedButton) { void UpdateCheckDialog::handleUpdateCheckDialogButtonClicked(TQAbstractButton *clickedButton) {
_roleOfClickedButton = _updateCheckDialogForm->buttonBox->buttonRole(clickedButton); _roleOfClickedButton = _updateCheckDialogForm->buttonBox->buttonRole(clickedButton);
if ( _roleOfClickedButton == QDialogButtonBox::RejectRole ) { if ( _roleOfClickedButton == TQDialogButtonBox::RejectRole ) {
// Abort the _networkAccessManager request. // Abort the _networkAccessManager request.
_currentNetworkReply->abort(); _currentNetworkReply->abort();
// Stop the progress bar timer. // Stop the progress bar timer.
@ -287,15 +287,15 @@ void UpdateCheckDialog::updateUpdateCheckProgressBar() {
Thus for example 12.5.170 will result in 12005170. Thus for example 12.5.170 will result in 12005170.
*/ */
int UpdateCheckDialog::convertVersionStringToNumber(QString versionString) { int UpdateCheckDialog::convertVersionStringToNumber(TQString versionString) {
int versionInteger = 0; int versionInteger = 0;
int pos = 0; int pos = 0;
QRegExp regEx("\\d{1,3}.\\d{1,3}.\\d{1,3}"); TQRegExp regEx("\\d{1,3}.\\d{1,3}.\\d{1,3}");
QRegExpValidator validator(regEx, NULL); TQRegExpValidator validator(regEx, NULL);
if ( validator.validate(versionString, pos) == QValidator::Acceptable ) { if ( validator.validate(versionString, pos) == TQValidator::Acceptable ) {
QStringList versionNumberStringList = versionString.split("."); TQStringList versionNumberStringList = versionString.split(".");
versionInteger = versionNumberStringList.at(0).toInt() * 1000000; versionInteger = versionNumberStringList.at(0).toInt() * 1000000;
versionInteger += versionNumberStringList.at(1).toInt() * 1000; versionInteger += versionNumberStringList.at(1).toInt() * 1000;
versionInteger += versionNumberStringList.at(2).toInt(); versionInteger += versionNumberStringList.at(2).toInt();
@ -310,13 +310,13 @@ int UpdateCheckDialog::convertVersionStringToNumber(QString versionString) {
void UpdateCheckDialog::initProxySettings() void UpdateCheckDialog::initProxySettings()
{ {
if ( _settings->getValueByName("ProxyEnabled") == true ) { if ( _settings->getValueByName("ProxyEnabled") == true ) {
QString proxyHostName = _settings->getValueByName("ProxyHostName").toString(); TQString proxyHostName = _settings->getValueByName("ProxyHostName").toString();
int proxyPort = _settings->getValueByName("ProxyPort").toInt(); int proxyPort = _settings->getValueByName("ProxyPort").toInt();
QString proxyUserName = _settings->getValueByName("ProxyUserName").toString(); TQString proxyUserName = _settings->getValueByName("ProxyUserName").toString();
QString proxyPassword = _settings->getValueByName("ProxyPassword").toString(); TQString proxyPassword = _settings->getValueByName("ProxyPassword").toString();
_networkAccessManager->setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, proxyHostName, proxyPort, proxyUserName, proxyPassword)); _networkAccessManager->setProxy(TQNetworkProxy(TQNetworkProxy::Socks5Proxy, proxyHostName, proxyPort, proxyUserName, proxyPassword));
} }
else { else {
_networkAccessManager->setProxy(QNetworkProxy()); _networkAccessManager->setProxy(TQNetworkProxy());
} }
} }

@ -20,7 +20,7 @@
#ifndef UPDATECHECKDIALOG_H #ifndef UPDATECHECKDIALOG_H
#define UPDATECHECKDIALOG_H #define UPDATECHECKDIALOG_H
#include <tqdialog.h> #include <tntqdialog.h>
#include <tqdialogbuttonbox.h> #include <tqdialogbuttonbox.h>
class UiGuiSettings; class UiGuiSettings;
@ -28,18 +28,18 @@ namespace Ui {
class UpdateCheckDialog; class UpdateCheckDialog;
} }
class QTimer; class TQTimer;
class QDesktopServices; class TQDesktopServices;
class QNetworkAccessManager; class TQNetworkAccessManager;
class QNetworkReply; class TQNetworkReply;
class UpdateCheckDialog : public QDialog class UpdateCheckDialog : public TQDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
UpdateCheckDialog(QSharedPointer<UiGuiSettings> settings, QWidget *parent = NULL); UpdateCheckDialog(TQSharedPointer<UiGuiSettings> settings, TQWidget *parent = NULL);
~UpdateCheckDialog(); ~UpdateCheckDialog();
public slots: public slots:
@ -47,8 +47,8 @@ public slots:
void checkForUpdate(); void checkForUpdate();
private slots: private slots:
void checkResultsOfFetchedPadXMLFile(QNetworkReply *networkReply); void checkResultsOfFetchedPadXMLFile(TQNetworkReply *networkReply);
void handleUpdateCheckDialogButtonClicked(QAbstractButton *clickedButton); void handleUpdateCheckDialogButtonClicked(TQAbstractButton *clickedButton);
void updateUpdateCheckProgressBar(); void updateUpdateCheckProgressBar();
void initProxySettings(); void initProxySettings();
@ -57,16 +57,16 @@ private:
void getPadXMLFile(); void getPadXMLFile();
void showCheckingForUpdateDialog(); void showCheckingForUpdateDialog();
void showNewVersionAvailableDialog(QString newVersion); void showNewVersionAvailableDialog(TQString newVersion);
void showNoNewVersionAvailableDialog(); void showNoNewVersionAvailableDialog();
int convertVersionStringToNumber(QString versionString); int convertVersionStringToNumber(TQString versionString);
QSharedPointer<UiGuiSettings> _settings; TQSharedPointer<UiGuiSettings> _settings;
bool _manualUpdateRequested; bool _manualUpdateRequested;
QNetworkAccessManager *_networkAccessManager; TQNetworkAccessManager *_networkAccessManager;
QNetworkReply *_currentNetworkReply; TQNetworkReply *_currentNetworkReply;
QDialogButtonBox::ButtonRole _roleOfClickedButton; TQDialogButtonBox::ButtonRole _roleOfClickedButton;
QTimer *_updateCheckProgressTimer; TQTimer *_updateCheckProgressTimer;
int _updateCheckProgressCounter; int _updateCheckProgressCounter;
}; };

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>UpdateCheckDialog</class> <class>UpdateCheckDialog</class>
<widget class="QDialog" name="UpdateCheckDialog"> <widget class="TQDialog" name="UpdateCheckDialog">
<property name="windowModality"> <property name="windowModality">
<enum>Qt::WindowModal</enum> <enum>TQt::WindowModal</enum>
</property> </property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -16,16 +16,16 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Checking for update...</string> <string>Checking for update...</string>
</property> </property>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="TQLabel" name="label">
<property name="text"> <property name="text">
<string>Checking whether a newer version is available</string> <string>Checking whether a newer version is available</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QProgressBar" name="progressBar"> <widget class="TQProgressBar" name="progressBar">
<property name="value"> <property name="value">
<number>0</number> <number>0</number>
</property> </property>
@ -35,9 +35,9 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="TQDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Cancel</set> <set>TQDialogButtonBox::Cancel</set>
</property> </property>
<property name="centerButtons"> <property name="centerButtons">
<bool>true</bool> <bool>true</bool>

@ -22,13 +22,13 @@
#include "SettingsPaths.h" #include "SettingsPaths.h"
#include <tqdatetime.h> #include <tntqdatetime.h>
#include <tqfile.h> #include <tntqfile.h>
#include <tqfileinfo.h> #include <tntqfileinfo.h>
#include <tqurl.h> #include <tntqurl.h>
#include <tqtextstream.h> #include <tntqtextstream.h>
#include <tqdesktopservices.h> #include <tqdesktopservices.h>
#include <tqmessagebox.h> #include <tntqmessagebox.h>
#include <ctime> #include <ctime>
@ -65,9 +65,9 @@ TSLogger* TSLogger::getInstance(int verboseLevel) {
*/ */
TSLogger* TSLogger::getInstance() { TSLogger* TSLogger::getInstance() {
#ifdef _DEBUG #ifdef _DEBUG
return TSLogger::getInstance(QtDebugMsg); return TSLogger::getInstance(TQtDebugMsg);
#else #else
return TSLogger::getInstance(QtWarningMsg); return TSLogger::getInstance(TQtWarningMsg);
#endif #endif
} }
@ -76,13 +76,13 @@ TSLogger* TSLogger::getInstance() {
\brief Initializes the dialog and sets the path to the log file in the systems temporary directory. \brief Initializes the dialog and sets the path to the log file in the systems temporary directory.
Sets the default verbose level to warning level. Sets the default verbose level to warning level.
*/ */
TSLogger::TSLogger(int verboseLevel) : QDialog() { TSLogger::TSLogger(int verboseLevel) : TQDialog() {
_TSLoggerDialogForm = new Ui::TSLoggerDialog(); _TSLoggerDialogForm = new Ui::TSLoggerDialog();
_TSLoggerDialogForm->setupUi(this); _TSLoggerDialogForm->setupUi(this);
#ifdef _DEBUG #ifdef _DEBUG
_verboseLevel = QtDebugMsg; _verboseLevel = TQtDebugMsg;
#else #else
_verboseLevel = QtMsgType(verboseLevel); _verboseLevel = TQtMsgType(verboseLevel);
#endif #endif
_logFileInitState = NOTINITIALZED; _logFileInitState = NOTINITIALZED;
@ -90,7 +90,7 @@ TSLogger::TSLogger(int verboseLevel) : QDialog() {
connect( _TSLoggerDialogForm->openLogFileFolderToolButton, SIGNAL(clicked()), this, SLOT(openLogFileFolder()) ); connect( _TSLoggerDialogForm->openLogFileFolderToolButton, SIGNAL(clicked()), this, SLOT(openLogFileFolder()) );
// Make the main application not to wait for the logging window to close. // Make the main application not to wait for the logging window to close.
setAttribute(Qt::WA_QuitOnClose, false); setAttribute(TQt::WA_QuitOnClose, false);
} }
@ -99,15 +99,15 @@ TSLogger::TSLogger(int verboseLevel) : QDialog() {
Only messages whos \a type have a higher priority than the set verbose level are logged. Only messages whos \a type have a higher priority than the set verbose level are logged.
*/ */
void TSLogger::messageHandler(QtMsgType type, const char *msg) { void TSLogger::messageHandler(TQtMsgType type, const char *msg) {
if ( _instance == NULL ) if ( _instance == NULL )
_instance = TSLogger::getInstance(); _instance = TSLogger::getInstance();
/* /*
QMessageBox messageBox; TQMessageBox messageBox;
QString messageBoxText = QString::fromUtf8( msg ); TQString messageBoxText = TQString::fromUtf8( msg );
messageBox.setText( messageBoxText ); messageBox.setText( messageBoxText );
messageBox.setWindowModality( Qt::ApplicationModal ); messageBox.setWindowModality( TQt::ApplicationModal );
messageBox.exec(); messageBox.exec();
*/ */
@ -116,22 +116,22 @@ void TSLogger::messageHandler(QtMsgType type, const char *msg) {
return; return;
// Init log message with prepended date and time. // Init log message with prepended date and time.
QString message = QDateTime::currentDateTime().toString(); TQString message = TQDateTime::currentDateTime().toString();
// Depending on the QtMsgType prepend a different colored Debug, Warning, Critical or Fatal. // Depending on the TQtMsgType prepend a different colored Debug, Warning, Critical or Fatal.
switch (type) { switch (type) {
case QtDebugMsg : case TQtDebugMsg :
message += " <span style=\"font-weight:bold; color:black;\">Debug:</span> "; message += " <span style=\"font-weight:bold; color:black;\">Debug:</span> ";
break; break;
case QtWarningMsg : case TQtWarningMsg :
message += " <span style=\"font-weight:bold; color:gold;\">Warning:</span> "; message += " <span style=\"font-weight:bold; color:gold;\">Warning:</span> ";
break; break;
case QtCriticalMsg : case TQtCriticalMsg :
message += "<span style=\"font-weight:bold; color:red;\">Critical:</span> "; message += "<span style=\"font-weight:bold; color:red;\">Critical:</span> ";
break; break;
case QtFatalMsg : case TQtFatalMsg :
message += " <span style=\"font-weight:bold; color:#D60000;\">Fatal:</span> "; message += " <span style=\"font-weight:bold; color:#D60000;\">Fatal:</span> ";
// This one is no Qt message type, but can be used to send info messages to the log // This one is no TQt message type, but can be used to send info messages to the log
// by calling TSLogger::messageHandler() directly. // by calling TSLogger::messageHandler() directly.
case TSLoggerInfoMsg : case TSLoggerInfoMsg :
message += " <span style=\"font-weight:bold; color:darkgray;\">Info:</span> "; message += " <span style=\"font-weight:bold; color:darkgray;\">Info:</span> ";
@ -139,7 +139,7 @@ void TSLogger::messageHandler(QtMsgType type, const char *msg) {
} }
// Append the to UTF-8 back converted message parameter. // Append the to UTF-8 back converted message parameter.
message += QString::fromUtf8( msg ) + "<br/>\n"; message += TQString::fromUtf8( msg ) + "<br/>\n";
// Write the message to the log windows text edit. // Write the message to the log windows text edit.
_instance->_TSLoggerDialogForm->logTextEdit->append( message ); _instance->_TSLoggerDialogForm->logTextEdit->append( message );
@ -148,7 +148,7 @@ void TSLogger::messageHandler(QtMsgType type, const char *msg) {
_instance->writeToLogFile( message ); _instance->writeToLogFile( message );
// In case of a fatal error abort the application. // In case of a fatal error abort the application.
if ( type == QtFatalMsg ) if ( type == TQtFatalMsg )
abort(); abort();
} }
@ -159,11 +159,11 @@ void TSLogger::messageHandler(QtMsgType type, const char *msg) {
*/ */
void TSLogger::setVerboseLevel(int level) { void TSLogger::setVerboseLevel(int level) {
if ( level < 0 ) if ( level < 0 )
_verboseLevel = QtDebugMsg; _verboseLevel = TQtDebugMsg;
if ( level > 3 ) if ( level > 3 )
_verboseLevel = QtFatalMsg; _verboseLevel = TQtFatalMsg;
else else
_verboseLevel = QtMsgType(level); _verboseLevel = TQtMsgType(level);
} }
@ -182,29 +182,29 @@ void TSLogger::deleteInstance() {
\brief Opens the folder that contains the created log file with the name "UiGUI_log.html". \brief Opens the folder that contains the created log file with the name "UiGUI_log.html".
*/ */
void TSLogger::openLogFileFolder() { void TSLogger::openLogFileFolder() {
QDesktopServices::openUrl( QFileInfo( _logFile ).absolutePath() ); TQDesktopServices::openUrl( TQFileInfo( _logFile ).absolutePath() );
} }
/*! /*!
\brief Writes the \a message to the used log file. \brief Writes the \a message to the used log file.
*/ */
void TSLogger::writeToLogFile(const QString &message) { void TSLogger::writeToLogFile(const TQString &message) {
// If the file where all logging messages should go to isn't initilized yet, do that now. // If the file where all logging messages should go to isn't initilized yet, do that now.
if ( _logFileInitState == NOTINITIALZED ) { if ( _logFileInitState == NOTINITIALZED ) {
_logFileInitState = INITIALIZING; _logFileInitState = INITIALIZING;
// On different systems it may be that "QDir::tempPath()" ends with a "/" or not. So check this. // On different systems it may be that "TQDir::tempPath()" ends with a "/" or not. So check this.
// Remove any trailing slashes. // Remove any trailing slashes.
QString tempPath = QFileInfo( SettingsPaths::getTempPath() ).absolutePath(); TQString tempPath = TQFileInfo( SettingsPaths::getTempPath() ).absolutePath();
while ( tempPath.right(1) == "/" ) { while ( tempPath.right(1) == "/" ) {
tempPath.chop(1); tempPath.chop(1);
} }
// To make the temporary log file invulnerable against file symbolic link hacks // To make the temporary log file invulnerable against file symbolic link hacks
// append the current date and time up to milliseconds to its name and a random character. // append the current date and time up to milliseconds to its name and a random character.
QString logFileName = "UiGUI_log_" + QDateTime::currentDateTime().toString("yyyyMMdd"); TQString logFileName = "UiGUI_log_" + TQDateTime::currentDateTime().toString("yyyyMMdd");
logFileName += "-" + QDateTime::currentDateTime().toString("hhmmsszzz"); logFileName += "-" + TQDateTime::currentDateTime().toString("hhmmsszzz");
// By random decide whether to append a number or an upper or lower case character. // By random decide whether to append a number or an upper or lower case character.
qsrand( time(NULL) ); qsrand( time(NULL) );
unsigned char randomChar; unsigned char randomChar;
@ -222,7 +222,7 @@ void TSLogger::writeToLogFile(const QString &message) {
randomChar = qrand() % 26 + 'a'; randomChar = qrand() % 26 + 'a';
break; break;
} }
logFileName += "_" + QString(randomChar) + ".html"; logFileName += "_" + TQString(randomChar) + ".html";
_logFile.setFileName( tempPath + "/" + logFileName ); _logFile.setFileName( tempPath + "/" + logFileName );
@ -238,8 +238,8 @@ void TSLogger::writeToLogFile(const QString &message) {
// If the logging file is initialzed, write all messages contained in the message queue into the file. // If the logging file is initialzed, write all messages contained in the message queue into the file.
if ( _logFileInitState == INITIALZED ) { if ( _logFileInitState == INITIALZED ) {
// Write/append the log message to the log file. // Write/append the log message to the log file.
if ( _logFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append) ) { if ( _logFile.open(TQIODevice::WriteOnly | TQIODevice::Text | TQIODevice::Append) ) {
QTextStream out(&_logFile); TQTextStream out(&_logFile);
while ( !_messageQueue.isEmpty() ) { while ( !_messageQueue.isEmpty() ) {
out << _messageQueue.takeFirst() << "\n"; out << _messageQueue.takeFirst() << "\n";

@ -20,8 +20,8 @@
#ifndef TSLogger_H #ifndef TSLogger_H
#define TSLogger_H #define TSLogger_H
#include <tqdialog.h> #include <tntqdialog.h>
#include <tqfile.h> #include <tntqfile.h>
namespace Ui { namespace Ui {
class TSLoggerDialog; class TSLoggerDialog;
@ -29,16 +29,16 @@ namespace Ui {
namespace tschweitzer { namespace debugging { namespace tschweitzer { namespace debugging {
#define TSLoggerInfoMsg QtMsgType(4) #define TSLoggerInfoMsg TQtMsgType(4)
class TSLogger : public QDialog class TSLogger : public TQDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
static TSLogger* getInstance(int verboseLevel); static TSLogger* getInstance(int verboseLevel);
static TSLogger* getInstance(); static TSLogger* getInstance();
static void messageHandler(QtMsgType type, const char *msg); static void messageHandler(TQtMsgType type, const char *msg);
static void deleteInstance(); static void deleteInstance();
void setVerboseLevel(int level); void setVerboseLevel(int level);
@ -50,12 +50,12 @@ private:
enum LogFileInitState { NOTINITIALZED, INITIALIZING, INITIALZED } _logFileInitState; enum LogFileInitState { NOTINITIALZED, INITIALIZING, INITIALZED } _logFileInitState;
TSLogger(int verboseLevel); TSLogger(int verboseLevel);
void writeToLogFile(const QString &message); void writeToLogFile(const TQString &message);
static TSLogger* _instance; static TSLogger* _instance;
QtMsgType _verboseLevel; TQtMsgType _verboseLevel;
QFile _logFile; TQFile _logFile;
QStringList _messageQueue; TQStringList _messageQueue;
}; };
}} // namespace tschweitzer::debugging }} // namespace tschweitzer::debugging

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>TSLoggerDialog</class> <class>TSLoggerDialog</class>
<widget class="QDialog" name="TSLoggerDialog"> <widget class="TQDialog" name="TSLoggerDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -17,25 +17,25 @@
<iconset resource="../resources/Icons.qrc"> <iconset resource="../resources/Icons.qrc">
<normaloff>:/mainWindow/document-properties.png</normaloff>:/mainWindow/document-properties.png</iconset> <normaloff>:/mainWindow/document-properties.png</normaloff>:/mainWindow/document-properties.png</iconset>
</property> </property>
<layout class="QVBoxLayout"> <layout class="TQVBoxLayout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="TQLabel" name="label">
<property name="text"> <property name="text">
<string>Logged messages</string> <string>Logged messages</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextEdit" name="logTextEdit"> <widget class="TQTextEdit" name="logTextEdit">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="TQHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QToolButton" name="cleanUpToolButton"> <widget class="TQToolButton" name="cleanUpToolButton">
<property name="toolTip"> <property name="toolTip">
<string>Clear log</string> <string>Clear log</string>
</property> </property>
@ -49,7 +49,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="openLogFileFolderToolButton"> <widget class="TQToolButton" name="openLogFileFolderToolButton">
<property name="toolTip"> <property name="toolTip">
<string>Open folder containing log file.</string> <string>Open folder containing log file.</string>
</property> </property>
@ -65,7 +65,7 @@
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>TQt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -76,9 +76,9 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="TQDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Close</set> <set>TQDialogButtonBox::Close</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -108,7 +108,7 @@
</connection> </connection>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>clicked(QAbstractButton*)</signal> <signal>clicked(TQAbstractButton*)</signal>
<receiver>TSLoggerDialog</receiver> <receiver>TSLoggerDialog</receiver>
<slot>close()</slot> <slot>close()</slot>
<hints> <hints>

@ -28,8 +28,8 @@
#include "IndentHandler.h" #include "IndentHandler.h"
#include "SettingsPaths.h" #include "SettingsPaths.h"
#include <tqapplication.h> #include <tntqapplication.h>
#include <tqtextcodec.h> #include <tntqtextcodec.h>
#include <tqdebug.h> #include <tqdebug.h>
#include <string> #include <string>
@ -129,7 +129,7 @@ using namespace tschweitzer::debugging;
-v --verbose needs a following parameter defining the verbose level as a number from 0 to 3. -v --verbose needs a following parameter defining the verbose level as a number from 0 to 3.
*/ */
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
QString file2OpenOnStart = ""; TQString file2OpenOnStart = "";
int verboseLevel = 1; int verboseLevel = 1;
bool startAsPlugin = false; bool startAsPlugin = false;
bool startAsServer = false; bool startAsServer = false;
@ -143,7 +143,7 @@ int main(int argc, char *argv[]) {
// Filter out -psn_0_118813 and similar parameters. // Filter out -psn_0_118813 and similar parameters.
std::vector<char*> argList; std::vector<char*> argList;
for ( int i = 0; i < argc; i++ ) { for ( int i = 0; i < argc; i++ ) {
QString argString(argv[i]); TQString argString(argv[i]);
if ( argString.startsWith("-psn_") == false ) { if ( argString.startsWith("-psn_") == false ) {
argList.push_back(argv[i]); argList.push_back(argv[i]);
@ -219,15 +219,15 @@ int main(int argc, char *argv[]) {
return returnValue; return returnValue;
} }
QApplication app(argc, argv); TQApplication app(argc, argv);
UiGuiIndentServer server; UiGuiIndentServer server;
MainWindow *mainWindow = NULL; MainWindow *mainWindow = NULL;
IndentHandler *indentHandler = NULL; IndentHandler *indentHandler = NULL;
// Init and install the logger function. // Init and install the logger function.
// Setting UTF-8 as default 8-Bit encoding to ensure that qDebug does no false string conversion. // Setting UTF-8 as default 8-Bit encoding to ensure that tqDebug does no false string conversion.
QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF-8") ); TQTextCodec::setCodecForCStrings( TQTextCodec::codecForName("UTF-8") );
QTextCodec::setCodecForLocale( QTextCodec::codecForName("UTF-8") ); TQTextCodec::setCodecForLocale( TQTextCodec::codecForName("UTF-8") );
// Force creation of an TSLogger instance here, to avoid recursion with SettingsPaths init function. // Force creation of an TSLogger instance here, to avoid recursion with SettingsPaths init function.
#ifdef _DEBUG #ifdef _DEBUG
TSLogger::getInstance(0); TSLogger::getInstance(0);
@ -235,13 +235,13 @@ int main(int argc, char *argv[]) {
TSLogger::getInstance(verboseLevel); TSLogger::getInstance(verboseLevel);
#endif #endif
qInstallMsgHandler( TSLogger::messageHandler ); qInstallMsgHandler( TSLogger::messageHandler );
TSLogger::messageHandler( TSLoggerInfoMsg, QString("Starting UiGUI Version %1 %2").arg(PROGRAM_VERSION_STRING).arg(PROGRAM_REVISION).toAscii() ); TSLogger::messageHandler( TSLoggerInfoMsg, TQString("Starting UiGUI Version %1 %2").arg(PROGRAM_VERSION_STRING).arg(PROGRAM_REVISION).toAscii() );
TSLogger::messageHandler( TSLoggerInfoMsg, QString("Running on %1").arg(UiGuiSystemInfo::getOperatingSystem()).toAscii() ); TSLogger::messageHandler( TSLoggerInfoMsg, TQString("Running on %1").arg(UiGuiSystemInfo::getOperatingSystem()).toAscii() );
// Set default values for all by UniversalIndentGUI used settings objects. // Set default values for all by UniversalIndentGUI used settings objects.
QCoreApplication::setOrganizationName("UniversalIndentGUI"); TQCoreApplication::setOrganizationName("UniversalIndentGUI");
QCoreApplication::setOrganizationDomain("universalindent.sf.net"); TQCoreApplication::setOrganizationDomain("universalindent.sf.net");
QCoreApplication::setApplicationName("UniversalIndentGUI"); TQCoreApplication::setApplicationName("UniversalIndentGUI");
// Start normal with full gui and without server. // Start normal with full gui and without server.
if ( !startAsPlugin && !startAsServer ) { if ( !startAsPlugin && !startAsServer ) {

Loading…
Cancel
Save