summaryrefslogtreecommitdiff
authorwaspe <waspe>2003-11-03 18:28:50 (UTC)
committer waspe <waspe>2003-11-03 18:28:50 (UTC)
commit87a9d6badcf518ffd14559ef886ff7729b63b73b (patch) (unidiff)
tree05af57bcebb8a124c2561336e4ff3dfdd52aeccb
parent9ce566fd5b280622670cf7b0e158f9d9c54e6e9a (diff)
downloadopie-87a9d6badcf518ffd14559ef886ff7729b63b73b.zip
opie-87a9d6badcf518ffd14559ef886ff7729b63b73b.tar.gz
opie-87a9d6badcf518ffd14559ef886ff7729b63b73b.tar.bz2
resolved merge conflict
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp24
-rw-r--r--core/pim/datebook/datebookweekheaderimpl.cpp11
-rw-r--r--core/pim/datebook/datebookweeklst.cpp43
-rw-r--r--core/pim/datebook/datebookweeklst.h1
-rw-r--r--core/pim/osearch/datebooksearch.cpp2
-rw-r--r--core/pim/osearch/mainwindow.cpp10
-rw-r--r--core/pim/osearch/mainwindow.h14
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginconfig.cpp10
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.cpp12
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginconfig.h12
-rw-r--r--core/pim/today/plugins/todolist/todopluginconfig.h9
-rw-r--r--core/settings/security/security.cpp27
-rw-r--r--noncore/apps/confedit/main.cpp15
-rw-r--r--noncore/games/tictac/main.cpp24
14 files changed, 118 insertions, 96 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 10a9b59..07d7164 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -179,32 +179,34 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
179 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), this, SLOT(appMessage(const QCString&, const QByteArray&)) ); 179 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), this, SLOT(appMessage(const QCString&, const QByteArray&)) );
180#endif 180#endif
181 181
182 // listen on QPE/System 182 // listen on QPE/System
183#if defined(Q_WS_QWS) 183#if defined(Q_WS_QWS)
184#if !defined(QT_NO_COP) 184#if !defined(QT_NO_COP)
185 QCopChannel *channel = new QCopChannel( "QPE/System", this ); 185 QCopChannel *channel = new QCopChannel( "QPE/System", this );
186 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), this, SLOT(receive(const QCString&, const QByteArray&)) ); 186 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), this, SLOT(receive(const QCString&, const QByteArray&)) );
187 channel = new QCopChannel( "QPE/Datebook", this ); 187 channel = new QCopChannel( "QPE/Datebook", this );
188 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), this, SLOT(receive(const QCString&, const QByteArray&)) ); 188 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), this, SLOT(receive(const QCString&, const QByteArray&)) );
189 qDebug("olle\n"); 189 qDebug("olle\n");
190#endif 190#endif
191#endif 191#endif
192 192
193 qDebug("done t=%d", t.elapsed() ); 193 qDebug("done t=%d", t.elapsed() );
194 194
195 connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
196 connect( qApp, SIGNAL( reload()), this, SLOT( reload() ) );
195 /* 197 /*
196 * Here is a problem description: 198 * Here is a problem description:
197 * When Weekview is the default view 199 * When Weekview is the default view
198 * a DateBookWeekView get's created 200 * a DateBookWeekView get's created
199 * redraw() get's called. So what? 201 * redraw() get's called. So what?
200 * Remember that we're still in the c'tor 202 * Remember that we're still in the c'tor
201 * and no final layout has happened? Ok 203 * and no final layout has happened? Ok
202 * now all Events get arranged. Their x 204 * now all Events get arranged. Their x
203 * position get's determined by a QHeader 205 * position get's determined by a QHeader
204 * position. But the QHeader isn't layouted or 206 * position. But the QHeader isn't layouted or
205 * at the right position. redraw() is a slot 207 * at the right position. redraw() is a slot
206 * so we'll call it then via a singleShot 208 * so we'll call it then via a singleShot
207 * from view() 209 * from view()
208 */ 210 */
209 if( needEvilHack ){ 211 if( needEvilHack ){
210 QTimer::singleShot( 500, this, SLOT(viewWeek()) ); 212 QTimer::singleShot( 500, this, SLOT(viewWeek()) );
@@ -389,32 +391,34 @@ void DateBook::viewDay() {
389 391
390void DateBook::viewWeek() { 392void DateBook::viewWeek() {
391 view(WEEK,currentDate()); 393 view(WEEK,currentDate());
392} 394}
393 395
394void DateBook::viewWeekLst() { 396void DateBook::viewWeekLst() {
395 view(WEEKLST,currentDate()); 397 view(WEEKLST,currentDate());
396} 398}
397 399
398void DateBook::viewMonth() { 400void DateBook::viewMonth() {
399 view(MONTH,currentDate()); 401 view(MONTH,currentDate());
400} 402}
401 403
402void DateBook::insertEvent( const Event &e ) 404void DateBook::insertEvent( const Event &e )
403{ 405{
404 Event dupEvent=e; 406 Event dupEvent=e;
407 if(!dupEvent.isValidUid() ) // tkcRom seems to be different
408 dupEvent.assignUid();
405 dupEvent.setLocation(defaultLocation); 409 dupEvent.setLocation(defaultLocation);
406 dupEvent.setCategories(defaultCategories); 410 dupEvent.setCategories(defaultCategories);
407 db->addEvent(dupEvent); 411 db->addEvent(dupEvent);
408 emit newEvent(); 412 emit newEvent();
409} 413}
410 414
411void DateBook::duplicateEvent( const Event &e ) 415void DateBook::duplicateEvent( const Event &e )
412{ 416{
413 qWarning("Hmmm..."); 417 qWarning("Hmmm...");
414 // Alot of code duplication, as this is almost like editEvent(); 418 // Alot of code duplication, as this is almost like editEvent();
415 if (syncing) { 419 if (syncing) {
416 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") ); 420 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
417 return; 421 return;
418 } 422 }
419 423
420 Event dupevent(e);// Make a duplicate. 424 Event dupevent(e);// Make a duplicate.
@@ -430,41 +434,43 @@ void DateBook::duplicateEvent( const Event &e )
430 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 434 sv->setHScrollBarMode( QScrollView::AlwaysOff );
431 vb->addWidget( sv ); 435 vb->addWidget( sv );
432 entry = new DateEntry( onMonday, dupevent, ampm, &editDlg, "editor" ); 436 entry = new DateEntry( onMonday, dupevent, ampm, &editDlg, "editor" );
433 entry->timezone->setEnabled( FALSE ); 437 entry->timezone->setEnabled( FALSE );
434 sv->addChild( entry ); 438 sv->addChild( entry );
435 439
436#if defined(Q_WS_QWS) || defined(_WS_QWS_) 440#if defined(Q_WS_QWS) || defined(_WS_QWS_)
437 editDlg.showMaximized(); 441 editDlg.showMaximized();
438#endif 442#endif
439 while (editDlg.exec() ) { 443 while (editDlg.exec() ) {
440 Event newEv = entry->event(); 444 Event newEv = entry->event();
441 QString error = checkEvent(newEv); 445 QString error = checkEvent(newEv);
442 if (!error.isNull()) { 446 if (!error.isNull()) {
443 if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) 447 if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0)
444 continue; 448 continue;
445 } 449 }
446 /* 450 /*
447 * The problem: 451 * The problem:
448 * DateBookDB does remove repeating events not by uid but by the time 452 * DateBookDB does remove repeating events not by uid but by the time
449 * the recurrence was created 453 * the recurrence was created
450 * so we need to update that time as well 454 * so we need to update that time as well
451 */ 455 */
452 Event::RepeatPattern rp = newEv.repeatPattern(); 456 Event::RepeatPattern rp = newEv.repeatPattern();
453 rp.createTime = ::time( NULL ); 457 rp.createTime = ::time( NULL );
454 newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern... 458 newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern...
459 if( newEv.uid() == e.uid() || !newEv.isValidUid() )
460 newEv.assignUid();
455 461
456 db->addEvent(newEv); 462 db->addEvent(newEv);
457 emit newEvent(); 463 emit newEvent();
458 break; 464 break;
459 } 465 }
460} 466}
461 467
462void DateBook::editEvent( const Event &e ) 468void DateBook::editEvent( const Event &e )
463{ 469{
464 if (syncing) { 470 if (syncing) {
465 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") ); 471 QMessageBox::warning( this, tr("Calendar"), tr( "Can not edit data, currently syncing") );
466 return; 472 return;
467 } 473 }
468 474
469 // workaround added for text input. 475 // workaround added for text input.
470 QDialog editDlg( this, 0, TRUE ); 476 QDialog editDlg( this, 0, TRUE );
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp
index 770410e..84b4f1b 100644
--- a/core/pim/datebook/datebookweekheaderimpl.cpp
+++ b/core/pim/datebook/datebookweekheaderimpl.cpp
@@ -85,39 +85,40 @@ void DateBookWeekHeader::nextWeek()
85} 85}
86void DateBookWeekHeader::prevWeek() 86void DateBookWeekHeader::prevWeek()
87{ 87{
88 qWarning("prevWeek() "); 88 qWarning("prevWeek() ");
89 setDate(date.addDays(-7)); 89 setDate(date.addDays(-7));
90} 90}
91 91
92void DateBookWeekHeader::setDate( int y, int m, int d ) 92void DateBookWeekHeader::setDate( int y, int m, int d )
93{ 93{
94 setDate(QDate(y,m,d)); 94 setDate(QDate(y,m,d));
95} 95}
96 96
97void DateBookWeekHeader::setDate(const QDate &d) { 97void DateBookWeekHeader::setDate(const QDate &d) {
98 int year,week,dayofweek; 98 int year,week,dayofweek;
99 date=d; 99 date=d;
100 dayofweek=d.dayOfWeek(); 100 dayofweek=d.dayOfWeek();
101 if(bStartOnMonday) 101 if(bStartOnMonday)
102 dayofweek--; 102 dayofweek--;
103 else if( dayofweek == 7 ) 103 else if( dayofweek == 7 )
104 /* we already have the right day -7 would lead to the current week..*/ 104 // we already have the right day -7 would lead to the current week..
105 dayofweek = 0; 105 dayofweek = 0;
106 106
107 date=date.addDays(-dayofweek); 107 date=date.addDays(-dayofweek);
108 calcWeek(date,week,year,bStartOnMonday); 108 calcWeek(date,week,year,bStartOnMonday);
109 QDate start=date; 109 QDate start=date;
110 QDate stop=start.addDays(6); 110 QDate stop=start.addDays(6);
111 labelDate->setText( QString::number(start.day()) + "." + 111 labelDate->setText( QString::number(start.day()) + "." +
112 start.monthName(start.month()) + "-" + 112 Calendar::nameOfMonth( start.month()) + "-" +
113 QString::number(stop.day()) + "." + 113 QString::number(stop.day()) + "." +
114 start.monthName(stop.month()) +" ("+ 114 Calendar::nameOfMonth( stop.month()) +" ("+
115 tr("w")+":"+QString::number( week ) +")"); 115 tr("w")+":"+QString::number( week ) +")");
116 date = d; // bugfix: 0001126 - date has to be the selected date, not monday!
116 emit dateChanged(date); 117 emit dateChanged(date);
117} 118}
118 119
119void DateBookWeekHeader::setStartOfWeek( bool onMonday ) 120void DateBookWeekHeader::setStartOfWeek( bool onMonday )
120{ 121{
121 bStartOnMonday = onMonday; 122 bStartOnMonday = onMonday;
122 setDate( date ); 123 setDate( date );
123} 124}
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp
index aad1f3a..24fb0ba 100644
--- a/core/pim/datebook/datebookweeklst.cpp
+++ b/core/pim/datebook/datebookweeklst.cpp
@@ -1,43 +1,28 @@
1#include "datebookweeklst.h" 1#include "datebookweeklst.h"
2 2
3#include "datebookweekheaderimpl.h"
4 3
5#include "datebook.h" 4#include "datebook.h"
6 5
7#include <qpe/calendar.h>
8#include <qpe/datebookdb.h>
9#include <qpe/event.h>
10#include <qpe/qpeapplication.h>
11#include <qpe/timestring.h>
12#include <qpe/datebookmonth.h> 6#include <qpe/datebookmonth.h>
13#include <qpe/config.h> 7#include <qpe/config.h>
14#include <qpe/resource.h> 8#include <qpe/resource.h>
9#include <qpe/calendar.h>
15 10
16#include <qdatetime.h>
17#include <qheader.h>
18#include <qlabel.h>
19#include <qlayout.h> 11#include <qlayout.h>
20#include <qpainter.h>
21#include <qpopupmenu.h>
22#include <qtimer.h>
23#include <qstyle.h>
24#include <qtoolbutton.h> 12#include <qtoolbutton.h>
25#include <qvbox.h>
26#include <qsizepolicy.h>
27#include <qabstractlayout.h>
28#include <qtl.h> 13#include <qtl.h>
29 14
30bool calcWeek(const QDate &d, int &week, int &year,bool startOnMonday = false); 15bool calcWeek(const QDate &d, int &week, int &year,bool startOnMonday = false);
31 16
32DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl) 17DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl)
33 : DateBookWeekLstHeaderBase(parent, name, fl) 18 : DateBookWeekLstHeaderBase(parent, name, fl)
34{ 19{
35 setBackgroundMode( PaletteButton ); 20 setBackgroundMode( PaletteButton );
36 labelDate->setBackgroundMode( PaletteButton ); 21 labelDate->setBackgroundMode( PaletteButton );
37 forwardweek->setBackgroundMode( PaletteButton ); 22 forwardweek->setBackgroundMode( PaletteButton );
38 forwardweek->setPixmap( Resource::loadPixmap("forward") ); 23 forwardweek->setPixmap( Resource::loadPixmap("forward") );
39 forwardmonth->setBackgroundMode( PaletteButton ); 24 forwardmonth->setBackgroundMode( PaletteButton );
40 forwardmonth->setPixmap( Resource::loadPixmap("fastforward") ); 25 forwardmonth->setPixmap( Resource::loadPixmap("fastforward") );
41 backweek->setBackgroundMode( PaletteButton ); 26 backweek->setBackgroundMode( PaletteButton );
42 backweek->setPixmap( Resource::loadPixmap("back") ); 27 backweek->setPixmap( Resource::loadPixmap("back") );
43 backmonth->setBackgroundMode( PaletteButton ); 28 backmonth->setBackgroundMode( PaletteButton );
@@ -60,36 +45,37 @@ DateBookWeekLstHeader::~DateBookWeekLstHeader(){}
60void DateBookWeekLstHeader::setDate(const QDate &d) { 45void DateBookWeekLstHeader::setDate(const QDate &d) {
61 int year,week,dayofweek; 46 int year,week,dayofweek;
62 date=d; 47 date=d;
63 dayofweek=d.dayOfWeek(); 48 dayofweek=d.dayOfWeek();
64 if(bStartOnMonday) 49 if(bStartOnMonday)
65 dayofweek--; 50 dayofweek--;
66 else if( dayofweek == 7 ) 51 else if( dayofweek == 7 )
67 /* we already have the right day -7 would lead to the same week */ 52 /* we already have the right day -7 would lead to the same week */
68 dayofweek = 0; 53 dayofweek = 0;
69 54
70 date=date.addDays(-dayofweek); 55 date=date.addDays(-dayofweek);
71 56
72 calcWeek(date,week,year,bStartOnMonday); 57 calcWeek(date,week,year,bStartOnMonday);
73 QDate start=date; 58 QDate start=date;
74 QDate stop=start.addDays(6); 59 QDate stop=start.addDays(6);
75 labelDate->setText( QString::number(start.day()) + "." + 60 labelDate->setText( QString::number(start.day()) + "." +
76 start.monthName(start.month()) + "-" + 61 Calendar::nameOfMonth( start.month() ) + "-" +
77 QString::number(stop.day()) + "." + 62 QString::number(stop.day()) + "." +
78 start.monthName(stop.month()) +" ("+ 63 Calendar::nameOfMonth( stop.month()) +" ("+
79 tr("w")+":"+QString::number( week ) +")"); 64 tr("w")+":"+QString::number( week ) +")");
65 date = d; // bugfix: 0001126 - date has to be the selected date, not monday!
80 emit dateChanged(date); 66 emit dateChanged(date);
81} 67}
82 68
83void DateBookWeekLstHeader::pickDate() { 69void DateBookWeekLstHeader::pickDate() {
84 static QPopupMenu *m1 = 0; 70 static QPopupMenu *m1 = 0;
85 static DateBookMonth *picker = 0; 71 static DateBookMonth *picker = 0;
86 if ( !m1 ) { 72 if ( !m1 ) {
87 m1 = new QPopupMenu( this ); 73 m1 = new QPopupMenu( this );
88 picker = new DateBookMonth( m1, 0, TRUE ); 74 picker = new DateBookMonth( m1, 0, TRUE );
89 m1->insertItem( picker ); 75 m1->insertItem( picker );
90 connect( picker, SIGNAL( dateClicked( int, int, int ) ),this, SLOT( setDate( int, int, int ) ) ); 76 connect( picker, SIGNAL( dateClicked( int, int, int ) ),this, SLOT( setDate( int, int, int ) ) );
91 //connect( m1, SIGNAL( aboutToHide() ), 77 //connect( m1, SIGNAL( aboutToHide() ),
92 //this, SLOT( gotHide() ) ); 78 //this, SLOT( gotHide() ) );
93 } 79 }
94 picker->setDate( date.year(), date.month(), date.day() ); 80 picker->setDate( date.year(), date.month(), date.day() );
95 m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height()))); 81 m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height())));
@@ -112,34 +98,36 @@ void DateBookWeekLstHeader::nextMonth()
112void DateBookWeekLstHeader::prevMonth() 98void DateBookWeekLstHeader::prevMonth()
113{ 99{
114 setDate(date.addDays(-28)); 100 setDate(date.addDays(-28));
115} 101}
116 102
117DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool /* onM */, 103DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool /* onM */,
118 QWidget* parent, 104 QWidget* parent,
119 const char* name, 105 const char* name,
120 WFlags fl ) 106 WFlags fl )
121 : DateBookWeekLstDayHdrBase(parent, name, fl) { 107 : DateBookWeekLstDayHdrBase(parent, name, fl) {
122 108
123 date=d; 109 date=d;
124 110
125 static const QString wdays=tr("MTWTFSSM", "Week days"); 111 static const QString wdays=tr("MTWTFSSM", "Week days");
126 char day=wdays[d.dayOfWeek()-1]; 112 char day=wdays[d.dayOfWeek()-1];
127 113
114 //dont use dayOfWeek() to save space !
128 label->setText( QString(QObject::tr(QString(QChar(day)))) + " " +QString::number(d.day()) ); 115 label->setText( QString(QObject::tr(QString(QChar(day)))) + " " +QString::number(d.day()) );
129 add->setText("+"); 116
117 add->setText("+");
130 118
131 if (d == QDate::currentDate()) { 119 if (d == QDate::currentDate()) {
132 QPalette pal=label->palette(); 120 QPalette pal=label->palette();
133 pal.setColor(QColorGroup::Foreground, QColor(0,0,255)); 121 pal.setColor(QColorGroup::Foreground, QColor(0,0,255));
134 label->setPalette(pal); 122 label->setPalette(pal);
135 123
136 /* 124 /*
137 QFont f=label->font(); 125 QFont f=label->font();
138 f.setItalic(true); 126 f.setItalic(true);
139 label->setFont(f); 127 label->setFont(f);
140 label->setPalette(QPalette(QColor(0,0,255),label->backgroundColor())); 128 label->setPalette(QPalette(QColor(0,0,255),label->backgroundColor()));
141 */ 129 */
142 } else if (d.dayOfWeek() == 7) { // FIXME: Match any holiday 130 } else if (d.dayOfWeek() == 7) { // FIXME: Match any holiday
143 QPalette pal=label->palette(); 131 QPalette pal=label->palette();
144 pal.setColor(QColorGroup::Foreground, QColor(255,0,0)); 132 pal.setColor(QColorGroup::Foreground, QColor(255,0,0));
145 label->setPalette(pal); 133 label->setPalette(pal);
@@ -328,34 +316,49 @@ DateBookWeekLst::~DateBookWeekLst(){
328 316
329void DateBookWeekLst::setDate(const QDate &d) { 317void DateBookWeekLst::setDate(const QDate &d) {
330 bdate=d; 318 bdate=d;
331 header->setDate(d); 319 header->setDate(d);
332} 320}
333 321
334void DateBookWeekLst::setDbl(bool on) { 322void DateBookWeekLst::setDbl(bool on) {
335 dbl=on; 323 dbl=on;
336 redraw(); 324 redraw();
337} 325}
338void DateBookWeekLst::redraw() {getEvents();} 326void DateBookWeekLst::redraw() {getEvents();}
339 327
340QDate DateBookWeekLst::date() { 328QDate DateBookWeekLst::date() {
341 return bdate; 329 return bdate;
342} 330}
343 331
332// return the date at the beginning of the week...
333// copied from DateBookWeek
334QDate DateBookWeekLst::weekDate() const
335{
336 QDate d=bdate;
337
338 // Calculate offset to first day of week.
339 int dayoffset=d.dayOfWeek();
340 if(bStartOnMonday) dayoffset--;
341 else if( dayoffset == 7 )
342 dayoffset = 0;
343
344 return d.addDays(-dayoffset);
345}
346
344void DateBookWeekLst::getEvents() { 347void DateBookWeekLst::getEvents() {
345 QDate start = date(); 348 QDate start = weekDate(); //date();
346 QDate stop = start.addDays(6); 349 QDate stop = start.addDays(6);
347 QValueList<EffectiveEvent> el = db->getEffectiveEvents(start, stop); 350 QValueList<EffectiveEvent> el = db->getEffectiveEvents(start, stop);
348 351
349 if (view) delete view; 352 if (view) delete view;
350 if (dbl) { 353 if (dbl) {
351 QDate start2=start.addDays(7); 354 QDate start2=start.addDays(7);
352 stop=start2.addDays(6); 355 stop=start2.addDays(6);
353 QValueList<EffectiveEvent> el2 = db->getEffectiveEvents(start2, stop); 356 QValueList<EffectiveEvent> el2 = db->getEffectiveEvents(start2, stop);
354 view=new DateBookWeekLstDblView(el,el2,start,bStartOnMonday,scroll); 357 view=new DateBookWeekLstDblView(el,el2,start,bStartOnMonday,scroll);
355 } else { 358 } else {
356 view=new DateBookWeekLstView(el,start,bStartOnMonday,scroll); 359 view=new DateBookWeekLstView(el,start,bStartOnMonday,scroll);
357 } 360 }
358 361
359 connect (view, SIGNAL(editEvent(const Event &)), this, SIGNAL(editEvent(const Event &))); 362 connect (view, SIGNAL(editEvent(const Event &)), this, SIGNAL(editEvent(const Event &)));
360 connect (view, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); 363 connect (view, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int)));
361 connect (view, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)), 364 connect (view, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &, const QString &)),
diff --git a/core/pim/datebook/datebookweeklst.h b/core/pim/datebook/datebookweeklst.h
index 0bfbcda..f683ce7 100644
--- a/core/pim/datebook/datebookweeklst.h
+++ b/core/pim/datebook/datebookweeklst.h
@@ -107,32 +107,33 @@ signals:
107 const QString &str, const QString &location); 107 const QString &str, const QString &location);
108}; 108};
109 109
110class DateBookWeekLst : public QWidget 110class DateBookWeekLst : public QWidget
111{ 111{
112 Q_OBJECT 112 Q_OBJECT
113 113
114public: 114public:
115 DateBookWeekLst( bool ampm, bool onM, DateBookDB *newDB, 115 DateBookWeekLst( bool ampm, bool onM, DateBookDB *newDB,
116 QWidget *parent = 0, 116 QWidget *parent = 0,
117 const char *name = 0 ); 117 const char *name = 0 );
118 ~DateBookWeekLst(); 118 ~DateBookWeekLst();
119 void setDate( int y, int w ); 119 void setDate( int y, int w );
120 void setDate(const QDate &d ); 120 void setDate(const QDate &d );
121 int week() const { return _week; }; 121 int week() const { return _week; };
122 QDate date(); 122 QDate date();
123 QDate weekDate() const;
123 124
124public slots: 125public slots:
125 void redraw(); 126 void redraw();
126 void dateChanged(QDate &date); 127 void dateChanged(QDate &date);
127 128
128protected slots: 129protected slots:
129 void keyPressEvent(QKeyEvent *); 130 void keyPressEvent(QKeyEvent *);
130 void setDbl(bool on); 131 void setDbl(bool on);
131 132
132signals: 133signals:
133 void showDate(int y, int m, int d); 134 void showDate(int y, int m, int d);
134 void addEvent(const QDateTime &start, const QDateTime &stop, 135 void addEvent(const QDateTime &start, const QDateTime &stop,
135 const QString &str, const QString &location); 136 const QString &str, const QString &location);
136 void editEvent(const Event &e); 137 void editEvent(const Event &e);
137 138
138private: 139private:
diff --git a/core/pim/osearch/datebooksearch.cpp b/core/pim/osearch/datebooksearch.cpp
index be2bf25..5da7ae9 100644
--- a/core/pim/osearch/datebooksearch.cpp
+++ b/core/pim/osearch/datebooksearch.cpp
@@ -63,30 +63,30 @@ int DatebookSearch::search()
63 for (uint i = 0; i < results.count(); i++) 63 for (uint i = 0; i < results.count(); i++)
64 insertItem( new OEvent( results[i] ) ); 64 insertItem( new OEvent( results[i] ) );
65 return _resultCount; 65 return _resultCount;
66} 66}
67 67
68void DatebookSearch::insertItem( void *rec ) 68void DatebookSearch::insertItem( void *rec )
69{ 69{
70 OEvent *ev = (OEvent*)rec; 70 OEvent *ev = (OEvent*)rec;
71 if ( !actionShowPastEvents->isOn() && 71 if ( !actionShowPastEvents->isOn() &&
72 ev->endDateTime() < QDateTime::currentDateTime() && 72 ev->endDateTime() < QDateTime::currentDateTime() &&
73 !ev->recurrence().doesRecur() 73 !ev->recurrence().doesRecur()
74 ) return; 74 ) return;
75 if ( !actionSearchInDates->isOn() && ( 75 if ( !actionSearchInDates->isOn() && (
76 ev->lastHitField() == Qtopia::StartDateTime || 76 ev->lastHitField() == Qtopia::StartDateTime ||
77 ev->lastHitField() == Qtopia::EndDateTime ) 77 ev->lastHitField() == Qtopia::EndDateTime )
78 ) return; 78 ) return;
79 (void)new EventItem( this, ev ); 79 new EventItem( this, ev );
80 _resultCount++; 80 _resultCount++;
81} 81}
82 82
83QPopupMenu* DatebookSearch::popupMenu() 83QPopupMenu* DatebookSearch::popupMenu()
84{ 84{
85 if (!_popupMenu){ 85 if (!_popupMenu){
86 _popupMenu = new QPopupMenu( 0 ); 86 _popupMenu = new QPopupMenu( 0 );
87 actionShowPastEvents->addTo( _popupMenu ); 87 actionShowPastEvents->addTo( _popupMenu );
88 actionSearchInDates->addTo( _popupMenu ); 88 actionSearchInDates->addTo( _popupMenu );
89 } 89 }
90 return _popupMenu; 90 return _popupMenu;
91} 91}
92 92
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index aa52061..f768d81 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -69,37 +69,37 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
69 detailsFrame = new QFrame( mainFrame, "detailsFrame" ); 69 detailsFrame = new QFrame( mainFrame, "detailsFrame" );
70 QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame ); 70 QVBoxLayout *detailsLayout = new QVBoxLayout( detailsFrame );
71 richEdit = new QTextView( detailsFrame ); 71 richEdit = new QTextView( detailsFrame );
72 QWhatsThis::add( richEdit, tr("The details of the current result") ); 72 QWhatsThis::add( richEdit, tr("The details of the current result") );
73 richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); 73 richEdit->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
74 detailsLayout->addWidget( richEdit ); 74 detailsLayout->addWidget( richEdit );
75 75
76 buttonBox = new QHBox( mainFrame, "Button Box" ); 76 buttonBox = new QHBox( mainFrame, "Button Box" );
77 77
78 _buttonCount = 0; 78 _buttonCount = 0;
79 79
80 mainLayout->addWidget( detailsFrame ); 80 mainLayout->addWidget( detailsFrame );
81 mainLayout->addWidget( buttonBox ); 81 mainLayout->addWidget( buttonBox );
82 detailsFrame->hide(); 82 detailsFrame->hide();
83 buttonBox->hide(); 83 buttonBox->hide();
84 84
85 searches.append( new AppLnkSearch( resultsList, tr("applications") ) ); 85 searches.append( new AppLnkSearch( resultsList, tr("Applications") ) );
86 searches.append( new DocLnkSearch( resultsList, tr("documents") ) ); 86 searches.append( new DocLnkSearch( resultsList, tr("Documents") ) );
87 searches.append( new TodoSearch( resultsList, tr("todo") ) ); 87 searches.append( new TodoSearch( resultsList, tr("Todo List") ) );
88 searches.append( new DatebookSearch( resultsList, tr("datebook") ) ); 88 searches.append( new DatebookSearch( resultsList, tr("Calendar") ) );
89 searches.append( new AdressSearch( resultsList, tr("adressbook") ) ); 89 searches.append( new AdressSearch( resultsList, tr("Contacts") ) );
90 90
91 setCentralWidget( mainFrame ); 91 setCentralWidget( mainFrame );
92 92
93 popupTimer = new QTimer(); 93 popupTimer = new QTimer();
94 searchTimer = new QTimer(); 94 searchTimer = new QTimer();
95 95
96 connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup())); 96 connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup()));
97 connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged())); 97 connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged()));
98 connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*))); 98 connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*)));
99 connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*))); 99 connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*)));
100 100
101 signalMapper = new QSignalMapper( this ); 101 signalMapper = new QSignalMapper( this );
102 102
103 connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) ); 103 connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) );
104 104
105 makeMenu(); 105 makeMenu();
diff --git a/core/pim/osearch/mainwindow.h b/core/pim/osearch/mainwindow.h
index 1f5c4bb..75054f0 100644
--- a/core/pim/osearch/mainwindow.h
+++ b/core/pim/osearch/mainwindow.h
@@ -1,57 +1,65 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 10// (c) 2002-2003 Patrick S. Vogt <tille@handhelds.org>
11 11
12#ifndef MAINWINDOW_H 12#ifndef MAINWINDOW_H
13#define MAINWINDOW_H 13#define MAINWINDOW_H
14 14
15#include <qmainwindow.h> 15#include <qmainwindow.h>
16#include <qdialog.h>
17#include <qaction.h>
16#include <qlist.h> 18#include <qlist.h>
19
17#include <qmap.h> 20#include <qmap.h>
21#include <qtimer.h>
22#include <qpopupmenu.h>
18 23
19class QAction; 24class QAction;
20class QPEToolBar; 25class QPEToolBar;
21class QHBox; 26class QHBox;
22class QVBoxLayout; 27class QVBoxLayout;
23class QTextView; 28class QTextView;
24class QFrame; 29class QFrame;
25class OListView; 30class OListView;
26class OListViewItem; 31class OListViewItem;
27class QListViewItem; 32class QListViewItem;
28class QPopupMenu; 33class QPopupMenu;
29class QSignalMapper;
30class QTimer; 34class QTimer;
35
36class QSignalMapper;
37class QButton;
38
31class SearchGroup; 39class SearchGroup;
32 40
33class MainWindow : public QMainWindow 41class MainWindow : public QMainWindow
34{ 42{
35 Q_OBJECT 43 Q_OBJECT
36 44
37 45
38public: 46public:
39 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 47 MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
40 ~MainWindow(); 48 ~MainWindow();
41 49 static QString appName() { return QString::fromLatin1("osearch"); }
42 50
43public slots: 51public slots:
44 void setCurrent(QListViewItem*); 52 void setCurrent(QListViewItem*);
45 void setSearch( const QString& ); 53 void setSearch( const QString& );
46 void searchAll(); 54 void searchAll();
47 55
48protected slots: 56protected slots:
49 void slotAction(int); 57 void slotAction(int);
50 void showPopup(); 58 void showPopup();
51 void stopTimer( QListViewItem* ); 59 void stopTimer( QListViewItem* );
52 void searchStringChanged(); 60 void searchStringChanged();
53 void optionChanged(int); 61 void optionChanged(int);
54 62
55private: 63private:
56 QHBox *buttonBox; 64 QHBox *buttonBox;
57 QMap<int, QButton*> buttonMap; 65 QMap<int, QButton*> buttonMap;
diff --git a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
index b79c679..8863192 100644
--- a/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginconfig.cpp
@@ -65,61 +65,67 @@ AddressBookPluginConfig::AddressBookPluginConfig( QWidget *parent, const char*
65 QHBox *box2 = new QHBox( this ); 65 QHBox *box2 = new QHBox( this );
66 QLabel* clipLabel = new QLabel( box2, "" ); 66 QLabel* clipLabel = new QLabel( box2, "" );
67 clipLabel->setText( tr( "Clip line after X chars: " ) ); 67 clipLabel->setText( tr( "Clip line after X chars: " ) );
68 SpinBoxClip = new QSpinBox( box2, "SpinClip" ); 68 SpinBoxClip = new QSpinBox( box2, "SpinClip" );
69 SpinBoxClip->setMaxValue( 200 ); 69 SpinBoxClip->setMaxValue( 200 );
70 QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) ); 70 QWhatsThis::add( SpinBoxClip , tr( "After how many chars should be the info about the task be cut off" ) );
71#endif 71#endif
72 72
73 // Look ahead settings 73 // Look ahead settings
74 QHBox *box3 = new QHBox( this ); 74 QHBox *box3 = new QHBox( this );
75 QLabel* daysLabel = new QLabel( box3, "" ); 75 QLabel* daysLabel = new QLabel( box3, "" );
76 daysLabel->setText( tr( "Days look ahead: " ) ); 76 daysLabel->setText( tr( "Days look ahead: " ) );
77 SpinDaysClip = new QSpinBox( box3, "SpinDays" ); 77 SpinDaysClip = new QSpinBox( box3, "SpinDays" );
78 SpinDaysClip->setMaxValue( 200 ); 78 SpinDaysClip->setMaxValue( 200 );
79 QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) ); 79 QWhatsThis::add( SpinDaysClip , tr( "How many days we should search forward" ) );
80 80
81// QHBox *box4 = new QHBox( this );
82
83// QLabel* colorLabel = new QLabel( box4, "" );
84// colorLabel->setText( tr( "To activate settings: Restart application !" ) );
85
86
81 QHBox *box5 = new QHBox( this ); 87 QHBox *box5 = new QHBox( this );
82 QLabel* colorLabel2 = new QLabel( box5, "" ); 88 QLabel* colorLabel2 = new QLabel( box5, "" );
83 colorLabel2->setText( tr( "Set Headline Color: " ) ); 89 colorLabel2->setText( tr( "Set Headline Color: " ) );
84 headlineColor = new OColorButton( box5, black , "headlineColor" ); 90 headlineColor = new OColorButton( box5, black , "headlineColor" );
85 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) ); 91 QWhatsThis::add( headlineColor , tr( "Colors for the headlines !" ) );
86 QHBox *box6 = new QHBox( this ); 92 QHBox *box6 = new QHBox( this );
87 93
88 // Entry color settings 94 // Entry color settings
89 QLabel* colorLabel3= new QLabel( box6, "" ); 95 QLabel* colorLabel3= new QLabel( box6, "" );
90 colorLabel3->setText( tr( "Set Entry Color: " ) ); 96 colorLabel3->setText( tr( "Set Entry Color: " ) );
91 entryColor = new OColorButton( box6, black , "entryColor" ); 97 entryColor = new OColorButton( box6, black , "entryColor" );
92 QWhatsThis::add( entryColor , tr( "This color will be used for shown birthdays/anniversaries !" ) ); 98 QWhatsThis::add( entryColor , tr( "This color will be used for shown birthdays/anniversaries !" ) );
93 99
94 // Urgent color settings 100 // Urgent color settings
95 QHBox *box7 = new QHBox( this ); 101 QHBox *box7 = new QHBox( this );
96 QLabel* colorLabel5 = new QLabel( box7, "" ); 102 QLabel* colorLabel5 = new QLabel( box7, "" );
97 colorLabel5->setText( tr( "Set Urgent\nColor if below " ) ); 103 colorLabel5->setText( tr( "Set Urgent\nColor if below " ) );
98 SpinUrgentClip = new QSpinBox( box7, "SpinDays" ); 104 SpinUrgentClip = new QSpinBox( box7, "SpinDays" );
99 SpinUrgentClip->setMaxValue( 200 ); 105 SpinUrgentClip->setMaxValue( 200 );
100 QLabel* colorLabel6 = new QLabel( box7, "" ); 106 QLabel* colorLabel6 = new QLabel( box7, "" );
101 colorLabel6->setText( tr( " days: " ) ); 107 colorLabel6->setText( tr( " days: " ) );
102 urgentColor = new OColorButton( box7, red , "urgentColor" ); 108 urgentColor = new OColorButton( box7, red , "urgentColor" );
103 QWhatsThis::add( urgentColor , tr( "This urgent color will be used if we are close to the event !" ) ); 109 QWhatsThis::add( urgentColor , tr( "This urgent color will be used if we are close to the event !" ) );
104 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) ); 110 QWhatsThis::add( SpinUrgentClip , tr( "The urgent color will be used if the birthday/anniversary is closer than given days !" ) );
105 111
106 112
107 layout->addWidget( b_group ); 113 //layout->addWidget( box4 );
108 layout->addWidget( box1 ); 114 layout->addWidget( box1 );
109 // layout->addWidget( box2 ); 115 //layout->addWidget( box2 );
110 layout->addWidget( box3 ); 116 layout->addWidget( box3 );
111 layout->addWidget( box5 ); 117 layout->addWidget( box5 );
112 layout->addWidget( box6 ); 118 layout->addWidget( box6 );
113 layout->addWidget( box7 ); 119 layout->addWidget( box7 );
114 120
115 readConfig(); 121 readConfig();
116 122
117} 123}
118 124
119void AddressBookPluginConfig::readConfig() { 125void AddressBookPluginConfig::readConfig() {
120 Config cfg( "todayaddressplugin" ); 126 Config cfg( "todayaddressplugin" );
121 cfg.setGroup( "config" ); 127 cfg.setGroup( "config" );
122 m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 ); 128 m_max_lines_task = cfg.readNumEntry( "maxlinestask", 5 );
123 SpinBox2->setValue( m_max_lines_task ); 129 SpinBox2->setValue( m_max_lines_task );
124// m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); 130// m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
125// SpinBoxClip->setValue( m_maxCharClip ); 131// SpinBoxClip->setValue( m_maxCharClip );
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
index dad09db..d47bc0b 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
@@ -89,46 +89,50 @@ void AddressBookPluginWidget::readConfig() {
89 */ 89 */
90void AddressBookPluginWidget::getAddress() { 90void AddressBookPluginWidget::getAddress() {
91 91
92 if ( ! layoutTodo ){ 92 if ( ! layoutTodo ){
93 layoutTodo = new QVBoxLayout( this ); 93 layoutTodo = new QVBoxLayout( this );
94 } 94 }
95 95
96 if ( ! addressLabel ) { 96 if ( ! addressLabel ) {
97 addressLabel = new OClickableLabel( this ); 97 addressLabel = new OClickableLabel( this );
98 connect( addressLabel, SIGNAL( clicked() ), this, SLOT( startAddressBook() ) ); 98 connect( addressLabel, SIGNAL( clicked() ), this, SLOT( startAddressBook() ) );
99 layoutTodo->addWidget( addressLabel ); 99 layoutTodo->addWidget( addressLabel );
100 } 100 }
101 101
102 QString output; 102 QString output;
103 103
104 // Check whether the database provide the search option.. 104 // Check whether the database provide the search option..
105 if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){ 105 if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){
106 // Libopie seems to be old.. 106 // Libopie seems to be old..
107 output = QObject::tr( "Database does not provide this search query ! Please upgrade libOpie !<br>" ); 107 output = QObject::tr( "Database does not provide this search query ! Please upgrade libOpie !<br>" );
108 addressLabel->setText( output ); 108 addressLabel->setText( output );
109 return; 109 return;
110 } 110 }
111 111
112 // Define the query for birthdays and start search.. 112 // Define the query for birthdays and start search..
113 QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead ); 113 QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead );
114 int ammount = 0; 114 int ammount = 0;
115 if ( m_showBirthdays ){ 115 if ( m_showBirthdays ){
116 qWarning("Searching from now (%s) until %s ! ", 116 qWarning("Searching from now (%s) until %s ! ",
117 QDate::currentDate().toString().latin1(), 117 QDate::currentDate().toString().latin1(),
118 lookAheadDate.toString().latin1() ); 118 lookAheadDate.toString().latin1() );
119 }
120
121 if ( m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){
122
119 123
120 OContact querybirthdays; 124 OContact querybirthdays;
121 querybirthdays.setBirthday( lookAheadDate ); 125 querybirthdays.setBirthday( lookAheadDate );
122 126
123 m_list = m_contactdb->queryByExample( querybirthdays, 127 m_list = m_contactdb->queryByExample( querybirthdays,
124 OContactAccess::DateDiff ); 128 OContactAccess::DateDiff );
125 if ( m_list.count() > 0 ){ 129 if ( m_list.count() > 0 ){
126 output = "<font color=" + m_headlineColor + ">" 130 output = "<font color=" + m_headlineColor + ">"
127 + QObject::tr( "Next birthdays in <b> %1 </b> days:" ) 131 + QObject::tr( "Next birthdays in <b> %1 </b> days:" )
128 .arg( m_daysLookAhead ) 132 .arg( m_daysLookAhead )
129 + "</font> <br>"; 133 + "</font> <br>";
130 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { 134 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
131 if ( ammount++ < m_maxLinesTask ){ 135 if ( ammount++ < m_maxLinesTask ){
132 // Now we want to calculate how many days 136 // Now we want to calculate how many days
133 //until birthday. We have to set 137 //until birthday. We have to set
134 // the correct year to calculate the day diff... 138 // the correct year to calculate the day diff...
diff --git a/core/pim/today/plugins/datebook/datebookpluginconfig.h b/core/pim/today/plugins/datebook/datebookpluginconfig.h
index bc412dd..2d303fc 100644
--- a/core/pim/today/plugins/datebook/datebookpluginconfig.h
+++ b/core/pim/today/plugins/datebook/datebookpluginconfig.h
@@ -10,53 +10,51 @@
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef DATEBOOK_PLUGIN_CONFIG_H 17#ifndef DATEBOOK_PLUGIN_CONFIG_H
18#define DATEBOOK_PLUGIN_CONFIG_H 18#define DATEBOOK_PLUGIN_CONFIG_H
19 19
20 20
21#include <qcheckbox.h> 21#include <qcheckbox.h>
22#include <qspinbox.h> 22#include <qspinbox.h>
23 23
24#include <opie/todayconfigwidget.h> 24#include <opie/todayconfigwidget.h>
25 25
26class DatebookPluginConfig : public TodayConfigWidget { 26#include "datebookpluginconfigbase.h"
27
28class DatebookPluginConfig : public TodayConfigWidget {
27 29
28 Q_OBJECT 30 Q_OBJECT
29 31
32
30public: 33public:
31 DatebookPluginConfig( QWidget *parent, const char *name ); 34 DatebookPluginConfig( QWidget *parent, const char *name );
32 ~DatebookPluginConfig(); 35 ~DatebookPluginConfig();
33 36
34 void writeConfig(); 37 void writeConfig();
35private: 38private:
36 /** 39 /**
37 * if changed then save 40 * if changed then save
38 */ 41 */
39 bool changed(); 42 bool changed();
40 void readConfig(); 43 void readConfig();
41 44
42 QCheckBox* CheckBox2;
43 QCheckBox* CheckBox1;
44 QCheckBox* CheckBox3;
45 QSpinBox* SpinBox1;
46 QSpinBox* SpinBox2;
47
48 45
46 DatebookPluginConfigBase *m_gui;
49 // how many lines should be showed in the datebook section 47 // how many lines should be showed in the datebook section
50 int m_max_lines_meet; 48 int m_max_lines_meet;
51 // If location is to be showed too, 1 to activate it. 49 // If location is to be showed too, 1 to activate it.
52 int m_show_location; 50 int m_show_location;
53 // if notes should be shown 51 // if notes should be shown
54 int m_show_notes; 52 int m_show_notes;
55 // should only later appointments be shown or all for the current day. 53 // should only later appointments be shown or all for the current day.
56 int m_only_later; 54 int m_only_later;
57 int m_more_days; 55 int m_more_days;
58 56
59}; 57};
60 58
61 59
62#endif 60#endif
diff --git a/core/pim/today/plugins/todolist/todopluginconfig.h b/core/pim/today/plugins/todolist/todopluginconfig.h
index e09251c..54d35cf 100644
--- a/core/pim/today/plugins/todolist/todopluginconfig.h
+++ b/core/pim/today/plugins/todolist/todopluginconfig.h
@@ -4,55 +4,56 @@
4 * copyright : (c) 2002, 2003 by Maximilian Reiß 4 * copyright : (c) 2002, 2003 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef TODOLIST_PLUGIN_CONFIG_H 17#ifndef TODOLIST_PLUGIN_CONFIG_H
18#define TODOLIST_PLUGIN_CONFIG_H 18#define TODOLIST_PLUGIN_CONFIG_H
19 19
20//#include <qwidget.h>
21#include <qspinbox.h> 20#include <qspinbox.h>
22 21
23#include <opie/todayconfigwidget.h> 22#include <opie/todayconfigwidget.h>
24 23
24#include "todopluginconfigbase.h"
25
25class TodolistPluginConfig : public TodayConfigWidget { 26class TodolistPluginConfig : public TodayConfigWidget {
26 27
27Q_OBJECT 28 Q_OBJECT
28 29
29public: 30public:
30 31
31 TodolistPluginConfig( QWidget *parent, const char *name ); 32 TodolistPluginConfig( QWidget *parent, const char *name );
32 ~TodolistPluginConfig(); 33 ~TodolistPluginConfig();
33 34
34private: 35private:
35 /** 36 /**
36 * if changed then save 37 * if changed then save
37 */ 38 */
38 bool changed(); 39 bool changed();
39 void readConfig(); 40 void readConfig();
40 void writeConfig(); 41 void writeConfig();
42
43 TodoPluginConfigBase *m_gui;
41 44
42 QSpinBox* SpinBox2;
43 QSpinBox* SpinBoxClip;
44 45
45 // how many lines should be showed in the todolist section 46 // how many lines should be showed in the todolist section
46 int m_max_lines_task; 47 int m_max_lines_task;
47 // clip the lines after X chars 48 // clip the lines after X chars
48 int m_maxCharClip; 49 int m_maxCharClip;
49 50
50 51
51 52
52}; 53};
53 54
54 55
55 56
56 57
57 58
58#endif 59#endif
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp
index c4726b3..00ea105 100644
--- a/core/settings/security/security.cpp
+++ b/core/settings/security/security.cpp
@@ -98,48 +98,52 @@ void Security::updateGUI()
98{ 98{
99 bool empty = passcode.isEmpty(); 99 bool empty = passcode.isEmpty();
100 100
101 changepasscode->setText( empty ? tr("Set passcode" ) 101 changepasscode->setText( empty ? tr("Set passcode" )
102 : tr("Change passcode" ) ); 102 : tr("Change passcode" ) );
103 passcode_poweron->setEnabled( !empty ); 103 passcode_poweron->setEnabled( !empty );
104 clearpasscode->setEnabled( !empty ); 104 clearpasscode->setEnabled( !empty );
105 105
106 autologinToggle->setChecked(autoLogin); 106 autologinToggle->setChecked(autoLogin);
107 userlist->setEnabled(autoLogin); 107 userlist->setEnabled(autoLogin);
108 108
109} 109}
110 110
111 111
112void Security::show() 112void Security::show()
113{ 113{
114 valid=FALSE; 114 //valid=FALSE;
115 setEnabled(FALSE); 115 setEnabled(FALSE);
116 SecurityBase::show(); 116 SecurityBase::show();
117 if ( passcode.isEmpty() ) { 117 if ( passcode.isEmpty() ) {
118 // could insist... 118 // could insist...
119 //changePassCode(); 119 //changePassCode();
120 //if ( passcode.isEmpty() ) 120 //if ( passcode.isEmpty() )
121 //reject(); 121 //reject();
122 } else { 122 } else {
123 QString pc = enterPassCode(tr("Enter passcode")); 123
124 if ( pc != passcode ) { 124 if (!valid) // security passcode was not asked yet, so ask now
125 QMessageBox::critical(this, tr("Passcode incorrect"), 125 {
126 tr("The passcode entered is incorrect.\nAccess denied")); 126 QString pc = enterPassCode(tr("Enter passcode"));
127 reject(); 127 if ( pc != passcode ) {
128 return; 128 QMessageBox::critical(this, tr("Passcode incorrect"),
129 } 129 tr("The passcode entered is incorrect.\nAccess denied"));
130 reject();
131 return;
132 }
133 }
130 } 134 }
131 setEnabled(TRUE); 135 setEnabled(TRUE);
132 valid=TRUE; 136 valid=TRUE;
133} 137}
134 138
135void Security::accept() 139void Security::accept()
136{ 140{
137 applySecurity(); 141 applySecurity();
138 QDialog::accept(); 142 QDialog::accept();
139 QCopEnvelope env("QPE/System", "securityChanged()" ); 143 QCopEnvelope env("QPE/System", "securityChanged()" );
140} 144}
141 145
142void Security::done(int r) 146void Security::done(int r)
143{ 147{
144 QDialog::done(r); 148 QDialog::done(r);
145 close(); 149 close();
@@ -200,81 +204,88 @@ void Security::loadUsers ( void )
200 while ( !t.eof() ) { 204 while ( !t.eof() ) {
201 account = QStringList::split(':',t.readLine()); 205 account = QStringList::split(':',t.readLine());
202 206
203 // Hide disabled accounts 207 // Hide disabled accounts
204 if (*account.at(1)!="*") { 208 if (*account.at(1)!="*") {
205 209
206 userlist->insertItem(*account.at(0)); 210 userlist->insertItem(*account.at(0));
207 // Highlight this item if it is set to autologinToggle 211 // Highlight this item if it is set to autologinToggle
208 if ( *account.at(0) == autoLoginName) 212 if ( *account.at(0) == autoLoginName)
209 userlist->setCurrentItem(userlist->count()-1); 213 userlist->setCurrentItem(userlist->count()-1);
210 } 214 }
211 } 215 }
212 passwd.close(); 216 passwd.close();
213 } 217 }
214 218
215} 219}
220
216void Security::toggleAutoLogin(bool val) 221void Security::toggleAutoLogin(bool val)
217{ 222{
218 autoLogin=val; 223 autoLogin=val;
219 userlist->setEnabled(val); 224 userlist->setEnabled(val);
220 if (!autoLogin) 225 if (!autoLogin)
221 autoLoginName=userlist->currentText(); 226 autoLoginName=userlist->currentText();
222} 227}
228
229
230
231
223void Security::setSyncNet(const QString& sn) 232void Security::setSyncNet(const QString& sn)
224{ 233{
225 int auth_peer,auth_peer_bits; 234 int auth_peer,auth_peer_bits;
226 parseNet(sn,auth_peer,auth_peer_bits); 235 parseNet(sn,auth_peer,auth_peer_bits);
227 selectNet(auth_peer,auth_peer_bits); 236 selectNet(auth_peer,auth_peer_bits);
228} 237}
229 238
230void Security::applySecurity() 239void Security::applySecurity()
231{ 240{
232 if ( valid ) { 241 if ( valid ) {
242<<<<<<< security.cpp
233 Config cfg("Security"); 243 Config cfg("Security");
234 cfg.setGroup("Passcode"); 244 cfg.setGroup("Passcode");
235 cfg.writeEntry("passcode",passcode); 245 cfg.writeEntry("passcode",passcode);
236 cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked()); 246 cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked());
237 cfg.setGroup("Sync"); 247 cfg.setGroup("Sync");
238 int auth_peer=0; 248 int auth_peer=0;
239 int auth_peer_bits; 249 int auth_peer_bits;
240 QString sn = syncnet->currentText(); 250 QString sn = syncnet->currentText();
241 parseNet(sn,auth_peer,auth_peer_bits); 251 parseNet(sn,auth_peer,auth_peer_bits);
242 cfg.writeEntry("auth_peer",auth_peer); 252 cfg.writeEntry("auth_peer",auth_peer);
243 cfg.writeEntry("auth_peer_bits",auth_peer_bits); 253 cfg.writeEntry("auth_peer_bits",auth_peer_bits);
244 /* 254 /*
245 cfg.setGroup("Remote"); 255 cfg.setGroup("Remote");
246 if ( telnetAvailable() ) 256 if ( telnetAvailable() )
247 cfg.writeEntry("allow_telnet",telnet->isChecked()); 257 cfg.writeEntry("allow_telnet",telnet->isChecked());
248 if ( sshAvailable() ) 258 if ( sshAvailable() )
249 cfg.writeEntry("allow_ssh",ssh->isChecked()); 259 cfg.writeEntry("allow_ssh",ssh->isChecked());
250 // ### write ssh/telnet sys config files 260 // ### write ssh/telnet sys config files
251 */ 261 */
252 262
253 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; 263 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf";
254 Config loginCfg(configFile,Config::File); 264 Config loginCfg(configFile,Config::File);
255 loginCfg.setGroup("General"); 265 loginCfg.setGroup("General");
256 266
257 if (autoLogin) { 267 if (autoLogin) {
258 loginCfg.writeEntry("AutoLogin",autoLoginName); 268 loginCfg.writeEntry("AutoLogin",autoLoginName);
259 } else { 269 } else {
260 loginCfg.removeEntry("AutoLogin"); 270 loginCfg.removeEntry("AutoLogin");
261 } 271 }
262 272
263 cfg.setGroup("SyncMode"); 273 cfg.setGroup("SyncMode");
264 cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 ); 274 cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 );
275
265 } 276 }
266} 277}
267 278
268void Security::changeLoginName( int idx ) 279void Security::changeLoginName( int idx )
269{ 280{
270 autoLoginName = userlist->text(idx);; 281 autoLoginName = userlist->text(idx);;
271 updateGUI(); 282 updateGUI();
272} 283}
273 284
274void Security::changePassCode() 285void Security::changePassCode()
275{ 286{
276 QString new1; 287 QString new1;
277 QString new2; 288 QString new2;
278 289
279 do { 290 do {
280 new1 = enterPassCode(tr("Enter new passcode")); 291 new1 = enterPassCode(tr("Enter new passcode"));
diff --git a/noncore/apps/confedit/main.cpp b/noncore/apps/confedit/main.cpp
index 7e7f064..74923c8 100644
--- a/noncore/apps/confedit/main.cpp
+++ b/noncore/apps/confedit/main.cpp
@@ -1,13 +1,8 @@
1 1
2#include "mainwindow.h" 2#include "mainwindow.h"
3 3
4#include <opie2/oapplication.h> 4#include <qpe/qpeapplication.h>
5 5#include <opie/oapplicationfactory.h>
6int main( int argc, char ** argv ) 6
7{ 7OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
8 OApplication a( argc, argv, "confedit" ); 8
9 MainWindow mw;
10 mw.showMaximized();
11 a.showMainDocumentWidget( &mw );
12 return a.exec();
13}
diff --git a/noncore/games/tictac/main.cpp b/noncore/games/tictac/main.cpp
index 78fb3b7..0185b8c 100644
--- a/noncore/games/tictac/main.cpp
+++ b/noncore/games/tictac/main.cpp
@@ -1,31 +1,19 @@
1/**************************************************************************** 1/****************************************************************************
2<<<<<<< main.cpp
2** $Id$ 3** $Id$
4=======
5** $Id$
6>>>>>>> 1.1.8.1.2.1
3** 7**
4** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
5** 9**
6** This file is part of an example program for Qt. This example 10** This file is part of an example program for Qt. This example
7** program may be used, distributed and modified without limitation. 11** program may be used, distributed and modified without limitation.
8** 12**
9*****************************************************************************/ 13*****************************************************************************/
10 14
11#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
12#include <stdlib.h> 16#include <opie/oapplicationfactory.h>
13#include "tictac.h" 17#include "tictac.h"
14 18
15 19OPIE_EXPORT_APP( OApplicationFactory<TicTacToe> )
16int main( int argc, char **argv )
17{
18 QPEApplication a( argc, argv );
19 int n = 3;
20 if ( argc == 2 ) // get board size n
21 n = atoi(argv[1]);
22 if ( n < 3 || n > 10 ) { // out of range
23 qWarning( "%s: Board size must be from 3x3 to 10x10", argv[0] );
24 return 1;
25 }
26 TicTacToe ttt( n ); // create game
27 a.setMainWidget( &ttt );
28 ttt.setCaption( QObject::tr("TicTac") );
29 ttt.show(); // show widget
30 return a.exec(); // go
31}