author | eilers <eilers> | 2003-08-01 12:44:27 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-08-01 12:44:27 (UTC) |
commit | 79e5e877ad1a42cf6486db94a2face8f8107ff8c (patch) (unidiff) | |
tree | 36dbcce317bfca3ad8775d864fef511d2ab3a769 | |
parent | 6c715b67a8f0e32a4edca5be91332622834c8d91 (diff) | |
download | opie-79e5e877ad1a42cf6486db94a2face8f8107ff8c.zip opie-79e5e877ad1a42cf6486db94a2face8f8107ff8c.tar.gz opie-79e5e877ad1a42cf6486db94a2face8f8107ff8c.tar.bz2 |
Merging changes in BRANCH_1_0 into HEAD
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 | |||
@@ -64,6 +64,11 @@ bool AddressBookPlugin::excludeFromRefresh() const { | |||
64 | } | 64 | } |
65 | 65 | ||
66 | void AddressBookPlugin::refresh() | 66 | void AddressBookPlugin::refresh() |
67 | { | 67 | { |
68 | m_abWidget->refresh( NULL ); | 68 | m_abWidget->refresh( NULL ); |
69 | } | 69 | } |
70 | |||
71 | void 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 | |||
@@ -39,12 +39,13 @@ public: | |||
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 | |||
@@ -75,13 +75,12 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* | |||
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 ); |
@@ -103,13 +102,12 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* | |||
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 ); |
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 | |||
@@ -24,13 +24,13 @@ | |||
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 | ||
29 | class AddressBookPluginConfig : public TodayConfigWidget { | 29 | class AddressBookPluginConfig : public TodayConfigWidget { |
30 | 30 | Q_OBJECT | |
31 | 31 | ||
32 | public: | 32 | public: |
33 | 33 | ||
34 | AddressBookPluginConfig( QWidget *parent, const char *name ); | 34 | AddressBookPluginConfig( QWidget *parent, const char *name ); |
35 | ~AddressBookPluginConfig(); | 35 | ~AddressBookPluginConfig(); |
36 | 36 | ||
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 | |||
@@ -61,12 +61,16 @@ void 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 | ||
67 | void AddressBookPluginWidget::reinitialize() { | ||
68 | readConfig(); | ||
69 | getAddress(); | ||
70 | } | ||
67 | 71 | ||
68 | void AddressBookPluginWidget::readConfig() { | 72 | void 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 ); |
@@ -95,16 +99,13 @@ void AddressBookPluginWidget::getAddress() { | |||
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 | ||
@@ -112,16 +113,16 @@ void AddressBookPluginWidget::getAddress() { | |||
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 ) |
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 | |||
@@ -32,12 +32,13 @@ class AddressBookPluginWidget : public QWidget { | |||
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 | void reinitialize(); | ||
38 | public slots: | 39 | public slots: |
39 | void refresh( const OContactAccess* db ); | 40 | void refresh( const OContactAccess* db ); |
40 | 41 | ||
41 | protected slots: | 42 | protected slots: |
42 | void startAddressBook(); | 43 | void startAddressBook(); |
43 | 44 | ||
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 @@ | |||
1 | Package: opie-today-addressbookplugin | 1 | Package: opie-today-addressbookplugin |
2 | Files: plugins/today/libtodayaddressbookplugin.so* | 2 | Files: plugins/today/libtodayaddressbookplugin.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Stefan Eilers <eilers.stefan@epost.de> | 5 | Maintainer: Stefan Eilers <eilers.stefan@epost.de> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: libqte2, opie-today | 7 | Depends: libqte2, opie-today |
9 | Description: Addressbook plugin for today shows Birthdays and Anniversaries | 8 | Description: Addressbook plugin for today shows Birthdays and Anniversaries |
9 | Version: $QPE_VERSION$EXTRAVERSION | ||