4 files changed, 26 insertions, 17 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 | |||
@@ -65,61 +65,67 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* | |||
65 | QHBox *box2 = new QHBox( this ); | 65 | QHBox *box2 = new QHBox( this ); |
66 | QLabel* clipLabel = new QLabel( box2, "" ); | 66 | QLabel* clipLabel = new QLabel( box2, "" ); |
67 | clipLabel->setText( tr( "Clip line after X chars: " ) ); | 67 | clipLabel->setText( tr( "Clip line after X chars: " ) ); |
68 | SpinBoxClip = new QSpinBox( box2, "SpinClip" ); | 68 | SpinBoxClip = new QSpinBox( box2, "SpinClip" ); |
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 !" ) ); |
93 | 99 | ||
94 | // Urgent color settings | 100 | // Urgent color settings |
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 | ||
119 | void AddressBookPluginConfig::readConfig() { | 125 | void AddressBookPluginConfig::readConfig() { |
120 | Config cfg( "todayaddressplugin" ); | 126 | Config cfg( "todayaddressplugin" ); |
121 | cfg.setGroup( "config" ); | 127 | cfg.setGroup( "config" ); |
122 | m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); | 128 | m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); |
123 | SpinBox2->setValue( m_max_lines_task ); | 129 | SpinBox2->setValue( m_max_lines_task ); |
124 | // m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); | 130 | // m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); |
125 | // SpinBoxClip->setValue( m_maxCharClip ); | 131 | // SpinBoxClip->setValue( m_maxCharClip ); |
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 | |||
@@ -89,46 +89,50 @@ void AddressBookPluginWidget::readConfig() { | |||
89 | */ | 89 | */ |
90 | void AddressBookPluginWidget::getAddress() { | 90 | void AddressBookPluginWidget::getAddress() { |
91 | 91 | ||
92 | if ( ! layoutTodo ){ | 92 | if ( ! layoutTodo ){ |
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 ) { |
131 | if ( ammount++ < m_maxLinesTask ){ | 135 | if ( ammount++ < m_maxLinesTask ){ |
132 | // Now we want to calculate how many days | 136 | // Now we want to calculate how many days |
133 | //until birthday. We have to set | 137 | //until birthday. We have to set |
134 | // the correct year to calculate the day diff... | 138 | // the correct year to calculate the day diff... |
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.h b/core/pim/today/plugins/datebook/datebookpluginconfig.h index bc412dd..2d303fc 100644 --- a/core/pim/today/plugins/datebook/datebookpluginconfig.h +++ b/core/pim/today/plugins/datebook/datebookpluginconfig.h | |||
@@ -10,53 +10,51 @@ | |||
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #ifndef DATEBOOK_PLUGIN_CONFIG_H | 17 | #ifndef DATEBOOK_PLUGIN_CONFIG_H |
18 | #define DATEBOOK_PLUGIN_CONFIG_H | 18 | #define DATEBOOK_PLUGIN_CONFIG_H |
19 | 19 | ||
20 | 20 | ||
21 | #include <qcheckbox.h> | 21 | #include <qcheckbox.h> |
22 | #include <qspinbox.h> | 22 | #include <qspinbox.h> |
23 | 23 | ||
24 | #include <opie/todayconfigwidget.h> | 24 | #include <opie/todayconfigwidget.h> |
25 | 25 | ||
26 | class DatebookPluginConfig : public TodayConfigWidget { | 26 | #include "datebookpluginconfigbase.h" |
27 | |||
28 | class DatebookPluginConfig : public TodayConfigWidget { | ||
27 | 29 | ||
28 | Q_OBJECT | 30 | Q_OBJECT |
29 | 31 | ||
32 | |||
30 | public: | 33 | public: |
31 | DatebookPluginConfig( QWidget *parent, const char *name ); | 34 | DatebookPluginConfig( QWidget *parent, const char *name ); |
32 | ~DatebookPluginConfig(); | 35 | ~DatebookPluginConfig(); |
33 | 36 | ||
34 | void writeConfig(); | 37 | void writeConfig(); |
35 | private: | 38 | private: |
36 | /** | 39 | /** |
37 | * if changed then save | 40 | * if changed then save |
38 | */ | 41 | */ |
39 | bool changed(); | 42 | bool changed(); |
40 | void readConfig(); | 43 | void readConfig(); |
41 | 44 | ||
42 | QCheckBox* CheckBox2; | ||
43 | QCheckBox* CheckBox1; | ||
44 | QCheckBox* CheckBox3; | ||
45 | QSpinBox* SpinBox1; | ||
46 | QSpinBox* SpinBox2; | ||
47 | |||
48 | 45 | ||
46 | DatebookPluginConfigBase *m_gui; | ||
49 | // how many lines should be showed in the datebook section | 47 | // how many lines should be showed in the datebook section |
50 | int m_max_lines_meet; | 48 | int m_max_lines_meet; |
51 | // If location is to be showed too, 1 to activate it. | 49 | // If location is to be showed too, 1 to activate it. |
52 | int m_show_location; | 50 | int m_show_location; |
53 | // if notes should be shown | 51 | // if notes should be shown |
54 | int m_show_notes; | 52 | int m_show_notes; |
55 | // should only later appointments be shown or all for the current day. | 53 | // should only later appointments be shown or all for the current day. |
56 | int m_only_later; | 54 | int m_only_later; |
57 | int m_more_days; | 55 | int m_more_days; |
58 | 56 | ||
59 | }; | 57 | }; |
60 | 58 | ||
61 | 59 | ||
62 | #endif | 60 | #endif |
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.h b/core/pim/today/plugins/todolist/todopluginconfig.h index e09251c..54d35cf 100644 --- a/core/pim/today/plugins/todolist/todopluginconfig.h +++ b/core/pim/today/plugins/todolist/todopluginconfig.h | |||
@@ -4,55 +4,56 @@ | |||
4 | * copyright : (c) 2002, 2003 by Maximilian Reiß | 4 | * copyright : (c) 2002, 2003 by Maximilian Reiß |
5 | * email : harlekin@handhelds.org | 5 | * email : harlekin@handhelds.org |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | /*************************************************************************** | 8 | /*************************************************************************** |
9 | * * | 9 | * * |
10 | * This program is free software; you can redistribute it and/or modify * | 10 | * This program is free software; you can redistribute it and/or modify * |
11 | * it under the terms of the GNU General Public License as published by * | 11 | * it under the terms of the GNU General Public License as published by * |
12 | * the Free Software Foundation; either version 2 of the License, or * | 12 | * the Free Software Foundation; either version 2 of the License, or * |
13 | * (at your option) any later version. * | 13 | * (at your option) any later version. * |
14 | * * | 14 | * * |
15 | ***************************************************************************/ | 15 | ***************************************************************************/ |
16 | 16 | ||
17 | #ifndef TODOLIST_PLUGIN_CONFIG_H | 17 | #ifndef TODOLIST_PLUGIN_CONFIG_H |
18 | #define TODOLIST_PLUGIN_CONFIG_H | 18 | #define TODOLIST_PLUGIN_CONFIG_H |
19 | 19 | ||
20 | //#include <qwidget.h> | ||
21 | #include <qspinbox.h> | 20 | #include <qspinbox.h> |
22 | 21 | ||
23 | #include <opie/todayconfigwidget.h> | 22 | #include <opie/todayconfigwidget.h> |
24 | 23 | ||
24 | #include "todopluginconfigbase.h" | ||
25 | |||
25 | class TodolistPluginConfig : public TodayConfigWidget { | 26 | class TodolistPluginConfig : public TodayConfigWidget { |
26 | 27 | ||
27 | Q_OBJECT | 28 | Q_OBJECT |
28 | 29 | ||
29 | public: | 30 | public: |
30 | 31 | ||
31 | TodolistPluginConfig( QWidget *parent, const char *name ); | 32 | TodolistPluginConfig( QWidget *parent, const char *name ); |
32 | ~TodolistPluginConfig(); | 33 | ~TodolistPluginConfig(); |
33 | 34 | ||
34 | private: | 35 | private: |
35 | /** | 36 | /** |
36 | * if changed then save | 37 | * if changed then save |
37 | */ | 38 | */ |
38 | bool changed(); | 39 | bool changed(); |
39 | void readConfig(); | 40 | void readConfig(); |
40 | void writeConfig(); | 41 | void writeConfig(); |
42 | |||
43 | TodoPluginConfigBase *m_gui; | ||
41 | 44 | ||
42 | QSpinBox* SpinBox2; | ||
43 | QSpinBox* SpinBoxClip; | ||
44 | 45 | ||
45 | // how many lines should be showed in the todolist section | 46 | // how many lines should be showed in the todolist section |
46 | int m_max_lines_task; | 47 | int m_max_lines_task; |
47 | // clip the lines after X chars | 48 | // clip the lines after X chars |
48 | int m_maxCharClip; | 49 | int m_maxCharClip; |
49 | 50 | ||
50 | 51 | ||
51 | 52 | ||
52 | }; | 53 | }; |
53 | 54 | ||
54 | 55 | ||
55 | 56 | ||
56 | 57 | ||
57 | 58 | ||
58 | #endif | 59 | #endif |