summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebooksettings.cpp
authoralwin <alwin>2005-03-18 16:57:24 (UTC)
committer alwin <alwin>2005-03-18 16:57:24 (UTC)
commit977193cc46768da220ddb01aca74286b28e6b7ee (patch) (side-by-side diff)
treeeff59fc4011b0b3a6fd610b2b04e934eb21a0687 /core/pim/datebook/datebooksettings.cpp
parentf32b76432aeb554204f06ca15ed1ec8d5387fb12 (diff)
downloadopie-977193cc46768da220ddb01aca74286b28e6b7ee.zip
opie-977193cc46768da220ddb01aca74286b28e6b7ee.tar.gz
opie-977193cc46768da220ddb01aca74286b28e6b7ee.tar.bz2
work on plugins finished.
these plugins now may have a config-widget (sorry guys - I had to change the plugininterface and so the UUID again.) the plugin for nationalholidays now has such a widget, the datebook will insert configwidgets into its settingsdialog. corrected the .pro file of opiepim2/ui so it contains the header/cpp files for that pluginsystem.
Diffstat (limited to 'core/pim/datebook/datebooksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebooksettings.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/pim/datebook/datebooksettings.cpp b/core/pim/datebook/datebooksettings.cpp
index 861e266..561dc38 100644
--- a/core/pim/datebook/datebooksettings.cpp
+++ b/core/pim/datebook/datebooksettings.cpp
@@ -22,6 +22,9 @@
#include <opie2/opluginloader.h>
#include <opie2/odebug.h>
+#include <opie2/oholidaypluginif.h>
+#include <opie2/oholidayplugin.h>
+#include <opie2/oholidayplugincfgwidget.h>
#include <qpe/qpeapplication.h>
@@ -29,6 +32,8 @@
#include <qcheckbox.h>
#include <qlistview.h>
#include <qheader.h>
+#include <qtabwidget.h>
+#include <qlayout.h>
DateBookSettings::DateBookSettings( bool whichClock, QWidget *parent,
const char *name, bool modal, WFlags fl )
@@ -90,6 +95,29 @@ void DateBookSettings::setPluginList(Opie::Core::OPluginManager*aManager,Opie::C
for ( Opie::Core::OPluginItem::List::Iterator it = inLst.begin(); it != inLst.end(); ++it ) {
pitem = new QCheckListItem(m_PluginListView,(*it).name(),QCheckListItem::CheckBox);
pitem->setOn( (*it).isEnabled() );
+
+ Opie::Datebook::HolidayPluginIf*hif = m_loader->load<Opie::Datebook::HolidayPluginIf>(*it,IID_HOLIDAY_PLUGIN);
+ if (!hif) continue;
+ Opie::Datebook::HolidayPlugin*pl = hif->plugin();
+ if (!pl) continue;
+ Opie::Datebook::HolidayPluginConfigWidget*cfg = pl->configWidget();
+ if (!cfg) continue;
+ QWidget * dtab = new QWidget(TabWidget,pl->description());
+ QVBoxLayout*dlayout = new QVBoxLayout(dtab);
+ dlayout->setMargin(2);
+ dlayout->setSpacing(2);
+ cfg->reparent(dtab,0,QPoint(0,0));
+ dlayout->addWidget(cfg);
+ TabWidget->insertTab(dtab,pl->description());
+
+ m_cfgWidgets.append(cfg);
+ }
+}
+void DateBookSettings::savePlugins()
+{
+ QValueList<Opie::Datebook::HolidayPluginConfigWidget*>::Iterator it;
+ for (it=m_cfgWidgets.begin();it!=m_cfgWidgets.end();++it) {
+ (*it)->saveConfig();
}
}