-rw-r--r-- | korganizer/calendarview.cpp | 148 |
1 files changed, 77 insertions, 71 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8385bcc..c1a2f76 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -29,28 +29,34 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | 32 | ||
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qradiobutton.h> | 34 | #include <qradiobutton.h> |
35 | #include <qbuttongroup.h> | 35 | #include <q3buttongroup.h> |
36 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qclipboard.h> | 37 | #include <qclipboard.h> |
38 | #include <qcursor.h> | 38 | #include <qcursor.h> |
39 | #include <qmessagebox.h> | 39 | #include <qmessagebox.h> |
40 | #include <qprogressbar.h> | 40 | #include <q3progressbar.h> |
41 | #include <qmultilineedit.h> | 41 | #include <q3multilineedit.h> |
42 | #include <qtimer.h> | 42 | #include <qtimer.h> |
43 | #include <qwidgetstack.h> | 43 | #include <q3widgetstack.h> |
44 | #include <qptrlist.h> | 44 | #include <q3ptrlist.h> |
45 | #include <qregexp.h> | 45 | #include <qregexp.h> |
46 | #include <qgroupbox.h> | 46 | #include <q3groupbox.h> |
47 | #include <qfile.h> | 47 | #include <qfile.h> |
48 | #include <qdir.h> | 48 | #include <qdir.h> |
49 | #ifndef KORG_NOSPLITTER | 49 | #ifndef KORG_NOSPLITTER |
50 | #include <qsplitter.h> | 50 | #include <qsplitter.h> |
51 | //Added by qt3to4: | ||
52 | #include <Q3VBoxLayout> | ||
53 | #include <QKeyEvent> | ||
54 | #include <Q3Frame> | ||
55 | #include <QLabel> | ||
56 | #include <Q3ValueList> | ||
51 | #endif | 57 | #endif |
52 | 58 | ||
53 | #include <kglobal.h> | 59 | #include <kglobal.h> |
54 | #include <kdebug.h> | 60 | #include <kdebug.h> |
55 | #include <kstandarddirs.h> | 61 | #include <kstandarddirs.h> |
56 | #include <kfiledialog.h> | 62 | #include <kfiledialog.h> |
@@ -125,25 +131,25 @@ | |||
125 | #endif | 131 | #endif |
126 | #ifndef _WIN32_ | 132 | #ifndef _WIN32_ |
127 | #include <stdlib.h> | 133 | #include <stdlib.h> |
128 | #include <stdio.h> | 134 | #include <stdio.h> |
129 | #include <unistd.h> | 135 | #include <unistd.h> |
130 | #else | 136 | #else |
131 | #include <qprocess.h> | 137 | #include <q3process.h> |
132 | #endif | 138 | #endif |
133 | 139 | ||
134 | #ifdef DESKTOP_VERSION | 140 | #ifdef DESKTOP_VERSION |
135 | #include <kabc/stdaddressbook.h> | 141 | #include <kabc/stdaddressbook.h> |
136 | #endif | 142 | #endif |
137 | using namespace KOrg; | 143 | using namespace KOrg; |
138 | using namespace KCal; | 144 | using namespace KCal; |
139 | extern int globalFlagBlockAgenda; | 145 | extern int globalFlagBlockAgenda; |
140 | extern int globalFlagBlockStartup; | 146 | extern int globalFlagBlockStartup; |
141 | 147 | ||
142 | 148 | ||
143 | MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent) | 149 | MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms,QDateTime start ) : Q3TextBrowser(parent) |
144 | 150 | ||
145 | { | 151 | { |
146 | mAlarms = alarms; | 152 | mAlarms = alarms; |
147 | viewport()->setBackgroundColor( QColor( 255, 255, 255 ) ); | 153 | viewport()->setBackgroundColor( QColor( 255, 255, 255 ) ); |
148 | QString mText = "<table width=\"100%\">\n"; | 154 | QString mText = "<table width=\"100%\">\n"; |
149 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; | 155 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; |
@@ -274,19 +280,19 @@ class KOBeamPrefs : public QDialog | |||
274 | { | 280 | { |
275 | public: | 281 | public: |
276 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : | 282 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : |
277 | QDialog( parent, name, true ) | 283 | QDialog( parent, name, true ) |
278 | { | 284 | { |
279 | setCaption( i18n("Beam Options") ); | 285 | setCaption( i18n("Beam Options") ); |
280 | QVBoxLayout* lay = new QVBoxLayout( this ); | 286 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
281 | lay->setSpacing( 3 ); | 287 | lay->setSpacing( 3 ); |
282 | lay->setMargin( 3 ); | 288 | lay->setMargin( 3 ); |
283 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); | 289 | Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("File format"), this ); |
284 | lay->addWidget( format ); | 290 | lay->addWidget( format ); |
285 | format->setExclusive ( true ) ; | 291 | format->setExclusive ( true ) ; |
286 | QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); | 292 | Q3ButtonGroup* time = new Q3ButtonGroup(1, Qt::Horizontal, i18n("Time format"), this ); |
287 | lay->addWidget( time ); time->setExclusive ( true ) ; | 293 | lay->addWidget( time ); time->setExclusive ( true ) ; |
288 | vcal = new QRadioButton(" vCalendar ", format ); | 294 | vcal = new QRadioButton(" vCalendar ", format ); |
289 | ical = new QRadioButton(" iCalendar ", format ); | 295 | ical = new QRadioButton(" iCalendar ", format ); |
290 | vcal->setChecked( true ); | 296 | vcal->setChecked( true ); |
291 | tz = new QRadioButton(i18n(" With timezone "), time ); | 297 | tz = new QRadioButton(i18n(" With timezone "), time ); |
292 | local = new QRadioButton(i18n(" Local time "), time ); | 298 | local = new QRadioButton(i18n(" Local time "), time ); |
@@ -309,18 +315,18 @@ class KOCatPrefs : public QDialog | |||
309 | { | 315 | { |
310 | public: | 316 | public: |
311 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : | 317 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : |
312 | QDialog( parent, name, true ) | 318 | QDialog( parent, name, true ) |
313 | { | 319 | { |
314 | setCaption( i18n("Manage new Categories") ); | 320 | setCaption( i18n("Manage new Categories") ); |
315 | QVBoxLayout* lay = new QVBoxLayout( this ); | 321 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
316 | lay->setSpacing( 3 ); | 322 | lay->setSpacing( 3 ); |
317 | lay->setMargin( 3 ); | 323 | lay->setMargin( 3 ); |
318 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:"), this ); | 324 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:"), this ); |
319 | lay->addWidget( lab ); | 325 | lay->addWidget( lab ); |
320 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); | 326 | Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("New categories not in list:"), this ); |
321 | lay->addWidget( format ); | 327 | lay->addWidget( format ); |
322 | format->setExclusive ( true ) ; | 328 | format->setExclusive ( true ) ; |
323 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); | 329 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); |
324 | new QRadioButton(i18n("Remove from Events/Todos"), format ); | 330 | new QRadioButton(i18n("Remove from Events/Todos"), format ); |
325 | addCatBut->setChecked( true ); | 331 | addCatBut->setChecked( true ); |
326 | QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); | 332 | QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); |
@@ -370,13 +376,13 @@ void CalendarView::init() | |||
370 | flag_blockConflict = false; | 376 | flag_blockConflict = false; |
371 | flag_blockScrollBar = false; | 377 | flag_blockScrollBar = false; |
372 | flag_checkFileFirsttime = true; | 378 | flag_checkFileFirsttime = true; |
373 | flag_clearallviewsEventDisplay = false; | 379 | flag_clearallviewsEventDisplay = false; |
374 | flag_clearallviewsupdateView = false; | 380 | flag_clearallviewsupdateView = false; |
375 | mNextAlarmDateTime = QDateTime::currentDateTime(); | 381 | mNextAlarmDateTime = QDateTime::currentDateTime(); |
376 | setFocusPolicy (NoFocus ); | 382 | setFocusPolicy (Qt::NoFocus ); |
377 | mViewerCallerIsSearchDialog = false; | 383 | mViewerCallerIsSearchDialog = false; |
378 | mBlockShowDates = false; | 384 | mBlockShowDates = false; |
379 | mConflictingEvent = 0; | 385 | mConflictingEvent = 0; |
380 | mDatePickerMode = 0; | 386 | mDatePickerMode = 0; |
381 | mCurrentSyncDevice = ""; | 387 | mCurrentSyncDevice = ""; |
382 | mViewManager = new KOViewManager( this ); | 388 | mViewManager = new KOViewManager( this ); |
@@ -391,13 +397,13 @@ void CalendarView::init() | |||
391 | mCalendar->registerObserver( this ); | 397 | mCalendar->registerObserver( this ); |
392 | // TODO: Make sure that view is updated, when calendar is changed. | 398 | // TODO: Make sure that view is updated, when calendar is changed. |
393 | 399 | ||
394 | mStorage = new FileStorage( mCalendar ); | 400 | mStorage = new FileStorage( mCalendar ); |
395 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); | 401 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); |
396 | 402 | ||
397 | QBoxLayout *topLayout = (QBoxLayout*)layout(); | 403 | Q3BoxLayout *topLayout = (Q3BoxLayout*)layout(); |
398 | #ifndef KORG_NOSPLITTER | 404 | #ifndef KORG_NOSPLITTER |
399 | // create the main layout frames. | 405 | // create the main layout frames. |
400 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); | 406 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); |
401 | topLayout->addWidget(mPanner); | 407 | topLayout->addWidget(mPanner); |
402 | 408 | ||
403 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, | 409 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, |
@@ -422,15 +428,15 @@ void CalendarView::init() | |||
422 | SLOT( updateView() ) ); | 428 | SLOT( updateView() ) ); |
423 | } else { | 429 | } else { |
424 | mResourceView = 0; | 430 | mResourceView = 0; |
425 | } | 431 | } |
426 | #endif | 432 | #endif |
427 | QWidget *rightBox = new QWidget( mPanner ); | 433 | QWidget *rightBox = new QWidget( mPanner ); |
428 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 434 | Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox ); |
429 | 435 | ||
430 | mRightFrame = new QWidgetStack( rightBox ); | 436 | mRightFrame = new Q3WidgetStack( rightBox ); |
431 | rightLayout->addWidget( mRightFrame, 1 ); | 437 | rightLayout->addWidget( mRightFrame, 1 ); |
432 | 438 | ||
433 | mLeftFrame = mLeftSplitter; | 439 | mLeftFrame = mLeftSplitter; |
434 | #else | 440 | #else |
435 | //QWidget *mainBox = new QWidget( this ); | 441 | //QWidget *mainBox = new QWidget( this ); |
436 | //QWidget *leftFrame = new QWidget( mainBox ); | 442 | //QWidget *leftFrame = new QWidget( mainBox ); |
@@ -451,13 +457,13 @@ void CalendarView::init() | |||
451 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 457 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
452 | } | 458 | } |
453 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); | 459 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); |
454 | //QBoxLayout * leftFrameLayout; | 460 | //QBoxLayout * leftFrameLayout; |
455 | topLayout->addWidget( mMainFrame ); | 461 | topLayout->addWidget( mMainFrame ); |
456 | #ifdef DESKTOP_VERSION | 462 | #ifdef DESKTOP_VERSION |
457 | mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); | 463 | mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,Qt::Horizontal, this ); |
458 | topLayout->addWidget( mDateScrollBar ); | 464 | topLayout->addWidget( mDateScrollBar ); |
459 | connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); | 465 | connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); |
460 | if ( QApplication::desktop()->width() < 800 ) | 466 | if ( QApplication::desktop()->width() < 800 ) |
461 | mDateScrollBar->hide(); | 467 | mDateScrollBar->hide(); |
462 | #endif | 468 | #endif |
463 | //mainBoxLayout->addWidget (mLeftFrame); | 469 | //mainBoxLayout->addWidget (mLeftFrame); |
@@ -498,14 +504,14 @@ void CalendarView::init() | |||
498 | } | 504 | } |
499 | #endif | 505 | #endif |
500 | mFilterView->hide(); | 506 | mFilterView->hide(); |
501 | mCalEditView->hide(); | 507 | mCalEditView->hide(); |
502 | QWidget *rightBox = new QWidget( mMainFrame ); | 508 | QWidget *rightBox = new QWidget( mMainFrame ); |
503 | //mainBoxLayout->addWidget ( rightBox, 10 ); | 509 | //mainBoxLayout->addWidget ( rightBox, 10 ); |
504 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 510 | Q3BoxLayout *rightLayout = new Q3VBoxLayout( rightBox ); |
505 | mRightFrame = new QWidgetStack( rightBox ); | 511 | mRightFrame = new Q3WidgetStack( rightBox ); |
506 | rightLayout->addWidget( mRightFrame, 10 ); | 512 | rightLayout->addWidget( mRightFrame, 10 ); |
507 | 513 | ||
508 | //mLeftFrame = (QWidget *)leftFrame; | 514 | //mLeftFrame = (QWidget *)leftFrame; |
509 | if ( KOPrefs::instance()->mVerticalScreen ) { | 515 | if ( KOPrefs::instance()->mVerticalScreen ) { |
510 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); | 516 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); |
511 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); | 517 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); |
@@ -613,15 +619,15 @@ void CalendarView::init() | |||
613 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), | 619 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), |
614 | SLOT( processTodoListSelection( Incidence * ) ) ); | 620 | SLOT( processTodoListSelection( Incidence * ) ) ); |
615 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); | 621 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); |
616 | 622 | ||
617 | // kdDebug() << "CalendarView::CalendarView() done" << endl; | 623 | // kdDebug() << "CalendarView::CalendarView() done" << endl; |
618 | 624 | ||
619 | mDateFrame = new QVBox(0,0,WType_Popup); | 625 | mDateFrame = new Q3VBox(0,0,Qt::WType_Popup); |
620 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); | 626 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); |
621 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); | 627 | mDateFrame->setFrameStyle( Q3Frame::WinPanel |Q3Frame::Raised ); |
622 | mDateFrame->setLineWidth(3); | 628 | mDateFrame->setLineWidth(3); |
623 | mDateFrame->hide(); | 629 | mDateFrame->hide(); |
624 | mDateFrame->setCaption( i18n( "Pick a date to display")); | 630 | mDateFrame->setCaption( i18n( "Pick a date to display")); |
625 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); | 631 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); |
626 | 632 | ||
627 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); | 633 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); |
@@ -666,13 +672,13 @@ CalendarView::~CalendarView() | |||
666 | 672 | ||
667 | 673 | ||
668 | void CalendarView::nextConflict( bool all, bool allday ) | 674 | void CalendarView::nextConflict( bool all, bool allday ) |
669 | { | 675 | { |
670 | if ( flag_blockConflict ) return; | 676 | if ( flag_blockConflict ) return; |
671 | flag_blockConflict = true; | 677 | flag_blockConflict = true; |
672 | QPtrList<Event> testlist = mCalendar->events(); | 678 | Q3PtrList<Event> testlist = mCalendar->events(); |
673 | Event * test = testlist.first(); | 679 | Event * test = testlist.first(); |
674 | while ( test ) { | 680 | while ( test ) { |
675 | test->setTagged( false ); | 681 | test->setTagged( false ); |
676 | test = testlist.next(); | 682 | test = testlist.next(); |
677 | } | 683 | } |
678 | QTime st ( 0,0,0); | 684 | QTime st ( 0,0,0); |
@@ -682,13 +688,13 @@ void CalendarView::nextConflict( bool all, bool allday ) | |||
682 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); | 688 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); |
683 | QDateTime conflict; | 689 | QDateTime conflict; |
684 | QDateTime retVal; | 690 | QDateTime retVal; |
685 | bool found = false; | 691 | bool found = false; |
686 | Event * cE = 0; | 692 | Event * cE = 0; |
687 | Event * cE2 = 0; | 693 | Event * cE2 = 0; |
688 | QPtrList<Event> testlist2 = testlist; | 694 | Q3PtrList<Event> testlist2 = testlist; |
689 | test = testlist.first(); | 695 | test = testlist.first(); |
690 | bool skip = false; | 696 | bool skip = false; |
691 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); | 697 | topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); |
692 | //QTime tm; | 698 | //QTime tm; |
693 | //tm.start(); | 699 | //tm.start(); |
694 | while ( test ) { | 700 | while ( test ) { |
@@ -832,13 +838,13 @@ void CalendarView::updateView(const QDate &start, const QDate &end) | |||
832 | 838 | ||
833 | 839 | ||
834 | 840 | ||
835 | void CalendarView::checkFiles() | 841 | void CalendarView::checkFiles() |
836 | { | 842 | { |
837 | QString message; | 843 | QString message; |
838 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 844 | Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
839 | KopiCalendarFile * cal = calendars.first(); | 845 | KopiCalendarFile * cal = calendars.first(); |
840 | while ( cal ) { | 846 | while ( cal ) { |
841 | if ( cal->mErrorOnLoad ) { | 847 | if ( cal->mErrorOnLoad ) { |
842 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; | 848 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; |
843 | } | 849 | } |
844 | cal = calendars.next(); | 850 | cal = calendars.next(); |
@@ -854,24 +860,24 @@ void CalendarView::checkFiles() | |||
854 | } | 860 | } |
855 | void CalendarView::checkAlarms() | 861 | void CalendarView::checkAlarms() |
856 | { | 862 | { |
857 | KConfig *config = KOGlobals::config(); | 863 | KConfig *config = KOGlobals::config(); |
858 | config->setGroup( "AppRun" ); | 864 | config->setGroup( "AppRun" ); |
859 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); | 865 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); |
860 | int daysto = dt.daysTo( QDate::currentDate() ); | 866 | int daysto = dt.daysTo( (QDateTime)QDate::currentDate() ); |
861 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); | 867 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); |
862 | dt = dt.addDays( days ); | 868 | dt = dt.addDays( days ); |
863 | int secto = dt.secsTo( QDateTime::currentDateTime() ); | 869 | int secto = dt.secsTo( QDateTime::currentDateTime() ); |
864 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; | 870 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; |
865 | //qDebug("KO: Reading program stop %d ", secs); | 871 | //qDebug("KO: Reading program stop %d ", secs); |
866 | //secs -= ( 3600 * 24*3 ); // debug only | 872 | //secs -= ( 3600 * 24*3 ); // debug only |
867 | QDateTime latest = dt.addSecs ( secs ); | 873 | QDateTime latest = dt.addSecs ( secs ); |
868 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); | 874 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); |
869 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); | 875 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); |
870 | QPtrList<Incidence> el = mCalendar->rawIncidences(); | 876 | Q3PtrList<Incidence> el = mCalendar->rawIncidences(); |
871 | QPtrList<Incidence> al; | 877 | Q3PtrList<Incidence> al; |
872 | Incidence* inL = el.first(); | 878 | Incidence* inL = el.first(); |
873 | QDateTime cur = QDateTime::currentDateTime().addSecs(-59); | 879 | QDateTime cur = QDateTime::currentDateTime().addSecs(-59); |
874 | qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); | 880 | qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); |
875 | while ( inL ) { | 881 | while ( inL ) { |
876 | bool ok = false; | 882 | bool ok = false; |
877 | int offset = 0; | 883 | int offset = 0; |
@@ -883,15 +889,15 @@ void CalendarView::checkAlarms() | |||
883 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); | 889 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); |
884 | } | 890 | } |
885 | } | 891 | } |
886 | inL = el.next(); | 892 | inL = el.next(); |
887 | } | 893 | } |
888 | if ( al.count() ) { | 894 | if ( al.count() ) { |
889 | QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); | 895 | QDialog* dia = new QDialog( this, "huhu", false, Qt::WDestructiveClose | Qt::WStyle_StaysOnTop ); |
890 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); | 896 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); |
891 | QVBoxLayout* lay = new QVBoxLayout( dia ); | 897 | Q3VBoxLayout* lay = new Q3VBoxLayout( dia ); |
892 | lay->setSpacing( 0 ); | 898 | lay->setSpacing( 0 ); |
893 | lay->setMargin( 0 ); | 899 | lay->setMargin( 0 ); |
894 | MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); | 900 | MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); |
895 | connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); | 901 | connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); |
896 | lay->addWidget( matb ); | 902 | lay->addWidget( matb ); |
897 | if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { | 903 | if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { |
@@ -1213,13 +1219,13 @@ void CalendarView::computeAlarm( QString msg ) | |||
1213 | #ifndef _WIN32_ | 1219 | #ifndef _WIN32_ |
1214 | if ( vfork () == 0 ) { | 1220 | if ( vfork () == 0 ) { |
1215 | execl ( tempfilename.latin1(), 0 ); | 1221 | execl ( tempfilename.latin1(), 0 ); |
1216 | return; | 1222 | return; |
1217 | } | 1223 | } |
1218 | #else | 1224 | #else |
1219 | QProcess* p = new QProcess(); | 1225 | Q3Process* p = new Q3Process(); |
1220 | p->addArgument( tempfilename.latin1() ); | 1226 | p->addArgument( tempfilename.latin1() ); |
1221 | p->start(); | 1227 | p->start(); |
1222 | return; | 1228 | return; |
1223 | #endif | 1229 | #endif |
1224 | 1230 | ||
1225 | return; | 1231 | return; |
@@ -1263,16 +1269,16 @@ void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) | |||
1263 | #ifdef DESKTOP_VERSION | 1269 | #ifdef DESKTOP_VERSION |
1264 | if ( QApplication::desktop()->width() < 1024 ) { | 1270 | if ( QApplication::desktop()->width() < 1024 ) { |
1265 | QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; | 1271 | QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; |
1266 | //qDebug("nextsuspendalarm = \n%s ",mess.latin1() ); | 1272 | //qDebug("nextsuspendalarm = \n%s ",mess.latin1() ); |
1267 | QString fn = QDir::homeDirPath() + "/.kopi_suspend_alarm"; | 1273 | QString fn = QDir::homeDirPath() + "/.kopi_suspend_alarm"; |
1268 | QFile file( fn ); | 1274 | QFile file( fn ); |
1269 | if (!file.open( IO_WriteOnly ) ) { | 1275 | if (!file.open( QIODevice::WriteOnly ) ) { |
1270 | qDebug("KO: Error writing next suspend alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); | 1276 | qDebug("KO: Error writing next suspend alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); |
1271 | } else { | 1277 | } else { |
1272 | QTextStream ts( &file ); | 1278 | Q3TextStream ts( &file ); |
1273 | ts << mess; | 1279 | ts << mess; |
1274 | file.close(); | 1280 | file.close(); |
1275 | } | 1281 | } |
1276 | } | 1282 | } |
1277 | #endif | 1283 | #endif |
1278 | 1284 | ||
@@ -1291,16 +1297,16 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) | |||
1291 | #ifdef DESKTOP_VERSION | 1297 | #ifdef DESKTOP_VERSION |
1292 | if ( QApplication::desktop()->width() < 1024 ) { | 1298 | if ( QApplication::desktop()->width() < 1024 ) { |
1293 | QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; | 1299 | QString mess = qdt.toString( "yyyy-MM-dd hh:mm:ss" ) + "\n" + noti; |
1294 | //qDebug("nextalarm = \n%s ",mess.latin1() ); | 1300 | //qDebug("nextalarm = \n%s ",mess.latin1() ); |
1295 | QString fn = QDir::homeDirPath() + "/.kopi_next_alarm"; | 1301 | QString fn = QDir::homeDirPath() + "/.kopi_next_alarm"; |
1296 | QFile file( fn ); | 1302 | QFile file( fn ); |
1297 | if (!file.open( IO_WriteOnly ) ) { | 1303 | if (!file.open( QIODevice::WriteOnly ) ) { |
1298 | qDebug("KO: Error writing next alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); | 1304 | qDebug("KO: Error writing next alarm file %s\nContent: \n%s ", fn.latin1(), mess.latin1()); |
1299 | } else { | 1305 | } else { |
1300 | QTextStream ts( &file ); | 1306 | Q3TextStream ts( &file ); |
1301 | ts << mess; | 1307 | ts << mess; |
1302 | file.close(); | 1308 | file.close(); |
1303 | } | 1309 | } |
1304 | } | 1310 | } |
1305 | #endif | 1311 | #endif |
1306 | int maxSec; | 1312 | int maxSec; |
@@ -1567,13 +1573,13 @@ Event* CalendarView::getLastSyncEvent() | |||
1567 | return lse; | 1573 | return lse; |
1568 | 1574 | ||
1569 | } | 1575 | } |
1570 | 1576 | ||
1571 | // we check, if the to delete event has a id for a profile | 1577 | // we check, if the to delete event has a id for a profile |
1572 | // if yes, we set this id in the profile to delete | 1578 | // if yes, we set this id in the profile to delete |
1573 | void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) | 1579 | void CalendarView::checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete ) |
1574 | { | 1580 | { |
1575 | if ( lastSync.count() == 0 ) { | 1581 | if ( lastSync.count() == 0 ) { |
1576 | //qDebug(" lastSync.count() == 0"); | 1582 | //qDebug(" lastSync.count() == 0"); |
1577 | return; | 1583 | return; |
1578 | } | 1584 | } |
1579 | if ( toDelete->typeID() == journalID ) | 1585 | if ( toDelete->typeID() == journalID ) |
@@ -1597,13 +1603,13 @@ void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* t | |||
1597 | eve = lastSync.next(); | 1603 | eve = lastSync.next(); |
1598 | } | 1604 | } |
1599 | 1605 | ||
1600 | } | 1606 | } |
1601 | void CalendarView::checkExternalId( Incidence * inc ) | 1607 | void CalendarView::checkExternalId( Incidence * inc ) |
1602 | { | 1608 | { |
1603 | QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; | 1609 | Q3PtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; |
1604 | checkExternSyncEvent( lastSync, inc ); | 1610 | checkExternSyncEvent( lastSync, inc ); |
1605 | 1611 | ||
1606 | } | 1612 | } |
1607 | // SSSSSSSSSSSSSSSSSSSSSS | 1613 | // SSSSSSSSSSSSSSSSSSSSSS |
1608 | bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) | 1614 | bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) |
1609 | { | 1615 | { |
@@ -1621,14 +1627,14 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1621 | Event* eventR; | 1627 | Event* eventR; |
1622 | QString uid; | 1628 | QString uid; |
1623 | int take; | 1629 | int take; |
1624 | Event* eventRSync; | 1630 | Event* eventRSync; |
1625 | Event* eventLSync; | 1631 | Event* eventLSync; |
1626 | clearAllViews(); | 1632 | clearAllViews(); |
1627 | QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); | 1633 | Q3PtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); |
1628 | QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); | 1634 | Q3PtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); |
1629 | bool fullDateRange = false; | 1635 | bool fullDateRange = false; |
1630 | local->resetTempSyncStat(); | 1636 | local->resetTempSyncStat(); |
1631 | mLastCalendarSync = QDateTime::currentDateTime(); | 1637 | mLastCalendarSync = QDateTime::currentDateTime(); |
1632 | if ( mSyncManager->syncWithDesktop() ) { | 1638 | if ( mSyncManager->syncWithDesktop() ) { |
1633 | remote->resetPilotStat(1); | 1639 | remote->resetPilotStat(1); |
1634 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { | 1640 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { |
@@ -1681,16 +1687,16 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1681 | if ( mCurrentSyncDevice == "deleteaftersync" ) { | 1687 | if ( mCurrentSyncDevice == "deleteaftersync" ) { |
1682 | mLastCalendarSync = loadedFileVersion; | 1688 | mLastCalendarSync = loadedFileVersion; |
1683 | //qDebug("setting mLastCalendarSync "); | 1689 | //qDebug("setting mLastCalendarSync "); |
1684 | } | 1690 | } |
1685 | //qDebug("*************************** "); | 1691 | //qDebug("*************************** "); |
1686 | qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); | 1692 | qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); |
1687 | QPtrList<Incidence> er = remote->rawIncidences(); | 1693 | Q3PtrList<Incidence> er = remote->rawIncidences(); |
1688 | Incidence* inR = er.first(); | 1694 | Incidence* inR = er.first(); |
1689 | Incidence* inL; | 1695 | Incidence* inL; |
1690 | QProgressBar bar( er.count(),0 ); | 1696 | Q3ProgressBar bar( er.count(),0 ); |
1691 | bar.setCaption (i18n("Syncing - close to abort!") ); | 1697 | bar.setCaption (i18n("Syncing - close to abort!") ); |
1692 | 1698 | ||
1693 | // ************** setting up filter ************* | 1699 | // ************** setting up filter ************* |
1694 | CalFilter *filterIN = 0; | 1700 | CalFilter *filterIN = 0; |
1695 | CalFilter *filterOUT = 0; | 1701 | CalFilter *filterOUT = 0; |
1696 | CalFilter *filter = mFilters.first(); | 1702 | CalFilter *filter = mFilters.first(); |
@@ -1828,13 +1834,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1828 | ++filteredIN; | 1834 | ++filteredIN; |
1829 | } | 1835 | } |
1830 | } | 1836 | } |
1831 | } | 1837 | } |
1832 | inR = er.next(); | 1838 | inR = er.next(); |
1833 | } | 1839 | } |
1834 | QPtrList<Incidence> el = local->rawIncidences(); | 1840 | Q3PtrList<Incidence> el = local->rawIncidences(); |
1835 | inL = el.first(); | 1841 | inL = el.first(); |
1836 | modulo = (el.count()/10)+1; | 1842 | modulo = (el.count()/10)+1; |
1837 | bar.setCaption (i18n("Add / remove events") ); | 1843 | bar.setCaption (i18n("Add / remove events") ); |
1838 | bar.setTotalSteps ( el.count() ) ; | 1844 | bar.setTotalSteps ( el.count() ) ; |
1839 | bar.show(); | 1845 | bar.show(); |
1840 | incCounter = 0; | 1846 | incCounter = 0; |
@@ -2045,13 +2051,13 @@ void CalendarView::syncExternal( int mode ) | |||
2045 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); | 2051 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); |
2046 | getEventViewerDialog()->setSyncMode( false ); | 2052 | getEventViewerDialog()->setSyncMode( false ); |
2047 | qApp->processEvents(); | 2053 | qApp->processEvents(); |
2048 | if ( syncOK ) { | 2054 | if ( syncOK ) { |
2049 | if ( mSyncManager->mWriteBackFile ) | 2055 | if ( mSyncManager->mWriteBackFile ) |
2050 | { | 2056 | { |
2051 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); | 2057 | Q3PtrList<Incidence> iL = mCalendar->rawIncidences(); |
2052 | Incidence* inc = iL.first(); | 2058 | Incidence* inc = iL.first(); |
2053 | if ( phoneFormat ) { | 2059 | if ( phoneFormat ) { |
2054 | while ( inc ) { | 2060 | while ( inc ) { |
2055 | inc->removeID(mCurrentSyncDevice); | 2061 | inc->removeID(mCurrentSyncDevice); |
2056 | inc = iL.next(); | 2062 | inc = iL.next(); |
2057 | } | 2063 | } |
@@ -2112,13 +2118,13 @@ bool CalendarView::importBday() | |||
2112 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 2118 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
2113 | KABC::AddressBook::Iterator it; | 2119 | KABC::AddressBook::Iterator it; |
2114 | int count = 0; | 2120 | int count = 0; |
2115 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 2121 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
2116 | ++count; | 2122 | ++count; |
2117 | } | 2123 | } |
2118 | QProgressBar bar(count,0 ); | 2124 | Q3ProgressBar bar(count,0 ); |
2119 | int w = 300; | 2125 | int w = 300; |
2120 | if ( QApplication::desktop()->width() < 320 ) | 2126 | if ( QApplication::desktop()->width() < 320 ) |
2121 | w = 220; | 2127 | w = 220; |
2122 | int h = bar.sizeHint().height() ; | 2128 | int h = bar.sizeHint().height() ; |
2123 | int dw = QApplication::desktop()->width(); | 2129 | int dw = QApplication::desktop()->width(); |
2124 | int dh = QApplication::desktop()->height(); | 2130 | int dh = QApplication::desktop()->height(); |
@@ -2183,13 +2189,13 @@ void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthd | |||
2183 | int count = birthdayList.count(); | 2189 | int count = birthdayList.count(); |
2184 | int addCount = 0; | 2190 | int addCount = 0; |
2185 | KCal::Attendee* a = 0; | 2191 | KCal::Attendee* a = 0; |
2186 | 2192 | ||
2187 | //qDebug("CalView 1 %i", count); | 2193 | //qDebug("CalView 1 %i", count); |
2188 | 2194 | ||
2189 | QProgressBar bar(count,0 ); | 2195 | Q3ProgressBar bar(count,0 ); |
2190 | int w = 300; | 2196 | int w = 300; |
2191 | if ( QApplication::desktop()->width() < 320 ) | 2197 | if ( QApplication::desktop()->width() < 320 ) |
2192 | w = 220; | 2198 | w = 220; |
2193 | int h = bar.sizeHint().height() ; | 2199 | int h = bar.sizeHint().height() ; |
2194 | int dw = QApplication::desktop()->width(); | 2200 | int dw = QApplication::desktop()->width(); |
2195 | int dh = QApplication::desktop()->height(); | 2201 | int dh = QApplication::desktop()->height(); |
@@ -2347,13 +2353,13 @@ void CalendarView::setSyncEventsReadOnly() | |||
2347 | { | 2353 | { |
2348 | mCalendar->setSyncEventsReadOnly(); | 2354 | mCalendar->setSyncEventsReadOnly(); |
2349 | } | 2355 | } |
2350 | 2356 | ||
2351 | bool CalendarView::loadCalendars() | 2357 | bool CalendarView::loadCalendars() |
2352 | { | 2358 | { |
2353 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2359 | Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2354 | KopiCalendarFile * cal = calendars.first(); | 2360 | KopiCalendarFile * cal = calendars.first(); |
2355 | mCalendar->setDefaultCalendar( 1 ); | 2361 | mCalendar->setDefaultCalendar( 1 ); |
2356 | openCalendar( MainWindow::defaultFileName(), false ); | 2362 | openCalendar( MainWindow::defaultFileName(), false ); |
2357 | cal = calendars.next(); | 2363 | cal = calendars.next(); |
2358 | while ( cal ) { | 2364 | while ( cal ) { |
2359 | addCalendar( cal ); | 2365 | addCalendar( cal ); |
@@ -2361,13 +2367,13 @@ bool CalendarView::loadCalendars() | |||
2361 | } | 2367 | } |
2362 | restoreCalendarSettings(); | 2368 | restoreCalendarSettings(); |
2363 | return true; | 2369 | return true; |
2364 | } | 2370 | } |
2365 | bool CalendarView::restoreCalendarSettings() | 2371 | bool CalendarView::restoreCalendarSettings() |
2366 | { | 2372 | { |
2367 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2373 | Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2368 | KopiCalendarFile * cal = calendars.first(); | 2374 | KopiCalendarFile * cal = calendars.first(); |
2369 | while ( cal ) { | 2375 | while ( cal ) { |
2370 | mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); | 2376 | mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); |
2371 | mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); | 2377 | mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); |
2372 | mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); | 2378 | mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); |
2373 | if ( cal->isStandard ) | 2379 | if ( cal->isStandard ) |
@@ -2526,13 +2532,13 @@ void CalendarView::watchSavedFile() | |||
2526 | return; | 2532 | return; |
2527 | } | 2533 | } |
2528 | loadedFileVersion = dt; | 2534 | loadedFileVersion = dt; |
2529 | } | 2535 | } |
2530 | bool CalendarView::checkAllFileVersions() | 2536 | bool CalendarView::checkAllFileVersions() |
2531 | { | 2537 | { |
2532 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2538 | Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2533 | KopiCalendarFile * cal = calendars.first(); | 2539 | KopiCalendarFile * cal = calendars.first(); |
2534 | mCalendar->setDefaultCalendar( 1 ); | 2540 | mCalendar->setDefaultCalendar( 1 ); |
2535 | mCalendar->setDefaultCalendarEnabledOnly(); | 2541 | mCalendar->setDefaultCalendarEnabledOnly(); |
2536 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { | 2542 | if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { |
2537 | if ( !checkFileVersion(MainWindow::defaultFileName())) { | 2543 | if ( !checkFileVersion(MainWindow::defaultFileName())) { |
2538 | restoreCalendarSettings(); | 2544 | restoreCalendarSettings(); |
@@ -2588,13 +2594,13 @@ bool CalendarView::checkFileVersion(QString fn) | |||
2588 | if ( e ) | 2594 | if ( e ) |
2589 | mCalendar->deleteEvent( e ); | 2595 | mCalendar->deleteEvent( e ); |
2590 | return true; | 2596 | return true; |
2591 | } | 2597 | } |
2592 | bool CalendarView::saveCalendars() | 2598 | bool CalendarView::saveCalendars() |
2593 | { | 2599 | { |
2594 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2600 | Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2595 | KopiCalendarFile * cal = calendars.first(); | 2601 | KopiCalendarFile * cal = calendars.first(); |
2596 | mCalendar->setDefaultCalendar( 1 ); | 2602 | mCalendar->setDefaultCalendar( 1 ); |
2597 | mCalendar->setDefaultCalendarEnabledOnly(); | 2603 | mCalendar->setDefaultCalendarEnabledOnly(); |
2598 | QString saveError; | 2604 | QString saveError; |
2599 | if ( !saveCalendar( MainWindow::defaultFileName() ) ) | 2605 | if ( !saveCalendar( MainWindow::defaultFileName() ) ) |
2600 | saveError = cal->mName +"\n"; | 2606 | saveError = cal->mName +"\n"; |
@@ -2692,13 +2698,13 @@ void CalendarView::readSettings() | |||
2692 | // read settings from the KConfig, supplying reasonable | 2698 | // read settings from the KConfig, supplying reasonable |
2693 | // defaults where none are to be found | 2699 | // defaults where none are to be found |
2694 | KConfig *config = KOGlobals::config(); | 2700 | KConfig *config = KOGlobals::config(); |
2695 | #ifndef KORG_NOSPLITTER | 2701 | #ifndef KORG_NOSPLITTER |
2696 | config->setGroup("KOrganizer Geometry"); | 2702 | config->setGroup("KOrganizer Geometry"); |
2697 | 2703 | ||
2698 | QValueList<int> sizes = config->readIntListEntry("Separator1"); | 2704 | Q3ValueList<int> sizes = config->readIntListEntry("Separator1"); |
2699 | if (sizes.count() != 2) { | 2705 | if (sizes.count() != 2) { |
2700 | sizes << mDateNavigator->minimumSizeHint().width(); | 2706 | sizes << mDateNavigator->minimumSizeHint().width(); |
2701 | sizes << 300; | 2707 | sizes << 300; |
2702 | } | 2708 | } |
2703 | mPanner->setSizes(sizes); | 2709 | mPanner->setSizes(sizes); |
2704 | 2710 | ||
@@ -2760,13 +2766,13 @@ void CalendarView::readSettings() | |||
2760 | getEventViewerDialog()->setGeometry(x,y,w,h); | 2766 | getEventViewerDialog()->setGeometry(x,y,w,h); |
2761 | } | 2767 | } |
2762 | #endif | 2768 | #endif |
2763 | config->setGroup( "Views" ); | 2769 | config->setGroup( "Views" ); |
2764 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); | 2770 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); |
2765 | 2771 | ||
2766 | QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); | 2772 | Q3ValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); |
2767 | 2773 | ||
2768 | int resetval = 0; | 2774 | int resetval = 0; |
2769 | int maxVal = 0; | 2775 | int maxVal = 0; |
2770 | if (sizes.count() != 3) { | 2776 | if (sizes.count() != 3) { |
2771 | if ( KOPrefs::instance()->mVerticalScreen ) { | 2777 | if ( KOPrefs::instance()->mVerticalScreen ) { |
2772 | resetval = mDateNavigator->sizeHint().width()+2; | 2778 | resetval = mDateNavigator->sizeHint().width()+2; |
@@ -2839,13 +2845,13 @@ void CalendarView::writeSettings() | |||
2839 | //KOPrefs::instance()->usrWriteConfig(); | 2845 | //KOPrefs::instance()->usrWriteConfig(); |
2840 | KOPrefs::instance()->writeConfig(); | 2846 | KOPrefs::instance()->writeConfig(); |
2841 | 2847 | ||
2842 | writeFilterSettings(config); | 2848 | writeFilterSettings(config); |
2843 | config->setGroup( "AppRun" ); | 2849 | config->setGroup( "AppRun" ); |
2844 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); | 2850 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); |
2845 | int days = dt.daysTo( QDate::currentDate() ); | 2851 | int days = dt.daysTo( (QDateTime)QDate::currentDate() ); |
2846 | dt = dt.addDays( days ); | 2852 | dt = dt.addDays( days ); |
2847 | int secs = dt.secsTo( QDateTime::currentDateTime() ); | 2853 | int secs = dt.secsTo( QDateTime::currentDateTime() ); |
2848 | config->writeEntry( "LatestProgramStopDays", days ); | 2854 | config->writeEntry( "LatestProgramStopDays", days ); |
2849 | config->writeEntry( "LatestProgramStopSecs", secs ); | 2855 | config->writeEntry( "LatestProgramStopSecs", secs ); |
2850 | //qDebug("KO: Writing stop time: %d ", secs); | 2856 | //qDebug("KO: Writing stop time: %d ", secs); |
2851 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); | 2857 | //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); |
@@ -2866,15 +2872,15 @@ void CalendarView::writeSettings() | |||
2866 | qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); | 2872 | qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); |
2867 | qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); | 2873 | qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); |
2868 | qDebug("********************* testcode end"); | 2874 | qDebug("********************* testcode end"); |
2869 | 2875 | ||
2870 | #endif | 2876 | #endif |
2871 | 2877 | ||
2872 | QValueList<int> listINT = mLeftFrame->sizes(); | 2878 | Q3ValueList<int> listINT = mLeftFrame->sizes(); |
2873 | config->writeEntry("Left Splitter Frame",listINT); | 2879 | config->writeEntry("Left Splitter Frame",listINT); |
2874 | QValueList<int> listINT2 = mMainFrame->sizes(); | 2880 | Q3ValueList<int> listINT2 = mMainFrame->sizes(); |
2875 | config->writeEntry("Main Splitter Frame",listINT2); | 2881 | config->writeEntry("Main Splitter Frame",listINT2); |
2876 | #ifdef DESKTOP_VERSION | 2882 | #ifdef DESKTOP_VERSION |
2877 | config->setGroup("WidgetLayout"); | 2883 | config->setGroup("WidgetLayout"); |
2878 | QStringList list ;//= config->readListEntry("MainLayout"); | 2884 | QStringList list ;//= config->readListEntry("MainLayout"); |
2879 | int x,y,w,h; | 2885 | int x,y,w,h; |
2880 | QWidget* wid; | 2886 | QWidget* wid; |
@@ -3163,13 +3169,13 @@ void CalendarView::checkConflictForEvent() | |||
3163 | } | 3169 | } |
3164 | if ( filterIN ) { | 3170 | if ( filterIN ) { |
3165 | if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { | 3171 | if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { |
3166 | return; | 3172 | return; |
3167 | } | 3173 | } |
3168 | } | 3174 | } |
3169 | QPtrList<Event> testlist = mCalendar->events(); | 3175 | Q3PtrList<Event> testlist = mCalendar->events(); |
3170 | Event * test = testlist.first(); | 3176 | Event * test = testlist.first(); |
3171 | QDateTime conflict; | 3177 | QDateTime conflict; |
3172 | QDateTime retVal; | 3178 | QDateTime retVal; |
3173 | bool found = false; | 3179 | bool found = false; |
3174 | Event * cE = 0; | 3180 | Event * cE = 0; |
3175 | bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; | 3181 | bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; |
@@ -3425,13 +3431,13 @@ void CalendarView::slotSelectPickerDate( QDate d) | |||
3425 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); | 3431 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); |
3426 | } | 3432 | } |
3427 | } | 3433 | } |
3428 | 3434 | ||
3429 | void CalendarView::removeCategories() | 3435 | void CalendarView::removeCategories() |
3430 | { | 3436 | { |
3431 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 3437 | Q3PtrList<Incidence> incList = mCalendar->rawIncidences(); |
3432 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 3438 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
3433 | QStringList catIncList; | 3439 | QStringList catIncList; |
3434 | QStringList newCatList; | 3440 | QStringList newCatList; |
3435 | Incidence* inc = incList.first(); | 3441 | Incidence* inc = incList.first(); |
3436 | uint i; | 3442 | uint i; |
3437 | while ( inc ) { | 3443 | while ( inc ) { |
@@ -3446,13 +3452,13 @@ void CalendarView::removeCategories() | |||
3446 | inc = incList.next(); | 3452 | inc = incList.next(); |
3447 | } | 3453 | } |
3448 | } | 3454 | } |
3449 | 3455 | ||
3450 | int CalendarView::addCategories() | 3456 | int CalendarView::addCategories() |
3451 | { | 3457 | { |
3452 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 3458 | Q3PtrList<Incidence> incList = mCalendar->rawIncidences(); |
3453 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 3459 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
3454 | QStringList catIncList; | 3460 | QStringList catIncList; |
3455 | Incidence* inc = incList.first(); | 3461 | Incidence* inc = incList.first(); |
3456 | uint i; | 3462 | uint i; |
3457 | int count = 0; | 3463 | int count = 0; |
3458 | while ( inc ) { | 3464 | while ( inc ) { |
@@ -3504,29 +3510,29 @@ void CalendarView::manageCategories() | |||
3504 | } | 3510 | } |
3505 | delete cp; | 3511 | delete cp; |
3506 | } | 3512 | } |
3507 | 3513 | ||
3508 | void CalendarView::beamIncidence(Incidence * Inc) | 3514 | void CalendarView::beamIncidence(Incidence * Inc) |
3509 | { | 3515 | { |
3510 | QPtrList<Incidence> delSel ; | 3516 | Q3PtrList<Incidence> delSel ; |
3511 | delSel.append(Inc); | 3517 | delSel.append(Inc); |
3512 | beamIncidenceList( delSel ); | 3518 | beamIncidenceList( delSel ); |
3513 | } | 3519 | } |
3514 | void CalendarView::beamCalendar() | 3520 | void CalendarView::beamCalendar() |
3515 | { | 3521 | { |
3516 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); | 3522 | Q3PtrList<Incidence> delSel = mCalendar->rawIncidences(); |
3517 | //qDebug("beamCalendar() "); | 3523 | //qDebug("beamCalendar() "); |
3518 | beamIncidenceList( delSel ); | 3524 | beamIncidenceList( delSel ); |
3519 | } | 3525 | } |
3520 | void CalendarView::beamFilteredCalendar() | 3526 | void CalendarView::beamFilteredCalendar() |
3521 | { | 3527 | { |
3522 | QPtrList<Incidence> delSel = mCalendar->incidences(); | 3528 | Q3PtrList<Incidence> delSel = mCalendar->incidences(); |
3523 | //qDebug("beamFilteredCalendar() "); | 3529 | //qDebug("beamFilteredCalendar() "); |
3524 | beamIncidenceList( delSel ); | 3530 | beamIncidenceList( delSel ); |
3525 | } | 3531 | } |
3526 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | 3532 | void CalendarView::beamIncidenceList(Q3PtrList<Incidence> delSel ) |
3527 | { | 3533 | { |
3528 | 3534 | ||
3529 | KOBeamPrefs beamDialog; | 3535 | KOBeamPrefs beamDialog; |
3530 | if ( beamDialog.exec () == QDialog::Rejected ) | 3536 | if ( beamDialog.exec () == QDialog::Rejected ) |
3531 | return; | 3537 | return; |
3532 | #ifdef DESKTOP_VERSION | 3538 | #ifdef DESKTOP_VERSION |
@@ -4312,13 +4318,13 @@ void CalendarView::schedule_publish(Incidence *incidence) | |||
4312 | KMessageBox::sorry(this,i18n("No event selected.")); | 4318 | KMessageBox::sorry(this,i18n("No event selected.")); |
4313 | return; | 4319 | return; |
4314 | } | 4320 | } |
4315 | 4321 | ||
4316 | PublishDialog *publishdlg = new PublishDialog(); | 4322 | PublishDialog *publishdlg = new PublishDialog(); |
4317 | if (incidence->attendeeCount()>0) { | 4323 | if (incidence->attendeeCount()>0) { |
4318 | QPtrList<Attendee> attendees = incidence->attendees(); | 4324 | Q3PtrList<Attendee> attendees = incidence->attendees(); |
4319 | attendees.first(); | 4325 | attendees.first(); |
4320 | while ( attendees.current()!=0 ) { | 4326 | while ( attendees.current()!=0 ) { |
4321 | publishdlg->addAttendee(attendees.current()); | 4327 | publishdlg->addAttendee(attendees.current()); |
4322 | attendees.next(); | 4328 | attendees.next(); |
4323 | } | 4329 | } |
4324 | } | 4330 | } |
@@ -4721,13 +4727,13 @@ void CalendarView::showDates(const DateList &selectedDates) | |||
4721 | } | 4727 | } |
4722 | } | 4728 | } |
4723 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); | 4729 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); |
4724 | 4730 | ||
4725 | } | 4731 | } |
4726 | 4732 | ||
4727 | QPtrList<CalFilter> CalendarView::filters() | 4733 | Q3PtrList<CalFilter> CalendarView::filters() |
4728 | { | 4734 | { |
4729 | return mFilters; | 4735 | return mFilters; |
4730 | 4736 | ||
4731 | } | 4737 | } |
4732 | void CalendarView::editFilters() | 4738 | void CalendarView::editFilters() |
4733 | { | 4739 | { |
@@ -4762,13 +4768,13 @@ void CalendarView::selectFilter( int fil ) | |||
4762 | void CalendarView::showFilter(bool visible) | 4768 | void CalendarView::showFilter(bool visible) |
4763 | { | 4769 | { |
4764 | #if 1 | 4770 | #if 1 |
4765 | if (visible) { | 4771 | if (visible) { |
4766 | mCalEditView->readConfig(); | 4772 | mCalEditView->readConfig(); |
4767 | mCalEditView->show(); | 4773 | mCalEditView->show(); |
4768 | QValueList<int> sizes; | 4774 | Q3ValueList<int> sizes; |
4769 | sizes = mLeftFrame->sizes(); | 4775 | sizes = mLeftFrame->sizes(); |
4770 | if ( sizes.count() == 4 && sizes[3] < 20 ) { | 4776 | if ( sizes.count() == 4 && sizes[3] < 20 ) { |
4771 | sizes.clear(); | 4777 | sizes.clear(); |
4772 | sizes << 100; | 4778 | sizes << 100; |
4773 | sizes << 0; | 4779 | sizes << 0; |
4774 | sizes << 0; | 4780 | sizes << 0; |
@@ -4843,27 +4849,27 @@ void CalendarView::takeOverEvent() | |||
4843 | 4849 | ||
4844 | void CalendarView::takeOverCalendar() | 4850 | void CalendarView::takeOverCalendar() |
4845 | { | 4851 | { |
4846 | // TODO: Create Calendar::allIncidences() function and use it here | 4852 | // TODO: Create Calendar::allIncidences() function and use it here |
4847 | 4853 | ||
4848 | clearAllViews(); | 4854 | clearAllViews(); |
4849 | QPtrList<Event> events = mCalendar->events(); | 4855 | Q3PtrList<Event> events = mCalendar->events(); |
4850 | for(uint i=0; i<events.count(); ++i) { | 4856 | for(uint i=0; i<events.count(); ++i) { |
4851 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); | 4857 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); |
4852 | events.at(i)->recreate(); | 4858 | events.at(i)->recreate(); |
4853 | events.at(i)->setReadOnly(false); | 4859 | events.at(i)->setReadOnly(false); |
4854 | } | 4860 | } |
4855 | 4861 | ||
4856 | QPtrList<Todo> todos = mCalendar->todos(); | 4862 | Q3PtrList<Todo> todos = mCalendar->todos(); |
4857 | for(uint i=0; i<todos.count(); ++i) { | 4863 | for(uint i=0; i<todos.count(); ++i) { |
4858 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); | 4864 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); |
4859 | todos.at(i)->recreate(); | 4865 | todos.at(i)->recreate(); |
4860 | todos.at(i)->setReadOnly(false); | 4866 | todos.at(i)->setReadOnly(false); |
4861 | } | 4867 | } |
4862 | 4868 | ||
4863 | QPtrList<Journal> journals = mCalendar->journals(); | 4869 | Q3PtrList<Journal> journals = mCalendar->journals(); |
4864 | for(uint i=0; i<journals.count(); ++i) { | 4870 | for(uint i=0; i<journals.count(); ++i) { |
4865 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); | 4871 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); |
4866 | journals.at(i)->recreate(); | 4872 | journals.at(i)->recreate(); |
4867 | journals.at(i)->setReadOnly(false); | 4873 | journals.at(i)->setReadOnly(false); |
4868 | } | 4874 | } |
4869 | 4875 | ||
@@ -4872,13 +4878,13 @@ void CalendarView::takeOverCalendar() | |||
4872 | 4878 | ||
4873 | void CalendarView::showIntro() | 4879 | void CalendarView::showIntro() |
4874 | { | 4880 | { |
4875 | kdDebug() << "To be implemented." << endl; | 4881 | kdDebug() << "To be implemented." << endl; |
4876 | } | 4882 | } |
4877 | 4883 | ||
4878 | QWidgetStack *CalendarView::viewStack() | 4884 | Q3WidgetStack *CalendarView::viewStack() |
4879 | { | 4885 | { |
4880 | return mRightFrame; | 4886 | return mRightFrame; |
4881 | } | 4887 | } |
4882 | 4888 | ||
4883 | QWidget *CalendarView::leftFrame() | 4889 | QWidget *CalendarView::leftFrame() |
4884 | { | 4890 | { |
@@ -5057,13 +5063,13 @@ void CalendarView::lookForIncomingMessages() | |||
5057 | icd->retrieve(); | 5063 | icd->retrieve(); |
5058 | } | 5064 | } |
5059 | 5065 | ||
5060 | bool CalendarView::removeCompletedSubTodos( Todo* t ) | 5066 | bool CalendarView::removeCompletedSubTodos( Todo* t ) |
5061 | { | 5067 | { |
5062 | bool deleteTodo = true; | 5068 | bool deleteTodo = true; |
5063 | QPtrList<Incidence> subTodos; | 5069 | Q3PtrList<Incidence> subTodos; |
5064 | Incidence *aTodo; | 5070 | Incidence *aTodo; |
5065 | subTodos = t->relations(); | 5071 | subTodos = t->relations(); |
5066 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { | 5072 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { |
5067 | if (! removeCompletedSubTodos( (Todo*) aTodo )) | 5073 | if (! removeCompletedSubTodos( (Todo*) aTodo )) |
5068 | deleteTodo = false; | 5074 | deleteTodo = false; |
5069 | } | 5075 | } |
@@ -5083,14 +5089,14 @@ void CalendarView::purgeCompleted() | |||
5083 | { | 5089 | { |
5084 | int result = KMessageBox::warningContinueCancel(this, | 5090 | int result = KMessageBox::warningContinueCancel(this, |
5085 | i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); | 5091 | i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); |
5086 | 5092 | ||
5087 | if (result == KMessageBox::Continue) { | 5093 | if (result == KMessageBox::Continue) { |
5088 | 5094 | ||
5089 | QPtrList<Todo> todoCal; | 5095 | Q3PtrList<Todo> todoCal; |
5090 | QPtrList<Todo> rootTodos; | 5096 | Q3PtrList<Todo> rootTodos; |
5091 | //QPtrList<Incidence> rel; | 5097 | //QPtrList<Incidence> rel; |
5092 | Todo *aTodo; | 5098 | Todo *aTodo; |
5093 | todoCal = calendar()->todos(); | 5099 | todoCal = calendar()->todos(); |
5094 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { | 5100 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { |
5095 | if ( !aTodo->relatedTo() ) | 5101 | if ( !aTodo->relatedTo() ) |
5096 | rootTodos.append( aTodo ); | 5102 | rootTodos.append( aTodo ); |