Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Jenirok
Summary Tracker SCM Files
index 337a9bd..ac9d643 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()));
@@ -151,7 +156,6 @@ void SettingsDialog::saveSettings()
 
     Settings::instance()->startEdit();
 
-    sourceConfig_->save();
     Settings::instance()->set("cache_size", cacheInput_->text());
     QString source = sourceSelector_->value().toString();
     Settings::instance()->set("source", source);
@@ -159,23 +163,22 @@ 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..."));
-        Daemon::restart();
-    }
-
     if(language != selectedLanguage_)
     {
         QMaemo5InformationBox::information(this, tr("You need to restart Jenirok for language change to take effect."));
         selectedLanguage_ = language;
     }
+    else if(Daemon::isRunning())
+    {
+        QMaemo5InformationBox::information(this, tr("Restarting daemon..."), 1500);
+        Daemon::restart();
+    }
 
 }
 
@@ -200,7 +203,13 @@ void SettingsDialog::onSourceSelected(unsigned int index,
 
     if(source != currentSource_)
     {
-        tabs_->removeTab(tabs_->count() - 1);
+        int tabId = tabs_->indexOf(sourceConfig_);
+
+        if(tabId >= 0)
+        {
+            tabs_->removeTab(tabId);
+        }
+
         delete sourceConfig_;
         Source::SourceId sourceId = Source::stringToId(value.toString());
         sourceConfig_ = SourceGuiConfig::getGuiConfig(sourceId, this);

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment