From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- lanbrowsing/kcmlisa/kcmlisa.cpp | 182 ++++++++++++++++++++-------------------- 1 file changed, 91 insertions(+), 91 deletions(-) (limited to 'lanbrowsing/kcmlisa/kcmlisa.cpp') diff --git a/lanbrowsing/kcmlisa/kcmlisa.cpp b/lanbrowsing/kcmlisa/kcmlisa.cpp index ee415462..7819b217 100644 --- a/lanbrowsing/kcmlisa/kcmlisa.cpp +++ b/lanbrowsing/kcmlisa/kcmlisa.cpp @@ -29,13 +29,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -48,140 +48,140 @@ #include -LisaSettings::LisaSettings(const QString& config, QWidget *parent) +LisaSettings::LisaSettings(const TQString& config, TQWidget *parent) : KCModule(parent, "kcmlanbrowser") ,m_config(config,false,true) ,m_wizard(0) ,m_configFilename(config) ,m_changed(false) { - QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); layout->setAutoAdd(true); - QWidget *dummy(0); + TQWidget *dummy(0); - QVButtonGroup *gb=new QVButtonGroup(i18n("Tell LISa Daemon How to Search for Hosts"),this); + TQVButtonGroup *gb=new TQVButtonGroup(i18n("Tell LISa Daemon How to Search for Hosts"),this); gb->setInsideSpacing(10); - m_useNmblookup=new QCheckBox(i18n("Send &NetBIOS broadcasts using nmblookup"), gb); - QToolTip::add(m_useNmblookup,i18n("Only hosts running SMB servers will answer")); + m_useNmblookup=new TQCheckBox(i18n("Send &NetBIOS broadcasts using nmblookup"), gb); + TQToolTip::add(m_useNmblookup,i18n("Only hosts running SMB servers will answer")); - m_sendPings=new QCheckBox(i18n("Send &pings (ICMP echo packets)"), gb); - QToolTip::add(m_sendPings,i18n("All hosts running TCP/IP will answer")); + m_sendPings=new TQCheckBox(i18n("Send &pings (ICMP echo packets)"), gb); + TQToolTip::add(m_sendPings,i18n("All hosts running TCP/IP will answer")); - QHBox *hbox=new QHBox(gb); + TQHBox *hbox=new TQHBox(gb); hbox->setSpacing(10); - dummy=new QWidget(hbox); + dummy=new TQWidget(hbox); dummy->setMinimumWidth(10); - QLabel *label=new QLabel(i18n("To these &IP addresses:"),hbox); - QString comment = i18n("Enter all ranges to scan, using the format '192.168.0.1/255.255.255.0;10.0.0.1;255.0.0.0'"); - QToolTip::add(label,comment); + TQLabel *label=new TQLabel(i18n("To these &IP addresses:"),hbox); + TQString comment = i18n("Enter all ranges to scan, using the format '192.168.0.1/255.255.255.0;10.0.0.1;255.0.0.0'"); + TQToolTip::add(label,comment); m_pingAddresses=new KRestrictedLine(hbox,"a","0123456789.-/;"); - QToolTip::add(m_pingAddresses, comment); + TQToolTip::add(m_pingAddresses, comment); label->setBuddy(m_pingAddresses); - QGrid *addressesGrid = new QGrid(2, Qt::Horizontal, this); + TQGrid *addressesGrid = new TQGrid(2, Qt::Horizontal, this); addressesGrid->setSpacing(10); layout->setStretchFactor(addressesGrid,0); - label=new QLabel(i18n("&Broadcast network address:"),addressesGrid); + label=new TQLabel(i18n("&Broadcast network address:"),addressesGrid); comment=i18n("Your network address/subnet mask (e.g. 192.168.0.0/255.255.255.0;)"); - QToolTip::add(label, comment); + TQToolTip::add(label, comment); m_broadcastNetwork=new KRestrictedLine(addressesGrid,"a","0123456789./;"); - QToolTip::add(m_broadcastNetwork,comment); + TQToolTip::add(m_broadcastNetwork,comment); label->setBuddy(m_broadcastNetwork); - label=new QLabel(i18n("&Trusted IP addresses:"),addressesGrid); + label=new TQLabel(i18n("&Trusted IP addresses:"),addressesGrid); comment = i18n("Usually your network address/subnet mask (e.g. 192.168.0.0/255.255.255.0;)"); - QToolTip::add(label, comment); + TQToolTip::add(label, comment); m_allowedAddresses=new KRestrictedLine(addressesGrid,"a","0123456789./;"); - QToolTip::add(m_allowedAddresses, comment); + TQToolTip::add(m_allowedAddresses, comment); label->setBuddy(m_allowedAddresses); - dummy=new QWidget(this); + dummy=new TQWidget(this); layout->setStretchFactor(dummy,10); - hbox = new QHBox(this); + hbox = new TQHBox(this); hbox->setSpacing(10); -// m_autoSetup=new QPushButton(i18n("&Guided LISa Setup..."),hbox); - m_autoSetup=new QPushButton(i18n("Setup Wizard..."),hbox); +// m_autoSetup=new TQPushButton(i18n("&Guided LISa Setup..."),hbox); + m_autoSetup=new TQPushButton(i18n("Setup Wizard..."),hbox); m_autoSetup->setFixedWidth( m_autoSetup->sizeHint().width() ); - m_suggestSettings=new QPushButton(i18n("&Suggest Settings"),hbox); + m_suggestSettings=new TQPushButton(i18n("&Suggest Settings"),hbox); - new QWidget(hbox); + new TQWidget(hbox); - m_advancedSettingsButton=new QPushButton(i18n("Ad&vanced Settings..."),hbox); + m_advancedSettingsButton=new TQPushButton(i18n("Ad&vanced Settings..."),hbox); m_lisaAdvancedDlg=new KDialogBase(0,0,true,i18n("Advanced Settings for LISa"),KDialogBase::Close, KDialogBase::Close); - connect(m_advancedSettingsButton,SIGNAL(clicked()),m_lisaAdvancedDlg,SLOT(show())); + connect(m_advancedSettingsButton,TQT_SIGNAL(clicked()),m_lisaAdvancedDlg,TQT_SLOT(show())); - QVBox *vbox=m_lisaAdvancedDlg->makeVBoxMainWidget(); + TQVBox *vbox=m_lisaAdvancedDlg->makeVBoxMainWidget(); m_pingNames=new KEditListBox(i18n("&Additionally Check These Hosts"),vbox,"a",false, KEditListBox::Add|KEditListBox::Remove); m_pingNames->setMinimumHeight(180); - QToolTip::add(m_pingNames,i18n("The hosts listed here will be pinged")); + TQToolTip::add(m_pingNames,i18n("The hosts listed here will be pinged")); - dummy=new QWidget(vbox); + dummy=new TQWidget(vbox); dummy->setMinimumHeight(10); - m_deliverUnnamedHosts=new QCheckBox(i18n("Show &hosts without DNS names"),vbox); + m_deliverUnnamedHosts=new TQCheckBox(i18n("Show &hosts without DNS names"),vbox); - QGrid *advGrid = new QGrid(2, Qt::Horizontal, vbox); + TQGrid *advGrid = new TQGrid(2, Qt::Horizontal, vbox); advGrid->setSpacing(10); - label=new QLabel(i18n("Host list update interval:"),advGrid); - QToolTip::add(label,i18n("Search hosts after this number of seconds")); - m_updatePeriod=new QSpinBox(30,1800,10,advGrid); + label=new TQLabel(i18n("Host list update interval:"),advGrid); + TQToolTip::add(label,i18n("Search hosts after this number of seconds")); + m_updatePeriod=new TQSpinBox(30,1800,10,advGrid); m_updatePeriod->setSuffix(i18n(" sec")); - QToolTip::add(m_updatePeriod,i18n("Search hosts after this number of seconds")); + TQToolTip::add(m_updatePeriod,i18n("Search hosts after this number of seconds")); - m_secondScan=new QCheckBox(i18n("Always check twice for hosts when searching"),advGrid); - new QWidget(advGrid); + m_secondScan=new TQCheckBox(i18n("Always check twice for hosts when searching"),advGrid); + new TQWidget(advGrid); - label=new QLabel(i18n("Wait for replies from hosts after first scan:"),advGrid); - QToolTip::add(label,i18n("How long to wait for replies to the ICMP echo requests from hosts")); - m_firstWait=new QSpinBox(10,1000,50,advGrid); + label=new TQLabel(i18n("Wait for replies from hosts after first scan:"),advGrid); + TQToolTip::add(label,i18n("How long to wait for replies to the ICMP echo requests from hosts")); + m_firstWait=new TQSpinBox(10,1000,50,advGrid); m_firstWait->setSuffix(i18n(" ms")); - QToolTip::add(m_firstWait,i18n("How long to wait for replies to the ICMP echo requests from hosts")); + TQToolTip::add(m_firstWait,i18n("How long to wait for replies to the ICMP echo requests from hosts")); - label=new QLabel(i18n("Wait for replies from hosts after second scan:"),advGrid); - QToolTip::add(label,i18n("How long to wait for replies to the ICMP echo requests from hosts")); - m_secondWait=new QSpinBox(0,1000,50,advGrid); + label=new TQLabel(i18n("Wait for replies from hosts after second scan:"),advGrid); + TQToolTip::add(label,i18n("How long to wait for replies to the ICMP echo requests from hosts")); + m_secondWait=new TQSpinBox(0,1000,50,advGrid); m_secondWait->setSuffix(i18n(" ms")); - QToolTip::add(m_secondWait,i18n("How long to wait for replies to the ICMP echo requests from hosts")); + TQToolTip::add(m_secondWait,i18n("How long to wait for replies to the ICMP echo requests from hosts")); - label=new QLabel(i18n("Max. number of ping packets to send at once:"),advGrid); - m_maxPingsAtOnce=new QSpinBox(8,1024,5,advGrid); + label=new TQLabel(i18n("Max. number of ping packets to send at once:"),advGrid); + m_maxPingsAtOnce=new TQSpinBox(8,1024,5,advGrid); - dummy=new QWidget(advGrid); + dummy=new TQWidget(advGrid); dummy->setMinimumHeight(10); - connect(m_secondScan,SIGNAL(toggled(bool)),m_secondWait,SLOT(setEnabled(bool))); - connect(m_sendPings,SIGNAL(toggled(bool)),m_pingAddresses,SLOT(setEnabled(bool))); - - connect(m_pingAddresses,SIGNAL(textChanged(const QString&)),this,SIGNAL(changed())); - connect(m_allowedAddresses,SIGNAL(textChanged(const QString&)),this,SIGNAL(changed())); - connect(m_broadcastNetwork,SIGNAL(textChanged(const QString&)),this,SIGNAL(changed())); - - connect(m_pingAddresses,SIGNAL(returnPressed()),this,SIGNAL(changed())); - connect(m_allowedAddresses,SIGNAL(returnPressed()),this,SIGNAL(changed())); - connect(m_broadcastNetwork,SIGNAL(returnPressed()),this,SIGNAL(changed())); - - connect(m_sendPings,SIGNAL(toggled(bool)),this,SIGNAL(changed())); - connect(m_firstWait,SIGNAL(valueChanged(int)),this,SIGNAL(changed())); - connect(m_secondWait,SIGNAL(valueChanged(int)),this,SIGNAL(changed())); - connect(m_maxPingsAtOnce,SIGNAL(valueChanged(int)),this,SIGNAL(changed())); - connect(m_secondScan,SIGNAL(toggled(bool)),this,SIGNAL(changed())); - connect(m_deliverUnnamedHosts,SIGNAL(toggled(bool)),this,SIGNAL(changed())); - connect(m_updatePeriod,SIGNAL(valueChanged(int)),this,SIGNAL(changed())); - connect(m_pingNames,SIGNAL(changed()),this,SIGNAL(changed())); - connect(m_useNmblookup,SIGNAL(toggled(bool)),this,SIGNAL(changed())); - connect(m_autoSetup,SIGNAL(clicked()),this,SLOT(autoSetup())); - connect(m_suggestSettings,SIGNAL(clicked()),this,SLOT(suggestSettings())); - connect(this, SIGNAL(changed()), SLOT(slotChanged())); + connect(m_secondScan,TQT_SIGNAL(toggled(bool)),m_secondWait,TQT_SLOT(setEnabled(bool))); + connect(m_sendPings,TQT_SIGNAL(toggled(bool)),m_pingAddresses,TQT_SLOT(setEnabled(bool))); + + connect(m_pingAddresses,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SIGNAL(changed())); + connect(m_allowedAddresses,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SIGNAL(changed())); + connect(m_broadcastNetwork,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SIGNAL(changed())); + + connect(m_pingAddresses,TQT_SIGNAL(returnPressed()),this,TQT_SIGNAL(changed())); + connect(m_allowedAddresses,TQT_SIGNAL(returnPressed()),this,TQT_SIGNAL(changed())); + connect(m_broadcastNetwork,TQT_SIGNAL(returnPressed()),this,TQT_SIGNAL(changed())); + + connect(m_sendPings,TQT_SIGNAL(toggled(bool)),this,TQT_SIGNAL(changed())); + connect(m_firstWait,TQT_SIGNAL(valueChanged(int)),this,TQT_SIGNAL(changed())); + connect(m_secondWait,TQT_SIGNAL(valueChanged(int)),this,TQT_SIGNAL(changed())); + connect(m_maxPingsAtOnce,TQT_SIGNAL(valueChanged(int)),this,TQT_SIGNAL(changed())); + connect(m_secondScan,TQT_SIGNAL(toggled(bool)),this,TQT_SIGNAL(changed())); + connect(m_deliverUnnamedHosts,TQT_SIGNAL(toggled(bool)),this,TQT_SIGNAL(changed())); + connect(m_updatePeriod,TQT_SIGNAL(valueChanged(int)),this,TQT_SIGNAL(changed())); + connect(m_pingNames,TQT_SIGNAL(changed()),this,TQT_SIGNAL(changed())); + connect(m_useNmblookup,TQT_SIGNAL(toggled(bool)),this,TQT_SIGNAL(changed())); + connect(m_autoSetup,TQT_SIGNAL(clicked()),this,TQT_SLOT(autoSetup())); + connect(m_suggestSettings,TQT_SIGNAL(clicked()),this,TQT_SLOT(suggestSettings())); + connect(this, TQT_SIGNAL(changed()), TQT_SLOT(slotChanged())); } void LisaSettings::load() @@ -242,13 +242,13 @@ void LisaSettings::save() m_config.writeEntry("PingAddresses",m_sendPings->isChecked()?m_pingAddresses->text():""); m_config.writeEntry("AllowedAddresses",m_allowedAddresses->text()); m_config.writeEntry("BroadcastNetwork",m_broadcastNetwork->text()); - QStringList writeStuff; + TQStringList writeStuff; for (int i=0; icount(); i++) writeStuff.append(m_pingNames->text(i)); m_config.writeEntry("PingNames",writeStuff,';'); m_config.sync(); - chmod(QFile::encodeName(m_configFilename),S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); + chmod(TQFile::encodeName(m_configFilename),S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); } else { @@ -260,7 +260,7 @@ void LisaSettings::save() if (tmp.status() == 0 && tmp.textStream()) { m_tmpFilename = tmp.name(); - QTextStream &confStream = *(tmp.textStream()); + TQTextStream &confStream = *(tmp.textStream()); if (m_secondScan->isChecked()) confStream<<"SecondWait = "<<(m_secondWait->value()+5)/10<<"\n"; else @@ -282,15 +282,15 @@ void LisaSettings::save() confStream<<"PingAddresses = "<text().latin1()<<"\n"; confStream<<"AllowedAddresses = "<text().latin1()<<"\n"; confStream<<"BroadcastNetwork = "<text().latin1()<<"\n"; - QString writeStuff; + TQString writeStuff; for (int i=0; icount(); i++) writeStuff=writeStuff+m_pingNames->text(i).latin1()+";"; confStream<<"PingNames = "<count()>1) { - QString msg(i18n("You have more than one network interface installed.
" + TQString msg(i18n("You have more than one network interface installed.
" "Please make sure the suggested settings are correct.
" "
The following interfaces were found:

")); //not that easy to handle @@ -337,7 +337,7 @@ void LisaSettings::suggestSettings() { msg+=""+tmp->name+": "+tmp->addr+"/"+tmp->netmask+";
"; } - KMessageBox::information(0,QString("%1").arg(msg)); + KMessageBox::information(0,TQString("%1").arg(msg)); } emit changed(); @@ -353,7 +353,7 @@ void LisaSettings::autoSetup() m_wizard->clearAll(); int result=m_wizard->exec(); - if (result!=QDialog::Accepted) + if (result!=TQDialog::Accepted) return; m_pingAddresses->setText(lci.pingAddresses); @@ -375,7 +375,7 @@ void LisaSettings::autoSetup() void LisaSettings::saveDone(KProcess *proc) { - unlink(QFile::encodeName(m_tmpFilename)); + unlink(TQFile::encodeName(m_tmpFilename)); KApplication::restoreOverrideCursor(); setEnabled(true); KMessageBox::information(0,i18n("The configuration has been saved to /etc/lisarc.\n" -- cgit v1.2.1