summaryrefslogtreecommitdiffstats
path: root/knetworkconf/knetworkconf/knetworkconf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'knetworkconf/knetworkconf/knetworkconf.cpp')
-rw-r--r--knetworkconf/knetworkconf/knetworkconf.cpp262
1 files changed, 131 insertions, 131 deletions
diff --git a/knetworkconf/knetworkconf/knetworkconf.cpp b/knetworkconf/knetworkconf/knetworkconf.cpp
index bc39c0e..8723d4b 100644
--- a/knetworkconf/knetworkconf/knetworkconf.cpp
+++ b/knetworkconf/knetworkconf/knetworkconf.cpp
@@ -19,7 +19,7 @@
#include "knetworkconf.h"
-KNetworkConf::KNetworkConf(QWidget *parent, const char *name) : DCOPObject("KNetworkConfIface"), KNetworkConfDlg(parent, name)
+KNetworkConf::KNetworkConf(TQWidget *parent, const char *name) : DCOPObject("KNetworkConfIface"), KNetworkConfDlg(parent, name)
{
netInfo = 0L;
makeButtonsResizeable();
@@ -29,18 +29,18 @@ KNetworkConf::KNetworkConf(QWidget *parent, const char *name) : DCOPObject("KNet
klvProfilesList->setAllColumnsShowFocus(true);
klvProfilesList->setRenameable(0,true);
klvProfilesList->setRenameable(1,true);
- QToolTip::remove( &(QListView)klvProfilesList );
+ TQToolTip::remove( &(TQListView)klvProfilesList );
tooltip = new KProfilesListViewToolTip(klvProfilesList);
//Connect signals emmitted by the backend to know when data is ready to be painted.
- connect(config,SIGNAL(readyLoadingNetworkInfo()),this,SLOT(getNetworkInfoSlot()));
- connect(config,SIGNAL(readyLoadingNetworkInfo()),this,SLOT(showMainWindow()));
- connect(config,SIGNAL(readyLoadingNetworkInfo()),this,SLOT(enableSignals()));
- connect(config, SIGNAL(setReadOnly(bool)),this,SLOT(setReadOnlySlot(bool)));
+ connect(config,TQT_SIGNAL(readyLoadingNetworkInfo()),this,TQT_SLOT(getNetworkInfoSlot()));
+ connect(config,TQT_SIGNAL(readyLoadingNetworkInfo()),this,TQT_SLOT(showMainWindow()));
+ connect(config,TQT_SIGNAL(readyLoadingNetworkInfo()),this,TQT_SLOT(enableSignals()));
+ connect(config, TQT_SIGNAL(setReadOnly(bool)),this,TQT_SLOT(setReadOnlySlot(bool)));
connect(klvCardList,
- SIGNAL(contextMenu(KListView*,QListViewItem*,const QPoint&)),
+ TQT_SIGNAL(contextMenu(KListView*,TQListViewItem*,const TQPoint&)),
this,
- SLOT(showInterfaceContextMenuSlot(KListView*,QListViewItem*, const QPoint&)));
+ TQT_SLOT(showInterfaceContextMenuSlot(KListView*,TQListViewItem*, const TQPoint&)));
// Register with DCOP - No longer needed as now we are a kcontrol module?
if ( !kapp->dcopClient()->isRegistered() ) {
@@ -70,7 +70,7 @@ void KNetworkConf::getNetworkInfoSlot()
}
else
{
- //QPtrList<KNetworkInterface> deviceList;
+ //TQPtrList<KNetworkInterface> deviceList;
routingInfo = netInfo->getRoutingInfo();
dnsInfo = netInfo->getDNSInfo();
profilesList = netInfo->getProfilesList();
@@ -93,20 +93,20 @@ void KNetworkConf::getNetworkInfoSlot()
void KNetworkConf::loadNetworkDevicesInfo()
{
KNetworkInterface *device;
- QPixmap activeEthernetDeviceImg(locate("icon","hicolor/22x22/actions/network_connected_lan_knc.png"));
- QPixmap inactiveEthernetDeviceImg(locate("icon","hicolor/22x22/actions/network_disconnected_lan.png"));
- QPixmap activeWirelessDeviceImg(locate("icon","hicolor/22x22/actions/network_traffic_wlan.png"));
- QPixmap inactiveWirelessDeviceImg(locate("icon","hicolor/22x22/actions/network_disconnected_wlan.png"));
+ TQPixmap activeEthernetDeviceImg(locate("icon","hicolor/22x22/actions/network_connected_lan_knc.png"));
+ TQPixmap inactiveEthernetDeviceImg(locate("icon","hicolor/22x22/actions/network_disconnected_lan.png"));
+ TQPixmap activeWirelessDeviceImg(locate("icon","hicolor/22x22/actions/network_traffic_wlan.png"));
+ TQPixmap inactiveWirelessDeviceImg(locate("icon","hicolor/22x22/actions/network_disconnected_wlan.png"));
klvCardList->clear();
- QPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
+ TQPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
for (device = deviceList.first(); device; device = deviceList.next())
{
if ( device->getType() != "loopback" )
{
if (klvCardList->findItem(device->getDeviceName(),0,CaseSensitive|ExactMatch) == 0)
{
- QListViewItem * item = new QListViewItem( klvCardList, 0 );
+ TQListViewItem * item = new TQListViewItem( klvCardList, 0 );
if (device->isActive())
{
@@ -138,7 +138,7 @@ void KNetworkConf::loadNetworkDevicesInfo()
else
item->setText(2,device->getBootProto());
item->setText(4,device->getDescription());
- QStringList l = deviceNamesList.grep(device->getDeviceName());
+ TQStringList l = deviceNamesList.grep(device->getDeviceName());
if (l.size() == 0)
deviceNamesList.append(device->getDeviceName());
}
@@ -151,7 +151,7 @@ void KNetworkConf::loadNetworkDevicesInfo()
*/
void KNetworkConf::quitSlot(){
int code = 0;
- connect( config, SIGNAL(readyLoadingNetworkInfo()), this, SLOT(quitSlot()) );
+ connect( config, TQT_SIGNAL(readyLoadingNetworkInfo()), this, TQT_SLOT(quitSlot()) );
if (modified)
{
code = KMessageBox::warningYesNoCancel(this,
@@ -170,8 +170,8 @@ void KNetworkConf::enableButtonsSlot(){
if (!readOnly)
{
kpbConfigureNetworkInterface->setEnabled(true);
- QListViewItem *item = klvCardList->currentItem();
- QString currentDevice = item->text(0);
+ TQListViewItem *item = klvCardList->currentItem();
+ TQString currentDevice = item->text(0);
KNetworkInterface *dev = getDeviceInfo(currentDevice);
if (dev->isActive())
@@ -204,8 +204,8 @@ void KNetworkConf::editServerSlot(){
{
int currentPos = klbDomainServerList->currentItem();
dlg.setCaption(i18n("Edit Server"));
- QListBoxItem *item = klbDomainServerList->item(currentPos);
- QString currentText = item->text();
+ TQListBoxItem *item = klbDomainServerList->item(currentPos);
+ TQString currentText = item->text();
dlg.kleNewServer->setText(currentText);
dlg.kpbAddServer->setText(i18n("&OK"));
dlg.exec();
@@ -221,7 +221,7 @@ void KNetworkConf::editServerSlot(){
/** Pops up the window for adding a new interface. */
void KNetworkConf::configureDeviceSlot(){
- QListViewItem *item = klvCardList->currentItem();
+ TQListViewItem *item = klvCardList->currentItem();
KWirelessInterface *wifiDev = NULL;
//KAddDeviceContainer *configDlg = new KAddDeviceContainer(this,0);
@@ -229,7 +229,7 @@ void KNetworkConf::configureDeviceSlot(){
if (item != NULL)
{
- QString currentDevice = item->text(0);
+ TQString currentDevice = item->text(0);
configDlg.setCaption(i18n("Configure Device %1").arg(currentDevice));
KNetworkInterface *dev = getDeviceInfo(currentDevice);
KAddDeviceDlgExtension *advancedOptions = (KAddDeviceDlgExtension *)configDlg.extension();
@@ -336,9 +336,9 @@ void KNetworkConf::configureDeviceSlot(){
dev->setIpAddress(configDlg.addDlg->kleIPAddress->text().stripWhiteSpace());
dev->setGateway(advancedOptions->kleGateway->text().stripWhiteSpace());
dev->setNetmask(configDlg.addDlg->kcbNetmask->currentText().stripWhiteSpace());
- QString network = KAddressValidator::calculateNetwork(dev->getIpAddress().stripWhiteSpace(),dev->getNetmask().stripWhiteSpace());
+ TQString network = KAddressValidator::calculateNetwork(dev->getIpAddress().stripWhiteSpace(),dev->getNetmask().stripWhiteSpace());
dev->setNetwork(network);
- QString broadcast = advancedOptions->kleBroadcast->text().stripWhiteSpace();
+ TQString broadcast = advancedOptions->kleBroadcast->text().stripWhiteSpace();
if (broadcast.isEmpty())
broadcast = KAddressValidator::calculateBroadcast(dev->getIpAddress().stripWhiteSpace(),dev->getNetmask().stripWhiteSpace());
dev->setBroadcast(broadcast);
@@ -363,9 +363,9 @@ void KNetworkConf::configureDeviceSlot(){
}
/**Returns the info of the network device 'device or NULL if not found.'*/
-KNetworkInterface * KNetworkConf::getDeviceInfo(QString device){
- QPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
- QPtrListIterator<KNetworkInterface> i(deviceList);
+KNetworkInterface * KNetworkConf::getDeviceInfo(TQString device){
+ TQPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
+ TQPtrListIterator<KNetworkInterface> i(deviceList);
KNetworkInterface *temp;
while ((temp = i.current()) != 0)
{
@@ -379,9 +379,9 @@ KNetworkInterface * KNetworkConf::getDeviceInfo(QString device){
}
/**Returns the name of the network device that corresponds to the IP address 'ipAddr' or NULL if not found.'*/
-QString KNetworkConf::getDeviceName(QString ipAddr){
- QPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
- QPtrListIterator<KNetworkInterface> i(deviceList);
+TQString KNetworkConf::getDeviceName(TQString ipAddr){
+ TQPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
+ TQPtrListIterator<KNetworkInterface> i(deviceList);
KNetworkInterface *temp;
while ((temp = i.current()) != 0)
{
@@ -412,8 +412,8 @@ void KNetworkConf::loadRoutingInfo(){
//because some platforms (Debian-like ones) seems that don't handle the concept of a default
//gateway, instead a gateway per interface.
KNetworkInterface *device;
- QString defaultGwDevice = routingInfo->getGatewayDevice();
- QPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
+ TQString defaultGwDevice = routingInfo->getGatewayDevice();
+ TQPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
for (device = deviceList.first(); device; device = deviceList.next())
{
if ( device->getDeviceName() == defaultGwDevice )
@@ -437,7 +437,7 @@ void KNetworkConf::loadRoutingInfo(){
}
void KNetworkConf::loadDNSInfo(){
- QStringList nameServers;
+ TQStringList nameServers;
if (dnsInfo == NULL)
KMessageBox::error(this,i18n("Could not open file '/etc/resolv.conf' for reading."),
i18n("Error Loading Config Files"));
@@ -447,24 +447,24 @@ void KNetworkConf::loadDNSInfo(){
kleDomainName->setText(dnsInfo->getDomainName());
klbDomainServerList->clear();
nameServers = dnsInfo->getNameServers();
- for ( QStringList::Iterator it = nameServers.begin(); it != nameServers.end(); ++it)
+ for ( TQStringList::Iterator it = nameServers.begin(); it != nameServers.end(); ++it)
{
klbDomainServerList->insertItem(*it);
}
klvKnownHosts->clear();
knownHostsList = dnsInfo->getKnownHostsList();
- QPtrListIterator<KKnownHostInfo> it(knownHostsList);
+ TQPtrListIterator<KKnownHostInfo> it(knownHostsList);
KKnownHostInfo *host;
while ((host = it.current()) != 0)
{
++it;
if (!(host->getIpAddress().isEmpty()))
{
- QListViewItem * item = new QListViewItem( klvKnownHosts, 0 );
+ TQListViewItem * item = new TQListViewItem( klvKnownHosts, 0 );
item->setText(0,host->getIpAddress());
- QStringList aliasesList = host->getAliases();
- QString aliases;
- for ( QStringList::Iterator it = aliasesList.begin(); it != aliasesList.end(); ++it )
+ TQStringList aliasesList = host->getAliases();
+ TQString aliases;
+ for ( TQStringList::Iterator it = aliasesList.begin(); it != aliasesList.end(); ++it )
{
aliases += *it+" ";
}
@@ -475,7 +475,7 @@ void KNetworkConf::loadDNSInfo(){
}
void KNetworkConf::loadNetworkProfiles(){
- QPtrListIterator<KNetworkInfo> it(profilesList);
+ TQPtrListIterator<KNetworkInfo> it(profilesList);
KNetworkInfo *profile = NULL;
klvProfilesList->clear();
@@ -484,7 +484,7 @@ void KNetworkConf::loadNetworkProfiles(){
++it;
if (!profile->getProfileName().isEmpty())
{
- QListViewItem * item = new QListViewItem( klvProfilesList, 0 );
+ TQListViewItem * item = new TQListViewItem( klvProfilesList, 0 );
item->setText(0,profile->getProfileName());
}
}
@@ -517,7 +517,7 @@ void KNetworkConf::setReadOnly(bool state){
KNetworkConf::readOnly = state;
}
/** No descriptions */
-void KNetworkConf::enableApplyButtonSlot(const QString &text){
+void KNetworkConf::enableApplyButtonSlot(const TQString &text){
enableApplyButtonSlot();
}
/** No descriptions */
@@ -538,9 +538,9 @@ void KNetworkConf::moveUpServerSlot(){
if (antPos >= 0)
{
- QListBoxItem *current = klbDomainServerList->item(curPos);
- QListBoxItem *ant = current->prev();
- QString antText = ant->text();
+ TQListBoxItem *current = klbDomainServerList->item(curPos);
+ TQListBoxItem *ant = current->prev();
+ TQString antText = ant->text();
klbDomainServerList->removeItem(antPos);
klbDomainServerList->insertItem(antText,curPos);
enableApplyButtonSlot();
@@ -554,8 +554,8 @@ void KNetworkConf::moveDownServerSlot(){
{
if (klbDomainServerList->count() >= nextPos)
{
- QListBoxItem *current = klbDomainServerList->item(curPos);
- QString curText = current->text();
+ TQListBoxItem *current = klbDomainServerList->item(curPos);
+ TQString curText = current->text();
klbDomainServerList->removeItem(curPos);
klbDomainServerList->insertItem(curText,nextPos);
klbDomainServerList->setSelected(nextPos,true);
@@ -569,7 +569,7 @@ void KNetworkConf::disableAll(){
kleDomainName->setReadOnly(true);
tlDomainName->setEnabled(false);
tlHostName->setEnabled(false);
- disconnect(klvCardList,SIGNAL(doubleClicked(QListViewItem *)),this,SLOT(configureDeviceSlot()));
+ disconnect(klvCardList,TQT_SIGNAL(doubleClicked(TQListViewItem *)),this,TQT_SLOT(configureDeviceSlot()));
klvCardList->setEnabled(false);
kpbUpButton->setEnabled(false);
kpbDownButton->setEnabled(false);
@@ -615,9 +615,9 @@ void KNetworkConf::saveInfoSlot(){
//because some platforms (Debian-like ones) get the default gateway from there
//instead from the default gateway field. funny huh?
KNetworkInterface *device;
- QString defaultGwDevice = routingInfo->getGatewayDevice();
- QString defaultGwAddress = routingInfo->getGateway();
- QPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
+ TQString defaultGwDevice = routingInfo->getGatewayDevice();
+ TQString defaultGwAddress = routingInfo->getGateway();
+ TQPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
for (device = deviceList.first(); device; device = deviceList.next())
{
if ( device->getGateway().length() == 0 )
@@ -633,19 +633,19 @@ void KNetworkConf::saveInfoSlot(){
modified = false;
}
}
-/** Creates a QStringList with the IP addresses contained in the QListBox of name servers. */
-QStringList KNetworkConf::getNamserversList(KListBox * serverList){
- QStringList list;
+/** Creates a TQStringList with the IP addresses contained in the TQListBox of name servers. */
+TQStringList KNetworkConf::getNamserversList(KListBox * serverList){
+ TQStringList list;
for (unsigned i = 0; i < serverList->count(); i++)
{
list.append(serverList->text(i));
}
return list;
}
-/** Creates a QPtrList<KKownHostInfo> with the info contained in the KListView of name servers. */
-QPtrList<KKnownHostInfo> KNetworkConf::getKnownHostsList(KListView * hostsList){
- QPtrList<KKnownHostInfo> list;
- QListViewItem *it = hostsList->firstChild();
+/** Creates a TQPtrList<KKownHostInfo> with the info contained in the KListView of name servers. */
+TQPtrList<KKnownHostInfo> KNetworkConf::getKnownHostsList(KListView * hostsList){
+ TQPtrList<KKnownHostInfo> list;
+ TQListViewItem *it = hostsList->firstChild();
for (int i = 0; i < hostsList->childCount(); i++)
{
KKnownHostInfo *host = new KKnownHostInfo();
@@ -654,7 +654,7 @@ QPtrList<KKnownHostInfo> KNetworkConf::getKnownHostsList(KListView * hostsList){
{
host->setIpAddress(it->text(0));
// host->setHostName(it->text(1));
- host->setAliases(QStringList::split(" ",it->text(1)));
+ host->setAliases(TQStringList::split(" ",it->text(1)));
it = it->nextSibling();
list.append(host);
}
@@ -662,16 +662,16 @@ QPtrList<KKnownHostInfo> KNetworkConf::getKnownHostsList(KListView * hostsList){
return list;
}
-QString KNetworkConf::getVersion(){
+TQString KNetworkConf::getVersion(){
return version;
}
-void KNetworkConf::setVersion(QString ver){
+void KNetworkConf::setVersion(TQString ver){
KNetworkConf::version = ver;
}
/** Changes the state of device 'dev' to DEVICE_UP or DEVICE_DOWN.
Return true on success, false on failure. */
-void KNetworkConf::changeDeviceState(const QString &dev, int state){
+void KNetworkConf::changeDeviceState(const TQString &dev, int state){
// If the text "Changing device state" is user visible it cannot be the
// name parameter to the constructor.
KInterfaceUpDownDlg* dialog = new KInterfaceUpDownDlg(this,"Changing device state");
@@ -684,12 +684,12 @@ void KNetworkConf::changeDeviceState(const QString &dev, int state){
dialog->setModal(true);
dialog->show();
- procDeviceState = new QProcess(this);
- QString cmd;
+ procDeviceState = new TQProcess(this);
+ TQString cmd;
procDeviceState->addArgument( locate("data",BACKEND_PATH) );
//If the platform couldn't be autodetected specify it manually
- if (netInfo->getPlatformName() != QString::null)
+ if (netInfo->getPlatformName() != TQString::null)
{
procDeviceState->addArgument( "--platform" );
procDeviceState->addArgument( netInfo->getPlatformName() );
@@ -701,10 +701,10 @@ void KNetworkConf::changeDeviceState(const QString &dev, int state){
else if (state == DEVICE_DOWN)
procDeviceState->addArgument("enable_iface::"+dev+"::0" );
- connect( procDeviceState, SIGNAL(readyReadStdout()),this, SLOT(readFromStdoutUpDown()) );
- connect( procDeviceState, SIGNAL(readyReadStderr()),this, SLOT(readFromStdErrUpDown()) );
- connect( procDeviceState, SIGNAL(processExited()),this, SLOT(verifyDeviceStateChanged()) );
- connect( procDeviceState, SIGNAL(processExited()), dialog, SLOT(close()) );
+ connect( procDeviceState, TQT_SIGNAL(readyReadStdout()),this, TQT_SLOT(readFromStdoutUpDown()) );
+ connect( procDeviceState, TQT_SIGNAL(readyReadStderr()),this, TQT_SLOT(readFromStdErrUpDown()) );
+ connect( procDeviceState, TQT_SIGNAL(processExited()),this, TQT_SLOT(verifyDeviceStateChanged()) );
+ connect( procDeviceState, TQT_SIGNAL(processExited()), dialog, TQT_SLOT(close()) );
currentDevice = dev;
commandOutput = "";
@@ -725,10 +725,10 @@ void KNetworkConf::readFromStdoutUpDown(){
void KNetworkConf::verifyDeviceStateChanged(){
KNetworkInterface *dev;
- QPixmap activeEthernetDeviceImg(BarIcon("network_connected_lan_knc"));
- QPixmap inactiveEthernetDeviceImg(BarIcon("network_disconnected_lan"));
- QPixmap activeWirelessDeviceImg(BarIcon("network_traffic_wlan"));
- QPixmap inactiveWirelessDeviceImg(BarIcon("network_disconnected_wlan"));
+ TQPixmap activeEthernetDeviceImg(BarIcon("network_connected_lan_knc"));
+ TQPixmap inactiveEthernetDeviceImg(BarIcon("network_disconnected_lan"));
+ TQPixmap activeWirelessDeviceImg(BarIcon("network_traffic_wlan"));
+ TQPixmap inactiveWirelessDeviceImg(BarIcon("network_disconnected_wlan"));
commandOutput = commandOutput.section('\n',1);
if (commandErrOutput.length() > 0)
@@ -740,7 +740,7 @@ void KNetworkConf::verifyDeviceStateChanged(){
}
else if (commandOutput == "\n<!-- GST: end of request -->")
{
- QListViewItem *item = klvCardList->findItem(currentDevice,0,ExactMatch);
+ TQListViewItem *item = klvCardList->findItem(currentDevice,0,ExactMatch);
if (item != NULL)
{
dev = getDeviceInfo(currentDevice);
@@ -776,10 +776,10 @@ void KNetworkConf::verifyDeviceStateChanged(){
}
}
/** Returns a list of strings of all the configured devices. */
-QStringList KNetworkConf::getDeviceList(){
- QStringList list;
+TQStringList KNetworkConf::getDeviceList(){
+ TQStringList list;
KNetworkInterface * device;
- QPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
+ TQPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
for (device = deviceList.first(); device; device = deviceList.next())
{
list.append(device->getDeviceName());
@@ -788,13 +788,13 @@ QStringList KNetworkConf::getDeviceList(){
}
/** No descriptions */
bool KNetworkConf::valuesChanged(KNetworkInterface *dev,
- QString bootProto,
- QString netmask,
- QString ipAddr,
- QString gateway,
+ TQString bootProto,
+ TQString netmask,
+ TQString ipAddr,
+ TQString gateway,
bool onBoot,
- QString desc,
- QString broadcast){
+ TQString desc,
+ TQString broadcast){
if ((dev->getBootProto() != bootProto) ||
(dev->getNetmask() != netmask) ||
(dev->getIpAddress() != ipAddr) ||
@@ -808,7 +808,7 @@ bool KNetworkConf::valuesChanged(KNetworkInterface *dev,
return false;
}
-/** Sets the QPushButton::autoResize() in true for all buttons. */
+/** Sets the TQPushButton::autoResize() in true for all buttons. */
void KNetworkConf::makeButtonsResizeable(){
kpbConfigureNetworkInterface->setAutoResize(true);
kcbGwDevice->setAutoResize(true);
@@ -864,13 +864,13 @@ void KNetworkConf::disableInterfaceSlot()
void KNetworkConf::addKnownHostSlot(){
KAddKnownHostDlg dlg(this,0);
dlg.setCaption(i18n("Add New Static Host"));
- QString aliases;
+ TQString aliases;
dlg.exec();
if (!dlg.kleIpAddress->text().isEmpty() && dlg.klbAliases->firstItem() > 0 )
{
- QListViewItem * item = new QListViewItem( klvKnownHosts, 0 );
+ TQListViewItem * item = new TQListViewItem( klvKnownHosts, 0 );
item->setText(0,dlg.kleIpAddress->text());
@@ -897,23 +897,23 @@ void KNetworkConf::editKnownHostSlot()
{
KAddKnownHostDlg dlg(this,0);
dlg.setCaption(i18n("Edit Static Host"));
- QListViewItem *item = klvKnownHosts->currentItem();
+ TQListViewItem *item = klvKnownHosts->currentItem();
dlg.kleIpAddress->setText(item->text(0));
- QStringList aliases = QStringList::split( " ", item->text(1) );
+ TQStringList aliases = TQStringList::split( " ", item->text(1) );
int n = 0;
- for ( QStringList::Iterator it = aliases.begin(); it != aliases.end(); ++it, ++n )
+ for ( TQStringList::Iterator it = aliases.begin(); it != aliases.end(); ++it, ++n )
{
- QString alias = *it;
+ TQString alias = *it;
dlg.klbAliases->insertItem(alias,n);
}
dlg.exec();
- QString _aliases;
+ TQString _aliases;
if (!dlg.kleIpAddress->text().isEmpty() && dlg.klbAliases->firstItem() > 0 )
{
- QListViewItem * item = klvKnownHosts->currentItem();
+ TQListViewItem * item = klvKnownHosts->currentItem();
item->setText(0,dlg.kleIpAddress->text());
@@ -937,23 +937,23 @@ void KNetworkConf::readFromStdErrUpDown()
commandErrOutput.append(procDeviceState->readStderr());
}
/** Sees if a device is active or not in the ifconfig output. Not very nice, but it works. Inthe future, this has to be managed by gst. */
-bool KNetworkConf::isDeviceActive(const QString &device, const QString &ifconfigOutput){
- QString temp = ifconfigOutput.section(device,1,1);
+bool KNetworkConf::isDeviceActive(const TQString &device, const TQString &ifconfigOutput){
+ TQString temp = ifconfigOutput.section(device,1,1);
if (temp.isEmpty())
return false;
else
{
- QString temp2 = temp.section("UP",0,0); //two firts lines of the device info.
- QString temp3 = temp2.section("\n",0,0); //Link encap:Ethernet HWaddr 00:00:21:C5:99:A0
- QString temp4 = temp2.section("\n",1,1); //inet addr:192.168.1.1 Bcast:192.255.255.255 Mask:255.0.0.0
+ TQString temp2 = temp.section("UP",0,0); //two firts lines of the device info.
+ TQString temp3 = temp2.section("\n",0,0); //Link encap:Ethernet HWaddr 00:00:21:C5:99:A0
+ TQString temp4 = temp2.section("\n",1,1); //inet addr:192.168.1.1 Bcast:192.255.255.255 Mask:255.0.0.0
temp3 = temp3.stripWhiteSpace();
temp4 = temp4.stripWhiteSpace();
- QString temp5 = temp3.section(" ",4,4); //00:00:21:C5:99:A0
- QString temp6 = temp4.section(" ",1,1); // addr:192.168.1.1
+ TQString temp5 = temp3.section(" ",4,4); //00:00:21:C5:99:A0
+ TQString temp6 = temp4.section(" ",1,1); // addr:192.168.1.1
temp6 = temp6.section(":",1,1); //192.168.1.1
- QString temp7 = temp4.section(" ",3,3); //Bcast:192.255.255.255
+ TQString temp7 = temp4.section(" ",3,3); //Bcast:192.255.255.255
temp7 = temp7.section(":",1,1); //192.255.255.255
- QString temp8 = temp4.section(" ",5,5); // Mask:255.0.0.0
+ TQString temp8 = temp4.section(" ",5,5); // Mask:255.0.0.0
temp8 = temp8.section(":",1,1); //255.0.0.0
//If the ip address is empty it must be a dhcp interface, so fill these fields:
@@ -977,14 +977,14 @@ void KNetworkConf::setReadOnlySlot(bool state)
}
/*Shows a context menu when right-clicking in the interface list*/
-void KNetworkConf::showInterfaceContextMenuSlot(KListView* lv, QListViewItem* lvi, const QPoint& pt)
+void KNetworkConf::showInterfaceContextMenuSlot(KListView* lv, TQListViewItem* lvi, const TQPoint& pt)
{
KPopupMenu *context = new KPopupMenu( this );
Q_CHECK_PTR( context );
- context->insertItem( "&Enable Interface", this, SLOT(enableInterfaceSlot()));
- context->insertItem( "&Disable Interface", this, SLOT(disableInterfaceSlot()));
- QListViewItem *item = klvCardList->currentItem();
- QString currentDevice = item->text(0);
+ context->insertItem( "&Enable Interface", this, TQT_SLOT(enableInterfaceSlot()));
+ context->insertItem( "&Disable Interface", this, TQT_SLOT(disableInterfaceSlot()));
+ TQListViewItem *item = klvCardList->currentItem();
+ TQString currentDevice = item->text(0);
KNetworkInterface *dev = getDeviceInfo(currentDevice);
if (dev->isActive())
@@ -998,27 +998,27 @@ void KNetworkConf::showInterfaceContextMenuSlot(KListView* lv, QListViewItem* lv
context->setItemEnabled(1,false);
}
context->insertSeparator(2);
- context->insertItem( "&Configure Interface...", this, SLOT(configureDeviceSlot()));
+ context->insertItem( "&Configure Interface...", this, TQT_SLOT(configureDeviceSlot()));
context->popup(pt);
- //context->insertItem( "About &Qt", this, SLOT(aboutQt()) );
+ //context->insertItem( "About &Qt", this, TQT_SLOT(aboutQt()) );
}
void KNetworkConf::enableSignals()
{
tooltip->setProfiles(netInfo->getProfilesList());
- connect(kleDefaultRoute,SIGNAL(textChanged(const QString&)),this,SLOT(enableApplyButtonSlot(const QString&)));
- connect(kleDomainName,SIGNAL(textChanged(const QString&)),this,SLOT(enableApplyButtonSlot(const QString&)));
- connect(kleHostName,SIGNAL(textChanged(const QString&)),this,SLOT(enableApplyButtonSlot(const QString&)));
+ connect(kleDefaultRoute,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(enableApplyButtonSlot(const TQString&)));
+ connect(kleDomainName,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(enableApplyButtonSlot(const TQString&)));
+ connect(kleHostName,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(enableApplyButtonSlot(const TQString&)));
}
void KNetworkConf::enableProfileSlot()
{
//Get selected profile
- QListViewItem *item = klvProfilesList->currentItem();
+ TQListViewItem *item = klvProfilesList->currentItem();
if (item != NULL)
{
- QString selectedProfile = item->text(0);
+ TQString selectedProfile = item->text(0);
//And search for it in the profiles list
KNetworkInfo *profile = getProfile(netInfo->getProfilesList(),selectedProfile);
@@ -1027,7 +1027,7 @@ void KNetworkConf::enableProfileSlot()
profile->setProfilesList(netInfo->getProfilesList());
config->saveNetworkInfo(profile);
modified = false;
- //connect( config, SIGNAL(readyLoadingNetworkInfo()), this, SLOT(showSelectedProfile(selectedProfile)) );
+ //connect( config, TQT_SIGNAL(readyLoadingNetworkInfo()), this, TQT_SLOT(showSelectedProfile(selectedProfile)) );
}
else
KMessageBox::error(this,
@@ -1036,9 +1036,9 @@ void KNetworkConf::enableProfileSlot()
}
}
-KNetworkInfo *KNetworkConf::getProfile(QPtrList<KNetworkInfo> profilesList, QString selectedProfile)
+KNetworkInfo *KNetworkConf::getProfile(TQPtrList<KNetworkInfo> profilesList, TQString selectedProfile)
{
- QPtrListIterator<KNetworkInfo> it(profilesList);
+ TQPtrListIterator<KNetworkInfo> it(profilesList);
KNetworkInfo *net = NULL;
while ((net = it.current()) != 0)
@@ -1055,19 +1055,19 @@ void KNetworkConf::createProfileSlot()
if (!netInfo)
return;
bool ok;
- QString newProfileName = KInputDialog::getText(i18n("Create New Network Profile"),
+ TQString newProfileName = KInputDialog::getText(i18n("Create New Network Profile"),
i18n("Name of new profile:"),
- QString::null, &ok, this );
+ TQString::null, &ok, this );
if ( ok && !newProfileName.isEmpty() )
{
- QPtrList<KNetworkInfo> profiles = netInfo->getProfilesList();
+ TQPtrList<KNetworkInfo> profiles = netInfo->getProfilesList();
KNetworkInfo *currentProfile = getProfile(profiles,newProfileName);
KNetworkInfo *newProfile = new KNetworkInfo();
//If there isn't a profile with the new name we add it to the list.
if (currentProfile == NULL)
{
- QListViewItem *newItem = new QListViewItem( klvProfilesList,newProfileName);
+ TQListViewItem *newItem = new TQListViewItem( klvProfilesList,newProfileName);
//memcpy(newProfile,netInfo,sizeof(netInfo) + sizeof(KRoutingInfo) + sizeof(KDNSInfo));
//Is there a better way to copy an object? the above memcpy doesn't do the trick
@@ -1091,9 +1091,9 @@ void KNetworkConf::createProfileSlot()
}
-/*void KNetworkConf::updateProfileNameSlot(QListViewItem *item)
+/*void KNetworkConf::updateProfileNameSlot(TQListViewItem *item)
{
- QString newName = item->text(0);
+ TQString newName = item->text(0);
if (newName.isEmpty())
KMessageBox::error(this,
@@ -1116,20 +1116,20 @@ void KNetworkConf::createProfileSlot()
void KNetworkConf::removeProfileSlot()
{
- QListViewItem *item= klvProfilesList->selectedItem();
+ TQListViewItem *item= klvProfilesList->selectedItem();
if (item != NULL)
{
/* if (KMessageBox::warningContinueCancel(this,
i18n("Are you sure you want to delete the selected network profile?"),
i18n("Delete Profile"),KStdGuiItem::del()) == KMessageBox::Continue)*/
{
- QString selectedProfile = item->text(0);
- QPtrList<KNetworkInfo> profiles = netInfo->getProfilesList();
+ TQString selectedProfile = item->text(0);
+ TQPtrList<KNetworkInfo> profiles = netInfo->getProfilesList();
KNetworkInfo *profileToDelete = NULL;
for ( profileToDelete = profiles.first(); profileToDelete; profileToDelete = profiles.next() )
{
- QString profileName = profileToDelete->getProfileName();
+ TQString profileName = profileToDelete->getProfileName();
if (profileName == selectedProfile)
{
profiles.remove(profileToDelete);
@@ -1146,17 +1146,17 @@ void KNetworkConf::removeProfileSlot()
void KNetworkConf::updateProfileSlot()
{
- QListViewItem *item= klvProfilesList->selectedItem();
+ TQListViewItem *item= klvProfilesList->selectedItem();
if (item != NULL)
{
- QString selectedProfile = item->text(0);
- QPtrList<KNetworkInfo> profiles = netInfo->getProfilesList();
+ TQString selectedProfile = item->text(0);
+ TQPtrList<KNetworkInfo> profiles = netInfo->getProfilesList();
KNetworkInfo *profileToUpdate = NULL;
KNetworkInfo *newProfile = new KNetworkInfo();
for ( profileToUpdate = profiles.first(); profileToUpdate; profileToUpdate = profiles.next() )
{
- QString profileName = profileToUpdate->getProfileName();
+ TQString profileName = profileToUpdate->getProfileName();
if (profileName == selectedProfile)
{
qDebug("profile updated");