author | harlekin <harlekin> | 2002-03-17 14:47:52 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-03-17 14:47:52 (UTC) |
commit | 31e0537b3406d3e89df6424cded2570d28d61df4 (patch) (unidiff) | |
tree | 7bc5171eabbeb6f8469fdafb963a568e08b71aa1 | |
parent | 2f18edca6cc3539298deccee89e6f4dd7a2570a2 (diff) | |
download | opie-31e0537b3406d3e89df6424cded2570d28d61df4.zip opie-31e0537b3406d3e89df6424cded2570d28d61df4.tar.gz opie-31e0537b3406d3e89df6424cded2570d28d61df4.tar.bz2 |
new: Owner field with the ability to set any text with a qcop call
-rw-r--r-- | core/pim/today/today.cpp | 109 | ||||
-rw-r--r-- | core/pim/today/today.h | 5 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 25 | ||||
-rw-r--r-- | core/pim/today/todaybase.h | 2 |
4 files changed, 101 insertions, 40 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 81d4d36..08efe2d 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -24,12 +24,14 @@ | |||
24 | #include <qpe/datebookdb.h> | 24 | #include <qpe/datebookdb.h> |
25 | #include <qpe/timestring.h> | 25 | #include <qpe/timestring.h> |
26 | #include <qpe/config.h> | 26 | #include <qpe/config.h> |
27 | #include <qpe/qcopenvelope_qws.h> | 27 | #include <qpe/qcopenvelope_qws.h> |
28 | #include <qpe/qprocess.h> | 28 | #include <qpe/qprocess.h> |
29 | #include <qpe/resource.h> | 29 | #include <qpe/resource.h> |
30 | #include <qpe/contact.h> | ||
31 | #include <qpe/global.h> | ||
30 | 32 | ||
31 | #include <qdir.h> | 33 | #include <qdir.h> |
32 | #include <qfile.h> | 34 | #include <qfile.h> |
33 | #include <qdatetime.h> | 35 | #include <qdatetime.h> |
34 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
35 | #include <qcheckbox.h> | 37 | #include <qcheckbox.h> |
@@ -63,17 +65,66 @@ int NEW_START=1; | |||
63 | Today::Today( QWidget* parent, const char* name, WFlags fl ) | 65 | Today::Today( QWidget* parent, const char* name, WFlags fl ) |
64 | : TodayBase( parent, name, fl ), AllDateBookEvents(NULL) { | 66 | : TodayBase( parent, name, fl ), AllDateBookEvents(NULL) { |
65 | QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); | 67 | QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); |
66 | QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); | 68 | QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); |
67 | QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); | 69 | QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); |
68 | QObject::connect( (QObject*)MailButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); | 70 | QObject::connect( (QObject*)MailButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); |
69 | 71 | ||
72 | #if defined(Q_WS_QWS) | ||
73 | #if !defined(QT_NO_COP) | ||
74 | QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this ); | ||
75 | connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)), | ||
76 | this, SLOT ( channelReceived(const QCString &, const QByteArray &)) ); | ||
77 | #endif | ||
78 | #endif | ||
79 | |||
70 | draw(); | 80 | draw(); |
81 | setOwnerField(); | ||
71 | autoStart(); | 82 | autoStart(); |
72 | } | 83 | } |
73 | 84 | ||
85 | /* | ||
86 | * Qcop receive method. | ||
87 | */ | ||
88 | void Today::channelReceived(const QCString &msg, const QByteArray & data) { | ||
89 | QDataStream stream(data, IO_ReadOnly ); | ||
90 | if ( msg == "message(QString)" ) { | ||
91 | QString message; | ||
92 | stream >> message; | ||
93 | setOwnerField(message); | ||
94 | } | ||
95 | |||
96 | } | ||
97 | |||
98 | /* | ||
99 | * Initialises the owner field with the default value, the username | ||
100 | */ | ||
101 | void Today::setOwnerField() { | ||
102 | QString file = Global::applicationFileName("addressbook", "businesscard.vcf"); | ||
103 | if (QFile::exists(file)) { | ||
104 | Contact cont = Contact::readVCard(file)[0]; | ||
105 | QString returnString = cont.fullName(); | ||
106 | OwnerField->setText( tr ("<b>Owned by " + returnString + "</b>")); | ||
107 | } else { | ||
108 | OwnerField->setText( tr ("<b>to lame to fill out the business card </b>")); | ||
109 | } | ||
110 | } | ||
111 | |||
112 | /* | ||
113 | * Set the owner field with a given QString, for example per qcop. | ||
114 | */ | ||
115 | void Today::setOwnerField(QString &message) { | ||
116 | if (!message.isEmpty()) { | ||
117 | OwnerField->setText("<b>" + message + "</b>"); | ||
118 | } | ||
119 | } | ||
120 | |||
121 | /* | ||
122 | * Autostart, uses the new (opie only) autostart method in the launcher code. | ||
123 | * If registered against that today ist started on each resume. | ||
124 | */ | ||
74 | void Today::autoStart() { | 125 | void Today::autoStart() { |
75 | Config cfg("today"); | 126 | Config cfg("today"); |
76 | cfg.setGroup("Autostart"); | 127 | cfg.setGroup("Autostart"); |
77 | AUTOSTART = cfg.readNumEntry("autostart",1); | 128 | AUTOSTART = cfg.readNumEntry("autostart",1); |
78 | if (AUTOSTART) { | 129 | if (AUTOSTART) { |
79 | QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); | 130 | QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); |
@@ -83,22 +134,24 @@ void Today::autoStart() { | |||
83 | QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); | 134 | QCopEnvelope e("QPE/System", "autoStart(QString,QString)"); |
84 | e << QString("remove"); | 135 | e << QString("remove"); |
85 | e << QString("today"); | 136 | e << QString("today"); |
86 | } | 137 | } |
87 | } | 138 | } |
88 | 139 | ||
140 | /* | ||
141 | * Repaint method. Reread all fields. | ||
142 | */ | ||
89 | void Today::draw() { | 143 | void Today::draw() { |
90 | init(); | 144 | init(); |
91 | getDates(); | 145 | getDates(); |
92 | getMail(); | 146 | getMail(); |
93 | getTodo(); | 147 | getTodo(); |
94 | // how often refresh | 148 | // how often refresh |
95 | QTimer::singleShot( 10*1000, this, SLOT(draw() ) ); | 149 | QTimer::singleShot( 10*1000, this, SLOT(draw() ) ); |
96 | } | 150 | } |
97 | 151 | ||
98 | |||
99 | /* | 152 | /* |
100 | * Check if the todolist.xml was modified (if there are new entries. | 153 | * Check if the todolist.xml was modified (if there are new entries. |
101 | * Returns true if it was modified. | 154 | * Returns true if it was modified. |
102 | */ | 155 | */ |
103 | bool Today::checkIfModified() { | 156 | bool Today::checkIfModified() { |
104 | 157 | ||
@@ -119,44 +172,48 @@ bool Today::checkIfModified() { | |||
119 | cfg.write(); | 172 | cfg.write(); |
120 | return true; | 173 | return true; |
121 | } | 174 | } |
122 | } | 175 | } |
123 | 176 | ||
124 | 177 | ||
178 | /* | ||
179 | * Init stuff needed for today. Reads the config file. | ||
180 | */ | ||
125 | void Today::init() { | 181 | void Today::init() { |
126 | QDate date = QDate::currentDate(); | 182 | QDate date = QDate::currentDate(); |
127 | QString time = (tr( date.toString()) ); | 183 | QString time = (tr( date.toString()) ); |
128 | // QString time = (tr( date.toString()) , white); | ||
129 | 184 | ||
130 | TextLabel1->setText(time); | 185 | TextLabel1->setText(time); |
131 | db = new DateBookDB; | 186 | db = new DateBookDB; |
132 | 187 | ||
133 | // read config | 188 | // read config |
134 | Config cfg("today"); | 189 | Config cfg("today"); |
135 | cfg.setGroup("BaseConfig"); | 190 | cfg.setGroup("BaseConfig"); |
136 | 191 | ||
192 | // -- config file section -- | ||
137 | // how many lines should be showed in the task section | 193 | // how many lines should be showed in the task section |
138 | MAX_LINES_TASK = cfg.readNumEntry("maxlinestask",5); | 194 | MAX_LINES_TASK = cfg.readNumEntry("maxlinestask",5); |
139 | // after how many chars should the be cut off on tasks and notes | 195 | // after how many chars should the be cut off on tasks and notes |
140 | MAX_CHAR_CLIP = cfg.readNumEntry("maxcharclip",30); | 196 | MAX_CHAR_CLIP = cfg.readNumEntry("maxcharclip",40); |
141 | // how many lines should be showed in the datebook section | 197 | // how many lines should be showed in the datebook section |
142 | MAX_LINES_MEET = cfg.readNumEntry("maxlinesmeet",5); | 198 | MAX_LINES_MEET = cfg.readNumEntry("maxlinesmeet",5); |
143 | // If location is to be showed too, 1 to activate it. | 199 | // If location is to be showed too, 1 to activate it. |
144 | SHOW_LOCATION = cfg.readNumEntry("showlocation",1); | 200 | SHOW_LOCATION = cfg.readNumEntry("showlocation",1); |
145 | // if notes should be shown | 201 | // if notes should be shown |
146 | SHOW_NOTES = cfg.readNumEntry("shownotes",0); | 202 | SHOW_NOTES = cfg.readNumEntry("shownotes",0); |
203 | // should only later appointments be shown or all for the current day. | ||
147 | ONLY_LATER = cfg.readNumEntry("onlylater",1); | 204 | ONLY_LATER = cfg.readNumEntry("onlylater",1); |
148 | |||
149 | } | 205 | } |
150 | 206 | ||
207 | |||
208 | /* | ||
209 | * The method for the configuration dialog. | ||
210 | */ | ||
151 | void Today::startConfig() { | 211 | void Today::startConfig() { |
152 | conf = new todayconfig ( this, "", true ); | ||
153 | |||
154 | |||
155 | //Config cfg = new Config("today"); | ||
156 | 212 | ||
213 | conf = new todayconfig ( this, "", true ); | ||
157 | // read the config | 214 | // read the config |
158 | Config cfg("today"); | 215 | Config cfg("today"); |
159 | cfg.setGroup("BaseConfig"); | 216 | cfg.setGroup("BaseConfig"); |
160 | 217 | ||
161 | //init(); | 218 | //init(); |
162 | 219 | ||
@@ -168,13 +225,13 @@ void Today::startConfig() { | |||
168 | // task lines | 225 | // task lines |
169 | conf->SpinBox2->setValue(MAX_LINES_TASK); | 226 | conf->SpinBox2->setValue(MAX_LINES_TASK); |
170 | // clip when? | 227 | // clip when? |
171 | conf->SpinBox7->setValue(MAX_CHAR_CLIP); | 228 | conf->SpinBox7->setValue(MAX_CHAR_CLIP); |
172 | // only later | 229 | // only later |
173 | conf->CheckBox3->setChecked(ONLY_LATER); | 230 | conf->CheckBox3->setChecked(ONLY_LATER); |
174 | 231 | // if today should be autostarted | |
175 | conf->CheckBoxAuto->setChecked(AUTOSTART); | 232 | conf->CheckBoxAuto->setChecked(AUTOSTART); |
176 | 233 | ||
177 | conf->exec(); | 234 | conf->exec(); |
178 | 235 | ||
179 | int maxlinestask = conf->SpinBox2->value(); | 236 | int maxlinestask = conf->SpinBox2->value(); |
180 | int maxmeet = conf->SpinBox1->value(); | 237 | int maxmeet = conf->SpinBox1->value(); |
@@ -189,12 +246,13 @@ void Today::startConfig() { | |||
189 | cfg.writeEntry("maxlinesmeet",maxmeet); | 246 | cfg.writeEntry("maxlinesmeet",maxmeet); |
190 | cfg.writeEntry("showlocation",location); | 247 | cfg.writeEntry("showlocation",location); |
191 | cfg.writeEntry("shownotes", notes); | 248 | cfg.writeEntry("shownotes", notes); |
192 | cfg.writeEntry("onlylater", onlylater); | 249 | cfg.writeEntry("onlylater", onlylater); |
193 | cfg.setGroup("Autostart"); | 250 | cfg.setGroup("Autostart"); |
194 | cfg.writeEntry("autostart", autostart); | 251 | cfg.writeEntry("autostart", autostart); |
252 | |||
195 | // sync it to "disk" | 253 | // sync it to "disk" |
196 | cfg.write(); | 254 | cfg.write(); |
197 | NEW_START=1; | 255 | NEW_START=1; |
198 | draw(); | 256 | draw(); |
199 | autoStart(); | 257 | autoStart(); |
200 | } | 258 | } |
@@ -219,30 +277,30 @@ void Today::getDates() { | |||
219 | // if 24 h format | 277 | // if 24 h format |
220 | //bool ampm = config.readBoolEntry( "AMPM", TRUE ); | 278 | //bool ampm = config.readBoolEntry( "AMPM", TRUE ); |
221 | 279 | ||
222 | int count=0; | 280 | int count=0; |
223 | 281 | ||
224 | if ( list.count() > 0 ) { | 282 | if ( list.count() > 0 ) { |
225 | 283 | ||
226 | for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); | 284 | for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); |
227 | it!=list.end(); ++it ) { | 285 | it!=list.end(); ++it ) { |
228 | 286 | ||
229 | 287 | ||
230 | if ( count <= MAX_LINES_MEET ) { | 288 | if ( count <= MAX_LINES_MEET ) { |
231 | 289 | ||
232 | QTime time = QTime::currentTime(); | 290 | QTime time = QTime::currentTime(); |
233 | 291 | ||
234 | if (!ONLY_LATER) { | 292 | if (!ONLY_LATER) { |
235 | count++; | 293 | count++; |
236 | DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents); | 294 | DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents); |
237 | layoutDates->addWidget(l); | 295 | layoutDates->addWidget(l); |
238 | connect (l, SIGNAL(editEvent(const Event &)), | 296 | connect (l, SIGNAL(editEvent(const Event &)), |
239 | this, SLOT(editEvent(const Event &))); | 297 | this, SLOT(editEvent(const Event &))); |
240 | } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { | 298 | } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { |
241 | count++; | 299 | count++; |
242 | 300 | ||
243 | // show only later appointments | 301 | // show only later appointments |
244 | DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents); | 302 | DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents); |
245 | layoutDates->addWidget(l); | 303 | layoutDates->addWidget(l); |
246 | connect (l, SIGNAL(editEvent(const Event &)), | 304 | connect (l, SIGNAL(editEvent(const Event &)), |
247 | this, SLOT(editEvent(const Event &))); | 305 | this, SLOT(editEvent(const Event &))); |
248 | } | 306 | } |
@@ -259,14 +317,12 @@ void Today::getDates() { | |||
259 | layoutDates->addWidget(noEvents); | 317 | layoutDates->addWidget(noEvents); |
260 | } | 318 | } |
261 | 319 | ||
262 | layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); | 320 | layoutDates->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); |
263 | sv1->addChild(AllDateBookEvents); | 321 | sv1->addChild(AllDateBookEvents); |
264 | AllDateBookEvents->show(); | 322 | AllDateBookEvents->show(); |
265 | |||
266 | |||
267 | } | 323 | } |
268 | 324 | ||
269 | /* | 325 | /* |
270 | * Parse in the todolist.xml | 326 | * Parse in the todolist.xml |
271 | */ | 327 | */ |
272 | QList<TodoItem> Today::loadTodo(const char *filename) { | 328 | QList<TodoItem> Today::loadTodo(const char *filename) { |
@@ -336,30 +392,28 @@ void Today::getMail() { | |||
336 | cfg.setGroup("today"); | 392 | cfg.setGroup("today"); |
337 | 393 | ||
338 | // how many lines should be showed in the task section | 394 | // how many lines should be showed in the task section |
339 | int NEW_MAILS = cfg.readNumEntry("newmails",0); | 395 | int NEW_MAILS = cfg.readNumEntry("newmails",0); |
340 | int OUTGOING = cfg.readNumEntry("outgoing",0); | 396 | int OUTGOING = cfg.readNumEntry("outgoing",0); |
341 | 397 | ||
342 | |||
343 | QString output = tr("<b>%1</b> new mail(s), <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING); | 398 | QString output = tr("<b>%1</b> new mail(s), <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING); |
344 | 399 | ||
345 | |||
346 | MailField->setText(output); | 400 | MailField->setText(output); |
347 | } | 401 | } |
348 | 402 | ||
349 | 403 | ||
350 | /* | 404 | /* |
351 | * Get the todos | 405 | * Get the todos |
352 | * | ||
353 | */ | 406 | */ |
354 | void Today::getTodo() { | 407 | void Today::getTodo() { |
355 | 408 | ||
356 | // if the todolist.xml file was not modified in between, do not parse it. | 409 | // if the todolist.xml file was not modified in between, do not parse it. |
357 | if (!checkIfModified() && !NEW_START) { | 410 | if (!checkIfModified() && !NEW_START) { |
358 | return; | 411 | return; |
359 | } | 412 | } |
413 | // since it was the new start or the return from config dialog, set it to 0 again. | ||
360 | NEW_START=0; | 414 | NEW_START=0; |
361 | 415 | ||
362 | QString output; | 416 | QString output; |
363 | QString tmpout; | 417 | QString tmpout; |
364 | int count = 0; | 418 | int count = 0; |
365 | 419 | ||
@@ -399,12 +453,16 @@ void Today::getTodo() { | |||
399 | * launches datebook | 453 | * launches datebook |
400 | */ | 454 | */ |
401 | void Today::startDatebook() { | 455 | void Today::startDatebook() { |
402 | QCopEnvelope e("QPE/System", "execute(QString)"); | 456 | QCopEnvelope e("QPE/System", "execute(QString)"); |
403 | e << QString("datebook"); | 457 | e << QString("datebook"); |
404 | } | 458 | } |
459 | |||
460 | /* | ||
461 | * starts the edit dialog as known from datebook | ||
462 | */ | ||
405 | void Today::editEvent(const Event &e) { | 463 | void Today::editEvent(const Event &e) { |
406 | startDatebook(); | 464 | startDatebook(); |
407 | 465 | ||
408 | //Dissabled for now as uid's not working properly | 466 | //Dissabled for now as uid's not working properly |
409 | /* | 467 | /* |
410 | while(!QCopChannel::isRegistered("QPE/Datebook")) sleep(1); | 468 | while(!QCopChannel::isRegistered("QPE/Datebook")) sleep(1); |
@@ -426,20 +484,21 @@ void Today::startTodo() { | |||
426 | */ | 484 | */ |
427 | void Today::startMail() { | 485 | void Today::startMail() { |
428 | QCopEnvelope e("QPE/System", "execute(QString)"); | 486 | QCopEnvelope e("QPE/System", "execute(QString)"); |
429 | e << QString("opiemail"); | 487 | e << QString("opiemail"); |
430 | } | 488 | } |
431 | 489 | ||
432 | /* | 490 | |
433 | * Destroys the object and frees any allocated resources | ||
434 | */ | ||
435 | Today::~Today() { | 491 | Today::~Today() { |
436 | // no need to delete child widgets, Qt does it all for us | ||
437 | } | 492 | } |
438 | 493 | ||
439 | 494 | ||
495 | |||
496 | /* | ||
497 | * Gets the events for the current day, if it should get all dates | ||
498 | */ | ||
440 | DateBookEvent::DateBookEvent(const EffectiveEvent &ev, | 499 | DateBookEvent::DateBookEvent(const EffectiveEvent &ev, |
441 | QWidget* parent = 0, | 500 | QWidget* parent = 0, |
442 | const char* name = 0, | 501 | const char* name = 0, |
443 | WFlags fl = 0) : | 502 | WFlags fl = 0) : |
444 | ClickableLabel(parent,name,fl), event(ev) { | 503 | ClickableLabel(parent,name,fl), event(ev) { |
445 | 504 | ||
@@ -462,12 +521,13 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, | |||
462 | } else { | 521 | } else { |
463 | // start time of event | 522 | // start time of event |
464 | msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) ) | 523 | msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) ) |
465 | // end time of event | 524 | // end time of event |
466 | + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) ); | 525 | + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) ); |
467 | } | 526 | } |
527 | |||
468 | // include possible note or not | 528 | // include possible note or not |
469 | if (SHOW_NOTES == 1) { | 529 | if (SHOW_NOTES == 1) { |
470 | msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; | 530 | msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; |
471 | } | 531 | } |
472 | } | 532 | } |
473 | setText(msg); | 533 | setText(msg); |
@@ -516,12 +576,13 @@ DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, | |||
516 | // } | 576 | // } |
517 | setText(msg); | 577 | setText(msg); |
518 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); | 578 | connect(this, SIGNAL(clicked()), this, SLOT(editMe())); |
519 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); | 579 | setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); |
520 | } | 580 | } |
521 | 581 | ||
582 | |||
522 | void DateBookEvent::editMe() { | 583 | void DateBookEvent::editMe() { |
523 | emit editEvent(event.event()); | 584 | emit editEvent(event.event()); |
524 | } | 585 | } |
525 | 586 | ||
526 | void DateBookEventLater::editMe() { | 587 | void DateBookEventLater::editMe() { |
527 | emit editEvent(event.event()); | 588 | emit editEvent(event.event()); |
diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 0b4356c..6dec2c2 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h | |||
@@ -52,13 +52,18 @@ class Today : public TodayBase { | |||
52 | void init(); | 52 | void init(); |
53 | void getDates(); | 53 | void getDates(); |
54 | void getTodo(); | 54 | void getTodo(); |
55 | void getMail(); | 55 | void getMail(); |
56 | void autoStart(); | 56 | void autoStart(); |
57 | bool checkIfModified(); | 57 | bool checkIfModified(); |
58 | void setOwnerField(); | ||
59 | void setOwnerField(QString &string); | ||
58 | QList<TodoItem> loadTodo(const char *filename); | 60 | QList<TodoItem> loadTodo(const char *filename); |
61 | private slots: | ||
62 | void channelReceived(const QCString &msg, const QByteArray & data); | ||
63 | |||
59 | private: | 64 | private: |
60 | DateBookDB *db; | 65 | DateBookDB *db; |
61 | todayconfig *conf; | 66 | todayconfig *conf; |
62 | QWidget* AllDateBookEvents; | 67 | QWidget* AllDateBookEvents; |
63 | //Config cfg; | 68 | //Config cfg; |
64 | int MAX_LINES_TASK; | 69 | int MAX_LINES_TASK; |
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index 552e2eb..c0b8d34 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp | |||
@@ -82,24 +82,27 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
82 | TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); | 82 | TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); |
83 | QFont TextLabel1_font( TextLabel1->font() ); | 83 | QFont TextLabel1_font( TextLabel1->font() ); |
84 | TextLabel1_font.setBold( TRUE ); | 84 | TextLabel1_font.setBold( TRUE ); |
85 | TextLabel1->setFont( TextLabel1_font ); | 85 | TextLabel1->setFont( TextLabel1_font ); |
86 | TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); | 86 | TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); |
87 | TextLabel1->setTextFormat( RichText ); | 87 | TextLabel1->setTextFormat( RichText ); |
88 | 88 | ||
89 | 89 | OwnerField = new QLabel(this , "Owner" ); | |
90 | OwnerField->setGeometry(QRect(0,0, this->width(), 12 )); | ||
91 | OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
92 | OwnerField->setMaximumHeight(12); | ||
93 | |||
90 | // --- dates section --- | 94 | // --- dates section --- |
91 | Frame4 = new QFrame( this, "Frame4" ); | 95 | Frame4 = new QFrame( this, "Frame4" ); |
92 | Frame4->setPalette( pal ); | 96 | Frame4->setPalette( pal ); |
93 | Frame4->setFrameShape( QScrollView::StyledPanel ); | 97 | Frame4->setFrameShape( QScrollView::StyledPanel ); |
94 | Frame4->setFrameShadow( QScrollView::Sunken ); | 98 | Frame4->setFrameShadow( QScrollView::Sunken ); |
95 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); | 99 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); |
96 | Frame4->setFrameStyle( QFrame::NoFrame ); | 100 | Frame4->setFrameStyle( QFrame::NoFrame ); |
97 | Frame4->setGeometry (QRect( 0, 0, this->width() , this->height()) ); | 101 | Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) ); |
98 | 102 | ||
99 | // QScrollView* sv1 = new QScrollView( Frame4 ); | ||
100 | sv1 = new QScrollView( Frame4 ); | 103 | sv1 = new QScrollView( Frame4 ); |
101 | sv1->setResizePolicy(QScrollView::AutoOneFit); | 104 | sv1->setResizePolicy(QScrollView::AutoOneFit); |
102 | sv1->setHScrollBarMode( QScrollView::AlwaysOff ); | 105 | sv1->setHScrollBarMode( QScrollView::AlwaysOff ); |
103 | // need to find a better way!!! | 106 | // need to find a better way!!! |
104 | sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) ); | 107 | sv1->setGeometry (QRect( 40, 2, Frame4->width()-40 , (Frame4->height()/3)+20 ) ); |
105 | sv1->setFrameShape(QFrame::NoFrame); | 108 | sv1->setFrameShape(QFrame::NoFrame); |
@@ -107,22 +110,14 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
107 | DatesButton = new QPushButton (Frame4, "DatesButton" ); | 110 | DatesButton = new QPushButton (Frame4, "DatesButton" ); |
108 | DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); | 111 | DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); |
109 | DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); | 112 | DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); |
110 | DatesButton->setPalette( pal ); | 113 | DatesButton->setPalette( pal ); |
111 | DatesButton->setPixmap( datebook ); | 114 | DatesButton->setPixmap( datebook ); |
112 | DatesButton->setFlat( TRUE ); | 115 | DatesButton->setFlat( TRUE ); |
113 | 116 | ||
114 | //DatesField = new QLabel( sv1->viewport(), "DatesField" ); | 117 | // --- mail section ---) |
115 | //DatesField = new QVBox(sv1->viewport()); | ||
116 | //QWidget *dummy = new QWidget(sv1->viewport()); | ||
117 | //sv1->addChild(DatesField); | ||
118 | //DatesField->setText( tr( "No appointments today" ) ); | ||
119 | // DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
120 | |||
121 | |||
122 | // --- mail section ---) | ||
123 | MailFrame = new QFrame( this ,"MailFrame" ); | 118 | MailFrame = new QFrame( this ,"MailFrame" ); |
124 | MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); | 119 | MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); |
125 | MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) ); | 120 | MailFrame->setGeometry (QRect( 0, 0, this->width() , 15) ); |
126 | MailFrame->setFrameStyle( QFrame::NoFrame ); | 121 | MailFrame->setFrameStyle( QFrame::NoFrame ); |
127 | 122 | ||
128 | QFrame* Line1 = new QFrame( MailFrame); | 123 | QFrame* Line1 = new QFrame( MailFrame); |
@@ -139,13 +134,12 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
139 | MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) ); | 134 | MailField->setGeometry( QRect( 40, 4, MailFrame->width(), 12) ); |
140 | MailField->setText( tr( "Opiemail not installed" ) ); | 135 | MailField->setText( tr( "Opiemail not installed" ) ); |
141 | MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | 136 | MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); |
142 | MailField->setMaximumHeight(40); | 137 | MailField->setMaximumHeight(40); |
143 | MailField->setMinimumHeight(15); | 138 | MailField->setMinimumHeight(15); |
144 | 139 | ||
145 | |||
146 | // --- todo section -- | 140 | // --- todo section -- |
147 | Frame15 = new QFrame( this, "Frame15" ); | 141 | Frame15 = new QFrame( this, "Frame15" ); |
148 | Frame15->setFrameStyle( QFrame::NoFrame ); | 142 | Frame15->setFrameStyle( QFrame::NoFrame ); |
149 | Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) ); | 143 | Frame15->setGeometry (QRect( 40, 3, this->width() , this->height()) ); |
150 | 144 | ||
151 | QFrame* Line2 = new QFrame( Frame15); | 145 | QFrame* Line2 = new QFrame( Frame15); |
@@ -176,12 +170,13 @@ TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | |||
176 | PushButton1->setPalette( pal ); | 170 | PushButton1->setPalette( pal ); |
177 | PushButton1->setAutoDefault( TRUE ); | 171 | PushButton1->setAutoDefault( TRUE ); |
178 | PushButton1->setFlat( TRUE ); | 172 | PushButton1->setFlat( TRUE ); |
179 | 173 | ||
180 | // -- layout -- | 174 | // -- layout -- |
181 | layout->addWidget(Frame); | 175 | layout->addWidget(Frame); |
176 | layout->addWidget(OwnerField); | ||
182 | layout->addWidget(Frame4); | 177 | layout->addWidget(Frame4); |
183 | layout->addWidget(MailFrame); | 178 | layout->addWidget(MailFrame); |
184 | layout->addWidget(Frame15); | 179 | layout->addWidget(Frame15); |
185 | 180 | ||
186 | layout->setStretchFactor(Frame4,5); | 181 | layout->setStretchFactor(Frame4,5); |
187 | layout->setStretchFactor(MailFrame,1); | 182 | layout->setStretchFactor(MailFrame,1); |
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h index 8840125..0118faa 100644 --- a/core/pim/today/todaybase.h +++ b/core/pim/today/todaybase.h | |||
@@ -29,13 +29,13 @@ public: | |||
29 | TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 29 | TodayBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
30 | ~TodayBase(); | 30 | ~TodayBase(); |
31 | 31 | ||
32 | //QScrollView* Frame4; | 32 | //QScrollView* Frame4; |
33 | QFrame* Frame4; | 33 | QFrame* Frame4; |
34 | QPushButton* DatesButton; | 34 | QPushButton* DatesButton; |
35 | //QLabel* DatesField; | 35 | QLabel* OwnerField; |
36 | QLabel* Frame; | 36 | QLabel* Frame; |
37 | QFrame* MailFrame; | 37 | QFrame* MailFrame; |
38 | QLabel* TextLabel1; | 38 | QLabel* TextLabel1; |
39 | QScrollView* sv1; | 39 | QScrollView* sv1; |
40 | QVBox* DatesField; | 40 | QVBox* DatesField; |
41 | QFrame* Frame15; | 41 | QFrame* Frame15; |