-rw-r--r-- | core/pim/today/plugins/addressbook/addressplugin.cpp | 18 | ||||
-rw-r--r-- | core/pim/today/plugins/addressbook/addressplugin.h | 6 | ||||
-rw-r--r-- | core/pim/today/plugins/addressbook/addresspluginwidget.h | 4 |
3 files changed, 21 insertions, 7 deletions
diff --git a/core/pim/today/plugins/addressbook/addressplugin.cpp b/core/pim/today/plugins/addressbook/addressplugin.cpp index b78a54c..cb1683b 100644 --- a/core/pim/today/plugins/addressbook/addressplugin.cpp +++ b/core/pim/today/plugins/addressbook/addressplugin.cpp | |||
@@ -1,63 +1,69 @@ | |||
1 | /* | 1 | /* |
2 | * addressplugin.cpp | 2 | * addressplugin.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2003 by Stefan Eilers | 4 | * copyright : (c) 2003 by Stefan Eilers |
5 | * email : eilers.stefan@epost.de | 5 | * email : eilers.stefan@epost.de |
6 | * | 6 | * |
7 | * This implementation was derived from the todolist plugin implementation | 7 | * This implementation was derived from the todolist plugin implementation |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | /*************************************************************************** | 10 | /*************************************************************************** |
11 | * * | 11 | * * |
12 | * This program is free software; you can redistribute it and/or modify * | 12 | * This program is free software; you can redistribute it and/or modify * |
13 | * it under the terms of the GNU General Public License as published by * | 13 | * it under the terms of the GNU General Public License as published by * |
14 | * the Free Software Foundation; either version 2 of the License, or * | 14 | * the Free Software Foundation; either version 2 of the License, or * |
15 | * (at your option) any later version. * | 15 | * (at your option) any later version. * |
16 | * * | 16 | * * |
17 | ***************************************************************************/ | 17 | ***************************************************************************/ |
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | #include "addressplugin.h" | 21 | #include "addressplugin.h" |
22 | #include "addresspluginconfig.h" | 22 | #include "addresspluginconfig.h" |
23 | #include "addresspluginwidget.h" | ||
24 | 23 | ||
25 | 24 | AddressBookPlugin::AddressBookPlugin(): | |
26 | AddressBookPlugin::AddressBookPlugin() { | 25 | m_abWidget( 0l ) |
26 | { | ||
27 | } | 27 | } |
28 | 28 | ||
29 | AddressBookPlugin::~AddressBookPlugin() { | 29 | AddressBookPlugin::~AddressBookPlugin() { |
30 | } | 30 | } |
31 | 31 | ||
32 | QString AddressBookPlugin::pluginName() const { | 32 | QString AddressBookPlugin::pluginName() const { |
33 | return QObject::tr( "AddressBook plugin" ); | 33 | return QObject::tr( "AddressBook plugin" ); |
34 | } | 34 | } |
35 | 35 | ||
36 | double AddressBookPlugin::versionNumber() const { | 36 | double AddressBookPlugin::versionNumber() const { |
37 | return 0.1; | 37 | return 0.2; |
38 | } | 38 | } |
39 | 39 | ||
40 | QString AddressBookPlugin::pixmapNameWidget() const { | 40 | QString AddressBookPlugin::pixmapNameWidget() const { |
41 | return "AddressBook"; | 41 | return "AddressBook"; |
42 | } | 42 | } |
43 | 43 | ||
44 | QWidget* AddressBookPlugin::widget( QWidget *wid ) { | 44 | QWidget* AddressBookPlugin::widget( QWidget *wid ) { |
45 | return new AddressBookPluginWidget( wid, "AddressBook" ); | 45 | m_abWidget = new AddressBookPluginWidget( wid, "AddressBook" ); |
46 | return m_abWidget; | ||
46 | } | 47 | } |
47 | 48 | ||
48 | QString AddressBookPlugin::pixmapNameConfig() const { | 49 | QString AddressBookPlugin::pixmapNameConfig() const { |
49 | return "AddressBook"; | 50 | return "AddressBook"; |
50 | } | 51 | } |
51 | 52 | ||
52 | TodayConfigWidget* AddressBookPlugin::configWidget( QWidget* wid ) { | 53 | TodayConfigWidget* AddressBookPlugin::configWidget( QWidget* wid ) { |
53 | return new AddressBookPluginConfig( wid , "AddressBook" ); | 54 | return new AddressBookPluginConfig( wid , "AddressBook" ); |
54 | } | 55 | } |
55 | 56 | ||
56 | QString AddressBookPlugin::appName() const { | 57 | QString AddressBookPlugin::appName() const { |
57 | return "addressbook"; | 58 | return "addressbook"; |
58 | } | 59 | } |
59 | 60 | ||
60 | 61 | ||
61 | bool AddressBookPlugin::excludeFromRefresh() const { | 62 | bool AddressBookPlugin::excludeFromRefresh() const { |
62 | return true; | 63 | return false; |
64 | } | ||
65 | |||
66 | void AddressBookPlugin::refresh() | ||
67 | { | ||
68 | m_abWidget->refresh( NULL ); | ||
63 | } | 69 | } |
diff --git a/core/pim/today/plugins/addressbook/addressplugin.h b/core/pim/today/plugins/addressbook/addressplugin.h index 5b655f5..04e4faf 100644 --- a/core/pim/today/plugins/addressbook/addressplugin.h +++ b/core/pim/today/plugins/addressbook/addressplugin.h | |||
@@ -1,44 +1,50 @@ | |||
1 | /* | 1 | /* |
2 | * addressplugin.h | 2 | * addressplugin.h |
3 | * | 3 | * |
4 | * copyright : (c) 2003 by Stefan Eilers | 4 | * copyright : (c) 2003 by Stefan Eilers |
5 | * email : eilers.stefan@epost.de | 5 | * email : eilers.stefan@epost.de |
6 | * | 6 | * |
7 | * This implementation was derived from the todolist plugin implementation | 7 | * This implementation was derived from the todolist plugin implementation |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | /*************************************************************************** | 10 | /*************************************************************************** |
11 | * * | 11 | * * |
12 | * This program is free software; you can redistribute it and/or modify * | 12 | * This program is free software; you can redistribute it and/or modify * |
13 | * it under the terms of the GNU General Public License as published by * | 13 | * it under the terms of the GNU General Public License as published by * |
14 | * the Free Software Foundation; either version 2 of the License, or * | 14 | * the Free Software Foundation; either version 2 of the License, or * |
15 | * (at your option) any later version. * | 15 | * (at your option) any later version. * |
16 | * * | 16 | * * |
17 | ***************************************************************************/ | 17 | ***************************************************************************/ |
18 | 18 | ||
19 | #ifndef ADDRESSBOOK_PLUGIN_H | 19 | #ifndef ADDRESSBOOK_PLUGIN_H |
20 | #define ADDRESSBOOK_PLUGIN_H | 20 | #define ADDRESSBOOK_PLUGIN_H |
21 | 21 | ||
22 | #include <qstring.h> | 22 | #include <qstring.h> |
23 | #include <qwidget.h> | 23 | #include <qwidget.h> |
24 | 24 | ||
25 | #include <opie/oclickablelabel.h> | 25 | #include <opie/oclickablelabel.h> |
26 | #include <opie/todayplugininterface.h> | 26 | #include <opie/todayplugininterface.h> |
27 | 27 | ||
28 | #include "addresspluginwidget.h" | ||
29 | |||
28 | class AddressBookPlugin : public TodayPluginObject { | 30 | class AddressBookPlugin : public TodayPluginObject { |
29 | 31 | ||
30 | public: | 32 | public: |
31 | AddressBookPlugin(); | 33 | AddressBookPlugin(); |
32 | ~AddressBookPlugin(); | 34 | ~AddressBookPlugin(); |
33 | 35 | ||
34 | QString pluginName() const; | 36 | QString pluginName() const; |
35 | double versionNumber() const; | 37 | double versionNumber() const; |
36 | QString pixmapNameWidget() const; | 38 | QString pixmapNameWidget() const; |
37 | QWidget* widget(QWidget *); | 39 | QWidget* widget(QWidget *); |
38 | QString pixmapNameConfig() const; | 40 | QString pixmapNameConfig() const; |
39 | TodayConfigWidget* configWidget(QWidget *); | 41 | TodayConfigWidget* configWidget(QWidget *); |
40 | QString appName() const; | 42 | QString appName() const; |
41 | bool excludeFromRefresh() const; | 43 | bool excludeFromRefresh() const; |
44 | void refresh(); | ||
45 | |||
46 | private: | ||
47 | AddressBookPluginWidget* m_abWidget; | ||
42 | }; | 48 | }; |
43 | 49 | ||
44 | #endif | 50 | #endif |
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.h b/core/pim/today/plugins/addressbook/addresspluginwidget.h index 89ffe7f..63f2a2b 100644 --- a/core/pim/today/plugins/addressbook/addresspluginwidget.h +++ b/core/pim/today/plugins/addressbook/addresspluginwidget.h | |||
@@ -1,61 +1,63 @@ | |||
1 | /* | 1 | /* |
2 | * addresspluginwidget.h | 2 | * addresspluginwidget.h |
3 | * | 3 | * |
4 | * copyright : (c) 2003 by Stefan Eilers | 4 | * copyright : (c) 2003 by Stefan Eilers |
5 | * email : eilers.stefan@epost.de | 5 | * email : eilers.stefan@epost.de |
6 | * | 6 | * |
7 | * This implementation was derived from the todolist plugin implementation | 7 | * This implementation was derived from the todolist plugin implementation |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | /*************************************************************************** | 10 | /*************************************************************************** |
11 | * * | 11 | * * |
12 | * This program is free software; you can redistribute it and/or modify * | 12 | * This program is free software; you can redistribute it and/or modify * |
13 | * it under the terms of the GNU General Public License as published by * | 13 | * it under the terms of the GNU General Public License as published by * |
14 | * the Free Software Foundation; either version 2 of the License, or * | 14 | * the Free Software Foundation; either version 2 of the License, or * |
15 | * (at your option) any later version. * | 15 | * (at your option) any later version. * |
16 | * * | 16 | * * |
17 | ***************************************************************************/ | 17 | ***************************************************************************/ |
18 | 18 | ||
19 | #ifndef ADDRESSBOOK_PLUGIN_WIDGET_H | 19 | #ifndef ADDRESSBOOK_PLUGIN_WIDGET_H |
20 | #define ADDRESSBOOK_PLUGIN_WIDGET_H | 20 | #define ADDRESSBOOK_PLUGIN_WIDGET_H |
21 | 21 | ||
22 | #include <qstring.h> | 22 | #include <qstring.h> |
23 | #include <qwidget.h> | 23 | #include <qwidget.h> |
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | 25 | ||
26 | #include <opie/ocontactaccess.h> | 26 | #include <opie/ocontactaccess.h> |
27 | #include <opie/oclickablelabel.h> | 27 | #include <opie/oclickablelabel.h> |
28 | 28 | ||
29 | 29 | ||
30 | class AddressBookPluginWidget : public QWidget { | 30 | class AddressBookPluginWidget : public QWidget { |
31 | 31 | ||
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | 33 | ||
34 | public: | 34 | public: |
35 | AddressBookPluginWidget( QWidget *parent, const char *name ); | 35 | AddressBookPluginWidget( QWidget *parent, const char *name ); |
36 | ~AddressBookPluginWidget(); | 36 | ~AddressBookPluginWidget(); |
37 | 37 | ||
38 | public slots: | ||
39 | void refresh( const OContactAccess* db ); | ||
40 | |||
38 | protected slots: | 41 | protected slots: |
39 | void startAddressBook(); | 42 | void startAddressBook(); |
40 | void refresh( const OContactAccess* db ); | ||
41 | 43 | ||
42 | private: | 44 | private: |
43 | OClickableLabel* addressLabel; | 45 | OClickableLabel* addressLabel; |
44 | QVBoxLayout* layoutTodo; | 46 | QVBoxLayout* layoutTodo; |
45 | OContactAccess * m_contactdb; | 47 | OContactAccess * m_contactdb; |
46 | 48 | ||
47 | OContactAccess::List m_list; | 49 | OContactAccess::List m_list; |
48 | OContactAccess::List::Iterator m_it; | 50 | OContactAccess::List::Iterator m_it; |
49 | 51 | ||
50 | void readConfig(); | 52 | void readConfig(); |
51 | void getAddress(); | 53 | void getAddress(); |
52 | int m_maxLinesTask; | 54 | int m_maxLinesTask; |
53 | int m_maxCharClip; | 55 | int m_maxCharClip; |
54 | int m_daysLookAhead; | 56 | int m_daysLookAhead; |
55 | int m_urgentDays; | 57 | int m_urgentDays; |
56 | QString m_entryColor; | 58 | QString m_entryColor; |
57 | QString m_headlineColor; | 59 | QString m_headlineColor; |
58 | QString m_urgentColor; | 60 | QString m_urgentColor; |
59 | }; | 61 | }; |
60 | 62 | ||
61 | #endif | 63 | #endif |