Browse Source

TQt4 port knemo

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knemo@1238869 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 10 years ago
parent
commit
02a6c8f363
  1. 14
      src/common/data.h
  2. 444
      src/kcm/configdialog.cpp
  3. 60
      src/kcm/configdialog.h
  4. 198
      src/kcm/configdlg.ui
  5. 4
      src/knemod/backends/backendbase.cpp
  6. 10
      src/knemod/backends/backendbase.h
  7. 8
      src/knemod/backends/daemonregistry.h
  8. 8
      src/knemod/backends/kcmregistry.h
  9. 124
      src/knemod/backends/nettoolsbackend.cpp
  10. 19
      src/knemod/backends/nettoolsbackend.h
  11. 56
      src/knemod/backends/sysbackend.cpp
  12. 12
      src/knemod/backends/sysbackend.h
  13. 60
      src/knemod/global.h
  14. 120
      src/knemod/interface.cpp
  15. 25
      src/knemod/interface.h
  16. 78
      src/knemod/interfaceicon.cpp
  17. 27
      src/knemod/interfaceicon.h
  18. 6
      src/knemod/interfacemonitor.cpp
  19. 9
      src/knemod/interfacemonitor.h
  20. 108
      src/knemod/interfacestatistics.cpp
  21. 15
      src/knemod/interfacestatistics.h
  22. 28
      src/knemod/interfacestatisticsdialog.cpp
  23. 7
      src/knemod/interfacestatisticsdialog.h
  24. 30
      src/knemod/interfacestatisticsdlg.ui
  25. 106
      src/knemod/interfacestatusdialog.cpp
  26. 11
      src/knemod/interfacestatusdialog.h
  27. 242
      src/knemod/interfacestatusdlg.ui
  28. 84
      src/knemod/interfacetooltip.cpp
  29. 24
      src/knemod/interfacetooltip.h
  30. 28
      src/knemod/interfacetray.cpp
  31. 11
      src/knemod/interfacetray.h
  32. 62
      src/knemod/knemodaemon.cpp
  33. 33
      src/knemod/knemodaemon.h
  34. 98
      src/knemod/signalplotter.cpp
  35. 61
      src/knemod/signalplotter.h

14
src/common/data.h

