@ -17,21 +17,21 @@
Boston , MA 02110 - 1301 , USA .
Boston , MA 02110 - 1301 , USA .
*/
*/
# include < qfile.h>
# include < t qfile.h>
# include < qdict.h>
# include < t qdict.h>
# include < qlabel.h>
# include < t qlabel.h>
# include < qlayout.h>
# include < t qlayout.h>
# include < qcstring.h>
# include < t qcstring.h>
# include < qlistbox.h>
# include < t qlistbox.h>
# include < qcheckbox.h>
# include < t qcheckbox.h>
# include < qlineedit.h>
# include < t qlineedit.h>
# include < qcombobox.h>
# include < t qcombobox.h>
# include < qgroupbox.h>
# include < t qgroupbox.h>
# include < qwhatsthis.h>
# include < t qwhatsthis.h>
# include < qtabwidget.h>
# include < t qtabwidget.h>
# include < qpushbutton.h>
# include < t qpushbutton.h>
# include < qstringlist.h>
# include < t qstringlist.h>
# include < qdatastream.h>
# include < t qdatastream.h>
# include <kglobal.h>
# include <kglobal.h>
# include <kconfig.h>
# include <kconfig.h>
@ -53,20 +53,20 @@
# include "kcmregistry.h"
# include "kcmregistry.h"
# include "configdialog.h"
# include "configdialog.h"
const QString ConfigDialog : : ICON_DISCONNECTED = " network_disconnected " ;
const T QString ConfigDialog : : ICON_DISCONNECTED = " network_disconnected " ;
const QString ConfigDialog : : ICON_CONNECTED = " network_connected " ;
const T QString ConfigDialog : : ICON_CONNECTED = " network_connected " ;
const QString ConfigDialog : : ICON_INCOMING = " network_incoming " ;
const T QString ConfigDialog : : ICON_INCOMING = " network_incoming " ;
const QString ConfigDialog : : ICON_OUTGOING = " network_outgoing " ;
const T QString ConfigDialog : : ICON_OUTGOING = " network_outgoing " ;
const QString ConfigDialog : : ICON_TRAFFIC = " network_traffic " ;
const T QString ConfigDialog : : ICON_TRAFFIC = " network_traffic " ;
const QString ConfigDialog : : SUFFIX_PPP = " _ppp " ;
const T QString ConfigDialog : : SUFFIX_PPP = " _ppp " ;
const QString ConfigDialog : : SUFFIX_LAN = " _lan " ;
const T QString ConfigDialog : : SUFFIX_LAN = " _lan " ;
const QString ConfigDialog : : SUFFIX_WLAN = " _wlan " ;
const T QString ConfigDialog : : SUFFIX_WLAN = " _wlan " ;
typedef KGenericFactory < ConfigDialog , QWidget> KNemoFactory ;
typedef KGenericFactory < ConfigDialog , T QWidget> KNemoFactory ;
K_EXPORT_COMPONENT_FACTORY ( kcm_knemo , KNemoFactory ( " kcm_knemo " ) )
K_EXPORT_COMPONENT_FACTORY ( kcm_knemo , KNemoFactory ( " kcm_knemo " ) )
ConfigDialog : : ConfigDialog ( QWidget * parent, const char * name , const QStringList& )
ConfigDialog : : ConfigDialog ( T QWidget * tq parent, const char * name , const T QStringList& )
: KCModule ( KNemoFactory : : instance ( ) , parent, name ) ,
: KCModule ( KNemoFactory : : instance ( ) , tq parent, name ) ,
mLock ( false ) ,
mLock ( false ) ,
mDlg ( new ConfigDlg ( this ) ) ,
mDlg ( new ConfigDlg ( this ) ) ,
mColorVLines ( 0x04FB1D ) ,
mColorVLines ( 0x04FB1D ) ,
@ -79,14 +79,14 @@ ConfigDialog::ConfigDialog( QWidget *parent, const char *name, const QStringList
setupToolTipArray ( ) ;
setupToolTipArray ( ) ;
// fill the backends combobox
// fill the backends combobox
for ( int i = 0 ; KCMRegistry [ i ] . name ! = QString: : null ; i + + )
for ( int i = 0 ; KCMRegistry [ i ] . name ! = TQString( ) ; i + + )
{
{
mDlg - > comboBoxBackends - > insertItem ( KCMRegistry [ i ] . name ) ;
mDlg - > comboBoxBackends - > insertItem ( KCMRegistry [ i ] . name ) ;
}
}
load ( ) ;
load ( ) ;
QVBoxLayout* top = new QVBoxLayout( this ) ;
T QVBoxLayout* top = new T QVBoxLayout( this ) ;
mDlg - > pushButtonNew - > setPixmap ( SmallIcon ( " filenew " ) ) ;
mDlg - > pushButtonNew - > setPixmap ( SmallIcon ( " filenew " ) ) ;
mDlg - > pushButtonDelete - > setPixmap ( SmallIcon ( " editdelete " ) ) ;
mDlg - > pushButtonDelete - > setPixmap ( SmallIcon ( " editdelete " ) ) ;
mDlg - > pushButtonAddCommand - > setPixmap ( SmallIcon ( " filenew " ) ) ;
mDlg - > pushButtonAddCommand - > setPixmap ( SmallIcon ( " filenew " ) ) ;
@ -96,7 +96,7 @@ ConfigDialog::ConfigDialog( QWidget *parent, const char *name, const QStringList
mDlg - > pushButtonAddToolTip - > setPixmap ( SmallIcon ( " 1rightarrow " ) ) ;
mDlg - > pushButtonAddToolTip - > setPixmap ( SmallIcon ( " 1rightarrow " ) ) ;
mDlg - > pushButtonRemoveToolTip - > setPixmap ( SmallIcon ( " 1leftarrow " ) ) ;
mDlg - > pushButtonRemoveToolTip - > setPixmap ( SmallIcon ( " 1leftarrow " ) ) ;
mDlg - > listViewCommands - > setSorting ( - 1 ) ;
mDlg - > listViewCommands - > setSorting ( - 1 ) ;
QWhatsThis: : add ( mDlg - > listViewCommands ,
T QWhatsThis: : add ( mDlg - > listViewCommands ,
i18n ( " <p>In this area you can add the custom entries " \
i18n ( " <p>In this area you can add the custom entries " \
" for your context menu: <ol><li>check <b>Display " \
" for your context menu: <ol><li>check <b>Display " \
" custom entries in context menu</b>;</li> " \
" custom entries in context menu</b>;</li> " \
@ -111,94 +111,94 @@ ConfigDialog::ConfigDialog( QWidget *parent, const char *name, const QStringList
mSettingsDict . setAutoDelete ( true ) ;
mSettingsDict . setAutoDelete ( true ) ;
setButtons ( KCModule : : Default | KCModule : : Apply ) ;
setButtons ( KCModule : : Default | KCModule : : Apply ) ;
connect ( mDlg - > pushButtonNew , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonNew , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonNewSelected ( ) ) ) ;
this , TQT_ SLOT( buttonNewSelected ( ) ) ) ;
connect ( mDlg - > pushButtonDelete , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonDelete , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonDeleteSelected ( ) ) ) ;
this , TQT_ SLOT( buttonDeleteSelected ( ) ) ) ;
connect ( mDlg - > pushButtonAddCommand , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonAddCommand , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonAddCommandSelected ( ) ) ) ;
this , TQT_ SLOT( buttonAddCommandSelected ( ) ) ) ;
connect ( mDlg - > pushButtonRemoveCommand , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonRemoveCommand , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonRemoveCommandSelected ( ) ) ) ;
this , TQT_ SLOT( buttonRemoveCommandSelected ( ) ) ) ;
connect ( mDlg - > pushButtonUp , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonUp , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonCommandUpSelected ( ) ) ) ;
this , TQT_ SLOT( buttonCommandUpSelected ( ) ) ) ;
connect ( mDlg - > pushButtonDown , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonDown , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonCommandDownSelected ( ) ) ) ;
this , TQT_ SLOT( buttonCommandDownSelected ( ) ) ) ;
connect ( mDlg - > pushButtonAddToolTip , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonAddToolTip , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonAddToolTipSelected ( ) ) ) ;
this , TQT_ SLOT( buttonAddToolTipSelected ( ) ) ) ;
connect ( mDlg - > pushButtonRemoveToolTip , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonRemoveToolTip , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonRemoveToolTipSelected ( ) ) ) ;
this , TQT_ SLOT( buttonRemoveToolTipSelected ( ) ) ) ;
connect ( mDlg - > pushButtonNotifications , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonNotifications , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonNotificationsSelected ( ) ) ) ;
this , TQT_ SLOT( buttonNotificationsSelected ( ) ) ) ;
connect ( mDlg - > pushButtonStatisticsDir , SIGNAL( clicked ( ) ) ,
connect ( mDlg - > pushButtonStatisticsDir , TQT_ SIGNAL( clicked ( ) ) ,
this , SLOT( buttonStatisticsDirSelected ( ) ) ) ;
this , TQT_ SLOT( buttonStatisticsDirSelected ( ) ) ) ;
connect ( mDlg - > lineEditAlias , SIGNAL( textChanged ( const QString& ) ) ,
connect ( mDlg - > lineEditAlias , TQT_ SIGNAL( textChanged ( const T QString& ) ) ,
this , SLOT( aliasChanged ( const QString& ) ) ) ;
this , TQT_ SLOT( aliasChanged ( const T QString& ) ) ) ;
connect ( mDlg - > comboBoxIconSet , SIGNAL( activated ( int ) ) ,
connect ( mDlg - > comboBoxIconSet , TQT_ SIGNAL( activated ( int ) ) ,
this , SLOT( iconSetChanged ( int ) ) ) ;
this , TQT_ SLOT( iconSetChanged ( int ) ) ) ;
connect ( mDlg - > comboBoxBackends , SIGNAL( activated ( int ) ) ,
connect ( mDlg - > comboBoxBackends , TQT_ SIGNAL( activated ( int ) ) ,
this , SLOT( backendChanged ( int ) ) ) ;
this , TQT_ SLOT( backendChanged ( int ) ) ) ;
connect ( mDlg - > checkBoxNotConnected , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxNotConnected , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxNotConnectedToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxNotConnectedToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxNotExisting , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxNotExisting , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxNotExistingToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxNotExistingToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxStatistics , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxStatistics , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxStatisticsToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxStatisticsToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxStartKNemo , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxStartKNemo , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxStartKNemoToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxStartKNemoToggled ( bool ) ) ) ;
connect ( mDlg - > spinBoxTrafficThreshold , SIGNAL( valueChanged ( int ) ) ,
connect ( mDlg - > spinBoxTrafficThreshold , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , SLOT( spinBoxTrafficValueChanged ( int ) ) ) ;
this , TQT_ SLOT( spinBoxTrafficValueChanged ( int ) ) ) ;
connect ( mDlg - > checkBoxCustom , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxCustom , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxCustomToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxCustomToggled ( bool ) ) ) ;
connect ( mDlg - > listBoxInterfaces , SIGNAL( highlighted ( const QString& ) ) ,
connect ( mDlg - > listBoxInterfaces , TQT_ SIGNAL( highlighted ( const T QString& ) ) ,
this , SLOT( interfaceSelected ( const QString& ) ) ) ;
this , TQT_ SLOT( interfaceSelected ( const T QString& ) ) ) ;
connect ( mDlg - > listViewCommands , SIGNAL( selectionChanged ( ) ) ,
connect ( mDlg - > listViewCommands , TQT_ SIGNAL( selectionChanged ( ) ) ,
this , SLOT( listViewCommandsSelectionChanged ( ) ) ) ;
this , TQT_ SLOT( listViewCommandsSelectionChanged ( ) ) ) ;
connect ( mDlg - > listViewCommands , SIGNAL( itemRenamed ( QListViewItem* , int , const QString& ) ) ,
connect ( mDlg - > listViewCommands , TQT_ SIGNAL( itemRenamed ( T QListViewItem* , int , const T QString& ) ) ,
this , SLOT( listViewCommandsRenamed ( QListViewItem* , int , const QString& ) ) ) ;
this , TQT_ SLOT( listViewCommandsRenamed ( T QListViewItem* , int , const T QString& ) ) ) ;
// connect the plotter widgets
// connect the plotter widgets
connect ( mDlg - > checkBoxTopBar , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxTopBar , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxLabels , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxLabels , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxVLines , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxVLines , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxHLines , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxHLines , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxIncoming , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxIncoming , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxOutgoing , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxOutgoing , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxVLinesScroll , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxVLinesScroll , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxToggled ( bool ) ) ) ;
connect ( mDlg - > checkBoxAutoDetection , SIGNAL( toggled ( bool ) ) ,
connect ( mDlg - > checkBoxAutoDetection , TQT_ SIGNAL( toggled ( bool ) ) ,
this , SLOT( checkBoxToggled ( bool ) ) ) ;
this , TQT_ SLOT( checkBoxToggled ( bool ) ) ) ;
connect ( mDlg - > spinBoxCount , SIGNAL( valueChanged ( int ) ) ,
connect ( mDlg - > spinBoxCount , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , SLOT( spinBoxValueChanged ( int ) ) ) ;
this , TQT_ SLOT( spinBoxValueChanged ( int ) ) ) ;
connect ( mDlg - > spinBoxPixel , SIGNAL( valueChanged ( int ) ) ,
connect ( mDlg - > spinBoxPixel , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , SLOT( spinBoxValueChanged ( int ) ) ) ;
this , TQT_ SLOT( spinBoxValueChanged ( int ) ) ) ;
connect ( mDlg - > spinBoxDistance , SIGNAL( valueChanged ( int ) ) ,
connect ( mDlg - > spinBoxDistance , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , SLOT( spinBoxValueChanged ( int ) ) ) ;
this , TQT_ SLOT( spinBoxValueChanged ( int ) ) ) ;
connect ( mDlg - > spinBoxFontSize , SIGNAL( valueChanged ( int ) ) ,
connect ( mDlg - > spinBoxFontSize , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , SLOT( spinBoxValueChanged ( int ) ) ) ;
this , TQT_ SLOT( spinBoxValueChanged ( int ) ) ) ;
connect ( mDlg - > spinBoxMinValue , SIGNAL( valueChanged ( int ) ) ,
connect ( mDlg - > spinBoxMinValue , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , SLOT( spinBoxValueChanged ( int ) ) ) ;
this , TQT_ SLOT( spinBoxValueChanged ( int ) ) ) ;
connect ( mDlg - > spinBoxMaxValue , SIGNAL( valueChanged ( int ) ) ,
connect ( mDlg - > spinBoxMaxValue , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , SLOT( spinBoxValueChanged ( int ) ) ) ;
this , TQT_ SLOT( spinBoxValueChanged ( int ) ) ) ;
connect ( mDlg - > numInputPollInterval , SIGNAL( valueChanged ( int ) ) ,
connect ( mDlg - > numInputPollInterval , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , SLOT( spinBoxValueChanged ( int ) ) ) ;
this , TQT_ SLOT( spinBoxValueChanged ( int ) ) ) ;
connect ( mDlg - > numInputSaveInterval , SIGNAL( valueChanged ( int ) ) ,
connect ( mDlg - > numInputSaveInterval , TQT_ SIGNAL( valueChanged ( int ) ) ,
this , SLOT( spinBoxValueChanged ( int ) ) ) ;
this , TQT_ SLOT( spinBoxValueChanged ( int ) ) ) ;
connect ( mDlg - > kColorButtonVLines , SIGNAL( changed ( const QColor& ) ) ,
connect ( mDlg - > kColorButtonVLines , TQT_ SIGNAL( changed ( const T QColor& ) ) ,
this , SLOT( kColorButtonChanged ( const QColor& ) ) ) ;
this , TQT_ SLOT( kColorButtonChanged ( const T QColor& ) ) ) ;
connect ( mDlg - > kColorButtonHLines , SIGNAL( changed ( const QColor& ) ) ,
connect ( mDlg - > kColorButtonHLines , TQT_ SIGNAL( changed ( const T QColor& ) ) ,
this , SLOT( kColorButtonChanged ( const QColor& ) ) ) ;
this , TQT_ SLOT( kColorButtonChanged ( const T QColor& ) ) ) ;
connect ( mDlg - > kColorButtonIncoming , SIGNAL( changed ( const QColor& ) ) ,
connect ( mDlg - > kColorButtonIncoming , TQT_ SIGNAL( changed ( const T QColor& ) ) ,
this , SLOT( kColorButtonChanged ( const QColor& ) ) ) ;
this , TQT_ SLOT( kColorButtonChanged ( const T QColor& ) ) ) ;
connect ( mDlg - > kColorButtonOutgoing , SIGNAL( changed ( const QColor& ) ) ,
connect ( mDlg - > kColorButtonOutgoing , TQT_ SIGNAL( changed ( const T QColor& ) ) ,
this , SLOT( kColorButtonChanged ( const QColor& ) ) ) ;
this , TQT_ SLOT( kColorButtonChanged ( const T QColor& ) ) ) ;
connect ( mDlg - > kColorButtonBackground , SIGNAL( changed ( const QColor& ) ) ,
connect ( mDlg - > kColorButtonBackground , TQT_ SIGNAL( changed ( const T QColor& ) ) ,
this , SLOT( kColorButtonChanged ( const QColor& ) ) ) ;
this , TQT_ SLOT( kColorButtonChanged ( const T QColor& ) ) ) ;
// No dcop call if KNemo is not activated by the user. Otherwise
// No dcop call if KNemo is not activated by the user. Otherwise
// load-on-demand will start KNemo.
// load-on-demand will start KNemo.
@ -207,22 +207,22 @@ ConfigDialog::ConfigDialog( QWidget *parent, const char *name, const QStringList
// In case the user opened the control center via the context menu
// In case the user opened the control center via the context menu
// this call to the daemon will deliver the interface the menu
// this call to the daemon will deliver the interface the menu
// belongs to. This way we can preselect the appropriate entry in the list.
// belongs to. This way we can preselect the appropriate entry in the list.
QCString replyType ;
T QCString replyType ;
QByteArray replyData , arg ;
T QByteArray replyData , arg ;
QString selectedInterface = QString: : null ;
T QString selectedInterface = TQString( ) ;
if ( kapp - > dcopClient ( ) - > call ( " kded " , " knemod " , " getSelectedInterface() " , arg , replyType , replyData ) )
if ( kapp - > dcopClient ( ) - > call ( " kded " , " knemod " , " getSelectedInterface() " , arg , replyType , replyData ) )
{
{
QDataStream reply ( replyData , IO_ReadOnly ) ;
T QDataStream reply ( replyData , IO_ReadOnly ) ;
reply > > selectedInterface ;
reply > > selectedInterface ;
}
}
if ( selectedInterface ! = QString: : null )
if ( selectedInterface ! = TQString( ) )
{
{
// Try to preselect the interface.
// Try to preselect the interface.
unsigned int i ;
unsigned int i ;
for ( i = 0 ; i < mDlg - > listBoxInterfaces - > count ( ) ; i + + )
for ( i = 0 ; i < mDlg - > listBoxInterfaces - > count ( ) ; i + + )
{
{
QListBoxItem* item = mDlg - > listBoxInterfaces - > item ( i ) ;
T QListBoxItem* item = mDlg - > listBoxInterfaces - > item ( i ) ;
if ( item - > text ( ) = = selectedInterface )
if ( item - > text ( ) = = selectedInterface )
{
{
// Found it.
// Found it.
@ -269,9 +269,9 @@ void ConfigDialog::load()
// select the backend from the config file
// select the backend from the config file
bool foundBackend = false ;
bool foundBackend = false ;
QString backend = config - > readEntry ( " Backend " , " Nettools " ) ;
T QString backend = config - > readEntry ( " Backend " , " Nettools " ) ;
int i ;
int i ;
for ( i = 0 ; KCMRegistry [ i ] . name ! = QString: : null ; i + + )
for ( i = 0 ; KCMRegistry [ i ] . name ! = TQString( ) ; i + + )
{
{
if ( KCMRegistry [ i ] . name = = backend )
if ( KCMRegistry [ i ] . name = = backend )
{
{
@ -287,7 +287,7 @@ void ConfigDialog::load()
mDlg - > comboBoxBackends - > setCurrentItem ( i ) ;
mDlg - > comboBoxBackends - > setCurrentItem ( i ) ;
mDlg - > textLabelBackendDescription - > setText ( KCMRegistry [ i ] . description ) ;
mDlg - > textLabelBackendDescription - > setText ( KCMRegistry [ i ] . description ) ;
QStrList list ;
T QStrList list ;
int numEntries = config - > readListEntry ( " Interfaces " , list ) ;
int numEntries = config - > readListEntry ( " Interfaces " , list ) ;
if ( numEntries = = 0 )
if ( numEntries = = 0 )
@ -296,7 +296,7 @@ void ConfigDialog::load()
char * interface ;
char * interface ;
for ( interface = list . first ( ) ; interface ; interface = list . next ( ) )
for ( interface = list . first ( ) ; interface ; interface = list . next ( ) )
{
{
QString group ( " Interface_ " ) ;
T QString group ( " Interface_ " ) ;
group + = interface ;
group + = interface ;
InterfaceSettings * settings = new InterfaceSettings ( ) ;
InterfaceSettings * settings = new InterfaceSettings ( ) ;
if ( config - > hasGroup ( group ) )
if ( config - > hasGroup ( group ) )
@ -312,13 +312,13 @@ void ConfigDialog::load()
int numCommands = config - > readNumEntry ( " NumCommands " ) ;
int numCommands = config - > readNumEntry ( " NumCommands " ) ;
for ( int i = 0 ; i < numCommands ; i + + )
for ( int i = 0 ; i < numCommands ; i + + )
{
{
QString entry ;
T QString entry ;
InterfaceCommand cmd ;
InterfaceCommand cmd ;
entry = QString( " RunAsRoot%1 " ) . arg( i + 1 ) ;
entry = T QString( " RunAsRoot%1 " ) . tq arg( i + 1 ) ;
cmd . runAsRoot = config - > readBoolEntry ( entry ) ;
cmd . runAsRoot = config - > readBoolEntry ( entry ) ;
entry = QString( " Command%1 " ) . arg( i + 1 ) ;
entry = T QString( " Command%1 " ) . tq arg( i + 1 ) ;
cmd . command = config - > readEntry ( entry ) ;
cmd . command = config - > readEntry ( entry ) ;
entry = QString( " MenuText%1 " ) . arg( i + 1 ) ;
entry = T QString( " MenuText%1 " ) . tq arg( i + 1 ) ;
cmd . menuText = config - > readEntry ( entry ) ;
cmd . menuText = config - > readEntry ( entry ) ;
settings - > commands . append ( cmd ) ;
settings - > commands . append ( cmd ) ;
}
}
@ -363,8 +363,8 @@ void ConfigDialog::save()
{
{
KConfig * config = new KConfig ( " knemorc " , false ) ;
KConfig * config = new KConfig ( " knemorc " , false ) ;
QStringList list ;
T QStringList list ;
QDictIterator< InterfaceSettings > it ( mSettingsDict ) ;
T QDictIterator< InterfaceSettings > it ( mSettingsDict ) ;
for ( ; it . current ( ) ; + + it )
for ( ; it . current ( ) ; + + it )
{
{
list . append ( it . currentKey ( ) ) ;
list . append ( it . currentKey ( ) ) ;
@ -383,12 +383,12 @@ void ConfigDialog::save()
config - > writeEntry ( " NumCommands " , settings - > commands . size ( ) ) ;
config - > writeEntry ( " NumCommands " , settings - > commands . size ( ) ) ;
for ( uint i = 0 ; i < settings - > commands . size ( ) ; i + + )
for ( uint i = 0 ; i < settings - > commands . size ( ) ; i + + )
{
{
QString entry ;
T QString entry ;
entry = QString( " RunAsRoot%1 " ) . arg( i + 1 ) ;
entry = T QString( " RunAsRoot%1 " ) . tq arg( i + 1 ) ;
config - > writeEntry ( entry , settings - > commands [ i ] . runAsRoot ) ;
config - > writeEntry ( entry , settings - > commands [ i ] . runAsRoot ) ;
entry = QString( " Command%1 " ) . arg( i + 1 ) ;
entry = T QString( " Command%1 " ) . tq arg( i + 1 ) ;
config - > writeEntry ( entry , settings - > commands [ i ] . command ) ;
config - > writeEntry ( entry , settings - > commands [ i ] . command ) ;
entry = QString( " MenuText%1 " ) . arg( i + 1 ) ;
entry = T QString( " MenuText%1 " ) . tq arg( i + 1 ) ;
config - > writeEntry ( entry , settings - > commands [ i ] . menuText ) ;
config - > writeEntry ( entry , settings - > commands [ i ] . menuText ) ;
}
}
}
}
@ -430,15 +430,15 @@ void ConfigDialog::save()
if ( mDlg - > checkBoxStartKNemo - > isChecked ( ) )
if ( mDlg - > checkBoxStartKNemo - > isChecked ( ) )
{
{
// This call will implicitly start KNemo if it is not yet running.
// This call will implicitly start KNemo if it is not yet running.
kapp - > dcopClient ( ) - > send ( " kded " , " knemod " , " reparseConfiguration() " , " " ) ;
kapp - > dcopClient ( ) - > send ( " kded " , " knemod " , " reparseConfiguration() " , TQString ( " " ) ) ;
desktop - > writeEntry ( " X-KDE-Kded-autoload " , true ) ;
desktop - > writeEntry ( " X-KDE-Kded-autoload " , true ) ;
}
}
else
else
{
{
QByteArray data ;
T QByteArray data ;
QDataStream arg ( data , IO_WriteOnly ) ;
T QDataStream arg ( data , IO_WriteOnly ) ;
arg < < " knemod " ;
arg < < " knemod " ;
kapp - > dcopClient ( ) - > send ( " kded " , " kded " , " unloadModule( QCString)" , data ) ;
kapp - > dcopClient ( ) - > send ( " kded " , " kded " , " unloadModule( T QCString)" , data ) ;
desktop - > deleteEntry ( " X-KDE-Kded-autoload " ) ;
desktop - > deleteEntry ( " X-KDE-Kded-autoload " ) ;
}
}
desktop - > sync ( ) ;
desktop - > sync ( ) ;
@ -448,20 +448,20 @@ void ConfigDialog::save()
void ConfigDialog : : defaults ( )
void ConfigDialog : : defaults ( )
{
{
// Default interfaces
// Default interfaces
QFile proc ( " /proc/net/dev " ) ;
T QFile proc ( " /proc/net/dev " ) ;
if ( proc . open ( IO_ReadOnly ) )
if ( proc . open ( IO_ReadOnly ) )
{
{
mSettingsDict . clear ( ) ;
mSettingsDict . clear ( ) ;
mDlg - > listBoxInterfaces - > clear ( ) ;
mDlg - > listBoxInterfaces - > clear ( ) ;
QString file = proc . readAll ( ) ;
T QString file = proc . readAll ( ) ;
QStringList content = QStringList: : split ( " \n " , file ) ;
T QStringList content = T QStringList: : split ( " \n " , file ) ;
if ( content . count ( ) > 2 )
if ( content . count ( ) > 2 )
{
{
for ( unsigned int i = 2 ; i < content . count ( ) ; i + + )
for ( unsigned int i = 2 ; i < content . count ( ) ; i + + )
{
{
QString interface = content [ i ] . simplifyWhiteSpace ( ) ;
T QString interface = content [ i ] . simplifyWhiteSpace ( ) ;
interface = interface . left ( interface . find( ' : ' ) ) ;
interface = interface . left ( interface . tq find( ' : ' ) ) ;
if ( interface = = " lo " )
if ( interface = = " lo " )
continue ;
continue ;
@ -479,7 +479,7 @@ void ConfigDialog::defaults()
}
}
else
else
{
{
mDlg - > lineEditAlias - > setText ( QString: : null ) ;
mDlg - > lineEditAlias - > setText ( TQString( ) ) ;
mDlg - > comboBoxIconSet - > setCurrentItem ( 0 ) ;
mDlg - > comboBoxIconSet - > setCurrentItem ( 0 ) ;
mDlg - > checkBoxNotConnected - > setChecked ( false ) ;
mDlg - > checkBoxNotConnected - > setChecked ( false ) ;
mDlg - > checkBoxNotExisting - > setChecked ( false ) ;
mDlg - > checkBoxNotExisting - > setChecked ( false ) ;
@ -528,9 +528,9 @@ void ConfigDialog::defaults()
void ConfigDialog : : buttonNewSelected ( )
void ConfigDialog : : buttonNewSelected ( )
{
{
bool ok = false ;
bool ok = false ;
QString ifname = KInputDialog : : getText ( i18n ( " Add new interface " ) ,
T QString ifname = KInputDialog : : getText ( i18n ( " Add new interface " ) ,
i18n ( " Please enter the name of the interface to be monitored. \n It should be something like 'eth1', 'wlan2' or 'ppp0'. " ) ,
i18n ( " Please enter the name of the interface to be monitored. \n It should be something like 'eth1', 'wlan2' or 'ppp0'. " ) ,
QString: : null ,
TQString( ) ,
& ok ) ;
& ok ) ;
if ( ok )
if ( ok )
@ -544,7 +544,7 @@ void ConfigDialog::buttonNewSelected()
void ConfigDialog : : buttonDeleteSelected ( )
void ConfigDialog : : buttonDeleteSelected ( )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -552,7 +552,7 @@ void ConfigDialog::buttonDeleteSelected()
// TODO: find a better way than blocking signals
// TODO: find a better way than blocking signals
mSettingsDict . remove ( selected - > text ( ) ) ;
mSettingsDict . remove ( selected - > text ( ) ) ;
mDlg - > lineEditAlias - > blockSignals ( true ) ;
mDlg - > lineEditAlias - > blockSignals ( true ) ;
mDlg - > lineEditAlias - > setText ( QString: : null ) ;
mDlg - > lineEditAlias - > setText ( TQString( ) ) ;
mDlg - > lineEditAlias - > blockSignals ( false ) ;
mDlg - > lineEditAlias - > blockSignals ( false ) ;
mDlg - > comboBoxIconSet - > blockSignals ( true ) ;
mDlg - > comboBoxIconSet - > blockSignals ( true ) ;
mDlg - > comboBoxIconSet - > setCurrentItem ( 0 ) ;
mDlg - > comboBoxIconSet - > setCurrentItem ( 0 ) ;
@ -575,7 +575,7 @@ void ConfigDialog::buttonDeleteSelected()
void ConfigDialog : : buttonAddCommandSelected ( )
void ConfigDialog : : buttonAddCommandSelected ( )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -583,12 +583,12 @@ void ConfigDialog::buttonAddCommandSelected()
KNemoCheckListItem * item = new KNemoCheckListItem ( mDlg - > listViewCommands ) ;
KNemoCheckListItem * item = new KNemoCheckListItem ( mDlg - > listViewCommands ) ;
item - > setRenameEnabled ( 1 , true ) ;
item - > setRenameEnabled ( 1 , true ) ;
item - > setRenameEnabled ( 2 , true ) ;
item - > setRenameEnabled ( 2 , true ) ;
connect ( item , SIGNAL( stateChanged ( KNemoCheckListItem * , bool ) ) ,
connect ( item , TQT_ SIGNAL( stateChanged ( KNemoCheckListItem * , bool ) ) ,
this , SLOT( listViewCommandsCheckListItemChanged ( KNemoCheckListItem * , bool ) ) ) ;
this , TQT_ SLOT( listViewCommandsCheckListItemChanged ( KNemoCheckListItem * , bool ) ) ) ;
InterfaceSettings * settings = mSettingsDict [ selected - > text ( ) ] ;
InterfaceSettings * settings = mSettingsDict [ selected - > text ( ) ] ;
QValueVector< InterfaceCommand > cmds ;
T QValueVector< InterfaceCommand > cmds ;
QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
T QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
{
{
InterfaceCommand cmd ;
InterfaceCommand cmd ;
@ -604,7 +604,7 @@ void ConfigDialog::buttonAddCommandSelected()
void ConfigDialog : : buttonRemoveCommandSelected ( )
void ConfigDialog : : buttonRemoveCommandSelected ( )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -612,8 +612,8 @@ void ConfigDialog::buttonRemoveCommandSelected()
delete mDlg - > listViewCommands - > selectedItem ( ) ;
delete mDlg - > listViewCommands - > selectedItem ( ) ;
InterfaceSettings * settings = mSettingsDict [ selected - > text ( ) ] ;
InterfaceSettings * settings = mSettingsDict [ selected - > text ( ) ] ;
QValueVector< InterfaceCommand > cmds ;
T QValueVector< InterfaceCommand > cmds ;
QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
T QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
{
{
InterfaceCommand cmd ;
InterfaceCommand cmd ;
@ -629,15 +629,15 @@ void ConfigDialog::buttonRemoveCommandSelected()
void ConfigDialog : : buttonCommandUpSelected ( )
void ConfigDialog : : buttonCommandUpSelected ( )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
QListViewItem* item = mDlg - > listViewCommands - > selectedItem ( ) ;
T QListViewItem* item = mDlg - > listViewCommands - > selectedItem ( ) ;
if ( item )
if ( item )
{
{
QListViewItem* previous = item - > itemAbove ( ) ;
T QListViewItem* previous = item - > itemAbove ( ) ;
if ( previous )
if ( previous )
{
{
// We can move one up.
// We can move one up.
@ -655,8 +655,8 @@ void ConfigDialog::buttonCommandUpSelected()
InterfaceSettings * settings = mSettingsDict [ selected - > text ( ) ] ;
InterfaceSettings * settings = mSettingsDict [ selected - > text ( ) ] ;
QValueVector< InterfaceCommand > cmds ;
T QValueVector< InterfaceCommand > cmds ;
QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
T QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
{
{
InterfaceCommand cmd ;
InterfaceCommand cmd ;
@ -672,15 +672,15 @@ void ConfigDialog::buttonCommandUpSelected()
void ConfigDialog : : buttonCommandDownSelected ( )
void ConfigDialog : : buttonCommandDownSelected ( )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
QListViewItem* item = mDlg - > listViewCommands - > selectedItem ( ) ;
T QListViewItem* item = mDlg - > listViewCommands - > selectedItem ( ) ;
if ( item )
if ( item )
{
{
QListViewItem* next = item - > itemBelow ( ) ;
T QListViewItem* next = item - > itemBelow ( ) ;
if ( next )
if ( next )
{
{
// We can move one down.
// We can move one down.
@ -690,8 +690,8 @@ void ConfigDialog::buttonCommandDownSelected()
InterfaceSettings * settings = mSettingsDict [ selected - > text ( ) ] ;
InterfaceSettings * settings = mSettingsDict [ selected - > text ( ) ] ;
QValueVector< InterfaceCommand > cmds ;
T QValueVector< InterfaceCommand > cmds ;
QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
T QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
{
{
InterfaceCommand cmd ;
InterfaceCommand cmd ;
@ -713,14 +713,14 @@ void ConfigDialog::buttonAddToolTipSelected()
if ( ! mDlg - > listBoxAvailable - > isSelected ( k ) )
if ( ! mDlg - > listBoxAvailable - > isSelected ( k ) )
continue ;
continue ;
QListBoxItem* selected = mDlg - > listBoxAvailable - > item ( k ) ;
T QListBoxItem* selected = mDlg - > listBoxAvailable - > item ( k ) ;
if ( selected = = 0 )
if ( selected = = 0 )
continue ;
continue ;
// Find the index of the selected item in the tooltip array.
// Find the index of the selected item in the tooltip array.
int itemIndex = 0 ;
int itemIndex = 0 ;
for ( int i = 0 ; mToolTips [ i ] . first ! = QString: : null ; i + + )
for ( int i = 0 ; mToolTips [ i ] . first ! = TQString( ) ; i + + )
{
{
if ( mToolTips [ i ] . first = = selected - > text ( ) )
if ( mToolTips [ i ] . first = = selected - > text ( ) )
{
{
@ -738,8 +738,8 @@ void ConfigDialog::buttonAddToolTipSelected()
// For every item in the display list find its index in
// For every item in the display list find its index in
// the tooltip array.
// the tooltip array.
int siblingIndex = 0 ;
int siblingIndex = 0 ;
QListBoxItem* item = mDlg - > listBoxDisplay - > item ( i ) ;
T QListBoxItem* item = mDlg - > listBoxDisplay - > item ( i ) ;
for ( int j = 0 ; mToolTips [ j ] . first ! = QString: : null ; j + + )
for ( int j = 0 ; mToolTips [ j ] . first ! = TQString( ) ; j + + )
{
{
if ( mToolTips [ j ] . first = = item - > text ( ) )
if ( mToolTips [ j ] . first = = item - > text ( ) )
{
{
@ -780,14 +780,14 @@ void ConfigDialog::buttonRemoveToolTipSelected()
if ( ! mDlg - > listBoxDisplay - > isSelected ( k ) )
if ( ! mDlg - > listBoxDisplay - > isSelected ( k ) )
continue ;
continue ;
QListBoxItem* selected = mDlg - > listBoxDisplay - > item ( k ) ;
T QListBoxItem* selected = mDlg - > listBoxDisplay - > item ( k ) ;
if ( selected = = 0 )
if ( selected = = 0 )
continue ;
continue ;
// Find the index of the selected item in the tooltip array.
// Find the index of the selected item in the tooltip array.
int itemIndex = 0 ;
int itemIndex = 0 ;
for ( int i = 0 ; mToolTips [ i ] . first ! = QString: : null ; i + + )
for ( int i = 0 ; mToolTips [ i ] . first ! = TQString( ) ; i + + )
{
{
if ( mToolTips [ i ] . first = = selected - > text ( ) )
if ( mToolTips [ i ] . first = = selected - > text ( ) )
{
{
@ -805,8 +805,8 @@ void ConfigDialog::buttonRemoveToolTipSelected()
// For every item in the available list find its index in
// For every item in the available list find its index in
// the tooltip array.
// the tooltip array.
int siblingIndex = 0 ;
int siblingIndex = 0 ;
QListBoxItem* item = mDlg - > listBoxAvailable - > item ( i ) ;
T QListBoxItem* item = mDlg - > listBoxAvailable - > item ( i ) ;
for ( int j = 0 ; mToolTips [ j ] . first ! = QString: : null ; j + + )
for ( int j = 0 ; mToolTips [ j ] . first ! = TQString( ) ; j + + )
{
{
if ( mToolTips [ j ] . first = = item - > text ( ) )
if ( mToolTips [ j ] . first = = item - > text ( ) )
{
{
@ -849,14 +849,14 @@ void ConfigDialog::buttonNotificationsSelected()
void ConfigDialog : : buttonStatisticsDirSelected ( )
void ConfigDialog : : buttonStatisticsDirSelected ( )
{
{
KURL url = KDirSelectDialog : : selectDirectory ( ) ;
KURL url = KDirSelectDialog : : selectDirectory ( ) ;
if ( url . path ( ) ! = QString: : null )
if ( url . path ( ) ! = TQString( ) )
{
{
mDlg - > lineEditStatisticsDir - > setText ( url . path ( ) ) ;
mDlg - > lineEditStatisticsDir - > setText ( url . path ( ) ) ;
changed ( true ) ;
changed ( true ) ;
}
}
}
}
void ConfigDialog : : interfaceSelected ( const QString& interface )
void ConfigDialog : : interfaceSelected ( const T QString& interface )
{
{
InterfaceSettings * settings = mSettingsDict [ interface ] ;
InterfaceSettings * settings = mSettingsDict [ interface ] ;
mLock = true ;
mLock = true ;
@ -877,17 +877,17 @@ void ConfigDialog::interfaceSelected( const QString& interface )
item - > setRenameEnabled ( 1 , true ) ;
item - > setRenameEnabled ( 1 , true ) ;
item - > setText ( 2 , settings - > commands [ i ] . command ) ;
item - > setText ( 2 , settings - > commands [ i ] . command ) ;
item - > setRenameEnabled ( 2 , true ) ;
item - > setRenameEnabled ( 2 , true ) ;
connect ( item , SIGNAL( stateChanged ( KNemoCheckListItem * , bool ) ) ,
connect ( item , TQT_ SIGNAL( stateChanged ( KNemoCheckListItem * , bool ) ) ,
this , SLOT( listViewCommandsCheckListItemChanged ( KNemoCheckListItem * , bool ) ) ) ;
this , TQT_ SLOT( listViewCommandsCheckListItemChanged ( KNemoCheckListItem * , bool ) ) ) ;
}
}
iconSetChanged ( settings - > iconSet ) ; // to update iconset preview
iconSetChanged ( settings - > iconSet ) ; // to update iconset preview
mLock = false ;
mLock = false ;
}
}
void ConfigDialog : : aliasChanged ( const QString& text )
void ConfigDialog : : aliasChanged ( const T QString& text )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -899,7 +899,7 @@ void ConfigDialog::aliasChanged( const QString& text )
void ConfigDialog : : iconSetChanged ( int set )
void ConfigDialog : : iconSetChanged ( int set )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -908,7 +908,7 @@ void ConfigDialog::iconSetChanged( int set )
settings - > iconSet = set ;
settings - > iconSet = set ;
// Update the preview of the iconset.
// Update the preview of the iconset.
QString suffix ;
T QString suffix ;
switch ( set )
switch ( set )
{
{
case NETWORK :
case NETWORK :
@ -940,7 +940,7 @@ void ConfigDialog::backendChanged( int backend )
void ConfigDialog : : checkBoxNotConnectedToggled ( bool on )
void ConfigDialog : : checkBoxNotConnectedToggled ( bool on )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -952,7 +952,7 @@ void ConfigDialog::checkBoxNotConnectedToggled( bool on )
void ConfigDialog : : checkBoxNotExistingToggled ( bool on )
void ConfigDialog : : checkBoxNotExistingToggled ( bool on )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -965,7 +965,7 @@ void ConfigDialog::checkBoxNotExistingToggled( bool on )
void ConfigDialog : : checkBoxStatisticsToggled ( bool on )
void ConfigDialog : : checkBoxStatisticsToggled ( bool on )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -1001,7 +1001,7 @@ void ConfigDialog::checkBoxStartKNemoToggled( bool on )
void ConfigDialog : : spinBoxTrafficValueChanged ( int value )
void ConfigDialog : : spinBoxTrafficValueChanged ( int value )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -1013,7 +1013,7 @@ void ConfigDialog::spinBoxTrafficValueChanged( int value )
void ConfigDialog : : checkBoxCustomToggled ( bool on )
void ConfigDialog : : checkBoxCustomToggled ( bool on )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -1034,7 +1034,7 @@ void ConfigDialog::setupToolTipTab()
mDlg - > listBoxDisplay - > clear ( ) ;
mDlg - > listBoxDisplay - > clear ( ) ;
mDlg - > listBoxAvailable - > clear ( ) ;
mDlg - > listBoxAvailable - > clear ( ) ;
for ( int i = 0 ; mToolTips [ i ] . first ! = QString: : null ; i + + )
for ( int i = 0 ; mToolTips [ i ] . first ! = TQString( ) ; i + + )
{
{
if ( mToolTipContent & mToolTips [ i ] . second )
if ( mToolTipContent & mToolTips [ i ] . second )
mDlg - > listBoxDisplay - > insertItem ( mToolTips [ i ] . first ) ;
mDlg - > listBoxDisplay - > insertItem ( mToolTips [ i ] . first ) ;
@ -1063,37 +1063,37 @@ void ConfigDialog::setupToolTipArray()
{
{
// Cannot make this data static as the i18n macro doesn't seem
// Cannot make this data static as the i18n macro doesn't seem
// to work when called to early i.e. before setting the catalogue.
// to work when called to early i.e. before setting the catalogue.
mToolTips [ 0 ] = QPair< QString, int > ( i18n ( " Interface " ) , INTERFACE ) ;
mToolTips [ 0 ] = T QPair< T QString, int > ( i18n ( " Interface " ) , INTERFACE ) ;
mToolTips [ 1 ] = QPair< QString, int > ( i18n ( " Alias " ) , ALIAS ) ;
mToolTips [ 1 ] = T QPair< T QString, int > ( i18n ( " Alias " ) , ALIAS ) ;
mToolTips [ 2 ] = QPair< QString, int > ( i18n ( " Status" ) , STATUS ) ;
mToolTips [ 2 ] = T QPair< T QString, int > ( i18n ( " tq Status" ) , STATUS ) ;
mToolTips [ 3 ] = QPair< QString, int > ( i18n ( " Uptime " ) , UPTIME ) ;
mToolTips [ 3 ] = T QPair< T QString, int > ( i18n ( " Uptime " ) , UPTIME ) ;
mToolTips [ 4 ] = QPair< QString, int > ( i18n ( " IP-Address " ) , IP_ADDRESS ) ;
mToolTips [ 4 ] = T QPair< T QString, int > ( i18n ( " IP-Address " ) , IP_ADDRESS ) ;
mToolTips [ 5 ] = QPair< QString, int > ( i18n ( " Subnet Mask " ) , SUBNET_MASK ) ;
mToolTips [ 5 ] = T QPair< T QString, int > ( i18n ( " Subnet Mask " ) , SUBNET_MASK ) ;
mToolTips [ 6 ] = QPair< QString, int > ( i18n ( " HW-Address " ) , HW_ADDRESS ) ;
mToolTips [ 6 ] = T QPair< T QString, int > ( i18n ( " HW-Address " ) , HW_ADDRESS ) ;
mToolTips [ 7 ] = QPair< QString, int > ( i18n ( " Broadcast Address " ) , BCAST_ADDRESS ) ;
mToolTips [ 7 ] = T QPair< T QString, int > ( i18n ( " Broadcast Address " ) , BCAST_ADDRESS ) ;
mToolTips [ 8 ] = QPair< QString, int > ( i18n ( " Default Gateway " ) , GATEWAY ) ;
mToolTips [ 8 ] = T QPair< T QString, int > ( i18n ( " Default Gateway " ) , GATEWAY ) ;
mToolTips [ 9 ] = QPair< QString, int > ( i18n ( " PtP-Address " ) , PTP_ADDRESS ) ;
mToolTips [ 9 ] = T QPair< T QString, int > ( i18n ( " PtP-Address " ) , PTP_ADDRESS ) ;
mToolTips [ 10 ] = QPair< QString, int > ( i18n ( " Packets Received " ) , RX_PACKETS ) ;
mToolTips [ 10 ] = T QPair< T QString, int > ( i18n ( " Packets Received " ) , RX_PACKETS ) ;
mToolTips [ 11 ] = QPair< QString, int > ( i18n ( " Packets Sent " ) , TX_PACKETS ) ;
mToolTips [ 11 ] = T QPair< T QString, int > ( i18n ( " Packets Sent " ) , TX_PACKETS ) ;
mToolTips [ 12 ] = QPair< QString, int > ( i18n ( " Bytes Received " ) , RX_BYTES ) ;
mToolTips [ 12 ] = T QPair< T QString, int > ( i18n ( " Bytes Received " ) , RX_BYTES ) ;
mToolTips [ 13 ] = QPair< QString, int > ( i18n ( " Bytes Sent " ) , TX_BYTES ) ;
mToolTips [ 13 ] = T QPair< T QString, int > ( i18n ( " Bytes Sent " ) , TX_BYTES ) ;
mToolTips [ 14 ] = QPair< QString, int > ( i18n ( " Download Speed " ) , DOWNLOAD_SPEED ) ;
mToolTips [ 14 ] = T QPair< T QString, int > ( i18n ( " Download Speed " ) , DOWNLOAD_SPEED ) ;
mToolTips [ 15 ] = QPair< QString, int > ( i18n ( " Upload Speed " ) , UPLOAD_SPEED ) ;
mToolTips [ 15 ] = T QPair< T QString, int > ( i18n ( " Upload Speed " ) , UPLOAD_SPEED ) ;
mToolTips [ 16 ] = QPair< QString, int > ( i18n ( " ESSID " ) , ESSID ) ;
mToolTips [ 16 ] = T QPair< T QString, int > ( i18n ( " ESSID " ) , ESSID ) ;
mToolTips [ 17 ] = QPair< QString, int > ( i18n ( " Mode " ) , MODE ) ;
mToolTips [ 17 ] = T QPair< T QString, int > ( i18n ( " Mode " ) , MODE ) ;
mToolTips [ 18 ] = QPair< QString, int > ( i18n ( " Frequency " ) , FREQUENCY ) ;
mToolTips [ 18 ] = T QPair< T QString, int > ( i18n ( " Frequency " ) , FREQUENCY ) ;
mToolTips [ 19 ] = QPair< QString, int > ( i18n ( " Bit Rate " ) , BIT_RATE ) ;
mToolTips [ 19 ] = T QPair< T QString, int > ( i18n ( " Bit Rate " ) , BIT_RATE ) ;
mToolTips [ 20 ] = QPair< QString, int > ( i18n ( " Access Point " ) , ACCESS_POINT ) ;
mToolTips [ 20 ] = T QPair< T QString, int > ( i18n ( " Access Point " ) , ACCESS_POINT ) ;
mToolTips [ 21 ] = QPair< QString, int > ( i18n ( " Link Quality " ) , LINK_ QUALITY ) ;
mToolTips [ 21 ] = T QPair< T QString, int > ( i18n ( " Link Quality " ) , LINK_ T QUALITY ) ;
mToolTips [ 22 ] = QPair< QString, int > ( i18n ( " Nickname " ) , NICK_NAME ) ;
mToolTips [ 22 ] = T QPair< T QString, int > ( i18n ( " Nickname " ) , NICK_NAME ) ;
mToolTips [ 23 ] = QPair< QString, int > ( i18n ( " Encryption " ) , ENCRYPTION ) ;
mToolTips [ 23 ] = T QPair< T QString, int > ( i18n ( " Encryption " ) , ENCRYPTION ) ;
mToolTips [ 24 ] = QPair< QString, int > ( ) ;
mToolTips [ 24 ] = T QPair< T QString, int > ( ) ;
}
}
void ConfigDialog : : updateStatisticsEntries ( void )
void ConfigDialog : : updateStatisticsEntries ( void )
{
{
bool statisticsActive = false ;
bool statisticsActive = false ;
QDictIterator< InterfaceSettings > it ( mSettingsDict ) ;
T QDictIterator< InterfaceSettings > it ( mSettingsDict ) ;
for ( ; it . current ( ) ; + + it )
for ( ; it . current ( ) ; + + it )
{
{
if ( it . current ( ) - > activateStatistics )
if ( it . current ( ) - > activateStatistics )
@ -1117,14 +1117,14 @@ void ConfigDialog::spinBoxValueChanged( int )
changed ( true ) ;
changed ( true ) ;
}
}
void ConfigDialog : : kColorButtonChanged ( const QColor& )
void ConfigDialog : : kColorButtonChanged ( const T QColor& )
{
{
changed ( true ) ;
changed ( true ) ;
}
}
void ConfigDialog : : listViewCommandsSelectionChanged ( )
void ConfigDialog : : listViewCommandsSelectionChanged ( )
{
{
QListViewItem* item = mDlg - > listViewCommands - > selectedItem ( ) ;
T QListViewItem* item = mDlg - > listViewCommands - > selectedItem ( ) ;
if ( item )
if ( item )
mDlg - > pushButtonRemoveCommand - > setEnabled ( true ) ;
mDlg - > pushButtonRemoveCommand - > setEnabled ( true ) ;
else
else
@ -1133,7 +1133,7 @@ void ConfigDialog::listViewCommandsSelectionChanged()
void ConfigDialog : : listViewCommandsCheckListItemChanged ( KNemoCheckListItem * item , bool state )
void ConfigDialog : : listViewCommandsCheckListItemChanged ( KNemoCheckListItem * item , bool state )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -1141,7 +1141,7 @@ void ConfigDialog::listViewCommandsCheckListItemChanged( KNemoCheckListItem* ite
// Find the row of the item.
// Find the row of the item.
int row = 0 ;
int row = 0 ;
bool foundItem = false ;
bool foundItem = false ;
QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
T QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
{
{
if ( i = = item )
if ( i = = item )
@ -1162,9 +1162,9 @@ void ConfigDialog::listViewCommandsCheckListItemChanged( KNemoCheckListItem* ite
}
}
}
}
void ConfigDialog : : listViewCommandsRenamed ( QListViewItem* item , int col , const QString & text )
void ConfigDialog : : listViewCommandsRenamed ( T QListViewItem* item , int col , const T QString & text )
{
{
QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
T QListBoxItem* selected = mDlg - > listBoxInterfaces - > selectedItem ( ) ;
if ( selected = = 0 )
if ( selected = = 0 )
return ;
return ;
@ -1172,7 +1172,7 @@ void ConfigDialog::listViewCommandsRenamed( QListViewItem* item, int col, const
// Find the row of the item.
// Find the row of the item.
int row = 0 ;
int row = 0 ;
bool foundItem = false ;
bool foundItem = false ;
QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
T QListViewItem* i = mDlg - > listViewCommands - > firstChild ( ) ;
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
for ( ; i ! = 0 ; i = i - > nextSibling ( ) )
{
{
if ( i = = item )
if ( i = = item )