summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp3
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp5
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp15
3 files changed, 19 insertions, 4 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index 49a47ae..8de30de 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -170,27 +170,30 @@ void InterfaceSetupImp::setProfile(const QString &profile){
170 // We must have a valid interface to get this far so read some settings. 170 // We must have a valid interface to get this far so read some settings.
171 171
172 // DHCP 172 // DHCP
173 bool error = false; 173 bool error = false;
174 if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) 174 if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP)
175 dhcpCheckBox->setChecked(true); 175 dhcpCheckBox->setChecked(true);
176 else 176 else
177 dhcpCheckBox->setChecked(false); 177 dhcpCheckBox->setChecked(false);
178 178
179 // IP Information 179 // IP Information
180 autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); 180 autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName()));
181 QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); 181 QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error);
182 qDebug("dns >%s<",dns.latin1());
182 if(dns.contains(" ")){ 183 if(dns.contains(" ")){
183 firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); 184 firstDNSLineEdit->setText(dns.mid(0, dns.find(" ")));
184 secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); 185 secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length()));
185 } 186 }
186 ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); 187 ipAddressEdit->setText(interfaces->getInterfaceOption("address", error));
187 subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); 188 subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error));
188 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); 189 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error));
189 190
191
192
190 qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); 193 qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1());
191 qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); 194 qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1());
192 195
193} 196}
194 197
195// interfacesetup.cpp 198// interfacesetup.cpp
196 199
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 8ea241d..2d714ca 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -631,24 +631,29 @@ void MainWindowImp::changeProfile(){
631void MainWindowImp::makeChannel() 631void MainWindowImp::makeChannel()
632{ 632{
633 channel = new QCopChannel( "QPE/Application/networksettings", this ); 633 channel = new QCopChannel( "QPE/Application/networksettings", this );
634 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 634 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
635 this, SLOT(receive(const QCString&, const QByteArray&)) ); 635 this, SLOT(receive(const QCString&, const QByteArray&)) );
636} 636}
637 637
638void MainWindowImp::receive(const QCString &msg, const QByteArray &arg) 638void MainWindowImp::receive(const QCString &msg, const QByteArray &arg)
639{ 639{
640 bool found = false; 640 bool found = false;
641 qDebug("MainWindowImp::receive QCop msg >"+msg+"<"); 641 qDebug("MainWindowImp::receive QCop msg >"+msg+"<");
642 642
643 if (msg == "raise") {
644 raise();
645 return;
646 }
647
643 QString dest = msg.left(msg.find("(")); 648 QString dest = msg.left(msg.find("("));
644 QCString param = msg.right(msg.length() - msg.find("(") - 1); 649 QCString param = msg.right(msg.length() - msg.find("(") - 1);
645 param = param.left( param.length() - 1 ); 650 param = param.left( param.length() - 1 );
646 qDebug("dest >%s< param >"+param+"<",dest.latin1()); 651 qDebug("dest >%s< param >"+param+"<",dest.latin1());
647 652
648 QMap<Module*, QLibrary*>::Iterator it; 653 QMap<Module*, QLibrary*>::Iterator it;
649 for( it = libraries.begin(); it != libraries.end(); ++it ){ 654 for( it = libraries.begin(); it != libraries.end(); ++it ){
650 qDebug("plugin >%s<", it.key()->type().latin1() ); 655 qDebug("plugin >%s<", it.key()->type().latin1() );
651 if(it.key()->type() == dest){ 656 if(it.key()->type() == dest){
652 it.key()->receive( param, arg ); 657 it.key()->receive( param, arg );
653 found = true; 658 found = true;
654 } 659 }
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 371b689..7bded85 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -61,25 +61,25 @@ bool WLANModule::isOwner(Interface *i){
61 return false; 61 return false;
62 62
63 i->setHardwareName("802.11b"); 63 i->setHardwareName("802.11b");
64 list.append(i); 64 list.append(i);
65 return true; 65 return true;
66} 66}
67 67
68/** 68/**
69 * Create, and return the WLANConfigure Module 69 * Create, and return the WLANConfigure Module
70 * @return QWidget* pointer to this modules configure. 70 * @return QWidget* pointer to this modules configure.
71 */ 71 */
72QWidget *WLANModule::configure(Interface *i){ 72QWidget *WLANModule::configure(Interface *i){
73 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, false, Qt::WDestructiveClose); 73 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, Qt::WDestructiveClose);
74 wlanconfig->setProfile(profile); 74 wlanconfig->setProfile(profile);
75 return wlanconfig; 75 return wlanconfig;
76} 76}
77 77
78/** 78/**
79 * Create, and return the Information Module 79 * Create, and return the Information Module
80 * @return QWidget* pointer to this modules info. 80 * @return QWidget* pointer to this modules info.
81 */ 81 */
82QWidget *WLANModule::information(Interface *i){ 82QWidget *WLANModule::information(Interface *i){
83 WExtensions we(i->getInterfaceName()); 83 WExtensions we(i->getInterfaceName());
84 if(!we.doesHaveWirelessExtensions()) 84 if(!we.doesHaveWirelessExtensions())
85 return NULL; 85 return NULL;
@@ -123,92 +123,99 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
123 QStringList params = QStringList::split(",",param); 123 QStringList params = QStringList::split(",",param);
124 int count = params.count(); 124 int count = params.count();
125 qDebug("WLANModule got %i params", count ); 125 qDebug("WLANModule got %i params", count );
126 if (count < 2){ 126 if (count < 2){
127 qDebug("Erorr less than 2 parameter"); 127 qDebug("Erorr less than 2 parameter");
128 qDebug("RETURNING"); 128 qDebug("RETURNING");
129 return; 129 return;
130 } 130 }
131 131
132 QDataStream stream(arg,IO_ReadOnly); 132 QDataStream stream(arg,IO_ReadOnly);
133 QString interface; 133 QString interface;
134 QString action; 134 QString action;
135 QDialog *toShow;
135 while (! stream.atEnd() ){ 136 while (! stream.atEnd() ){
136 stream >> interface; 137 stream >> interface;
137 stream >> action; 138 stream >> action;
138 qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); 139 qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1());
139 // find interfaces 140 // find interfaces
140 Interface *ifa=0; 141 Interface *ifa=0;
141 for ( Interface *i=list.first(); i != 0; i=list.next() ){ 142 for ( Interface *i=list.first(); i != 0; i=list.next() ){
142 if (i->getInterfaceName() == interface){ 143 if (i->getInterfaceName() == interface){
143 qDebug("WLANModule found interface %s",interface.latin1()); 144 qDebug("WLANModule found interface %s",interface.latin1());
144 ifa = i; 145 ifa = i;
145 } 146 }
146 } 147 }
147 148
148 if (ifa == 0){ 149 if (ifa == 0){
149 qDebug("WLANModule Did not find %s",interface.latin1()); 150 qDebug("WLANModule Did not find %s",interface.latin1());
150 qDebug("returning"); 151 qDebug("skipping");
151 return; 152 count = 0;
152 } 153 }
153 154
154 if (count == 2){ 155 if (count == 2){
155 // those should call the interface directly 156 // those should call the interface directly
156 QWidget *info = getInfo( ifa ); 157 QWidget *info = getInfo( ifa );
157 info->showMaximized(); 158 info->showMaximized();
158 159
159 if ( action.contains("start" ) ){ 160 if ( action.contains("start" ) ){
160 ifa->start(); 161 ifa->start();
161 } else if ( action.contains("restart" ) ){ 162 } else if ( action.contains("restart" ) ){
162 ifa->restart(); 163 ifa->restart();
163 } else if ( action.contains("stop" ) ){ 164 } else if ( action.contains("stop" ) ){
164 ifa->stop(); 165 ifa->stop();
165 }else if ( action.contains("refresh" ) ){ 166 }else if ( action.contains("refresh" ) ){
166 ifa->refresh(); 167 ifa->refresh();
167 } 168 }
168 }else if (count == 3){ 169 }else if (count == 3){
169 QString value; 170 QString value;
170 if (!wlanconfigWiget){ 171 if (!wlanconfigWiget){
171 //FIXME: what if it got closed meanwhile? 172 //FIXME: what if it got closed meanwhile?
172 wlanconfigWiget = (WLANImp*) configure(ifa); 173 wlanconfigWiget = (WLANImp*) configure(ifa);
174 toShow = (QDialog*) wlanconfigWiget;
173 } 175 }
174 wlanconfigWiget->showMaximized(); 176 wlanconfigWiget->showMaximized();
175 stream >> value; 177 stream >> value;
176 qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); 178 qDebug("WLANModule is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() );
177 if ( action.contains("ESSID") ){ 179 if ( action.contains("ESSID") ){
178 QComboBox *combo = wlanconfigWiget->essid; 180 QComboBox *combo = wlanconfigWiget->essid;
179 bool found = false; 181 bool found = false;
180 for ( int i = 0; i < combo->count(); i++) 182 for ( int i = 0; i < combo->count(); i++)
181 if ( combo->text( i ) == value ){ 183 if ( combo->text( i ) == value ){
182 combo->setCurrentItem( i ); 184 combo->setCurrentItem( i );
183 found = true; 185 found = true;
184 } 186 }
185 if (!found) combo->insertItem( value, 0 ); 187 if (!found) combo->insertItem( value, 0 );
186 }else if ( action.contains("Mode") ){ 188 }else if ( action.contains("Mode") ){
187 QComboBox *combo = wlanconfigWiget->mode; 189 QComboBox *combo = wlanconfigWiget->mode;
188 for ( int i = 0; i < combo->count(); i++) 190 for ( int i = 0; i < combo->count(); i++)
189 if ( combo->text( i ) == value ){ 191 if ( combo->text( i ) == value ){
190 combo->setCurrentItem( i ); 192 combo->setCurrentItem( i );
191 } 193 }
192 194
193 }else if (action.contains("Channel")){ 195 }else if (action.contains("Channel")){
196 bool ok;
197 int chan = value.toInt( &ok );
198 if (ok){
194 wlanconfigWiget->specifyChan->setChecked( true ); 199 wlanconfigWiget->specifyChan->setChecked( true );
195 wlanconfigWiget->networkChannel->setValue( value.toInt() ); 200 wlanconfigWiget->networkChannel->setValue( chan );
201 }
196 }else if (action.contains("MacAddr")){ 202 }else if (action.contains("MacAddr")){
197 wlanconfigWiget->specifyAp->setChecked( true ); 203 wlanconfigWiget->specifyAp->setChecked( true );
198 wlanconfigWiget->macEdit->setText( value ); 204 wlanconfigWiget->macEdit->setText( value );
199 }else 205 }else
200 qDebug("wlan plugin has no clue"); 206 qDebug("wlan plugin has no clue");
201 } 207 }
202 }// while stream 208 }// while stream
209 if (toShow) toShow->exec();
203} 210}
204 211
205QWidget *WLANModule::getInfo( Interface *i) 212QWidget *WLANModule::getInfo( Interface *i)
206{ 213{
207 qDebug("WLANModule::getInfo start"); 214 qDebug("WLANModule::getInfo start");
208 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); 215 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose);
209 InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); 216 InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i);
210 info->tabWidget->insertTab(information, "TCP/IP", 0); 217 info->tabWidget->insertTab(information, "TCP/IP", 0);
211 218
212 qDebug("WLANModule::getInfo return"); 219 qDebug("WLANModule::getInfo return");
213 return info; 220 return info;
214} 221}