@ -20,8 +20,8 @@
#ifndef DATA_H
#define DATA_H
#include <qstring.h>
#include <qvaluevector.h>
#include <tqstring.h>
#include <tqvaluevector.h>
/**
* This file contains data structures used to store information about
@ -36,8 +36,8 @@ struct InterfaceCommand
{
int id;
bool runAsRoot;
QString command;
QString menuText;
TQString command;
TQString menuText;
};
struct InterfaceSettings
@ -59,8 +59,8 @@ struct InterfaceSettings
bool hideWhenNotAvailable;
bool activateStatistics;
bool customCommands;
QString alias;
QValueVector<InterfaceCommand> commands;
TQString alias;
TQValueVector<InterfaceCommand> commands;
};
enum ToolTipEnums
@ -82,7 +82,7 @@ enum ToolTipEnums
FREQUENCY = 0x00004000,
BIT_RATE = 0x00008000,
ACCESS_POINT = 0x00010000,
LINK_QUALITY = 0x00020000,
LINK_TQUALITY = 0x00020000,
BCAST_ADDRESS = 0x00040000,
GATEWAY = 0x00080000,
DOWNLOAD_SPEED = 0x00100000,

444
src/kcm/configdialog.cpp

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

60
src/kcm/configdialog.h

@ -20,16 +20,16 @@
#ifndef CONFIGDIALOG_H
#define CONFIGDIALOG_H
#include <qdict.h>
#include <qpair.h>
#include <qstring.h>
#include <qlistview.h>
#include <tqdict.h>
#include <tqpair.h>
#include <tqstring.h>
#include <tqlistview.h>
#include <kcmodule.h>
#include "data.h"
class QTimer;
class TQTimer;
class ConfigDlg;
class KNemoCheckListItem;
@ -46,11 +46,12 @@ class KNemoCheckListItem;
class ConfigDialog : public KCModule
{
Q_OBJECT
TQ_OBJECT
public:
/**
* Default Constructor
*/
ConfigDialog( QWidget *parent, const char *name, const QStringList& );
ConfigDialog( TQWidget *tqparent, const char *name, const TQStringList& );
/**
* Default Destructor
@ -72,8 +73,8 @@ private slots:
void buttonRemoveToolTipSelected();
void buttonNotificationsSelected();
void buttonStatisticsDirSelected();
void interfaceSelected( const QString& interface );
void aliasChanged( const QString& text );
void interfaceSelected( const TQString& interface );
void aliasChanged( const TQString& text );
void iconSetChanged( int set );
void backendChanged( int set );
void checkBoxNotConnectedToggled( bool on );
@ -84,7 +85,7 @@ private slots:
void checkBoxCustomToggled( bool on );
void listViewCommandsSelectionChanged();
void listViewCommandsCheckListItemChanged( KNemoCheckListItem* item, bool state );
void listViewCommandsRenamed( QListViewItem* item, int col, const QString & text );
void listViewCommandsRenamed( TQListViewItem* item, int col, const TQString & text );
/**
* These three are generic.
@ -93,7 +94,7 @@ private slots:
*/
void checkBoxToggled( bool );
void spinBoxValueChanged( int );
void kColorButtonChanged( const QColor& );
void kColorButtonChanged( const TQColor& );
private:
void setupToolTipTab();
@ -111,30 +112,31 @@ private:
int mToolTipContent;
bool mLock;
ConfigDlg* mDlg;
QColor mColorVLines;
QColor mColorHLines;
QColor mColorIncoming;
QColor mColorOutgoing;
QColor mColorBackground;
QDict<InterfaceSettings> mSettingsDict;
QPair<QString, int> mToolTips[25];
static const QString ICON_DISCONNECTED;
static const QString ICON_CONNECTED;
static const QString ICON_INCOMING;
static const QString ICON_OUTGOING;
static const QString ICON_TRAFFIC;
static const QString SUFFIX_PPP;
static const QString SUFFIX_LAN;
static const QString SUFFIX_WLAN;
TQColor mColorVLines;
TQColor mColorHLines;
TQColor mColorIncoming;
TQColor mColorOutgoing;
TQColor mColorBackground;
TQDict<InterfaceSettings> mSettingsDict;
TQPair<TQString, int> mToolTips[25];
static const TQString ICON_DISCONNECTED;
static const TQString ICON_CONNECTED;
static const TQString ICON_INCOMING;
static const TQString ICON_OUTGOING;
static const TQString ICON_TRAFFIC;
static const TQString SUFFIX_PPP;
static const TQString SUFFIX_LAN;
static const TQString SUFFIX_WLAN;
};
class KNemoCheckListItem : public QObject, public QCheckListItem
class KNemoCheckListItem : public TQObject, public TQCheckListItem
{
Q_OBJECT
TQ_OBJECT
public:
KNemoCheckListItem( QListView* view )
: QCheckListItem( view, QString::null, QCheckListItem::CheckBox )
KNemoCheckListItem( TQListView* view )
: TQCheckListItem( view, TQString(), TQCheckListItem::CheckBox )
{}
signals:

198
src/kcm/configdlg.ui

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
<class>ConfigDlg</class>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>ConfigDlg</cstring>
</property>
@ -16,7 +16,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<widget class="TQCheckBox">
<property name="name">
<cstring>checkBoxStartKNemo</cstring>
</property>
@ -24,11 +24,11 @@
<string>Use KNemo to monitor your interfaces</string>
</property>
</widget>
<widget class="QTabWidget">
<widget class="TQTabWidget">
<property name="name">
<cstring>tabWidgetConfiguration</cstring>
</property>
<widget class="QWidget">
<widget class="TQWidget">
<property name="name">
<cstring>interfaces</cstring>
</property>
@ -39,15 +39,15 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="0" column="0" rowspan="2" colspan="1">
<widget class="TQLayoutWidget" row="0" column="0" rowspan="2" colspan="1">
<property name="name">
<cstring>layout4</cstring>
<cstring>tqlayout4</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QPushButton" row="1" column="0">
<widget class="TQPushButton" row="1" column="0">
<property name="name">
<cstring>pushButtonNew</cstring>
</property>
@ -58,7 +58,7 @@
<string>Add a new interface</string>
</property>
</widget>
<widget class="QListBox" row="0" column="0" rowspan="1" colspan="2">
<widget class="TQListBox" row="0" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>listBoxInterfaces</cstring>
</property>
@ -68,7 +68,7 @@ use the names understood by the command 'ifconfig',
for example 'eth0', 'wlan0' or 'ppp0'.</string>
</property>
</widget>
<widget class="QPushButton" row="1" column="1">
<widget class="TQPushButton" row="1" column="1">
<property name="name">
<cstring>pushButtonDelete</cstring>
</property>
@ -81,7 +81,7 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
</widget>
</grid>
</widget>
<widget class="QGroupBox" row="1" column="1">
<widget class="TQGroupBox" row="1" column="1">
<property name="name">
<cstring>groupBox6</cstring>
</property>
@ -92,7 +92,7 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
<widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>checkBoxCustom</cstring>
</property>
@ -100,7 +100,7 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
<string>&amp;Display custom entries in context menu</string>
</property>
</widget>
<widget class="QListView" row="1" column="0">
<widget class="TQListView" row="1" column="0">
<column>
<property name="text">
<string>Root</string>
@ -144,15 +144,15 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
<enum>LastColumn</enum>
</property>
</widget>
<widget class="QLayoutWidget" row="1" column="1">
<widget class="TQLayoutWidget" row="1" column="1">
<property name="name">
<cstring>layout6</cstring>
<cstring>tqlayout6</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>pushButtonAddCommand</cstring>
</property>
@ -169,7 +169,7 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
<string>Add a new entry</string>
</property>
</widget>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>pushButtonRemoveCommand</cstring>
</property>
@ -196,14 +196,14 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>41</width>
<height>61</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>pushButtonUp</cstring>
</property>
@ -214,7 +214,7 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
<string>Move the selected entry up</string>
</property>
</widget>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>pushButtonDown</cstring>
</property>
@ -229,7 +229,7 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
</widget>
</grid>
</widget>
<widget class="QGroupBox" row="0" column="1">
<widget class="TQGroupBox" row="0" column="1">
<property name="name">
<cstring>groupBox3</cstring>
</property>
@ -240,15 +240,15 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout5</cstring>
<cstring>tqlayout5</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@ -256,7 +256,7 @@ for example 'eth0', 'wlan0' or 'ppp0'.</string>
<string>Alias:</string>
</property>
</widget>
<widget class="QLineEdit">
<widget class="TQLineEdit">
<property name="name">
<cstring>lineEditAlias</cstring>
</property>
@ -269,7 +269,7 @@ icons.</string>
</widget>
</hbox>
</widget>
<widget class="QCheckBox">
<widget class="TQCheckBox">
<property name="name">
<cstring>checkBoxNotConnected</cstring>
</property>
@ -282,9 +282,9 @@ hidden when the interface is not connected.
When reconnected the icon will be shown again.</string>
</property>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout3</cstring>
<cstring>tqlayout3</cstring>
</property>
<hbox>
<property name="name">
@ -300,14 +300,14 @@ When reconnected the icon will be shown again.</string>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<property name="tqsizeHint">
<size>
<width>20</width>
<height>21</height>
</size>
</property>
</spacer>
<widget class="QCheckBox">
<widget class="TQCheckBox">
<property name="name">
<cstring>checkBoxNotExisting</cstring>
</property>
@ -324,7 +324,7 @@ of bluetooth adaptors.</string>
</widget>
</hbox>
</widget>
<widget class="QCheckBox">
<widget class="TQCheckBox">
<property name="name">
<cstring>checkBoxStatistics</cstring>
</property>
@ -332,15 +332,15 @@ of bluetooth adaptors.</string>
<string>Activate statistics</string>
</property>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout7_2</cstring>
<cstring>tqlayout7_2</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1_3_2</cstring>
</property>
@ -369,15 +369,15 @@ of bluetooth adaptors.</string>
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<widget class="TQLayoutWidget">
<property name="name">
<cstring>layout7</cstring>
<cstring>tqlayout7</cstring>