Diffstat (limited to 'noncore/settings/networksettings/mainwindowimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index e9429e3..e895971 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp | |||
@@ -7,3 +7,2 @@ | |||
7 | #include "kprocess.h" | 7 | #include "kprocess.h" |
8 | #include "namedialog.h" | ||
9 | 8 | ||
@@ -12,2 +11,3 @@ | |||
12 | #include <qlistbox.h> | 11 | #include <qlistbox.h> |
12 | #include <qlineedit.h> | ||
13 | #include <qlistview.h> | 13 | #include <qlistview.h> |
@@ -39,4 +39,5 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par | |||
39 | connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile())); | 39 | connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile())); |
40 | connect(profilesList, SIGNAL(highlighted(const QString&)), this, SLOT(changeProfile(const QString&))); | 40 | connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile())); |
41 | 41 | ||
42 | connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&))); | ||
42 | // Load connections. | 43 | // Load connections. |
@@ -61,2 +62,3 @@ MainWindowImp::~MainWindowImp(){ | |||
61 | Config cfg("NetworkSetup"); | 62 | Config cfg("NetworkSetup"); |
63 | cfg.setGroup("General"); | ||
62 | cfg.writeEntry("Profiles", profiles.join(" ")); | 64 | cfg.writeEntry("Profiles", profiles.join(" ")); |
@@ -374,2 +376,9 @@ void MainWindowImp::updateInterface(Interface *i){ | |||
374 | 376 | ||
377 | void MainWindowImp::newProfileChanged(const QString& newText){ | ||
378 | if(newText.length() > 0) | ||
379 | newProfileButton->setEnabled(true); | ||
380 | else | ||
381 | newProfileButton->setEnabled(false); | ||
382 | } | ||
383 | |||
375 | /** | 384 | /** |
@@ -380,7 +389,3 @@ void MainWindowImp::updateInterface(Interface *i){ | |||
380 | void MainWindowImp::addProfile(){ | 389 | void MainWindowImp::addProfile(){ |
381 | NameDialog foo(this, "namedialog", true); | 390 | QString newProfileName = newProfile->text(); |
382 | QString newProfileName = foo.go(); | ||
383 | if(newProfileName.length() == 0) | ||
384 | return; | ||
385 | |||
386 | if(profiles.grep(newProfileName).count() > 0){ | 391 | if(profiles.grep(newProfileName).count() > 0){ |
@@ -416,4 +421,4 @@ void MainWindowImp::removeProfile(){ | |||
416 | */ | 421 | */ |
417 | void MainWindowImp::changeProfile(const QString& newProfile){ | 422 | void MainWindowImp::changeProfile(){ |
418 | currentProfileLabel->setText(newProfile); | 423 | currentProfileLabel->setText(profilesList->text(profilesList->currentItem())); |
419 | } | 424 | } |