author | drw <drw> | 2005-06-06 19:09:03 (UTC) |
---|---|---|
committer | drw <drw> | 2005-06-06 19:09:03 (UTC) |
commit | 9ccde964284da2c2dcc42da5e04f818e45baa148 (patch) (side-by-side diff) | |
tree | aafeed7ef6bcceaf1271a7f3b748b3fd9634c0f6 | |
parent | 85a043b065f0b43470bc15dc6594eb520f379505 (diff) | |
download | opie-9ccde964284da2c2dcc42da5e04f818e45baa148.zip opie-9ccde964284da2c2dcc42da5e04f818e45baa148.tar.gz opie-9ccde964284da2c2dcc42da5e04f818e45baa148.tar.bz2 |
Fix to show/not show birthdays and use checkboxes for selection in plugin config dialog (courtesy of hrw)
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* b_group -> setTitle( tr("Enable/Disable Views") ); - m_showBirthdayButton = new QRadioButton( b_group ); + m_showBirthdayButton = new QCheckBox( b_group ); m_showBirthdayButton -> setText( tr( "Show &Birthdays" ) ); - m_showAnniversaryButton = new QRadioButton( b_group ); + m_showAnniversaryButton = new QCheckBox( b_group ); 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 @@ #include <qspinbox.h> -#include <qradiobutton.h> +#include <qcheckbox.h> @@ -51,4 +51,4 @@ private: Opie::OColorButton* urgentColor; - QRadioButton* m_showBirthdayButton; - QRadioButton* m_showAnniversaryButton; + QCheckBox* m_showBirthdayButton; + QCheckBox* m_showAnniversaryButton; 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() { << lookAheadDate.toString() << " ! " << oendl; - } - - if ( m_contactdb->hasQuerySettings( Opie::OPimContactAccess::DateDiff ) ){ - - - Opie::OPimContact querybirthdays; - querybirthdays.setBirthday( lookAheadDate ); - m_list = m_contactdb->queryByExample( querybirthdays, - Opie::OPimContactAccess::DateDiff ); - if ( m_list.count() > 0 ){ - output = "<font color=" + m_headlineColor + ">" - + QObject::tr( "Next birthdays in <b> %1 </b> days:" ) - .arg( m_daysLookAhead ) - + "</font> <br>"; - for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { - if ( ammount++ < m_maxLinesTask ){ - // Now we want to calculate how many days - //until birthday. We have to set - // the correct year to calculate the day diff... - QDate destdate = (*m_it).birthday(); - destdate.setYMD( QDate::currentDate().year(), - destdate.month(), destdate.day() ); - if ( QDate::currentDate().daysTo(destdate) < 0 ) - destdate.setYMD( QDate::currentDate().year()+1, + if ( m_contactdb->hasQuerySettings( Opie::OPimContactAccess::DateDiff ) ){ + + + Opie::OPimContact querybirthdays; + querybirthdays.setBirthday( lookAheadDate ); + + m_list = m_contactdb->queryByExample( querybirthdays, + Opie::OPimContactAccess::DateDiff ); + if ( m_list.count() > 0 ){ + output = "<font color=" + m_headlineColor + ">" + + QObject::tr( "Next birthdays in <b> %1 </b> days:" ) + .arg( m_daysLookAhead ) + + "</font> <br>"; + for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { + if ( ammount++ < m_maxLinesTask ){ + // Now we want to calculate how many days + //until birthday. We have to set + // the correct year to calculate the day diff... + QDate destdate = (*m_it).birthday(); + destdate.setYMD( QDate::currentDate().year(), destdate.month(), destdate.day() ); - - - if ( QDate::currentDate().daysTo(destdate) < m_urgentDays ) - output += "<font color=" + m_urgentColor + "><b>-" - + (*m_it).fullName() - + " (" - + QString::number(QDate::currentDate() - .daysTo(destdate)) - + " Days) </b></font><br>"; - - else - output += "<font color=" + m_entryColor + "><b>-" - + (*m_it).fullName() - + " (" - + QString::number(QDate::currentDate() - .daysTo(destdate)) - + " Days) </b></font><br>"; + if ( QDate::currentDate().daysTo(destdate) < 0 ) + destdate.setYMD( QDate::currentDate().year()+1, + destdate.month(), destdate.day() ); + + + if ( QDate::currentDate().daysTo(destdate) < m_urgentDays ) + output += "<font color=" + m_urgentColor + "><b>-" + + (*m_it).fullName() + + " (" + + QString::number(QDate::currentDate() + .daysTo(destdate)) + + " Days) </b></font><br>"; + + else + output += "<font color=" + m_entryColor + "><b>-" + + (*m_it).fullName() + + " (" + + QString::number(QDate::currentDate() + .daysTo(destdate)) + + " Days) </b></font><br>"; + } } + } else { + output = "<font color=" + m_headlineColor + ">" + + QObject::tr( "No birthdays in <b> %1 </b> days!" ) + .arg( m_daysLookAhead ) + + "</font> <br>"; } - } else { - output = "<font color=" + m_headlineColor + ">" - + QObject::tr( "No birthdays in <b> %1 </b> days!" ) - .arg( m_daysLookAhead ) - + "</font> <br>"; } - } + } |