-rw-r--r-- | core/pim/today/plugins/addressbook/addresspluginconfig.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp index 45d9a3e..8d7bec6 100644 --- a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp +++ b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp | |||
@@ -1,153 +1,153 @@ | |||
1 | /* | 1 | /* |
2 | * addresspluginconfig.cpp | 2 | * addresspluginconfig.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2003 by Stefan Eilers | 4 | * copyright : (c) 2003 by Stefan Eilers |
5 | * email : eilers.stefan@epost.de | 5 | * email : eilers.stefan@epost.de |
6 | * | 6 | * |
7 | * This implementation was derived from the todolist plugin implementation | 7 | * This implementation was derived from the todolist plugin implementation |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | /*************************************************************************** | 10 | /*************************************************************************** |
11 | * * | 11 | * * |
12 | * This program is free software; you can redistribute it and/or modify * | 12 | * This program is free software; you can redistribute it and/or modify * |
13 | * it under the terms of the GNU General Public License as published by * | 13 | * it under the terms of the GNU General Public License as published by * |
14 | * the Free Software Foundation; either version 2 of the License, or * | 14 | * the Free Software Foundation; either version 2 of the License, or * |
15 | * (at your option) any later version. * | 15 | * (at your option) any later version. * |
16 | * * | 16 | * * |
17 | ***************************************************************************/ | 17 | ***************************************************************************/ |
18 | 18 | ||
19 | #include "addresspluginconfig.h" | 19 | #include "addresspluginconfig.h" |
20 | 20 | ||
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | 22 | ||
23 | #include <qlayout.h> | 23 | #include <qlayout.h> |
24 | #include <qhbox.h> | 24 | #include <qhbox.h> |
25 | #include <qtoolbutton.h> | 25 | #include <qtoolbutton.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qwhatsthis.h> | 27 | #include <qwhatsthis.h> |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* name) | 31 | AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char* name) |
32 | : TodayConfigWidget(parent, name ) { | 32 | : TodayConfigWidget(parent, name ) { |
33 | 33 | ||
34 | QVBoxLayout * layout = new QVBoxLayout( this ); | 34 | QVBoxLayout * layout = new QVBoxLayout( this ); |
35 | layout->setMargin( 20 ); | 35 | layout->setMargin( 20 ); |
36 | 36 | ||
37 | QHBox *box1 = new QHBox( this ); | 37 | QHBox *box1 = new QHBox( this ); |
38 | 38 | ||
39 | QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); | 39 | QLabel* TextLabel6 = new QLabel( box1, "TextLabel6" ); |
40 | TextLabel6->setText( tr( "Max Lines: " ) ); | 40 | TextLabel6->setText( tr( "Max Lines: " ) ); |
41 | 41 | ||
42 | SpinBox2 = new QSpinBox( box1, "SpinBox2" ); | 42 | SpinBox2 = new QSpinBox( box1, "SpinBox2" ); |
43 | SpinBox2->setMaxValue( 40 ); | 43 | SpinBox2->setMaxValue( 40 ); |
44 | QWhatsThis::add( SpinBox2 , tr( "Set the maximum number of lines that should be shown for each" ) ); | 44 | QWhatsThis::add( SpinBox2 , tr( "Set the maximum number of lines that should be shown for each anniversaries/birthdays" ) ); |
45 | 45 | ||
46 | QHBox *box2 = new QHBox( this ); | 46 | QHBox *box2 = new QHBox( this ); |
47 | 47 | ||
48 | QLabel* clipLabel = new QLabel( box2, "" ); | 48 | QLabel* clipLabel = new QLabel( box2, "" ); |
49 | clipLabel->setText( tr( "Clip line after X chars: " ) ); | 49 | clipLabel->setText( tr( "Clip line after X chars: " ) ); |
50 | 50 | ||
51 | SpinBoxClip = new QSpinBox( box2, "SpinClip" ); | 51 | SpinBoxClip = new QSpinBox( box2, "SpinClip" ); |
52 | SpinBoxClip->setMaxValue( 200 ); | 52 | SpinBoxClip->setMaxValue( 200 ); |
53 | QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) ); | 53 | QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) ); |
54 | 54 | ||
55 | QHBox *box3 = new QHBox( this ); | 55 | QHBox *box3 = new QHBox( this ); |
56 | 56 | ||
57 | QLabel* daysLabel = new QLabel( box3, "" ); | 57 | QLabel* daysLabel = new QLabel( box3, "" ); |
58 | daysLabel->setText( tr( "Days look ahead: " ) ); | 58 | daysLabel->setText( tr( "Days look ahead: " ) ); |
59 | SpinDaysClip = new QSpinBox( box3, "SpinDays" ); | 59 | SpinDaysClip = new QSpinBox( box3, "SpinDays" ); |
60 | SpinDaysClip->setMaxValue( 200 ); | 60 | SpinDaysClip->setMaxValue( 200 ); |
61 | QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); | 61 | QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); |
62 | 62 | ||
63 | QHBox *box4 = new QHBox( this ); | 63 | QHBox *box4 = new QHBox( this ); |
64 | 64 | ||
65 | QLabel* colorLabel = new QLabel( box4, "" ); | 65 | QLabel* colorLabel = new QLabel( box4, "" ); |
66 | colorLabel->setText( tr( "To activate color settings:\nRestart application !" ) ); | 66 | colorLabel->setText( tr( "To activate settings: Restart application !" ) ); |
67 | 67 | ||
68 | QHBox *box5 = new QHBox( this ); | 68 | QHBox *box5 = new QHBox( this ); |
69 | 69 | ||
70 | QLabel* colorLabel2 = new QLabel( box5, "" ); | 70 | QLabel* colorLabel2 = new QLabel( box5, "" ); |
71 | colorLabel2->setText( tr( "Set Headline Color: " ) ); | 71 | colorLabel2->setText( tr( "Set Headline Color: " ) ); |
72 | headlineColor = new OColorButton( box5, black , "headlineColor" ); | 72 | headlineColor = new OColorButton( box5, black , "headlineColor" ); |
73 | QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) ); | 73 | QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) ); |
74 | 74 | ||
75 | QHBox *box6 = new QHBox( this ); | 75 | QHBox *box6 = new QHBox( this ); |
76 | 76 | ||
77 | QLabel* colorLabel3= new QLabel( box6, "" ); | 77 | QLabel* colorLabel3= new QLabel( box6, "" ); |
78 | colorLabel3->setText( tr( "Set Entry Color: " ) ); | 78 | colorLabel3->setText( tr( "Set Entry Color: " ) ); |
79 | entryColor = new OColorButton( box6, black , "entryColor" ); | 79 | entryColor = new OColorButton( box6, black , "entryColor" ); |
80 | QWhatsThis::add( entryColor , tr( "This color will be used for shown birthdays/anniversaries !" ) ); | 80 | QWhatsThis::add( entryColor , tr( "This color will be used for shown birthdays/anniversaries !" ) ); |
81 | 81 | ||
82 | QHBox *box7 = new QHBox( this ); | 82 | QHBox *box7 = new QHBox( this ); |
83 | 83 | ||
84 | QLabel* colorLabel5 = new QLabel( box7, "" ); | 84 | QLabel* colorLabel5 = new QLabel( box7, "" ); |
85 | colorLabel5->setText( tr( "Set Urgent\nColor if below " ) ); | 85 | colorLabel5->setText( tr( "Set Urgent\nColor if below " ) ); |
86 | SpinUrgentClip = new QSpinBox( box7, "SpinDays" ); | 86 | SpinUrgentClip = new QSpinBox( box7, "SpinDays" ); |
87 | SpinUrgentClip->setMaxValue( 200 ); | 87 | SpinUrgentClip->setMaxValue( 200 ); |
88 | QLabel* colorLabel6 = new QLabel( box7, "" ); | 88 | QLabel* colorLabel6 = new QLabel( box7, "" ); |
89 | colorLabel6->setText( tr( "days: " ) ); | 89 | colorLabel6->setText( tr( " days: " ) ); |
90 | urgentColor = new OColorButton( box7, red , "urgentColor" ); | 90 | urgentColor = new OColorButton( box7, red , "urgentColor" ); |
91 | QWhatsThis::add( urgentColor , tr( "This color will be used if we are close to the event !" ) ); | 91 | QWhatsThis::add( urgentColor , tr( "This urgent color will be used if we are close to the event !" ) ); |
92 | QWhatsThis::add( SpinUrgentClip , tr( "How many days we should search forward" ) ); | 92 | QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) ); |
93 | 93 | ||
94 | 94 | ||
95 | layout->addWidget( box4 ); | ||
95 | layout->addWidget( box1 ); | 96 | layout->addWidget( box1 ); |
96 | layout->addWidget( box2 ); | 97 | layout->addWidget( box2 ); |
97 | layout->addWidget( box3 ); | 98 | layout->addWidget( box3 ); |
98 | layout->addWidget( box4 ); | ||
99 | layout->addWidget( box5 ); | 99 | layout->addWidget( box5 ); |
100 | layout->addWidget( box6 ); | 100 | layout->addWidget( box6 ); |
101 | layout->addWidget( box7 ); | 101 | layout->addWidget( box7 ); |
102 | 102 | ||
103 | readConfig(); | 103 | readConfig(); |
104 | 104 | ||
105 | } | 105 | } |
106 | 106 | ||
107 | void AddressBookPluginConfig::readConfig() { | 107 | void AddressBookPluginConfig::readConfig() { |
108 | Config cfg( "todayaddressplugin" ); | 108 | Config cfg( "todayaddressplugin" ); |
109 | cfg.setGroup( "config" ); | 109 | cfg.setGroup( "config" ); |
110 | m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); | 110 | m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); |
111 | SpinBox2->setValue( m_max_lines_task ); | 111 | SpinBox2->setValue( m_max_lines_task ); |
112 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); | 112 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); |
113 | SpinBoxClip->setValue( m_maxCharClip ); | 113 | SpinBoxClip->setValue( m_maxCharClip ); |
114 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); | 114 | m_daysLookAhead = cfg.readNumEntry( "dayslookahead", 14 ); |
115 | SpinDaysClip->setValue( m_daysLookAhead ); | 115 | SpinDaysClip->setValue( m_daysLookAhead ); |
116 | m_urgentDays = cfg.readNumEntry( "urgentdays", 7 ); | 116 | m_urgentDays = cfg.readNumEntry( "urgentdays", 7 ); |
117 | SpinUrgentClip->setValue( m_urgentDays ); | 117 | SpinUrgentClip->setValue( m_urgentDays ); |
118 | 118 | ||
119 | m_entryColor = cfg.readEntry( "entrycolor", Qt::black.name() ); | 119 | m_entryColor = cfg.readEntry( "entrycolor", Qt::black.name() ); |
120 | entryColor->setColor( QColor( m_entryColor ) ); | 120 | entryColor->setColor( QColor( m_entryColor ) ); |
121 | m_headlineColor = cfg.readEntry( "headlinecolor", Qt::black.name() ); | 121 | m_headlineColor = cfg.readEntry( "headlinecolor", Qt::black.name() ); |
122 | headlineColor->setColor( QColor( m_headlineColor ) ); | 122 | headlineColor->setColor( QColor( m_headlineColor ) ); |
123 | m_urgentColor = cfg.readEntry( "urgentcolor", Qt::red.name() ); | 123 | m_urgentColor = cfg.readEntry( "urgentcolor", Qt::red.name() ); |
124 | urgentColor->setColor( QColor( m_urgentColor ) ); | 124 | urgentColor->setColor( QColor( m_urgentColor ) ); |
125 | } | 125 | } |
126 | 126 | ||
127 | 127 | ||
128 | void AddressBookPluginConfig::writeConfig() { | 128 | void AddressBookPluginConfig::writeConfig() { |
129 | Config cfg( "todayaddressplugin" ); | 129 | Config cfg( "todayaddressplugin" ); |
130 | cfg.setGroup( "config" ); | 130 | cfg.setGroup( "config" ); |
131 | m_max_lines_task = SpinBox2->value(); | 131 | m_max_lines_task = SpinBox2->value(); |
132 | cfg.writeEntry( "maxlinestask", m_max_lines_task ); | 132 | cfg.writeEntry( "maxlinestask", m_max_lines_task ); |
133 | m_maxCharClip = SpinBoxClip->value(); | 133 | m_maxCharClip = SpinBoxClip->value(); |
134 | cfg.writeEntry( "maxcharclip", m_maxCharClip ); | 134 | cfg.writeEntry( "maxcharclip", m_maxCharClip ); |
135 | m_daysLookAhead = SpinDaysClip->value(); | 135 | m_daysLookAhead = SpinDaysClip->value(); |
136 | cfg.writeEntry( "dayslookahead", m_daysLookAhead ); | 136 | cfg.writeEntry( "dayslookahead", m_daysLookAhead ); |
137 | m_urgentDays = SpinUrgentClip->value(); | 137 | m_urgentDays = SpinUrgentClip->value(); |
138 | if ( m_urgentDays > m_daysLookAhead ) | 138 | if ( m_urgentDays > m_daysLookAhead ) |
139 | m_urgentDays = m_daysLookAhead; | 139 | m_urgentDays = m_daysLookAhead; |
140 | cfg.writeEntry( "urgentdays", m_urgentDays ); | 140 | cfg.writeEntry( "urgentdays", m_urgentDays ); |
141 | 141 | ||
142 | m_entryColor = entryColor->color().name(); | 142 | m_entryColor = entryColor->color().name(); |
143 | cfg.writeEntry( "entrycolor", m_entryColor ); | 143 | cfg.writeEntry( "entrycolor", m_entryColor ); |
144 | m_headlineColor = headlineColor->color().name(); | 144 | m_headlineColor = headlineColor->color().name(); |
145 | cfg.writeEntry( "headlinecolor", m_headlineColor ); | 145 | cfg.writeEntry( "headlinecolor", m_headlineColor ); |
146 | m_urgentColor = urgentColor->color().name(); | 146 | m_urgentColor = urgentColor->color().name(); |
147 | cfg.writeEntry( "urgentcolor", m_urgentColor ); | 147 | cfg.writeEntry( "urgentcolor", m_urgentColor ); |
148 | cfg.write(); | 148 | cfg.write(); |
149 | } | 149 | } |
150 | 150 | ||
151 | 151 | ||
152 | AddressBookPluginConfig::~AddressBookPluginConfig() { | 152 | AddressBookPluginConfig::~AddressBookPluginConfig() { |
153 | } | 153 | } |