1 #include "akregatorconfig.h"
2 #include "settings_advanced.h"
3 #include "storagefactory.h"
4 #include "storagefactoryregistry.h"
6 #include <tqpushbutton.h>
7 #include <tqstringlist.h>
10 #include <kcombobox.h>
14 SettingsAdvanced::SettingsAdvanced(TQWidget* parent,
const char* name) : SettingsAdvancedBase(parent, name)
17 TQStringList backends = Backend::StorageFactoryRegistry::self()->list();
20 TQStringList::Iterator end( backends.end() );
21 for (TQStringList::Iterator it = backends.begin(); it != end; ++it)
23 m_factories[i] = Backend::StorageFactoryRegistry::self()->getFactory(*it);
24 m_keyPos[m_factories[i]->key()] = i;
25 cbBackend->insertItem(m_factories[i]->name());
28 connect(pbBackendConfigure, TQ_SIGNAL(clicked()),
this, TQ_SLOT(slotConfigureStorage()));
29 connect(cbBackend, TQ_SIGNAL(activated(
int)),
this, TQ_SLOT(slotFactorySelected(
int)));
32 TQString SettingsAdvanced::selectedFactory()
const
34 return m_factories[cbBackend->currentItem()]->key();
37 void SettingsAdvanced::selectFactory(
const TQString& key)
39 cbBackend->setCurrentItem(m_keyPos[key]);
40 pbBackendConfigure->setEnabled((m_factories[m_keyPos[key]]->isConfigurable()));
43 void SettingsAdvanced::slotConfigureStorage()
45 m_factories[cbBackend->currentItem()]->configure();
48 void SettingsAdvanced::slotFactorySelected(
int pos)
50 pbBackendConfigure->setEnabled(m_factories[pos]->isConfigurable());
54 #include "settings_advanced.moc"