summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/mainwindowimp.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/mainwindowimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp25
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 @@
#include "kprocess.h"
-#include "namedialog.h"
@@ -12,2 +11,3 @@
#include <qlistbox.h>
+#include <qlineedit.h>
#include <qlistview.h>
@@ -39,4 +39,5 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par
connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
- connect(profilesList, SIGNAL(highlighted(const QString&)), this, SLOT(changeProfile(const QString&)));
-
+ connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile()));
+
+ connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&)));
// Load connections.
@@ -61,2 +62,3 @@ MainWindowImp::~MainWindowImp(){
Config cfg("NetworkSetup");
+ cfg.setGroup("General");
cfg.writeEntry("Profiles", profiles.join(" "));
@@ -374,2 +376,9 @@ void MainWindowImp::updateInterface(Interface *i){
+void MainWindowImp::newProfileChanged(const QString& newText){
+ if(newText.length() > 0)
+ newProfileButton->setEnabled(true);
+ else
+ newProfileButton->setEnabled(false);
+}
+
/**
@@ -380,7 +389,3 @@ void MainWindowImp::updateInterface(Interface *i){
void MainWindowImp::addProfile(){
- NameDialog foo(this, "namedialog", true);
- QString newProfileName = foo.go();
- if(newProfileName.length() == 0)
- return;
-
+ QString newProfileName = newProfile->text();
if(profiles.grep(newProfileName).count() > 0){
@@ -416,4 +421,4 @@ void MainWindowImp::removeProfile(){
*/
-void MainWindowImp::changeProfile(const QString& newProfile){
- currentProfileLabel->setText(newProfile);
+void MainWindowImp::changeProfile(){
+ currentProfileLabel->setText(profilesList->text(profilesList->currentItem()));
}