summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebook.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp48
1 files changed, 25 insertions, 23 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 2c2965e..c0d45c9 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -129,5 +129,5 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
129 a->addTo( sub_bar ); 129 a->addTo( sub_bar );
130 a->addTo( view ); 130 a->addTo( view );
131 131
132 a = new QAction( tr( "Day" ), Resource::loadPixmap( "day" ), QString::null, 0, g, 0 ); 132 a = new QAction( tr( "Day" ), Resource::loadPixmap( "day" ), QString::null, 0, g, 0 );
133 connect( a, SIGNAL( activated() ), this, SLOT( viewDay() ) ); 133 connect( a, SIGNAL( activated() ), this, SLOT( viewDay() ) );
@@ -174,5 +174,5 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
174 config.setGroup("Main"); 174 config.setGroup("Main");
175 int current=config.readNumEntry("defaultview", DAY); 175 int current=config.readNumEntry("defaultview", DAY);
176 176
177 QActionGroup *ag = new QActionGroup(this); 177 QActionGroup *ag = new QActionGroup(this);
178 a = new QAction( tr( "Day" ), QString::null, 0, 0, 0, true ); 178 a = new QAction( tr( "Day" ), QString::null, 0, 0, 0, true );
@@ -188,20 +188,20 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
188 if (current==MONTH) a->setOn(true), viewMonth(); 188 if (current==MONTH) a->setOn(true), viewMonth();
189 ag->insert(a); 189 ag->insert(a);
190 190
191 ag->addTo(default_view); 191 ag->addTo(default_view);
192 connect(ag, SIGNAL( selected ( QAction * ) ), 192 connect(ag, SIGNAL( selected ( QAction * ) ),
193 this, SLOT( newDefaultView(QAction *) ) 193 this, SLOT( newDefaultView(QAction *) )
194 ); 194 );
195 195
196 connect( qApp, SIGNAL(clockChanged(bool)), 196 connect( qApp, SIGNAL(clockChanged(bool)),
197 this, SLOT(changeClock(bool)) ); 197 this, SLOT(changeClock(bool)) );
198 connect( qApp, SIGNAL(weekChanged(bool)), 198 connect( qApp, SIGNAL(weekChanged(bool)),
199 this, SLOT(changeWeek(bool)) ); 199 this, SLOT(changeWeek(bool)) );
200 200
201#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 201#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
202 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), 202 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)),
203 this, SLOT(appMessage(const QCString&, const QByteArray&)) ); 203 this, SLOT(appMessage(const QCString&, const QByteArray&)) );
204#endif 204#endif
205 205
206 // listen on QPE/System 206 // listen on QPE/System
207#if defined(Q_WS_QWS) 207#if defined(Q_WS_QWS)
@@ -213,8 +213,8 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
213 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 213 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
214 this, SLOT(receive(const QCString&, const QByteArray&)) ); 214 this, SLOT(receive(const QCString&, const QByteArray&)) );
215 qDebug("olle\n"); 215 qDebug("olle\n");
216#endif 216#endif
217#endif 217#endif
218 218
219 qDebug("done t=%d", t.elapsed() ); 219 qDebug("done t=%d", t.elapsed() );
220 220
@@ -310,5 +310,5 @@ QDate DateBook::currentDate()
310{ 310{
311 QDate d = QDate::currentDate(); 311 QDate d = QDate::currentDate();
312 312
313 if ( dayView && views->visibleWidget() == dayView ) { 313 if ( dayView && views->visibleWidget() == dayView ) {
314 d = dayView->date(); 314 d = dayView->date();
@@ -407,5 +407,5 @@ void DateBook::editEvent( const Event &e )
407 if (!error.isNull()) { 407 if (!error.isNull()) {
408 if (QMessageBox::warning(this, "error box", 408 if (QMessageBox::warning(this, "error box",
409 error, "Fix it", "Continue", 409 error, "Fix it", "Continue",
410 0, 0, 1) == 0) 410 0, 0, 1) == 0)
411 continue; 411 continue;
@@ -489,5 +489,5 @@ void DateBook::initWeek()
489 QDate d = QDate( yearNumber, 12, 31 ); 489 QDate d = QDate( yearNumber, 12, 31 );
490 calcWeek( d, totWeeks, yearNumber, onMonday ); 490 calcWeek( d, totWeeks, yearNumber, onMonday );
491 491
492 while ( totWeeks == 1 ) { 492 while ( totWeeks == 1 ) {
493 d = d.addDays( -1 ); 493 d = d.addDays( -1 );
@@ -499,16 +499,16 @@ void DateBook::initWeek()
499void DateBook::initWeekLst() { 499void DateBook::initWeekLst() {
500 if ( !weekLstView ) { 500 if ( !weekLstView ) {
501 weekLstView = new DateBookWeekLst( ampm, onMonday, db, 501 weekLstView = new DateBookWeekLst( ampm, onMonday, db,
502 views, "weeklst view" ); 502 views, "weeklst view" );
503 views->addWidget( weekLstView, WEEKLST ); 503 views->addWidget( weekLstView, WEEKLST );
504 504
505 //weekLstView->setStartViewTime( startTime ); 505 //weekLstView->setStartViewTime( startTime );
506 connect( weekLstView, SIGNAL( showDate( int, int, int ) ), 506 connect( weekLstView, SIGNAL( showDate( int, int, int ) ),
507 this, SLOT( showDay( int, int, int ) ) ); 507 this, SLOT( showDay( int, int, int ) ) );
508 connect( weekLstView, SIGNAL( addEvent( const QDateTime &, 508 connect( weekLstView, SIGNAL( addEvent( const QDateTime &,
509 const QDateTime &, 509 const QDateTime &,
510 const QString & ) ), 510 const QString & ) ),
511 this, SLOT( slotNewEntry( const QDateTime &, 511 this, SLOT( slotNewEntry( const QDateTime &,
512 const QDateTime &, 512 const QDateTime &,
513 const QString & ) ) ); 513 const QString & ) ) );
514 connect( this, SIGNAL( newEvent() ), 514 connect( this, SIGNAL( newEvent() ),
@@ -541,5 +541,5 @@ void DateBook::loadSettings()
541 onMonday = config.readBoolEntry( "MONDAY" ); 541 onMonday = config.readBoolEntry( "MONDAY" );
542 } 542 }
543 543
544 { 544 {
545 Config config("DateBook"); 545 Config config("DateBook");
@@ -567,5 +567,5 @@ void DateBook::newDefaultView(QAction *a) {
567 if (a->text() == "WeekLst") val=WEEKLST; 567 if (a->text() == "WeekLst") val=WEEKLST;
568 if (a->text() == "Month") val=MONTH; 568 if (a->text() == "Month") val=MONTH;
569 569
570 Config configDB( "DateBook" ); 570 Config configDB( "DateBook" );
571 configDB.setGroup( "Main" ); 571 configDB.setGroup( "Main" );
@@ -689,5 +689,5 @@ void DateBook::timerEvent( QTimerEvent *e )
689 alarmCounter++; 689 alarmCounter++;
690 Sound::soundAlarm(); 690 Sound::soundAlarm();
691 } 691 }
692 else 692 else
693 killTimer( e->timerId() ); 693 killTimer( e->timerId() );
@@ -977,5 +977,5 @@ Event DateBookDBHack::eventByUID(int uid) {
977 977
978 QValueList<Event>::ConstIterator it; 978 QValueList<Event>::ConstIterator it;
979 979
980 for (it = myEventList.begin(); it != myEventList.end(); it++) { 980 for (it = myEventList.begin(); it != myEventList.end(); it++) {
981 if ((*it).uid() == uid) return *it; 981 if ((*it).uid() == uid) return *it;
@@ -986,4 +986,6 @@ Event DateBookDBHack::eventByUID(int uid) {
986 986
987 qDebug("Event not found: uid=%d\n", uid); 987 qDebug("Event not found: uid=%d\n", uid);
988 Event ev;
989 return ev; // return at least
988} 990}
989 991