summaryrefslogtreecommitdiff
path: root/core/pim/today
Unidiff
Diffstat (limited to 'core/pim/today') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginconfig.cpp4
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginconfig.h6
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.cpp94
3 files changed, 52 insertions, 52 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
index 7b6117e..4f1630d 100644
--- a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
@@ -38,5 +38,5 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
38 b_group -> setTitle( tr("Enable/Disable Views") ); 38 b_group -> setTitle( tr("Enable/Disable Views") );
39 m_showBirthdayButton = new QRadioButton( b_group ); 39 m_showBirthdayButton = new QCheckBox( b_group );
40 m_showBirthdayButton -> setText( tr( "Show &Birthdays" ) ); 40 m_showBirthdayButton -> setText( tr( "Show &Birthdays" ) );
41 m_showAnniversaryButton = new QRadioButton( b_group ); 41 m_showAnniversaryButton = new QCheckBox( b_group );
42 m_showAnniversaryButton -> setText( tr( "Show &Anniveraries" ) ); 42 m_showAnniversaryButton -> setText( tr( "Show &Anniveraries" ) );
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.h b/core/pim/today/plugins/addressbook/addresspluginconfig.h
index e065ca2..1284fdc 100644
--- a/core/pim/today/plugins/addressbook/addresspluginconfig.h
+++ b/core/pim/today/plugins/addressbook/addresspluginconfig.h
@@ -26,3 +26,3 @@
26#include <qspinbox.h> 26#include <qspinbox.h>
27#include <qradiobutton.h> 27#include <qcheckbox.h>
28 28
@@ -51,4 +51,4 @@ private:
51 Opie::OColorButton* urgentColor; 51 Opie::OColorButton* urgentColor;
52 QRadioButton* m_showBirthdayButton; 52 QCheckBox* m_showBirthdayButton;
53 QRadioButton* m_showAnniversaryButton; 53 QCheckBox* m_showAnniversaryButton;
54 54
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
index df7c5e1..5662af2 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
@@ -104,54 +104,54 @@ void AddressBookPluginWidget::getAddress() {
104 << lookAheadDate.toString() << " ! " << oendl; 104 << lookAheadDate.toString() << " ! " << oendl;
105 }
106
107 if ( m_contactdb->hasQuerySettings( Opie::OPimContactAccess::DateDiff ) ){
108
109
110 Opie::OPimContact querybirthdays;
111 querybirthdays.setBirthday( lookAheadDate );
112 105
113 m_list = m_contactdb->queryByExample( querybirthdays, 106 if ( m_contactdb->hasQuerySettings( Opie::OPimContactAccess::DateDiff ) ){
114 Opie::OPimContactAccess::DateDiff ); 107
115 if ( m_list.count() > 0 ){ 108
116 output = "<font color=" + m_headlineColor + ">" 109 Opie::OPimContact querybirthdays;
117 + QObject::tr( "Next birthdays in <b> %1 </b> days:" ) 110 querybirthdays.setBirthday( lookAheadDate );
118 .arg( m_daysLookAhead ) 111
119 + "</font> <br>"; 112 m_list = m_contactdb->queryByExample( querybirthdays,
120 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { 113 Opie::OPimContactAccess::DateDiff );
121 if ( ammount++ < m_maxLinesTask ){ 114 if ( m_list.count() > 0 ){
122 // Now we want to calculate how many days 115 output = "<font color=" + m_headlineColor + ">"
123 //until birthday. We have to set 116 + QObject::tr( "Next birthdays in <b> %1 </b> days:" )
124 // the correct year to calculate the day diff... 117 .arg( m_daysLookAhead )
125 QDate destdate = (*m_it).birthday(); 118 + "</font> <br>";
126 destdate.setYMD( QDate::currentDate().year(), 119 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
127 destdate.month(), destdate.day() ); 120 if ( ammount++ < m_maxLinesTask ){
128 if ( QDate::currentDate().daysTo(destdate) < 0 ) 121 // Now we want to calculate how many days
129 destdate.setYMD( QDate::currentDate().year()+1, 122 //until birthday. We have to set
123 // the correct year to calculate the day diff...
124 QDate destdate = (*m_it).birthday();
125 destdate.setYMD( QDate::currentDate().year(),
130 destdate.month(), destdate.day() ); 126 destdate.month(), destdate.day() );
131 127 if ( QDate::currentDate().daysTo(destdate) < 0 )
132 128 destdate.setYMD( QDate::currentDate().year()+1,
133 if ( QDate::currentDate().daysTo(destdate) < m_urgentDays ) 129 destdate.month(), destdate.day() );
134 output += "<font color=" + m_urgentColor + "><b>-" 130
135 + (*m_it).fullName() 131
136 + " (" 132 if ( QDate::currentDate().daysTo(destdate) < m_urgentDays )
137 + QString::number(QDate::currentDate() 133 output += "<font color=" + m_urgentColor + "><b>-"
138 .daysTo(destdate)) 134 + (*m_it).fullName()
139 + " Days) </b></font><br>"; 135 + " ("
140 136 + QString::number(QDate::currentDate()
141 else 137 .daysTo(destdate))
142 output += "<font color=" + m_entryColor + "><b>-" 138 + " Days) </b></font><br>";
143 + (*m_it).fullName() 139
144 + " (" 140 else
145 + QString::number(QDate::currentDate() 141 output += "<font color=" + m_entryColor + "><b>-"
146 .daysTo(destdate)) 142 + (*m_it).fullName()
147 + " Days) </b></font><br>"; 143 + " ("
144 + QString::number(QDate::currentDate()
145 .daysTo(destdate))
146 + " Days) </b></font><br>";
147 }
148 } 148 }
149 } else {
150 output = "<font color=" + m_headlineColor + ">"
151 + QObject::tr( "No birthdays in <b> %1 </b> days!" )
152 .arg( m_daysLookAhead )
153 + "</font> <br>";
149 } 154 }
150 } else {
151 output = "<font color=" + m_headlineColor + ">"
152 + QObject::tr( "No birthdays in <b> %1 </b> days!" )
153 .arg( m_daysLookAhead )
154 + "</font> <br>";
155 } 155 }
156 } 156 }
157 157