+
+void SettingsDialog::onSourceSelected(unsigned int index,
+ QString const& text,
+ QVariant const& value)
+{
+ Q_UNUSED(index);
+ Q_UNUSED(text);
+
+ QString source = value.toString();
+
+ if(source != currentSource_)
+ {
+ 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);
+ Q_ASSERT(sourceConfig_ != 0);
+ tabs_->addTab(sourceConfig_, tr("Phonebook settings"));
+ currentSource_ = source;
+ }
+}