Danish Eniro search fixed.
[jenirok] / src / gui / settingsdialog.cpp
index 10e4e2d..2c3ee77 100644 (file)
@@ -107,7 +107,12 @@ autostartSelector_(0), connectionSelector_(0), tabs_(0)
 
     connectionSelector_ = new ConnectionSelector(tr("Connect automatically on"), this);
     QString selectedConnection = Settings::instance()->get("connection");
-    connectionSelector_->selectByValue(selectedConnection);
+
+    if(connectionSelector_->selectByValue(selectedConnection) &&
+       selectedConnection == "gprs")
+    {
+        connectionSelector_->updateConnections();
+    }
 
     QPushButton* submitButton = new QPushButton(tr("Save"), this);
     connect(submitButton, SIGNAL(pressed()), this, SLOT(saveSettings()));
@@ -158,25 +163,33 @@ void SettingsDialog::saveSettings()
     Settings::instance()->set("autostart", autostart);
     QString connection = connectionSelector_->value().toString();
     Settings::instance()->set("connection", connection);
-    Settings::instance()->set("connection_name", connectionSelector_->text());
     QString language = languageSelector_->value().toString();
     Settings::instance()->set("language", language);
     sourceConfig_->save();
 
     Settings::instance()->endEdit();
 
-    if(Daemon::isRunning())
-    {
-        QMaemo5InformationBox::information(this, tr("Restarting daemon..."), 1500);
-        Daemon::restart();
-    }
+    bool infoboxShown = false;
 
     if(language != selectedLanguage_)
     {
         QMaemo5InformationBox::information(this, tr("You need to restart Jenirok for language change to take effect."));
         selectedLanguage_ = language;
+        infoboxShown = true;
+    }
+
+    if(Daemon::isRunning())
+    {
+        if(!infoboxShown)
+        {
+            QMaemo5InformationBox::information(this, tr("Restarting daemon..."), 1500);
+        }
+
+        Daemon::restart();
     }
 
+    emit saved();
+
 }
 
 void SettingsDialog::resetCache()