summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/mainwindowimp.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/mainwindowimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index b9fff56..6440bd4 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -221,69 +221,61 @@ void MainWindowImp::removeClicked(){
221/** 221/**
222 * Pull up the configure about the currently selected interface. 222 * Pull up the configure about the currently selected interface.
223 * Report an error if no interface is selected. 223 * Report an error if no interface is selected.
224 * If the interface has a module owner then request its configure. 224 * If the interface has a module owner then request its configure.
225 */ 225 */
226void MainWindowImp::configureClicked(){ 226void MainWindowImp::configureClicked(){
227 QListViewItem *item = connectionList->currentItem(); 227 QListViewItem *item = connectionList->currentItem();
228 if(!item){ 228 if(!item){
229 QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok); 229 QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok);
230 return; 230 return;
231 } 231 }
232 232
233 QString currentProfile = currentProfileLabel->text();
234 if(profilesList->count() <= 1 || currentProfile == "All"){
235 currentProfile = "";
236 }
237
238 Interface *i = interfaceItems[item]; 233 Interface *i = interfaceItems[item];
239 if(i->getModuleOwner()){ 234 if(i->getModuleOwner()){
240 i->getModuleOwner()->setProfile(currentProfile);
241 QWidget *moduleConfigure = i->getModuleOwner()->configure(i); 235 QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
242 if(moduleConfigure != NULL){ 236 if(moduleConfigure != NULL){
243 moduleConfigure->showMaximized(); 237 moduleConfigure->showMaximized();
244 moduleConfigure->show(); 238 moduleConfigure->show();
245 return; 239 return;
246 } 240 }
247 } 241 }
248 242
249 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(0, "InterfaceSetupImp", i, true, Qt::WDestructiveClose); 243 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(0, "InterfaceSetupImp", i, true, Qt::WDestructiveClose);
250 //configure->setProfile(currentProfile); 244 QString currentProfileText = currentProfileLabel->text();
245 if(currentProfileText.upper() == "ALL");
246 currentProfileText = "";
247 configure->setProfile(currentProfileText);
251 configure->showMaximized(); 248 configure->showMaximized();
252 configure->show(); 249 configure->show();
253} 250}
254 251
255/** 252/**
256 * Pull up the information about the currently selected interface. 253 * Pull up the information about the currently selected interface.
257 * Report an error if no interface is selected. 254 * Report an error if no interface is selected.
258 * If the interface has a module owner then request its configure. 255 * If the interface has a module owner then request its configure.
259 */ 256 */
260void MainWindowImp::informationClicked(){ 257void MainWindowImp::informationClicked(){
261 QListViewItem *item = connectionList->currentItem(); 258 QListViewItem *item = connectionList->currentItem();
262 if(!item){ 259 if(!item){
263 QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok); 260 QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok);
264 return; 261 return;
265 } 262 }
266 263
267 Interface *i = interfaceItems[item]; 264 Interface *i = interfaceItems[item];
268 if(!i->isAttached()){ 265 if(!i->isAttached()){
269 QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok); 266 QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok);
270 return; 267 return;
271 } 268 }
272 269
273 QStringList list;
274 for(uint i = 0; i < profilesList->count(); i++){
275 list.append(profilesList->text(i));
276 }
277
278 if(i->getModuleOwner()){ 270 if(i->getModuleOwner()){
279 QWidget *moduleInformation = i->getModuleOwner()->information(i); 271 QWidget *moduleInformation = i->getModuleOwner()->information(i);
280 if(moduleInformation != NULL){ 272 if(moduleInformation != NULL){
281 moduleInformation->showMaximized(); 273 moduleInformation->showMaximized();
282 moduleInformation->show(); 274 moduleInformation->show();
283 return; 275 return;
284 } 276 }
285 } 277 }
286 InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i, true); 278 InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i, true);
287 information->showMaximized(); 279 information->showMaximized();
288 information->show(); 280 information->show();
289} 281}
@@ -529,16 +521,17 @@ void MainWindowImp::changeProfile(){
529 file.close(); 521 file.close();
530 } 522 }
531 // restart all up devices? 523 // restart all up devices?
532 if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok){ 524 if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok){
533 // Go through them one by one 525 // Go through them one by one
534 QMap<Interface*, QListViewItem*>::Iterator it; 526 QMap<Interface*, QListViewItem*>::Iterator it;
535 for( it = items.begin(); it != items.end(); ++it ){ 527 for( it = items.begin(); it != items.end(); ++it ){
536 if(it.key()->getStatus() == true) 528 if(it.key()->getStatus() == true)
537 it.key()->restart(); 529 it.key()->restart();
538 } 530 }
539 } 531 }
540 } 532 }
533 // TODO change the profile in the modules
541} 534}
542 535
543// mainwindowimp.cpp 536// mainwindowimp.cpp
544 537