author | eilers <eilers> | 2003-01-13 13:17:17 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-01-13 13:17:17 (UTC) |
commit | 55266a0b221b065a94dc1a83860f9603c1d3c2c5 (patch) (unidiff) | |
tree | d5f25e9c77d35dc90d4881d04854cc1a5ae4eabc /core/pim/today/plugins/addressbook/addresspluginwidget.cpp | |
parent | aa4f80fdc2d78bfe1c1d4cb8ec1d852115d00fc7 (diff) | |
download | opie-55266a0b221b065a94dc1a83860f9603c1d3c2c5.zip opie-55266a0b221b065a94dc1a83860f9603c1d3c2c5.tar.gz opie-55266a0b221b065a94dc1a83860f9603c1d3c2c5.tar.bz2 |
Bugfixed and improved color settings ! Now it is possible to change
the color if the anniversary/birthday is close.. :)
Diffstat (limited to 'core/pim/today/plugins/addressbook/addresspluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/plugins/addressbook/addresspluginwidget.cpp | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp index c81beee..7d87fca 100644 --- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp +++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp | |||
@@ -70,6 +70,9 @@ void AddressBookPluginWidget::readConfig() { | |||
70 | cfg.setGroup( "config" ); | 70 | cfg.setGroup( "config" ); |
71 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); | 71 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); |
72 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); | 72 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); |
73 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); | 73 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); |
74 | m_entryColor = cfg.readEntry("entrycolor", Qt::red.name() ); | 74 | m_urgentDays = cfg.readNumEntry( "urgentdays", 7 ); |
75 | m_entryColor = cfg.readEntry("entrycolor", Qt::black.name() ); | ||
76 | m_headlineColor = cfg.readEntry( "headlinecolor", Qt::black.name() ); | ||
77 | m_urgentColor = cfg.readEntry( "urgentcolor", Qt::red.name() ); | ||
75 | } | 78 | } |
@@ -108,3 +111,5 @@ void AddressBookPluginWidget::getAddress() { | |||
108 | if ( m_list.count() > 0 ){ | 111 | if ( m_list.count() > 0 ){ |
109 | output = QObject::tr( "Next birthdays in <b> %1 </b> days: <br>" ).arg( m_daysLookAhead ); | 112 | output = "<font color=" + m_headlineColor + ">" |
113 | + QObject::tr( "Next birthdays in <b> %1 </b> days:" ).arg( m_daysLookAhead ) | ||
114 | + "</font> <br>"; | ||
110 | for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { | 115 | for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { |
@@ -118,6 +123,14 @@ void AddressBookPluginWidget::getAddress() { | |||
118 | 123 | ||
119 | output += "<font color=" + m_entryColor + "><b>-" + (*m_it).fullName() | 124 | |
120 | + " (" | 125 | if ( QDate::currentDate().daysTo(destdate) < m_urgentDays ) |
121 | + QString::number(QDate::currentDate().daysTo(destdate)) | 126 | output += "<font color=" + m_urgentColor + "><b>-" + (*m_it).fullName() |
122 | + " Days) </b></font><br>"; | 127 | + " (" |
128 | + QString::number(QDate::currentDate().daysTo(destdate)) | ||
129 | + " Days) </b></font><br>"; | ||
130 | |||
131 | else | ||
132 | output += "<font color=" + m_entryColor + "><b>-" + (*m_it).fullName() | ||
133 | + " (" | ||
134 | + QString::number(QDate::currentDate().daysTo(destdate)) | ||
135 | + " Days) </b></font><br>"; | ||
123 | } | 136 | } |
@@ -125,3 +138,5 @@ void AddressBookPluginWidget::getAddress() { | |||
125 | } else { | 138 | } else { |
126 | output = QObject::tr( "No birthdays in <b> %1 </b> days! <br>" ).arg( m_daysLookAhead ); | 139 | output = "<font color=" + m_headlineColor + ">" |
140 | + QObject::tr( "No birthdays in <b> %1 </b> days!" ).arg( m_daysLookAhead ) | ||
141 | + "</font> <br>"; | ||
127 | } | 142 | } |
@@ -136,3 +151,5 @@ void AddressBookPluginWidget::getAddress() { | |||
136 | if ( m_list.count() > 0 ){ | 151 | if ( m_list.count() > 0 ){ |
137 | output += QObject::tr( "Next anniversaries in <b> %1 </b> days: <br>" ).arg( m_daysLookAhead ); | 152 | output += "<font color=" + m_headlineColor + ">" |
153 | + QObject::tr( "Next anniversaries in <b> %1 </b> days:" ).arg( m_daysLookAhead ) | ||
154 | + "</font> <br>"; | ||
138 | for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { | 155 | for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { |
@@ -146,6 +163,12 @@ void AddressBookPluginWidget::getAddress() { | |||
146 | 163 | ||
147 | output += "<font color=#e00000><b>-" + (*m_it).fullName() | 164 | if ( QDate::currentDate().daysTo(destdate) < m_urgentDays ) |
148 | + " (" | 165 | output += "<font color=" + m_urgentColor + "><b>-" + (*m_it).fullName() |
149 | + QString::number(QDate::currentDate().daysTo( destdate ) ) | 166 | + " (" |
150 | + " Days) </b></font><br>"; | 167 | + QString::number(QDate::currentDate().daysTo( destdate ) ) |
168 | + " Days) </b></font><br>"; | ||
169 | else | ||
170 | output += "<font color=" + m_entryColor + "><b>-" + (*m_it).fullName() | ||
171 | + " (" | ||
172 | + QString::number(QDate::currentDate().daysTo( destdate ) ) | ||
173 | + " Days) </b></font><br>"; | ||
151 | } | 174 | } |
@@ -153,3 +176,5 @@ void AddressBookPluginWidget::getAddress() { | |||
153 | } else { | 176 | } else { |
154 | output += QObject::tr( "No anniversaries in <b> %1 </b> days! <br>" ).arg( m_daysLookAhead ); | 177 | output += "<font color=" + m_headlineColor + ">" |
178 | + QObject::tr( "No anniversaries in <b> %1 </b> days!" ).arg( m_daysLookAhead ) | ||
179 | + "</font> <br>"; | ||
155 | } | 180 | } |