summaryrefslogtreecommitdiff
path: root/noncore/settings
Unidiff
Diffstat (limited to 'noncore/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.cpp114
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp36
3 files changed, 92 insertions, 60 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp
index a62a90c..71d0cf5 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaces.cpp
@@ -13,6 +13,6 @@
13 * Constructor. Reads in the interfaces file and then split the file up by 13 * Constructor. Reads in the interfaces file and then split the file up by
14 * the \n for interfaces variable. 14 * the \n for interfaces variable.
15 * @param useInterfacesFile if an interface file other then the default is 15 * @param useInterfacesFile if an interface file other then the default is
16 * desired to be used it should be passed in. 16 * desired to be used it should be passed in.
17 */ 17 */
18Interfaces::Interfaces(QString useInterfacesFile){ 18Interfaces::Interfaces(QString useInterfacesFile){
@@ -21,3 +21,3 @@ Interfaces::Interfaces(QString useInterfacesFile){
21 acceptedFamily.append(INTERFACES_FAMILY_INET6); 21 acceptedFamily.append(INTERFACES_FAMILY_INET6);
22 22
23 interfacesFile = useInterfacesFile; 23 interfacesFile = useInterfacesFile;
@@ -38,3 +38,3 @@ Interfaces::Interfaces(QString useInterfacesFile){
38 interfaces = QStringList::split("\n", line, true); 38 interfaces = QStringList::split("\n", line, true);
39 39
40 currentIface = interfaces.end(); 40 currentIface = interfaces.end();
@@ -46,6 +46,6 @@ Interfaces::Interfaces(QString useInterfacesFile){
46 * Get a list of all interfaces in the interface file. Usefull for 46 * Get a list of all interfaces in the interface file. Usefull for
47 * hardware that is not currently connected such as an 802.11b card 47 * hardware that is not currently connected such as an 802.11b card
48 * not plugged in, but configured for when it is plugged in. 48 * not plugged in, but configured for when it is plugged in.
49 * @return Return string list of interfaces. 49 * @return Return string list of interfaces.
50 **/ 50 **/
51QStringList Interfaces::getInterfaceList(){ 51QStringList Interfaces::getInterfaceList(){
@@ -69,6 +69,6 @@ QStringList Interfaces::getInterfaceList(){
69 * Find out if interface is in an "auto" group or not. 69 * Find out if interface is in an "auto" group or not.
70 * Report any duplicates such as eth0 being in two differnt auto's 70 * Report any duplicates such as eth0 being in two differnt auto's
71 * @param interface interface to check to see if it is on or not. 71 * @param interface interface to check to see if it is on or not.
72 * @return true is interface is in auto 72 * @return true is interface is in auto
73 */ 73 */
74bool Interfaces::isAuto(const QString &interface) const { 74bool Interfaces::isAuto(const QString &interface) const {
@@ -86,3 +86,3 @@ bool Interfaces::isAuto(const QString &interface) const {
86 * @return false if already set to setAuto. 86 * @return false if already set to setAuto.
87 * */ 87 * */
88bool Interfaces::setAuto(const QString &interface, bool setAuto){ 88bool Interfaces::setAuto(const QString &interface, bool setAuto){
@@ -91,3 +91,3 @@ bool Interfaces::setAuto(const QString &interface, bool setAuto){
91 return false; 91 return false;
92 92
93 bool changed = false; 93 bool changed = false;
@@ -127,4 +127,4 @@ bool Interfaces::setAuto(const QString &interface, bool setAuto){
127 * removed from the interface name. 127 * removed from the interface name.
128 * @return bool true if it is successfull. 128 * @return bool true if it is successfull.
129 */ 129 */
130bool Interfaces::setInterface(QString interface){ 130bool Interfaces::setInterface(QString interface){
@@ -138,3 +138,3 @@ bool Interfaces::setInterface(QString interface){
138 * @return bool true if set, false otherwise. 138 * @return bool true if set, false otherwise.
139 */ 139 */
140bool Interfaces::isInterfaceSet() const { 140bool Interfaces::isInterfaceSet() const {
@@ -151,3 +151,3 @@ bool Interfaces::isInterfaceSet() const {
151 * @return true if successfull. 151 * @return true if successfull.
152 */ 152 */
153bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ 153bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){
@@ -166,3 +166,3 @@ bool Interfaces::addInterface(const QString &interface, const QString &family, c
166 * @return bool true if successfull 166 * @return bool true if successfull
167 */ 167 */
168bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ 168bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){
@@ -174,3 +174,3 @@ bool Interfaces::copyInterface(const QString &interface, const QString &newInter
174 it++; 174 it++;
175 175
176 // Add the new interface 176 // Add the new interface
@@ -180,6 +180,6 @@ bool Interfaces::copyInterface(const QString &interface, const QString &newInter
180 return false; 180 return false;
181 181
182 QStringList::Iterator newIface = currentIface; 182 QStringList::Iterator newIface = currentIface;
183 newIface++; 183 newIface++;
184 184
185 // Copy all of the lines 185 // Copy all of the lines
@@ -190,3 +190,3 @@ bool Interfaces::copyInterface(const QString &interface, const QString &newInter
190 } 190 }
191 191
192 return true; 192 return true;
@@ -197,3 +197,3 @@ bool Interfaces::copyInterface(const QString &interface, const QString &newInter
197 * @return bool if successfull or not. 197 * @return bool if successfull or not.
198 */ 198 */
199bool Interfaces::removeInterface(){ 199bool Interfaces::removeInterface(){
@@ -206,3 +206,3 @@ bool Interfaces::removeInterface(){
206 * @param error set to true if any error occurs, false otherwise. 206 * @param error set to true if any error occurs, false otherwise.
207 */ 207 */
208QString Interfaces::getInterfaceName(bool &error){ 208QString Interfaces::getInterfaceName(bool &error){
@@ -228,3 +228,3 @@ QString Interfaces::getInterfaceName(bool &error){
228 * @param error set to true if any error occurs, false otherwise. 228 * @param error set to true if any error occurs, false otherwise.
229 */ 229 */
230QString Interfaces::getInterfaceFamily(bool &error){ 230QString Interfaces::getInterfaceFamily(bool &error){
@@ -251,3 +251,3 @@ QString Interfaces::getInterfaceFamily(bool &error){
251 * @param error set to true if any error occurs, false otherwise. 251 * @param error set to true if any error occurs, false otherwise.
252 */ 252 */
253QString Interfaces::getInterfaceMethod(bool &error){ 253QString Interfaces::getInterfaceMethod(bool &error){
@@ -269,6 +269,6 @@ QString Interfaces::getInterfaceMethod(bool &error){
269/** 269/**
270 * Sets the interface name to newName. 270 * Sets the interface name to newName.
271 * @param newName the new name of the interface. All whitespace is removed. 271 * @param newName the new name of the interface. All whitespace is removed.
272 * @return bool true if successfull. 272 * @return bool true if successfull.
273 */ 273 */
274bool Interfaces::setInterfaceName(const QString &newName){ 274bool Interfaces::setInterfaceName(const QString &newName){
@@ -280,3 +280,3 @@ bool Interfaces::setInterfaceName(const QString &newName){
280 (*currentIface) = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); 280 (*currentIface) = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue));
281 return !returnValue; 281 return !returnValue;
282} 282}
@@ -284,3 +284,3 @@ bool Interfaces::setInterfaceName(const QString &newName){
284/** 284/**
285 * Sets the interface family to newName. 285 * Sets the interface family to newName.
286 * @param newName the new name of the interface. Must be one of the families 286 * @param newName the new name of the interface. Must be one of the families
@@ -288,3 +288,3 @@ bool Interfaces::setInterfaceName(const QString &newName){
288 * @return bool true if successfull. 288 * @return bool true if successfull.
289 */ 289 */
290bool Interfaces::setInterfaceFamily(const QString &newName){ 290bool Interfaces::setInterfaceFamily(const QString &newName){
@@ -296,3 +296,3 @@ bool Interfaces::setInterfaceFamily(const QString &newName){
296 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(newName).arg(getInterfaceMethod(returnValue)); 296 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(newName).arg(getInterfaceMethod(returnValue));
297 return !returnValue; 297 return !returnValue;
298} 298}
@@ -303,3 +303,3 @@ bool Interfaces::setInterfaceFamily(const QString &newName){
303 * @return bool true if successfull. 303 * @return bool true if successfull.
304 */ 304 */
305bool Interfaces::setInterfaceMethod(const QString &newName){ 305bool Interfaces::setInterfaceMethod(const QString &newName){
@@ -309,3 +309,3 @@ bool Interfaces::setInterfaceMethod(const QString &newName){
309 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(getInterfaceFamily(returnValue)).arg(newName); 309 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(getInterfaceFamily(returnValue)).arg(newName);
310 return !returnValue; 310 return !returnValue;
311} 311}
@@ -321,3 +321,3 @@ bool Interfaces::setInterfaceMethod(const QString &newName){
321 * @return QString the options value. QString::null if error == true 321 * @return QString the options value. QString::null if error == true
322 */ 322 */
323QString Interfaces::getInterfaceOption(const QString &option, bool &error){ 323QString Interfaces::getInterfaceOption(const QString &option, bool &error){
@@ -333,3 +333,3 @@ QString Interfaces::getInterfaceOption(const QString &option, bool &error){
333 * @return QString the options value. QString::null if error == true 333 * @return QString the options value. QString::null if error == true
334 */ 334 */
335bool Interfaces::setInterfaceOption(const QString &option, const QString &value){ 335bool Interfaces::setInterfaceOption(const QString &option, const QString &value){
@@ -339,3 +339,3 @@ bool Interfaces::setInterfaceOption(const QString &option, const QString &value)
339/** 339/**
340 * Removes a value for an option in the currently selected interface. 340 * Removes a value for an option in the currently selected interface.
341 * @param option the options to set the value. 341 * @param option the options to set the value.
@@ -343,3 +343,3 @@ bool Interfaces::setInterfaceOption(const QString &option, const QString &value)
343 * @return QString the options value. QString::null if error == true 343 * @return QString the options value. QString::null if error == true
344 */ 344 */
345bool Interfaces::removeInterfaceOption(const QString &option){ 345bool Interfaces::removeInterfaceOption(const QString &option){
@@ -349,3 +349,3 @@ bool Interfaces::removeInterfaceOption(const QString &option){
349/** 349/**
350 * Removes a value for an option in the currently selected interface. 350 * Removes a value for an option in the currently selected interface.
351 * @param option the options to set the value. 351 * @param option the options to set the value.
@@ -354,3 +354,3 @@ bool Interfaces::removeInterfaceOption(const QString &option){
354 * @return QString the options value. QString::null if error == true 354 * @return QString the options value. QString::null if error == true
355 */ 355 */
356bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){ 356bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){
@@ -361,4 +361,4 @@ bool Interfaces::removeInterfaceOption(const QString &option, const QString &val
361 * Removes all of the options from the currently selected interface. 361 * Removes all of the options from the currently selected interface.
362 * @return bool error if if successfull 362 * @return bool error if if successfull
363 */ 363 */
364bool Interfaces::removeAllInterfaceOptions(){ 364bool Interfaces::removeAllInterfaceOptions(){
@@ -372,4 +372,4 @@ bool Interfaces::removeAllInterfaceOptions(){
372 * removed from the interface name. 372 * removed from the interface name.
373 * @return bool true if it is successfull. 373 * @return bool true if it is successfull.
374 */ 374 */
375bool Interfaces::setMapping(const QString &interface){ 375bool Interfaces::setMapping(const QString &interface){
@@ -383,3 +383,3 @@ bool Interfaces::setMapping(const QString &interface){
383 * @param interface the name(s) of the interfaces to set to this mapping 383 * @param interface the name(s) of the interfaces to set to this mapping
384 */ 384 */
385void Interfaces::addMapping(const QString &option){ 385void Interfaces::addMapping(const QString &option){
@@ -395,3 +395,3 @@ bool Interfaces::removeMapping(){
395 return removeStanza(currentMapping); 395 return removeStanza(currentMapping);
396} 396}
397 397
@@ -402,3 +402,3 @@ bool Interfaces::removeMapping(){
402 * @return bool true if it is successfull. 402 * @return bool true if it is successfull.
403 */ 403 */
404bool Interfaces::setMap(const QString &map, const QString &value){ 404bool Interfaces::setMap(const QString &map, const QString &value){
@@ -412,3 +412,3 @@ bool Interfaces::setMap(const QString &map, const QString &value){
412 * @return bool true if it is successfull. 412 * @return bool true if it is successfull.
413 */ 413 */
414bool Interfaces::removeMap(const QString &map, const QString &value){ 414bool Interfaces::removeMap(const QString &map, const QString &value){
@@ -422,3 +422,3 @@ bool Interfaces::removeMap(const QString &map, const QString &value){
422 * @return value that goes to the map 422 * @return value that goes to the map
423 */ 423 */
424QString Interfaces::getMap(const QString &map, bool &error){ 424QString Interfaces::getMap(const QString &map, bool &error){
@@ -431,3 +431,3 @@ QString Interfaces::getMap(const QString &map, bool &error){
431 * @return true if successfull. 431 * @return true if successfull.
432 */ 432 */
433bool Interfaces::setScript(const QString &argument){ 433bool Interfaces::setScript(const QString &argument){
@@ -439,3 +439,3 @@ bool Interfaces::setScript(const QString &argument){
439 * @return QString the argument of the script for the current mapping. 439 * @return QString the argument of the script for the current mapping.
440 */ 440 */
441QString Interfaces::getScript(bool &error){ 441QString Interfaces::getScript(bool &error){
@@ -447,3 +447,3 @@ QString Interfaces::getScript(bool &error){
447/** 447/**
448 * Helper function used to parse through the QStringList and put pointers in 448 * Helper function used to parse through the QStringList and put pointers in
449 * the correct place. 449 * the correct place.
@@ -453,3 +453,3 @@ QString Interfaces::getScript(bool &error){
453 * @return bool true if the stanza is found. 453 * @return bool true if the stanza is found.
454 */ 454 */
455bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){ 455bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){
@@ -494,3 +494,3 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op
494 return false; 494 return false;
495 495
496 bool found = false; 496 bool found = false;
@@ -525,3 +525,3 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op
525 * @return bool true if successfull. 525 * @return bool true if successfull.
526 */ 526 */
527bool Interfaces::removeStanza(QStringList::Iterator &stanza){ 527bool Interfaces::removeStanza(QStringList::Iterator &stanza){
@@ -542,3 +542,3 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString
542 return false; 542 return false;
543 543
544 bool found = false; 544 bool found = false;
@@ -569,3 +569,3 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString
569 return false; 569 return false;
570 570
571 bool found = false; 571 bool found = false;
@@ -595,3 +595,3 @@ bool Interfaces::removeAllOptions(const QStringList::Iterator &start){
595 return false; 595 return false;
596 596
597 QStringList::Iterator it = start; 597 QStringList::Iterator it = start;
@@ -622,3 +622,3 @@ QString Interfaces::getOption(const QStringList::Iterator &start, const QString
622 } 622 }
623 623
624 QString value; 624 QString value;
@@ -649,3 +649,3 @@ QString Interfaces::getOption(const QStringList::Iterator &start, const QString
649 * @return bool true if successfull, false if not. 649 * @return bool true if successfull, false if not.
650 */ 650 */
651bool Interfaces::write(){ 651bool Interfaces::write(){
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index f19cbdd..b40d101 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -189,2 +189,4 @@ void InterfaceSetupImp::setProfile(const QString &profile){
189 subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); 189 subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error));
190 if (subnetMaskEdit->text().isEmpty())
191 subnetMaskEdit->setText( "255.255.255.0" );
190 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); 192 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error));
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 7bded85..a4488f9 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -134,5 +134,22 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
134 QString action; 134 QString action;
135 int countMsgs = 0;
136 stream >> interface;
137 qDebug("got count? >%s<",interface.latin1());
138 if (interface == "count"){
139 qDebug("got count");
140 stream >> action;
141 qDebug("Got count num >%s<", action.latin1());
142 countMsgs = action.toInt();
143 }
144
135 QDialog *toShow; 145 QDialog *toShow;
136 while (! stream.atEnd() ){ 146 //while (! stream.atEnd() ){
147 for (int i = 0; i < countMsgs; i++){
148 qDebug("start stream %d/%d",i,countMsgs);
149 if (stream.atEnd()){
150 qDebug("end of stream");
151 return;
152 }
137 stream >> interface; 153 stream >> interface;
154 qDebug("got iface");
138 stream >> action; 155 stream >> action;
@@ -177,3 +194,7 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
177 stream >> value; 194 stream >> value;
178 qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); 195 qDebug("WLANModule (build 4) is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() );
196 if (value.isEmpty()){
197 qDebug("value is empty!!!\nreturning");
198 return;
199 }
179 if ( action.contains("ESSID") ){ 200 if ( action.contains("ESSID") ){
@@ -196,4 +217,6 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
196 bool ok; 217 bool ok;
218 qDebug("converting channel");
197 int chan = value.toInt( &ok ); 219 int chan = value.toInt( &ok );
198 if (ok){ 220 if (ok){
221 qDebug("ok setting channel");
199 wlanconfigWiget->specifyChan->setChecked( true ); 222 wlanconfigWiget->specifyChan->setChecked( true );
@@ -207,4 +230,7 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
207 } 230 }
231 qDebug("next stream");
208 }// while stream 232 }// while stream
233 qDebug("end of stream");
209 if (toShow) toShow->exec(); 234 if (toShow) toShow->exec();
235 qDebug("returning");
210} 236}
@@ -217,3 +243,7 @@ QWidget *WLANModule::getInfo( Interface *i)
217 info->tabWidget->insertTab(information, "TCP/IP", 0); 243 info->tabWidget->insertTab(information, "TCP/IP", 0);
218 244 info->tabWidget->setCurrentPage( 0 );
245 info->tabWidget->showPage( information );
246 if (info->tabWidget->currentPage() == information ) qDebug("infotab OK");
247 else qDebug("infotab NOT OK");
248 qDebug("current idx %d", info->tabWidget->currentPageIndex());
219 qDebug("WLANModule::getInfo return"); 249 qDebug("WLANModule::getInfo return");