summaryrefslogtreecommitdiff
path: root/core
authorskyhusker <skyhusker>2005-04-10 12:45:59 (UTC)
committer skyhusker <skyhusker>2005-04-10 12:45:59 (UTC)
commit7a49d0610ae9bc1cadacf9d572c671009cb3c088 (patch) (unidiff)
tree31d98c05af90dc9a3dce9eb01a5af51778ec64fc /core
parent713db174943e9184bfa68fa430123c52ad3c3b2b (diff)
downloadopie-7a49d0610ae9bc1cadacf9d572c671009cb3c088.zip
opie-7a49d0610ae9bc1cadacf9d572c671009cb3c088.tar.gz
opie-7a49d0610ae9bc1cadacf9d572c671009cb3c088.tar.bz2
Added configuration option for max characters displayed in notes. Fixes bug 1635
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfig.cpp4
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfig.h1
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfigbase.ui55
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginwidget.cpp3
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginwidget.h2
5 files changed, 54 insertions, 11 deletions
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
index 5fd5221..6b7c3ce 100644
--- a/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
+++ b/core/pim/today/plugins/datebook/datebookpluginconfig.cpp
@@ -45,12 +45,14 @@ void DatebookPluginConfig::readConfig() {
45 m_gui->CheckBox2->setChecked( m_show_notes ); 45 m_gui->CheckBox2->setChecked( m_show_notes );
46 m_only_later = cfg.readNumEntry( "onlylater", 1 ); 46 m_only_later = cfg.readNumEntry( "onlylater", 1 );
47 m_gui->CheckBox4->setChecked( cfg.readNumEntry( "timeextraline", 1 ) ); 47 m_gui->CheckBox4->setChecked( cfg.readNumEntry( "timeextraline", 1 ) );
48 m_gui->CheckBox3->setChecked( m_only_later ); 48 m_gui->CheckBox3->setChecked( m_only_later );
49 m_more_days = cfg.readNumEntry( "moredays", 0 ); 49 m_more_days = cfg.readNumEntry( "moredays", 0 );
50 m_gui->SpinBox2->setValue( m_more_days ); 50 m_gui->SpinBox2->setValue( m_more_days );
51 m_maxCharClip = cfg.readNumEntry( "maxcharclip" , 38 );
52 m_gui->SpinBox3->setValue( m_maxCharClip );
51} 53}
52 54
53 55
54void DatebookPluginConfig::writeConfig() { 56void DatebookPluginConfig::writeConfig() {
55 Config cfg( "todaydatebookplugin" ); 57 Config cfg( "todaydatebookplugin" );
56 cfg.setGroup( "config" ); 58 cfg.setGroup( "config" );
@@ -63,11 +65,13 @@ void DatebookPluginConfig::writeConfig() {
63 cfg.writeEntry( "shownotes", m_show_notes ); 65 cfg.writeEntry( "shownotes", m_show_notes );
64 m_only_later = m_gui->CheckBox3->isChecked(); 66 m_only_later = m_gui->CheckBox3->isChecked();
65 cfg.writeEntry( "timeextraline", m_gui->CheckBox4->isChecked() ); 67 cfg.writeEntry( "timeextraline", m_gui->CheckBox4->isChecked() );
66 cfg.writeEntry( "onlylater", m_only_later ); 68 cfg.writeEntry( "onlylater", m_only_later );
67 m_more_days = m_gui->SpinBox2->value(); 69 m_more_days = m_gui->SpinBox2->value();
68 cfg.writeEntry( "moredays", m_more_days ); 70 cfg.writeEntry( "moredays", m_more_days );
71 m_maxCharClip = m_gui->SpinBox3->value();
72 cfg.writeEntry( "maxcharclip", m_maxCharClip );
69 cfg.write(); 73 cfg.write();
70} 74}
71 75
72DatebookPluginConfig::~DatebookPluginConfig() { 76DatebookPluginConfig::~DatebookPluginConfig() {
73} 77}
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.h b/core/pim/today/plugins/datebook/datebookpluginconfig.h
index 4f4e3f1..61e31e0 100644
--- a/core/pim/today/plugins/datebook/datebookpluginconfig.h
+++ b/core/pim/today/plugins/datebook/datebookpluginconfig.h
@@ -53,11 +53,12 @@ private:
53 int m_show_location; 53 int m_show_location;
54 // if notes should be shown 54 // if notes should be shown
55 int m_show_notes; 55 int m_show_notes;
56 // should only later appointments be shown or all for the current day. 56 // should only later appointments be shown or all for the current day.
57 int m_only_later; 57 int m_only_later;
58 int m_more_days; 58 int m_more_days;
59 int m_maxCharClip;
59 60
60}; 61};
61 62
62 63
63#endif 64#endif
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfigbase.ui b/core/pim/today/plugins/datebook/datebookpluginconfigbase.ui
index 943e8ec..004204a 100644
--- a/core/pim/today/plugins/datebook/datebookpluginconfigbase.ui
+++ b/core/pim/today/plugins/datebook/datebookpluginconfigbase.ui
@@ -8,34 +8,34 @@
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>228</width> 14 <width>224</width>
15 <height>267</height> 15 <height>267</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>DatebookPluginConfigBase</string> 20 <string>DatebookPluginConfigBase</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>whatsThis</name> 23 <name>whatsThis</name>
24 <string></string> 24 <string></string>
25 </property> 25 </property>
26 <vbox> 26 <grid>
27 <property stdset="1"> 27 <property stdset="1">
28 <name>margin</name> 28 <name>margin</name>
29 <number>11</number> 29 <number>11</number>
30 </property> 30 </property>
31 <property stdset="1"> 31 <property stdset="1">
32 <name>spacing</name> 32 <name>spacing</name>
33 <number>6</number> 33 <number>6</number>
34 </property> 34 </property>
35 <widget> 35 <widget row="0" column="0" >
36 <class>QCheckBox</class> 36 <class>QCheckBox</class>
37 <property stdset="1"> 37 <property stdset="1">
38 <name>name</name> 38 <name>name</name>
39 <cstring>CheckBox1</cstring> 39 <cstring>CheckBox1</cstring>
40 </property> 40 </property>
41 <property stdset="1"> 41 <property stdset="1">
@@ -44,13 +44,13 @@
44 </property> 44 </property>
45 <property> 45 <property>
46 <name>whatsThis</name> 46 <name>whatsThis</name>
47 <string>Check this if the location of an appointment should be shown for each one</string> 47 <string>Check this if the location of an appointment should be shown for each one</string>
48 </property> 48 </property>
49 </widget> 49 </widget>
50 <widget> 50 <widget row="1" column="0" >
51 <class>QCheckBox</class> 51 <class>QCheckBox</class>
52 <property stdset="1"> 52 <property stdset="1">
53 <name>name</name> 53 <name>name</name>
54 <cstring>CheckBox2</cstring> 54 <cstring>CheckBox2</cstring>
55 </property> 55 </property>
56 <property stdset="1"> 56 <property stdset="1">
@@ -59,13 +59,13 @@
59 </property> 59 </property>
60 <property> 60 <property>
61 <name>whatsThis</name> 61 <name>whatsThis</name>
62 <string>Check this if the note attached to an appointment should be shown for each one</string> 62 <string>Check this if the note attached to an appointment should be shown for each one</string>
63 </property> 63 </property>
64 </widget> 64 </widget>
65 <widget> 65 <widget row="2" column="0" >
66 <class>QCheckBox</class> 66 <class>QCheckBox</class>
67 <property stdset="1"> 67 <property stdset="1">
68 <name>name</name> 68 <name>name</name>
69 <cstring>CheckBox3</cstring> 69 <cstring>CheckBox3</cstring>
70 </property> 70 </property>
71 <property stdset="1"> 71 <property stdset="1">
@@ -74,24 +74,24 @@
74 </property> 74 </property>
75 <property> 75 <property>
76 <name>whatsThis</name> 76 <name>whatsThis</name>
77 <string>Check this if only appointments later then current time should be shown</string> 77 <string>Check this if only appointments later then current time should be shown</string>
78 </property> 78 </property>
79 </widget> 79 </widget>
80 <widget> 80 <widget row="3" column="0" >
81 <class>QCheckBox</class> 81 <class>QCheckBox</class>
82 <property stdset="1"> 82 <property stdset="1">
83 <name>name</name> 83 <name>name</name>
84 <cstring>CheckBox4</cstring> 84 <cstring>CheckBox4</cstring>
85 </property> 85 </property>
86 <property stdset="1"> 86 <property stdset="1">
87 <name>text</name> 87 <name>text</name>
88 <string>Show time in extra line</string> 88 <string>Show time in extra line</string>
89 </property> 89 </property>
90 </widget> 90 </widget>
91 <widget> 91 <widget row="4" column="0" >
92 <class>QLayoutWidget</class> 92 <class>QLayoutWidget</class>
93 <property stdset="1"> 93 <property stdset="1">
94 <name>name</name> 94 <name>name</name>
95 <cstring>Layout3</cstring> 95 <cstring>Layout3</cstring>
96 </property> 96 </property>
97 <hbox> 97 <hbox>
@@ -135,13 +135,13 @@
135 <property> 135 <property>
136 <name>wordwrap</name> 136 <name>wordwrap</name>
137 </property> 137 </property>
138 </widget> 138 </widget>
139 </hbox> 139 </hbox>
140 </widget> 140 </widget>
141 <widget> 141 <widget row="5" column="0" >
142 <class>QLayoutWidget</class> 142 <class>QLayoutWidget</class>
143 <property stdset="1"> 143 <property stdset="1">
144 <name>name</name> 144 <name>name</name>
145 <cstring>Layout2</cstring> 145 <cstring>Layout2</cstring>
146 </property> 146 </property>
147 <hbox> 147 <hbox>
@@ -189,13 +189,48 @@
189 <property> 189 <property>
190 <name>wordwrap</name> 190 <name>wordwrap</name>
191 </property> 191 </property>
192 </widget> 192 </widget>
193 </hbox> 193 </hbox>
194 </widget> 194 </widget>
195 <spacer> 195 <widget row="6" column="0" >
196 <class>QLayoutWidget</class>
197 <property stdset="1">
198 <name>name</name>
199 <cstring>Layout6</cstring>
200 </property>
201 <hbox>
202 <property stdset="1">
203 <name>margin</name>
204 <number>0</number>
205 </property>
206 <property stdset="1">
207 <name>spacing</name>
208 <number>6</number>
209 </property>
210 <widget>
211 <class>QSpinBox</class>
212 <property stdset="1">
213 <name>name</name>
214 <cstring>SpinBox3</cstring>
215 </property>
216 </widget>
217 <widget>
218 <class>QLabel</class>
219 <property stdset="1">
220 <name>name</name>
221 <cstring>TextLabel1_2</cstring>
222 </property>
223 <property stdset="1">
224 <name>text</name>
225 <string>Clip line after X chars</string>
226 </property>
227 </widget>
228 </hbox>
229 </widget>
230 <spacer row="7" column="0" >
196 <property> 231 <property>
197 <name>name</name> 232 <name>name</name>
198 <cstring>Spacer2</cstring> 233 <cstring>Spacer2</cstring>
199 </property> 234 </property>
200 <property stdset="1"> 235 <property stdset="1">
201 <name>orientation</name> 236 <name>orientation</name>
@@ -210,9 +245,9 @@
210 <size> 245 <size>
211 <width>20</width> 246 <width>20</width>
212 <height>20</height> 247 <height>20</height>
213 </size> 248 </size>
214 </property> 249 </property>
215 </spacer> 250 </spacer>
216 </vbox> 251 </grid>
217</widget> 252</widget>
218</UI> 253</UI>
diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
index 0820802..eb6d47a 100644
--- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
+++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
@@ -51,12 +51,13 @@ void DatebookPluginWidget::readConfig() {
51 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 ); 51 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 );
52 m_show_location = cfg.readNumEntry( "showlocation", 1 ); 52 m_show_location = cfg.readNumEntry( "showlocation", 1 );
53 m_show_notes = cfg.readNumEntry( "shownotes", 0 ); 53 m_show_notes = cfg.readNumEntry( "shownotes", 0 );
54 m_onlyLater = cfg.readNumEntry( "onlylater", 1 ); 54 m_onlyLater = cfg.readNumEntry( "onlylater", 1 );
55 m_moreDays = cfg.readNumEntry( "moredays", 0 ); 55 m_moreDays = cfg.readNumEntry( "moredays", 0 );
56 m_timeExtraLine = cfg.readNumEntry( "timeextraline", 1 ); 56 m_timeExtraLine = cfg.readNumEntry( "timeextraline", 1 );
57 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
57} 58}
58 59
59void DatebookPluginWidget::reinitialize() { 60void DatebookPluginWidget::reinitialize() {
60 readConfig(); 61 readConfig();
61 refresh(); 62 refresh();
62} 63}
@@ -93,13 +94,13 @@ void DatebookPluginWidget::getDates() {
93 94
94 for ( QValueList<EffectiveEvent>::ConstIterator it = list.begin(); it != list.end(); ++it ) { 95 for ( QValueList<EffectiveEvent>::ConstIterator it = list.begin(); it != list.end(); ++it ) {
95 96
96 if ( count < m_max_lines_meet ) { 97 if ( count < m_max_lines_meet ) {
97 if ( !m_onlyLater ) { 98 if ( !m_onlyLater ) {
98 count++; 99 count++;
99 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine ); 100 DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes, m_timeExtraLine, m_maxCharClip );
100 m_eventsList.append( l ); 101 m_eventsList.append( l );
101 l->show(); 102 l->show();
102 QObject::connect ( l, SIGNAL( editEvent(const Event&) ), l, SLOT( editEventSlot(const Event&) ) ); 103 QObject::connect ( l, SIGNAL( editEvent(const Event&) ), l, SLOT( editEventSlot(const Event&) ) );
103 } else { 104 } else {
104 if ( ( QDateTime::currentDateTime() <= (*it).event().end() ) 105 if ( ( QDateTime::currentDateTime() <= (*it).event().end() )
105 // Show events which span over many days and are not elapsed. 106 // Show events which span over many days and are not elapsed.
diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.h b/core/pim/today/plugins/datebook/datebookpluginwidget.h
index f8ed89e..65e060e 100644
--- a/core/pim/today/plugins/datebook/datebookpluginwidget.h
+++ b/core/pim/today/plugins/datebook/datebookpluginwidget.h
@@ -54,9 +54,11 @@ private:
54 bool m_show_notes; 54 bool m_show_notes;
55 // should only later appointments be shown or all for the current day. 55 // should only later appointments be shown or all for the current day.
56 bool m_onlyLater; 56 bool m_onlyLater;
57 int m_moreDays; 57 int m_moreDays;
58 // true if time of an appointment should be an extra line 58 // true if time of an appointment should be an extra line
59 bool m_timeExtraLine; 59 bool m_timeExtraLine;
60 //max characters displayed in notes
61 int m_maxCharClip;
60}; 62};
61 63
62#endif 64#endif