summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/addressbook
Unidiff
Diffstat (limited to 'core/pim/today/plugins/addressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginconfig.cpp10
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.cpp12
2 files changed, 16 insertions, 6 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
index b79c679..8863192 100644
--- a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
@@ -69,24 +69,30 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
69 SpinBoxClip->setMaxValue( 200 ); 69 SpinBoxClip->setMaxValue( 200 );
70 QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) ); 70 QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) );
71#endif 71#endif
72 72
73 // Look ahead settings 73 // Look ahead settings
74 QHBox *box3 = new QHBox( this ); 74 QHBox *box3 = new QHBox( this );
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// QHBox *box4 = new QHBox( this );
82
83// QLabel* colorLabel = new QLabel( box4, "" );
84// colorLabel->setText( tr( "To activate settings: Restart application !" ) );
85
86
81 QHBox *box5 = new QHBox( this ); 87 QHBox *box5 = new QHBox( this );
82 QLabel* colorLabel2 = new QLabel( box5, "" ); 88 QLabel* colorLabel2 = new QLabel( box5, "" );
83 colorLabel2->setText( tr( "Set Headline Color: " ) ); 89 colorLabel2->setText( tr( "Set Headline Color: " ) );
84 headlineColor = new OColorButton( box5, black , "headlineColor" ); 90 headlineColor = new OColorButton( box5, black , "headlineColor" );
85 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) ); 91 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) );
86 QHBox *box6 = new QHBox( this ); 92 QHBox *box6 = new QHBox( this );
87 93
88 // Entry color settings 94 // Entry color settings
89 QLabel* colorLabel3= new QLabel( box6, "" ); 95 QLabel* colorLabel3= new QLabel( box6, "" );
90 colorLabel3->setText( tr( "Set Entry Color: " ) ); 96 colorLabel3->setText( tr( "Set Entry Color: " ) );
91 entryColor = new OColorButton( box6, black , "entryColor" ); 97 entryColor = new OColorButton( box6, black , "entryColor" );
92 QWhatsThis::add( entryColor , tr( "This color will be used for shown birthdays/anniversaries !" ) ); 98 QWhatsThis::add( entryColor , tr( "This color will be used for shown birthdays/anniversaries !" ) );
@@ -95,27 +101,27 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
95 QHBox *box7 = new QHBox( this ); 101 QHBox *box7 = new QHBox( this );
96 QLabel* colorLabel5 = new QLabel( box7, "" ); 102 QLabel* colorLabel5 = new QLabel( box7, "" );
97 colorLabel5->setText( tr( "Set Urgent\nColor if below " ) ); 103 colorLabel5->setText( tr( "Set Urgent\nColor if below " ) );
98 SpinUrgentClip = new QSpinBox( box7, "SpinDays" ); 104 SpinUrgentClip = new QSpinBox( box7, "SpinDays" );
99 SpinUrgentClip->setMaxValue( 200 ); 105 SpinUrgentClip->setMaxValue( 200 );
100 QLabel* colorLabel6 = new QLabel( box7, "" ); 106 QLabel* colorLabel6 = new QLabel( box7, "" );
101 colorLabel6->setText( tr( " days: " ) ); 107 colorLabel6->setText( tr( " days: " ) );
102 urgentColor = new OColorButton( box7, red , "urgentColor" ); 108 urgentColor = new OColorButton( box7, red , "urgentColor" );
103 QWhatsThis::add( urgentColor , tr( "This urgent color will be used if we are close to the event !" ) ); 109 QWhatsThis::add( urgentColor , tr( "This urgent color will be used if we are close to the event !" ) );
104 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) ); 110 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) );
105 111
106 112
107 layout->addWidget( b_group ); 113 //layout->addWidget( box4 );
108 layout->addWidget( box1 ); 114 layout->addWidget( box1 );
109 // layout->addWidget( box2 ); 115 //layout->addWidget( box2 );
110 layout->addWidget( box3 ); 116 layout->addWidget( box3 );
111 layout->addWidget( box5 ); 117 layout->addWidget( box5 );
112 layout->addWidget( box6 ); 118 layout->addWidget( box6 );
113 layout->addWidget( box7 ); 119 layout->addWidget( box7 );
114 120
115 readConfig(); 121 readConfig();
116 122
117} 123}
118 124
119void AddressBookPluginConfig::readConfig() { 125void AddressBookPluginConfig::readConfig() {
120 Config cfg( "todayaddressplugin" ); 126 Config cfg( "todayaddressplugin" );
121 cfg.setGroup( "config" ); 127 cfg.setGroup( "config" );
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
index dad09db..d47bc0b 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
@@ -93,38 +93,42 @@ void AddressBookPluginWidget::getAddress() {
93 layoutTodo = new QVBoxLayout( this ); 93 layoutTodo = new QVBoxLayout( this );
94 } 94 }
95 95
96 if ( ! addressLabel ) { 96 if ( ! addressLabel ) {
97 addressLabel = new OClickableLabel( this ); 97 addressLabel = new OClickableLabel( this );
98 connect( addressLabel, SIGNAL( clicked() ), this, SLOT( startAddressBook() ) ); 98 connect( addressLabel, SIGNAL( clicked() ), this, SLOT( startAddressBook() ) );
99 layoutTodo->addWidget( addressLabel ); 99 layoutTodo->addWidget( addressLabel );
100 } 100 }
101 101
102 QString output; 102 QString output;
103 103
104 // Check whether the database provide the search option.. 104 // Check whether the database provide the search option..
105 if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){ 105 if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){
106 // Libopie seems to be old.. 106 // Libopie seems to be old..
107 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>" );
108 addressLabel->setText( output ); 108 addressLabel->setText( output );
109 return; 109 return;
110 } 110 }
111 111
112 // Define the query for birthdays and start search.. 112 // Define the query for birthdays and start search..
113 QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead ); 113 QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead );
114 int ammount = 0; 114 int ammount = 0;
115 if ( m_showBirthdays ){ 115 if ( m_showBirthdays ){
116 qWarning("Searching from now (%s) until %s ! ", 116 qWarning("Searching from now (%s) until %s ! ",
117 QDate::currentDate().toString().latin1(), 117 QDate::currentDate().toString().latin1(),
118 lookAheadDate.toString().latin1() ); 118 lookAheadDate.toString().latin1() );
119 }
120
121 if ( m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){
122
119 123
120 OContact querybirthdays; 124 OContact querybirthdays;
121 querybirthdays.setBirthday( lookAheadDate ); 125 querybirthdays.setBirthday( lookAheadDate );
122 126
123 m_list = m_contactdb->queryByExample( querybirthdays, 127 m_list = m_contactdb->queryByExample( querybirthdays,
124 OContactAccess::DateDiff ); 128 OContactAccess::DateDiff );
125 if ( m_list.count() > 0 ){ 129 if ( m_list.count() > 0 ){
126 output = "<font color=" + m_headlineColor + ">" 130 output = "<font color=" + m_headlineColor + ">"
127 + QObject::tr( "Next birthdays in <b> %1 </b> days:" ) 131 + QObject::tr( "Next birthdays in <b> %1 </b> days:" )
128 .arg( m_daysLookAhead ) 132 .arg( m_daysLookAhead )
129 + "</font> <br>"; 133 + "</font> <br>";
130 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { 134 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {