summaryrefslogtreecommitdiffstats
path: root/ksim/monitors/net
diff options
context:
space:
mode:
Diffstat (limited to 'ksim/monitors/net')
-rw-r--r--ksim/monitors/net/ksimnet.cpp90
-rw-r--r--ksim/monitors/net/ksimnet.h18
-rw-r--r--ksim/monitors/net/netconfig.cpp60
-rw-r--r--ksim/monitors/net/netconfig.h22
-rw-r--r--ksim/monitors/net/netdevices.h30
-rw-r--r--ksim/monitors/net/netdialog.cpp126
-rw-r--r--ksim/monitors/net/netdialog.h50
7 files changed, 198 insertions, 198 deletions
diff --git a/ksim/monitors/net/ksimnet.cpp b/ksim/monitors/net/ksimnet.cpp
index 45f86c2..1bbfeb2 100644
--- a/ksim/monitors/net/ksimnet.cpp
+++ b/ksim/monitors/net/ksimnet.cpp
@@ -33,15 +33,15 @@
static int mib[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };
#endif
-#include <qpushbutton.h>
-#include <qtextstream.h>
-#include <qfile.h>
-#include <qdatetime.h>
-#include <qlayout.h>
-#include <qtimer.h>
-#include <qregexp.h>
-#include <qcursor.h>
-#include <qpopupmenu.h>
+#include <tqpushbutton.h>
+#include <tqtextstream.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
+#include <tqlayout.h>
+#include <tqtimer.h>
+#include <tqregexp.h>
+#include <tqcursor.h>
+#include <tqpopupmenu.h>
#include <kdebug.h>
#include <klocale.h>
@@ -84,7 +84,7 @@ KSim::PluginPage *NetPlugin::createConfigPage(const char *className)
void NetPlugin::showAbout()
{
- QString version = kapp->aboutData()->version();
+ TQString version = kapp->aboutData()->version();
KAboutData aboutData(instanceName(),
I18N_NOOP("KSim Net Plugin"), version.latin1(),
@@ -105,7 +105,7 @@ NetView::NetView(KSim::PluginObject *parent, const char *name)
#ifdef __linux__
m_procStream = 0L;
if ((m_procFile = fopen("/proc/net/dev", "r")))
- m_procStream = new QTextStream(m_procFile, IO_ReadOnly);
+ m_procStream = new TQTextStream(m_procFile, IO_ReadOnly);
#endif
#ifdef __FreeBSD__
m_buf = 0;
@@ -113,17 +113,17 @@ NetView::NetView(KSim::PluginObject *parent, const char *name)
#endif
m_firstTime = true;
- m_netLayout = new QVBoxLayout(this);
+ m_netLayout = new TQVBoxLayout(this);
m_networkList = createList();
addDisplay();
- m_netTimer = new QTimer(this);
- connect(m_netTimer, SIGNAL(timeout()), SLOT(updateGraph()));
+ m_netTimer = new TQTimer(this);
+ connect(m_netTimer, TQT_SIGNAL(timeout()), TQT_SLOT(updateGraph()));
m_netTimer->start(NET_UPDATE);
- m_lightTimer = new QTimer(this);
- connect(m_lightTimer, SIGNAL(timeout()), SLOT(updateLights()));
+ m_lightTimer = new TQTimer(this);
+ connect(m_lightTimer, TQT_SIGNAL(timeout()), TQT_SLOT(updateLights()));
m_lightTimer->start(LED_UPDATE);
updateGraph();
@@ -180,12 +180,12 @@ void NetView::addDisplay()
{
KSim::LedLabel *led = addLedLabel( ( *it ).name() );
KSim::Label *label = ( ( *it ).showTimer() ? addLabel() : 0L );
- QPopupMenu * popup = ( ( *it ).commandsEnabled() ?
+ TQPopupMenu * popup = ( ( *it ).commandsEnabled() ?
addPopupMenu( ( *it ).name(), i ) : 0L );
KSim::Chart *chart = addChart();
//KSim::LedLabel *led = addLedLabel( ( *it ).name() );
//KSim::Label *label = ( ( *it ).showTimer() ? addLabel() : 0L );
- //QPopupMenu * popup = ( ( *it ).commandsEnabled() ?
+ //TQPopupMenu * popup = ( ( *it ).commandsEnabled() ?
//addPopupMenu( ( *it ).name(), i ) : 0L );
if ( ( *it ).commandsEnabled() )
@@ -262,12 +262,12 @@ Network::List NetView::createList() const
Network::List list;
for ( int i = 0; i < amount; ++i )
{
- if ( !config()->hasGroup( "device-" + QString::number( i ) ) )
+ if ( !config()->hasGroup( "device-" + TQString::number( i ) ) )
{
continue;
}
- config()->setGroup( "device-" + QString::number( i ) );
+ config()->setGroup( "device-" + TQString::number( i ) );
list.append( Network( config()->readEntry( "deviceName" ),
config()->readEntry( "deviceFormat" ),
@@ -341,10 +341,10 @@ void NetView::updateGraph()
time_t start = 0;
struct stat st;
- QTime netTime;
- QString timeDisplay;
- QString pid( "/var/run/%1.pid" );
- QString newPid;
+ TQTime netTime;
+ TQString timeDisplay;
+ TQString pid( "/var/run/%1.pid" );
+ TQString newPid;
Network::List::Iterator it;
for ( it = m_networkList.begin(); it != m_networkList.end(); ++it )
@@ -358,7 +358,7 @@ void NetView::updateGraph()
timeDisplay = ( *it ).format();
newPid = pid.arg( ( *it ).name() );
- if ( QFile::exists( newPid ) && stat( QFile::encodeName( newPid ).data(), &st ) == 0 )
+ if ( TQFile::exists( newPid ) && stat( TQFile::encodeName( newPid ).data(), &st ) == 0 )
{
start = st.st_mtime;
@@ -391,8 +391,8 @@ void NetView::updateGraph()
( *it ).chart()->setValue( receiveDiff, sendDiff );
( *it ).setMaxValue( ( *it ).chart()->maxValue() );
- QString receiveString = KGlobal::locale()->formatNumber( ( float ) receiveDiff / 1024.0, 1 );
- QString sendString = KGlobal::locale()->formatNumber( ( float ) sendDiff / 1024.0, 1 );
+ TQString receiveString = KGlobal::locale()->formatNumber( ( float ) receiveDiff / 1024.0, 1 );
+ TQString sendString = KGlobal::locale()->formatNumber( ( float ) sendDiff / 1024.0, 1 );
( *it ).chart()->setText( i18n( "in: %1k" ).arg( receiveString ),
i18n( "out: %1k" ).arg( sendString ) );
@@ -422,7 +422,7 @@ KSim::Chart *NetView::addChart()
return chart;
}
-KSim::LedLabel *NetView::addLedLabel(const QString &device)
+KSim::LedLabel *NetView::addLedLabel(const TQString &device)
{
KSim::LedLabel *ledLabel = new KSim::LedLabel(0, KSim::Types::Net,
device, this);
@@ -440,20 +440,20 @@ KSim::Label *NetView::addLabel()
return label;
}
-QPopupMenu *NetView::addPopupMenu(const QString &device, int value)
+TQPopupMenu *NetView::addPopupMenu(const TQString &device, int value)
{
- QPopupMenu *popup = new QPopupMenu(this);
+ TQPopupMenu *popup = new TQPopupMenu(this);
popup->insertItem(SmallIcon("network"), i18n("Connect"), this,
- SLOT(runConnectCommand(int)), 0, 1);
+ TQT_SLOT(runConnectCommand(int)), 0, 1);
popup->setItemParameter(1, value);
popup->insertItem(SmallIcon("network"), i18n("Disconnect"), this,
- SLOT(runDisconnectCommand(int)), 0, 2);
+ TQT_SLOT(runDisconnectCommand(int)), 0, 2);
popup->setItemParameter(2, value);
menu()->insertItem(device, popup, 100 + value);
return popup;
}
-void NetView::netStatistics(const QString &device, NetData &data)
+void NetView::netStatistics(const TQString &device, NetData &data)
{
#ifdef __linux__
if (m_procFile == 0) {
@@ -462,8 +462,8 @@ void NetView::netStatistics(const QString &device, NetData &data)
return;
}
- QString output;
- QString parser;
+ TQString output;
+ TQString parser;
// Parse the proc file
while (!m_procStream->atEnd()) {
parser = m_procStream->readLine();
@@ -480,8 +480,8 @@ void NetView::netStatistics(const QString &device, NetData &data)
// make sure our output doesn't contain "eth0:11210107" so we dont
// end up with netList[1] actually being netList[2]
- output.replace(QRegExp(":"), " ");
- QStringList netList = QStringList::split(' ', output);
+ output.replace(TQRegExp(":"), " ");
+ TQStringList netList = TQStringList::split(' ', output);
data.in = netList[1].toULong();
data.out = netList[9].toULong();
@@ -552,14 +552,14 @@ void NetView::netStatistics(const QString &device, NetData &data)
#endif
}
-bool NetView::isOnline(const QString &device)
+bool NetView::isOnline(const TQString &device)
{
#ifdef __linux__
- QFile file("/proc/net/route");
+ TQFile file("/proc/net/route");
if (!file.open(IO_ReadOnly))
return -1;
- return (QTextStream(&file).read().find(device) != -1 ? true : false);
+ return (TQTextStream(&file).read().find(device) != -1 ? true : false);
#endif
#ifdef __FreeBSD__
@@ -625,7 +625,7 @@ bool NetView::isOnline(const QString &device)
}
// EventFilter
-bool NetView::eventFilter( QObject * o, QEvent * e )
+bool NetView::eventFilter( TQObject * o, TQEvent * e )
{
// find out which interface we are
int i = 0;
@@ -640,9 +640,9 @@ bool NetView::eventFilter( QObject * o, QEvent * e )
++i;
}
- if ( e->type() == QEvent::MouseButtonPress )
+ if ( e->type() == TQEvent::MouseButtonPress )
{
- if ( static_cast<QMouseEvent *>( e )->button() == QMouseEvent::RightButton )
+ if ( static_cast<TQMouseEvent *>( e )->button() == TQMouseEvent::RightButton )
{
showMenu(i);
}
@@ -655,10 +655,10 @@ bool NetView::eventFilter( QObject * o, QEvent * e )
void NetView::showMenu(int i) {
- QPopupMenu menu;
+ TQPopupMenu menu;
menu.insertItem( SmallIcon("network"), i18n("Connect"), 1);
menu.insertItem( SmallIcon("network"), i18n("Disconnect"), 2);
- switch (menu.exec(QCursor::pos())) {
+ switch (menu.exec(TQCursor::pos())) {
case 1:
runConnectCommand(i);
break;
diff --git a/ksim/monitors/net/ksimnet.h b/ksim/monitors/net/ksimnet.h
index bdb76e6..007a1a8 100644
--- a/ksim/monitors/net/ksimnet.h
+++ b/ksim/monitors/net/ksimnet.h
@@ -58,29 +58,29 @@ class NetView : public KSim::PluginView
void runDisconnectCommand(int);
protected:
- bool eventFilter(QObject *, QEvent *);
+ bool eventFilter(TQObject *, TQEvent *);
private:
Network::List createList() const;
KSim::Chart *addChart();
- KSim::LedLabel *addLedLabel(const QString &device);
+ KSim::LedLabel *addLedLabel(const TQString &device);
KSim::Label *addLabel();
- QPopupMenu *addPopupMenu(const QString &device, int value);
+ TQPopupMenu *addPopupMenu(const TQString &device, int value);
- void netStatistics(const QString &device, NetData &data);
- bool isOnline(const QString &device);
+ void netStatistics(const TQString &device, NetData &data);
+ bool isOnline(const TQString &device);
void showMenu(int i);
bool m_firstTime;
Network::List m_networkList;
- QTimer *m_netTimer;
- QTimer *m_lightTimer;
- QVBoxLayout *m_netLayout;
+ TQTimer *m_netTimer;
+ TQTimer *m_lightTimer;
+ TQVBoxLayout *m_netLayout;
#ifdef __linux__
FILE *m_procFile;
- QTextStream *m_procStream;
+ TQTextStream *m_procStream;
#endif
#ifdef __FreeBSD__
char *m_buf;
diff --git a/ksim/monitors/net/netconfig.cpp b/ksim/monitors/net/netconfig.cpp
index ca424b3..178ac90 100644
--- a/ksim/monitors/net/netconfig.cpp
+++ b/ksim/monitors/net/netconfig.cpp
@@ -17,9 +17,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qcursor.h>
+#include <tqpushbutton.h>
+#include <tqlayout.h>
+#include <tqcursor.h>
#include <klistview.h>
#include <ksimpleconfig.h>
@@ -40,7 +40,7 @@ NetConfig::NetConfig(KSim::PluginObject *parent, const char *name)
m_yes = i18n("yes");
m_no = i18n("no");
- QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ TQVBoxLayout *mainLayout = new TQVBoxLayout(this);
mainLayout->setSpacing(6);
usingBox = new KListView(this);
@@ -49,33 +49,33 @@ NetConfig::NetConfig(KSim::PluginObject *parent, const char *name)
usingBox ->addColumn(i18n("Commands"));
usingBox->setAllColumnsShowFocus(true);
- connect(usingBox, SIGNAL(contextMenu(KListView *,
- QListViewItem *, const QPoint &)),
- SLOT(menu(KListView *, QListViewItem *, const QPoint &)));
- connect(usingBox, SIGNAL(doubleClicked(QListViewItem *)),
- SLOT(modifyItem(QListViewItem *)));
+ connect(usingBox, TQT_SIGNAL(contextMenu(KListView *,
+ TQListViewItem *, const TQPoint &)),
+ TQT_SLOT(menu(KListView *, TQListViewItem *, const TQPoint &)));
+ connect(usingBox, TQT_SIGNAL(doubleClicked(TQListViewItem *)),
+ TQT_SLOT(modifyItem(TQListViewItem *)));
mainLayout->addWidget(usingBox);
layout = new QHBoxLayout;
layout->setSpacing(6);
- QSpacerItem *spacer = new QSpacerItem(20, 20,
- QSizePolicy::Expanding, QSizePolicy::Minimum);
+ TQSpacerItem *spacer = new TQSpacerItem(20, 20,
+ TQSizePolicy::Expanding, TQSizePolicy::Minimum);
layout->addItem(spacer);
- insertButton = new QPushButton(this);
+ insertButton = new TQPushButton(this);
insertButton->setText(i18n("Add..."));
- connect(insertButton, SIGNAL(clicked()), SLOT(showNetDialog()));
+ connect(insertButton, TQT_SIGNAL(clicked()), TQT_SLOT(showNetDialog()));
layout->addWidget(insertButton);
- modifyButton = new QPushButton(this);
+ modifyButton = new TQPushButton(this);
modifyButton->setText(i18n("Modify..."));
- connect(modifyButton, SIGNAL(clicked()), SLOT(modifyCurrent()));
+ connect(modifyButton, TQT_SIGNAL(clicked()), TQT_SLOT(modifyCurrent()));
layout->addWidget(modifyButton);
- removeButton = new QPushButton(this);
+ removeButton = new TQPushButton(this);
removeButton->setText(i18n("Remove"));
- connect(removeButton, SIGNAL(clicked()), SLOT(removeCurrent()));
+ connect(removeButton, TQT_SIGNAL(clicked()), TQT_SLOT(removeCurrent()));
layout->addWidget(removeButton);
mainLayout->addLayout(layout);
@@ -93,7 +93,7 @@ void NetConfig::saveConfig()
Network::List::Iterator it;
for( it = m_networkList.begin(); it != m_networkList.end(); ++it )
{
- config()->setGroup( "device-" + QString::number( i ) );
+ config()->setGroup( "device-" + TQString::number( i ) );
config()->writeEntry( "deviceName", ( *it ).name() );
config()->writeEntry( "showTimer", ( *it ).showTimer() );
config()->writeEntry( "deviceFormat", ( *it ).format() );
@@ -117,12 +117,12 @@ void NetConfig::readConfig()
for ( int i = 0; i < deviceAmount; ++i )
{
- if ( !config()->hasGroup( "device-" + QString::number( i ) ) )
+ if ( !config()->hasGroup( "device-" + TQString::number( i ) ) )
{
continue;
}
- config()->setGroup("device-" + QString::number(i));
+ config()->setGroup("device-" + TQString::number(i));
m_networkList.append( Network( config()->readEntry( "deviceName" ),
config()->readEntry( "deviceFormat" ),
@@ -131,16 +131,16 @@ void NetConfig::readConfig()
config()->readEntry( "cCommand" ),
config()->readEntry( "dCommand" ) ) );
- (void) new QListViewItem( usingBox,
+ (void) new TQListViewItem( usingBox,
config()->readEntry( "deviceName" ),
boolToString( config()->readBoolEntry( "showTimer" ) ),
boolToString( config()->readBoolEntry( "commands" ) ) );
}
}
-void NetConfig::menu(KListView *, QListViewItem *item, const QPoint &)
+void NetConfig::menu(KListView *, TQListViewItem *item, const TQPoint &)
{
- aboutMenu = new QPopupMenu(this);
+ aboutMenu = new TQPopupMenu(this);
if (item) {
aboutMenu->insertItem(i18n("&Add Net Device"), 3);
@@ -155,7 +155,7 @@ void NetConfig::menu(KListView *, QListViewItem *item, const QPoint &)
aboutMenu->setItemEnabled(2, false);
}
- switch (aboutMenu->exec(QCursor::pos())) {
+ switch (aboutMenu->exec(TQCursor::pos())) {
case 1:
removeItem(item);
break;
@@ -170,7 +170,7 @@ void NetConfig::menu(KListView *, QListViewItem *item, const QPoint &)
delete aboutMenu;
}
-void NetConfig::modifyItem(QListViewItem *item)
+void NetConfig::modifyItem(TQListViewItem *item)
{
if (!item)
return;
@@ -211,13 +211,13 @@ void NetConfig::modifyItem(QListViewItem *item)
delete netDialog;
}
-void NetConfig::removeItem(QListViewItem *item)
+void NetConfig::removeItem(TQListViewItem *item)
{
if (!item)
return;
int result = KMessageBox::warningContinueCancel(0, i18n("Are you sure you "
- "want to remove the net interface '%1'?").arg(item->text(0)), QString::null, KStdGuiItem::del());
+ "want to remove the net interface '%1'?").arg(item->text(0)), TQString::null, KStdGuiItem::del());
if (result == KMessageBox::Cancel)
return;
@@ -229,7 +229,7 @@ void NetConfig::removeItem(QListViewItem *item)
if ( item->text( 0 ) == ( *it ).name() )
{
m_networkList.remove( it );
- if ( config()->deleteGroup( "device-" + QString::number( i ) ) )
+ if ( config()->deleteGroup( "device-" + TQString::number( i ) ) )
kdDebug(2003) << "device-" << i << " was deleted" << endl;
break;
@@ -281,13 +281,13 @@ void NetConfig::getStats()
netDialog->cCommand(),
netDialog->dCommand() ) );
- (void) new QListViewItem( usingBox,
+ (void) new TQListViewItem( usingBox,
netDialog->deviceName(),
boolToString( netDialog->timer() ),
boolToString( netDialog->commands() ) );
}
-const QString &NetConfig::boolToString(bool value) const
+const TQString &NetConfig::boolToString(bool value) const
{
if (value)
return m_yes;
diff --git a/ksim/monitors/net/netconfig.h b/ksim/monitors/net/netconfig.h
index 9ec5c8d..d8c7889 100644
--- a/ksim/monitors/net/netconfig.h
+++ b/ksim/monitors/net/netconfig.h
@@ -41,9 +41,9 @@ class NetConfig : public KSim::PluginPage
virtual void readConfig();
private slots:
- void menu(KListView *, QListViewItem *, const QPoint &);
- void modifyItem(QListViewItem *);
- void removeItem(QListViewItem *);
+ void menu(KListView *, TQListViewItem *, const TQPoint &);
+ void modifyItem(TQListViewItem *);
+ void removeItem(TQListViewItem *);
void removeCurrent();
void modifyCurrent();
void showNetDialog();
@@ -51,17 +51,17 @@ class NetConfig : public KSim::PluginPage
private:
// Couldnt think of a better name for this :)
- const QString &boolToString(bool) const;
+ const TQString &boolToString(bool) const;
- QHBoxLayout *layout;
- QPushButton *insertButton;
- QPushButton *removeButton;
- QPushButton *modifyButton;
+ TQHBoxLayout *layout;
+ TQPushButton *insertButton;
+ TQPushButton *removeButton;
+ TQPushButton *modifyButton;
KListView *usingBox;
NetDialog *netDialog;
Network::List m_networkList;
- QString m_yes;
- QString m_no;
- QPopupMenu *aboutMenu;
+ TQString m_yes;
+ TQString m_no;
+ TQPopupMenu *aboutMenu;
};
#endif
diff --git a/ksim/monitors/net/netdevices.h b/ksim/monitors/net/netdevices.h
index 2a5a680..b82b77d 100644
--- a/ksim/monitors/net/netdevices.h
+++ b/ksim/monitors/net/netdevices.h
@@ -42,7 +42,7 @@ class NetData
class Network
{
public:
- typedef QValueList<Network> List;
+ typedef TQValueList<Network> List;
Network()
{
@@ -54,12 +54,12 @@ class Network
m_max = 0;
}
- Network( const QString & name,
- const QString & format,
+ Network( const TQString & name,
+ const TQString & format,
bool timer,
bool commands,
- const QString & cCommand,
- const QString & dCommand )
+ const TQString & cCommand,
+ const TQString & dCommand )
: m_name( name ),
m_format( format ),
m_timer( timer ),
@@ -144,7 +144,7 @@ class Network
return m_max;
}
- const QString & name() const
+ const TQString & name() const
{
return m_name;
}
@@ -154,7 +154,7 @@ class Network
return m_timer;
}
- const QString & format() const
+ const TQString & format() const
{
return m_format;
}
@@ -164,18 +164,18 @@ class Network
return m_commands;
}
- const QString & connectCommand() const
+ const TQString & connectCommand() const
{
return m_cCommand;
}
- const QString & disconnectCommand() const
+ const TQString & disconnectCommand() const
{
return m_dCommand;
}
void setDisplay( KSim::Chart * chart, KSim::LedLabel * led,
- KSim::Label * label, QPopupMenu * popup )
+ KSim::Label * label, TQPopupMenu * popup )
{
m_chart = chart;
m_led = led;
@@ -201,17 +201,17 @@ class Network
private:
NetData m_data;
NetData m_old;
- QString m_name;
- QString m_format;
+ TQString m_name;
+ TQString m_format;
bool m_timer;
bool m_commands;
- QString m_cCommand;
- QString m_dCommand;
+ TQString m_cCommand;
+ TQString m_dCommand;
KSim::Chart * m_chart;
KSim::LedLabel * m_led;
KSim::Label * m_label;
- QPopupMenu * m_popup;
+ TQPopupMenu * m_popup;
int m_max;
};
diff --git a/ksim/monitors/net/netdialog.cpp b/ksim/monitors/net/netdialog.cpp
index fe655d4..60a5d20 100644
--- a/ksim/monitors/net/netdialog.cpp
+++ b/ksim/monitors/net/netdialog.cpp
@@ -20,15 +20,15 @@
#include "netdialog.h"
#include "netdialog.moc"
-#include <qcheckbox.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qtabwidget.h>
-#include <qwidget.h>
-#include <qlayout.h>
-#include <qfile.h>
-#include <qregexp.h>
+#include <tqcheckbox.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
+#include <tqtabwidget.h>
+#include <tqwidget.h>
+#include <tqlayout.h>
+#include <tqfile.h>
+#include <tqregexp.h>
#include <klocale.h>
#include <kcombobox.h>
@@ -49,29 +49,29 @@
#include <string.h>
-NetDialog::NetDialog(QWidget *parent, const char *name)
- : QTabDialog(parent, name, true)
+NetDialog::NetDialog(TQWidget *parent, const char *name)
+ : TQTabDialog(parent, name, true)
{
m_clicked = false;
setCaption(kapp->makeStdCaption(i18n("Network Interface")));
- m_generalTab = new QWidget(this);
- m_generalLayout = new QGridLayout(m_generalTab);
+ m_generalTab = new TQWidget(this);
+ m_generalLayout = new TQGridLayout(m_generalTab);
m_generalLayout->setSpacing(6);
m_generalLayout->setMargin(11);
- m_deviceLabel = new QLabel(m_generalTab);
+ m_deviceLabel = new TQLabel(m_generalTab);
m_deviceLabel->setText(i18n("Interface:"));
m_generalLayout->addMultiCellWidget(m_deviceLabel, 0, 0, 0, 0);
m_deviceCombo = new KComboBox(true, m_generalTab);
- m_deviceCombo->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
- QSizePolicy::Fixed));
+ m_deviceCombo->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred,
+ TQSizePolicy::Fixed));
m_deviceCombo->setFocus();
m_deviceCombo->setDuplicatesEnabled(false);
m_generalLayout->addMultiCellWidget(m_deviceCombo, 0, 0, 1, 1);
- QStringList output(createList());
+ TQStringList output(createList());
if (output.isEmpty()) {
m_deviceCombo->insertItem("ppp0");
m_deviceCombo->insertItem("eth0");
@@ -79,16 +79,16 @@ NetDialog::NetDialog(QWidget *parent, const char *name)
else
m_deviceCombo->insertStringList(output);
- QSpacerItem *deviceSpacer = new QSpacerItem(20, 20,
- QSizePolicy::Expanding, QSizePolicy::Fixed);
+ TQSpacerItem *deviceSpacer = new TQSpacerItem(20, 20,
+ TQSizePolicy::Expanding, TQSizePolicy::Fixed);
m_generalLayout->addMultiCell(deviceSpacer, 0, 0, 2, 2);
- m_timerBox = new QGroupBox(m_generalTab);
+ m_timerBox = new TQGroupBox(m_generalTab);
m_timerBox->setTitle(i18n("Timer"));
m_timerBox->setColumnLayout(0, Qt::Vertical);
m_timerBox->layout()->setSpacing(0);
m_timerBox->layout()->setMargin(0);
- m_timerBoxLayout = new QVBoxLayout(m_timerBox->layout());
+ m_timerBoxLayout = new TQVBoxLayout(m_timerBox->layout());
m_timerBoxLayout->setAlignment(Qt::AlignTop);
m_timerBoxLayout->setSpacing(6);
m_timerBoxLayout->setMargin(11);
@@ -97,77 +97,77 @@ NetDialog::NetDialog(QWidget *parent, const char *name)
m_timerEdit->setText("hh:mm:ss");
m_timerEdit->setEnabled(false);
- m_showTimer = new QCheckBox(m_timerBox);
+ m_showTimer = new TQCheckBox(m_timerBox);
m_showTimer->setText(i18n("Show timer"));
- connect(m_showTimer, SIGNAL(toggled(bool)),
- m_timerEdit, SLOT(setEnabled(bool)));
+ connect(m_showTimer, TQT_SIGNAL(toggled(bool)),
+ m_timerEdit, TQT_SLOT(setEnabled(bool)));
m_timerBoxLayout->addWidget(m_showTimer);
m_timerBoxLayout->addWidget(m_timerEdit);
- m_hFormat = new QLabel(m_timerBox);
+ m_hFormat = new TQLabel(m_timerBox);
m_hFormat->setText(i18n("hh - Total hours online"));
m_timerBoxLayout->addWidget(m_hFormat);
- m_mFormat = new QLabel(m_timerBox);
+ m_mFormat = new TQLabel(m_timerBox);
m_mFormat->setText(i18n("mm - Total minutes online"));
m_timerBoxLayout->addWidget(m_mFormat);
- m_sFormat = new QLabel(m_timerBox);
+ m_sFormat = new TQLabel(m_timerBox);
m_sFormat->setText(i18n("ss - Total seconds online"));
m_timerBoxLayout->addWidget(m_sFormat);
m_generalLayout->addMultiCellWidget(m_timerBox, 1, 1, 0, 2);
- QSpacerItem *spacer = new QSpacerItem(20, 20,
- QSizePolicy::Minimum, QSizePolicy::Expanding);
+ TQSpacerItem *spacer = new TQSpacerItem(20, 20,
+ TQSizePolicy::Minimum, TQSizePolicy::Expanding);
m_generalLayout->addMultiCell(spacer, 2, 2, 0, 0);
addTab(m_generalTab, i18n("General"));
- m_commandTab = new QWidget(this);
- m_commandLayout = new QGridLayout(m_commandTab);
+ m_commandTab = new TQWidget(this);
+ m_commandLayout = new TQGridLayout(m_commandTab);
m_commandLayout->setSpacing(6);
m_commandLayout->setMargin(11);
- m_enableCommands = new QCheckBox(m_commandTab);
+ m_enableCommands = new TQCheckBox(m_commandTab);
m_enableCommands->setText(i18n("Enable connect/disconnect"));
m_commandLayout->addMultiCellWidget(m_enableCommands, 0, 0, 0, 2);
- m_cCommand = new QLabel(m_commandTab);
+ m_cCommand = new TQLabel(m_commandTab);
m_cCommand->setText(i18n("Connect command:"));
m_commandLayout->addMultiCellWidget(m_cCommand, 1, 1, 0, 0);
m_connectRequester = new KURLRequester(m_commandTab);
m_connectRequester->setMinimumSize(145, 0);
m_connectRequester->setEnabled(false);
- connect(m_enableCommands, SIGNAL(toggled(bool)),
- m_connectRequester, SLOT(setEnabled(bool)));
+ connect(m_enableCommands, TQT_SIGNAL(toggled(bool)),
+ m_connectRequester, TQT_SLOT(setEnabled(bool)));
m_commandLayout->addMultiCellWidget(m_connectRequester, 1, 1, 1, 2);
- m_dCommand = new QLabel(m_commandTab);
+ m_dCommand = new TQLabel(m_commandTab);
m_dCommand->setText(i18n("Disconnect command:"));
m_commandLayout->addMultiCellWidget(m_dCommand, 2, 2, 0, 0);
m_disconnectRequester = new KURLRequester(m_commandTab);
m_disconnectRequester->setMinimumSize(145, 0);
m_disconnectRequester->setEnabled(false);
- connect(m_enableCommands, SIGNAL(toggled(bool)),
- m_disconnectRequester, SLOT(setEnabled(bool)));
+ connect(m_enableCommands, TQT_SIGNAL(toggled(bool)),
+ m_disconnectRequester, TQT_SLOT(setEnabled(bool)));
m_commandLayout->addMultiCellWidget(m_disconnectRequester, 2, 2, 1, 2);
- QSpacerItem *commandSpacer = new QSpacerItem(20, 20,
- QSizePolicy::Minimum, QSizePolicy::Expanding);
+ TQSpacerItem *commandSpacer = new TQSpacerItem(20, 20,
+ TQSizePolicy::Minimum, TQSizePolicy::Expanding);
m_commandLayout->addItem(commandSpacer);
addTab(m_commandTab, i18n("Commands"));
setOkButton(KStdGuiItem::ok().text());
setCancelButton(KStdGuiItem::cancel().text());
- connect(this, SIGNAL(applyButtonPressed()), SLOT(sendClicked()));
+ connect(this, TQT_SIGNAL(applyButtonPressed()), TQT_SLOT(sendClicked()));
}
NetDialog::~NetDialog()
{
}
-const QString NetDialog::deviceName() const
+const TQString NetDialog::deviceName() const
{
return m_deviceCombo->currentText();
}
@@ -177,7 +177,7 @@ bool NetDialog::timer()
return m_showTimer->isChecked();
}
-const QString NetDialog::format() const
+const TQString NetDialog::format() const
{
return m_timerEdit->text();
}
@@ -187,17 +187,17 @@ bool NetDialog::commands()
return m_enableCommands->isChecked();
}
-const QString NetDialog::cCommand() const
+const TQString NetDialog::cCommand() const
{
return m_connectRequester->url();
}
-const QString NetDialog::dCommand() const
+const TQString NetDialog::dCommand() const
{
return m_disconnectRequester->url();
}
-void NetDialog::setDeviceName(const QString &text)
+void NetDialog::setDeviceName(const TQString &text)
{
m_deviceCombo->setCurrentItem(text, true);
}
@@ -207,7 +207,7 @@ void NetDialog::setShowTimer(bool value)
m_showTimer->setChecked(value);
}
-void NetDialog::setFormat(const QString &format)
+void NetDialog::setFormat(const TQString &format)
{
m_timerEdit->setText(format);
}
@@ -217,12 +217,12 @@ void NetDialog::setShowCommands(bool value)
m_enableCommands->setChecked(value);
}
-void NetDialog::setCCommand(const QString &text)
+void NetDialog::setCCommand(const TQString &text)
{
m_connectRequester->setURL(text);
}
-void NetDialog::setDCommand(const QString &text)
+void NetDialog::setDCommand(const TQString &text)
{
m_disconnectRequester->setURL(text);
}
@@ -233,28 +233,28 @@ void NetDialog::sendClicked()
kdDebug(2003) << "ok was clicked" << endl;
}
-QStringList NetDialog::createList() const
+TQStringList NetDialog::createList() const
{
#ifdef __linux__
- QFile file("/proc/net/dev");
+ TQFile file("/proc/net/dev");
if (!file.open(IO_ReadOnly))
- return QStringList();
+ return TQStringList();
- QStringList output;
- QTextStream textStream(&file);
+ TQStringList output;
+ TQTextStream textStream(&file);
while (!textStream.atEnd())
output.append(textStream.readLine());
if (output.isEmpty())
- return QStringList();
+ return TQStringList();
output.pop_front();
output.pop_front();
- QStringList::Iterator it;
- QStringList list;
+ TQStringList::Iterator it;
+ TQStringList list;
for (it = output.begin(); it != output.end(); ++it) {
- list = QStringList::split(' ', (*it));
+ list = TQStringList::split(' ', (*it));
(*it) = list[0].stripWhiteSpace();
(*it).truncate((*it).find(':'));
}
@@ -263,7 +263,7 @@ QStringList NetDialog::createList() const
#endif
#ifdef __FreeBSD__
- QStringList output;
+ TQStringList output;
int mib[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };
char *buf = 0;
int alloc = 0;
@@ -274,19 +274,19 @@ QStringList NetDialog::createList() const
char s[32];
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
- return QStringList();
+ return TQStringList();
if (alloc < needed) {
buf = new char[needed];
if (buf == NULL)
- return QStringList();
+ return TQStringList();
alloc = needed;
}
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
- return QStringList();
+ return TQStringList();
lim = buf + needed;
@@ -294,7 +294,7 @@ QStringList NetDialog::createList() const
while (next < lim) {
ifm = (struct if_msghdr *)next;
if (ifm->ifm_type != RTM_IFINFO)
- return QStringList();
+ return TQStringList();
next += ifm->ifm_msglen;
diff --git a/ksim/monitors/net/netdialog.h b/ksim/monitors/net/netdialog.h
index b6d7801..662e727 100644
--- a/ksim/monitors/net/netdialog.h
+++ b/ksim/monitors/net/netdialog.h
@@ -20,7 +20,7 @@
#ifndef NETDIALOG_H
#define NETDIALOG_H
-#include <qtabdialog.h>
+#include <tqtabdialog.h>
class QVBoxLayout;
class QGridLayout;
@@ -36,50 +36,50 @@ class NetDialog : public QTabDialog
{
Q_OBJECT
public:
- NetDialog(QWidget *parent, const char *name = 0);
+ NetDialog(TQWidget *parent, const char *name = 0);
~NetDialog();
- const QString deviceName() const;
+ const TQString deviceName() const;
bool timer();
- const QString format() const;
+ const TQString format() const;
bool commands();
- const QString cCommand() const;
- const QString dCommand() const;
+ const TQString cCommand() const;
+ const TQString dCommand() const;
bool okClicked() { return m_clicked; }
public slots:
- void setDeviceName(const QString &);
+ void setDeviceName(const TQString &);
void setShowTimer(bool);
- void setFormat(const QString &);
+ void setFormat(const TQString &);
void setShowCommands(bool);
- void setCCommand(const QString &);
- void setDCommand(const QString &);
+ void setCCommand(const TQString &);
+ void setDCommand(const TQString &);
private slots:
void sendClicked();
private:
- QStringList createList() const;
+ TQStringList createList() const;
bool m_clicked;
- QWidget *m_generalTab;
- QLabel *m_deviceLabel;
+ TQWidget *m_generalTab;
+ TQLabel *m_deviceLabel;
KComboBox *m_deviceCombo;
- QGroupBox *m_timerBox;
- QCheckBox *m_showTimer;
+ TQGroupBox *m_timerBox;
+ TQCheckBox *m_showTimer;
KLineEdit *m_timerEdit;
- QLabel *m_hFormat;
- QLabel *m_mFormat;
- QLabel *m_sFormat;
- QWidget *m_commandTab;
- QCheckBox *m_enableCommands;
- QLabel *m_cCommand;
+ TQLabel *m_hFormat;
+ TQLabel *m_mFormat;
+ TQLabel *m_sFormat;
+ TQWidget *m_commandTab;
+ TQCheckBox *m_enableCommands;
+ TQLabel *m_cCommand;
KURLRequester *m_connectRequester;
- QLabel *m_dCommand;
+ TQLabel *m_dCommand;
KURLRequester *m_disconnectRequester;
- QGridLayout *m_generalLayout;
- QVBoxLayout *m_timerBoxLayout;
- QGridLayout *m_commandLayout;
+ TQGridLayout *m_generalLayout;
+ TQVBoxLayout *m_timerBoxLayout;
+ TQGridLayout *m_commandLayout;
};
#endif // NETDIALOG_H