summaryrefslogtreecommitdiff
authorumopapisdn <umopapisdn>2003-04-12 03:56:46 (UTC)
committer umopapisdn <umopapisdn>2003-04-12 03:56:46 (UTC)
commit8c690a7bb709773217ba3d39d3ef769a2414cc72 (patch) (unidiff)
treea34bae70ee8dc46f40f60150e1703088fbc4da36
parent212aef7fd20182fe926644af2ab10a4b49549440 (diff)
downloadopie-8c690a7bb709773217ba3d39d3ef769a2414cc72.zip
opie-8c690a7bb709773217ba3d39d3ef769a2414cc72.tar.gz
opie-8c690a7bb709773217ba3d39d3ef769a2414cc72.tar.bz2
New feature:
Added a configurable option to make the weeklist view display either no times at all, only start times, or both start and end time. Also moved the configuration of default view from the menu into the preference dialog.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp120
-rw-r--r--core/pim/datebook/datebook.h6
-rw-r--r--core/pim/datebook/datebooksettingsbase.ui394
-rw-r--r--core/pim/datebook/datebookweeklst.cpp123
-rw-r--r--core/pim/datebook/datebookweeklst.h2
5 files changed, 396 insertions, 249 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 829f8f8..4fbcb10 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -72,8 +72,2 @@
72 72
73#define DAY 1
74#define WEEK 2
75#define WEEKLST 4
76#define MONTH 3
77
78
79DateBook::DateBook( QWidget *parent, const char *, WFlags f ) 73DateBook::DateBook( QWidget *parent, const char *, WFlags f )
@@ -168,3 +162,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
168 162
169 a = new QAction( tr( "Alarm and Start Time..." ), QString::null, 0, 0 ); 163 a = new QAction( tr( "Edit..." ), QString::null, 0, 0 );
170 connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); 164 connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
@@ -172,37 +166,12 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
172 166
173 QPopupMenu *default_view = new QPopupMenu(this); 167 if(defaultView==DAY) viewDay();
174 settings->insertItem( tr( "Default View" ),default_view ); 168 if(defaultView==WEEK) needEvilHack=true;// viewWeek();
175 default_view->setCheckable(TRUE); 169 if(defaultView==WEEKLST) viewWeekLst();
170 if(defaultView==MONTH) viewMonth();
176 171
177 Config config("DateBook"); 172 connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(changeClock(bool)) );
178 config.setGroup("Main"); 173 connect( qApp, SIGNAL(weekChanged(bool)), this, SLOT(changeWeek(bool)) );
179 int current=config.readNumEntry("defaultview", DAY);
180
181 QActionGroup *ag = new QActionGroup(this);
182 a = new QAction( tr( "Day" ), QString::null, 0, 0, 0, true );
183 if (current==DAY) a->setOn(true), viewDay();
184 ag->insert(a);
185 a = new QAction( tr( "Week" ), QString::null, 0, 0, 0, true );
186 if (current==WEEK) a->setOn(true), /*viewWeek(),*/ needEvilHack = true;
187 ag->insert(a);
188 a = new QAction( tr( "WeekLst" ), QString::null, 0, 0, 0, true );
189 if (current==WEEKLST) a->setOn(true), viewWeekLst();
190 ag->insert(a);
191 a = new QAction( tr( "Month" ), QString::null, 0, 0, 0, true );
192 if (current==MONTH) a->setOn(true), viewMonth();
193 ag->insert(a);
194
195 ag->addTo(default_view);
196 connect(ag, SIGNAL( selected ( QAction * ) ),
197 this, SLOT( newDefaultView(QAction *) )
198 );
199
200 connect( qApp, SIGNAL(clockChanged(bool)),
201 this, SLOT(changeClock(bool)) );
202 connect( qApp, SIGNAL(weekChanged(bool)),
203 this, SLOT(changeWeek(bool)) );
204 174
205#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 175#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
206 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), 176 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), this, SLOT(appMessage(const QCString&, const QByteArray&)) );
207 this, SLOT(appMessage(const QCString&, const QByteArray&)) );
208#endif 177#endif
@@ -213,7 +182,5 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
213 QCopChannel *channel = new QCopChannel( "QPE/System", this ); 182 QCopChannel *channel = new QCopChannel( "QPE/System", this );
214 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 183 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), this, SLOT(receive(const QCString&, const QByteArray&)) );
215 this, SLOT(receive(const QCString&, const QByteArray&)) );
216 channel = new QCopChannel( "QPE/Datebook", this ); 184 channel = new QCopChannel( "QPE/Datebook", this );
217 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 185 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), this, SLOT(receive(const QCString&, const QByteArray&)) );
218 this, SLOT(receive(const QCString&, const QByteArray&)) );
219 qDebug("olle\n"); 186 qDebug("olle\n");
@@ -274,2 +241,5 @@ void DateBook::slotSettings()
274 frmSettings.setRowStyle( rowStyle ); 241 frmSettings.setRowStyle( rowStyle );
242 frmSettings.comboDefaultView->setCurrentItem(defaultView-1);
243 frmSettings.comboWeekListView->setCurrentItem(weeklistviewconfig);
244
275#if defined (Q_WS_QWS) || defined(_WS_QWS_) 245#if defined (Q_WS_QWS) || defined(_WS_QWS_)
@@ -285,2 +255,4 @@ void DateBook::slotSettings()
285 rowStyle = frmSettings.rowStyle(); 255 rowStyle = frmSettings.rowStyle();
256 defaultView=frmSettings.comboDefaultView->currentItem()+1;
257 weeklistviewconfig=frmSettings.comboWeekListView->currentItem();
286 258
@@ -302,2 +274,4 @@ void DateBook::slotSettings()
302 weekView->redraw(); 274 weekView->redraw();
275 else if ( views->visibleWidget() == weekLstView )
276 weekLstView->redraw();
303 } 277 }
@@ -385,2 +359,3 @@ void DateBook::view(int v, const QDate &d) {
385void DateBook::viewDefault(const QDate &d) { 359void DateBook::viewDefault(const QDate &d) {
360/*
386 Config config("DateBook"); 361 Config config("DateBook");
@@ -390,2 +365,4 @@ void DateBook::viewDefault(const QDate &d) {
390 view(current,d); 365 view(current,d);
366*/
367 view(defaultView,d);
391} 368}
@@ -610,10 +587,7 @@ void DateBook::loadSettings()
610{ 587{
611 { 588 Config qpeconfig( "qpe" );
612 Config config( "qpe" ); 589 qpeconfig.setGroup("Time");
613 config.setGroup("Time"); 590 ampm = qpeconfig.readBoolEntry( "AMPM", TRUE );
614 ampm = config.readBoolEntry( "AMPM", TRUE ); 591 onMonday = qpeconfig.readBoolEntry( "MONDAY" );
615 onMonday = config.readBoolEntry( "MONDAY" );
616 }
617 592
618 {
619 Config config("DateBook"); 593 Config config("DateBook");
@@ -625,3 +599,4 @@ void DateBook::loadSettings()
625 rowStyle = config.readNumEntry("rowstyle"); 599 rowStyle = config.readNumEntry("rowstyle");
626 } 600 defaultView = config.readNumEntry("defaultview",DAY);
601 weeklistviewconfig = config.readNumEntry("weeklistviewconfig",NORMAL);
627} 602}
@@ -638,14 +613,4 @@ void DateBook::saveSettings()
638 configDB.writeEntry("rowstyle", rowStyle); 613 configDB.writeEntry("rowstyle", rowStyle);
639} 614 configDB.writeEntry("defaultview",defaultView);
640 615 configDB.writeEntry("weeklistviewconfig",weeklistviewconfig);
641void DateBook::newDefaultView(QAction *a) {
642 int val=DAY;
643 if (a->text() == "Day") val=DAY;
644 if (a->text() == "Week") val=WEEK;
645 if (a->text() == "WeekLst") val=WEEKLST;
646 if (a->text() == "Month") val=MONTH;
647
648 Config configDB( "DateBook" );
649 configDB.setGroup( "Main" );
650 configDB.writeEntry("defaultview",val);
651} 616}
@@ -664,4 +629,3 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data)
664 QDateTime current = QDateTime::currentDateTime(); 629 QDateTime current = QDateTime::currentDateTime();
665 if ( current.time().hour() != when.time().hour() 630 if ( current.time().hour() != when.time().hour() && current.time().minute() != when.time().minute() )
666 && current.time().minute() != when.time().minute() )
667 return; 631 return;
@@ -674,4 +638,3 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data)
674 bool found = FALSE; 638 bool found = FALSE;
675 for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); 639 for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); it!=list.end(); ++it ) {
676 it!=list.end(); ++it ) {
677 if ( (*it).event().hasAlarm() ) { 640 if ( (*it).event().hasAlarm() ) {
@@ -698,3 +661,2 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data)
698 } 661 }
699
700 QDialog dlg( this, 0, TRUE ); 662 QDialog dlg( this, 0, TRUE );
@@ -722,4 +684,3 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data)
722 needShow = TRUE; 684 needShow = TRUE;
723 } 685 } else {
724 else {
725 QWidget* cur = views->visibleWidget(); 686 QWidget* cur = views->visibleWidget();
@@ -753,8 +714,5 @@ void DateBook::reload()
753 db->reload(); 714 db->reload();
754 if ( dayAction->isOn() ) 715 if ( dayAction->isOn() ) viewDay();
755 viewDay(); 716 else if ( weekAction->isOn() ) viewWeek();
756 else if ( weekAction->isOn() ) 717 else if ( monthAction->isOn() ) viewMonth();
757 viewWeek();
758 else if ( monthAction->isOn() )
759 viewMonth();
760 syncing = FALSE; 718 syncing = FALSE;
@@ -773,6 +731,6 @@ void DateBook::timerEvent( QTimerEvent *e )
773 Sound::soundAlarm(); 731 Sound::soundAlarm();
774 } 732 } else {
775 else
776 killTimer( e->timerId() ); 733 killTimer( e->timerId() );
777} 734}
735}
778 736
@@ -797,3 +755,3 @@ void DateBook::slotToday()
797 // we need to view today using default view 755 // we need to view today using default view
798 viewDefault(QDate::currentDate()); 756 view(defaultView,QDate::currentDate());
799} 757}
@@ -811,5 +769,5 @@ void DateBook::closeEvent( QCloseEvent *e )
811 saveSettings(); 769 saveSettings();
812 if ( db->save() ) 770 if ( db->save() ) {
813 e->accept(); 771 e->accept();
814 else { 772 } else {
815 if ( QMessageBox::critical( this, tr( "Out of space" ), 773 if ( QMessageBox::critical( this, tr( "Out of space" ),
diff --git a/core/pim/datebook/datebook.h b/core/pim/datebook/datebook.h
index 623862b..5216770 100644
--- a/core/pim/datebook/datebook.h
+++ b/core/pim/datebook/datebook.h
@@ -26,2 +26,5 @@
26 26
27 enum { DAY=1,WEEK,WEEKLST,MONTH };// defaultView values
28 enum { NONE=0,NORMAL,EXTENDED };// WeekLstView's modes.
29
27class QAction; 30class QAction;
@@ -69,3 +72,2 @@ private slots:
69 void slotSettings(); 72 void slotSettings();
70 void newDefaultView(QAction *a);
71 void slotToday();// view today 73 void slotToday();// view today
@@ -114,2 +116,3 @@ private:
114 QAction *dayAction, *weekAction, *weekLstAction, *monthAction; 116 QAction *dayAction, *weekAction, *weekLstAction, *monthAction;
117 int weeklistviewconfig;
115 bool aPreset; // have everything set to alarm? 118 bool aPreset; // have everything set to alarm?
@@ -118,2 +121,3 @@ private:
118 int rowStyle; 121 int rowStyle;
122 int defaultView;
119 bool bJumpToCurTime; //should jump to current time in dayview? 123 bool bJumpToCurTime; //should jump to current time in dayview?
diff --git a/core/pim/datebook/datebooksettingsbase.ui b/core/pim/datebook/datebooksettingsbase.ui
index 816a441..3836330 100644
--- a/core/pim/datebook/datebooksettingsbase.ui
+++ b/core/pim/datebook/datebooksettingsbase.ui
@@ -34,4 +34,4 @@
34 <y>0</y> 34 <y>0</y>
35 <width>220</width> 35 <width>273</width>
36 <height>290</height> 36 <height>303</height>
37 </rect> 37 </rect>
@@ -48,3 +48,3 @@
48 </property> 48 </property>
49 <grid> 49 <vbox>
50 <property stdset="1"> 50 <property stdset="1">
@@ -57,19 +57,26 @@
57 </property> 57 </property>
58 <widget row="0" column="0" > 58 <widget>
59 <class>QGroupBox</class> 59 <class>QTabWidget</class>
60 <property stdset="1"> 60 <property stdset="1">
61 <name>name</name> 61 <name>name</name>
62 <cstring>fraStart</cstring> 62 <cstring>TabWidget2</cstring>
63 </property> 63 </property>
64 <widget>
65 <class>QWidget</class>
64 <property stdset="1"> 66 <property stdset="1">
65 <name>frameShape</name> 67 <name>name</name>
66 <enum>Box</enum> 68 <cstring>tab</cstring>
67 </property> 69 </property>
70 <attribute>
71 <name>title</name>
72 <string>Views</string>
73 </attribute>
74 <vbox>
68 <property stdset="1"> 75 <property stdset="1">
69 <name>frameShadow</name> 76 <name>margin</name>
70 <enum>Sunken</enum> 77 <number>11</number>
71 </property> 78 </property>
72 <property stdset="1"> 79 <property stdset="1">
73 <name>title</name> 80 <name>spacing</name>
74 <string>Start viewing events</string> 81 <number>6</number>
75 </property> 82 </property>
@@ -79,14 +86,5 @@
79 <name>name</name> 86 <name>name</name>
80 <cstring>Layout6</cstring> 87 <cstring>Layout5</cstring>
81 </property>
82 <property stdset="1">
83 <name>geometry</name>
84 <rect>
85 <x>3</x>
86 <y>21</y>
87 <width>210</width>
88 <height>53</height>
89 </rect>
90 </property> 88 </property>
91 <grid> 89 <hbox>
92 <property stdset="1"> 90 <property stdset="1">
@@ -99,3 +97,3 @@
99 </property> 97 </property>
100 <spacer row="1" column="0" > 98 <spacer>
101 <property> 99 <property>
@@ -106,3 +104,3 @@
106 <name>orientation</name> 104 <name>orientation</name>
107 <enum>Vertical</enum> 105 <enum>Horizontal</enum>
108 </property> 106 </property>
@@ -120,12 +118,81 @@
120 </spacer> 118 </spacer>
121 <widget row="0" column="0" > 119 <widget>
122 <class>QLayoutWidget</class> 120 <class>QLabel</class>
123 <property stdset="1"> 121 <property stdset="1">
124 <name>name</name> 122 <name>name</name>
125 <cstring>Layout1</cstring> 123 <cstring>TextLabel1_2</cstring>
124 </property>
125 <property stdset="1">
126 <name>text</name>
127 <string>Default view:</string>
128 </property>
129 </widget>
130 <widget>
131 <class>QComboBox</class>
132 <item>
133 <property>
134 <name>text</name>
135 <string>Day</string>
136 </property>
137 </item>
138 <item>
139 <property>
140 <name>text</name>
141 <string>Week</string>
142 </property>
143 </item>
144 <item>
145 <property>
146 <name>text</name>
147 <string>Week List</string>
148 </property>
149 </item>
150 <item>
151 <property>
152 <name>text</name>
153 <string>Month</string>
154 </property>
155 </item>
156 <property stdset="1">
157 <name>name</name>
158 <cstring>comboDefaultView</cstring>
159 </property>
160 </widget>
161 <spacer>
162 <property>
163 <name>name</name>
164 <cstring>Spacer2</cstring>
165 </property>
166 <property stdset="1">
167 <name>orientation</name>
168 <enum>Horizontal</enum>
169 </property>
170 <property stdset="1">
171 <name>sizeType</name>
172 <enum>Expanding</enum>
173 </property>
174 <property>
175 <name>sizeHint</name>
176 <size>
177 <width>20</width>
178 <height>20</height>
179 </size>
180 </property>
181 </spacer>
182 </hbox>
183 </widget>
184 <widget>
185 <class>QGroupBox</class>
186 <property stdset="1">
187 <name>name</name>
188 <cstring>GroupBox4</cstring>
126 </property> 189 </property>
127 <hbox> 190 <property stdset="1">
191 <name>title</name>
192 <string>Day</string>
193 </property>
194 <vbox>
128 <property stdset="1"> 195 <property stdset="1">
129 <name>margin</name> 196 <name>margin</name>
130 <number>0</number> 197 <number>11</number>
131 </property> 198 </property>
@@ -136,6 +203,6 @@
136 <widget> 203 <widget>
137 <class>QLabel</class> 204 <class>QCheckBox</class>
138 <property stdset="1"> 205 <property stdset="1">
139 <name>name</name> 206 <name>name</name>
140 <cstring>lblStartTime</cstring> 207 <cstring>chkJumpToCurTime</cstring>
141 </property> 208 </property>
@@ -143,3 +210,3 @@
143 <name>text</name> 210 <name>text</name>
144 <string>Start Time:</string> 211 <string>Jump to current time</string>
145 </property> 212 </property>
@@ -147,26 +214,57 @@
147 <widget> 214 <widget>
148 <class>QSpinBox</class> 215 <class>QLayoutWidget</class>
149 <property stdset="1"> 216 <property stdset="1">
150 <name>name</name> 217 <name>name</name>
151 <cstring>spinStart</cstring> 218 <cstring>Layout5</cstring>
152 </property> 219 </property>
220 <hbox>
153 <property stdset="1"> 221 <property stdset="1">
154 <name>suffix</name> 222 <name>margin</name>
155 <string>:00</string> 223 <number>0</number>
156 </property> 224 </property>
157 <property stdset="1"> 225 <property stdset="1">
158 <name>wrapping</name> 226 <name>spacing</name>
159 <bool>true</bool> 227 <number>6</number>
160 </property> 228 </property>
229 <widget>
230 <class>QLabel</class>
161 <property stdset="1"> 231 <property stdset="1">
162 <name>maxValue</name> 232 <name>name</name>
163 <number>23</number> 233 <cstring>TextLabel1</cstring>
234 </property>
235 <property stdset="1">
236 <name>text</name>
237 <string>Row style:</string>
164 </property> 238 </property>
165 </widget> 239 </widget>
166 </hbox> 240 <widget>
241 <class>QComboBox</class>
242 <item>
243 <property>
244 <name>text</name>
245 <string>Default</string>
246 </property>
247 </item>
248 <item>
249 <property>
250 <name>text</name>
251 <string>Medium</string>
252 </property>
253 </item>
254 <item>
255 <property>
256 <name>text</name>
257 <string>Large</string>
258 </property>
259 </item>
260 <property stdset="1">
261 <name>name</name>
262 <cstring>comboRowStyle</cstring>
263 </property>
167 </widget> 264 </widget>
168 </grid> 265 </hbox>
169 </widget> 266 </widget>
267 </vbox>
170 </widget> 268 </widget>
171 <widget row="1" column="0" > 269 <widget>
172 <class>QGroupBox</class> 270 <class>QGroupBox</class>
@@ -174,3 +272,3 @@
174 <name>name</name> 272 <name>name</name>
175 <cstring>fraAlarm</cstring> 273 <cstring>GroupBox5</cstring>
176 </property> 274 </property>
@@ -178,3 +276,12 @@
178 <name>title</name> 276 <name>title</name>
179 <string>Alarm Settings</string> 277 <string>Week List</string>
278 </property>
279 <vbox>
280 <property stdset="1">
281 <name>margin</name>
282 <number>11</number>
283 </property>
284 <property stdset="1">
285 <name>spacing</name>
286 <number>6</number>
180 </property> 287 </property>
@@ -184,14 +291,5 @@
184 <name>name</name> 291 <name>name</name>
185 <cstring>Layout4</cstring> 292 <cstring>Layout6</cstring>
186 </property>
187 <property stdset="1">
188 <name>geometry</name>
189 <rect>
190 <x>10</x>
191 <y>20</y>
192 <width>200</width>
193 <height>53</height>
194 </rect>
195 </property> 293 </property>
196 <grid> 294 <hbox>
197 <property stdset="1"> 295 <property stdset="1">
@@ -204,6 +302,46 @@
204 </property> 302 </property>
205 <spacer row="1" column="0" > 303 <widget>
304 <class>QLabel</class>
305 <property stdset="1">
306 <name>name</name>
307 <cstring>TextLabel2</cstring>
308 </property>
309 <property stdset="1">
310 <name>text</name>
311 <string>Time display</string>
312 </property>
313 </widget>
314 <widget>
315 <class>QComboBox</class>
316 <item>
317 <property>
318 <name>text</name>
319 <string>None</string>
320 </property>
321 </item>
322 <item>
323 <property>
324 <name>text</name>
325 <string>Start</string>
326 </property>
327 </item>
328 <item>
206 <property> 329 <property>
330 <name>text</name>
331 <string>Start-End</string>
332 </property>
333 </item>
334 <property stdset="1">
207 <name>name</name> 335 <name>name</name>
208 <cstring>Spacer2</cstring> 336 <cstring>comboWeekListView</cstring>
337 </property>
338 </widget>
339 </hbox>
340 </widget>
341 </vbox>
342 </widget>
343 <spacer>
344 <property>
345 <name>name</name>
346 <cstring>Spacer3_2</cstring>
209 </property> 347 </property>
@@ -225,3 +363,43 @@
225 </spacer> 363 </spacer>
226 <widget row="0" column="0" > 364 </vbox>
365 </widget>
366 <widget>
367 <class>QWidget</class>
368 <property stdset="1">
369 <name>name</name>
370 <cstring>tab</cstring>
371 </property>
372 <attribute>
373 <name>title</name>
374 <string>Misc</string>
375 </attribute>
376 <vbox>
377 <property stdset="1">
378 <name>margin</name>
379 <number>11</number>
380 </property>
381 <property stdset="1">
382 <name>spacing</name>
383 <number>6</number>
384 </property>
385 <widget>
386 <class>QGroupBox</class>
387 <property stdset="1">
388 <name>name</name>
389 <cstring>GroupBox6</cstring>
390 </property>
391 <property stdset="1">
392 <name>title</name>
393 <string>Alarm Settings</string>
394 </property>
395 <vbox>
396 <property stdset="1">
397 <name>margin</name>
398 <number>11</number>
399 </property>
400 <property stdset="1">
401 <name>spacing</name>
402 <number>6</number>
403 </property>
404 <widget>
227 <class>QLayoutWidget</class> 405 <class>QLayoutWidget</class>
@@ -284,6 +462,5 @@
284 </widget> 462 </widget>
285 </grid> 463 </vbox>
286 </widget>
287 </widget> 464 </widget>
288 <widget row="2" column="0" > 465 <widget>
289 <class>QGroupBox</class> 466 <class>QGroupBox</class>
@@ -291,3 +468,3 @@
291 <name>name</name> 468 <name>name</name>
292 <cstring>fraMisc</cstring> 469 <cstring>GroupBox7</cstring>
293 </property> 470 </property>
@@ -295,3 +472,12 @@
295 <name>title</name> 472 <name>title</name>
296 <string>Misc</string> 473 <string>Start viewing events</string>
474 </property>
475 <vbox>
476 <property stdset="1">
477 <name>margin</name>
478 <number>11</number>
479 </property>
480 <property stdset="1">
481 <name>spacing</name>
482 <number>6</number>
297 </property> 483 </property>
@@ -301,12 +487,3 @@
301 <name>name</name> 487 <name>name</name>
302 <cstring>Layout5</cstring> 488 <cstring>Layout1</cstring>
303 </property>
304 <property stdset="1">
305 <name>geometry</name>
306 <rect>
307 <x>10</x>
308 <y>40</y>
309 <width>170</width>
310 <height>24</height>
311 </rect>
312 </property> 489 </property>
@@ -325,3 +502,3 @@
325 <name>name</name> 502 <name>name</name>
326 <cstring>TextLabel1</cstring> 503 <cstring>lblStartTime</cstring>
327 </property> 504 </property>
@@ -329,3 +506,3 @@
329 <name>text</name> 506 <name>text</name>
330 <string>Row style:</string> 507 <string>Start Time:</string>
331 </property> 508 </property>
@@ -333,24 +510,18 @@
333 <widget> 510 <widget>
334 <class>QComboBox</class> 511 <class>QSpinBox</class>
335 <item> 512 <property stdset="1">
336 <property> 513 <name>name</name>
337 <name>text</name> 514 <cstring>spinStart</cstring>
338 <string>Default</string>
339 </property> 515 </property>
340 </item> 516 <property stdset="1">
341 <item> 517 <name>suffix</name>
342 <property> 518 <string>:00</string>
343 <name>text</name>
344 <string>Medium</string>
345 </property> 519 </property>
346 </item> 520 <property stdset="1">
347 <item> 521 <name>wrapping</name>
348 <property> 522 <bool>true</bool>
349 <name>text</name>
350 <string>Large</string>
351 </property> 523 </property>
352 </item>
353 <property stdset="1"> 524 <property stdset="1">
354 <name>name</name> 525 <name>maxValue</name>
355 <cstring>comboRowStyle</cstring> 526 <number>23</number>
356 </property> 527 </property>
@@ -359,24 +530,29 @@
359 </widget> 530 </widget>
360 <widget> 531 </vbox>
361 <class>QCheckBox</class> 532 </widget>
362 <property stdset="1"> 533 <spacer>
534 <property>
363 <name>name</name> 535 <name>name</name>
364 <cstring>chkJumpToCurTime</cstring> 536 <cstring>Spacer9</cstring>
365 </property> 537 </property>
366 <property stdset="1"> 538 <property stdset="1">
367 <name>geometry</name> 539 <name>orientation</name>
368 <rect> 540 <enum>Vertical</enum>
369 <x>10</x>
370 <y>20</y>
371 <width>200</width>
372 <height>20</height>
373 </rect>
374 </property> 541 </property>
375 <property stdset="1"> 542 <property stdset="1">
376 <name>text</name> 543 <name>sizeType</name>
377 <string>Jump to current time (dayview)</string> 544 <enum>Expanding</enum>
378 </property> 545 </property>
546 <property>
547 <name>sizeHint</name>
548 <size>
549 <width>20</width>
550 <height>20</height>
551 </size>
552 </property>
553 </spacer>
554 </vbox>
379 </widget> 555 </widget>
380 </widget> 556 </widget>
381 </grid> 557 </vbox>
382</widget> 558</widget>
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index 3d6a029..3c8fc89 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -4,2 +4,4 @@
4 4
5#include "datebook.h"
6
5#include <qpe/calendar.h> 7#include <qpe/calendar.h>
@@ -145,20 +147,40 @@ void DateBookWeekLstDayHdr::newEvent() {
145DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, 147DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev,
148 int weeklistviewconfig,
146 QWidget* parent, 149 QWidget* parent,
147 const char* name, 150 const char* name,
148 WFlags fl) : 151 WFlags fl ) : OClickableLabel(parent,name,fl), event(ev)
149 OClickableLabel(parent,name,fl),
150 event(ev)
151{ 152{
152 char s[10]; 153 // old values... lastday = "__|__", middle=" |---", Firstday="00:00",
153 if ( ev.startDate() != ev.date() ) { // multiday event (not first day) 154 QString s,start,middle,end,day;
154 if ( ev.endDate() == ev.date() ) { // last day 155
155 strcpy(s, "__|__"); 156 qDebug("weeklistviewconfig=%d",weeklistviewconfig);
156 } else { 157 if(weeklistviewconfig==NONE) {// No times displayed.
157 strcpy(s, " |---"); 158 // start.sprintf("%.2d:%.2d-",ev.start().hour(),ev.start().minute());
159 // middle.sprintf("<--->");
160 // end.sprintf("-%.2d:%.2d",ev.end().hour(),ev.end().minute());
161 // day.sprintf("%.2d:%.2d-%.2d:%.2d",ev.start().hour(),ev.start().minute(),ev.end().hour(),ev.end().minute());
162 } else if(weeklistviewconfig==NORMAL) {// "Normal", only display start time.
163 start.sprintf("%.2d:%.2d",ev.start().hour(),ev.start().minute());
164 middle.sprintf(" |---");
165 end.sprintf("__|__");
166 day.sprintf("%.2d:%.2d",ev.start().hour(),ev.start().minute());
167 } else if(weeklistviewconfig==EXTENDED) { // Extended mode, display start and end times.
168 start.sprintf("%.2d:%.2d-",ev.start().hour(),ev.start().minute());
169 middle.sprintf("<--->");
170 end.sprintf("-%.2d:%.2d",ev.end().hour(),ev.end().minute());
171 day.sprintf("%.2d:%.2d-%.2d:%.2d",ev.start().hour(),ev.start().minute(),ev.end().hour(),ev.end().minute());
172 }
173
174 if(ev.event().type() == Event::Normal) {
175 if(ev.startDate()==ev.date() && ev.endDate()==ev.date()) {// day event.
176 s=day;
177 } else if(ev.startDate()==ev.date()) {// start event.
178 s=start;
179 } else if(ev.endDate()==ev.date()) { // end event.
180 s=end;
181 } else {// middle day.
182 s=middle;
158 } 183 }
159 } else { 184 } else {
160 if(ev.event().type() == Event::Normal ) 185 s="";
161 sprintf(s,"%.2d:%.2d",ev.start().hour(),ev.start().minute());
162 else
163 sprintf(s," ");
164 } 186 }
@@ -179,2 +201,7 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
179{ 201{
202 Config config("DateBook");
203 config.setGroup("Main");
204 int weeklistviewconfig=config.readNumEntry("weeklistviewconfig", NORMAL);
205 qDebug("Read weeklistviewconfig: %d",weeklistviewconfig);
206
180 onMonday=onM; 207 onMonday=onM;
@@ -190,5 +217,5 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
190 int dayOrder[7]; 217 int dayOrder[7];
191 if (onMonday) 218 if (onMonday) {
192 for (int d=0; d<7; d++) dayOrder[d]=d+1; 219 for (int d=0; d<7; d++) dayOrder[d]=d+1;
193 else { 220 } else {
194 for (int d=0; d<7; d++) dayOrder[d]=d; 221 for (int d=0; d<7; d++) dayOrder[d]=d;
@@ -199,12 +226,7 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
199 // Header 226 // Header
200 DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i), 227 DateBookWeekLstDayHdr *hdr=new DateBookWeekLstDayHdr(d.addDays(i), onMonday,this);
201 onMonday,this);
202 connect(hdr, SIGNAL(showDate(int,int,int)), 228 connect(hdr, SIGNAL(showDate(int,int,int)),
203 this, SIGNAL(showDate(int,int,int))); 229 this, SIGNAL(showDate(int,int,int)));
204 connect(hdr, SIGNAL(addEvent(const QDateTime &, 230 connect(hdr, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)),
205 const QDateTime &, 231 this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)));
206 const QString &, const QString &)),
207 this, SIGNAL(addEvent(const QDateTime &,
208 const QDateTime &,
209 const QString &, const QString &)));
210 layout->addWidget(hdr); 232 layout->addWidget(hdr);
@@ -214,6 +236,5 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev,
214 if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) {// Skip events ending at 00:00 starting at another day. 236 if(!(((*it).end().hour()==0) && ((*it).end().minute()==0) && ((*it).startDate()!=(*it).date()))) {// Skip events ending at 00:00 starting at another day.
215 DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this); 237 DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,weeklistviewconfig,this);
216 layout->addWidget(l); 238 layout->addWidget(l);
217 connect (l, SIGNAL(editEvent(const Event &)), 239 connect (l, SIGNAL(editEvent(const Event &)), this, SIGNAL(editEvent(const Event &)));
218 this, SIGNAL(editEvent(const Event &)));
219 } 240 }
@@ -239,10 +260,6 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
239 layout->addWidget(w); 260 layout->addWidget(w);
240 connect (w, SIGNAL(editEvent(const Event &)), 261 connect (w, SIGNAL(editEvent(const Event &)), this, SIGNAL(editEvent(const Event &)));
241 this, SIGNAL(editEvent(const Event &))); 262 connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
242 connect (w, SIGNAL(showDate(int,int,int)), 263 connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &,const QString &)),
243 this, SIGNAL(showDate(int,int,int))); 264 this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)));
244 connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
245 const QString &,const QString &)),
246 this, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
247 const QString &, const QString &)));
248 265
@@ -251,10 +268,6 @@ DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1,
251 layout->addWidget(w); 268 layout->addWidget(w);
252 connect (w, SIGNAL(editEvent(const Event &)), 269 connect (w, SIGNAL(editEvent(const Event &)), this, SIGNAL(editEvent(const Event &)));
253 this, SIGNAL(editEvent(const Event &))); 270 connect (w, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
254 connect (w, SIGNAL(showDate(int,int,int)), 271 connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)),
255 this, SIGNAL(showDate(int,int,int))); 272 this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)));
256 connect (w, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
257 const QString &, const QString &)),
258 this, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
259 const QString &, const QString &)));
260} 273}
@@ -276,6 +289,4 @@ DateBookWeekLst::DateBookWeekLst( bool ap, bool onM, DateBookDB *newDB,
276 layout->addWidget( header ); 289 layout->addWidget( header );
277 connect(header, SIGNAL(dateChanged(int,int)), 290 connect(header, SIGNAL(dateChanged(int,int)), this, SLOT(dateChanged(int,int)));
278 this, SLOT(dateChanged(int,int))); 291 connect(header, SIGNAL(setDbl(bool)), this, SLOT(setDbl(bool)));
279 connect(header, SIGNAL(setDbl(bool)),
280 this, SLOT(setDbl(bool)));
281 292
@@ -318,4 +329,7 @@ QDate DateBookWeekLst::date() const {
318 if (!onMonday) 329 if (!onMonday)
319 if (dow==7) dow=1; 330 if (dow==7) {
320 else dow++; 331 dow=1;
332 } else {
333 dow++;
334 }
321 335
@@ -335,3 +349,2 @@ void DateBookWeekLst::getEvents() {
335 QValueList<EffectiveEvent> el2 = db->getEffectiveEvents(start2, stop); 349 QValueList<EffectiveEvent> el2 = db->getEffectiveEvents(start2, stop);
336
337 view=new DateBookWeekLstDblView(el,el2,start,onMonday,scroll); 350 view=new DateBookWeekLstDblView(el,el2,start,onMonday,scroll);
@@ -341,10 +354,6 @@ void DateBookWeekLst::getEvents() {
341 354
342 connect (view, SIGNAL(editEvent(const Event &)), 355 connect (view, SIGNAL(editEvent(const Event &)), this, SIGNAL(editEvent(const Event &)));
343 this, SIGNAL(editEvent(const Event &))); 356 connect (view, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
344 connect (view, SIGNAL(showDate(int,int,int)), 357 connect (view, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)),
345 this, SIGNAL(showDate(int,int,int))); 358 this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)));
346 connect (view, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
347 const QString &, const QString &)),
348 this, SIGNAL(addEvent(const QDateTime &, const QDateTime &,
349 const QString &, const QString &)));
350 359
diff --git a/core/pim/datebook/datebookweeklst.h b/core/pim/datebook/datebookweeklst.h
index ea88f20..17dc01f 100644
--- a/core/pim/datebook/datebookweeklst.h
+++ b/core/pim/datebook/datebookweeklst.h
@@ -61,3 +61,3 @@ class DateBookWeekLstEvent: public OClickableLabel
61public: 61public:
62 DateBookWeekLstEvent(const EffectiveEvent &ev, 62 DateBookWeekLstEvent(const EffectiveEvent &ev, int weeklistviewconfig =1,
63 QWidget* parent = 0, const char* name = 0, 63 QWidget* parent = 0, const char* name = 0,