summaryrefslogtreecommitdiff
path: root/core/pim
Unidiff
Diffstat (limited to 'core/pim') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/addressbook/addressplugin.cpp5
-rw-r--r--core/pim/today/plugins/addressbook/addressplugin.h1
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginconfig.cpp2
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginconfig.h2
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.cpp11
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.h1
-rw-r--r--core/pim/today/plugins/addressbook/opie-today-addressbookplugin.control2
7 files changed, 15 insertions, 9 deletions
diff --git a/core/pim/today/plugins/addressbook/addressplugin.cpp b/core/pim/today/plugins/addressbook/addressplugin.cpp
index a70f8d8..5d5d34c 100644
--- a/core/pim/today/plugins/addressbook/addressplugin.cpp
+++ b/core/pim/today/plugins/addressbook/addressplugin.cpp
@@ -62,8 +62,13 @@ QString AddressBookPlugin::appName() const {
62bool AddressBookPlugin::excludeFromRefresh() const { 62bool AddressBookPlugin::excludeFromRefresh() const {
63 return false; 63 return false;
64} 64}
65 65
66void AddressBookPlugin::refresh() 66void AddressBookPlugin::refresh()
67{ 67{
68 m_abWidget->refresh( NULL ); 68 m_abWidget->refresh( NULL );
69} 69}
70
71void AddressBookPlugin::reinitialize()
72{
73 m_abWidget->reinitialize();
74}
diff --git a/core/pim/today/plugins/addressbook/addressplugin.h b/core/pim/today/plugins/addressbook/addressplugin.h
index 04e4faf..0b3b065 100644
--- a/core/pim/today/plugins/addressbook/addressplugin.h
+++ b/core/pim/today/plugins/addressbook/addressplugin.h
@@ -37,14 +37,15 @@ public:
37 double versionNumber() const; 37 double versionNumber() const;
38 QString pixmapNameWidget() const; 38 QString pixmapNameWidget() const;
39 QWidget* widget(QWidget *); 39 QWidget* widget(QWidget *);
40 QString pixmapNameConfig() const; 40 QString pixmapNameConfig() const;
41 TodayConfigWidget* configWidget(QWidget *); 41 TodayConfigWidget* configWidget(QWidget *);
42 QString appName() const; 42 QString appName() const;
43 bool excludeFromRefresh() const; 43 bool excludeFromRefresh() const;
44 void refresh(); 44 void refresh();
45 void reinitialize();
45 46
46 private: 47 private:
47 AddressBookPluginWidget* m_abWidget; 48 AddressBookPluginWidget* m_abWidget;
48}; 49};
49 50
50#endif 51#endif
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
index 9c65e7d..b79c679 100644
--- a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
@@ -73,17 +73,16 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
73 // Look ahead settings 73 // Look ahead settings
74 QHBox *box3 = new QHBox( this ); 74 QHBox *box3 = new QHBox( this );
75 QLabel* daysLabel = new QLabel( box3, "" ); 75 QLabel* daysLabel = new QLabel( box3, "" );
76 daysLabel->setText( tr( "Days look ahead: " ) ); 76 daysLabel->setText( tr( "Days look ahead: " ) );
77 SpinDaysClip = new QSpinBox( box3, "SpinDays" ); 77 SpinDaysClip = new QSpinBox( box3, "SpinDays" );
78 SpinDaysClip->setMaxValue( 200 ); 78 SpinDaysClip->setMaxValue( 200 );
79 QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); 79 QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) );
80 80
81 // Headline color settings
82 QHBox *box5 = new QHBox( this ); 81 QHBox *box5 = new QHBox( this );
83 QLabel* colorLabel2 = new QLabel( box5, "" ); 82 QLabel* colorLabel2 = new QLabel( box5, "" );
84 colorLabel2->setText( tr( "Set Headline Color: " ) ); 83 colorLabel2->setText( tr( "Set Headline Color: " ) );
85 headlineColor = new OColorButton( box5, black , "headlineColor" ); 84 headlineColor = new OColorButton( box5, black , "headlineColor" );
86 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) ); 85 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) );
87 QHBox *box6 = new QHBox( this ); 86 QHBox *box6 = new QHBox( this );
88 87
89 // Entry color settings 88 // Entry color settings
@@ -101,17 +100,16 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
101 QLabel* colorLabel6 = new QLabel( box7, "" ); 100 QLabel* colorLabel6 = new QLabel( box7, "" );
102 colorLabel6->setText( tr( " days: " ) ); 101 colorLabel6->setText( tr( " days: " ) );
103 urgentColor = new OColorButton( box7, red , "urgentColor" ); 102 urgentColor = new OColorButton( box7, red , "urgentColor" );
104 QWhatsThis::add( urgentColor , tr( "This urgent color will be used if we are close to the event !" ) ); 103 QWhatsThis::add( urgentColor , tr( "This urgent color will be used if we are close to the event !" ) );
105 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) ); 104 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) );
106 105
107 106
108 layout->addWidget( b_group ); 107 layout->addWidget( b_group );
109 // layout->addWidget( box4 );
110 layout->addWidget( box1 ); 108 layout->addWidget( box1 );
111 // layout->addWidget( box2 ); 109 // layout->addWidget( box2 );
112 layout->addWidget( box3 ); 110 layout->addWidget( box3 );
113 layout->addWidget( box5 ); 111 layout->addWidget( box5 );
114 layout->addWidget( box6 ); 112 layout->addWidget( box6 );
115 layout->addWidget( box7 ); 113 layout->addWidget( box7 );
116 114
117 readConfig(); 115 readConfig();
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.h b/core/pim/today/plugins/addressbook/addresspluginconfig.h
index 5e07aa3..5626e5d 100644
--- a/core/pim/today/plugins/addressbook/addresspluginconfig.h
+++ b/core/pim/today/plugins/addressbook/addresspluginconfig.h
@@ -22,17 +22,17 @@
22#include <qwidget.h> 22#include <qwidget.h>
23#include <qspinbox.h> 23#include <qspinbox.h>
24#include <qradiobutton.h> 24#include <qradiobutton.h>
25 25
26#include <opie/todayconfigwidget.h> 26#include <opie/todayconfigwidget.h>
27#include <opie/ocolorbutton.h> 27#include <opie/ocolorbutton.h>
28 28
29class AddressBookPluginConfig : public TodayConfigWidget { 29class AddressBookPluginConfig : public TodayConfigWidget {
30 30 Q_OBJECT
31 31
32public: 32public:
33 33
34 AddressBookPluginConfig( QWidget *parent, const char *name ); 34 AddressBookPluginConfig( QWidget *parent, const char *name );
35 ~AddressBookPluginConfig(); 35 ~AddressBookPluginConfig();
36 36
37private: 37private:
38 /** 38 /**
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
index 498de28..dad09db 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
@@ -59,16 +59,20 @@ AddressBookPluginWidget::~AddressBookPluginWidget() {
59 59
60void AddressBookPluginWidget::refresh( const OContactAccess* ) 60void AddressBookPluginWidget::refresh( const OContactAccess* )
61{ 61{
62 qWarning(" AddressBookPluginWidget::Database was changed externally ! "); 62 qWarning(" AddressBookPluginWidget::Database was changed externally ! ");
63 m_contactdb->reload(); 63 m_contactdb->reload();
64 getAddress(); 64 getAddress();
65} 65}
66 66
67void AddressBookPluginWidget::reinitialize() {
68 readConfig();
69 getAddress();
70}
67 71
68void AddressBookPluginWidget::readConfig() { 72void AddressBookPluginWidget::readConfig() {
69 Config cfg( "todayaddressplugin" ); 73 Config cfg( "todayaddressplugin" );
70 cfg.setGroup( "config" ); 74 cfg.setGroup( "config" );
71 m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); 75 m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 );
72 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); 76 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
73 m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); 77 m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 );
74 m_urgentDays = cfg.readNumEntry( "urgentdays", 7 ); 78 m_urgentDays = cfg.readNumEntry( "urgentdays", 7 );
@@ -93,37 +97,34 @@ void AddressBookPluginWidget::getAddress() {
93 addressLabel = new OClickableLabel( this ); 97 addressLabel = new OClickableLabel( this );
94 connect( addressLabel, SIGNAL( clicked() ), this, SLOT( startAddressBook() ) ); 98 connect( addressLabel, SIGNAL( clicked() ), this, SLOT( startAddressBook() ) );
95 layoutTodo->addWidget( addressLabel ); 99 layoutTodo->addWidget( addressLabel );
96 } 100 }
97 101
98 QString output; 102 QString output;
99 103
100 // Check whether the database provide the search option.. 104 // Check whether the database provide the search option..
101 // The following if-statement was replaced due to a bug in some 105 if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){
102 // implementations of libopie. The replacement should work everywhere..(eilers)
103 // if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){
104 if ( !( m_contactdb->querySettings() & OContactAccess::DateDiff ) ){
105 // Libopie seems to be old.. 106 // Libopie seems to be old..
106 output = QObject::tr( "Database does not provide this search query ! Please upgrade libOpie !<br>" ); 107 output = QObject::tr( "Database does not provide this search query ! Please upgrade libOpie !<br>" );
107 addressLabel->setText( output ); 108 addressLabel->setText( output );
108 return; 109 return;
109 } 110 }
110 111
111 // Define the query for birthdays and start search.. 112 // Define the query for birthdays and start search..
112 QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead ); 113 QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead );
113 int ammount = 0; 114 int ammount = 0;
114 if ( m_showBirthdays ){ 115 if ( m_showBirthdays ){
115 qWarning("Searching from now (%s) until %s ! ", 116 qWarning("Searching from now (%s) until %s ! ",
116 QDate::currentDate().toString().latin1(), 117 QDate::currentDate().toString().latin1(),
117 lookAheadDate.toString().latin1() ); 118 lookAheadDate.toString().latin1() );
119
118 OContact querybirthdays; 120 OContact querybirthdays;
119 querybirthdays.setBirthday( lookAheadDate ); 121 querybirthdays.setBirthday( lookAheadDate );
120 122
121
122 m_list = m_contactdb->queryByExample( querybirthdays, 123 m_list = m_contactdb->queryByExample( querybirthdays,
123 OContactAccess::DateDiff ); 124 OContactAccess::DateDiff );
124 if ( m_list.count() > 0 ){ 125 if ( m_list.count() > 0 ){
125 output = "<font color=" + m_headlineColor + ">" 126 output = "<font color=" + m_headlineColor + ">"
126 + QObject::tr( "Next birthdays in <b> %1 </b> days:" ) 127 + QObject::tr( "Next birthdays in <b> %1 </b> days:" )
127 .arg( m_daysLookAhead ) 128 .arg( m_daysLookAhead )
128 + "</font> <br>"; 129 + "</font> <br>";
129 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { 130 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.h b/core/pim/today/plugins/addressbook/addresspluginwidget.h
index cf2ecce..b0e3811 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.h
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.h
@@ -30,16 +30,17 @@
30class AddressBookPluginWidget : public QWidget { 30class AddressBookPluginWidget : public QWidget {
31 31
32 Q_OBJECT 32 Q_OBJECT
33 33
34public: 34public:
35 AddressBookPluginWidget( QWidget *parent, const char *name ); 35 AddressBookPluginWidget( QWidget *parent, const char *name );
36 ~AddressBookPluginWidget(); 36 ~AddressBookPluginWidget();
37 37
38 void reinitialize();
38public slots: 39public slots:
39 void refresh( const OContactAccess* db ); 40 void refresh( const OContactAccess* db );
40 41
41protected slots: 42protected slots:
42 void startAddressBook(); 43 void startAddressBook();
43 44
44private: 45private:
45 OClickableLabel* addressLabel; 46 OClickableLabel* addressLabel;
diff --git a/core/pim/today/plugins/addressbook/opie-today-addressbookplugin.control b/core/pim/today/plugins/addressbook/opie-today-addressbookplugin.control
index 9fe23b6..1876eb8 100644
--- a/core/pim/today/plugins/addressbook/opie-today-addressbookplugin.control
+++ b/core/pim/today/plugins/addressbook/opie-today-addressbookplugin.control
@@ -1,9 +1,9 @@
1Package: opie-today-addressbookplugin 1Package: opie-today-addressbookplugin
2Files: plugins/today/libtodayaddressbookplugin.so* 2Files: plugins/today/libtodayaddressbookplugin.so*
3Priority: optional 3Priority: optional
4Section: opie/applications 4Section: opie/applications
5Maintainer: Stefan Eilers <eilers.stefan@epost.de> 5Maintainer: Stefan Eilers <eilers.stefan@epost.de>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION
8Depends: libqte2, opie-today 7Depends: libqte2, opie-today
9Description: Addressbook plugin for today shows Birthdays and Anniversaries 8Description: Addressbook plugin for today shows Birthdays and Anniversaries
9Version: $QPE_VERSION$EXTRAVERSION