summaryrefslogtreecommitdiff
path: root/noncore/net/networksetup/mainwindowimp.cpp
Unidiff
Diffstat (limited to 'noncore/net/networksetup/mainwindowimp.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/networksetup/mainwindowimp.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp
index 6440bd4..3b0b7e8 100644
--- a/noncore/net/networksetup/mainwindowimp.cpp
+++ b/noncore/net/networksetup/mainwindowimp.cpp
@@ -166,13 +166,13 @@ void MainWindowImp::addClicked(){
166 if(it.key()){ 166 if(it.key()){
167 (it.key())->possibleNewInterfaces(list); 167 (it.key())->possibleNewInterfaces(list);
168 } 168 }
169 } 169 }
170 // See if the list has anything that we can add. 170 // See if the list has anything that we can add.
171 if(list.count() == 0){ 171 if(list.count() == 0){
172 QMessageBox::information(this, "Sorry", "Nothing to add.", "Ok"); 172 QMessageBox::information(this, "Sorry", "Nothing to add.", QMessageBox::Ok);
173 return; 173 return;
174 } 174 }
175 AddConnectionImp addNewConnection(this, "AddConnectionImp", true); 175 AddConnectionImp addNewConnection(this, "AddConnectionImp", true);
176 addNewConnection.addConnections(list); 176 addNewConnection.addConnections(list);
177 addNewConnection.showMaximized(); 177 addNewConnection.showMaximized();
178 if(QDialog::Accepted == addNewConnection.exec()){ 178 if(QDialog::Accepted == addNewConnection.exec()){
@@ -196,25 +196,25 @@ void MainWindowImp::addClicked(){
196 * Prompt the user to see if they really want to do this. 196 * Prompt the user to see if they really want to do this.
197 * If they do then remove from the list and unload. 197 * If they do then remove from the list and unload.
198 */ 198 */
199void MainWindowImp::removeClicked(){ 199void MainWindowImp::removeClicked(){
200 QListViewItem *item = connectionList->currentItem(); 200 QListViewItem *item = connectionList->currentItem();
201 if(!item) { 201 if(!item) {
202 QMessageBox::information(this, "Sorry","Please select an interface First.", "Ok"); 202 QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok);
203 return; 203 return;
204 } 204 }
205 205
206 Interface *i = interfaceItems[item]; 206 Interface *i = interfaceItems[item];
207 if(i->getModuleOwner() == NULL){ 207 if(i->getModuleOwner() == NULL){
208 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", "Ok"); 208 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", QMessageBox::Ok);
209 } 209 }
210 else{ 210 else{
211 if(!i->getModuleOwner()->remove(i)) 211 if(!i->getModuleOwner()->remove(i))
212 QMessageBox::information(this, "Error", "Unable to remove.", "Ok"); 212 QMessageBox::information(this, "Error", "Unable to remove.", QMessageBox::Ok);
213 else{ 213 else{
214 QMessageBox::information(this, "Success", "Interface was removed.", "Ok"); 214 QMessageBox::information(this, "Success", "Interface was removed.", QMessageBox::Ok);
215 // TODO memory managment.... 215 // TODO memory managment....
216 // who deletes the interface? 216 // who deletes the interface?
217 } 217 }
218 } 218 }
219} 219}
220 220
@@ -441,36 +441,36 @@ void MainWindowImp::newProfileChanged(const QString& newText){
441 * Don't add profiles that already exists. 441 * Don't add profiles that already exists.
442 * Appends to the list and QStringList 442 * Appends to the list and QStringList
443 */ 443 */
444void MainWindowImp::addProfile(){ 444void MainWindowImp::addProfile(){
445 QString newProfileName = newProfile->text(); 445 QString newProfileName = newProfile->text();
446 if(profiles.grep(newProfileName).count() > 0){ 446 if(profiles.grep(newProfileName).count() > 0){
447 QMessageBox::information(this, "Can't Add","Profile already exists.", "Ok"); 447 QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok);
448 return; 448 return;
449 } 449 }
450 profiles.append(newProfileName); 450 profiles.append(newProfileName);
451 profilesList->insertItem(newProfileName); 451 profilesList->insertItem(newProfileName);
452} 452}
453 453
454/** 454/**
455 * Removes the currently selected profile in the combo. 455 * Removes the currently selected profile in the combo.
456 * Doesn't delete if there are less then 2 profiles. 456 * Doesn't delete if there are less then 2 profiles.
457 */ 457 */
458void MainWindowImp::removeProfile(){ 458void MainWindowImp::removeProfile(){
459 if(profilesList->count() <= 1){ 459 if(profilesList->count() <= 1){
460 QMessageBox::information(this, "Can't remove.","At least one profile\nis needed.", "Ok"); 460 QMessageBox::information(this, "Can't remove.","At least one profile\nis needed.", QMessageBox::Ok);
461 return; 461 return;
462 } 462 }
463 QString profileToRemove = profilesList->currentText(); 463 QString profileToRemove = profilesList->currentText();
464 if(profileToRemove == "All"){ 464 if(profileToRemove == "All"){
465 QMessageBox::information(this, "Can't remove.","Can't remove default.", "Ok"); 465 QMessageBox::information(this, "Can't remove.","Can't remove default.", QMessageBox::Ok);
466 return; 466 return;
467 } 467 }
468 // Can't remove the curent profile 468 // Can't remove the curent profile
469 if(profileToRemove == currentProfileLabel->text()){ 469 if(profileToRemove == currentProfileLabel->text()){
470 QMessageBox::information(this, "Can't remove.",QString("%1 is the current profile.").arg(profileToRemove), "Ok"); 470 QMessageBox::information(this, "Can't remove.",QString("%1 is the current profile.").arg(profileToRemove), QMessageBox::Ok);
471 return; 471 return;
472 472
473 } 473 }
474 474
475 if(QMessageBox::information(this, "Question",QString("Remove profile: %1").arg(profileToRemove), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok){ 475 if(QMessageBox::information(this, "Question",QString("Remove profile: %1").arg(profileToRemove), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok){
476 profiles = QStringList::split(" ", profiles.join(" ").replace(QRegExp(profileToRemove), "")); 476 profiles = QStringList::split(" ", profiles.join(" ").replace(QRegExp(profileToRemove), ""));
@@ -504,13 +504,13 @@ void MainWindowImp::removeProfile(){
504/** 504/**
505 * A new profile has been selected, change. 505 * A new profile has been selected, change.
506 * @param newProfile the new profile. 506 * @param newProfile the new profile.
507 */ 507 */
508void MainWindowImp::changeProfile(){ 508void MainWindowImp::changeProfile(){
509 if(profilesList->currentItem() == -1){ 509 if(profilesList->currentItem() == -1){
510 QMessageBox::information(this, "Can't Change.","Please select a profile.", "Ok"); 510 QMessageBox::information(this, "Can't Change.","Please select a profile.", QMessageBox::Ok);
511 return; 511 return;
512 } 512 }
513 QString newProfile = profilesList->text(profilesList->currentItem()); 513 QString newProfile = profilesList->text(profilesList->currentItem());
514 if(newProfile != currentProfileLabel->text()){ 514 if(newProfile != currentProfileLabel->text()){
515 currentProfileLabel->setText(newProfile); 515 currentProfileLabel->setText(newProfile);
516 QFile::remove(scheme); 516 QFile::remove(scheme);