Diffstat (limited to 'core/pim/datebook/datebooksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/datebook/datebooksettings.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/core/pim/datebook/datebooksettings.cpp b/core/pim/datebook/datebooksettings.cpp index cb4b73b..861e266 100644 --- a/core/pim/datebook/datebooksettings.cpp +++ b/core/pim/datebook/datebooksettings.cpp | |||
@@ -17,26 +17,35 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "datebooksettings.h" | 21 | #include "datebooksettings.h" |
22 | 22 | ||
23 | #include <opie2/opluginloader.h> | ||
24 | #include <opie2/odebug.h> | ||
25 | |||
23 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
24 | 27 | ||
25 | #include <qspinbox.h> | 28 | #include <qspinbox.h> |
26 | #include <qcheckbox.h> | 29 | #include <qcheckbox.h> |
30 | #include <qlistview.h> | ||
31 | #include <qheader.h> | ||
27 | 32 | ||
28 | DateBookSettings::DateBookSettings( bool whichClock, QWidget *parent, | 33 | DateBookSettings::DateBookSettings( bool whichClock, QWidget *parent, |
29 | const char *name, bool modal, WFlags fl ) | 34 | const char *name, bool modal, WFlags fl ) |
30 | : DateBookSettingsBase( parent, name, modal, fl ), | 35 | : DateBookSettingsBase( parent, name, modal, fl ), |
31 | ampm( whichClock ) | 36 | ampm( whichClock ) |
32 | { | 37 | { |
33 | init(); | 38 | init(); |
34 | QObject::connect( qApp, SIGNAL( clockChanged(bool) ), this, SLOT( slotChangeClock(bool) ) ); | 39 | QObject::connect( qApp, SIGNAL( clockChanged(bool) ), this, SLOT( slotChangeClock(bool) ) ); |
35 | QArray<int> categories; | 40 | QArray<int> categories; |
36 | comboCategory->setCategories( categories, "Calendar", tr("Calendar") ); | 41 | comboCategory->setCategories( categories, "Calendar", tr("Calendar") ); |
42 | m_loader = 0; | ||
43 | m_manager = 0; | ||
44 | m_PluginListView->header()->hide(); | ||
45 | m_PluginListView->setSorting(-1); | ||
37 | } | 46 | } |
38 | 47 | ||
39 | DateBookSettings::~DateBookSettings() | 48 | DateBookSettings::~DateBookSettings() |
40 | { | 49 | { |
41 | } | 50 | } |
42 | 51 | ||
@@ -67,12 +76,39 @@ int DateBookSettings::startTime() const | |||
67 | else if (returnMe == 12 && spinStart->suffix().contains(tr("AM"), TRUE)) | 76 | else if (returnMe == 12 && spinStart->suffix().contains(tr("AM"), TRUE)) |
68 | returnMe = 0; | 77 | returnMe = 0; |
69 | } | 78 | } |
70 | return returnMe; | 79 | return returnMe; |
71 | } | 80 | } |
72 | 81 | ||
82 | void DateBookSettings::setPluginList(Opie::Core::OPluginManager*aManager,Opie::Core::OPluginLoader*aLoader) | ||
83 | { | ||
84 | m_manager = aManager; | ||
85 | m_loader = aLoader; | ||
86 | if (!aManager||!aLoader) return; | ||
87 | Opie::Core::OPluginItem::List inLst = m_loader->allAvailable(true); | ||
88 | QCheckListItem *pitem = 0; | ||
89 | |||
90 | for ( Opie::Core::OPluginItem::List::Iterator it = inLst.begin(); it != inLst.end(); ++it ) { | ||
91 | pitem = new QCheckListItem(m_PluginListView,(*it).name(),QCheckListItem::CheckBox); | ||
92 | pitem->setOn( (*it).isEnabled() ); | ||
93 | } | ||
94 | } | ||
95 | |||
96 | void DateBookSettings::pluginItemClicked(QListViewItem *aItem) | ||
97 | { | ||
98 | if (!aItem||!m_manager||!m_loader) return; | ||
99 | QCheckListItem*pitem = ((QCheckListItem*)aItem); | ||
100 | |||
101 | Opie::Core::OPluginItem::List lst = m_loader->allAvailable( true ); | ||
102 | for ( Opie::Core::OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) { | ||
103 | if ( QString::compare( (*it).name() , pitem->text(0) ) == 0 ) { | ||
104 | m_manager->setEnabled((*it),pitem->isOn()); | ||
105 | break; | ||
106 | } | ||
107 | } | ||
108 | } | ||
73 | 109 | ||
74 | void DateBookSettings::setAlarmPreset( bool bAlarm, int presetTime ) | 110 | void DateBookSettings::setAlarmPreset( bool bAlarm, int presetTime ) |
75 | { | 111 | { |
76 | chkAlarmPreset->setChecked( bAlarm ); | 112 | chkAlarmPreset->setChecked( bAlarm ); |
77 | if ( presetTime >=5 ) | 113 | if ( presetTime >=5 ) |
78 | spinPreset->setValue( presetTime ); | 114 | spinPreset->setValue( presetTime ); |