summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-04-04 15:02:30 (UTC)
committer harlekin <harlekin>2002-04-04 15:02:30 (UTC)
commitb765d3996578024679cd4c0f083070d2784df330 (patch) (unidiff)
treef138ce099ecd5a59c4948132fc1c3d891aa7dca8
parent8d2a3e988c683d9b999f9fa5a3485d6b54465d1c (diff)
downloadopie-b765d3996578024679cd4c0f083070d2784df330.zip
opie-b765d3996578024679cd4c0f083070d2784df330.tar.gz
opie-b765d3996578024679cd4c0f083070d2784df330.tar.bz2
small fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp4
-rw-r--r--core/pim/today/todaybase.cpp1
-rw-r--r--core/pim/today/todayconfig.cpp1
3 files changed, 2 insertions, 4 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 66a4152..51aba69 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -1,537 +1,537 @@
1/* 1/*
2 * today.cpp : main class 2 * today.cpp : main class
3 * 3 *
4 * --------------------- 4 * ---------------------
5 * 5 *
6 * begin : Sun 10 17:20:00 CEST 2002 6 * begin : Sun 10 17:20:00 CEST 2002
7 * copyright : (c) 2002 by Maximilian Reiß 7 * copyright : (c) 2002 by Maximilian Reiß
8 * email : max.reiss@gmx.de 8 * email : max.reiss@gmx.de
9 * 9 *
10 */ 10 */
11/*************************************************************************** 11/***************************************************************************
12 * * 12 * *
13 * This program is free software; you can redistribute it and/or modify * 13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by * 14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or * 15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. * 16 * (at your option) any later version. *
17 * * 17 * *
18 ***************************************************************************/ 18 ***************************************************************************/
19 19
20#include "today.h" 20#include "today.h"
21 21
22#include <qpe/timestring.h> 22#include <qpe/timestring.h>
23#include <qpe/config.h> 23#include <qpe/config.h>
24#include <qpe/qcopenvelope_qws.h> 24#include <qpe/qcopenvelope_qws.h>
25#include <qpe/qprocess.h> 25#include <qpe/qprocess.h>
26#include <qpe/resource.h> 26#include <qpe/resource.h>
27#include <qpe/contact.h> 27#include <qpe/contact.h>
28#include <qpe/global.h> 28#include <qpe/global.h>
29#include <qpe/qpeapplication.h> 29#include <qpe/qpeapplication.h>
30 30
31#include <qdir.h> 31#include <qdir.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qdatetime.h> 33#include <qdatetime.h>
34#include <qtextstream.h> 34#include <qtextstream.h>
35#include <qcheckbox.h> 35#include <qcheckbox.h>
36#include <qspinbox.h> 36#include <qspinbox.h>
37#include <qpushbutton.h> 37#include <qpushbutton.h>
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qtimer.h> 39#include <qtimer.h>
40#include <qpixmap.h> 40#include <qpixmap.h>
41#include <qfileinfo.h> 41#include <qfileinfo.h>
42#include <qlayout.h> 42#include <qlayout.h>
43#include <qtl.h> 43#include <qtl.h>
44 44
45//#include <iostream.h> 45//#include <iostream.h>
46#include <unistd.h> 46#include <unistd.h>
47#include <stdlib.h> 47#include <stdlib.h>
48 48
49int MAX_LINES_TASK; 49int MAX_LINES_TASK;
50int MAX_CHAR_CLIP; 50int MAX_CHAR_CLIP;
51int MAX_LINES_MEET; 51int MAX_LINES_MEET;
52int SHOW_LOCATION; 52int SHOW_LOCATION;
53int SHOW_NOTES; 53int SHOW_NOTES;
54// show only later dates 54// show only later dates
55int ONLY_LATER; 55int ONLY_LATER;
56int AUTOSTART; 56int AUTOSTART;
57int NEW_START=1; 57int NEW_START=1;
58 58
59/* 59/*
60 * Constructs a Example which is a child of 'parent', with the 60 * Constructs a Example which is a child of 'parent', with the
61 * name 'name' and widget flags set to 'f' 61 * name 'name' and widget flags set to 'f'
62 */ 62 */
63Today::Today( QWidget* parent, const char* name, WFlags fl ) 63Today::Today( QWidget* parent, const char* name, WFlags fl )
64 : TodayBase( parent, name, fl ), AllDateBookEvents(NULL) { 64 : TodayBase( parent, name, fl ), AllDateBookEvents(NULL) {
65 QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); 65 QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) );
66 QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); 66 QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) );
67 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); 67 QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) );
68 QObject::connect( (QObject*)MailButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); 68 QObject::connect( (QObject*)MailButton, SIGNAL( clicked() ), this, SLOT(startMail() ) );
69 69
70#if defined(Q_WS_QWS) 70#if defined(Q_WS_QWS)
71#if !defined(QT_NO_COP) 71#if !defined(QT_NO_COP)
72 QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this ); 72 QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this );
73 connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)), 73 connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)),
74 this, SLOT ( channelReceived(const QCString &, const QByteArray &)) ); 74 this, SLOT ( channelReceived(const QCString &, const QByteArray &)) );
75#endif 75#endif
76#endif 76#endif
77 77
78 setOwnerField(); 78 setOwnerField();
79 todo = new ToDoDB; 79 todo = new ToDoDB;
80 getTodo(); 80 getTodo();
81 draw(); 81 draw();
82 autoStart(); 82 autoStart();
83} 83}
84 84
85/* 85/*
86 * Qcop receive method. 86 * Qcop receive method.
87 */ 87 */
88void Today::channelReceived(const QCString &msg, const QByteArray & data) { 88void Today::channelReceived(const QCString &msg, const QByteArray & data) {
89 QDataStream stream(data, IO_ReadOnly ); 89 QDataStream stream(data, IO_ReadOnly );
90 if ( msg == "message(QString)" ) { 90 if ( msg == "message(QString)" ) {
91 QString message; 91 QString message;
92 stream >> message; 92 stream >> message;
93 setOwnerField(message); 93 setOwnerField(message);
94 } 94 }
95 95
96} 96}
97 97
98/* 98/*
99 * Initialises the owner field with the default value, the username 99 * Initialises the owner field with the default value, the username
100 */ 100 */
101void Today::setOwnerField() { 101void Today::setOwnerField() {
102 QString file = Global::applicationFileName("addressbook", "businesscard.vcf"); 102 QString file = Global::applicationFileName("addressbook", "businesscard.vcf");
103 if (QFile::exists(file)) { 103 if (QFile::exists(file)) {
104 Contact cont = Contact::readVCard(file)[0]; 104 Contact cont = Contact::readVCard(file)[0];
105 QString returnString = cont.fullName(); 105 QString returnString = cont.fullName();
106 OwnerField->setText( tr ("<b>Owned by " + returnString + "</b>")); 106 OwnerField->setText( tr ("<b>Owned by " + returnString + "</b>"));
107 } else { 107 } else {
108 OwnerField->setText( tr ("<b>Please fill out the business card </b>")); 108 OwnerField->setText( tr ("<b>Please fill out the business card </b>"));
109 } 109 }
110} 110}
111 111
112/* 112/*
113 * Set the owner field with a given QString, for example per qcop. 113 * Set the owner field with a given QString, for example per qcop.
114 */ 114 */
115void Today::setOwnerField(QString &message) { 115void Today::setOwnerField(QString &message) {
116 if (!message.isEmpty()) { 116 if (!message.isEmpty()) {
117 OwnerField->setText("<b>" + message + "</b>"); 117 OwnerField->setText("<b>" + message + "</b>");
118 } 118 }
119} 119}
120 120
121/* 121/*
122 * Autostart, uses the new (opie only) autostart method in the launcher code. 122 * Autostart, uses the new (opie only) autostart method in the launcher code.
123 * If registered against that today ist started on each resume. 123 * If registered against that today ist started on each resume.
124 */ 124 */
125void Today::autoStart() { 125void Today::autoStart() {
126 Config cfg("today"); 126 Config cfg("today");
127 cfg.setGroup("Autostart"); 127 cfg.setGroup("Autostart");
128 AUTOSTART = cfg.readNumEntry("autostart",1); 128 AUTOSTART = cfg.readNumEntry("autostart",1);
129 if (AUTOSTART) { 129 if (AUTOSTART) {
130 QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); 130 QCopEnvelope e("QPE/System", "autoStart(QString,QString)");
131 e << QString("add"); 131 e << QString("add");
132 e << QString("today"); 132 e << QString("today");
133 } else { 133 } else {
134 QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); 134 QCopEnvelope e("QPE/System", "autoStart(QString,QString)");
135 e << QString("remove"); 135 e << QString("remove");
136 e << QString("today"); 136 e << QString("today");
137 } 137 }
138} 138}
139 139
140/* 140/*
141 * Repaint method. Reread all fields. 141 * Repaint method. Reread all fields.
142 */ 142 */
143void Today::draw() { 143void Today::draw() {
144 init(); 144 init();
145 getDates(); 145 getDates();
146 getMail(); 146 getMail();
147 147
148 // if the todolist.xml file was not modified in between, do not parse it. 148 // if the todolist.xml file was not modified in between, do not parse it.
149 if (checkIfModified()) { 149 if (checkIfModified()) {
150 if (todo) delete todo; 150 if (todo) delete todo;
151 todo = new ToDoDB; 151 todo = new ToDoDB;
152 getTodo(); 152 getTodo();
153 } 153 }
154 154
155 // how often refresh 155 // how often refresh
156 QTimer::singleShot( 20*1000, this, SLOT(draw() ) ); 156 QTimer::singleShot( 20*1000, this, SLOT(draw() ) );
157} 157}
158 158
159/* 159/*
160 * Check if the todolist.xml was modified (if there are new entries. 160 * Check if the todolist.xml was modified (if there are new entries.
161 * Returns true if it was modified. 161 * Returns true if it was modified.
162 */ 162 */
163bool Today::checkIfModified() { 163bool Today::checkIfModified() {
164 164
165 QDir dir; 165 QDir dir;
166 QString homedir = dir.homeDirPath (); 166 QString homedir = dir.homeDirPath ();
167 QString time; 167 QString time;
168 168
169 Config cfg("today"); 169 Config cfg("today");
170 cfg.setGroup("Files"); 170 cfg.setGroup("Files");
171 time = cfg.readEntry("todolisttimestamp", ""); 171 time = cfg.readEntry("todolisttimestamp", "");
172 172
173 QFileInfo file = (homedir +"/Applications/todolist/todolist.xml"); 173 QFileInfo file = (homedir +"/Applications/todolist/todolist.xml");
174 QDateTime fileTime = file.lastModified(); 174 QDateTime fileTime = file.lastModified();
175 if (time.compare(fileTime.toString()) == 0) { 175 if (time.compare(fileTime.toString()) == 0) {
176 return false; 176 return false;
177 } else { 177 } else {
178 cfg.writeEntry("todolisttimestamp", fileTime.toString() ); 178 cfg.writeEntry("todolisttimestamp", fileTime.toString() );
179 cfg.write(); 179 cfg.write();
180 return true; 180 return true;
181 } 181 }
182} 182}
183 183
184 184
185/* 185/*
186 * Init stuff needed for today. Reads the config file. 186 * Init stuff needed for today. Reads the config file.
187 */ 187 */
188void Today::init() { 188void Today::init() {
189 QDate date = QDate::currentDate(); 189 QDate date = QDate::currentDate();
190 QString time = (tr( date.toString()) ); 190 QString time = (tr( date.toString()) );
191 191
192 TextLabel1->setText(QString("<font color=#FFFFFF>" + time + "</font>")); 192 TextLabel1->setText(QString("<font color=#FFFFFF>" + time + "</font>"));
193 193
194 // read config 194 // read config
195 Config cfg("today"); 195 Config cfg("today");
196 cfg.setGroup("BaseConfig"); 196 cfg.setGroup("BaseConfig");
197 197
198 // -- config file section -- 198 // -- config file section --
199 // how many lines should be showed in the task section 199 // how many lines should be showed in the task section
200 MAX_LINES_TASK = cfg.readNumEntry("maxlinestask",5); 200 MAX_LINES_TASK = cfg.readNumEntry("maxlinestask",5);
201 // after how many chars should the be cut off on tasks and notes 201 // after how many chars should the be cut off on tasks and notes
202 MAX_CHAR_CLIP = cfg.readNumEntry("maxcharclip",40); 202 MAX_CHAR_CLIP = cfg.readNumEntry("maxcharclip",40);
203 // how many lines should be showed in the datebook section 203 // how many lines should be showed in the datebook section
204 MAX_LINES_MEET = cfg.readNumEntry("maxlinesmeet",5); 204 MAX_LINES_MEET = cfg.readNumEntry("maxlinesmeet",5);
205 // If location is to be showed too, 1 to activate it. 205 // If location is to be showed too, 1 to activate it.
206 SHOW_LOCATION = cfg.readNumEntry("showlocation",1); 206 SHOW_LOCATION = cfg.readNumEntry("showlocation",1);
207 // if notes should be shown 207 // if notes should be shown
208 SHOW_NOTES = cfg.readNumEntry("shownotes",0); 208 SHOW_NOTES = cfg.readNumEntry("shownotes",0);
209 // should only later appointments be shown or all for the current day. 209 // should only later appointments be shown or all for the current day.
210 ONLY_LATER = cfg.readNumEntry("onlylater",1); 210 ONLY_LATER = cfg.readNumEntry("onlylater",1);
211 211
212 db = new DateBookDB; 212 db = new DateBookDB;
213} 213}
214 214
215/* 215/*
216 * The method for the configuration dialog. 216 * The method for the configuration dialog.
217 */ 217 */
218void Today::startConfig() { 218void Today::startConfig() {
219 219
220 conf = new todayconfig ( this, "", true ); 220 conf = new todayconfig ( this, "", true );
221 // read the config 221 // read the config
222 Config cfg("today"); 222 Config cfg("today");
223 cfg.setGroup("BaseConfig"); 223 cfg.setGroup("BaseConfig");
224 224
225 //init(); 225 //init();
226 226
227 conf->SpinBox1->setValue(MAX_LINES_MEET); 227 conf->SpinBox1->setValue(MAX_LINES_MEET);
228 // location show box 228 // location show box
229 conf->CheckBox1->setChecked(SHOW_LOCATION); 229 conf->CheckBox1->setChecked(SHOW_LOCATION);
230 // notes show box 230 // notes show box
231 conf->CheckBox2->setChecked(SHOW_NOTES); 231 conf->CheckBox2->setChecked(SHOW_NOTES);
232 // task lines 232 // task lines
233 conf->SpinBox2->setValue(MAX_LINES_TASK); 233 conf->SpinBox2->setValue(MAX_LINES_TASK);
234 // clip when? 234 // clip when?
235 conf->SpinBox7->setValue(MAX_CHAR_CLIP); 235 conf->SpinBox7->setValue(MAX_CHAR_CLIP);
236 // only later 236 // only later
237 conf->CheckBox3->setChecked(ONLY_LATER); 237 conf->CheckBox3->setChecked(ONLY_LATER);
238 // if today should be autostarted 238 // if today should be autostarted
239 conf->CheckBoxAuto->setChecked(AUTOSTART); 239 conf->CheckBoxAuto->setChecked(AUTOSTART);
240 240
241 conf->exec(); 241 conf->exec();
242 242
243 int maxlinestask = conf->SpinBox2->value(); 243 int maxlinestask = conf->SpinBox2->value();
244 int maxmeet = conf->SpinBox1->value(); 244 int maxmeet = conf->SpinBox1->value();
245 int location = conf->CheckBox1->isChecked(); 245 int location = conf->CheckBox1->isChecked();
246 int notes = conf->CheckBox2->isChecked(); 246 int notes = conf->CheckBox2->isChecked();
247 int maxcharclip = conf->SpinBox7->value(); 247 int maxcharclip = conf->SpinBox7->value();
248 int onlylater = conf->CheckBox3->isChecked(); 248 int onlylater = conf->CheckBox3->isChecked();
249 int autostart =conf->CheckBoxAuto->isChecked(); 249 int autostart =conf->CheckBoxAuto->isChecked();
250 250
251 cfg.writeEntry("maxlinestask",maxlinestask); 251 cfg.writeEntry("maxlinestask",maxlinestask);
252 cfg.writeEntry("maxcharclip", maxcharclip); 252 cfg.writeEntry("maxcharclip", maxcharclip);
253 cfg.writeEntry("maxlinesmeet",maxmeet); 253 cfg.writeEntry("maxlinesmeet",maxmeet);
254 cfg.writeEntry("showlocation",location); 254 cfg.writeEntry("showlocation",location);
255 cfg.writeEntry("shownotes", notes); 255 cfg.writeEntry("shownotes", notes);
256 cfg.writeEntry("onlylater", onlylater); 256 cfg.writeEntry("onlylater", onlylater);
257 cfg.setGroup("Autostart"); 257 cfg.setGroup("Autostart");
258 cfg.writeEntry("autostart", autostart); 258 cfg.writeEntry("autostart", autostart);
259 259
260 // sync it to "disk" 260 // sync it to "disk"
261 cfg.write(); 261 cfg.write();
262 NEW_START=1; 262 NEW_START=1;
263 draw(); 263 draw();
264 autoStart(); 264 autoStart();
265} 265}
266 266
267 267
268/* 268/*
269 * Get all events that are in the datebook xml file for today 269 * Get all events that are in the datebook xml file for today
270 */ 270 */
271void Today::getDates() { 271void Today::getDates() {
272 QDate date = QDate::currentDate(); 272 QDate date = QDate::currentDate();
273 273
274 if (AllDateBookEvents) delete AllDateBookEvents; 274 if (AllDateBookEvents) delete AllDateBookEvents;
275 AllDateBookEvents = new QWidget( ); 275 AllDateBookEvents = new QWidget( );
276 QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); 276 QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents);
277 277
278 QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); 278 QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date);
279 279
280 qBubbleSort(list); 280 qBubbleSort(list);
281 // printf("Get dates\n"); 281 // printf("Get dates\n");
282 282
283 Config config( "qpe" ); 283 Config config( "qpe" );
284 // if 24 h format 284 // if 24 h format
285 //bool ampm = config.readBoolEntry( "AMPM", TRUE ); 285 //bool ampm = config.readBoolEntry( "AMPM", TRUE );
286 286
287 int count=0; 287 int count=0;
288 288
289 if ( list.count() > 0 ) { 289 if ( list.count() > 0 ) {
290 290
291 for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); 291 for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin();
292 it!=list.end(); ++it ) { 292 it!=list.end(); ++it ) {
293 293
294 294
295 if ( count <= MAX_LINES_MEET ) { 295 if ( count <= MAX_LINES_MEET ) {
296 296
297 QTime time = QTime::currentTime(); 297 QTime time = QTime::currentTime();
298 298
299 if (!ONLY_LATER) { 299 if (!ONLY_LATER) {
300 count++; 300 count++;
301 DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); 301 DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES);
302 layoutDates->addWidget(l); 302 layoutDates->addWidget(l);
303 connect (l, SIGNAL(editEvent(const Event &)), 303 connect (l, SIGNAL(editEvent(const Event &)),
304 this, SLOT(editEvent(const Event &))); 304 this, SLOT(editEvent(const Event &)));
305 } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { 305 } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) {
306 count++; 306 count++;
307 307
308 // show only later appointments 308 // show only later appointments
309 DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); 309 DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES);
310 layoutDates->addWidget(l); 310 layoutDates->addWidget(l);
311 connect (l, SIGNAL(editEvent(const Event &)), 311 connect (l, SIGNAL(editEvent(const Event &)),
312 this, SLOT(editEvent(const Event &))); 312 this, SLOT(editEvent(const Event &)));
313 } 313 }
314 } 314 }
315 } 315 }
316 if (ONLY_LATER && count==0) { 316 if (ONLY_LATER && count==0) {
317 QLabel* noMoreEvents = new QLabel(AllDateBookEvents); 317 QLabel* noMoreEvents = new QLabel(AllDateBookEvents);
318 noMoreEvents->setText("No more appointments today"); 318 noMoreEvents->setText(tr("No more appointments today"));
319 layoutDates->addWidget(noMoreEvents); 319 layoutDates->addWidget(noMoreEvents);
320 } 320 }
321 } else { 321 } else {
322 QLabel* noEvents = new QLabel(AllDateBookEvents); 322 QLabel* noEvents = new QLabel(AllDateBookEvents);
323 noEvents->setText("No appointments today"); 323 noEvents->setText(tr("No appointments today"));
324 layoutDates->addWidget(noEvents); 324 layoutDates->addWidget(noEvents);
325 } 325 }
326 326
327 layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); 327 layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding));
328 sv1->addChild(AllDateBookEvents); 328 sv1->addChild(AllDateBookEvents);
329 AllDateBookEvents->show(); 329 AllDateBookEvents->show();
330} 330}
331 331
332 332
333void Today::getMail() { 333void Today::getMail() {
334 Config cfg("opiemail"); 334 Config cfg("opiemail");
335 cfg.setGroup("today"); 335 cfg.setGroup("today");
336 336
337 // how many lines should be showed in the task section 337 // how many lines should be showed in the task section
338 int NEW_MAILS = cfg.readNumEntry("newmails",0); 338 int NEW_MAILS = cfg.readNumEntry("newmails",0);
339 int OUTGOING = cfg.readNumEntry("outgoing",0); 339 int OUTGOING = cfg.readNumEntry("outgoing",0);
340 340
341 QString output = tr("<b>%1</b> new mail(s), <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING); 341 QString output = tr("<b>%1</b> new mail(s), <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING);
342 342
343 MailField->setText(output); 343 MailField->setText(output);
344} 344}
345 345
346 346
347/* 347/*
348 * Get the todos 348 * Get the todos
349 */ 349 */
350void Today::getTodo() { 350void Today::getTodo() {
351 351
352 QString output; 352 QString output;
353 QString tmpout; 353 QString tmpout;
354 int count = 0; 354 int count = 0;
355 int ammount = 0; 355 int ammount = 0;
356 356
357 // get overdue todos first 357 // get overdue todos first
358 QValueList<ToDoEvent> overDueList = todo->overDue(); 358 QValueList<ToDoEvent> overDueList = todo->overDue();
359 qBubbleSort(overDueList); 359 qBubbleSort(overDueList);
360 for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin(); 360 for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin();
361 it!=overDueList.end(); ++it ) { 361 it!=overDueList.end(); ++it ) {
362 if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) { 362 if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) {
363 tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>"; 363 tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>";
364 ammount++; 364 ammount++;
365 } 365 }
366 } 366 }
367 367
368 // get total number of still open todos 368 // get total number of still open todos
369 QValueList<ToDoEvent> open = todo->rawToDos(); 369 QValueList<ToDoEvent> open = todo->rawToDos();
370 qBubbleSort(open); 370 qBubbleSort(open);
371 for ( QValueList<ToDoEvent>::Iterator it=open.begin(); 371 for ( QValueList<ToDoEvent>::Iterator it=open.begin();
372 it!=open.end(); ++it ) { 372 it!=open.end(); ++it ) {
373 if (!(*it).isCompleted()){ 373 if (!(*it).isCompleted()){
374 count +=1; 374 count +=1;
375 // not the overdues, we allready got them, and not if we are 375 // not the overdues, we allready got them, and not if we are
376 // over the maxlines 376 // over the maxlines
377 if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { 377 if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) {
378 tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; 378 tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>";
379 ammount++; 379 ammount++;
380 } 380 }
381 } 381 }
382 } 382 }
383 383
384 384
385 if (count > 0) { 385 if (count > 0) {
386 if( count == 1 ) { 386 if( count == 1 ) {
387 output = tr("There is <b> 1</b> active task: <br>" ); 387 output = tr("There is <b> 1</b> active task: <br>" );
388 } else { 388 } else {
389 output = tr("There are <b> %1</b> active tasks: <br>").arg(count); 389 output = tr("There are <b> %1</b> active tasks: <br>").arg(count);
390 } 390 }
391 output += tmpout; 391 output += tmpout;
392 } else { 392 } else {
393 output = tr("No active tasks"); 393 output = tr("No active tasks");
394 } 394 }
395 395
396 TodoField->setText(tr(output)); 396 TodoField->setText(tr(output));
397} 397}
398 398
399/* 399/*
400 * launches datebook 400 * launches datebook
401 */ 401 */
402void Today::startDatebook() { 402void Today::startDatebook() {
403 QCopEnvelope e("QPE/System", "execute(QString)"); 403 QCopEnvelope e("QPE/System", "execute(QString)");
404 e << QString("datebook"); 404 e << QString("datebook");
405} 405}
406 406
407/* 407/*
408 * starts the edit dialog as known from datebook 408 * starts the edit dialog as known from datebook
409 */ 409 */
410 410
411extern QPEApplication *todayApp; 411extern QPEApplication *todayApp;
412 412
413void Today::editEvent(const Event &e) { 413void Today::editEvent(const Event &e) {
414 startDatebook(); 414 startDatebook();
415 415
416 while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents(); 416 while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents();
417 QCopEnvelope env("QPE/Datebook", "editEvent(int)"); 417 QCopEnvelope env("QPE/Datebook", "editEvent(int)");
418 env << e.uid(); 418 env << e.uid();
419} 419}
420 420
421/* 421/*
422 * launches todolist 422 * launches todolist
423 */ 423 */
424void Today::startTodo() { 424void Today::startTodo() {
425 QCopEnvelope e("QPE/System", "execute(QString)"); 425 QCopEnvelope e("QPE/System", "execute(QString)");
426 e << QString("todolist"); 426 e << QString("todolist");
427} 427}
428 428
429/* 429/*
430 * launch opiemail 430 * launch opiemail
431 */ 431 */
432void Today::startMail() { 432void Today::startMail() {
433 QCopEnvelope e("QPE/System", "execute(QString)"); 433 QCopEnvelope e("QPE/System", "execute(QString)");
434 e << QString("opiemail"); 434 e << QString("opiemail");
435} 435}
436 436
437 437
438Today::~Today() { 438Today::~Today() {
439} 439}
440 440
441 441
442 442
443/* 443/*
444 * Gets the events for the current day, if it should get all dates 444 * Gets the events for the current day, if it should get all dates
445 */ 445 */
446DateBookEvent::DateBookEvent(const EffectiveEvent &ev, 446DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
447 QWidget* parent = 0, 447 QWidget* parent = 0,
448 int SHOW_LOCATION = 0, 448 int SHOW_LOCATION = 0,
449 int SHOW_NOTES = 0, 449 int SHOW_NOTES = 0,
450 const char* name = 0, 450 const char* name = 0,
451 WFlags fl = 0) : 451 WFlags fl = 0) :
452 ClickableLabel(parent,name,fl), event(ev) { 452 ClickableLabel(parent,name,fl), event(ev) {
453 453
454 QString msg; 454 QString msg;
455 //QTime time = QTime::currentTime(); 455 //QTime time = QTime::currentTime();
456 456
457 if (!ONLY_LATER) { 457 if (!ONLY_LATER) {
458 msg += "<B>" + (ev).description() + "</B>"; 458 msg += "<B>" + (ev).description() + "</B>";
459 if ( (ev).event().hasAlarm() ) { 459 if ( (ev).event().hasAlarm() ) {
460 msg += " <b>[with alarm]</b>"; 460 msg += " <b>[with alarm]</b>";
461 } 461 }
462 // include location or not 462 // include location or not
463 if (SHOW_LOCATION == 1) { 463 if (SHOW_LOCATION == 1) {
464 msg += "<BR><i>" + (ev).location() + "</i>"; 464 msg += "<BR><i>" + (ev).location() + "</i>";
465 } 465 }
466 466
467 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { 467 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
468 msg += "<br>All day"; 468 msg += "<br>All day";
469 } else { 469 } else {
470 // start time of event 470 // start time of event
471 msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) ) 471 msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) )
472 // end time of event 472 // end time of event
473 + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) ); 473 + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) );
474 } 474 }
475 475
476 // include possible note or not 476 // include possible note or not
477 if (SHOW_NOTES == 1) { 477 if (SHOW_NOTES == 1) {
478 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); 478 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP);
479 } 479 }
480 } 480 }
481 setText(msg); 481 setText(msg);
482 connect(this, SIGNAL(clicked()), this, SLOT(editMe())); 482 connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
483 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); 483 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
484} 484}
485 485
486 486
487DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, 487DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev,
488 QWidget* parent = 0, 488 QWidget* parent = 0,
489 int SHOW_LOCATION = 0, 489 int SHOW_LOCATION = 0,
490 int SHOW_NOTES = 0, 490 int SHOW_NOTES = 0,
491 const char* name = 0, 491 const char* name = 0,
492 WFlags fl = 0) : 492 WFlags fl = 0) :
493 ClickableLabel(parent,name,fl), event(ev) { 493 ClickableLabel(parent,name,fl), event(ev) {
494 494
495 QString msg; 495 QString msg;
496 QTime time = QTime::currentTime(); 496 QTime time = QTime::currentTime();
497 497
498 if ((time.toString() <= TimeString::dateString((ev).event().end())) ) { 498 if ((time.toString() <= TimeString::dateString((ev).event().end())) ) {
499 // show only later appointments 499 // show only later appointments
500 msg += "<B>" + (ev).description() + "</B>"; 500 msg += "<B>" + (ev).description() + "</B>";
501 if ( (ev).event().hasAlarm() ) { 501 if ( (ev).event().hasAlarm() ) {
502 msg += " <b>[with alarm]</b>"; 502 msg += " <b>[with alarm]</b>";
503 } 503 }
504 // include location or not 504 // include location or not
505 if (SHOW_LOCATION == 1) { 505 if (SHOW_LOCATION == 1) {
506 msg += "<BR><i>" + (ev).location() + "</i>"; 506 msg += "<BR><i>" + (ev).location() + "</i>";
507 } 507 }
508 508
509 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { 509 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
510 msg += "<br>All day"; 510 msg += "<br>All day";
511 } else { 511 } else {
512 // start time of event 512 // start time of event
513 msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) ) 513 msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) )
514 // end time of event 514 // end time of event
515 + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) ); 515 + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) );
516 } 516 }
517 // include possible note or not 517 // include possible note or not
518 if (SHOW_NOTES == 1) { 518 if (SHOW_NOTES == 1) {
519 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); 519 msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP);
520 } 520 }
521 } 521 }
522 522
523 setText(msg); 523 setText(msg);
524 connect(this, SIGNAL(clicked()), this, SLOT(editMe())); 524 connect(this, SIGNAL(clicked()), this, SLOT(editMe()));
525 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); 525 setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) );
526} 526}
527 527
528 528
529void DateBookEvent::editMe() { 529void DateBookEvent::editMe() {
530 emit editEvent(event.event()); 530 emit editEvent(event.event());
531} 531}
532 532
533void DateBookEventLater::editMe() { 533void DateBookEventLater::editMe() {
534 emit editEvent(event.event()); 534 emit editEvent(event.event());
535} 535}
536 536
537 537
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index c0b8d34..dfcc34e 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -1,192 +1,191 @@
1/* 1/*
2 * todaybase.cpp * 2 * todaybase.cpp *
3 * --------------------- 3 * ---------------------
4 * 4 *
5 * begin : Sun 10 17:20:00 CEST 2002 5 * begin : Sun 10 17:20:00 CEST 2002
6 * copyright : (c) 2002 by Maximilian Reiß 6 * copyright : (c) 2002 by Maximilian Reiß
7 * email : max.reiss@gmx.de 7 * email : max.reiss@gmx.de
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 "todaybase.h" 19#include "todaybase.h"
20 20
21#include <qframe.h> 21#include <qframe.h>
22#include <qlabel.h> 22#include <qlabel.h>
23#include <qpushbutton.h> 23#include <qpushbutton.h>
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qvariant.h> 25#include <qvariant.h>
26#include <qtooltip.h>
27#include <qwhatsthis.h> 26#include <qwhatsthis.h>
28#include <qimage.h> 27#include <qimage.h>
29#include <qpixmap.h> 28#include <qpixmap.h>
30#include <qscrollview.h> 29#include <qscrollview.h>
31#include <qvbox.h> 30#include <qvbox.h>
32#include <qapplication.h> 31#include <qapplication.h>
33 32
34#include <qpe/resource.h> 33#include <qpe/resource.h>
35 34
36/* 35/*
37 * Constructs a TodayBase which is a child of 'parent', with the 36 * Constructs a TodayBase which is a child of 'parent', with the
38 * name 'name' and widget flags set to 'f' 37 * name 'name' and widget flags set to 'f'
39 */ 38 */
40TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 39TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
41 : QWidget( parent, name, fl ) 40 : QWidget( parent, name, fl )
42{ 41{
43 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo 42 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo
44 QPixmap datebook = Resource::loadPixmap("DateBook"); // datebook 43 QPixmap datebook = Resource::loadPixmap("DateBook"); // datebook
45 QPixmap todo = Resource::loadPixmap( "TodoList" ); // todo 44 QPixmap todo = Resource::loadPixmap( "TodoList" ); // todo
46 QPixmap config = Resource::loadPixmap( "today/config" ); // config icon 45 QPixmap config = Resource::loadPixmap( "today/config" ); // config icon
47 QPixmap mail = Resource::loadPixmap( "today/mail" ); // mail icon 46 QPixmap mail = Resource::loadPixmap( "today/mail" ); // mail icon
48 47
49 QPalette pal = this->palette(); 48 QPalette pal = this->palette();
50 QColor col = pal.color(QPalette::Active, QColorGroup::Background); 49 QColor col = pal.color(QPalette::Active, QColorGroup::Background);
51 pal.setColor(QPalette::Active, QColorGroup::Button, col); 50 pal.setColor(QPalette::Active, QColorGroup::Button, col);
52 this->setPalette(pal); 51 this->setPalette(pal);
53 52
54 53
55 QWidget *d = QApplication::desktop(); 54 QWidget *d = QApplication::desktop();
56 int w=d->width(); 55 int w=d->width();
57 int h=d->height(); 56 int h=d->height();
58 resize( w , h ); 57 resize( w , h );
59 58
60 // hehe, qt is ... 59 // hehe, qt is ...
61 getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" ); 60 getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" );
62 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); 61 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) );
63 62
64 QVBoxLayout * layout = new QVBoxLayout(this); 63 QVBoxLayout * layout = new QVBoxLayout(this);
65 64
66 // --- logo Section --- 65 // --- logo Section ---
67 QPalette pal2; 66 QPalette pal2;
68 QColorGroup cg; 67 QColorGroup cg;
69 cg.setColor( QColorGroup::Text, white ); 68 cg.setColor( QColorGroup::Text, white );
70 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); 69 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) );
71 pal2.setActive( cg ); 70 pal2.setActive( cg );
72 // today logo 71 // today logo
73 Frame = new QLabel( this, "Frame" ); 72 Frame = new QLabel( this, "Frame" );
74 Frame->setPalette( pal2 ); 73 Frame->setPalette( pal2 );
75 Frame->setFrameShape( QFrame::StyledPanel ); 74 Frame->setFrameShape( QFrame::StyledPanel );
76 Frame->setFrameShadow( QFrame::Raised ); 75 Frame->setFrameShadow( QFrame::Raised );
77 Frame->setLineWidth( 0 ); 76 Frame->setLineWidth( 0 );
78 Frame->setMaximumHeight(50); 77 Frame->setMaximumHeight(50);
79 Frame->setMinimumHeight(50); 78 Frame->setMinimumHeight(50);
80 // date 79 // date
81 TextLabel1 = new QLabel( Frame, "TextLabel1" ); 80 TextLabel1 = new QLabel( Frame, "TextLabel1" );
82 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); 81 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) );
83 QFont TextLabel1_font( TextLabel1->font() ); 82 QFont TextLabel1_font( TextLabel1->font() );
84 TextLabel1_font.setBold( TRUE ); 83 TextLabel1_font.setBold( TRUE );
85 TextLabel1->setFont( TextLabel1_font ); 84 TextLabel1->setFont( TextLabel1_font );
86 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); 85 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin );
87 TextLabel1->setTextFormat( RichText ); 86 TextLabel1->setTextFormat( RichText );
88 87
89 OwnerField = new QLabel(this , "Owner" ); 88 OwnerField = new QLabel(this , "Owner" );
90 OwnerField->setGeometry(QRect(0,0, this->width(), 12 )); 89 OwnerField->setGeometry(QRect(0,0, this->width(), 12 ));
91 OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) ); 90 OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) );
92 OwnerField->setMaximumHeight(12); 91 OwnerField->setMaximumHeight(12);
93 92
94 // --- dates section --- 93 // --- dates section ---
95 Frame4 = new QFrame( this, "Frame4" ); 94 Frame4 = new QFrame( this, "Frame4" );
96 Frame4->setPalette( pal ); 95 Frame4->setPalette( pal );
97 Frame4->setFrameShape( QScrollView::StyledPanel ); 96 Frame4->setFrameShape( QScrollView::StyledPanel );
98 Frame4->setFrameShadow( QScrollView::Sunken ); 97 Frame4->setFrameShadow( QScrollView::Sunken );
99 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); 98 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin );
100 Frame4->setFrameStyle( QFrame::NoFrame ); 99 Frame4->setFrameStyle( QFrame::NoFrame );
101 Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) ); 100 Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) );
102 101
103 sv1 = new QScrollView( Frame4 ); 102 sv1 = new QScrollView( Frame4 );
104 sv1->setResizePolicy(QScrollView::AutoOneFit); 103 sv1->setResizePolicy(QScrollView::AutoOneFit);
105 sv1->setHScrollBarMode( QScrollView::AlwaysOff ); 104 sv1->setHScrollBarMode( QScrollView::AlwaysOff );
106 // need to find a better way!!! 105 // need to find a better way!!!
107 sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) ); 106 sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) );
108 sv1->setFrameShape(QFrame::NoFrame); 107 sv1->setFrameShape(QFrame::NoFrame);
109 108
110 DatesButton = new QPushButton (Frame4, "DatesButton" ); 109 DatesButton = new QPushButton (Frame4, "DatesButton" );
111 DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); 110 DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) );
112 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); 111 DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin );
113 DatesButton->setPalette( pal ); 112 DatesButton->setPalette( pal );
114 DatesButton->setPixmap( datebook ); 113 DatesButton->setPixmap( datebook );
115 DatesButton->setFlat( TRUE ); 114 DatesButton->setFlat( TRUE );
116 115
117 // --- mail section ---) 116 // --- mail section ---)
118 MailFrame = new QFrame( this ,"MailFrame" ); 117 MailFrame = new QFrame( this ,"MailFrame" );
119 MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); 118 MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin );
120 MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) ); 119 MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) );
121 MailFrame->setFrameStyle( QFrame::NoFrame ); 120 MailFrame->setFrameStyle( QFrame::NoFrame );
122 121
123 QFrame* Line1 = new QFrame( MailFrame); 122 QFrame* Line1 = new QFrame( MailFrame);
124 Line1->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) ); 123 Line1->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) );
125 Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 124 Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken );
126 125
127 MailButton = new QPushButton (MailFrame, "MailButton" ); 126 MailButton = new QPushButton (MailFrame, "MailButton" );
128 MailButton->setGeometry( QRect( 2, 3, 36, 19 ) ); 127 MailButton->setGeometry( QRect( 2, 3, 36, 19 ) );
129 MailButton->setPalette( pal ); 128 MailButton->setPalette( pal );
130 MailButton->setPixmap( mail ); 129 MailButton->setPixmap( mail );
131 MailButton->setFlat( TRUE ); 130 MailButton->setFlat( TRUE );
132 131
133 MailField = new QLabel( MailFrame, "MailField" ); 132 MailField = new QLabel( MailFrame, "MailField" );
134 MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) ); 133 MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) );
135 MailField->setText( tr( "Opiemail not installed" ) ); 134 MailField->setText( tr( "Opiemail not installed" ) );
136 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 135 MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
137 MailField->setMaximumHeight(40); 136 MailField->setMaximumHeight(40);
138 MailField->setMinimumHeight(15); 137 MailField->setMinimumHeight(15);
139 138
140 // --- todo section -- 139 // --- todo section --
141 Frame15 = new QFrame( this, "Frame15" ); 140 Frame15 = new QFrame( this, "Frame15" );
142 Frame15->setFrameStyle( QFrame::NoFrame ); 141 Frame15->setFrameStyle( QFrame::NoFrame );
143 Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) ); 142 Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) );
144 143
145 QFrame* Line2 = new QFrame( Frame15); 144 QFrame* Line2 = new QFrame( Frame15);
146 Line2->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) ); 145 Line2->setGeometry( QRect( -5, 0, MailFrame->width()+5, 5 ) );
147 Line2->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 146 Line2->setFrameStyle( QFrame::HLine | QFrame::Sunken );
148 147
149 TodoButton = new QPushButton (Frame15, "TodoButton" ); 148 TodoButton = new QPushButton (Frame15, "TodoButton" );
150 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); 149 TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) );
151 TodoButton->setPalette( pal ); 150 TodoButton->setPalette( pal );
152 TodoButton->setPixmap( todo ); 151 TodoButton->setPixmap( todo );
153 TodoButton->setFlat( TRUE ); 152 TodoButton->setFlat( TRUE );
154 153
155 QScrollView* sv2 = new QScrollView( Frame15 ); 154 QScrollView* sv2 = new QScrollView( Frame15 );
156 sv2->setResizePolicy(QScrollView::AutoOneFit); 155 sv2->setResizePolicy(QScrollView::AutoOneFit);
157 sv2->setHScrollBarMode( QScrollView::AlwaysOff ); 156 sv2->setHScrollBarMode( QScrollView::AlwaysOff );
158 sv2->setGeometry (QRect( 40, 3, Frame15->width()-40 , (Frame15->height()/3) ) ); 157 sv2->setGeometry (QRect( 40, 3, Frame15->width()-40 , (Frame15->height()/3) ) );
159 sv2->setFrameShape(QFrame::NoFrame); 158 sv2->setFrameShape(QFrame::NoFrame);
160 159
161 TodoField = new QLabel( sv2->viewport(), "TodoField" ); 160 TodoField = new QLabel( sv2->viewport(), "TodoField" );
162 sv2->addChild(TodoField); 161 sv2->addChild(TodoField);
163 TodoField->setFrameShadow( QLabel::Plain ); 162 TodoField->setFrameShadow( QLabel::Plain );
164 //TodoField->setText( tr( "No current todos" ) ); 163 //TodoField->setText( tr( "No current todos" ) );
165 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); 164 TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) );
166 165
167 PushButton1 = new QPushButton (Frame15, "PushButton1" ); 166 PushButton1 = new QPushButton (Frame15, "PushButton1" );
168 PushButton1->setGeometry( QRect( 2, 68, 25, 21 ) ); 167 PushButton1->setGeometry( QRect( 2, 68, 25, 21 ) );
169 PushButton1->setPixmap( config ); 168 PushButton1->setPixmap( config );
170 PushButton1->setPalette( pal ); 169 PushButton1->setPalette( pal );
171 PushButton1->setAutoDefault( TRUE ); 170 PushButton1->setAutoDefault( TRUE );
172 PushButton1->setFlat( TRUE ); 171 PushButton1->setFlat( TRUE );
173 172
174 // -- layout -- 173 // -- layout --
175 layout->addWidget(Frame); 174 layout->addWidget(Frame);
176 layout->addWidget(OwnerField); 175 layout->addWidget(OwnerField);
177 layout->addWidget(Frame4); 176 layout->addWidget(Frame4);
178 layout->addWidget(MailFrame); 177 layout->addWidget(MailFrame);
179 layout->addWidget(Frame15); 178 layout->addWidget(Frame15);
180 179
181 layout->setStretchFactor(Frame4,5); 180 layout->setStretchFactor(Frame4,5);
182 layout->setStretchFactor(MailFrame,1); 181 layout->setStretchFactor(MailFrame,1);
183 layout->setStretchFactor(Frame15,4); 182 layout->setStretchFactor(Frame15,4);
184} 183}
185 184
186/* 185/*
187 * Destroys the object and frees any allocated resources 186 * Destroys the object and frees any allocated resources
188 */ 187 */
189TodayBase::~TodayBase() 188TodayBase::~TodayBase()
190{ 189{
191} 190}
192 191
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index 7c690a7..a908d98 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -1,147 +1,146 @@
1/**************************************************************************** 1/****************************************************************************
2** Form implementation generated from reading ui file 'todayconfig.ui' 2** Form implementation generated from reading ui file 'todayconfig.ui'
3** 3**
4** Created: Thu Feb 14 15:04:33 2002 4** Created: Thu Feb 14 15:04:33 2002
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#include "todayconfig.h" 9#include "todayconfig.h"
10 10
11#include <qcheckbox.h> 11#include <qcheckbox.h>
12#include <qframe.h> 12#include <qframe.h>
13#include <qlabel.h> 13#include <qlabel.h>
14#include <qspinbox.h> 14#include <qspinbox.h>
15#include <qtabwidget.h> 15#include <qtabwidget.h>
16#include <qwidget.h> 16#include <qwidget.h>
17#include <qlayout.h> 17#include <qlayout.h>
18#include <qvariant.h> 18#include <qvariant.h>
19#include <qtooltip.h>
20#include <qwhatsthis.h> 19#include <qwhatsthis.h>
21 20
22/* 21/*
23 * Constructs a todayconfig which is a child of 'parent', with the 22 * Constructs a todayconfig which is a child of 'parent', with the
24 * name 'name' and widget flags set to 'f' 23 * name 'name' and widget flags set to 'f'
25 * 24 *
26 * The dialog will by default be modeless, unless you set 'modal' to 25 * The dialog will by default be modeless, unless you set 'modal' to
27 * TRUE to construct a modal dialog. 26 * TRUE to construct a modal dialog.
28 */ 27 */
29todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags fl ) 28todayconfig::todayconfig( QWidget* parent, const char* name, bool modal, WFlags fl )
30 : QDialog( parent, name, modal, fl ) 29 : QDialog( parent, name, modal, fl )
31{ 30{
32 if ( !name ) 31 if ( !name )
33 setName( "todayconfig" ); 32 setName( "todayconfig" );
34 resize( 175, 232 ); 33 resize( 175, 232 );
35 setCaption( tr( "Today config" ) ); 34 setCaption( tr( "Today config" ) );
36 35
37 TabWidget3 = new QTabWidget( this, "TabWidget3" ); 36 TabWidget3 = new QTabWidget( this, "TabWidget3" );
38 TabWidget3->setGeometry( QRect( 0, 0, 220, 320 ) ); 37 TabWidget3->setGeometry( QRect( 0, 0, 220, 320 ) );
39 TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) ); 38 TabWidget3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, TabWidget3->sizePolicy().hasHeightForWidth() ) );
40 TabWidget3->setAutoMask( FALSE ); 39 TabWidget3->setAutoMask( FALSE );
41 TabWidget3->setTabShape( QTabWidget::Rounded ); 40 TabWidget3->setTabShape( QTabWidget::Rounded );
42 41
43 tab = new QWidget( TabWidget3, "tab" ); 42 tab = new QWidget( TabWidget3, "tab" );
44 43
45 Frame8 = new QFrame( tab, "Frame8" ); 44 Frame8 = new QFrame( tab, "Frame8" );
46 Frame8->setGeometry( QRect( -5, 0, 200, 300 ) ); 45 Frame8->setGeometry( QRect( -5, 0, 200, 300 ) );
47 Frame8->setFrameShape( QFrame::StyledPanel ); 46 Frame8->setFrameShape( QFrame::StyledPanel );
48 Frame8->setFrameShadow( QFrame::Raised ); 47 Frame8->setFrameShadow( QFrame::Raised );
49 48
50 TextLabel4 = new QLabel( Frame8, "TextLabel4" ); 49 TextLabel4 = new QLabel( Frame8, "TextLabel4" );
51 TextLabel4->setGeometry( QRect( 20, 65, 100, 60 ) ); 50 TextLabel4->setGeometry( QRect( 20, 65, 100, 60 ) );
52 TextLabel4->setText( tr( "Should the \n" 51 TextLabel4->setText( tr( "Should the \n"
53 "location \n" 52 "location \n"
54 "be shown?" ) ); 53 "be shown?" ) );
55 54
56 TextLabel5 = new QLabel( Frame8, "TextLabel5" ); 55 TextLabel5 = new QLabel( Frame8, "TextLabel5" );
57 TextLabel5->setGeometry( QRect( 20, 160, 120, 40 ) ); 56 TextLabel5->setGeometry( QRect( 20, 160, 120, 40 ) );
58 TextLabel5->setText( tr( "Should the notes \n" 57 TextLabel5->setText( tr( "Should the notes \n"
59 "be shown?" ) ); 58 "be shown?" ) );
60 59
61 CheckBox2 = new QCheckBox( Frame8, "CheckBox2" ); 60 CheckBox2 = new QCheckBox( Frame8, "CheckBox2" );
62 CheckBox2->setGeometry( QRect( 158, 170, 27, 21 ) ); 61 CheckBox2->setGeometry( QRect( 158, 170, 27, 21 ) );
63 //CheckBox2->setText( tr( "" ) ); 62 //CheckBox2->setText( tr( "" ) );
64 63
65 CheckBox1 = new QCheckBox( Frame8, "CheckBox1" ); 64 CheckBox1 = new QCheckBox( Frame8, "CheckBox1" );
66 CheckBox1->setGeometry( QRect( 158, 65, 27, 50 ) ); 65 CheckBox1->setGeometry( QRect( 158, 65, 27, 50 ) );
67 //CheckBox1->setText( tr( "" ) ); 66 //CheckBox1->setText( tr( "" ) );
68 67
69 CheckBox3 = new QCheckBox (Frame8, "CheckBox3" ); 68 CheckBox3 = new QCheckBox (Frame8, "CheckBox3" );
70 CheckBox3->setGeometry( QRect( 158, 125, 27, 21 ) ); 69 CheckBox3->setGeometry( QRect( 158, 125, 27, 21 ) );
71 70
72 TextLabel6 = new QLabel( Frame8, "All Day"); 71 TextLabel6 = new QLabel( Frame8, "All Day");
73 TextLabel6->setGeometry( QRect( 20, 120, 100, 30 ) ); 72 TextLabel6->setGeometry( QRect( 20, 120, 100, 30 ) );
74 TextLabel6->setText( tr( "Show only later\n" 73 TextLabel6->setText( tr( "Show only later\n"
75 "appointments") ); 74 "appointments") );
76 75
77 SpinBox1 = new QSpinBox( Frame8, "SpinBox1" ); 76 SpinBox1 = new QSpinBox( Frame8, "SpinBox1" );
78 SpinBox1->setGeometry( QRect( 115, 20, 58, 25 ) ); 77 SpinBox1->setGeometry( QRect( 115, 20, 58, 25 ) );
79 SpinBox1->setMaxValue( 10 ); 78 SpinBox1->setMaxValue( 10 );
80 SpinBox1->setValue( 5 ); 79 SpinBox1->setValue( 5 );
81 80
82 TextLabel3 = new QLabel( Frame8, "TextLabel3" ); 81 TextLabel3 = new QLabel( Frame8, "TextLabel3" );
83 TextLabel3->setGeometry( QRect( 20, 10, 90, 60 ) ); 82 TextLabel3->setGeometry( QRect( 20, 10, 90, 60 ) );
84 TextLabel3->setText( tr( "How many \n" 83 TextLabel3->setText( tr( "How many \n"
85 "appointment\n" 84 "appointment\n"
86 "should should \n" 85 "should should \n"
87 "be shown?" ) ); 86 "be shown?" ) );
88 TabWidget3->insertTab( tab, tr( "Calendar" ) ); 87 TabWidget3->insertTab( tab, tr( "Calendar" ) );
89 88
90 tab_2 = new QWidget( TabWidget3, "tab_2" ); 89 tab_2 = new QWidget( TabWidget3, "tab_2" );
91 90
92 Frame9 = new QFrame( tab_2, "Frame9" ); 91 Frame9 = new QFrame( tab_2, "Frame9" );
93 Frame9->setGeometry( QRect( -5, 0, 230, 310 ) ); 92 Frame9->setGeometry( QRect( -5, 0, 230, 310 ) );
94 Frame9->setFrameShape( QFrame::StyledPanel ); 93 Frame9->setFrameShape( QFrame::StyledPanel );
95 Frame9->setFrameShadow( QFrame::Raised ); 94 Frame9->setFrameShadow( QFrame::Raised );
96 95
97 TextLabel6 = new QLabel( Frame9, "TextLabel6" ); 96 TextLabel6 = new QLabel( Frame9, "TextLabel6" );
98 TextLabel6->setGeometry( QRect( 20, 10, 100, 60 ) ); 97 TextLabel6->setGeometry( QRect( 20, 10, 100, 60 ) );
99 TextLabel6->setText( tr( "How many\n" 98 TextLabel6->setText( tr( "How many\n"
100 "tasks should \n" 99 "tasks should \n"
101 "be shown?" ) ); 100 "be shown?" ) );
102 101
103 SpinBox2 = new QSpinBox( Frame9, "SpinBox2" ); 102 SpinBox2 = new QSpinBox( Frame9, "SpinBox2" );
104 SpinBox2->setGeometry( QRect( 115, 20, 58, 25 ) ); 103 SpinBox2->setGeometry( QRect( 115, 20, 58, 25 ) );
105 SpinBox2->setMaxValue( 20 ); 104 SpinBox2->setMaxValue( 20 );
106 SpinBox2->setValue( 5 ); 105 SpinBox2->setValue( 5 );
107 TabWidget3->insertTab( tab_2, tr( "Tasks" ) ); 106 TabWidget3->insertTab( tab_2, tr( "Tasks" ) );
108 107
109 tab_3 = new QWidget( TabWidget3, "tab_3" ); 108 tab_3 = new QWidget( TabWidget3, "tab_3" );
110 109
111 Frame14 = new QFrame( tab_3, "Frame14" ); 110 Frame14 = new QFrame( tab_3, "Frame14" );
112 Frame14->setGeometry( QRect( -5, 0, 200, 220 ) ); 111 Frame14->setGeometry( QRect( -5, 0, 200, 220 ) );
113 Frame14->setFrameShape( QFrame::StyledPanel ); 112 Frame14->setFrameShape( QFrame::StyledPanel );
114 Frame14->setFrameShadow( QFrame::Raised ); 113 Frame14->setFrameShadow( QFrame::Raised );
115 114
116 TextLabel1 = new QLabel( Frame14, "TextLabel1" ); 115 TextLabel1 = new QLabel( Frame14, "TextLabel1" );
117 TextLabel1->setGeometry( QRect( 20, 20, 100, 30 ) ); 116 TextLabel1->setGeometry( QRect( 20, 20, 100, 30 ) );
118 TextLabel1->setText( tr( "Clip after how\n" 117 TextLabel1->setText( tr( "Clip after how\n"
119 "many letters" ) ); 118 "many letters" ) );
120 119
121 SpinBox7 = new QSpinBox( Frame14, "SpinBox7" ); 120 SpinBox7 = new QSpinBox( Frame14, "SpinBox7" );
122 SpinBox7->setGeometry( QRect( 115, 20, 58, 25 ) ); 121 SpinBox7->setGeometry( QRect( 115, 20, 58, 25 ) );
123 SpinBox7->setMaxValue( 80 ); 122 SpinBox7->setMaxValue( 80 );
124 SpinBox7->setValue( 30 ); 123 SpinBox7->setValue( 30 );
125 124
126 TextLabel2 = new QLabel( Frame14, "AutoStart" ); 125 TextLabel2 = new QLabel( Frame14, "AutoStart" );
127 TextLabel2->setGeometry( QRect( 20, 60, 100, 45 ) ); 126 TextLabel2->setGeometry( QRect( 20, 60, 100, 45 ) );
128 TextLabel2->setText( tr( "Should today be\n" 127 TextLabel2->setText( tr( "Should today be\n"
129 "autostarted on\n" 128 "autostarted on\n"
130 "resume ?" 129 "resume ?"
131 " (Opie only)" ) ); 130 " (Opie only)" ) );
132 131
133 CheckBoxAuto = new QCheckBox (Frame14, "CheckBoxAuto" ); 132 CheckBoxAuto = new QCheckBox (Frame14, "CheckBoxAuto" );
134 CheckBoxAuto->setGeometry( QRect( 158, 60, 27, 21 ) ); 133 CheckBoxAuto->setGeometry( QRect( 158, 60, 27, 21 ) );
135 134
136 TabWidget3->insertTab( tab_3, tr( "Misc" ) ); 135 TabWidget3->insertTab( tab_3, tr( "Misc" ) );
137 136
138} 137}
139 138
140/* 139/*
141 * Destroys the object and frees any allocated resources 140 * Destroys the object and frees any allocated resources
142 */ 141 */
143todayconfig::~todayconfig() 142todayconfig::~todayconfig()
144{ 143{
145 // no need to delete child widgets, Qt does it all for us 144 // no need to delete child widgets, Qt does it all for us
146} 145}
147 146