diff options
Diffstat (limited to 'src/netparams.h')
-rw-r--r-- | src/netparams.h | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/src/netparams.h b/src/netparams.h index 3ec8352..91335a9 100644 --- a/src/netparams.h +++ b/src/netparams.h @@ -22,42 +22,42 @@ #define WA_NETPARAMS_H #include <iostream> -#include <qfile.h> +#include <tqfile.h> #include <kmessagebox.h> #include <klocale.h> class WANetParams { public: - QString iface; - QString essid; - //QString mode; - QString channel; - QString ap; + TQString iface; + TQString essid; + //TQString mode; + TQString channel; + TQString ap; bool wep; - QString wepMode; - QString wepKey; + TQString wepMode; + TQString wepKey; bool wpa; - QStringList wpaSettings; - QString wpaKey; + TQStringList wpaSettings; + TQString wpaKey; bool dhcp; - QString ip; - QString netmask; - QString broadcast; - QString gateway; - QString domain; - QString dns1; - QString dns2; + TQString ip; + TQString nettqmask; + TQString broadcast; + TQString gateway; + TQString domain; + TQString dns1; + TQString dns2; bool hiddenEssid; bool wasHiddenEssid; bool wasWep; - QString preConnectionCommand; - QString postConnectionCommand; - QString preDisconnectionCommand; - QString postDisconnectionCommand; + TQString preConnectionCommand; + TQString postConnectionCommand; + TQString preDisconnectionCommand; + TQString postDisconnectionCommand; int preConnectionTimeout; int postConnectionTimeout; int preDisconnectionTimeout; @@ -79,7 +79,7 @@ public: r = true; } if ( (hiddenEssid) && (!wasHiddenEssid) ) - if ( KMessageBox::questionYesNo(0, i18n("<qt><p>The network has stopped broadcasting its ESSID since the last time you were connected.</p><p>Would you like to use '<b>%1</b>' as an ESSID for this network?</p><p><i>NOTE: If you answer No, a dialog will appear where you will be able to specify a different ESSID.</i></p></qt>").arg(essid) ) != 3 ) // !=YES + if ( KMessageBox::questionYesNo(0, i18n("<qt><p>The network has stopped broadcasting its ESSID since the last time you were connected.</p><p>Would you like to use '<b>%1</b>' as an ESSID for this network?</p><p><i>NOTE: If you answer No, a dialog will appear where you will be able to specify a different ESSID.</i></p></qt>").tqarg(essid) ) != 3 ) // !=YES r = true; wasHiddenEssid = hiddenEssid; @@ -87,19 +87,19 @@ public: return r; } - QString netParamsString() + TQString netParamsString() { - QStringList mNPS; - mNPS << boolToString(hiddenEssid) << essid << ap << channel << boolToString(wep) << wepMode << wepKey << boolToString(dhcp) << ip << netmask << broadcast << gateway << domain << dns1 << dns2 << boolToString(wasHiddenEssid) << boolToString(wasWep) << \ - preConnectionCommand << QString::number(preConnectionTimeout) << boolToString(preConnectionDetached) << \ - postConnectionCommand << QString::number(postConnectionTimeout) << boolToString(postConnectionDetached) << \ - preDisconnectionCommand << QString::number(preDisconnectionTimeout) << boolToString(preDisconnectionDetached) << \ - postDisconnectionCommand << QString::number(postDisconnectionTimeout) << boolToString(postDisconnectionDetached) << \ + TQStringList mNPS; + mNPS << boolToString(hiddenEssid) << essid << ap << channel << boolToString(wep) << wepMode << wepKey << boolToString(dhcp) << ip << nettqmask << broadcast << gateway << domain << dns1 << dns2 << boolToString(wasHiddenEssid) << boolToString(wasWep) << \ + preConnectionCommand << TQString::number(preConnectionTimeout) << boolToString(preConnectionDetached) << \ + postConnectionCommand << TQString::number(postConnectionTimeout) << boolToString(postConnectionDetached) << \ + preDisconnectionCommand << TQString::number(preDisconnectionTimeout) << boolToString(preDisconnectionDetached) << \ + postDisconnectionCommand << TQString::number(postDisconnectionTimeout) << boolToString(postDisconnectionDetached) << \ wpaSettings.join(",") << wpaKey; return mNPS.join(","); } - void loadNetParamsString( const QString & nps ) + void loadNetParamsString( const TQString & nps ) { /*if (nps.section(",",0,0)=="true") hiddenEssid=true; @@ -116,7 +116,7 @@ public: wepKey = nps.section(",",6,6); dhcp = ( nps.section(",",7,7) == "true" ); ip = nps.section(",",8,8); - netmask = nps.section(",",9,9); + nettqmask = nps.section(",",9,9); broadcast = nps.section(",",10,10); gateway = nps.section(",",11,11); domain = nps.section(",",12,12); @@ -140,14 +140,14 @@ public: postDisconnectionCommand = nps.section(",",26,26); postDisconnectionTimeout = nps.section(",",27,27).toInt(); postDisconnectionDetached = ( nps.section(",",28,28) == "true" ); - wpaSettings = QStringList::split( ",", nps.section(",",29,32) ); // 4 fields + wpaSettings = TQStringList::split( ",", nps.section(",",29,32) ); // 4 fields wpaKey = nps.section(",",33,33); } private: - QString boolToString( bool b ) + TQString boolToString( bool b ) { - QString result; + TQString result; b ? result = "true" : result = "false"; return result; } @@ -157,11 +157,11 @@ class WACommands { public: bool allFound; - QStringList notFound; + TQStringList notFound; void init() { - QStringList binDirs; + TQStringList binDirs; binDirs << "/sbin" << "/usr/sbin" << "/usr/local/sbin" << "/bin" << "/usr/bin" << "/usr/local/bin"; wpa_supplicant = getPath("wpa_supplicant", binDirs); @@ -187,9 +187,9 @@ public: std::cout << "All executables found." << std::endl; } - QStringList cmd( const QString & action, const WANetParams & np, const bool & quiet = false ) + TQStringList cmd( const TQString & action, const WANetParams & np, const bool & quiet = false ) { - QStringList mCmd; + TQStringList mCmd; /*if (action=="ifup") mCmd << ifconfig << np.iface << "up"; @@ -234,8 +234,8 @@ public: } else if (action=="ifconfig_manual") { mCmd << ifconfig << np.iface << np.ip; - if (!np.netmask.isEmpty()) - mCmd << "netmask" << np.netmask; + if (!np.nettqmask.isEmpty()) + mCmd << "nettqmask" << np.nettqmask; if (!np.broadcast.isEmpty()) mCmd << "broadcast" << np.broadcast; @@ -250,31 +250,31 @@ public: } else std::cout << "Unknown action: " << action << std::endl; - if ( (!mCmd.isEmpty()) && (!quiet) ) {//mCmd = QStringList(); - QString mCmdString = mCmd.join(" "); - if (!np.wepKey.isEmpty()) mCmdString.replace(np.wepKey, "xxxxxxxxxx"); + if ( (!mCmd.isEmpty()) && (!quiet) ) {//mCmd = TQStringList(); + TQString mCmdString = mCmd.join(" "); + if (!np.wepKey.isEmpty()) mCmdString.tqreplace(np.wepKey, "xxxxxxxxxx"); std::cout << action << ": " << mCmdString << std::endl; } return mCmd; } - QString route; - QString dhcpClient; - QString wpa_supplicant; - QString wpa_cli; + TQString route; + TQString dhcpClient; + TQString wpa_supplicant; + TQString wpa_cli; private: - QString ifconfig; - QString iwconfig; - QString iwlist; - QString dhcp; - QString pidof; + TQString ifconfig; + TQString iwconfig; + TQString iwlist; + TQString dhcp; + TQString pidof; - QString getPath(QString file, QStringList dirs) + TQString getPath(TQString file, TQStringList dirs) { - QString s; - for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); it++ ) { - if (QFile( QString(*it+"/"+file) ).exists()) { - s = QString(*it+"/"+file); + TQString s; + for ( TQStringList::Iterator it = dirs.begin(); it != dirs.end(); it++ ) { + if (TQFile( TQString(*it+"/"+file) ).exists()) { + s = TQString(*it+"/"+file); break; } } |