diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 17:52:36 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-27 17:52:36 +0000 |
commit | ff419492931de3748936967da36948af7a04d7a0 (patch) | |
tree | 31a70be62d3bfb8e405d51e4b256a7210940ffe8 /KMFSysTray | |
parent | f1fd95abe28acef708caac65af44473461d7026c (diff) | |
download | kmyfirewall-ff419492931de3748936967da36948af7a04d7a0.tar.gz kmyfirewall-ff419492931de3748936967da36948af7a04d7a0.zip |
TQt4 convert kmyfirewall
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmyfirewall@1238525 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'KMFSysTray')
-rw-r--r-- | KMFSysTray/app.cpp | 14 | ||||
-rw-r--r-- | KMFSysTray/details.cpp | 20 | ||||
-rw-r--r-- | KMFSysTray/details.h | 5 | ||||
-rw-r--r-- | KMFSysTray/details_designer.ui | 86 | ||||
-rw-r--r-- | KMFSysTray/kmfiptwatcher.cpp | 154 | ||||
-rw-r--r-- | KMFSysTray/kmfiptwatcher.h | 17 | ||||
-rw-r--r-- | KMFSysTray/kmfsystray.cpp | 34 | ||||
-rw-r--r-- | KMFSysTray/kmfsystray.h | 17 | ||||
-rw-r--r-- | KMFSysTray/main.cpp | 2 | ||||
-rw-r--r-- | KMFSysTray/mainwidget.cpp | 24 | ||||
-rw-r--r-- | KMFSysTray/mainwidget.h | 7 | ||||
-rw-r--r-- | KMFSysTray/mainwidget_designer.ui | 10 |
12 files changed, 197 insertions, 193 deletions
diff --git a/KMFSysTray/app.cpp b/KMFSysTray/app.cpp index bacfda0..1e3d906 100644 --- a/KMFSysTray/app.cpp +++ b/KMFSysTray/app.cpp @@ -11,8 +11,8 @@ // #include "app.h" -// #include <qlcdnumber.h> -// #include <qlayout.h> +// #include <tqlcdnumber.h> +// #include <tqlayout.h> // // // KDE includes // #include <kglobal.h> @@ -42,13 +42,13 @@ MainApp::MainApp() : KApplication() { // KConfig *ksConfig = config(); // KMFIPTWatcher *watch = new KMFIPTWatcher( this, "KMFIPTWatcher" ); // MainWidget *mainWid = new MainWidget( 0 ); -// connect( watch, SIGNAL( sigUpdateActive( bool ) ), mainWid, SLOT( slotSetRunningStatus( bool ) ) ); -// connect( watch, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ), -// mainWid, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ) ); +// connect( watch, TQT_SIGNAL( sigUpdateActive( bool ) ), mainWid, TQT_SLOT( slotSetRunningtqStatus( bool ) ) ); +// connect( watch, TQT_SIGNAL( sigUpdateRuleCount( const TQString&, const TQString&, int ) ), +// mainWid, TQT_SIGNAL( sigUpdateRuleCount( const TQString&, const TQString&, int ) ) ); -// connect( mainWid, SIGNAL( sigQueryDetails( bool ) ), watch, SLOT( slotQueryDetails( bool ) ) ); +// connect( mainWid, TQT_SIGNAL( sigQueryDetails( bool ) ), watch, TQT_SLOT( slotQueryDetails( bool ) ) ); /* - QHBoxLayout *_layout = new QHBoxLayout(this); + TQHBoxLayout *_layout = new TQHBoxLayout(this); _layout->add(mainWid);*/ diff --git a/KMFSysTray/details.cpp b/KMFSysTray/details.cpp index 067d697..0dfa3bc 100644 --- a/KMFSysTray/details.cpp +++ b/KMFSysTray/details.cpp @@ -22,16 +22,16 @@ #include "details.h" // QT includes -#include <qlcdnumber.h> +#include <tqlcdnumber.h> // KDE includes #include <kdebug.h> #include <kpushbutton.h> -Details::Details( QWidget* parent, const char* name, WFlags fl ) - : DetailsDesigner( parent, name, fl ) { +Details::Details( TQWidget* tqparent, const char* name, WFlags fl ) + : DetailsDesigner( tqparent, name, fl ) { - QObject::connect( m_cmd_close, SIGNAL( clicked() ), this, SLOT ( close() ) ); + TQObject::connect( m_cmd_close, TQT_SIGNAL( clicked() ), this, TQT_SLOT ( close() ) ); } @@ -42,24 +42,24 @@ Details::~Details() {} void Details::close() { kdDebug() << "void Details::close()" << endl; emit closing(); - QWidget::close(); + TQWidget::close(); } void Details::show() { kdDebug() << "void Details::show()" << endl; emit showing(); - QWidget::show(); + TQWidget::show(); } void Details::hide() { kdDebug() << "void Details::hide()" << endl; emit closing(); - QWidget::hide(); + TQWidget::hide(); } -void Details::slotUpdateRuleCount( const QString& table, const QString& chain, int num ) { - kdDebug() << "slotUpdateRuleCount( const QString& " << table << ", const QString& " << chain << ", int " << num << " )" << endl; - QLCDNumber *lcd = 0; +void Details::slotUpdateRuleCount( const TQString& table, const TQString& chain, int num ) { + kdDebug() << "slotUpdateRuleCount( const TQString& " << table << ", const TQString& " << chain << ", int " << num << " )" << endl; + TQLCDNumber *lcd = 0; if ( table == "filter" ) { if ( chain == "INPUT" ) { lcd = m_lcd_numRulesIn_Filter_Input; diff --git a/KMFSysTray/details.h b/KMFSysTray/details.h index b468f09..453e37f 100644 --- a/KMFSysTray/details.h +++ b/KMFSysTray/details.h @@ -25,9 +25,10 @@ class Details : public DetailsDesigner { Q_OBJECT + TQ_OBJECT public: - Details( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + Details( TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~Details(); /*$PUBLIC_FUNCTIONS$*/ @@ -36,7 +37,7 @@ public slots: void close(); void show(); void hide(); - void slotUpdateRuleCount( const QString&, const QString&, int ); + void slotUpdateRuleCount( const TQString&, const TQString&, int ); protected: /*$PROTECTED_FUNCTIONS$*/ diff --git a/KMFSysTray/details_designer.ui b/KMFSysTray/details_designer.ui index 9a5b1f9..55bd3b8 100644 --- a/KMFSysTray/details_designer.ui +++ b/KMFSysTray/details_designer.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>DetailsDesigner</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>DetailsDesigner</cstring> </property> @@ -38,7 +38,7 @@ <string>&Help</string> </property> </widget> - <widget class="QWidgetStack" row="1" column="0" rowspan="1" colspan="3"> + <widget class="TQWidgetStack" row="1" column="0" rowspan="1" colspan="3"> <property name="name"> <cstring>widgetStack1</cstring> </property> @@ -50,7 +50,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>WStackPage</cstring> </property> @@ -61,7 +61,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>m_lbl_numRules_Filter_Input</cstring> </property> @@ -69,7 +69,7 @@ <string>INPUT:</string> </property> </widget> - <widget class="QLCDNumber" row="0" column="1"> + <widget class="TQLCDNumber" row="0" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Filter_Input</cstring> </property> @@ -82,7 +82,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>m_lbl_numRules_Filter_Output</cstring> </property> @@ -90,7 +90,7 @@ <string>OUTPUT:</string> </property> </widget> - <widget class="QLCDNumber" row="1" column="1"> + <widget class="TQLCDNumber" row="1" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Filter_Output</cstring> </property> @@ -103,7 +103,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>m_lbl_numRules_Filter_Forward</cstring> </property> @@ -111,7 +111,7 @@ <string>FORWARD:</string> </property> </widget> - <widget class="QLCDNumber" row="2" column="1"> + <widget class="TQLCDNumber" row="2" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Filter_Forward</cstring> </property> @@ -124,7 +124,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="2" column="2"> + <widget class="TQLabel" row="2" column="2"> <property name="name"> <cstring>m_lbl_numRulesInfilter_2_3_5_3</cstring> </property> @@ -132,7 +132,7 @@ <string>POLICY:</string> </property> </widget> - <widget class="QLabel" row="1" column="2"> + <widget class="TQLabel" row="1" column="2"> <property name="name"> <cstring>m_lbl_numRulesInfilter_2_3_5_2</cstring> </property> @@ -140,7 +140,7 @@ <string>POLICY:</string> </property> </widget> - <widget class="QLabel" row="1" column="3"> + <widget class="TQLabel" row="1" column="3"> <property name="name"> <cstring>m_lbl_policy_filter_output</cstring> </property> @@ -148,7 +148,7 @@ <string><Policy></string> </property> </widget> - <widget class="QLabel" row="2" column="3"> + <widget class="TQLabel" row="2" column="3"> <property name="name"> <cstring>m_lbl_policy_filter_forward</cstring> </property> @@ -156,7 +156,7 @@ <string><Policy></string> </property> </widget> - <widget class="QLabel" row="0" column="2"> + <widget class="TQLabel" row="0" column="2"> <property name="name"> <cstring>m_lbl_numRulesInfilter_2_3_5</cstring> </property> @@ -164,7 +164,7 @@ <string>POLICY:</string> </property> </widget> - <widget class="QLabel" row="0" column="3"> + <widget class="TQLabel" row="0" column="3"> <property name="name"> <cstring>m_lbl_policy_filter_input</cstring> </property> @@ -174,7 +174,7 @@ </widget> </grid> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>WStackPage</cstring> </property> @@ -185,7 +185,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>m_lbl_numRulesInfilter_2</cstring> </property> @@ -193,7 +193,7 @@ <string>OUTPUT:</string> </property> </widget> - <widget class="QLabel" row="0" column="3"> + <widget class="TQLabel" row="0" column="3"> <property name="name"> <cstring>m_lbl_policy_nat_output</cstring> </property> @@ -201,7 +201,7 @@ <string><Policy></string> </property> </widget> - <widget class="QLCDNumber" row="0" column="1"> + <widget class="TQLCDNumber" row="0" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Nat_Output</cstring> </property> @@ -214,7 +214,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="0" column="2"> + <widget class="TQLabel" row="0" column="2"> <property name="name"> <cstring>m_lbl_numRulesInfilter_2_3</cstring> </property> @@ -222,7 +222,7 @@ <string>POLICY:</string> </property> </widget> - <widget class="QLabel" row="1" column="2"> + <widget class="TQLabel" row="1" column="2"> <property name="name"> <cstring>m_lbl_numRulesInfilter_2_3_2</cstring> </property> @@ -230,7 +230,7 @@ <string>POLICY:</string> </property> </widget> - <widget class="QLCDNumber" row="1" column="1"> + <widget class="TQLCDNumber" row="1" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Nat_Prerouting</cstring> </property> @@ -243,7 +243,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>m_lbl_numRulesInNat_2_2</cstring> </property> @@ -251,7 +251,7 @@ <string>PREROUTING:</string> </property> </widget> - <widget class="QLabel" row="1" column="3"> + <widget class="TQLabel" row="1" column="3"> <property name="name"> <cstring>m_lbl_policy_nat_prerouting</cstring> </property> @@ -259,7 +259,7 @@ <string><Policy></string> </property> </widget> - <widget class="QLCDNumber" row="2" column="1"> + <widget class="TQLCDNumber" row="2" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Nat_Postrouting</cstring> </property> @@ -272,7 +272,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="2" column="2"> + <widget class="TQLabel" row="2" column="2"> <property name="name"> <cstring>m_lbl_numRulesInfilter_2_3_3</cstring> </property> @@ -280,7 +280,7 @@ <string>POLICY:</string> </property> </widget> - <widget class="QLabel" row="2" column="3"> + <widget class="TQLabel" row="2" column="3"> <property name="name"> <cstring>m_lbl_policy_filter_nat_postrouting</cstring> </property> @@ -288,7 +288,7 @@ <string><Policy></string> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>m_lbl_numRulesInNat_2</cstring> </property> @@ -298,7 +298,7 @@ </widget> </grid> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>WStackPage</cstring> </property> @@ -309,7 +309,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLCDNumber" row="0" column="1"> + <widget class="TQLCDNumber" row="0" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Mangle_Input</cstring> </property> @@ -322,7 +322,7 @@ </sizepolicy> </property> </widget> - <widget class="QLCDNumber" row="1" column="1"> + <widget class="TQLCDNumber" row="1" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Mangle_Output</cstring> </property> @@ -335,7 +335,7 @@ </sizepolicy> </property> </widget> - <widget class="QLCDNumber" row="2" column="1"> + <widget class="TQLCDNumber" row="2" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Mangle_Forward</cstring> </property> @@ -348,7 +348,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>m_lbl_numRulesInMangle_2_2</cstring> </property> @@ -356,7 +356,7 @@ <string>FORWARD:</string> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>m_lbl_numRulesInfilter_2_2</cstring> </property> @@ -364,7 +364,7 @@ <string>OUTPUT:</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>m_lbl_numRulesInfilter_2_2_2</cstring> </property> @@ -372,7 +372,7 @@ <string>INPUT:</string> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>m_lbl_numRulesInNat_2_2_2</cstring> </property> @@ -380,7 +380,7 @@ <string>PREROUTING:</string> </property> </widget> - <widget class="QLCDNumber" row="4" column="1"> + <widget class="TQLCDNumber" row="4" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Mangle_Postrouting</cstring> </property> @@ -393,7 +393,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>m_lbl_numRulesInNat_2_3</cstring> </property> @@ -401,7 +401,7 @@ <string>POSTROUTING:</string> </property> </widget> - <widget class="QLCDNumber" row="3" column="1"> + <widget class="TQLCDNumber" row="3" column="1"> <property name="name"> <cstring>m_lcd_numRulesIn_Mangle_Prerouting</cstring> </property> @@ -417,14 +417,14 @@ </grid> </widget> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>lbl_table</cstring> </property> <property name="text"> <string>Table:</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter</set> </property> </widget> @@ -458,7 +458,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>51</width> <height>20</height> @@ -475,7 +475,7 @@ <slot>raiseWidget(int)</slot> </connection> </connections> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kpushbutton.h</includehint> <includehint>kpushbutton.h</includehint> diff --git a/KMFSysTray/kmfiptwatcher.cpp b/KMFSysTray/kmfiptwatcher.cpp index c2f8c1a..396b3e9 100644 --- a/KMFSysTray/kmfiptwatcher.cpp +++ b/KMFSysTray/kmfiptwatcher.cpp @@ -21,7 +21,7 @@ // QT includes -#include <qtimer.h> +#include <tqtimer.h> // KDE includes #include <kdebug.h> @@ -41,8 +41,8 @@ #include "../core/iptrule.h" #include "../core/iptruleoption.h" -KMFIPTWatcher::KMFIPTWatcher( QObject *parent, const char *name ) - : QObject( parent, name ) { +KMFIPTWatcher::KMFIPTWatcher( TQObject *tqparent, const char *name ) + : TQObject( tqparent, name ) { m_queryExtendedInfo = true; m_doc = new KMFIPTDoc( 0, "iptdoc" ); go(); @@ -54,8 +54,8 @@ KMFIPTWatcher::~KMFIPTWatcher() {} void KMFIPTWatcher::go() { // KMessageBox::information( 0, i18n( "go()" ) ); - m_timer = new QTimer(); - QObject::connect( m_timer, SIGNAL( timeout() ), this, SLOT( timeout() ) ); + m_timer = new TQTimer(); + TQObject::connect( m_timer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( timeout() ) ); m_timer->start( 3000, false ); } @@ -64,26 +64,26 @@ void KMFIPTWatcher::timeout() { DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); - QString arg = "filter"; + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); + TQString arg = "filter"; stream << arg; - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "numChainsInTable(QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "numChainsInTable(TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { - // KMessageBox::information( 0, i18n( "Error with DCOP: %1" ).arg( kapp->dcopClient() ->appId() ) ); + // KMessageBox::information( 0, i18n( "Error with DCOP: %1" ).tqarg( kapp->dcopClient() ->appId() ) ); emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); + TQDataStream answer( reply_data, IO_ReadOnly ); if ( reply_type == "int" ) { int result; answer >> result; - // KMessageBox::information( 0, i18n( "Got answer %1" ).arg(result) ); + // KMessageBox::information( 0, i18n( "Got answer %1" ).tqarg(result) ); emit sigUpdateActive( result > 0 ); } else KMessageBox::information( 0, i18n( "Calling over DCOP succeeded, but the answer had wrong type!" ) ); @@ -102,33 +102,33 @@ void KMFIPTWatcher::queryExtendedInfo() { emit sigUpdateIPTDoc( m_doc ); } -void KMFIPTWatcher::queryChainsInTable( const QString& table, KMFIPTDoc* iptdoc ) { - kdDebug() << "queryNumRulesInChain( const QString& table, const QString& chain )" << endl; +void KMFIPTWatcher::queryChainsInTable( const TQString& table, KMFIPTDoc* iptdoc ) { + kdDebug() << "queryNumRulesInChain( const TQString& table, const TQString& chain )" << endl; DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << table; - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "getChainsInTable(QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "getChainsInTable(TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); - if ( reply_type == "QStringList" ) { - QStringList result; + TQDataStream answer( reply_data, IO_ReadOnly ); + if ( reply_type == TQSTRINGLIST_OBJECT_NAME_STRING ) { + TQStringList result; answer >> result; IPTable *tableObj = iptdoc->table( table ); kdDebug() << "Filling Table: " << tableObj->name() << endl; - QPtrList<IPTChain> *used = new QPtrList<IPTChain>; - for ( QStringList::Iterator it = result.begin(); it != result.end(); ++it ) { + TQPtrList<IPTChain> *used = new TQPtrList<IPTChain>; + for ( TQStringList::Iterator it = result.begin(); it != result.end(); ++it ) { kdDebug() << "Found Chain" << *it << endl; IPTChain *chain = tableObj->chainForName( *it ); if ( ! chain ) { - QString tg = "ACCEPT"; + TQString tg = "ACCEPT"; tableObj->addChain( *it, tg, false, new KMFError() ); } fetchChainPolicy( tableObj->chainForName( *it ) ); @@ -136,12 +136,12 @@ void KMFIPTWatcher::queryChainsInTable( const QString& table, KMFIPTDoc* iptdoc used->append( tableObj->chainForName( *it ) ); } - QPtrListIterator<IPTChain> it_chains( tableObj->chains() ); + TQPtrListIterator<IPTChain> it_chains( tableObj->chains() ); IPTChain* found_chain = 0; while ( it_chains.current() ) { found_chain = it_chains.current(); bool found = false; - for ( QStringList::Iterator it_all = result.begin(); it_all != result.end(); ++it_all ) { + for ( TQStringList::Iterator it_all = result.begin(); it_all != result.end(); ++it_all ) { if ( *it_all == found_chain->name() ) { found = true; } @@ -162,21 +162,21 @@ void KMFIPTWatcher::queryChainsInTable( const QString& table, KMFIPTDoc* iptdoc void KMFIPTWatcher::fetchChainPolicy( IPTChain* chain ) { DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << chain->table()->name() << chain->name(); - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "getChainPolicy(QString,QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "getChainPolicy(TQString,TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); - if ( reply_type == "QString" ) { - QString result; + TQDataStream answer( reply_data, IO_ReadOnly ); + if ( reply_type == TQSTRING_OBJECT_NAME_STRING ) { + TQString result; answer >> result; kdDebug() << "Found Chain Policy: " << chain->table()->name() << " " << chain->name() << " " << result << endl; chain->setDefaultTarget( result ); @@ -185,27 +185,27 @@ void KMFIPTWatcher::fetchChainPolicy( IPTChain* chain ) { } void KMFIPTWatcher::fetchRulesInChain( IPTChain* chain ) { - kdDebug() << "fetchRulesInChain( const QString& table, const QString& chain )" << endl; + kdDebug() << "fetchRulesInChain( const TQString& table, const TQString& chain )" << endl; DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << chain->table()->name() << chain->name(); - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "numRulesInChain(QString,QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "numRulesInChain(TQString,TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); + TQDataStream answer( reply_data, IO_ReadOnly ); if ( reply_type == "int" ) { int result; answer >> result; - QPtrList<IPTRule> *used = new QPtrList<IPTRule>; + TQPtrList<IPTRule> *used = new TQPtrList<IPTRule>; for ( int i = 0; i < result; i++ ) { - QString rn = QString("rule_%1").arg( i ); + TQString rn = TQString("rule_%1").tqarg( i ); IPTRule *rule = 0; rule = chain->ruleForName( rn ); if ( ! rule ) { @@ -215,13 +215,13 @@ void KMFIPTWatcher::fetchRulesInChain( IPTChain* chain ) { used->append( rule ); } - QPtrListIterator<IPTRule> it_rules( chain->chainRuleset() ); + TQPtrListIterator<IPTRule> it_rules( chain->chainRuleset() ); IPTRule* found_rule = 0; while ( it_rules.current() ) { found_rule = it_rules.current(); bool found = false; for ( int i = 0; i < result; i++ ) { - QString rn = QString("rule_%1").arg( i ); + TQString rn = TQString("rule_%1").tqarg( i ); if ( rn == found_rule->name() ) { found = true; } @@ -238,23 +238,23 @@ void KMFIPTWatcher::fetchRulesInChain( IPTChain* chain ) { } void KMFIPTWatcher::fetchRulesProperties( IPTRule* rule, int index ) { - kdDebug() << "queryNumRulesInChain( const QString& table, const QString& chain )" << endl; + kdDebug() << "queryNumRulesInChain( const TQString& table, const TQString& chain )" << endl; DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << rule->chain()->table()->name() << rule->chain()->name() << index; - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "getRuleProperties(QString,QString,int)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "getRuleProperties(TQString,TQString,int)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); - if ( reply_type == "QStringList" ) { - QStringList result; + TQDataStream answer( reply_data, IO_ReadOnly ); + if ( reply_type == TQSTRINGLIST_OBJECT_NAME_STRING ) { + TQStringList result; answer >> result; if ( *result.at( 0 ) == "ERROR" ) { return; @@ -270,22 +270,22 @@ void KMFIPTWatcher::fetchRulesProperties( IPTRule* rule, int index ) { } -void KMFIPTWatcher::queryNumRulesInChain( const QString& table, const QString& chain, KMFIPTDoc* doc ) { - kdDebug() << "queryNumRulesInChain( const QString& table, const QString& chain )" << endl; +void KMFIPTWatcher::queryNumRulesInChain( const TQString& table, const TQString& chain, KMFIPTDoc* doc ) { + kdDebug() << "queryNumRulesInChain( const TQString& table, const TQString& chain )" << endl; DCOPClient *client = kapp->dcopClient(); - QCString reply_type; - QByteArray params; - QDataStream stream( params, IO_WriteOnly ); + TQCString reply_type; + TQByteArray params; + TQDataStream stream( params, IO_WriteOnly ); stream << table << chain; - QByteArray reply_data; + TQByteArray reply_data; - if ( ! client->call( *( new QCString( "kmfiptinterface" ) ), - *( new QCString( "KMFIPTInterface" ) ), - *( new QCString( "numRulesInChain(QString,QString)" ) ), params, + if ( ! client->call( *( new TQCString( "kmfiptinterface" ) ), + *( new TQCString( "KMFIPTInterface" ) ), + *( new TQCString( "numRulesInChain(TQString,TQString)" ) ), params, reply_type, reply_data, false, 10000 ) ) { emit sigUpdateActive( false ); } else { - QDataStream answer( reply_data, IO_ReadOnly ); + TQDataStream answer( reply_data, IO_ReadOnly ); if ( reply_type == "int" ) { int result; answer >> result; diff --git a/KMFSysTray/kmfiptwatcher.h b/KMFSysTray/kmfiptwatcher.h index c6c27f8..68ecf3c 100644 --- a/KMFSysTray/kmfiptwatcher.h +++ b/KMFSysTray/kmfiptwatcher.h @@ -20,24 +20,25 @@ #ifndef KMFIPTWATCHER_H #define KMFIPTWATCHER_H -#include <qobject.h> +#include <tqobject.h> /** @author Christian Hubinger */ -class QTimer; +class TQTimer; class KMFIPTDoc; class IPTChain; class IPTable; class IPTRule; class IPTRuleOption; -class KMFIPTWatcher : public QObject +class KMFIPTWatcher : public TQObject { Q_OBJECT + TQ_OBJECT public: - KMFIPTWatcher(QObject *parent = 0, const char *name = 0); + KMFIPTWatcher(TQObject *tqparent = 0, const char *name = 0); ~KMFIPTWatcher(); @@ -52,10 +53,10 @@ private slots: private: void go(); void queryExtendedInfo(); - void queryNumRulesInChain( const QString& /*table*/, const QString& /*Chain*/, KMFIPTDoc* /* doc */ ); - void queryChainsInTable( const QString& /*table*/, KMFIPTDoc* /* doc */ ); + void queryNumRulesInChain( const TQString& /*table*/, const TQString& /*Chain*/, KMFIPTDoc* /* doc */ ); + void queryChainsInTable( const TQString& /*table*/, KMFIPTDoc* /* doc */ ); - QTimer *m_timer; + TQTimer *m_timer; bool m_queryExtendedInfo; void fetchChainPolicy( IPTChain* ); @@ -66,7 +67,7 @@ private: signals: void sigUpdateIPTDoc( KMFIPTDoc* ); void sigUpdateActive( bool ); - void sigUpdateRuleCount( const QString& /*table*/, const QString& /*Chain*/, int ); + void sigUpdateRuleCount( const TQString& /*table*/, const TQString& /*Chain*/, int ); }; diff --git a/KMFSysTray/kmfsystray.cpp b/KMFSysTray/kmfsystray.cpp index bea6399..42fa48e 100644 --- a/KMFSysTray/kmfsystray.cpp +++ b/KMFSysTray/kmfsystray.cpp @@ -20,8 +20,8 @@ // QT includes -#include <qlcdnumber.h> -#include <qlayout.h> +#include <tqlcdnumber.h> +#include <tqlayout.h> // KDE includes #include <kglobal.h> @@ -45,7 +45,7 @@ #include "../core/kmfiptdoc.h" #include "../core/kmfappstate.h" -KMFSysTray::KMFSysTray( QWidget* w ) : KSystemTray ( w ) , DCOPObject( "KMFSysTray" ) { +KMFSysTray::KMFSysTray( TQWidget* w ) : KSystemTray ( w ) , DCOPObject( "KMFSysTray" ) { mainView = w; ksConfig = kapp->config(); KMFIPTWatcher *watch = new KMFIPTWatcher( this, "KMFIPTWatcher" ); @@ -54,19 +54,19 @@ KMFSysTray::KMFSysTray( QWidget* w ) : KSystemTray ( w ) , DCOPObject( "KMFSysT setPixmap( baseIcon ); // Connect the watch deamon - connect( watch, SIGNAL( sigUpdateActive( bool ) ), this, SLOT( slotSetRunningStatus( bool ) ) ); - connect( watch, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ), - this, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ) ); + connect( watch, TQT_SIGNAL( sigUpdateActive( bool ) ), this, TQT_SLOT( slotSetRunningtqStatus( bool ) ) ); + connect( watch, TQT_SIGNAL( sigUpdateRuleCount( const TQString&, const TQString&, int ) ), + this, TQT_SIGNAL( sigUpdateRuleCount( const TQString&, const TQString&, int ) ) ); - connect( watch, SIGNAL( sigUpdateIPTDoc( KMFIPTDoc* ) ), - this, SIGNAL( sigUpdateIPTDoc( KMFIPTDoc* ) ) ); + connect( watch, TQT_SIGNAL( sigUpdateIPTDoc( KMFIPTDoc* ) ), + this, TQT_SIGNAL( sigUpdateIPTDoc( KMFIPTDoc* ) ) ); - connect( this, SIGNAL( sigQueryDetails( bool ) ), watch, SLOT( slotQueryDetails( bool ) ) ); + connect( this, TQT_SIGNAL( sigQueryDetails( bool ) ), watch, TQT_SLOT( slotQueryDetails( bool ) ) ); // Connect view - connect( w, SIGNAL( closing() ), this, SLOT ( slotDetailsClosed() ) ); - connect( w, SIGNAL( showing() ), this, SLOT ( slotQueryDetails() ) ); - connect( this, SIGNAL( sigUpdateIPTDoc( KMFIPTDoc* ) ), w, SLOT( slotLoadDoc( KMFIPTDoc* ) ) ); + connect( w, TQT_SIGNAL( closing() ), this, TQT_SLOT ( slotDetailsClosed() ) ); + connect( w, TQT_SIGNAL( showing() ), this, TQT_SLOT ( slotQueryDetails() ) ); + connect( this, TQT_SIGNAL( sigUpdateIPTDoc( KMFIPTDoc* ) ), w, TQT_SLOT( slotLoadDoc( KMFIPTDoc* ) ) ); initMenu(); @@ -82,11 +82,11 @@ KMFSysTray::~KMFSysTray() {} void KMFSysTray::initMenu() { KPopupMenu* menu = contextMenu (); - menu->insertItem( KGlobal::iconLoader()->loadIcon( "kmyfirewall", KIcon::Small ), i18n( "Launch KMyFirewall..."), this, SLOT( slotLaunchKMF() ), CTRL+Key_K ); + menu->insertItem( KGlobal::iconLoader()->loadIcon( "kmyfirewall", KIcon::Small ), i18n( "Launch KMyFirewall..."), this, TQT_SLOT( slotLaunchKMF() ), CTRL+Key_K ); } -void KMFSysTray::slotSetRunningStatus( bool on ) { +void KMFSysTray::slotSetRunningtqStatus( bool on ) { if ( on ) { baseIcon = KSystemTray::loadIcon( "kmyfirewall" ); } else { @@ -151,15 +151,15 @@ int KMFSysTray::heightForWidth( int ) const { return height(); } -void KMFSysTray::resizeEvent( QResizeEvent *e ) {} +void KMFSysTray::resizeEvent( TQResizeEvent *e ) {} // extern "C" { -// KPanelApplet * init( QWidget * parent, const QString & configFile ) { +// KPanelApplet * init( TQWidget * tqparent, const TQString & configFile ) { // KGlobal::locale() ->insertCatalogue( "kmfsystray" ); // return new KMFSysTray( configFile, KPanelApplet::Normal, // KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences, -// parent, "kmfsystray" ); +// tqparent, "kmfsystray" ); // } // } diff --git a/KMFSysTray/kmfsystray.h b/KMFSysTray/kmfsystray.h index 9eb4b8a..e9b6f92 100644 --- a/KMFSysTray/kmfsystray.h +++ b/KMFSysTray/kmfsystray.h @@ -27,8 +27,8 @@ #endif // QT includes -#include <qstring.h> -#include <qpixmap.h> +#include <tqstring.h> +#include <tqpixmap.h> // KDE Includes #include <kpanelapplet.h> @@ -42,9 +42,10 @@ class KMFIPTDoc; class KMFSysTray : public KSystemTray, public DCOPObject { Q_OBJECT + TQ_OBJECT public: - KMFSysTray( QWidget * ); + KMFSysTray( TQWidget * ); virtual ~KMFSysTray(); virtual int widthForHeight(int height) const; virtual int heightForWidth(int width) const; @@ -53,14 +54,14 @@ public: virtual void preferences(); public slots: - void slotSetRunningStatus( bool on ); + void slotSetRunningtqStatus( bool on ); void slotLaunchKMF(); void slotShowDetails(); void slotQueryDetails(); void slotDetailsClosed(); protected: - void resizeEvent(QResizeEvent *); + void resizeEvent(TQResizeEvent *); private: // Methods void initMenu(); @@ -68,13 +69,13 @@ private: // Methods private: KAboutData *_aboutData; KConfig *ksConfig; - QWidget *mainView; - QPixmap baseIcon; + TQWidget *mainView; + TQPixmap baseIcon; signals: void sigUpdateIPTDoc( KMFIPTDoc* ); void sigQueryDetails( bool ); - void sigUpdateRuleCount( const QString&, const QString&, int ); + void sigUpdateRuleCount( const TQString&, const TQString&, int ); }; #endif diff --git a/KMFSysTray/main.cpp b/KMFSysTray/main.cpp index fe24ce8..ef9b9d9 100644 --- a/KMFSysTray/main.cpp +++ b/KMFSysTray/main.cpp @@ -10,7 +10,7 @@ // // -#include <qwidget.h> +#include <tqwidget.h> #include <kapplication.h> #include <kaboutapplication.h> diff --git a/KMFSysTray/mainwidget.cpp b/KMFSysTray/mainwidget.cpp index 5eeded9..37fb869 100644 --- a/KMFSysTray/mainwidget.cpp +++ b/KMFSysTray/mainwidget.cpp @@ -22,9 +22,9 @@ #include "mainwidget.h" // QT includes -#include <qcolor.h> -#include <qpushbutton.h> -#include <qwidget.h> +#include <tqcolor.h> +#include <tqpushbutton.h> +#include <tqwidget.h> // KDE includes #include <kled.h> @@ -33,29 +33,29 @@ // Project Includes #include "details.h" -MainWidget::MainWidget(QWidget* parent, const char* name, WFlags fl) -: MainWidgetDesigner(parent,name,fl) +MainWidget::MainWidget(TQWidget* tqparent, const char* name, WFlags fl) +: MainWidgetDesigner(tqparent,name,fl) { m_ledActive->off(); m_cmd_info->setEnabled( false ); m_wid_details = new Details( 0 ); - connect( m_wid_details, SIGNAL( closing() ), this, SLOT ( slotDetailsClosed() ) ); - connect( this, SIGNAL( sigUpdateRuleCount( const QString&, const QString&, int ) ), - m_wid_details, SLOT( slotUpdateRuleCount( const QString&, const QString&, int ) ) ); - connect( m_cmd_info, SIGNAL( clicked() ), this, SLOT( slotShowDetails() ) ) ; + connect( m_wid_details, TQT_SIGNAL( closing() ), this, TQT_SLOT ( slotDetailsClosed() ) ); + connect( this, TQT_SIGNAL( sigUpdateRuleCount( const TQString&, const TQString&, int ) ), + m_wid_details, TQT_SLOT( slotUpdateRuleCount( const TQString&, const TQString&, int ) ) ); + connect( m_cmd_info, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotShowDetails() ) ) ; } MainWidget::~MainWidget() { } -void MainWidget::slotSetRunningStatus( bool on ) { +void MainWidget::slotSetRunningtqStatus( bool on ) { m_ledActive->on(); m_cmd_info->setEnabled( on ); if ( on ) { - m_ledActive -> setColor( QColor(0, 255, 0) ); + m_ledActive -> setColor( TQColor(0, 255, 0) ); } else { - m_ledActive -> setColor( QColor(255, 0, 0) ); + m_ledActive -> setColor( TQColor(255, 0, 0) ); } } diff --git a/KMFSysTray/mainwidget.h b/KMFSysTray/mainwidget.h index aeae571..e862f88 100644 --- a/KMFSysTray/mainwidget.h +++ b/KMFSysTray/mainwidget.h @@ -29,14 +29,15 @@ class Details; class MainWidget : public MainWidgetDesigner { Q_OBJECT + TQ_OBJECT public: - MainWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + MainWidget(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~MainWidget(); /*$PUBLIC_FUNCTIONS$*/ public slots: - void slotSetRunningStatus( bool ); + void slotSetRunningtqStatus( bool ); void slotDetailsClosed(); protected: @@ -54,7 +55,7 @@ private: signals: void sigQueryDetails( bool ); - void sigUpdateRuleCount( const QString&, const QString&, int ); + void sigUpdateRuleCount( const TQString&, const TQString&, int ); }; #endif diff --git a/KMFSysTray/mainwidget_designer.ui b/KMFSysTray/mainwidget_designer.ui index abdb834..c275006 100644 --- a/KMFSysTray/mainwidget_designer.ui +++ b/KMFSysTray/mainwidget_designer.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>MainWidgetDesigner</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>MainWidgetDesigner</cstring> </property> @@ -37,13 +37,13 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>30</width> <height>30</height> </size> </property> - <property name="maximumSize"> + <property name="tqmaximumSize"> <size> <width>30</width> <height>30</height> @@ -52,7 +52,7 @@ <property name="state"> <enum>On</enum> </property> - <property name="shape"> + <property name="tqshape"> <enum>Circular</enum> </property> <property name="look"> @@ -80,7 +80,7 @@ </widget> </hbox> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kled.h</includehint> <includehint>kpushbutton.h</includehint> |