diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch) | |
tree | 67208f7c145782a7e90b123b982ca78d88cc2c87 /akregator/src/settings_advanced.cpp | |
download | tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'akregator/src/settings_advanced.cpp')
-rw-r--r-- | akregator/src/settings_advanced.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/akregator/src/settings_advanced.cpp b/akregator/src/settings_advanced.cpp new file mode 100644 index 000000000..5d1254835 --- /dev/null +++ b/akregator/src/settings_advanced.cpp @@ -0,0 +1,54 @@ +#include "akregatorconfig.h" +#include "settings_advanced.h" +#include "storagefactory.h" +#include "storagefactoryregistry.h" + +#include <qpushbutton.h> +#include <qstringlist.h> +#include <qwidget.h> + +#include <kcombobox.h> + +namespace Akregator { + +SettingsAdvanced::SettingsAdvanced(QWidget* parent, const char* name) : SettingsAdvancedBase(parent, name) +{ + + QStringList backends = Backend::StorageFactoryRegistry::self()->list(); + QString tname; + int i = 0; + QStringList::Iterator end( backends.end() ); + for (QStringList::Iterator it = backends.begin(); it != end; ++it) + { + m_factories[i] = Backend::StorageFactoryRegistry::self()->getFactory(*it); + m_keyPos[m_factories[i]->key()] = i; + cbBackend->insertItem(m_factories[i]->name()); + i++; + } + connect(pbBackendConfigure, SIGNAL(clicked()), this, SLOT(slotConfigureStorage())); + connect(cbBackend, SIGNAL(activated(int)), this, SLOT(slotFactorySelected(int))); +} + +QString SettingsAdvanced::selectedFactory() const +{ + return m_factories[cbBackend->currentItem()]->key(); +} + +void SettingsAdvanced::selectFactory(const QString& key) +{ + cbBackend->setCurrentItem(m_keyPos[key]); + pbBackendConfigure->setEnabled((m_factories[m_keyPos[key]]->isConfigurable())); +} + +void SettingsAdvanced::slotConfigureStorage() +{ + m_factories[cbBackend->currentItem()]->configure(); +} + +void SettingsAdvanced::slotFactorySelected(int pos) +{ + pbBackendConfigure->setEnabled(m_factories[pos]->isConfigurable()); +} + +} //namespace Akregator +#include "settings_advanced.moc" |