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 @@ -37,7 +37,7 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* QVGroupBox* b_group = new QVGroupBox( this, "name" ); 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 @@ -25,5 +25,5 @@ #include <qwidget.h> #include <qspinbox.h> -#include <qradiobutton.h> +#include <qcheckbox.h> class AddressBookPluginConfig : public TodayConfigWidget { @@ -50,6 +50,6 @@ private: Opie::OColorButton* headlineColor; Opie::OColorButton* urgentColor; - QRadioButton* m_showBirthdayButton; - QRadioButton* m_showAnniversaryButton; + QCheckBox* m_showBirthdayButton; + QCheckBox* m_showAnniversaryButton; // how many lines should be showed in the AddressBook section 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 @@ -103,56 +103,56 @@ void AddressBookPluginWidget::getAddress() { owarn << "Searching from now (" << QDate::currentDate().toString() << ") until " << 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>"; } - } + } if ( m_showAnniversaries ){ |