106 files changed, 2091 insertions, 1688 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 ); |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 60b1276..b4eada7 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -21,19 +21,21 @@ | |||
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef CALENDARVIEW_H | 24 | #ifndef CALENDARVIEW_H |
25 | #define CALENDARVIEW_H | 25 | #define CALENDARVIEW_H |
26 | 26 | ||
27 | #include <qframe.h> | 27 | #include <q3frame.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | #include <qptrlist.h> | 30 | #include <q3ptrlist.h> |
31 | #include <qvbox.h> | 31 | #include <q3vbox.h> |
32 | #include <qmap.h> | 32 | #include <qmap.h> |
33 | #include <qscrollbar.h> | 33 | #include <qscrollbar.h> |
34 | //Added by qt3to4: | ||
35 | #include <QKeyEvent> | ||
34 | #ifndef DESKTOP_VERSION | 36 | #ifndef DESKTOP_VERSION |
35 | #include <qtopia/ir.h> | 37 | #include <qtopia/ir.h> |
36 | #else | 38 | #else |
37 | #define Ir char | 39 | #define Ir char |
38 | #endif | 40 | #endif |
39 | #include <libkcal/calendar.h> | 41 | #include <libkcal/calendar.h> |
@@ -44,13 +46,13 @@ | |||
44 | 46 | ||
45 | #include <korganizer/calendarviewbase.h> | 47 | #include <korganizer/calendarviewbase.h> |
46 | 48 | ||
47 | #include <ksyncmanager.h> | 49 | #include <ksyncmanager.h> |
48 | //#include <koprefs.h> | 50 | //#include <koprefs.h> |
49 | 51 | ||
50 | class QWidgetStack; | 52 | class Q3WidgetStack; |
51 | class QSplitter; | 53 | class QSplitter; |
52 | class KopiCalendarFile; | 54 | class KopiCalendarFile; |
53 | class CalPrinter; | 55 | class CalPrinter; |
54 | class KOFilterView; | 56 | class KOFilterView; |
55 | class KOCalEditView; | 57 | class KOCalEditView; |
56 | class KOViewManager; | 58 | class KOViewManager; |
@@ -81,25 +83,25 @@ using namespace KCal; | |||
81 | event editor, search dialog etc. | 83 | event editor, search dialog etc. |
82 | 84 | ||
83 | @short main calendar view widget | 85 | @short main calendar view widget |
84 | @author Cornelius Schumacher | 86 | @author Cornelius Schumacher |
85 | */ | 87 | */ |
86 | 88 | ||
87 | #include <qtextbrowser.h> | 89 | #include <q3textbrowser.h> |
88 | #include <qtextcodec.h> | 90 | #include <qtextcodec.h> |
89 | 91 | ||
90 | class MissedAlarmTextBrowser : public QTextBrowser { | 92 | class MissedAlarmTextBrowser : public Q3TextBrowser { |
91 | Q_OBJECT | 93 | Q_OBJECT |
92 | public: | 94 | public: |
93 | MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start); | 95 | MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms ,QDateTime start); |
94 | ~MissedAlarmTextBrowser(); | 96 | ~MissedAlarmTextBrowser(); |
95 | void setSource(const QString & n); | 97 | void setSource(const QString & n); |
96 | 98 | ||
97 | private: | 99 | private: |
98 | Incidence * getNextInc(QDateTime start ); | 100 | Incidence * getNextInc(QDateTime start ); |
99 | QPtrList<Incidence> mAlarms; | 101 | Q3PtrList<Incidence> mAlarms; |
100 | signals: | 102 | signals: |
101 | void showIncidence( QString uid); | 103 | void showIncidence( QString uid); |
102 | }; | 104 | }; |
103 | 105 | ||
104 | 106 | ||
105 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface | 107 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface |
@@ -124,13 +126,13 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
124 | KOViewManager *viewManager(); | 126 | KOViewManager *viewManager(); |
125 | KODialogManager *dialogManager(); | 127 | KODialogManager *dialogManager(); |
126 | 128 | ||
127 | QDate startDate(); | 129 | QDate startDate(); |
128 | QDate endDate(); | 130 | QDate endDate(); |
129 | 131 | ||
130 | QWidgetStack *viewStack(); | 132 | Q3WidgetStack *viewStack(); |
131 | QWidget *leftFrame(); | 133 | QWidget *leftFrame(); |
132 | 134 | ||
133 | DateNavigator *dateNavigator(); | 135 | DateNavigator *dateNavigator(); |
134 | KDateNavigator *dateNavigatorWidget(); | 136 | KDateNavigator *dateNavigatorWidget(); |
135 | 137 | ||
136 | void addView(KOrg::BaseView *); | 138 | void addView(KOrg::BaseView *); |
@@ -438,13 +440,13 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
438 | void schedule_publish_freebusy(int daysToPublish = 30); | 440 | void schedule_publish_freebusy(int daysToPublish = 30); |
439 | 441 | ||
440 | void openAddressbook(); | 442 | void openAddressbook(); |
441 | 443 | ||
442 | void editFilters(); | 444 | void editFilters(); |
443 | void toggleFilerEnabled(); | 445 | void toggleFilerEnabled(); |
444 | QPtrList<CalFilter> filters(); | 446 | Q3PtrList<CalFilter> filters(); |
445 | void toggleFilter(); | 447 | void toggleFilter(); |
446 | void showFilter(bool visible); | 448 | void showFilter(bool visible); |
447 | void updateFilter(); | 449 | void updateFilter(); |
448 | void filterEdited(); | 450 | void filterEdited(); |
449 | void selectFilter( int ); | 451 | void selectFilter( int ); |
450 | KOFilterView *filterView(); | 452 | KOFilterView *filterView(); |
@@ -492,13 +494,13 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
492 | void showDatePicker() ; | 494 | void showDatePicker() ; |
493 | void showDatePickerPopup() ; | 495 | void showDatePickerPopup() ; |
494 | void moveIncidence(Incidence *) ; | 496 | void moveIncidence(Incidence *) ; |
495 | void beamIncidence(Incidence *) ; | 497 | void beamIncidence(Incidence *) ; |
496 | void beamCalendar() ; | 498 | void beamCalendar() ; |
497 | void beamFilteredCalendar() ; | 499 | void beamFilteredCalendar() ; |
498 | void beamIncidenceList(QPtrList<Incidence>) ; | 500 | void beamIncidenceList(Q3PtrList<Incidence>) ; |
499 | void manageCategories(); | 501 | void manageCategories(); |
500 | void editCategories(); | 502 | void editCategories(); |
501 | int addCategories(); | 503 | int addCategories(); |
502 | void removeCategories(); | 504 | void removeCategories(); |
503 | void setSyncDevice( QString ); | 505 | void setSyncDevice( QString ); |
504 | void setSyncName( QString ); | 506 | void setSyncName( QString ); |
@@ -572,13 +574,13 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
572 | QTimer* mRecheckAlarmTimer; | 574 | QTimer* mRecheckAlarmTimer; |
573 | void computeAlarm( QString ); | 575 | void computeAlarm( QString ); |
574 | void startAlarm( QString, QString ); | 576 | void startAlarm( QString, QString ); |
575 | void setSyncEventsReadOnly(); | 577 | void setSyncEventsReadOnly(); |
576 | 578 | ||
577 | QDateTime loadedFileVersion; | 579 | QDateTime loadedFileVersion; |
578 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); | 580 | void checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete ); |
579 | void checkExternalId( Incidence * inc ); | 581 | void checkExternalId( Incidence * inc ); |
580 | int mGlobalSyncMode; | 582 | int mGlobalSyncMode; |
581 | QString mCurrentSyncDevice; | 583 | QString mCurrentSyncDevice; |
582 | QString mCurrentSyncName; | 584 | QString mCurrentSyncName; |
583 | void init(); | 585 | void init(); |
584 | int mDatePickerMode; | 586 | int mDatePickerMode; |
@@ -590,16 +592,16 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
590 | 592 | ||
591 | CalPrinter *mCalPrinter; | 593 | CalPrinter *mCalPrinter; |
592 | 594 | ||
593 | QSplitter *mPanner; | 595 | QSplitter *mPanner; |
594 | QSplitter *mLeftSplitter; | 596 | QSplitter *mLeftSplitter; |
595 | KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; | 597 | KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; |
596 | QWidgetStack *mRightFrame; | 598 | Q3WidgetStack *mRightFrame; |
597 | 599 | ||
598 | KDatePicker* mDatePicker; | 600 | KDatePicker* mDatePicker; |
599 | QVBox* mDateFrame; | 601 | Q3VBox* mDateFrame; |
600 | 602 | ||
601 | DateNavigatorContainer *mDateNavigator; // widget showing small month view. | 603 | DateNavigatorContainer *mDateNavigator; // widget showing small month view. |
602 | 604 | ||
603 | KOFilterView *mFilterView; | 605 | KOFilterView *mFilterView; |
604 | KOCalEditView *mCalEditView; | 606 | KOCalEditView *mCalEditView; |
605 | 607 | ||
@@ -615,13 +617,13 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
615 | DateNavigator *mNavigator; | 617 | DateNavigator *mNavigator; |
616 | 618 | ||
617 | KOViewManager *mViewManager; | 619 | KOViewManager *mViewManager; |
618 | KODialogManager *mDialogManager; | 620 | KODialogManager *mDialogManager; |
619 | 621 | ||
620 | // Calendar filters | 622 | // Calendar filters |
621 | QPtrList<CalFilter> mFilters; | 623 | Q3PtrList<CalFilter> mFilters; |
622 | 624 | ||
623 | // various housekeeping variables. | 625 | // various housekeeping variables. |
624 | bool mModified; // flag indicating if calendar is modified | 626 | bool mModified; // flag indicating if calendar is modified |
625 | bool mReadOnly; // flag indicating if calendar is read-only | 627 | bool mReadOnly; // flag indicating if calendar is read-only |
626 | QDate mSaveSingleDate; | 628 | QDate mSaveSingleDate; |
627 | 629 | ||
diff --git a/korganizer/calprintbase.cpp b/korganizer/calprintbase.cpp index 7b7d54c..ecb9e03 100644 --- a/korganizer/calprintbase.cpp +++ b/korganizer/calprintbase.cpp | |||
@@ -22,17 +22,19 @@ | |||
22 | with any edition of Qt, and distribute the resulting executable, | 22 | with any edition of Qt, and distribute the resulting executable, |
23 | without including the source code for Qt in the source distribution. | 23 | without including the source code for Qt in the source distribution. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qframe.h> | 28 | #include <q3frame.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qptrlist.h> | 30 | #include <q3ptrlist.h> |
31 | #include <qintdict.h> | 31 | #include <q3intdict.h> |
32 | #include <qfontmetrics.h> | 32 | #include <qfontmetrics.h> |
33 | //Added by qt3to4: | ||
34 | #include <Q3VBoxLayout> | ||
33 | 35 | ||
34 | #include <kglobal.h> | 36 | #include <kglobal.h> |
35 | #include <klocale.h> | 37 | #include <klocale.h> |
36 | #include <kdebug.h> | 38 | #include <kdebug.h> |
37 | #include <kconfig.h> | 39 | #include <kconfig.h> |
38 | #include <kcalendarsystem.h> | 40 | #include <kcalendarsystem.h> |
@@ -142,14 +144,14 @@ CalPrintBase::~CalPrintBase() | |||
142 | } | 144 | } |
143 | 145 | ||
144 | 146 | ||
145 | 147 | ||
146 | QWidget *CalPrintBase::configWidget( QWidget *w ) | 148 | QWidget *CalPrintBase::configWidget( QWidget *w ) |
147 | { | 149 | { |
148 | QFrame *wdg = new QFrame( w ); | 150 | Q3Frame *wdg = new Q3Frame( w ); |
149 | QVBoxLayout *layout = new QVBoxLayout( wdg ); | 151 | Q3VBoxLayout *layout = new Q3VBoxLayout( wdg ); |
150 | 152 | ||
151 | QLabel *title = new QLabel( description(), wdg ); | 153 | QLabel *title = new QLabel( description(), wdg ); |
152 | QFont titleFont( title->font() ); | 154 | QFont titleFont( title->font() ); |
153 | titleFont.setPointSize( 20 ); | 155 | titleFont.setPointSize( 20 ); |
154 | titleFont.setBold( true ); | 156 | titleFont.setBold( true ); |
155 | title->setFont( titleFont ); | 157 | title->setFont( titleFont ); |
@@ -282,13 +284,13 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, | |||
282 | int month = monthDate.month(); | 284 | int month = monthDate.month(); |
283 | 285 | ||
284 | // draw the title | 286 | // draw the title |
285 | p.setFont(QFont("helvetica", 7, QFont::Bold)); | 287 | p.setFont(QFont("helvetica", 7, QFont::Bold)); |
286 | // int lineSpacing = p.fontMetrics().lineSpacing(); | 288 | // int lineSpacing = p.fontMetrics().lineSpacing(); |
287 | const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); | 289 | const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); |
288 | p.drawText(x, y, width, height/4, AlignCenter, calSys->monthName( qd ) ); | 290 | p.drawText(x, y, width, height/4, Qt::AlignCenter, calSys->monthName( qd ) ); |
289 | 291 | ||
290 | int cellWidth = width/7; | 292 | int cellWidth = width/7; |
291 | int cellHeight = height/8; | 293 | int cellHeight = height/8; |
292 | QString tmpStr; | 294 | QString tmpStr; |
293 | 295 | ||
294 | // correct begin of week | 296 | // correct begin of week |
@@ -298,13 +300,13 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, | |||
298 | // draw days of week | 300 | // draw days of week |
299 | p.setFont(QFont("helvetica", 7, QFont::Bold)); | 301 | p.setFont(QFont("helvetica", 7, QFont::Bold)); |
300 | for (int col = 0; col < 7; col++) { | 302 | for (int col = 0; col < 7; col++) { |
301 | // tmpStr.sprintf("%c",(const char*)monthDate2.dayName(monthDate2.dayOfWeek())); | 303 | // tmpStr.sprintf("%c",(const char*)monthDate2.dayName(monthDate2.dayOfWeek())); |
302 | tmpStr=calSys->weekDayName( monthDate2 )[0].upper(); | 304 | tmpStr=calSys->weekDayName( monthDate2 )[0].upper(); |
303 | p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight, | 305 | p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight, |
304 | AlignCenter, tmpStr); | 306 | Qt::AlignCenter, tmpStr); |
305 | monthDate2 = monthDate2.addDays(1); | 307 | monthDate2 = monthDate2.addDays(1); |
306 | } | 308 | } |
307 | 309 | ||
308 | // draw separator line | 310 | // draw separator line |
309 | p.drawLine(x, y+height/4+cellHeight, x+width, y+height/4+cellHeight); | 311 | p.drawLine(x, y+height/4+cellHeight, x+width, y+height/4+cellHeight); |
310 | 312 | ||
@@ -315,13 +317,13 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, | |||
315 | if (firstCol) { | 317 | if (firstCol) { |
316 | firstCol = true; | 318 | firstCol = true; |
317 | col = weekdayColumn( monthDate.dayOfWeek() ); | 319 | col = weekdayColumn( monthDate.dayOfWeek() ); |
318 | } | 320 | } |
319 | p.drawText( x+col*cellWidth, | 321 | p.drawText( x+col*cellWidth, |
320 | y+height/4+cellHeight+(row*cellHeight), | 322 | y+height/4+cellHeight+(row*cellHeight), |
321 | cellWidth, cellHeight, AlignCenter, | 323 | cellWidth, cellHeight, Qt::AlignCenter, |
322 | tmpStr.setNum(monthDate.day()) ); | 324 | tmpStr.setNum(monthDate.day()) ); |
323 | monthDate = monthDate.addDays(1); | 325 | monthDate = monthDate.addDays(1); |
324 | } | 326 | } |
325 | } | 327 | } |
326 | } | 328 | } |
327 | 329 | ||
@@ -355,13 +357,13 @@ void CalPrintBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd, | |||
355 | 357 | ||
356 | p.setFont( QFont( "helvetica", 10, QFont::Bold ) ); | 358 | p.setFont( QFont( "helvetica", 10, QFont::Bold ) ); |
357 | p.drawRect( x, y, width, height ); | 359 | p.drawRect( x, y, width, height ); |
358 | // p.fillRect( x+1, y+1, | 360 | // p.fillRect( x+1, y+1, |
359 | // width-2, height-2, | 361 | // width-2, height-2, |
360 | // QBrush( Dense7Pattern ) ); | 362 | // QBrush( Dense7Pattern ) ); |
361 | p.drawText( x+5, y, width-10, height, AlignCenter | AlignVCenter, | 363 | p.drawText( x+5, y, width-10, height, Qt::AlignCenter | Qt::AlignVCenter, |
362 | calSys->weekDayName( qd ) ); | 364 | calSys->weekDayName( qd ) ); |
363 | } | 365 | } |
364 | 366 | ||
365 | 367 | ||
366 | void CalPrintBase::drawTimeLine(QPainter &p, | 368 | void CalPrintBase::drawTimeLine(QPainter &p, |
367 | const QTime &fromTime, const QTime &toTime, | 369 | const QTime &fromTime, const QTime &toTime, |
@@ -398,22 +400,22 @@ void CalPrintBase::drawTimeLine(QPainter &p, | |||
398 | if (cellHeight > 30) { | 400 | if (cellHeight > 30) { |
399 | p.setFont(QFont("helvetica", 16, QFont::Bold)); | 401 | p.setFont(QFont("helvetica", 16, QFont::Bold)); |
400 | } else { | 402 | } else { |
401 | p.setFont(QFont("helvetica", 12, QFont::Bold)); | 403 | p.setFont(QFont("helvetica", 12, QFont::Bold)); |
402 | } | 404 | } |
403 | p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight, | 405 | p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight, |
404 | AlignTop|AlignRight, numStr); | 406 | Qt::AlignTop|Qt::AlignRight, numStr); |
405 | p.setFont(QFont("helvetica", 10, QFont::Normal)); | 407 | p.setFont(QFont("helvetica", 10, QFont::Normal)); |
406 | p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3, | 408 | p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3, |
407 | AlignTop | AlignLeft, "00"); | 409 | Qt::AlignTop | Qt::AlignLeft, "00"); |
408 | } else { | 410 | } else { |
409 | QTime time( curTime.hour(), 0 ); | 411 | QTime time( curTime.hour(), 0 ); |
410 | numStr = KGlobal::locale()->formatTime( time ); | 412 | numStr = KGlobal::locale()->formatTime( time ); |
411 | p.setFont(QFont("helvetica", 14, QFont::Bold)); | 413 | p.setFont(QFont("helvetica", 14, QFont::Bold)); |
412 | p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3, | 414 | p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3, |
413 | AlignTop|AlignLeft, numStr); | 415 | Qt::AlignTop|Qt::AlignLeft, numStr); |
414 | } | 416 | } |
415 | currY+=cellHeight; | 417 | currY+=cellHeight; |
416 | } // enough space for half-hour line and time | 418 | } // enough space for half-hour line and time |
417 | if (curTime.secsTo(endTime)>3600) | 419 | if (curTime.secsTo(endTime)>3600) |
418 | curTime=curTime.addSecs(3600); | 420 | curTime=curTime.addSecs(3600); |
419 | else curTime=endTime; | 421 | else curTime=endTime; |
@@ -469,13 +471,13 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList, | |||
469 | if (mUseColors) | 471 | if (mUseColors) |
470 | setCategoryColors(p, currEvent); | 472 | setCategoryColors(p, currEvent); |
471 | 473 | ||
472 | p.drawRect( x, offset, width, height ); | 474 | p.drawRect( x, offset, width, height ); |
473 | 475 | ||
474 | p.drawText( x+5, offset+5, width-10, height-10, | 476 | p.drawText( x+5, offset+5, width-10, height-10, |
475 | AlignCenter | AlignVCenter | AlignJustify | WordBreak, | 477 | Qt::AlignCenter | Qt::AlignVCenter | Qt::AlignJustify | Qt::WordBreak, |
476 | text ); | 478 | text ); |
477 | // reset the colors | 479 | // reset the colors |
478 | p.setBrush( oldBrush ); | 480 | p.setBrush( oldBrush ); |
479 | p.setPen( oldPen ); | 481 | p.setPen( oldPen ); |
480 | p.setBackgroundColor(oldBgColor); | 482 | p.setBackgroundColor(oldBgColor); |
481 | 483 | ||
@@ -490,13 +492,13 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList, | |||
490 | 492 | ||
491 | if (!expandable) { | 493 | if (!expandable) { |
492 | p.drawRect(x, offset, width, height); | 494 | p.drawRect(x, offset, width, height); |
493 | if (!multiDayStr.isEmpty()) { | 495 | if (!multiDayStr.isEmpty()) { |
494 | // p.fillRect(x+1, offset+1, width-2, height-2, QBrush(Dense5Pattern) ); | 496 | // p.fillRect(x+1, offset+1, width-2, height-2, QBrush(Dense5Pattern) ); |
495 | p.drawText( x+5, offset+5, width-10, height-10, | 497 | p.drawText( x+5, offset+5, width-10, height-10, |
496 | AlignLeft | AlignTop | AlignJustify , | 498 | Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify , |
497 | multiDayStr); | 499 | multiDayStr); |
498 | } | 500 | } |
499 | } else { | 501 | } else { |
500 | height=offset-y; | 502 | height=offset-y; |
501 | } | 503 | } |
502 | } | 504 | } |
@@ -557,21 +559,21 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, | |||
557 | QDateTime startPrintDate = QDateTime( qd, fromTime ); | 559 | QDateTime startPrintDate = QDateTime( qd, fromTime ); |
558 | QDateTime endPrintDate = QDateTime( qd, toTime ); | 560 | QDateTime endPrintDate = QDateTime( qd, toTime ); |
559 | 561 | ||
560 | // Calculate horizontal positions and widths of events taking into account | 562 | // Calculate horizontal positions and widths of events taking into account |
561 | // overlapping events | 563 | // overlapping events |
562 | 564 | ||
563 | QPtrList<KOrg::CellItem> cells; | 565 | Q3PtrList<KOrg::CellItem> cells; |
564 | cells.setAutoDelete( true ); | 566 | cells.setAutoDelete( true ); |
565 | 567 | ||
566 | Event::List::ConstIterator itEvents; | 568 | Event::List::ConstIterator itEvents; |
567 | for( itEvents = events.begin(); itEvents != events.end(); ++itEvents ) { | 569 | for( itEvents = events.begin(); itEvents != events.end(); ++itEvents ) { |
568 | cells.append( new PrintCellItem( *itEvents, qd ) ); | 570 | cells.append( new PrintCellItem( *itEvents, qd ) ); |
569 | } | 571 | } |
570 | 572 | ||
571 | QPtrListIterator<KOrg::CellItem> it1( cells ); | 573 | Q3PtrListIterator<KOrg::CellItem> it1( cells ); |
572 | for( it1.toFirst(); it1.current(); ++it1 ) { | 574 | for( it1.toFirst(); it1.current(); ++it1 ) { |
573 | KOrg::CellItem *placeItem = it1.current(); | 575 | KOrg::CellItem *placeItem = it1.current(); |
574 | 576 | ||
575 | KOrg::CellItem::placeItem( cells, placeItem ); | 577 | KOrg::CellItem::placeItem( cells, placeItem ); |
576 | } | 578 | } |
577 | 579 | ||
@@ -590,13 +592,13 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, | |||
590 | 592 | ||
591 | p.setBrush( oldBrush ); | 593 | p.setBrush( oldBrush ); |
592 | p.setPen( oldPen ); | 594 | p.setPen( oldPen ); |
593 | p.setBackgroundColor( oldBgColor ); | 595 | p.setBackgroundColor( oldBgColor ); |
594 | } | 596 | } |
595 | 597 | ||
596 | p.setBrush( QBrush( NoBrush ) ); | 598 | p.setBrush( QBrush( Qt::NoBrush ) ); |
597 | } | 599 | } |
598 | 600 | ||
599 | 601 | ||
600 | void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p, | 602 | void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p, |
601 | const QDate &qd, | 603 | const QDate &qd, |
602 | const QDateTime &startPrintDate, | 604 | const QDateTime &startPrintDate, |
@@ -632,13 +634,13 @@ void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p, | |||
632 | // p.save(); | 634 | // p.save(); |
633 | QPen pe = p.pen(); | 635 | QPen pe = p.pen(); |
634 | pe.setWidth( 2 ); | 636 | pe.setWidth( 2 ); |
635 | p.setPen( pe ); | 637 | p.setPen( pe ); |
636 | p.drawRect( currentX, currentyPos+1, currentWidth+1, eventLength+1 ); | 638 | p.drawRect( currentX, currentyPos+1, currentWidth+1, eventLength+1 ); |
637 | p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3, | 639 | p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3, |
638 | AlignLeft | AlignTop | AlignJustify | WordBreak, | 640 | Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify | Qt::TextWordWrap, |
639 | text); | 641 | text); |
640 | // p.restore(); | 642 | // p.restore(); |
641 | } | 643 | } |
642 | } | 644 | } |
643 | 645 | ||
644 | void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, | 646 | void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, |
@@ -667,23 +669,23 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, | |||
667 | hstring=KOCore::self()->holiday(qd); | 669 | hstring=KOCore::self()->holiday(qd); |
668 | #endif | 670 | #endif |
669 | 671 | ||
670 | if (!hstring.isEmpty()) { | 672 | if (!hstring.isEmpty()) { |
671 | p.setFont( QFont( "helvetica", 8, QFont::Bold, true ) ); | 673 | p.setFont( QFont( "helvetica", 8, QFont::Bold, true ) ); |
672 | 674 | ||
673 | p.drawText( x+5, y, width-25, mSubHeaderHeight, AlignLeft | AlignVCenter, | 675 | p.drawText( x+5, y, width-25, mSubHeaderHeight, Qt::AlignLeft | Qt::AlignVCenter, |
674 | hstring ); | 676 | hstring ); |
675 | } | 677 | } |
676 | p.setFont(QFont("helvetica", 10, QFont::Bold)); | 678 | p.setFont(QFont("helvetica", 10, QFont::Bold)); |
677 | if ( fullDate) { | 679 | if ( fullDate) { |
678 | // use short date format, if long date is too long | 680 | // use short date format, if long date is too long |
679 | QFontMetrics fm ( p.font() ); | 681 | QFontMetrics fm ( p.font() ); |
680 | if ( fm.width( dayNumStr ) > width -10 ) | 682 | if ( fm.width( dayNumStr ) > width -10 ) |
681 | dayNumStr = local->formatDate(qd, true); | 683 | dayNumStr = local->formatDate(qd, true); |
682 | } | 684 | } |
683 | p.drawText(x+5, y, width-10, mSubHeaderHeight, AlignRight | AlignVCenter, | 685 | p.drawText(x+5, y, width-10, mSubHeaderHeight, Qt::AlignRight | Qt::AlignVCenter, |
684 | dayNumStr); | 686 | dayNumStr); |
685 | Event::List eventList; | 687 | Event::List eventList; |
686 | eventList.fill( mCalendar->events( qd, true )); | 688 | eventList.fill( mCalendar->events( qd, true )); |
687 | Todo::List todos; | 689 | Todo::List todos; |
688 | todos.fill( mCalendar->todos( qd )); | 690 | todos.fill( mCalendar->todos( qd )); |
689 | QString outStr; | 691 | QString outStr; |
@@ -721,13 +723,13 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, | |||
721 | outStr += " " + currEvent->summary(); | 723 | outStr += " " + currEvent->summary(); |
722 | } | 724 | } |
723 | 725 | ||
724 | } // doesFloat | 726 | } // doesFloat |
725 | 727 | ||
726 | p.drawText(x+5, y+textY, width-10, lineSpacing, | 728 | p.drawText(x+5, y+textY, width-10, lineSpacing, |
727 | AlignLeft|AlignBottom, outStr); | 729 | Qt::AlignLeft|Qt::AlignBottom, outStr); |
728 | textY+=lineSpacing; | 730 | textY+=lineSpacing; |
729 | } | 731 | } |
730 | 732 | ||
731 | if ( textY<height ) { | 733 | if ( textY<height ) { |
732 | 734 | ||
733 | Todo::List::ConstIterator it2; | 735 | Todo::List::ConstIterator it2; |
@@ -740,13 +742,13 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, | |||
740 | text += " "; | 742 | text += " "; |
741 | } | 743 | } |
742 | } | 744 | } |
743 | text += i18n("To-Do: %1").arg(todo->summary()); | 745 | text += i18n("To-Do: %1").arg(todo->summary()); |
744 | 746 | ||
745 | p.drawText(x+5, y+textY, width-10, lineSpacing, | 747 | p.drawText(x+5, y+textY, width-10, lineSpacing, |
746 | AlignLeft|AlignBottom, text); | 748 | Qt::AlignLeft|Qt::AlignBottom, text); |
747 | textY+=lineSpacing; | 749 | textY+=lineSpacing; |
748 | } | 750 | } |
749 | } | 751 | } |
750 | } | 752 | } |
751 | 753 | ||
752 | 754 | ||
@@ -846,13 +848,13 @@ void CalPrintBase::drawMonth(QPainter &p, const QDate &qd, bool weeknumbers, | |||
846 | p.setFont(newFont); | 848 | p.setFont(newFont); |
847 | xoffset += 18; | 849 | xoffset += 18; |
848 | QDate weekDate(monthDate); | 850 | QDate weekDate(monthDate); |
849 | for (int row = 0; row<rows; row++) { | 851 | for (int row = 0; row<rows; row++) { |
850 | int calWeek = weekDate.weekNumber(); | 852 | int calWeek = weekDate.weekNumber(); |
851 | QRect rc(x, y+yoffset+cellHeight*row, xoffset-1, cellHeight); | 853 | QRect rc(x, y+yoffset+cellHeight*row, xoffset-1, cellHeight); |
852 | p.drawText( rc, AlignRight|AlignVCenter, QString::number(calWeek) ); | 854 | p.drawText( rc, Qt::AlignRight|Qt::AlignVCenter, QString::number(calWeek) ); |
853 | weekDate = weekDate.addDays(7); | 855 | weekDate = weekDate.addDays(7); |
854 | } | 856 | } |
855 | p.setFont(oldFont); | 857 | p.setFont(oldFont); |
856 | } | 858 | } |
857 | 859 | ||
858 | drawDaysOfWeek( p, monthDate, monthDate.addDays(6), x+xoffset, y, width-xoffset, mSubHeaderHeight ); | 860 | drawDaysOfWeek( p, monthDate, monthDate.addDays(6), x+xoffset, y, width-xoffset, mSubHeaderHeight ); |
@@ -894,31 +896,31 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
894 | int posdue=posDueDt; | 896 | int posdue=posDueDt; |
895 | if (posdue<0) posdue=x+width; | 897 | if (posdue<0) posdue=x+width; |
896 | QRect rect; | 898 | QRect rect; |
897 | TodoParentStart startpt; | 899 | TodoParentStart startpt; |
898 | // This list keeps all starting points of the parent todos so the connection | 900 | // This list keeps all starting points of the parent todos so the connection |
899 | // lines of the tree can easily be drawn (needed if a new page is started) | 901 | // lines of the tree can easily be drawn (needed if a new page is started) |
900 | static QPtrList<TodoParentStart> startPoints; | 902 | static Q3PtrList<TodoParentStart> startPoints; |
901 | if (level<1) { | 903 | if (level<1) { |
902 | startPoints.clear(); | 904 | startPoints.clear(); |
903 | } | 905 | } |
904 | 906 | ||
905 | // size of item | 907 | // size of item |
906 | outStr=item->summary(); | 908 | outStr=item->summary(); |
907 | if ( ! item->location().isEmpty() ) | 909 | if ( ! item->location().isEmpty() ) |
908 | outStr += " ("+item->location()+")"; | 910 | outStr += " ("+item->location()+")"; |
909 | if ( item->hasDueDate() && posDueDt>=0 ) { | 911 | if ( item->hasDueDate() && posDueDt>=0 ) { |
910 | outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]"; | 912 | outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]"; |
911 | } | 913 | } |
912 | int left = possummary+(level*10); | 914 | int left = possummary+(level*10); |
913 | rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr); | 915 | rect = p.boundingRect(left, y, (posdue-left-5),-1, Qt::WordBreak, outStr); |
914 | //qDebug("bottom1 %d ", rect.bottom() ); | 916 | //qDebug("bottom1 %d ", rect.bottom() ); |
915 | if ( !item->description().isEmpty() && desc ) { | 917 | if ( !item->description().isEmpty() && desc ) { |
916 | outStr = item->description(); | 918 | outStr = item->description(); |
917 | rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1, | 919 | rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1, |
918 | WordBreak, outStr ); | 920 | Qt::WordBreak, outStr ); |
919 | } | 921 | } |
920 | //qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight ); | 922 | //qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight ); |
921 | // if too big make new page | 923 | // if too big make new page |
922 | if ( rect.bottom() > y+height) { | 924 | if ( rect.bottom() > y+height) { |
923 | // first draw the connection lines from parent todos: | 925 | // first draw the connection lines from parent todos: |
924 | if (level > 0 && connectSubTodos) { | 926 | if (level > 0 && connectSubTodos) { |
@@ -930,14 +932,13 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
930 | 932 | ||
931 | // draw either from start point of parent or from top of the page | 933 | // draw either from start point of parent or from top of the page |
932 | if (rct->mSamePage) | 934 | if (rct->mSamePage) |
933 | start = rct->mRect.bottom() + 1; | 935 | start = rct->mRect.bottom() + 1; |
934 | else | 936 | else |
935 | start = p.viewport().top(); | 937 | start = p.viewport().top(); |
936 | p.moveTo( center, start ); | 938 | p.drawLine( center, start, center, to ); |
937 | p.lineTo( center, to ); | ||
938 | rct->mSamePage=false; | 939 | rct->mSamePage=false; |
939 | } | 940 | } |
940 | } | 941 | } |
941 | y=0; | 942 | y=0; |
942 | height=pageHeight-y; | 943 | height=pageHeight-y; |
943 | mPrinter->newPage(); | 944 | mPrinter->newPage(); |
@@ -948,26 +949,26 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
948 | if (r && pospriority >= 0 ) { | 949 | if (r && pospriority >= 0 ) { |
949 | pospriority = r->mRect.right() + 1; | 950 | pospriority = r->mRect.right() + 1; |
950 | } | 951 | } |
951 | 952 | ||
952 | // Priority | 953 | // Priority |
953 | outStr.setNum(priority); | 954 | outStr.setNum(priority); |
954 | rect = p.boundingRect(pospriority, y + 10, 5, -1, AlignCenter, outStr); | 955 | rect = p.boundingRect(pospriority, y + 10, 5, -1, Qt::AlignCenter, outStr); |
955 | // Make it a more reasonable size | 956 | // Make it a more reasonable size |
956 | rect.setWidth(19); | 957 | rect.setWidth(19); |
957 | rect.setHeight(19); | 958 | rect.setHeight(19); |
958 | if ( priority > 0 && pospriority>=0 ) { | 959 | if ( priority > 0 && pospriority>=0 ) { |
959 | p.drawText(rect, AlignCenter, outStr); | 960 | p.drawText(rect, Qt::AlignCenter, outStr); |
960 | p.drawRect(rect); | 961 | p.drawRect(rect); |
961 | // cross out the rectangle for completed items | 962 | // cross out the rectangle for completed items |
962 | if ( item->isCompleted() ) { | 963 | if ( item->isCompleted() ) { |
963 | p.drawLine( rect.topLeft(), rect.bottomRight() ); | 964 | p.drawLine( rect.topLeft(), rect.bottomRight() ); |
964 | p.drawLine( rect.topRight(), rect.bottomLeft() ); | 965 | p.drawLine( rect.topRight(), rect.bottomLeft() ); |
965 | } else if (item->cancelled() ) { | 966 | } else if (item->cancelled() ) { |
966 | QPen pen = p.pen(); | 967 | QPen pen = p.pen(); |
967 | p.setPen ( QPen ( black, 2) ); | 968 | p.setPen ( QPen ( Qt::black, 2) ); |
968 | p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 ); | 969 | p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 ); |
969 | p.setPen( pen ); | 970 | p.setPen( pen ); |
970 | } | 971 | } |
971 | } | 972 | } |
972 | startpt.mRect = rect; //save for later | 973 | startpt.mRect = rect; //save for later |
973 | 974 | ||
@@ -978,15 +979,14 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
978 | if (r->mSamePage ) | 979 | if (r->mSamePage ) |
979 | bottom = r->mRect.bottom();//lutz + 1; | 980 | bottom = r->mRect.bottom();//lutz + 1; |
980 | else | 981 | else |
981 | bottom = 0; | 982 | bottom = 0; |
982 | int to( rect.top() + (rect.height()/2)+1 ); | 983 | int to( rect.top() + (rect.height()/2)+1 ); |
983 | int endx( rect.left() ); | 984 | int endx( rect.left() ); |
984 | p.moveTo(center, bottom); | 985 | p.drawLine(center,bottom, center,to); |
985 | p.lineTo(center, to); | 986 | p.drawLine(center,to, endx,to); |
986 | p.lineTo(endx, to); | ||
987 | } | 987 | } |
988 | 988 | ||
989 | // if completed, use strike out font | 989 | // if completed, use strike out font |
990 | // LR does not work - font is underlined, not striked out | 990 | // LR does not work - font is underlined, not striked out |
991 | //QFont ft=p.font(); | 991 | //QFont ft=p.font(); |
992 | //ft.setStrikeOut( item->isCompleted() ); | 992 | //ft.setStrikeOut( item->isCompleted() ); |
@@ -996,15 +996,15 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
996 | if ( ! item->location().isEmpty() ) | 996 | if ( ! item->location().isEmpty() ) |
997 | outStr += " ("+item->location()+")"; | 997 | outStr += " ("+item->location()+")"; |
998 | if ( item->hasDueDate() && posDueDt>=0 ) { | 998 | if ( item->hasDueDate() && posDueDt>=0 ) { |
999 | outStr += " [" +item->dtDueStr(true)+"]"; | 999 | outStr += " [" +item->dtDueStr(true)+"]"; |
1000 | } | 1000 | } |
1001 | rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)), | 1001 | rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)), |
1002 | -1, WordBreak, outStr); | 1002 | -1, Qt::WordBreak, outStr); |
1003 | QRect newrect; | 1003 | QRect newrect; |
1004 | p.drawText( rect, WordBreak, outStr, -1, &newrect ); | 1004 | p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect ); |
1005 | //ft.setStrikeOut(false); | 1005 | //ft.setStrikeOut(false); |
1006 | // p.setFont(ft); | 1006 | // p.setFont(ft); |
1007 | 1007 | ||
1008 | // due | 1008 | // due |
1009 | // if ( item->hasDueDate() && posDueDt>=0 ) { | 1009 | // if ( item->hasDueDate() && posDueDt>=0 ) { |
1010 | // outStr = local->formatDate(item->dtDue().date(),true); | 1010 | // outStr = local->formatDate(item->dtDue().date(),true); |
@@ -1013,14 +1013,14 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
1013 | // } | 1013 | // } |
1014 | 1014 | ||
1015 | if ( !item->description().isEmpty() && desc ) { | 1015 | if ( !item->description().isEmpty() && desc ) { |
1016 | y=newrect.bottom() + 5; | 1016 | y=newrect.bottom() + 5; |
1017 | outStr = item->description(); | 1017 | outStr = item->description(); |
1018 | rect = p.boundingRect( left+20, y, x+width-(left+10), -1, | 1018 | rect = p.boundingRect( left+20, y, x+width-(left+10), -1, |
1019 | WordBreak, outStr ); | 1019 | Qt::WordBreak, outStr ); |
1020 | p.drawText( rect, WordBreak, outStr, -1, &newrect ); | 1020 | p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect ); |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | // Set the new line position | 1023 | // Set the new line position |
1024 | y=newrect.bottom() + 10; //set the line position | 1024 | y=newrect.bottom() + 10; //set the line position |
1025 | 1025 | ||
1026 | // If the item has subitems, we need to call ourselves recursively | 1026 | // If the item has subitems, we need to call ourselves recursively |
@@ -1135,14 +1135,14 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, | |||
1135 | int width, int ) | 1135 | int width, int ) |
1136 | { | 1136 | { |
1137 | int tempStore = mSubHeaderHeight; | 1137 | int tempStore = mSubHeaderHeight; |
1138 | mSubHeaderHeight+= mSubHeaderHeight; | 1138 | mSubHeaderHeight+= mSubHeaderHeight; |
1139 | KLocale *local = KGlobal::locale(); | 1139 | KLocale *local = KGlobal::locale(); |
1140 | QFont font("helvetica", 18, QFont::Bold); | 1140 | QFont font("helvetica", 18, QFont::Bold); |
1141 | QPen penA( black,0); | 1141 | QPen penA( Qt::black,0); |
1142 | QPen penB( black,3); | 1142 | QPen penB( Qt::black,3); |
1143 | p.setFont(font); | 1143 | p.setFont(font); |
1144 | int lineSpacing = p.fontMetrics().lineSpacing(); | 1144 | int lineSpacing = p.fontMetrics().lineSpacing(); |
1145 | QString title; | 1145 | QString title; |
1146 | QString myOwner(mCalendar->getOwner()); | 1146 | QString myOwner(mCalendar->getOwner()); |
1147 | if ( fd.month() == td.month() ) { | 1147 | if ( fd.month() == td.month() ) { |
1148 | title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' ' | 1148 | title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' ' |
@@ -1158,23 +1158,23 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, | |||
1158 | // serifFont.setWeight(87); | 1158 | // serifFont.setWeight(87); |
1159 | // serifFont.setItalic(true); | 1159 | // serifFont.setItalic(true); |
1160 | p.setFont(serifFont); | 1160 | p.setFont(serifFont); |
1161 | QFontInfo info(p.font()); | 1161 | QFontInfo info(p.font()); |
1162 | 1162 | ||
1163 | lineSpacing = p.fontMetrics().lineSpacing(); | 1163 | lineSpacing = p.fontMetrics().lineSpacing(); |
1164 | p.drawText(0, lineSpacing * 0, width, lineSpacing, AlignRight |AlignTop, title ); | 1164 | p.drawText(0, lineSpacing * 0, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title ); |
1165 | 1165 | ||
1166 | title.truncate(0); | 1166 | title.truncate(0); |
1167 | 1167 | ||
1168 | p.setPen(penB ); | 1168 | p.setPen(penB ); |
1169 | p.drawLine(200, lineSpacing * 1, width, lineSpacing * 1); | 1169 | p.drawLine(200, lineSpacing * 1, width, lineSpacing * 1); |
1170 | p.setPen(penA ); | 1170 | p.setPen(penA ); |
1171 | 1171 | ||
1172 | p.setFont(QFont("Helvetica", 20, QFont::Bold, TRUE)); | 1172 | p.setFont(QFont("Helvetica", 20, QFont::Bold, TRUE)); |
1173 | title += QString::number(fd.year()); | 1173 | title += QString::number(fd.year()); |
1174 | p.drawText(0, lineSpacing * 1, width, lineSpacing, AlignRight |AlignTop, title ); | 1174 | p.drawText(0, lineSpacing * 1, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title ); |
1175 | mSubHeaderHeight = tempStore ; | 1175 | mSubHeaderHeight = tempStore ; |
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, | 1178 | void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, |
1179 | int height, int offsetLeft ) | 1179 | int height, int offsetLeft ) |
1180 | { | 1180 | { |
@@ -1194,13 +1194,13 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, | |||
1194 | // width+1 to make sure there's a continuous, black bar across the top. | 1194 | // width+1 to make sure there's a continuous, black bar across the top. |
1195 | p.setPen( QPen(Qt::black,2)); | 1195 | p.setPen( QPen(Qt::black,2)); |
1196 | p.drawRect(offsetLeft, mHeaderHeight + 5, width +1, mSubHeaderHeight); | 1196 | p.drawRect(offsetLeft, mHeaderHeight + 5, width +1, mSubHeaderHeight); |
1197 | p.setPen( Qt::black); | 1197 | p.setPen( Qt::black); |
1198 | p.setFont(QFont("helvetica", 12, QFont::Bold, true)); | 1198 | p.setFont(QFont("helvetica", 12, QFont::Bold, true)); |
1199 | p.drawText(offsetLeft, mHeaderHeight + 5, | 1199 | p.drawText(offsetLeft, mHeaderHeight + 5, |
1200 | width, mSubHeaderHeight, AlignHCenter | AlignVCenter, | 1200 | width, mSubHeaderHeight, Qt::AlignHCenter | Qt::AlignVCenter, |
1201 | dayName); | 1201 | dayName); |
1202 | 1202 | ||
1203 | p.setPen( QPen(Qt::black,2)); | 1203 | p.setPen( QPen(Qt::black,2)); |
1204 | p.setFont(QFont("helvetica", 12)); | 1204 | p.setFont(QFont("helvetica", 12)); |
1205 | p.setBrush(Qt::white); | 1205 | p.setBrush(Qt::white); |
1206 | it = eventList.begin(); | 1206 | it = eventList.begin(); |
@@ -1251,16 +1251,16 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, | |||
1251 | int endMinuteOff = (int) (minuteInc * currEvent->dtEnd().time().minute()); | 1251 | int endMinuteOff = (int) (minuteInc * currEvent->dtEnd().time().minute()); |
1252 | int cheight = (int) (minuteInc * | 1252 | int cheight = (int) (minuteInc * |
1253 | currEvent->dtStart().secsTo(currEvent->dtEnd()) / 60 ); | 1253 | currEvent->dtStart().secsTo(currEvent->dtEnd()) / 60 ); |
1254 | p.drawRect(offsetLeft+2, 1+offset+startMinuteOff+startTime*cellHeight, | 1254 | p.drawRect(offsetLeft+2, 1+offset+startMinuteOff+startTime*cellHeight, |
1255 | width-4, cheight); | 1255 | width-4, cheight); |
1256 | p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24, | 1256 | p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24, |
1257 | cheight-10, AlignHCenter | AlignTop, text); | 1257 | cheight-10, Qt::AlignHCenter | Qt::AlignTop, text); |
1258 | } | 1258 | } |
1259 | } | 1259 | } |
1260 | p.setBrush(QBrush(NoBrush)); | 1260 | p.setBrush(QBrush(Qt::NoBrush)); |
1261 | mSubHeaderHeight = tempStore ; | 1261 | mSubHeaderHeight = tempStore ; |
1262 | } | 1262 | } |
1263 | 1263 | ||
1264 | void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, | 1264 | void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, |
1265 | int height ) | 1265 | int height ) |
1266 | { | 1266 | { |
@@ -1271,36 +1271,36 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, | |||
1271 | int offset = mHeaderHeight + mSubHeaderHeight + 10; | 1271 | int offset = mHeaderHeight + mSubHeaderHeight + 10; |
1272 | int hours = endHour - startHour; | 1272 | int hours = endHour - startHour; |
1273 | int cellHeight = (height-offset) / hours; // hour increments. | 1273 | int cellHeight = (height-offset) / hours; // hour increments. |
1274 | 1274 | ||
1275 | QString numStr; | 1275 | QString numStr; |
1276 | for (int i = 0; i < hours; i++) { | 1276 | for (int i = 0; i < hours; i++) { |
1277 | p.setPen(QPen(black,1)); | 1277 | p.setPen(QPen(Qt::black,1)); |
1278 | p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight); | 1278 | p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight); |
1279 | p.setPen(QPen(gray,0)); | 1279 | p.setPen(QPen(Qt::gray,0)); |
1280 | p.drawLine(37, offset+i*cellHeight+(cellHeight/2), | 1280 | p.drawLine(37, offset+i*cellHeight+(cellHeight/2), |
1281 | width, offset+i*cellHeight+(cellHeight/2)); | 1281 | width, offset+i*cellHeight+(cellHeight/2)); |
1282 | p.setPen(QPen(black,0)); | 1282 | p.setPen(QPen(Qt::black,0)); |
1283 | 1283 | ||
1284 | if ( !KGlobal::locale()->use12Clock() ) { | 1284 | if ( !KGlobal::locale()->use12Clock() ) { |
1285 | numStr.setNum(i+startHour); | 1285 | numStr.setNum(i+startHour); |
1286 | if (cellHeight > 40) { | 1286 | if (cellHeight > 40) { |
1287 | p.setFont(QFont("helvetica", 16, QFont::Bold)); | 1287 | p.setFont(QFont("helvetica", 16, QFont::Bold)); |
1288 | } else { | 1288 | } else { |
1289 | p.setFont(QFont("helvetica", 14, QFont::Bold)); | 1289 | p.setFont(QFont("helvetica", 14, QFont::Bold)); |
1290 | } | 1290 | } |
1291 | p.drawText(0, offset+i*cellHeight, 33, cellHeight/2, | 1291 | p.drawText(0, offset+i*cellHeight, 33, cellHeight/2, |
1292 | AlignTop|AlignRight, numStr); | 1292 | Qt::AlignTop|Qt::AlignRight, numStr); |
1293 | p.setFont(QFont("helvetica", 12, QFont::Bold)); | 1293 | p.setFont(QFont("helvetica", 12, QFont::Bold)); |
1294 | p.drawText(37, offset+i*cellHeight, 45, cellHeight/2, | 1294 | p.drawText(37, offset+i*cellHeight, 45, cellHeight/2, |
1295 | AlignTop | AlignLeft, "00"); | 1295 | Qt::AlignTop | Qt::AlignLeft, "00"); |
1296 | } else { | 1296 | } else { |
1297 | QTime time( i + startHour, 0 ); | 1297 | QTime time( i + startHour, 0 ); |
1298 | numStr = KGlobal::locale()->formatTime( time ); | 1298 | numStr = KGlobal::locale()->formatTime( time ); |
1299 | p.setFont(QFont("helvetica", 12, QFont::Bold)); | 1299 | p.setFont(QFont("helvetica", 12, QFont::Bold)); |
1300 | p.drawText(4, offset+i*cellHeight, 70, cellHeight/2, | 1300 | p.drawText(4, offset+i*cellHeight, 70, cellHeight/2, |
1301 | AlignTop|AlignLeft, numStr); | 1301 | Qt::AlignTop|Qt::AlignLeft, numStr); |
1302 | } | 1302 | } |
1303 | } mSubHeaderHeight = tempStore ; | 1303 | } mSubHeaderHeight = tempStore ; |
1304 | } | 1304 | } |
1305 | 1305 | ||
1306 | #endif | 1306 | #endif |
diff --git a/korganizer/calprinter.cpp b/korganizer/calprinter.cpp index 0cdf28e..d4bf988 100644 --- a/korganizer/calprinter.cpp +++ b/korganizer/calprinter.cpp | |||
@@ -18,21 +18,24 @@ | |||
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qvbuttongroup.h> | 24 | // #include <qvbuttongroup.h> |
25 | #include <qwidgetstack.h> | 25 | #include <q3widgetstack.h> |
26 | #include <qradiobutton.h> | 26 | #include <qradiobutton.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qcombobox.h> | 29 | #include <qcombobox.h> |
30 | #include <qlabel.h> | 30 | #include <qlabel.h> |
31 | #include <qvbox.h> | 31 | #include <q3vbox.h> |
32 | #include <qsplitter.h> | 32 | #include <qsplitter.h> |
33 | //Added by qt3to4: | ||
34 | #include <Q3GridLayout> | ||
35 | #include <Q3PtrList> | ||
33 | 36 | ||
34 | #include <kprinter.h> | 37 | #include <kprinter.h> |
35 | #include <kglobal.h> | 38 | #include <kglobal.h> |
36 | #include <ksimpleconfig.h> | 39 | #include <ksimpleconfig.h> |
37 | #include <kmessagebox.h> | 40 | #include <kmessagebox.h> |
38 | #include <kdebug.h> | 41 | #include <kdebug.h> |
@@ -171,43 +174,43 @@ void CalPrinter::updateConfig() | |||
171 | { | 174 | { |
172 | } | 175 | } |
173 | 176 | ||
174 | 177 | ||
175 | /****************************************************************************/ | 178 | /****************************************************************************/ |
176 | 179 | ||
177 | CalPrintDialog::CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p, | 180 | CalPrintDialog::CalPrintDialog( Q3PtrList<CalPrintBase> plugins, KPrinter *p, |
178 | QWidget *parent, const char *name ) | 181 | QWidget *parent, const char *name ) |
179 | : KDialogBase( parent, name, /*modal*/true, i18n("Print"), Ok | Cancel ), | 182 | : KDialogBase( parent, name, /*modal*/true, i18n("Print"), Ok | Cancel ), |
180 | mPrinter( p ), mPrintPlugins( plugins ) | 183 | mPrinter( p ), mPrintPlugins( plugins ) |
181 | { | 184 | { |
182 | QVBox *page = new QVBox(this);//makeVBoxMainWidget(); | 185 | Q3VBox *page = new Q3VBox(this);//makeVBoxMainWidget(); |
183 | setMainWidget( page ); | 186 | setMainWidget( page ); |
184 | QHBox *printerLayout = new QHBox( page ); | 187 | Q3HBox *printerLayout = new Q3HBox( page ); |
185 | 188 | ||
186 | mPrinterLabel = new QLabel( printerLayout ); | 189 | mPrinterLabel = new QLabel( printerLayout ); |
187 | QPushButton *setupButton = new QPushButton( i18n("&Setup Printer..."), | 190 | QPushButton *setupButton = new QPushButton( i18n("&Setup Printer..."), |
188 | printerLayout ); | 191 | printerLayout ); |
189 | setupButton->setSizePolicy( QSizePolicy( | 192 | setupButton->setSizePolicy( QSizePolicy( |
190 | (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0, | 193 | (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0, |
191 | 0, 0, setupButton->sizePolicy().hasHeightForWidth() ) ); | 194 | 0, 0, setupButton->sizePolicy().hasHeightForWidth() ) ); |
192 | 195 | ||
193 | QSplitter *splitter = new QSplitter( page ); | 196 | QSplitter *splitter = new QSplitter( page ); |
194 | splitter->setOrientation( QSplitter::Horizontal ); | 197 | splitter->setOrientation( Qt::Horizontal ); |
195 | 198 | ||
196 | mTypeGroup = new QVButtonGroup( i18n("View Type"), splitter, "buttonGroup" ); | 199 | mTypeGroup = new Q3VButtonGroup( i18n("View Type"), splitter, "buttonGroup" ); |
197 | // use the minimal width possible = max width of the radio buttons, not extensible | 200 | // use the minimal width possible = max width of the radio buttons, not extensible |
198 | /* mTypeGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, | 201 | /* mTypeGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, |
199 | (QSizePolicy::SizeType)5, 0, 0, | 202 | (QSizePolicy::SizeType)5, 0, 0, |
200 | mTypeGroup->sizePolicy().hasHeightForWidth() ) );*/ | 203 | mTypeGroup->sizePolicy().hasHeightForWidth() ) );*/ |
201 | 204 | ||
202 | QWidget *splitterRight = new QWidget( splitter, "splitterRight" ); | 205 | QWidget *splitterRight = new QWidget( splitter, "splitterRight" ); |
203 | QGridLayout *splitterRightLayout = new QGridLayout( splitterRight ); | 206 | Q3GridLayout *splitterRightLayout = new Q3GridLayout( splitterRight ); |
204 | splitterRightLayout->setMargin( marginHint() ); | 207 | splitterRightLayout->setMargin( marginHint() ); |
205 | splitterRightLayout->setSpacing( spacingHint() ); | 208 | splitterRightLayout->setSpacing( spacingHint() ); |
206 | 209 | ||
207 | mConfigArea = new QWidgetStack( splitterRight, "configWidgetStack" ); | 210 | mConfigArea = new Q3WidgetStack( splitterRight, "configWidgetStack" ); |
208 | splitterRightLayout->addMultiCellWidget( mConfigArea, 0,0, 0,1 ); | 211 | splitterRightLayout->addMultiCellWidget( mConfigArea, 0,0, 0,1 ); |
209 | 212 | ||
210 | QLabel *orientationLabel = new QLabel( i18n("Page &orientation:"), | 213 | QLabel *orientationLabel = new QLabel( i18n("Page &orientation:"), |
211 | splitterRight, "orientationLabel" ); | 214 | splitterRight, "orientationLabel" ); |
212 | splitterRightLayout->addWidget( orientationLabel, 1, 0 ); | 215 | splitterRightLayout->addWidget( orientationLabel, 1, 0 ); |
213 | 216 | ||
diff --git a/korganizer/calprinter.h b/korganizer/calprinter.h index 7b58f4f..e065779 100644 --- a/korganizer/calprinter.h +++ b/korganizer/calprinter.h | |||
@@ -1,6 +1,8 @@ | |||
1 | //Added by qt3to4: | ||
2 | #include <QLabel> | ||
1 | /* | 3 | /* |
2 | This file is part of KOrganizer. | 4 | This file is part of KOrganizer. |
3 | 5 | ||
4 | Copyright (c) 1998 Preston Brown | 6 | Copyright (c) 1998 Preston Brown |
5 | 7 | ||
6 | This program is free software; you can redistribute it and/or modify | 8 | This program is free software; you can redistribute it and/or modify |
@@ -25,24 +27,24 @@ | |||
25 | #define _CALPRINTER_H | 27 | #define _CALPRINTER_H |
26 | 28 | ||
27 | // #define KORG_NOPRINTER | 29 | // #define KORG_NOPRINTER |
28 | 30 | ||
29 | #ifndef KORG_NOPRINTER | 31 | #ifndef KORG_NOPRINTER |
30 | 32 | ||
31 | #include <qptrlist.h> | 33 | #include <q3ptrlist.h> |
32 | 34 | ||
33 | #include <kdialogbase.h> | 35 | #include <kdialogbase.h> |
34 | 36 | ||
35 | #include <korganizer/baseview.h> | 37 | #include <korganizer/baseview.h> |
36 | 38 | ||
37 | #include "calprintbase.h" | 39 | #include "calprintbase.h" |
38 | 40 | ||
39 | using namespace KCal; | 41 | using namespace KCal; |
40 | 42 | ||
41 | class QVButtonGroup; | 43 | class Q3VButtonGroup; |
42 | class QWidgetStack; | 44 | class Q3WidgetStack; |
43 | class KPrinter; | 45 | class KPrinter; |
44 | class CalPrintDialog; | 46 | class CalPrintDialog; |
45 | class KConfig; | 47 | class KConfig; |
46 | class QComboBox; | 48 | class QComboBox; |
47 | class QLabel; | 49 | class QLabel; |
48 | 50 | ||
@@ -91,13 +93,13 @@ class CalPrinter : public QObject, public KOrg::CalPrinterBase | |||
91 | 93 | ||
92 | public: | 94 | public: |
93 | void preview( PrintType type, const QDate &fd, const QDate &td ); | 95 | void preview( PrintType type, const QDate &fd, const QDate &td ); |
94 | void print( PrintType type, const QDate &fd, const QDate &td ); | 96 | void print( PrintType type, const QDate &fd, const QDate &td ); |
95 | 97 | ||
96 | protected: | 98 | protected: |
97 | QPtrList<CalPrintBase> mPrintPlugins; | 99 | Q3PtrList<CalPrintBase> mPrintPlugins; |
98 | 100 | ||
99 | private: | 101 | private: |
100 | KPrinter *mPrinter; | 102 | KPrinter *mPrinter; |
101 | Calendar *mCalendar; | 103 | Calendar *mCalendar; |
102 | QWidget *mParent; | 104 | QWidget *mParent; |
103 | KConfig *mConfig; | 105 | KConfig *mConfig; |
@@ -106,13 +108,13 @@ class CalPrinter : public QObject, public KOrg::CalPrinterBase | |||
106 | }; | 108 | }; |
107 | 109 | ||
108 | class CalPrintDialog : public KDialogBase | 110 | class CalPrintDialog : public KDialogBase |
109 | { | 111 | { |
110 | Q_OBJECT | 112 | Q_OBJECT |
111 | public: | 113 | public: |
112 | CalPrintDialog( QPtrList<CalPrintBase> plugins, KPrinter *p, | 114 | CalPrintDialog( Q3PtrList<CalPrintBase> plugins, KPrinter *p, |
113 | QWidget *parent = 0, const char *name = 0 ); | 115 | QWidget *parent = 0, const char *name = 0 ); |
114 | virtual ~CalPrintDialog(); | 116 | virtual ~CalPrintDialog(); |
115 | CalPrintBase *selectedPlugin(); | 117 | CalPrintBase *selectedPlugin(); |
116 | CalPrinter::ePrintOrientation orientation() { return mOrientation; } | 118 | CalPrinter::ePrintOrientation orientation() { return mOrientation; } |
117 | 119 | ||
118 | public slots: | 120 | public slots: |
@@ -124,15 +126,15 @@ class CalPrintDialog : public KDialogBase | |||
124 | void setupPrinter(); | 126 | void setupPrinter(); |
125 | void setPrinterLabel(); | 127 | void setPrinterLabel(); |
126 | signals: | 128 | signals: |
127 | void okClicked(); | 129 | void okClicked(); |
128 | private: | 130 | private: |
129 | KPrinter *mPrinter; | 131 | KPrinter *mPrinter; |
130 | QVButtonGroup *mTypeGroup; | 132 | Q3VButtonGroup *mTypeGroup; |
131 | QWidgetStack *mConfigArea; | 133 | Q3WidgetStack *mConfigArea; |
132 | QPtrList<CalPrintBase> mPrintPlugins; | 134 | Q3PtrList<CalPrintBase> mPrintPlugins; |
133 | QLabel *mPrinterLabel; | 135 | QLabel *mPrinterLabel; |
134 | QString mPreviewText; | 136 | QString mPreviewText; |
135 | QComboBox *mOrientationSelection; | 137 | QComboBox *mOrientationSelection; |
136 | 138 | ||
137 | CalPrinter::ePrintOrientation mOrientation; | 139 | CalPrinter::ePrintOrientation mOrientation; |
138 | }; | 140 | }; |
diff --git a/korganizer/calprintplugins.cpp b/korganizer/calprintplugins.cpp index bc35ca4..9b6dc6e 100644 --- a/korganizer/calprintplugins.cpp +++ b/korganizer/calprintplugins.cpp | |||
@@ -22,17 +22,17 @@ | |||
22 | As a special exception, permission is given to link this program | 22 | As a special exception, permission is given to link this program |
23 | with any edition of Qt, and distribute the resulting executable, | 23 | with any edition of Qt, and distribute the resulting executable, |
24 | without including the source code for Qt in the source distribution. | 24 | without including the source code for Qt in the source distribution. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include <qpainter.h> | 27 | #include <qpainter.h> |
28 | #include <qdatetimeedit.h> | 28 | #include <q3datetimeedit.h> |
29 | #include <qdatetime.h> | 29 | #include <qdatetime.h> |
30 | #include <qcheckbox.h> | 30 | #include <qcheckbox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qbuttongroup.h> | 32 | #include <q3buttongroup.h> |
33 | 33 | ||
34 | #include <kglobal.h> | 34 | #include <kglobal.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | #include <kdebug.h> | 36 | #include <kdebug.h> |
37 | #include <kprinter.h> | 37 | #include <kprinter.h> |
38 | #include <kconfig.h> | 38 | #include <kconfig.h> |
diff --git a/korganizer/cellitem.cpp b/korganizer/cellitem.cpp index 61d06ac..1fd703c 100644 --- a/korganizer/cellitem.cpp +++ b/korganizer/cellitem.cpp | |||
@@ -24,32 +24,34 @@ | |||
24 | 24 | ||
25 | #include "cellitem.h" | 25 | #include "cellitem.h" |
26 | 26 | ||
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | 29 | ||
30 | #include <qintdict.h> | 30 | #include <q3intdict.h> |
31 | //Added by qt3to4: | ||
32 | #include <Q3PtrList> | ||
31 | 33 | ||
32 | using namespace KOrg; | 34 | using namespace KOrg; |
33 | 35 | ||
34 | QString CellItem::label() const | 36 | QString CellItem::label() const |
35 | { | 37 | { |
36 | return i18n("<undefined>"); | 38 | return i18n("<undefined>"); |
37 | } | 39 | } |
38 | 40 | ||
39 | QPtrList<CellItem> CellItem::placeItem( QPtrList<CellItem> cells, | 41 | Q3PtrList<CellItem> CellItem::placeItem( Q3PtrList<CellItem> cells, |
40 | CellItem *placeItem ) | 42 | CellItem *placeItem ) |
41 | { | 43 | { |
42 | kdDebug(5855) << "Placing " << placeItem->label() << endl; | 44 | kdDebug(5855) << "Placing " << placeItem->label() << endl; |
43 | 45 | ||
44 | QPtrList<KOrg::CellItem> conflictItems; | 46 | Q3PtrList<KOrg::CellItem> conflictItems; |
45 | int maxSubCells = 0; | 47 | int maxSubCells = 0; |
46 | QIntDict<KOrg::CellItem> subCellDict; | 48 | Q3IntDict<KOrg::CellItem> subCellDict; |
47 | 49 | ||
48 | // Find all items which are in same cell | 50 | // Find all items which are in same cell |
49 | QPtrListIterator<KOrg::CellItem> it2( cells ); | 51 | Q3PtrListIterator<KOrg::CellItem> it2( cells ); |
50 | for( it2.toFirst(); it2.current(); ++it2 ) { | 52 | for( it2.toFirst(); it2.current(); ++it2 ) { |
51 | KOrg::CellItem *item = it2.current(); | 53 | KOrg::CellItem *item = it2.current(); |
52 | if ( item == placeItem ) continue; | 54 | if ( item == placeItem ) continue; |
53 | 55 | ||
54 | if ( item->overlaps( placeItem ) ) { | 56 | if ( item->overlaps( placeItem ) ) { |
55 | kdDebug(5855) << " Overlaps: " << item->label() << endl; | 57 | kdDebug(5855) << " Overlaps: " << item->label() << endl; |
@@ -80,13 +82,13 @@ QPtrList<CellItem> CellItem::placeItem( QPtrList<CellItem> cells, | |||
80 | kdDebug(5855) << " Sub cells: " << maxSubCells << endl; | 82 | kdDebug(5855) << " Sub cells: " << maxSubCells << endl; |
81 | 83 | ||
82 | // Write results to item to be placed | 84 | // Write results to item to be placed |
83 | conflictItems.append( placeItem ); | 85 | conflictItems.append( placeItem ); |
84 | placeItem->setSubCells( maxSubCells ); | 86 | placeItem->setSubCells( maxSubCells ); |
85 | 87 | ||
86 | QPtrListIterator<KOrg::CellItem> it3( conflictItems ); | 88 | Q3PtrListIterator<KOrg::CellItem> it3( conflictItems ); |
87 | for( it3.toFirst(); it3.current(); ++it3 ) { | 89 | for( it3.toFirst(); it3.current(); ++it3 ) { |
88 | (*it3)->setSubCells( maxSubCells ); | 90 | (*it3)->setSubCells( maxSubCells ); |
89 | } | 91 | } |
90 | // Todo: Adapt subCells of items conflicting with conflicting items | 92 | // Todo: Adapt subCells of items conflicting with conflicting items |
91 | } else { | 93 | } else { |
92 | kdDebug(5855) << " no conflicts" << endl; | 94 | kdDebug(5855) << " no conflicts" << endl; |
diff --git a/korganizer/cellitem.h b/korganizer/cellitem.h index 72773d0..b917bd5 100644 --- a/korganizer/cellitem.h +++ b/korganizer/cellitem.h | |||
@@ -22,13 +22,13 @@ | |||
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef KORG_CELLITEM_H | 24 | #ifndef KORG_CELLITEM_H |
25 | #define KORG_CELLITEM_H | 25 | #define KORG_CELLITEM_H |
26 | 26 | ||
27 | #include <qstring.h> | 27 | #include <qstring.h> |
28 | #include <qptrlist.h> | 28 | #include <q3ptrlist.h> |
29 | 29 | ||
30 | namespace KOrg { | 30 | namespace KOrg { |
31 | 31 | ||
32 | class CellItem | 32 | class CellItem |
33 | { | 33 | { |
34 | public: | 34 | public: |
@@ -50,13 +50,13 @@ class CellItem | |||
50 | /** | 50 | /** |
51 | Place item \arg placeItem into stripe containing items \arg cells in a | 51 | Place item \arg placeItem into stripe containing items \arg cells in a |
52 | way that items don't overlap. | 52 | way that items don't overlap. |
53 | 53 | ||
54 | \return Placed items | 54 | \return Placed items |
55 | */ | 55 | */ |
56 | static QPtrList<CellItem> placeItem( QPtrList<CellItem> cells, | 56 | static Q3PtrList<CellItem> placeItem( Q3PtrList<CellItem> cells, |
57 | CellItem *placeItem ); | 57 | CellItem *placeItem ); |
58 | 58 | ||
59 | private: | 59 | private: |
60 | int mSubCells; | 60 | int mSubCells; |
61 | int mSubCell; | 61 | int mSubCell; |
62 | }; | 62 | }; |
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index ea510f1..53507d3 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -31,12 +31,14 @@ | |||
31 | #include "kdatenavigator.h" | 31 | #include "kdatenavigator.h" |
32 | 32 | ||
33 | #include <kcalendarsystem.h> | 33 | #include <kcalendarsystem.h> |
34 | 34 | ||
35 | #include "datenavigatorcontainer.h" | 35 | #include "datenavigatorcontainer.h" |
36 | #include "koprefs.h" | 36 | #include "koprefs.h" |
37 | //Added by qt3to4: | ||
38 | #include <QResizeEvent> | ||
37 | 39 | ||
38 | DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, | 40 | DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, |
39 | const char *name ) | 41 | const char *name ) |
40 | : QWidget( parent, name ), mCalendar( 0 ), | 42 | : QWidget( parent, name ), mCalendar( 0 ), |
41 | mHorizontalCount( 1 ), mVerticalCount( 1 ) | 43 | mHorizontalCount( 1 ), mVerticalCount( 1 ) |
42 | { | 44 | { |
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h index 87cc59f..75d387c 100644 --- a/korganizer/datenavigatorcontainer.h +++ b/korganizer/datenavigatorcontainer.h | |||
@@ -1,6 +1,9 @@ | |||
1 | //Added by qt3to4: | ||
2 | #include <QResizeEvent> | ||
3 | #include <Q3PtrList> | ||
1 | /* | 4 | /* |
2 | This file is part of KOrganizer. | 5 | This file is part of KOrganizer. |
3 | 6 | ||
4 | Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org> | 7 | Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org> |
5 | Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com> | 8 | Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com> |
6 | 9 | ||
@@ -97,13 +100,13 @@ class DateNavigatorContainer: public QWidget | |||
97 | QDate mFirstSelectedDate; | 100 | QDate mFirstSelectedDate; |
98 | int mSelectedDateCount; | 101 | int mSelectedDateCount; |
99 | KDateNavigator *mNavigatorView; | 102 | KDateNavigator *mNavigatorView; |
100 | 103 | ||
101 | KCal::Calendar *mCalendar; | 104 | KCal::Calendar *mCalendar; |
102 | 105 | ||
103 | QPtrList<KDateNavigator> mExtraViews; | 106 | Q3PtrList<KDateNavigator> mExtraViews; |
104 | 107 | ||
105 | int mHorizontalCount; | 108 | int mHorizontalCount; |
106 | int mVerticalCount; | 109 | int mVerticalCount; |
107 | }; | 110 | }; |
108 | 111 | ||
109 | #endif | 112 | #endif |
diff --git a/korganizer/filteredit_base.cpp b/korganizer/filteredit_base.cpp index 505edf6..9425963 100644 --- a/korganizer/filteredit_base.cpp +++ b/korganizer/filteredit_base.cpp | |||
@@ -8,78 +8,83 @@ | |||
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | 9 | ||
10 | #include "filteredit_base.h" | 10 | #include "filteredit_base.h" |
11 | 11 | ||
12 | #include <qvariant.h> | 12 | #include <qvariant.h> |
13 | #include <qpushbutton.h> | 13 | #include <qpushbutton.h> |
14 | #include <qframe.h> | 14 | #include <q3frame.h> |
15 | #include <qbuttongroup.h> | 15 | #include <q3buttongroup.h> |
16 | #include <qapplication.h> | 16 | #include <qapplication.h> |
17 | #include <QDesktopWidget> | ||
17 | #include <qradiobutton.h> | 18 | #include <qradiobutton.h> |
18 | #include <qlistbox.h> | 19 | #include <q3listbox.h> |
19 | #include <qlabel.h> | 20 | #include <qlabel.h> |
20 | #include <qcheckbox.h> | 21 | #include <qcheckbox.h> |
21 | #include <qlayout.h> | 22 | #include <qlayout.h> |
22 | #include <qtooltip.h> | 23 | #include <qtooltip.h> |
23 | #include <qwhatsthis.h> | 24 | #include <q3whatsthis.h> |
25 | //Added by qt3to4: | ||
26 | #include <Q3GridLayout> | ||
27 | #include <Q3HBoxLayout> | ||
28 | #include <Q3VBoxLayout> | ||
24 | #include "tr.h" | 29 | #include "tr.h" |
25 | 30 | ||
26 | /* | 31 | /* |
27 | * Constructs a FilterEdit_base as a child of 'parent', with the | 32 | * Constructs a FilterEdit_base as a child of 'parent', with the |
28 | * name 'name' and widget flags set to 'f'. | 33 | * name 'name' and widget flags set to 'f'. |
29 | */ | 34 | */ |
30 | FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) | 35 | FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, Qt::WFlags fl ) |
31 | : QWidget( parent, name, fl ) | 36 | : QWidget( parent, name, fl ) |
32 | { | 37 | { |
33 | if ( !name ) | 38 | if ( !name ) |
34 | setName( "FilterEdit_base" ); | 39 | setName( "FilterEdit_base" ); |
35 | FilterEdit_baseLayout = new QVBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); | 40 | FilterEdit_baseLayout = new Q3VBoxLayout( this, 0, 0, "FilterEdit_baseLayout"); |
36 | 41 | ||
37 | mCriteriaFrame = new QFrame( this, "mCriteriaFrame" ); | 42 | mCriteriaFrame = new Q3Frame( this, "mCriteriaFrame" ); |
38 | mCriteriaFrame->setFrameShape( QFrame::StyledPanel ); | 43 | mCriteriaFrame->setFrameShape( Q3Frame::StyledPanel ); |
39 | mCriteriaFrame->setFrameShadow( QFrame::Raised ); | 44 | mCriteriaFrame->setFrameShadow( Q3Frame::Raised ); |
40 | mCriteriaFrameLayout = new QVBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout"); | 45 | mCriteriaFrameLayout = new Q3VBoxLayout( mCriteriaFrame, 3, 2, "mCriteriaFrameLayout"); |
41 | 46 | ||
42 | ButtonGroup1 = new QButtonGroup( mCriteriaFrame, "ButtonGroup1" ); | 47 | ButtonGroup1 = new Q3ButtonGroup( mCriteriaFrame, "ButtonGroup1" ); |
43 | ButtonGroup1->setColumnLayout(0, Qt::Vertical ); | 48 | ButtonGroup1->setColumnLayout(0, Qt::Vertical ); |
44 | ButtonGroup1->layout()->setSpacing( 6 ); | 49 | ButtonGroup1->layout()->setSpacing( 6 ); |
45 | ButtonGroup1->layout()->setMargin( 6 ); | 50 | ButtonGroup1->layout()->setMargin( 6 ); |
46 | ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() ); | 51 | ButtonGroup1Layout = new Q3GridLayout( ButtonGroup1->layout() ); |
47 | ButtonGroup1Layout->setAlignment( Qt::AlignTop ); | 52 | ButtonGroup1Layout->setAlignment( Qt::AlignTop ); |
48 | 53 | ||
49 | layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); | 54 | layout4 = new Q3HBoxLayout( 0, 0, 6, "layout4"); |
50 | 55 | ||
51 | mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" ); | 56 | mCatShowCheck = new QRadioButton( ButtonGroup1, "mCatShowCheck" ); |
52 | layout4->addWidget( mCatShowCheck ); | 57 | layout4->addWidget( mCatShowCheck ); |
53 | 58 | ||
54 | mCatHideCheck = new QRadioButton( ButtonGroup1, "mCatHideCheck" ); | 59 | mCatHideCheck = new QRadioButton( ButtonGroup1, "mCatHideCheck" ); |
55 | layout4->addWidget( mCatHideCheck ); | 60 | layout4->addWidget( mCatHideCheck ); |
56 | 61 | ||
57 | mCatEditButton = new QPushButton( ButtonGroup1, "mCatEditButton" ); | 62 | mCatEditButton = new QPushButton( ButtonGroup1, "mCatEditButton" ); |
58 | layout4->addWidget( mCatEditButton ); | 63 | layout4->addWidget( mCatEditButton ); |
59 | 64 | ||
60 | ButtonGroup1Layout->addLayout( layout4, 0, 0 ); | 65 | ButtonGroup1Layout->addLayout( layout4, 0, 0 ); |
61 | 66 | ||
62 | mCatList = new QListBox( ButtonGroup1, "mCatList" ); | 67 | mCatList = new Q3ListBox( ButtonGroup1, "mCatList" ); |
63 | 68 | ||
64 | ButtonGroup1Layout->addWidget( mCatList, 1, 0 ); | 69 | ButtonGroup1Layout->addWidget( mCatList, 1, 0 ); |
65 | mCriteriaFrameLayout->addWidget( ButtonGroup1 ); | 70 | mCriteriaFrameLayout->addWidget( ButtonGroup1 ); |
66 | 71 | ||
67 | layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); | 72 | layout7 = new Q3HBoxLayout( 0, 0, 6, "layout7"); |
68 | 73 | ||
69 | textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" ); | 74 | textLabel1 = new QLabel( mCriteriaFrame, "textLabel1" ); |
70 | layout7->addWidget( textLabel1 ); | 75 | layout7->addWidget( textLabel1 ); |
71 | 76 | ||
72 | mRecurringCheck = new QCheckBox( mCriteriaFrame, "mRecurringCheck" ); | 77 | mRecurringCheck = new QCheckBox( mCriteriaFrame, "mRecurringCheck" ); |
73 | layout7->addWidget( mRecurringCheck ); | 78 | layout7->addWidget( mRecurringCheck ); |
74 | 79 | ||
75 | mCompletedCheck = new QCheckBox( mCriteriaFrame, "mCompletedCheck" ); | 80 | mCompletedCheck = new QCheckBox( mCriteriaFrame, "mCompletedCheck" ); |
76 | layout7->addWidget( mCompletedCheck ); | 81 | layout7->addWidget( mCompletedCheck ); |
77 | mCriteriaFrameLayout->addLayout( layout7 ); | 82 | mCriteriaFrameLayout->addLayout( layout7 ); |
78 | 83 | ||
79 | layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); | 84 | layout9 = new Q3HBoxLayout( 0, 0, 6, "layout9"); |
80 | 85 | ||
81 | textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" ); | 86 | textLabel1_2 = new QLabel( mCriteriaFrame, "textLabel1_2" ); |
82 | layout9->addWidget( textLabel1_2 ); | 87 | layout9->addWidget( textLabel1_2 ); |
83 | 88 | ||
84 | mEventCheck = new QCheckBox( mCriteriaFrame, "mEventCheck" ); | 89 | mEventCheck = new QCheckBox( mCriteriaFrame, "mEventCheck" ); |
85 | layout9->addWidget( mEventCheck ); | 90 | layout9->addWidget( mEventCheck ); |
@@ -88,13 +93,13 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) | |||
88 | layout9->addWidget( mTodoCheck ); | 93 | layout9->addWidget( mTodoCheck ); |
89 | 94 | ||
90 | mJournalCheck = new QCheckBox( mCriteriaFrame, "mJournalCheck" ); | 95 | mJournalCheck = new QCheckBox( mCriteriaFrame, "mJournalCheck" ); |
91 | layout9->addWidget( mJournalCheck ); | 96 | layout9->addWidget( mJournalCheck ); |
92 | mCriteriaFrameLayout->addLayout( layout9 ); | 97 | mCriteriaFrameLayout->addLayout( layout9 ); |
93 | 98 | ||
94 | layout2 = new QHBoxLayout( 0, 0, 0, "layout2"); | 99 | layout2 = new Q3HBoxLayout( 0, 0, 0, "layout2"); |
95 | 100 | ||
96 | textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" ); | 101 | textLabel2 = new QLabel( mCriteriaFrame, "textLabel2" ); |
97 | layout2->addWidget( textLabel2 ); | 102 | layout2->addWidget( textLabel2 ); |
98 | 103 | ||
99 | mPublicCheck = new QCheckBox( mCriteriaFrame, "mPublicCheck" ); | 104 | mPublicCheck = new QCheckBox( mCriteriaFrame, "mPublicCheck" ); |
100 | layout2->addWidget( mPublicCheck ); | 105 | layout2->addWidget( mPublicCheck ); |
@@ -106,13 +111,12 @@ FilterEdit_base::FilterEdit_base( QWidget* parent, const char* name, WFlags fl ) | |||
106 | mConfidentialCheck->setChecked( FALSE ); | 111 | mConfidentialCheck->setChecked( FALSE ); |
107 | layout2->addWidget( mConfidentialCheck ); | 112 | layout2->addWidget( mConfidentialCheck ); |
108 | mCriteriaFrameLayout->addLayout( layout2 ); | 113 | mCriteriaFrameLayout->addLayout( layout2 ); |
109 | FilterEdit_baseLayout->addWidget( mCriteriaFrame ); | 114 | FilterEdit_baseLayout->addWidget( mCriteriaFrame ); |
110 | languageChange(); | 115 | languageChange(); |
111 | resize( QSize(300, 200).expandedTo(minimumSizeHint()) ); | 116 | resize( QSize(300, 200).expandedTo(minimumSizeHint()) ); |
112 | clearWState( WState_Polished ); | ||
113 | } | 117 | } |
114 | 118 | ||
115 | /* | 119 | /* |
116 | * Destroys the object and frees any allocated resources | 120 | * Destroys the object and frees any allocated resources |
117 | */ | 121 | */ |
118 | FilterEdit_base::~FilterEdit_base() | 122 | FilterEdit_base::~FilterEdit_base() |
diff --git a/korganizer/filteredit_base.h b/korganizer/filteredit_base.h index 13a02c3..135f6fa 100644 --- a/korganizer/filteredit_base.h +++ b/korganizer/filteredit_base.h | |||
@@ -9,40 +9,46 @@ | |||
9 | 9 | ||
10 | #ifndef FILTEREDIT_BASE_H | 10 | #ifndef FILTEREDIT_BASE_H |
11 | #define FILTEREDIT_BASE_H | 11 | #define FILTEREDIT_BASE_H |
12 | 12 | ||
13 | #include <qvariant.h> | 13 | #include <qvariant.h> |
14 | #include <qwidget.h> | 14 | #include <qwidget.h> |
15 | //Added by qt3to4: | ||
16 | #include <Q3VBoxLayout> | ||
17 | #include <Q3Frame> | ||
18 | #include <Q3GridLayout> | ||
19 | #include <Q3HBoxLayout> | ||
20 | #include <QLabel> | ||
15 | 21 | ||
16 | class QVBoxLayout; | 22 | class Q3VBoxLayout; |
17 | class QHBoxLayout; | 23 | class Q3HBoxLayout; |
18 | class QGridLayout; | 24 | class Q3GridLayout; |
19 | class QSpacerItem; | 25 | class QSpacerItem; |
20 | class QFrame; | 26 | class Q3Frame; |
21 | class QButtonGroup; | 27 | class Q3ButtonGroup; |
22 | class QRadioButton; | 28 | class QRadioButton; |
23 | class QPushButton; | 29 | class QPushButton; |
24 | class QListBox; | 30 | class Q3ListBox; |
25 | class QListBoxItem; | 31 | class Q3ListBoxItem; |
26 | class QLabel; | 32 | class QLabel; |
27 | class QCheckBox; | 33 | class QCheckBox; |
28 | 34 | ||
29 | class FilterEdit_base : public QWidget | 35 | class FilterEdit_base : public QWidget |
30 | { | 36 | { |
31 | Q_OBJECT | 37 | Q_OBJECT |
32 | 38 | ||
33 | public: | 39 | public: |
34 | FilterEdit_base( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 40 | FilterEdit_base( QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0 ); |
35 | ~FilterEdit_base(); | 41 | ~FilterEdit_base(); |
36 | 42 | ||
37 | QFrame* mCriteriaFrame; | 43 | Q3Frame* mCriteriaFrame; |
38 | QButtonGroup* ButtonGroup1; | 44 | Q3ButtonGroup* ButtonGroup1; |
39 | QRadioButton* mCatShowCheck; | 45 | QRadioButton* mCatShowCheck; |
40 | QRadioButton* mCatHideCheck; | 46 | QRadioButton* mCatHideCheck; |
41 | QPushButton* mCatEditButton; | 47 | QPushButton* mCatEditButton; |
42 | QListBox* mCatList; | 48 | Q3ListBox* mCatList; |
43 | QLabel* textLabel1; | 49 | QLabel* textLabel1; |
44 | QCheckBox* mRecurringCheck; | 50 | QCheckBox* mRecurringCheck; |
45 | QCheckBox* mCompletedCheck; | 51 | QCheckBox* mCompletedCheck; |
46 | QLabel* textLabel1_2; | 52 | QLabel* textLabel1_2; |
47 | QCheckBox* mEventCheck; | 53 | QCheckBox* mEventCheck; |
48 | QCheckBox* mTodoCheck; | 54 | QCheckBox* mTodoCheck; |
@@ -50,19 +56,19 @@ public: | |||
50 | QLabel* textLabel2; | 56 | QLabel* textLabel2; |
51 | QCheckBox* mPublicCheck; | 57 | QCheckBox* mPublicCheck; |
52 | QCheckBox* mPrivateCheck; | 58 | QCheckBox* mPrivateCheck; |
53 | QCheckBox* mConfidentialCheck; | 59 | QCheckBox* mConfidentialCheck; |
54 | 60 | ||
55 | protected: | 61 | protected: |
56 | QVBoxLayout* FilterEdit_baseLayout; | 62 | Q3VBoxLayout* FilterEdit_baseLayout; |
57 | QVBoxLayout* mCriteriaFrameLayout; | 63 | Q3VBoxLayout* mCriteriaFrameLayout; |
58 | QGridLayout* ButtonGroup1Layout; | 64 | Q3GridLayout* ButtonGroup1Layout; |
59 | QHBoxLayout* layout4; | 65 | Q3HBoxLayout* layout4; |
60 | QHBoxLayout* layout7; | 66 | Q3HBoxLayout* layout7; |
61 | QHBoxLayout* layout9; | 67 | Q3HBoxLayout* layout9; |
62 | QHBoxLayout* layout2; | 68 | Q3HBoxLayout* layout2; |
63 | 69 | ||
64 | protected slots: | 70 | protected slots: |
65 | virtual void languageChange(); | 71 | virtual void languageChange(); |
66 | 72 | ||
67 | }; | 73 | }; |
68 | 74 | ||
diff --git a/korganizer/filtereditdialog.cpp b/korganizer/filtereditdialog.cpp index df84911..a3cff49 100644 --- a/korganizer/filtereditdialog.cpp +++ b/korganizer/filtereditdialog.cpp | |||
@@ -23,14 +23,19 @@ | |||
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qpushbutton.h> | 25 | #include <qpushbutton.h> |
26 | #include <qcombobox.h> | 26 | #include <qcombobox.h> |
27 | #include <qcheckbox.h> | 27 | #include <qcheckbox.h> |
28 | #include <qradiobutton.h> | 28 | #include <qradiobutton.h> |
29 | #include <qlistbox.h> | 29 | #include <q3listbox.h> |
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | //Added by qt3to4: | ||
32 | #include <Q3GridLayout> | ||
33 | #include <Q3PtrList> | ||
34 | |||
35 | #include <QDesktopWidget> | ||
31 | 36 | ||
32 | #include <kdebug.h> | 37 | #include <kdebug.h> |
33 | #include <klocale.h> | 38 | #include <klocale.h> |
34 | #include <klineeditdlg.h> | 39 | #include <klineeditdlg.h> |
35 | #include <kmessagebox.h> | 40 | #include <kmessagebox.h> |
36 | 41 | ||
@@ -50,13 +55,13 @@ public: | |||
50 | ComboFilterBox( QWidget *parent=0, const char *name=0) : | 55 | ComboFilterBox( QWidget *parent=0, const char *name=0) : |
51 | QComboBox( parent,name ) { } | 56 | QComboBox( parent,name ) { } |
52 | void popupBox() { popup(); } | 57 | void popupBox() { popup(); } |
53 | 58 | ||
54 | }; | 59 | }; |
55 | 60 | ||
56 | FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent, | 61 | FilterEditDialog::FilterEditDialog(Q3PtrList<CalFilter> *filters,QWidget *parent, |
57 | const char *name) : | 62 | const char *name) : |
58 | KDialogBase(parent,name,true,i18n("Edit Calendar Filters"), | 63 | KDialogBase(parent,name,true,i18n("Edit Calendar Filters"), |
59 | Ok|Apply|Cancel) | 64 | Ok|Apply|Cancel) |
60 | { | 65 | { |
61 | mFilters = filters; | 66 | mFilters = filters; |
62 | 67 | ||
@@ -77,13 +82,13 @@ FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent, | |||
77 | upButton->setMaximumSize( upButton->sizeHint()); | 82 | upButton->setMaximumSize( upButton->sizeHint()); |
78 | connect(upButton,SIGNAL(clicked()),SLOT(slotUp())); | 83 | connect(upButton,SIGNAL(clicked()),SLOT(slotUp())); |
79 | 84 | ||
80 | 85 | ||
81 | mEditor = new FilterEdit_base(mainWidget); | 86 | mEditor = new FilterEdit_base(mainWidget); |
82 | 87 | ||
83 | QGridLayout *topLayout = new QGridLayout(mainWidget,2,2); | 88 | Q3GridLayout *topLayout = new Q3GridLayout(mainWidget,2,2); |
84 | topLayout->setSpacing(spacingHint()); | 89 | topLayout->setSpacing(spacingHint()); |
85 | topLayout->addWidget(mSelectionCombo,0,0); | 90 | topLayout->addWidget(mSelectionCombo,0,0); |
86 | topLayout->addWidget(upButton,0,1); | 91 | topLayout->addWidget(upButton,0,1); |
87 | topLayout->addWidget(addButton,0,2); | 92 | topLayout->addWidget(addButton,0,2); |
88 | topLayout->addWidget(mRemoveButton,0,3); | 93 | topLayout->addWidget(mRemoveButton,0,3); |
89 | topLayout->addMultiCellWidget(mEditor,1,1,0,3); | 94 | topLayout->addMultiCellWidget(mEditor,1,1,0,3); |
diff --git a/korganizer/filtereditdialog.h b/korganizer/filtereditdialog.h index 42aa3da..c1a52ed 100644 --- a/korganizer/filtereditdialog.h +++ b/korganizer/filtereditdialog.h | |||
@@ -20,13 +20,13 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _FILTEREDITDIALOG_H | 23 | #ifndef _FILTEREDITDIALOG_H |
24 | #define _FILTEREDITDIALOG_H | 24 | #define _FILTEREDITDIALOG_H |
25 | 25 | ||
26 | #include <qptrlist.h> | 26 | #include <q3ptrlist.h> |
27 | 27 | ||
28 | #include <kdialogbase.h> | 28 | #include <kdialogbase.h> |
29 | 29 | ||
30 | #include <libkcal/calfilter.h> | 30 | #include <libkcal/calfilter.h> |
31 | 31 | ||
32 | class QComboBox; | 32 | class QComboBox; |
@@ -43,13 +43,13 @@ using namespace KCal; | |||
43 | @author Cornelius Schumacher | 43 | @author Cornelius Schumacher |
44 | */ | 44 | */ |
45 | class FilterEditDialog : public KDialogBase | 45 | class FilterEditDialog : public KDialogBase |
46 | { | 46 | { |
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | public: | 48 | public: |
49 | FilterEditDialog(QPtrList<CalFilter> *,QWidget *parent=0, const char *name=0); | 49 | FilterEditDialog(Q3PtrList<CalFilter> *,QWidget *parent=0, const char *name=0); |
50 | virtual ~FilterEditDialog(); | 50 | virtual ~FilterEditDialog(); |
51 | 51 | ||
52 | public slots: | 52 | public slots: |
53 | void updateFilterList(); | 53 | void updateFilterList(); |
54 | 54 | ||
55 | signals: | 55 | signals: |
@@ -71,13 +71,13 @@ class FilterEditDialog : public KDialogBase | |||
71 | 71 | ||
72 | protected: | 72 | protected: |
73 | void readFilter(CalFilter *); | 73 | void readFilter(CalFilter *); |
74 | void writeFilter(CalFilter *); | 74 | void writeFilter(CalFilter *); |
75 | 75 | ||
76 | private: | 76 | private: |
77 | QPtrList<CalFilter> *mFilters; | 77 | Q3PtrList<CalFilter> *mFilters; |
78 | 78 | ||
79 | ComboFilterBox *mSelectionCombo; | 79 | ComboFilterBox *mSelectionCombo; |
80 | QPushButton *mRemoveButton; | 80 | QPushButton *mRemoveButton; |
81 | FilterEdit_base *mEditor; | 81 | FilterEdit_base *mEditor; |
82 | 82 | ||
83 | QStringList mCategories; | 83 | QStringList mCategories; |
diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp index fe78356..c2402d4 100644 --- a/korganizer/incomingdialog.cpp +++ b/korganizer/incomingdialog.cpp | |||
@@ -14,16 +14,18 @@ | |||
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlistview.h> | 20 | #include <q3listview.h> |
21 | #include <qfile.h> | 21 | #include <qfile.h> |
22 | #include <qdir.h> | 22 | #include <qdir.h> |
23 | #include <qmap.h> | 23 | #include <qmap.h> |
24 | //Added by qt3to4: | ||
25 | #include <Q3PtrList> | ||
24 | 26 | ||
25 | #include <kglobal.h> | 27 | #include <kglobal.h> |
26 | #include <klocale.h> | 28 | #include <klocale.h> |
27 | #include <kdebug.h> | 29 | #include <kdebug.h> |
28 | #include <kstandarddirs.h> | 30 | #include <kstandarddirs.h> |
29 | #include <kmessagebox.h> | 31 | #include <kmessagebox.h> |
@@ -53,15 +55,15 @@ | |||
53 | #define KORG_NOKABC | 55 | #define KORG_NOKABC |
54 | //#include <kabc/stdaddressbook.h> | 56 | //#include <kabc/stdaddressbook.h> |
55 | #define size count | 57 | #define size count |
56 | #endif | 58 | #endif |
57 | 59 | ||
58 | 60 | ||
59 | ScheduleItemIn::ScheduleItemIn(QListView *parent,IncidenceBase *ev, | 61 | ScheduleItemIn::ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev, |
60 | Scheduler::Method method,ScheduleMessage::Status status) | 62 | Scheduler::Method method,ScheduleMessage::Status status) |
61 | : QListViewItem(parent) | 63 | : Q3ListViewItem(parent) |
62 | { | 64 | { |
63 | mIncidence = ev; | 65 | mIncidence = ev; |
64 | mMethod = method; | 66 | mMethod = method; |
65 | mStatus = status; | 67 | mStatus = status; |
66 | setText(6,Scheduler::translatedMethodName(mMethod)+" "); | 68 | setText(6,Scheduler::translatedMethodName(mMethod)+" "); |
67 | setText(7,ScheduleMessage::statusName(status)); | 69 | setText(7,ScheduleMessage::statusName(status)); |
@@ -132,28 +134,28 @@ bool ScheduleItemVisitor::visit(Journal *) | |||
132 | * name 'name' and widget flags set to 'f' | 134 | * name 'name' and widget flags set to 'f' |
133 | * | 135 | * |
134 | * The dialog will by default be modeless, unless you set 'modal' to | 136 | * The dialog will by default be modeless, unless you set 'modal' to |
135 | * TRUE to construct a modal dialog. | 137 | * TRUE to construct a modal dialog. |
136 | */ | 138 | */ |
137 | IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, | 139 | IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, |
138 | QWidget* parent,const char* name,bool modal,WFlags fl) : | 140 | QWidget* parent,const char* name,bool modal,Qt::WFlags fl) : |
139 | IncomingDialog_base(parent,name,modal,fl) | 141 | IncomingDialog_base(parent,name,modal,fl) |
140 | { | 142 | { |
141 | mCalendar = calendar; | 143 | mCalendar = calendar; |
142 | mOutgoing = outgoing; | 144 | mOutgoing = outgoing; |
143 | #ifndef KORG_NOMAIL | 145 | #ifndef KORG_NOMAIL |
144 | mScheduler = new MailScheduler(mCalendar); | 146 | mScheduler = new MailScheduler(mCalendar); |
145 | #else | 147 | #else |
146 | mScheduler = new DummyScheduler(mCalendar); | 148 | mScheduler = new DummyScheduler(mCalendar); |
147 | #endif | 149 | #endif |
148 | mMessageListView->setColumnAlignment(1,AlignHCenter); | 150 | mMessageListView->setColumnAlignment(1,Qt::AlignHCenter); |
149 | mMessageListView->setColumnAlignment(2,AlignHCenter); | 151 | mMessageListView->setColumnAlignment(2,Qt::AlignHCenter); |
150 | mMessageListView->setColumnAlignment(3,AlignHCenter); | 152 | mMessageListView->setColumnAlignment(3,Qt::AlignHCenter); |
151 | mMessageListView->setColumnAlignment(4,AlignHCenter); | 153 | mMessageListView->setColumnAlignment(4,Qt::AlignHCenter); |
152 | QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), | 154 | QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)), |
153 | this,SLOT(showEvent(QListViewItem *))); | 155 | this,SLOT(showEvent(Q3ListViewItem *))); |
154 | retrieve(); | 156 | retrieve(); |
155 | } | 157 | } |
156 | 158 | ||
157 | /* | 159 | /* |
158 | * Destroys the object and frees any allocated resources | 160 | * Destroys the object and frees any allocated resources |
159 | */ | 161 | */ |
@@ -166,13 +168,13 @@ void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing) | |||
166 | { | 168 | { |
167 | mOutgoing = outgoing; | 169 | mOutgoing = outgoing; |
168 | } | 170 | } |
169 | 171 | ||
170 | void IncomingDialog::retrieve() | 172 | void IncomingDialog::retrieve() |
171 | { | 173 | { |
172 | QPtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions(); | 174 | Q3PtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions(); |
173 | 175 | ||
174 | ScheduleMessage *message; | 176 | ScheduleMessage *message; |
175 | for(message = messages.first();message;message = messages.next()) { | 177 | for(message = messages.first();message;message = messages.next()) { |
176 | IncidenceBase *inc = message->event(); | 178 | IncidenceBase *inc = message->event(); |
177 | Scheduler::Method method = (Scheduler::Method)message->method(); | 179 | Scheduler::Method method = (Scheduler::Method)message->method(); |
178 | ScheduleMessage::Status status = message->status(); | 180 | ScheduleMessage::Status status = message->status(); |
@@ -249,13 +251,13 @@ void IncomingDialog::rejectMessage() | |||
249 | mScheduler->deleteTransaction(item->event()); | 251 | mScheduler->deleteTransaction(item->event()); |
250 | delete item; | 252 | delete item; |
251 | emit numMessagesChanged(mMessageListView->childCount()); | 253 | emit numMessagesChanged(mMessageListView->childCount()); |
252 | } | 254 | } |
253 | } | 255 | } |
254 | 256 | ||
255 | void IncomingDialog::showEvent(QListViewItem *item) | 257 | void IncomingDialog::showEvent(Q3ListViewItem *item) |
256 | { | 258 | { |
257 | IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); | 259 | IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); |
258 | if( incidence && incidence->typeID() == eventID ) { | 260 | if( incidence && incidence->typeID() == eventID ) { |
259 | Event *event = static_cast<Event *>(incidence); | 261 | Event *event = static_cast<Event *>(incidence); |
260 | KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); | 262 | KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); |
261 | eventViewer->setEvent(event); | 263 | eventViewer->setEvent(event); |
@@ -266,13 +268,13 @@ void IncomingDialog::showEvent(QListViewItem *item) | |||
266 | bool IncomingDialog::incomeRefresh(ScheduleItemIn *item) | 268 | bool IncomingDialog::incomeRefresh(ScheduleItemIn *item) |
267 | { | 269 | { |
268 | Event *ev = mCalendar->event(item->event()->uid()); | 270 | Event *ev = mCalendar->event(item->event()->uid()); |
269 | if (ev) { | 271 | if (ev) { |
270 | //user interaction before?? | 272 | //user interaction before?? |
271 | Attendee *att; | 273 | Attendee *att; |
272 | QPtrList<Attendee> attlist = ev->attendees(); | 274 | Q3PtrList<Attendee> attlist = ev->attendees(); |
273 | for (att=attlist.first(); att; att=attlist.next()) { | 275 | for (att=attlist.first(); att; att=attlist.next()) { |
274 | Event *event = new Event(*ev); | 276 | Event *event = new Event(*ev); |
275 | mOutgoing->addMessage(event,Scheduler::Request,att->email()); | 277 | mOutgoing->addMessage(event,Scheduler::Request,att->email()); |
276 | delete(event); | 278 | delete(event); |
277 | } | 279 | } |
278 | mScheduler->deleteTransaction(item->event()); | 280 | mScheduler->deleteTransaction(item->event()); |
@@ -511,13 +513,13 @@ bool IncomingDialog::checkOrganizerInAddressbook(QString organizer) | |||
511 | bool IncomingDialog::checkAttendeesInAddressbook(IncidenceBase *inc) | 513 | bool IncomingDialog::checkAttendeesInAddressbook(IncidenceBase *inc) |
512 | { | 514 | { |
513 | bool inBook = false; | 515 | bool inBook = false; |
514 | #ifndef KORG_NOKABC | 516 | #ifndef KORG_NOKABC |
515 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 517 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
516 | KABC::Addressee::List addressList; | 518 | KABC::Addressee::List addressList; |
517 | QPtrList <Attendee> attendees; | 519 | Q3PtrList <Attendee> attendees; |
518 | Attendee *att; | 520 | Attendee *att; |
519 | attendees = inc->attendees(); | 521 | attendees = inc->attendees(); |
520 | for (att=attendees.first();att;att=attendees.next()) { | 522 | for (att=attendees.first();att;att=attendees.next()) { |
521 | addressList = add_book->findByEmail(att->email()); | 523 | addressList = add_book->findByEmail(att->email()); |
522 | if (addressList.size()>0 ) inBook = true; | 524 | if (addressList.size()>0 ) inBook = true; |
523 | } | 525 | } |
diff --git a/korganizer/incomingdialog.h b/korganizer/incomingdialog.h index 413ce6a..e002b25 100644 --- a/korganizer/incomingdialog.h +++ b/korganizer/incomingdialog.h | |||
@@ -16,26 +16,26 @@ | |||
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | #ifndef INCOMINGDIALOG_H | 19 | #ifndef INCOMINGDIALOG_H |
20 | #define INCOMINGDIALOG_H | 20 | #define INCOMINGDIALOG_H |
21 | 21 | ||
22 | #include <qlistview.h> | 22 | #include <q3listview.h> |
23 | 23 | ||
24 | #include <libkcal/calendar.h> | 24 | #include <libkcal/calendar.h> |
25 | #include <libkcal/scheduler.h> | 25 | #include <libkcal/scheduler.h> |
26 | 26 | ||
27 | #include "incomingdialog_base.h" | 27 | #include "incomingdialog_base.h" |
28 | #include "outgoingdialog.h" | 28 | #include "outgoingdialog.h" |
29 | 29 | ||
30 | using namespace KCal; | 30 | using namespace KCal; |
31 | 31 | ||
32 | class ScheduleItemIn : public QListViewItem | 32 | class ScheduleItemIn : public Q3ListViewItem |
33 | { | 33 | { |
34 | public: | 34 | public: |
35 | ScheduleItemIn(QListView *parent,IncidenceBase *ev,Scheduler::Method method, | 35 | ScheduleItemIn(Q3ListView *parent,IncidenceBase *ev,Scheduler::Method method, |
36 | ScheduleMessage::Status status); | 36 | ScheduleMessage::Status status); |
37 | virtual ~ScheduleItemIn() {} | 37 | virtual ~ScheduleItemIn() {} |
38 | 38 | ||
39 | IncidenceBase *event() { return mIncidence; } | 39 | IncidenceBase *event() { return mIncidence; } |
40 | Scheduler::Method method() { return mMethod; } | 40 | Scheduler::Method method() { return mMethod; } |
41 | ScheduleMessage::Status status() { return mStatus; } | 41 | ScheduleMessage::Status status() { return mStatus; } |
@@ -69,13 +69,13 @@ class ScheduleItemVisitor : public Incidence::Visitor | |||
69 | 69 | ||
70 | class IncomingDialog : public IncomingDialog_base | 70 | class IncomingDialog : public IncomingDialog_base |
71 | { | 71 | { |
72 | Q_OBJECT | 72 | Q_OBJECT |
73 | public: | 73 | public: |
74 | IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, | 74 | IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing, |
75 | QWidget* parent=0,const char* name=0,bool modal=false,WFlags fl=0); | 75 | QWidget* parent=0,const char* name=0,bool modal=false,Qt::WFlags fl=0); |
76 | ~IncomingDialog(); | 76 | ~IncomingDialog(); |
77 | 77 | ||
78 | void setOutgoingDialog(OutgoingDialog *outgoing); | 78 | void setOutgoingDialog(OutgoingDialog *outgoing); |
79 | 79 | ||
80 | signals: | 80 | signals: |
81 | void calendarUpdated(); | 81 | void calendarUpdated(); |
@@ -84,13 +84,13 @@ class IncomingDialog : public IncomingDialog_base | |||
84 | void retrieve(); | 84 | void retrieve(); |
85 | 85 | ||
86 | protected slots: | 86 | protected slots: |
87 | void acceptAllMessages(); | 87 | void acceptAllMessages(); |
88 | void acceptMessage(); | 88 | void acceptMessage(); |
89 | void rejectMessage(); | 89 | void rejectMessage(); |
90 | void showEvent(QListViewItem *); | 90 | void showEvent(Q3ListViewItem *); |
91 | 91 | ||
92 | protected: | 92 | protected: |
93 | bool acceptMessage(ScheduleItemIn *item); | 93 | bool acceptMessage(ScheduleItemIn *item); |
94 | bool incomeRefresh(ScheduleItemIn *item); | 94 | bool incomeRefresh(ScheduleItemIn *item); |
95 | bool incomeCounter(ScheduleItemIn *item); | 95 | bool incomeCounter(ScheduleItemIn *item); |
96 | bool incomeDeclineCounter(ScheduleItemIn *item); | 96 | bool incomeDeclineCounter(ScheduleItemIn *item); |
diff --git a/korganizer/incomingdialog_base.cpp b/korganizer/incomingdialog_base.cpp index 8589803..5c5ace4 100644 --- a/korganizer/incomingdialog_base.cpp +++ b/korganizer/incomingdialog_base.cpp | |||
@@ -8,44 +8,46 @@ | |||
8 | ** WARNING! All changes made in this file will be lost! | 8 | ** WARNING! All changes made in this file will be lost! |
9 | ****************************************************************************/ | 9 | ****************************************************************************/ |
10 | 10 | ||
11 | #include "incomingdialog_base.h" | 11 | #include "incomingdialog_base.h" |
12 | 12 | ||
13 | #include <qvariant.h> | 13 | #include <qvariant.h> |
14 | #include <qheader.h> | 14 | #include <q3header.h> |
15 | #include <qlistview.h> | 15 | #include <q3listview.h> |
16 | #include <qpushbutton.h> | 16 | #include <qpushbutton.h> |
17 | #include <qlayout.h> | 17 | #include <qlayout.h> |
18 | #include <qtooltip.h> | 18 | #include <qtooltip.h> |
19 | #include <qwhatsthis.h> | 19 | #include <q3whatsthis.h> |
20 | //Added by qt3to4: | ||
21 | #include <Q3GridLayout> | ||
20 | 22 | ||
21 | /* | 23 | /* |
22 | * Constructs a IncomingDialog_base as a child of 'parent', with the | 24 | * Constructs a IncomingDialog_base as a child of 'parent', with the |
23 | * name 'name' and widget flags set to 'f'. | 25 | * name 'name' and widget flags set to 'f'. |
24 | * | 26 | * |
25 | * The dialog will by default be modeless, unless you set 'modal' to | 27 | * The dialog will by default be modeless, unless you set 'modal' to |
26 | * TRUE to construct a modal dialog. | 28 | * TRUE to construct a modal dialog. |
27 | */ | 29 | */ |
28 | IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) | 30 | IncomingDialog_base::IncomingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) |
29 | : QDialog( parent, name, modal, fl ) | 31 | : QDialog( parent, name, modal, fl ) |
30 | 32 | ||
31 | { | 33 | { |
32 | if ( !name ) | 34 | if ( !name ) |
33 | setName( "IncomingDialog_base" ); | 35 | setName( "IncomingDialog_base" ); |
34 | IncomingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout"); | 36 | IncomingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "IncomingDialog_baseLayout"); |
35 | 37 | ||
36 | PushButton4 = new QPushButton( this, "PushButton4" ); | 38 | PushButton4 = new QPushButton( this, "PushButton4" ); |
37 | 39 | ||
38 | IncomingDialog_baseLayout->addWidget( PushButton4, 0, 1 ); | 40 | IncomingDialog_baseLayout->addWidget( PushButton4, 0, 1 ); |
39 | 41 | ||
40 | PushButton7 = new QPushButton( this, "PushButton7" ); | 42 | PushButton7 = new QPushButton( this, "PushButton7" ); |
41 | PushButton7->setDefault( TRUE ); | 43 | PushButton7->setDefault( TRUE ); |
42 | 44 | ||
43 | IncomingDialog_baseLayout->addWidget( PushButton7, 5, 1 ); | 45 | IncomingDialog_baseLayout->addWidget( PushButton7, 5, 1 ); |
44 | 46 | ||
45 | mMessageListView = new QListView( this, "mMessageListView" ); | 47 | mMessageListView = new Q3ListView( this, "mMessageListView" ); |
46 | mMessageListView->addColumn( tr2i18n( "Summary" ) ); | 48 | mMessageListView->addColumn( tr2i18n( "Summary" ) ); |
47 | mMessageListView->addColumn( tr2i18n( "Start Date" ) ); | 49 | mMessageListView->addColumn( tr2i18n( "Start Date" ) ); |
48 | mMessageListView->addColumn( tr2i18n( "Start Time" ) ); | 50 | mMessageListView->addColumn( tr2i18n( "Start Time" ) ); |
49 | mMessageListView->addColumn( tr2i18n( "End Date" ) ); | 51 | mMessageListView->addColumn( tr2i18n( "End Date" ) ); |
50 | mMessageListView->addColumn( tr2i18n( "End Time" ) ); | 52 | mMessageListView->addColumn( tr2i18n( "End Time" ) ); |
51 | mMessageListView->addColumn( tr2i18n( "Organizer" ) ); | 53 | mMessageListView->addColumn( tr2i18n( "Organizer" ) ); |
diff --git a/korganizer/incomingdialog_base.h b/korganizer/incomingdialog_base.h index 7732384..537ef86 100644 --- a/korganizer/incomingdialog_base.h +++ b/korganizer/incomingdialog_base.h | |||
@@ -9,37 +9,41 @@ | |||
9 | 9 | ||
10 | #ifndef INCOMINGDIALOG_BASE_H | 10 | #ifndef INCOMINGDIALOG_BASE_H |
11 | #define INCOMINGDIALOG_BASE_H | 11 | #define INCOMINGDIALOG_BASE_H |
12 | 12 | ||
13 | #include <qvariant.h> | 13 | #include <qvariant.h> |
14 | #include <qdialog.h> | 14 | #include <qdialog.h> |
15 | 15 | //Added by qt3to4: | |
16 | class QVBoxLayout; | 16 | #include <Q3VBoxLayout> |
17 | class QHBoxLayout; | 17 | #include <Q3GridLayout> |
18 | class QGridLayout; | 18 | #include <Q3HBoxLayout> |
19 | class QListView; | 19 | |
20 | class QListViewItem; | 20 | class Q3VBoxLayout; |
21 | class Q3HBoxLayout; | ||
22 | class Q3GridLayout; | ||
23 | class Q3ListView; | ||
24 | class Q3ListViewItem; | ||
21 | class QPushButton; | 25 | class QPushButton; |
22 | 26 | ||
23 | class IncomingDialog_base : public QDialog | 27 | class IncomingDialog_base : public QDialog |
24 | { | 28 | { |
25 | Q_OBJECT | 29 | Q_OBJECT |
26 | 30 | ||
27 | public: | 31 | public: |
28 | IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 32 | IncomingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); |
29 | ~IncomingDialog_base(); | 33 | ~IncomingDialog_base(); |
30 | 34 | ||
31 | QPushButton* PushButton4; | 35 | QPushButton* PushButton4; |
32 | QPushButton* PushButton7; | 36 | QPushButton* PushButton7; |
33 | QListView* mMessageListView; | 37 | Q3ListView* mMessageListView; |
34 | QPushButton* PushButton7_2; | 38 | QPushButton* PushButton7_2; |
35 | QPushButton* PushButton8; | 39 | QPushButton* PushButton8; |
36 | QPushButton* PushButton9; | 40 | QPushButton* PushButton9; |
37 | 41 | ||
38 | protected: | 42 | protected: |
39 | QGridLayout* IncomingDialog_baseLayout; | 43 | Q3GridLayout* IncomingDialog_baseLayout; |
40 | 44 | ||
41 | protected slots: | 45 | protected slots: |
42 | virtual void languageChange(); | 46 | virtual void languageChange(); |
43 | 47 | ||
44 | virtual void acceptAllMessages(); | 48 | virtual void acceptAllMessages(); |
45 | virtual void acceptMessage(); | 49 | virtual void acceptMessage(); |
diff --git a/korganizer/interfaces/korganizer/baseview.h b/korganizer/interfaces/korganizer/baseview.h index 2ac9de1..c828573 100644 --- a/korganizer/interfaces/korganizer/baseview.h +++ b/korganizer/interfaces/korganizer/baseview.h | |||
@@ -21,14 +21,14 @@ | |||
21 | #ifndef KORG_BASEVIEW_H | 21 | #ifndef KORG_BASEVIEW_H |
22 | #define KORG_BASEVIEW_H | 22 | #define KORG_BASEVIEW_H |
23 | // $Id$ | 23 | // $Id$ |
24 | // KOBaseView is the abstract base class of all calendar views. | 24 | // KOBaseView is the abstract base class of all calendar views. |
25 | 25 | ||
26 | #include <qwidget.h> | 26 | #include <qwidget.h> |
27 | #include <qptrlist.h> | 27 | #include <q3ptrlist.h> |
28 | #include <qvaluelist.h> | 28 | #include <q3valuelist.h> |
29 | 29 | ||
30 | #include <klocale.h> | 30 | #include <klocale.h> |
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <kmessagebox.h> | 32 | #include <kmessagebox.h> |
33 | 33 | ||
34 | #include <libkcal/event.h> | 34 | #include <libkcal/event.h> |
@@ -85,13 +85,13 @@ class BaseView : public QWidget | |||
85 | 85 | ||
86 | /** | 86 | /** |
87 | @return a list of selected events. Most views can probably only | 87 | @return a list of selected events. Most views can probably only |
88 | select a single event at a time, but some may be able to select | 88 | select a single event at a time, but some may be able to select |
89 | more than one. | 89 | more than one. |
90 | */ | 90 | */ |
91 | virtual QPtrList<Incidence> selectedIncidences() = 0; | 91 | virtual Q3PtrList<Incidence> selectedIncidences() = 0; |
92 | 92 | ||
93 | /** | 93 | /** |
94 | @return a list of the dates of selected events. Most views can probably only | 94 | @return a list of the dates of selected events. Most views can probably only |
95 | select a single event at a time, but some may be able to select | 95 | select a single event at a time, but some may be able to select |
96 | more than one. | 96 | more than one. |
97 | */ | 97 | */ |
@@ -150,13 +150,13 @@ class BaseView : public QWidget | |||
150 | /** | 150 | /** |
151 | Show given events. Depending on the actual view it might not be possible to | 151 | Show given events. Depending on the actual view it might not be possible to |
152 | show all given events. | 152 | show all given events. |
153 | 153 | ||
154 | @param eventList a list of events to show. | 154 | @param eventList a list of events to show. |
155 | */ | 155 | */ |
156 | virtual void showEvents(QPtrList<Event> eventList) = 0; | 156 | virtual void showEvents(Q3PtrList<Event> eventList) = 0; |
157 | 157 | ||
158 | /** | 158 | /** |
159 | Updates the current display to reflect changes that may have happened | 159 | Updates the current display to reflect changes that may have happened |
160 | in the calendar since the last display refresh. | 160 | in the calendar since the last display refresh. |
161 | */ | 161 | */ |
162 | virtual void updateView() = 0; | 162 | virtual void updateView() = 0; |
diff --git a/korganizer/interfaces/korganizer/calendarviewbase.h b/korganizer/interfaces/korganizer/calendarviewbase.h index 3c715b1..1f49357 100644 --- a/korganizer/interfaces/korganizer/calendarviewbase.h +++ b/korganizer/interfaces/korganizer/calendarviewbase.h | |||
@@ -20,12 +20,14 @@ | |||
20 | #ifndef KORG_CALENDARVIEWBASE_H | 20 | #ifndef KORG_CALENDARVIEWBASE_H |
21 | #define KORG_CALENDARVIEWBASE_H | 21 | #define KORG_CALENDARVIEWBASE_H |
22 | // $Id$ | 22 | // $Id$ |
23 | 23 | ||
24 | #include <qwidget.h> | 24 | #include <qwidget.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | //Added by qt3to4: | ||
27 | #include <Q3VBoxLayout> | ||
26 | 28 | ||
27 | 29 | ||
28 | #include <libkcal/calendar.h> | 30 | #include <libkcal/calendar.h> |
29 | 31 | ||
30 | #include <korganizer/baseview.h> | 32 | #include <korganizer/baseview.h> |
31 | 33 | ||
@@ -37,13 +39,13 @@ namespace KOrg { | |||
37 | */ | 39 | */ |
38 | class CalendarViewBase : public QWidget | 40 | class CalendarViewBase : public QWidget |
39 | { | 41 | { |
40 | Q_OBJECT | 42 | Q_OBJECT |
41 | public: | 43 | public: |
42 | CalendarViewBase(QWidget *parent, const char *name) : | 44 | CalendarViewBase(QWidget *parent, const char *name) : |
43 | QWidget(parent,name) {new QVBoxLayout(this);} | 45 | QWidget(parent,name) {new Q3VBoxLayout(this);} |
44 | virtual ~CalendarViewBase() {}; | 46 | virtual ~CalendarViewBase() {}; |
45 | 47 | ||
46 | virtual KCal::Calendar *calendar() = 0; | 48 | virtual KCal::Calendar *calendar() = 0; |
47 | 49 | ||
48 | virtual QDate startDate() = 0; | 50 | virtual QDate startDate() = 0; |
49 | virtual QDate endDate() = 0; | 51 | virtual QDate endDate() = 0; |
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 5269af7..2814c61 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -23,20 +23,27 @@ | |||
23 | 23 | ||
24 | // | 24 | // |
25 | // Journal Entry | 25 | // Journal Entry |
26 | 26 | ||
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qvbox.h> | 29 | #include <q3vbox.h> |
30 | #include <qfile.h> | 30 | #include <qfile.h> |
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | #include <qtextstream.h> | 32 | #include <q3textstream.h> |
33 | #include <qtextcodec.h> | 33 | #include <qtextcodec.h> |
34 | #include <qpixmap.h> | 34 | #include <qpixmap.h> |
35 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | #include <qapplication.h> | 36 | #include <qapplication.h> |
37 | #include <QDesktopWidget> | ||
38 | //Added by qt3to4: | ||
39 | #include <QResizeEvent> | ||
40 | #include <Q3Frame> | ||
41 | #include <QKeyEvent> | ||
42 | #include <QEvent> | ||
43 | #include <Q3VBoxLayout> | ||
37 | 44 | ||
38 | #include <kdebug.h> | 45 | #include <kdebug.h> |
39 | #include <kglobal.h> | 46 | #include <kglobal.h> |
40 | #include <klocale.h> | 47 | #include <klocale.h> |
41 | #include <ktextedit.h> | 48 | #include <ktextedit.h> |
42 | #include <kfiledialog.h> | 49 | #include <kfiledialog.h> |
@@ -54,26 +61,26 @@ | |||
54 | #include "journalentry.h" | 61 | #include "journalentry.h" |
55 | //#include "journalentry.moc" | 62 | //#include "journalentry.moc" |
56 | #ifndef DESKTOP_VERSION | 63 | #ifndef DESKTOP_VERSION |
57 | #include <qpe/qpeapplication.h> | 64 | #include <qpe/qpeapplication.h> |
58 | #endif | 65 | #endif |
59 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | 66 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : |
60 | QFrame(parent) | 67 | Q3Frame(parent) |
61 | { | 68 | { |
62 | 69 | ||
63 | int fac = 5; | 70 | int fac = 5; |
64 | heiHint = QApplication::desktop()->height(); | 71 | heiHint = QApplication::desktop()->height(); |
65 | if ( heiHint > 800 ) | 72 | if ( heiHint > 800 ) |
66 | fac += 2; | 73 | fac += 2; |
67 | heiHint = heiHint / fac; | 74 | heiHint = heiHint / fac; |
68 | 75 | ||
69 | showOnlyMode = false; | 76 | showOnlyMode = false; |
70 | mCalendar = calendar; | 77 | mCalendar = calendar; |
71 | mJournal = 0; | 78 | mJournal = 0; |
72 | visibleMode = true; | 79 | visibleMode = true; |
73 | QHBox * vb = new QHBox ( this ); | 80 | Q3HBox * vb = new Q3HBox ( this ); |
74 | QPixmap iconp; | 81 | QPixmap iconp; |
75 | vb->setMargin ( KDialog::marginHint()-1 ); | 82 | vb->setMargin ( KDialog::marginHint()-1 ); |
76 | QPushButton * toggleJournal = new QPushButton( vb ); | 83 | QPushButton * toggleJournal = new QPushButton( vb ); |
77 | iconp = SmallIcon("1updownarrow"); | 84 | iconp = SmallIcon("1updownarrow"); |
78 | toggleJournal->setPixmap (iconp ) ; | 85 | toggleJournal->setPixmap (iconp ) ; |
79 | QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb); | 86 | QLabel* textLabel = new QLabel(" "+i18n("Title: "),vb); |
@@ -126,19 +133,19 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
126 | } else { | 133 | } else { |
127 | mTitle->setMaximumWidth( (maxwid/4)*3); | 134 | mTitle->setMaximumWidth( (maxwid/4)*3); |
128 | mCalendarBox->setMaximumWidth( maxwid/2 ); | 135 | mCalendarBox->setMaximumWidth( maxwid/2 ); |
129 | } | 136 | } |
130 | //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); | 137 | //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); |
131 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); | 138 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); |
132 | QBoxLayout *topLayout = new QVBoxLayout(this); | 139 | Q3BoxLayout *topLayout = new Q3VBoxLayout(this); |
133 | topLayout->addWidget(vb); | 140 | topLayout->addWidget(vb); |
134 | topLayout->addWidget(mEditor); | 141 | topLayout->addWidget(mEditor); |
135 | mEditor->installEventFilter(this); | 142 | mEditor->installEventFilter(this); |
136 | installEventFilter(this); | 143 | installEventFilter(this); |
137 | mTitle->installEventFilter(this); | 144 | mTitle->installEventFilter(this); |
138 | setFocusPolicy (QWidget::NoFocus); | 145 | setFocusPolicy (Qt::NoFocus); |
139 | 146 | ||
140 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 147 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
141 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 148 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
142 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); | 149 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); |
143 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); | 150 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); |
144 | mTitle->lineEdit ()->setText(""); | 151 | mTitle->lineEdit ()->setText(""); |
@@ -165,13 +172,13 @@ void JournalEntry::resizeEvent(QResizeEvent* e ) | |||
165 | } | 172 | } |
166 | //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); | 173 | //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); |
167 | } | 174 | } |
168 | //setMaximumWidth( QApplication::desktop()->width() ); | 175 | //setMaximumWidth( QApplication::desktop()->width() ); |
169 | //qDebug("MAXXX %d ", QApplication::desktop()->width()); | 176 | //qDebug("MAXXX %d ", QApplication::desktop()->width()); |
170 | #endif | 177 | #endif |
171 | QFrame::resizeEvent( e ); | 178 | Q3Frame::resizeEvent( e ); |
172 | } | 179 | } |
173 | QSize JournalEntry::sizeHint() const | 180 | QSize JournalEntry::sizeHint() const |
174 | { | 181 | { |
175 | return QSize ( 240, heiHint ); | 182 | return QSize ( 240, heiHint ); |
176 | } | 183 | } |
177 | void JournalEntry::slotSaveTemplate() | 184 | void JournalEntry::slotSaveTemplate() |
@@ -183,19 +190,19 @@ void JournalEntry::slotSaveTemplate() | |||
183 | fileName += "/journal"; | 190 | fileName += "/journal"; |
184 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); | 191 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); |
185 | if ( fileName.length() == 0 ) | 192 | if ( fileName.length() == 0 ) |
186 | return; | 193 | return; |
187 | 194 | ||
188 | QFile fileIn( fileName ); | 195 | QFile fileIn( fileName ); |
189 | if (!fileIn.open( IO_WriteOnly ) ) { | 196 | if (!fileIn.open( QIODevice::WriteOnly ) ) { |
190 | KMessageBox::error( this, i18n("Error saving template file\n '%1'.") | 197 | KMessageBox::error( this, i18n("Error saving template file\n '%1'.") |
191 | .arg( fileName ) ); | 198 | .arg( fileName ) ); |
192 | return; | 199 | return; |
193 | } | 200 | } |
194 | // QString text; | 201 | // QString text; |
195 | QTextStream tsIn( &fileIn ); | 202 | Q3TextStream tsIn( &fileIn ); |
196 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 203 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
197 | tsIn << mEditor->text(); | 204 | tsIn << mEditor->text(); |
198 | fileIn.close(); | 205 | fileIn.close(); |
199 | } | 206 | } |
200 | void JournalEntry::slotLoadTemplate() | 207 | void JournalEntry::slotLoadTemplate() |
201 | { | 208 | { |
@@ -205,18 +212,18 @@ void JournalEntry::slotLoadTemplate() | |||
205 | t_dir.mkdir ( fileName ); | 212 | t_dir.mkdir ( fileName ); |
206 | fileName += "/journal"; | 213 | fileName += "/journal"; |
207 | fileName = KFileDialog::getOpenFileName( fileName , i18n("Insert Journal template"), this ); | 214 | fileName = KFileDialog::getOpenFileName( fileName , i18n("Insert Journal template"), this ); |
208 | if ( fileName.length() == 0 ) | 215 | if ( fileName.length() == 0 ) |
209 | return; | 216 | return; |
210 | QFile fileIn( fileName ); | 217 | QFile fileIn( fileName ); |
211 | if (!fileIn.open( IO_ReadOnly ) ) { | 218 | if (!fileIn.open( QIODevice::ReadOnly ) ) { |
212 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 219 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
213 | .arg( fileName ) ); | 220 | .arg( fileName ) ); |
214 | return; | 221 | return; |
215 | } | 222 | } |
216 | QTextStream tsIn( &fileIn ); | 223 | Q3TextStream tsIn( &fileIn ); |
217 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 224 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
218 | QString text = tsIn.read(); | 225 | QString text = tsIn.read(); |
219 | fileIn.close(); | 226 | fileIn.close(); |
220 | int line, col; | 227 | int line, col; |
221 | mEditor->getCursorPosition (& line, & col ); | 228 | mEditor->getCursorPosition (& line, & col ); |
222 | mEditor-> insertAt ( text, line, col, true ); | 229 | mEditor-> insertAt ( text, line, col, true ); |
@@ -313,17 +320,17 @@ void JournalEntry::clear() | |||
313 | } | 320 | } |
314 | 321 | ||
315 | bool JournalEntry::eventFilter( QObject *o, QEvent *e ) | 322 | bool JournalEntry::eventFilter( QObject *o, QEvent *e ) |
316 | { | 323 | { |
317 | // kdDebug() << "JournalEntry::event received " << e->type() << endl; | 324 | // kdDebug() << "JournalEntry::event received " << e->type() << endl; |
318 | if ( isVisible() ) { | 325 | if ( isVisible() ) { |
319 | mEditor->setFocusPolicy (QWidget::StrongFocus); | 326 | mEditor->setFocusPolicy (Qt::StrongFocus); |
320 | mTitle->setFocusPolicy (QWidget::StrongFocus); | 327 | mTitle->setFocusPolicy (Qt::StrongFocus); |
321 | } else { | 328 | } else { |
322 | mEditor->setFocusPolicy (QWidget::NoFocus); | 329 | mEditor->setFocusPolicy (Qt::NoFocus); |
323 | mTitle->setFocusPolicy (QWidget::NoFocus); | 330 | mTitle->setFocusPolicy (Qt::NoFocus); |
324 | } | 331 | } |
325 | if ( e->type() == QEvent::FocusOut ) { | 332 | if ( e->type() == QEvent::FocusOut ) { |
326 | writeJournal(); | 333 | writeJournal(); |
327 | } | 334 | } |
328 | if ( e->type() == QEvent::KeyPress ) { | 335 | if ( e->type() == QEvent::KeyPress ) { |
329 | QKeyEvent * k = (QKeyEvent *) e; | 336 | QKeyEvent * k = (QKeyEvent *) e; |
@@ -332,13 +339,13 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e ) | |||
332 | if ( k->state() == Qt::ControlButton ) { | 339 | if ( k->state() == Qt::ControlButton ) { |
333 | k->ignore(); | 340 | k->ignore(); |
334 | //return true; | 341 | //return true; |
335 | } | 342 | } |
336 | } | 343 | } |
337 | 344 | ||
338 | return QFrame::eventFilter( o, e ); // standard event processing | 345 | return Q3Frame::eventFilter( o, e ); // standard event processing |
339 | } | 346 | } |
340 | 347 | ||
341 | void JournalEntry::writeJournal() | 348 | void JournalEntry::writeJournal() |
342 | { | 349 | { |
343 | if ( !visibleMode ) return; | 350 | if ( !visibleMode ) return; |
344 | if ( !mTitle->isEnabled() ) return; | 351 | if ( !mTitle->isEnabled() ) return; |
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index ee17da8..0adebe9 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h | |||
@@ -22,25 +22,30 @@ | |||
22 | */ | 22 | */ |
23 | #ifndef JOURNALENTRY_H | 23 | #ifndef JOURNALENTRY_H |
24 | #define JOURNALENTRY_H | 24 | #define JOURNALENTRY_H |
25 | // | 25 | // |
26 | // Widget showing one Journal entry | 26 | // Widget showing one Journal entry |
27 | 27 | ||
28 | #include <qframe.h> | 28 | #include <q3frame.h> |
29 | //Added by qt3to4: | ||
30 | #include <QResizeEvent> | ||
31 | #include <QEvent> | ||
32 | #include <QLabel> | ||
33 | #include <QKeyEvent> | ||
29 | 34 | ||
30 | #include <libkcal/calendar.h> | 35 | #include <libkcal/calendar.h> |
31 | 36 | ||
32 | class QLabel; | 37 | class QLabel; |
33 | class KTextEdit; | 38 | class KTextEdit; |
34 | class QComboBox; | 39 | class QComboBox; |
35 | class KLineEdit; | 40 | class KLineEdit; |
36 | class KOLocationBox; | 41 | class KOLocationBox; |
37 | 42 | ||
38 | using namespace KCal; | 43 | using namespace KCal; |
39 | 44 | ||
40 | class JournalEntry : public QFrame { | 45 | class JournalEntry : public Q3Frame { |
41 | Q_OBJECT | 46 | Q_OBJECT |
42 | public: | 47 | public: |
43 | JournalEntry(Calendar *,QWidget *parent); | 48 | JournalEntry(Calendar *,QWidget *parent); |
44 | virtual ~JournalEntry(); | 49 | virtual ~JournalEntry(); |
45 | 50 | ||
46 | void setJournal(Journal *, bool saveJournal = true ); | 51 | void setJournal(Journal *, bool saveJournal = true ); |
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 6697602..ecc7a2f 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp | |||
@@ -19,18 +19,22 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qkeycode.h> | 25 | #include <qnamespace.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qtimer.h> | 27 | #include <qtimer.h> |
28 | #include <qframe.h> | 28 | #include <q3frame.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | //Added by qt3to4: | ||
32 | #include <QWheelEvent> | ||
33 | #include <Q3GridLayout> | ||
34 | #include <QEvent> | ||
31 | 35 | ||
32 | #include <kdebug.h> | 36 | #include <kdebug.h> |
33 | #include <klocale.h> | 37 | #include <klocale.h> |
34 | #include <kglobal.h> | 38 | #include <kglobal.h> |
35 | 39 | ||
36 | #include "koglobals.h" | 40 | #include "koglobals.h" |
@@ -43,18 +47,18 @@ | |||
43 | 47 | ||
44 | #include "navigatorbar.h" | 48 | #include "navigatorbar.h" |
45 | 49 | ||
46 | #include "kdatenavigator.h" | 50 | #include "kdatenavigator.h" |
47 | 51 | ||
48 | KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | 52 | KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) |
49 | : QFrame(parent, name), | 53 | : Q3Frame(parent, name), |
50 | updateTimer(0L) | 54 | updateTimer(0L) |
51 | { | 55 | { |
52 | setFrameStyle(QFrame::NoFrame); | 56 | setFrameStyle(Q3Frame::NoFrame); |
53 | QDate startDate = QDate::currentDate(); | 57 | QDate startDate = QDate::currentDate(); |
54 | QGridLayout *topLayout = new QGridLayout(this,8,8); | 58 | Q3GridLayout *topLayout = new Q3GridLayout(this,8,8); |
55 | 59 | ||
56 | if (! startDate.isValid()) { | 60 | if (! startDate.isValid()) { |
57 | qDebug("KDateNavigator::invalid startdate "); | 61 | qDebug("KDateNavigator::invalid startdate "); |
58 | startDate = QDate::currentDate(); | 62 | startDate = QDate::currentDate(); |
59 | } | 63 | } |
60 | mMonthSignalOffset = 0; | 64 | mMonthSignalOffset = 0; |
@@ -78,33 +82,33 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | |||
78 | int i; | 82 | int i; |
79 | 83 | ||
80 | // Set up the heading fields. | 84 | // Set up the heading fields. |
81 | for( i = 0; i < 7; i++ ) { | 85 | for( i = 0; i < 7; i++ ) { |
82 | headings[i] = new QLabel("",this); | 86 | headings[i] = new QLabel("",this); |
83 | //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); | 87 | //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); |
84 | headings[i]->setAlignment(AlignCenter); | 88 | headings[i]->setAlignment(Qt::AlignCenter); |
85 | headings[i]->installEventFilter(this); | 89 | headings[i]->installEventFilter(this); |
86 | 90 | ||
87 | topLayout->addWidget(headings[i],1,i+1); | 91 | topLayout->addWidget(headings[i],1,i+1); |
88 | } | 92 | } |
89 | 93 | ||
90 | // Create the weeknumber labels | 94 | // Create the weeknumber labels |
91 | for( i = 0; i < 6; i++ ) { | 95 | for( i = 0; i < 6; i++ ) { |
92 | weeknos[i] = new QLabel(this); | 96 | weeknos[i] = new QLabel(this); |
93 | weeknos[i]->setAlignment(AlignCenter ); | 97 | weeknos[i]->setAlignment(Qt::AlignCenter ); |
94 | //weeknos[i]->setFont(QFont("Arial", 10)); | 98 | //weeknos[i]->setFont(QFont("Arial", 10)); |
95 | if(!m_bShowWeekNums) { | 99 | if(!m_bShowWeekNums) { |
96 | weeknos[i]->hide(); | 100 | weeknos[i]->hide(); |
97 | } | 101 | } |
98 | weeknos[i]->installEventFilter(this); | 102 | weeknos[i]->installEventFilter(this); |
99 | 103 | ||
100 | topLayout->addWidget(weeknos[i],i+2,0); | 104 | topLayout->addWidget(weeknos[i],i+2,0); |
101 | } | 105 | } |
102 | 106 | ||
103 | daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); | 107 | daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); |
104 | daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); | 108 | daymatrix->setFrameStyle(Q3Frame::Panel|Q3Frame::Sunken); |
105 | daymatrix->setLineWidth(1); | 109 | daymatrix->setLineWidth(1); |
106 | 110 | ||
107 | connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), | 111 | connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), |
108 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); | 112 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); |
109 | 113 | ||
110 | connect( daymatrix, SIGNAL( eventDropped( Event * ) ), | 114 | connect( daymatrix, SIGNAL( eventDropped( Event * ) ), |
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h index 780ebb8..2cbca76 100644 --- a/korganizer/kdatenavigator.h +++ b/korganizer/kdatenavigator.h | |||
@@ -20,28 +20,31 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KDATENAVIGATOR_H | 23 | #ifndef KDATENAVIGATOR_H |
24 | #define KDATENAVIGATOR_H | 24 | #define KDATENAVIGATOR_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <q3frame.h> |
27 | #include <qdatetime.h> | 27 | #include <qdatetime.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | //Added by qt3to4: | ||
30 | #include <QWheelEvent> | ||
31 | #include <QEvent> | ||
29 | 32 | ||
30 | #include <libkcal/calendar.h> | 33 | #include <libkcal/calendar.h> |
31 | 34 | ||
32 | #include "kodaymatrix.h" | 35 | #include "kodaymatrix.h" |
33 | 36 | ||
34 | class QPushButton; | 37 | class QPushButton; |
35 | class QTimer; | 38 | class QTimer; |
36 | 39 | ||
37 | class KCalendarSystem; | 40 | class KCalendarSystem; |
38 | 41 | ||
39 | class NavigatorBar; | 42 | class NavigatorBar; |
40 | 43 | ||
41 | class KDateNavigator: public QFrame | 44 | class KDateNavigator: public Q3Frame |
42 | { | 45 | { |
43 | Q_OBJECT | 46 | Q_OBJECT |
44 | public: | 47 | public: |
45 | KDateNavigator( QWidget *parent = 0,const char *name = 0 ); | 48 | KDateNavigator( QWidget *parent = 0,const char *name = 0 ); |
46 | ~KDateNavigator(); | 49 | ~KDateNavigator(); |
47 | 50 | ||
@@ -130,14 +133,14 @@ class KDateNavigator: public QFrame | |||
130 | QSize mySizeHint; | 133 | QSize mySizeHint; |
131 | QSize myFullSizeHint; | 134 | QSize myFullSizeHint; |
132 | bool mFontChanged; | 135 | bool mFontChanged; |
133 | int mMonthSignalOffset; | 136 | int mMonthSignalOffset; |
134 | NavigatorBar *mNavigatorBar; | 137 | NavigatorBar *mNavigatorBar; |
135 | 138 | ||
136 | QFrame *headingSep; | 139 | Q3Frame *headingSep; |
137 | QFrame *weeknumSep; | 140 | Q3Frame *weeknumSep; |
138 | QLabel *headings[7]; | 141 | QLabel *headings[7]; |
139 | QLabel *weeknos[7]; | 142 | QLabel *weeknos[7]; |
140 | KODayMatrix *daymatrix; | 143 | KODayMatrix *daymatrix; |
141 | 144 | ||
142 | KCal::DateList mSelectedDates; | 145 | KCal::DateList mSelectedDates; |
143 | QDate m_MthYr; | 146 | QDate m_MthYr; |
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 1d4d6de..fe59787 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -26,18 +26,29 @@ | |||
26 | 26 | ||
27 | #ifndef _WIN32_ | 27 | #ifndef _WIN32_ |
28 | #define protected public | 28 | #define protected public |
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | #undef protected | 30 | #undef protected |
31 | #endif | 31 | #endif |
32 | #include <qintdict.h> | 32 | #include <q3intdict.h> |
33 | #include <qdatetime.h> | 33 | #include <qdatetime.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | #include <qpopupmenu.h> | 35 | #include <q3popupmenu.h> |
36 | #include <qcursor.h> | 36 | #include <qcursor.h> |
37 | #include <qpainter.h> | 37 | #include <qpainter.h> |
38 | #include <QDesktopWidget> | ||
39 | //Added by qt3to4: | ||
40 | #include <QResizeEvent> | ||
41 | #include <QLabel> | ||
42 | #include <QPixmap> | ||
43 | #include <QMouseEvent> | ||
44 | #include <QKeyEvent> | ||
45 | #include <Q3MemArray> | ||
46 | #include <QEvent> | ||
47 | #include <Q3Frame> | ||
48 | #include <Q3PtrList> | ||
38 | 49 | ||
39 | #include <kdebug.h> | 50 | #include <kdebug.h> |
40 | #include <klocale.h> | 51 | #include <klocale.h> |
41 | #include <kiconloader.h> | 52 | #include <kiconloader.h> |
42 | #include <kglobal.h> | 53 | #include <kglobal.h> |
43 | 54 | ||
@@ -60,13 +71,13 @@ extern int globalFlagBlockAgendaItemPaint; | |||
60 | extern int globalFlagBlockAgendaItemUpdate; | 71 | extern int globalFlagBlockAgendaItemUpdate; |
61 | extern int globalFlagBlockStartup; | 72 | extern int globalFlagBlockStartup; |
62 | 73 | ||
63 | 74 | ||
64 | //////////////////////////////////////////////////////////////////////////// | 75 | //////////////////////////////////////////////////////////////////////////// |
65 | MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) | 76 | MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) |
66 | : QFrame(_agenda->viewport(),name), agenda(_agenda) | 77 | : Q3Frame(_agenda->viewport(),name), agenda(_agenda) |
67 | { | 78 | { |
68 | setLineWidth(0); | 79 | setLineWidth(0); |
69 | setMargin(0); | 80 | setMargin(0); |
70 | setBackgroundColor(Qt::red); | 81 | setBackgroundColor(Qt::red); |
71 | minutes = new QTimer(this); | 82 | minutes = new QTimer(this); |
72 | connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); | 83 | connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); |
@@ -166,14 +177,14 @@ void MarcusBains::updateLocation(bool recalculate) | |||
166 | 177 | ||
167 | 178 | ||
168 | /* | 179 | /* |
169 | Create an agenda widget with rows rows and columns columns. | 180 | Create an agenda widget with rows rows and columns columns. |
170 | */ | 181 | */ |
171 | KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, | 182 | KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, |
172 | const char *name,WFlags f) : | 183 | const char *name,Qt::WFlags f) : |
173 | QScrollView(parent,name,f) | 184 | Q3ScrollView(parent,name,f) |
174 | { | 185 | { |
175 | 186 | ||
176 | mAllAgendaPopup = 0; | 187 | mAllAgendaPopup = 0; |
177 | mColumns = columns; | 188 | mColumns = columns; |
178 | mRows = rows; | 189 | mRows = rows; |
179 | mGridSpacingY = rowSize; | 190 | mGridSpacingY = rowSize; |
@@ -187,14 +198,14 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, | |||
187 | } | 198 | } |
188 | 199 | ||
189 | /* | 200 | /* |
190 | Create an agenda widget with columns columns and one row. This is used for | 201 | Create an agenda widget with columns columns and one row. This is used for |
191 | all-day events. | 202 | all-day events. |
192 | */ | 203 | */ |
193 | KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : | 204 | KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,Qt::WFlags f) : |
194 | QScrollView(parent,name,f) | 205 | Q3ScrollView(parent,name,f) |
195 | { | 206 | { |
196 | mAllAgendaPopup = 0; | 207 | mAllAgendaPopup = 0; |
197 | blockResize = false; | 208 | blockResize = false; |
198 | mColumns = columns; | 209 | mColumns = columns; |
199 | mRows = 1; | 210 | mRows = 1; |
200 | //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); | 211 | //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); |
@@ -228,45 +239,45 @@ QDate KOAgenda::selectedIncidenceDate() const | |||
228 | 239 | ||
229 | void KOAgenda::init() | 240 | void KOAgenda::init() |
230 | { | 241 | { |
231 | mPopupTimer = new QTimer(this); | 242 | mPopupTimer = new QTimer(this); |
232 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); | 243 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); |
233 | 244 | ||
234 | mNewItemPopup = new QPopupMenu( this ); | 245 | mNewItemPopup = new Q3PopupMenu( this ); |
235 | connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); | 246 | connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); |
236 | QString pathString = ""; | 247 | QString pathString = ""; |
237 | if ( !KOPrefs::instance()->mToolBarMiniIcons ) { | 248 | if ( !KOPrefs::instance()->mToolBarMiniIcons ) { |
238 | if ( QApplication::desktop()->width() < 480 ) | 249 | if ( QApplication::desktop()->width() < 480 ) |
239 | pathString += "icons16/"; | 250 | pathString += "icons16/"; |
240 | } else | 251 | } else |
241 | pathString += "iconsmini/"; | 252 | pathString += "iconsmini/"; |
242 | 253 | ||
243 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); | 254 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); |
244 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); | 255 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); |
245 | mNewItemPopup->insertSeparator ( ); | 256 | mNewItemPopup->insertSeparator ( ); |
246 | mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); | 257 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"day" ), i18n("Day view"),3 ); |
247 | mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); | 258 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); |
248 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 ); | 259 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next week"),4 ); |
249 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); | 260 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); |
250 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 ); | 261 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"month" ), i18n("This month"),6 ); |
251 | mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); | 262 | mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); |
252 | #ifndef _WIN32_ | 263 | #ifndef _WIN32_ |
253 | int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase | 264 | Qt::WindowFlags wflags = viewport()-> windowFlags() |Qt::WRepaintNoErase;//WResizeNoErase |
254 | viewport()->setWFlags ( wflags); | 265 | viewport()->setWindowFlags ( wflags); |
255 | #endif | 266 | #endif |
256 | mGridSpacingX = 80; | 267 | mGridSpacingX = 80; |
257 | mResizeBorderWidth = 8; | 268 | mResizeBorderWidth = 8; |
258 | mScrollBorderWidth = 8; | 269 | mScrollBorderWidth = 8; |
259 | mScrollDelay = 30; | 270 | mScrollDelay = 30; |
260 | mScrollOffset = 10; | 271 | mScrollOffset = 10; |
261 | mPaintPixmap.resize( 20,20); | 272 | mPaintPixmap.resize( 20,20); |
262 | //enableClipper(true); | 273 | //enableClipper(true); |
263 | 274 | ||
264 | // Grab key strokes for keyboard navigation of agenda. Seems to have no | 275 | // Grab key strokes for keyboard navigation of agenda. Seems to have no |
265 | // effect. Has to be fixed. | 276 | // effect. Has to be fixed. |
266 | setFocusPolicy(WheelFocus); | 277 | setFocusPolicy(Qt::WheelFocus); |
267 | 278 | ||
268 | connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); | 279 | connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); |
269 | connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); | 280 | connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); |
270 | connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); | 281 | connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); |
271 | 282 | ||
272 | mStartCellX = 0; | 283 | mStartCellX = 0; |
@@ -392,17 +403,17 @@ bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) | |||
392 | case QEvent::MouseButtonRelease: | 403 | case QEvent::MouseButtonRelease: |
393 | case QEvent::MouseMove: | 404 | case QEvent::MouseMove: |
394 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); | 405 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); |
395 | 406 | ||
396 | case (QEvent::Leave): | 407 | case (QEvent::Leave): |
397 | if (!mActionItem) | 408 | if (!mActionItem) |
398 | setCursor(arrowCursor); | 409 | setCursor(Qt::arrowCursor); |
399 | return true; | 410 | return true; |
400 | 411 | ||
401 | default: | 412 | default: |
402 | return QScrollView::eventFilter(object,event); | 413 | return Q3ScrollView::eventFilter(object,event); |
403 | } | 414 | } |
404 | } | 415 | } |
405 | void KOAgenda::popupMenu() | 416 | void KOAgenda::popupMenu() |
406 | { | 417 | { |
407 | mPopupTimer->stop(); | 418 | mPopupTimer->stop(); |
408 | if ( mPopupKind == 1 || mPopupKind == 3 ) { | 419 | if ( mPopupKind == 1 || mPopupKind == 3 ) { |
@@ -502,17 +513,17 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
502 | } else { | 513 | } else { |
503 | viewportPos = me->pos(); | 514 | viewportPos = me->pos(); |
504 | } | 515 | } |
505 | bool objIsNotViewport = (object != viewport()); | 516 | bool objIsNotViewport = (object != viewport()); |
506 | bool leftButt = false; | 517 | bool leftButt = false; |
507 | #ifdef DESKTOP_VERSION | 518 | #ifdef DESKTOP_VERSION |
508 | leftButt = (me->button() == LeftButton); | 519 | leftButt = (me->button() == Qt::LeftButton); |
509 | #endif | 520 | #endif |
510 | switch (me->type()) { | 521 | switch (me->type()) { |
511 | case QEvent::MouseButtonPress: | 522 | case QEvent::MouseButtonPress: |
512 | if (me->button() == LeftButton) { | 523 | if (me->button() == Qt::LeftButton) { |
513 | mPopupTimer->start( 600 ); | 524 | mPopupTimer->start( 600 ); |
514 | mLeftMouseDown = true; | 525 | mLeftMouseDown = true; |
515 | } | 526 | } |
516 | blockMoving = true; | 527 | blockMoving = true; |
517 | startX = viewportPos.x(); | 528 | startX = viewportPos.x(); |
518 | startY = viewportPos.y(); | 529 | startY = viewportPos.y(); |
@@ -575,16 +586,16 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
575 | } | 586 | } |
576 | } | 587 | } |
577 | } | 588 | } |
578 | if ( objIsNotViewport ) { | 589 | if ( objIsNotViewport ) { |
579 | mPopupItem = (KOAgendaItem *)object; | 590 | mPopupItem = (KOAgendaItem *)object; |
580 | mPopupKind = 1; | 591 | mPopupKind = 1; |
581 | if (me->button() == RightButton) { | 592 | if (me->button() == Qt::RightButton) { |
582 | mPopupKind = 3; | 593 | mPopupKind = 3; |
583 | popupMenu(); | 594 | popupMenu(); |
584 | } else if (me->button() == LeftButton) { | 595 | } else if (me->button() == Qt::LeftButton) { |
585 | mActionItem = (KOAgendaItem *)object; | 596 | mActionItem = (KOAgendaItem *)object; |
586 | if (mActionItem) { | 597 | if (mActionItem) { |
587 | emit signalClearSelection(); | 598 | emit signalClearSelection(); |
588 | slotClearSelection(); | 599 | slotClearSelection(); |
589 | selectItem(mActionItem); | 600 | selectItem(mActionItem); |
590 | Incidence *incidence = mActionItem->incidence(); | 601 | Incidence *incidence = mActionItem->incidence(); |
@@ -597,62 +608,62 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
597 | } | 608 | } |
598 | } else { // ---------- viewport() | 609 | } else { // ---------- viewport() |
599 | mPopupItem = 0; | 610 | mPopupItem = 0; |
600 | mPopupKind = 2; | 611 | mPopupKind = 2; |
601 | selectItem(0); | 612 | selectItem(0); |
602 | mActionItem = 0; | 613 | mActionItem = 0; |
603 | if (me->button() == RightButton) { | 614 | if (me->button() == Qt::RightButton) { |
604 | int x,y; | 615 | int x,y; |
605 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 616 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
606 | int gx,gy; | 617 | int gx,gy; |
607 | contentsToGrid(x,y,gx,gy); | 618 | contentsToGrid(x,y,gx,gy); |
608 | mCurrentCellX = gx; | 619 | mCurrentCellX = gx; |
609 | mCurrentCellY = gy; | 620 | mCurrentCellY = gy; |
610 | mStartCellX = gx; | 621 | mStartCellX = gx; |
611 | mStartCellY = gy; | 622 | mStartCellY = gy; |
612 | mPopupKind = 4; | 623 | mPopupKind = 4; |
613 | popupMenu(); | 624 | popupMenu(); |
614 | } else if (me->button() == LeftButton) { | 625 | } else if (me->button() == Qt::LeftButton) { |
615 | setCursor(arrowCursor); | 626 | setCursor(Qt::arrowCursor); |
616 | startSelectAction(viewportPos); | 627 | startSelectAction(viewportPos); |
617 | } | 628 | } |
618 | } | 629 | } |
619 | break; | 630 | break; |
620 | 631 | ||
621 | case QEvent::MouseButtonRelease: | 632 | case QEvent::MouseButtonRelease: |
622 | if (me->button() == LeftButton ) { | 633 | if (me->button() == Qt::LeftButton ) { |
623 | mPopupTimer->stop(); | 634 | mPopupTimer->stop(); |
624 | } | 635 | } |
625 | if (object != viewport()) { | 636 | if (object != viewport()) { |
626 | if (me->button() == LeftButton && mLeftMouseDown) { | 637 | if (me->button() == Qt::LeftButton && mLeftMouseDown) { |
627 | if (mActionItem) { | 638 | if (mActionItem) { |
628 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 639 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
629 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); | 640 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); |
630 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { | 641 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { |
631 | mScrollUpTimer.stop(); | 642 | mScrollUpTimer.stop(); |
632 | mScrollDownTimer.stop(); | 643 | mScrollDownTimer.stop(); |
633 | mActionItem->resetMove(); | 644 | mActionItem->resetMove(); |
634 | placeSubCells( mActionItem ); | 645 | placeSubCells( mActionItem ); |
635 | // emit startDragSignal( mActionItem->incidence() ); | 646 | // emit startDragSignal( mActionItem->incidence() ); |
636 | setCursor( arrowCursor ); | 647 | setCursor( Qt::arrowCursor ); |
637 | mActionItem = 0; | 648 | mActionItem = 0; |
638 | mActionType = NOP; | 649 | mActionType = NOP; |
639 | mItemMoved = 0; | 650 | mItemMoved = 0; |
640 | mLeftMouseDown = false; | 651 | mLeftMouseDown = false; |
641 | return true; | 652 | return true; |
642 | } | 653 | } |
643 | endItemAction(); | 654 | endItemAction(); |
644 | } | 655 | } |
645 | } | 656 | } |
646 | 657 | ||
647 | } else { // ---------- viewport() | 658 | } else { // ---------- viewport() |
648 | if (me->button() == LeftButton && mLeftMouseDown ) { //left click | 659 | if (me->button() == Qt::LeftButton && mLeftMouseDown ) { //left click |
649 | endSelectAction( true ); // emit new event signal | 660 | endSelectAction( true ); // emit new event signal |
650 | } | 661 | } |
651 | } | 662 | } |
652 | if (me->button() == LeftButton) | 663 | if (me->button() == Qt::LeftButton) |
653 | mLeftMouseDown = false; | 664 | mLeftMouseDown = false; |
654 | 665 | ||
655 | break; | 666 | break; |
656 | 667 | ||
657 | case QEvent::MouseMove: | 668 | case QEvent::MouseMove: |
658 | //qDebug("mm "); | 669 | //qDebug("mm "); |
@@ -847,38 +858,38 @@ void KOAgenda::startItemAction(QPoint viewportPos) | |||
847 | 858 | ||
848 | if (mAllDayMode) { | 859 | if (mAllDayMode) { |
849 | int gridDistanceX = (x - gx * mGridSpacingX); | 860 | int gridDistanceX = (x - gx * mGridSpacingX); |
850 | if ( allowResize && gridDistanceX < mResizeBorderWidth && | 861 | if ( allowResize && gridDistanceX < mResizeBorderWidth && |
851 | mActionItem->cellX() == mCurrentCellX) { | 862 | mActionItem->cellX() == mCurrentCellX) { |
852 | mActionType = RESIZELEFT; | 863 | mActionType = RESIZELEFT; |
853 | setCursor(sizeHorCursor); | 864 | setCursor(Qt::sizeHorCursor); |
854 | } else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth && | 865 | } else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth && |
855 | mActionItem->cellXWidth() == mCurrentCellX) { | 866 | mActionItem->cellXWidth() == mCurrentCellX) { |
856 | mActionType = RESIZERIGHT; | 867 | mActionType = RESIZERIGHT; |
857 | setCursor(sizeHorCursor); | 868 | setCursor(Qt::sizeHorCursor); |
858 | } else { | 869 | } else { |
859 | mActionType = MOVE; | 870 | mActionType = MOVE; |
860 | mActionItem->startMove(); | 871 | mActionItem->startMove(); |
861 | setCursor(sizeAllCursor); | 872 | setCursor(Qt::sizeAllCursor); |
862 | } | 873 | } |
863 | } else { | 874 | } else { |
864 | int gridDistanceY = (y - gy * mGridSpacingY); | 875 | int gridDistanceY = (y - gy * mGridSpacingY); |
865 | if (allowResize && gridDistanceY < mResizeBorderWidth && | 876 | if (allowResize && gridDistanceY < mResizeBorderWidth && |
866 | mActionItem->cellYTop() == mCurrentCellY && | 877 | mActionItem->cellYTop() == mCurrentCellY && |
867 | !mActionItem->firstMultiItem()) { | 878 | !mActionItem->firstMultiItem()) { |
868 | mActionType = RESIZETOP; | 879 | mActionType = RESIZETOP; |
869 | setCursor(sizeVerCursor); | 880 | setCursor(Qt::sizeVerCursor); |
870 | } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && | 881 | } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && |
871 | mActionItem->cellYBottom() == mCurrentCellY && | 882 | mActionItem->cellYBottom() == mCurrentCellY && |
872 | !mActionItem->lastMultiItem()) { | 883 | !mActionItem->lastMultiItem()) { |
873 | mActionType = RESIZEBOTTOM; | 884 | mActionType = RESIZEBOTTOM; |
874 | setCursor(sizeVerCursor); | 885 | setCursor(Qt::sizeVerCursor); |
875 | } else { | 886 | } else { |
876 | mActionType = MOVE; | 887 | mActionType = MOVE; |
877 | mActionItem->startMove(); | 888 | mActionItem->startMove(); |
878 | setCursor(sizeAllCursor); | 889 | setCursor(Qt::sizeAllCursor); |
879 | } | 890 | } |
880 | } | 891 | } |
881 | } | 892 | } |
882 | 893 | ||
883 | void KOAgenda::performItemAction(QPoint viewportPos) | 894 | void KOAgenda::performItemAction(QPoint viewportPos) |
884 | { | 895 | { |
@@ -903,33 +914,33 @@ void KOAgenda::performItemAction(QPoint viewportPos) | |||
903 | if ( mActionType == MOVE ) { | 914 | if ( mActionType == MOVE ) { |
904 | mScrollUpTimer.stop(); | 915 | mScrollUpTimer.stop(); |
905 | mScrollDownTimer.stop(); | 916 | mScrollDownTimer.stop(); |
906 | mActionItem->resetMove(); | 917 | mActionItem->resetMove(); |
907 | placeSubCells( mActionItem ); | 918 | placeSubCells( mActionItem ); |
908 | // emit startDragSignal( mActionItem->incidence() ); | 919 | // emit startDragSignal( mActionItem->incidence() ); |
909 | setCursor( arrowCursor ); | 920 | setCursor( Qt::arrowCursor ); |
910 | mActionItem = 0; | 921 | mActionItem = 0; |
911 | mActionType = NOP; | 922 | mActionType = NOP; |
912 | mItemMoved = 0; | 923 | mItemMoved = 0; |
913 | return; | 924 | return; |
914 | } | 925 | } |
915 | } else { | 926 | } else { |
916 | switch ( mActionType ) { | 927 | switch ( mActionType ) { |
917 | case MOVE: | 928 | case MOVE: |
918 | setCursor( sizeAllCursor ); | 929 | setCursor( Qt::sizeAllCursor ); |
919 | break; | 930 | break; |
920 | case RESIZETOP: | 931 | case RESIZETOP: |
921 | case RESIZEBOTTOM: | 932 | case RESIZEBOTTOM: |
922 | setCursor( sizeVerCursor ); | 933 | setCursor( Qt::sizeVerCursor ); |
923 | break; | 934 | break; |
924 | case RESIZELEFT: | 935 | case RESIZELEFT: |
925 | case RESIZERIGHT: | 936 | case RESIZERIGHT: |
926 | setCursor( sizeHorCursor ); | 937 | setCursor( Qt::sizeHorCursor ); |
927 | break; | 938 | break; |
928 | default: | 939 | default: |
929 | setCursor( arrowCursor ); | 940 | setCursor( Qt::arrowCursor ); |
930 | } | 941 | } |
931 | } | 942 | } |
932 | 943 | ||
933 | // Scroll if item was moved to upper or lower end of agenda. | 944 | // Scroll if item was moved to upper or lower end of agenda. |
934 | if (clipperPos.y() < mScrollBorderWidth) { | 945 | if (clipperPos.y() < mScrollBorderWidth) { |
935 | mScrollUpTimer.start(mScrollDelay); | 946 | mScrollUpTimer.start(mScrollDelay); |
@@ -968,13 +979,13 @@ void KOAgenda::performItemAction(QPoint viewportPos) | |||
968 | mActionItem->expandTop(gy - mCurrentCellY); | 979 | mActionItem->expandTop(gy - mCurrentCellY); |
969 | mActionItem->resize(mActionItem->width(), | 980 | mActionItem->resize(mActionItem->width(), |
970 | mGridSpacingY * mActionItem->cellHeight()); | 981 | mGridSpacingY * mActionItem->cellHeight()); |
971 | int x,y; | 982 | int x,y; |
972 | gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y); | 983 | gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y); |
973 | //moveChild(mActionItem,childX(mActionItem),y); | 984 | //moveChild(mActionItem,childX(mActionItem),y); |
974 | QScrollView::moveChild( mActionItem,childX(mActionItem),y ); | 985 | Q3ScrollView::moveChild( mActionItem,childX(mActionItem),y ); |
975 | } | 986 | } |
976 | } else if (mActionType == RESIZEBOTTOM) { | 987 | } else if (mActionType == RESIZEBOTTOM) { |
977 | if (mCurrentCellY >= mActionItem->cellYTop()) { | 988 | if (mCurrentCellY >= mActionItem->cellYTop()) { |
978 | mActionItem->expandBottom(gy - mCurrentCellY); | 989 | mActionItem->expandBottom(gy - mCurrentCellY); |
979 | mActionItem->resize(mActionItem->width(), | 990 | mActionItem->resize(mActionItem->width(), |
980 | mGridSpacingY * mActionItem->cellHeight()); | 991 | mGridSpacingY * mActionItem->cellHeight()); |
@@ -1016,13 +1027,13 @@ void KOAgenda::endItemAction() | |||
1016 | } | 1027 | } |
1017 | int type = mActionType; | 1028 | int type = mActionType; |
1018 | if ( mAllDayMode ) | 1029 | if ( mAllDayMode ) |
1019 | type = -1; | 1030 | type = -1; |
1020 | KOAgendaItem *modifiedItem = placeItem; | 1031 | KOAgendaItem *modifiedItem = placeItem; |
1021 | //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */); | 1032 | //emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */); |
1022 | QPtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems(); | 1033 | Q3PtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems(); |
1023 | KOAgendaItem *item; | 1034 | KOAgendaItem *item; |
1024 | 1035 | ||
1025 | if ( placeItem->incidence()->typeID() == todoID ) { | 1036 | if ( placeItem->incidence()->typeID() == todoID ) { |
1026 | mSelectedItem = 0; | 1037 | mSelectedItem = 0; |
1027 | //qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth()); | 1038 | //qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth()); |
1028 | modifiedItem->mLastMoveXPos = mCurrentCellX; | 1039 | modifiedItem->mLastMoveXPos = mCurrentCellX; |
@@ -1107,13 +1118,13 @@ void KOAgenda::endItemAction() | |||
1107 | 1118 | ||
1108 | } | 1119 | } |
1109 | if ( mActionItem ) | 1120 | if ( mActionItem ) |
1110 | emit incidenceSelected( mActionItem->incidence() ); | 1121 | emit incidenceSelected( mActionItem->incidence() ); |
1111 | mScrollUpTimer.stop(); | 1122 | mScrollUpTimer.stop(); |
1112 | mScrollDownTimer.stop(); | 1123 | mScrollDownTimer.stop(); |
1113 | setCursor( arrowCursor ); | 1124 | setCursor( Qt::arrowCursor ); |
1114 | mActionItem = 0; | 1125 | mActionItem = 0; |
1115 | mActionType = NOP; | 1126 | mActionType = NOP; |
1116 | mItemMoved = 0; | 1127 | mItemMoved = 0; |
1117 | 1128 | ||
1118 | } | 1129 | } |
1119 | 1130 | ||
@@ -1133,31 +1144,31 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) | |||
1133 | 1144 | ||
1134 | // Change cursor to resize cursor if appropriate | 1145 | // Change cursor to resize cursor if appropriate |
1135 | if (mAllDayMode) { | 1146 | if (mAllDayMode) { |
1136 | int gridDistanceX = (x - gx * mGridSpacingX); | 1147 | int gridDistanceX = (x - gx * mGridSpacingX); |
1137 | if (gridDistanceX < mResizeBorderWidth && | 1148 | if (gridDistanceX < mResizeBorderWidth && |
1138 | moveItem->cellX() == gx) { | 1149 | moveItem->cellX() == gx) { |
1139 | setCursor(sizeHorCursor); | 1150 | setCursor(Qt::sizeHorCursor); |
1140 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && | 1151 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && |
1141 | moveItem->cellXWidth() == gx) { | 1152 | moveItem->cellXWidth() == gx) { |
1142 | setCursor(sizeHorCursor); | 1153 | setCursor(Qt::sizeHorCursor); |
1143 | } else { | 1154 | } else { |
1144 | setCursor(arrowCursor); | 1155 | setCursor(Qt::arrowCursor); |
1145 | } | 1156 | } |
1146 | } else { | 1157 | } else { |
1147 | int gridDistanceY = (y - gy * mGridSpacingY); | 1158 | int gridDistanceY = (y - gy * mGridSpacingY); |
1148 | if (gridDistanceY < mResizeBorderWidth && | 1159 | if (gridDistanceY < mResizeBorderWidth && |
1149 | moveItem->cellYTop() == gy && | 1160 | moveItem->cellYTop() == gy && |
1150 | !moveItem->firstMultiItem()) { | 1161 | !moveItem->firstMultiItem()) { |
1151 | setCursor(sizeVerCursor); | 1162 | setCursor(Qt::sizeVerCursor); |
1152 | } else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth && | 1163 | } else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth && |
1153 | moveItem->cellYBottom() == gy && | 1164 | moveItem->cellYBottom() == gy && |
1154 | !moveItem->lastMultiItem()) { | 1165 | !moveItem->lastMultiItem()) { |
1155 | setCursor(sizeVerCursor); | 1166 | setCursor(Qt::sizeVerCursor); |
1156 | } else { | 1167 | } else { |
1157 | setCursor(arrowCursor); | 1168 | setCursor(Qt::arrowCursor); |
1158 | } | 1169 | } |
1159 | } | 1170 | } |
1160 | } | 1171 | } |
1161 | 1172 | ||
1162 | 1173 | ||
1163 | /* | 1174 | /* |
@@ -1170,15 +1181,15 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos) | |||
1170 | cell, where other items are, which do not overlap in Y with the item to place, | 1181 | cell, where other items are, which do not overlap in Y with the item to place, |
1171 | the display gets corrupted, although the corruption looks quite nice. | 1182 | the display gets corrupted, although the corruption looks quite nice. |
1172 | */ | 1183 | */ |
1173 | void KOAgenda::placeSubCells(KOAgendaItem *placeItem) | 1184 | void KOAgenda::placeSubCells(KOAgendaItem *placeItem) |
1174 | { | 1185 | { |
1175 | 1186 | ||
1176 | QPtrList<KOAgendaItem> conflictItems; | 1187 | Q3PtrList<KOAgendaItem> conflictItems; |
1177 | int maxSubCells = 0; | 1188 | int maxSubCells = 0; |
1178 | QIntDict<KOAgendaItem> subCellDict(7); | 1189 | Q3IntDict<KOAgendaItem> subCellDict(7); |
1179 | 1190 | ||
1180 | KOAgendaItem *item; | 1191 | KOAgendaItem *item; |
1181 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { | 1192 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { |
1182 | if (item != placeItem) { | 1193 | if (item != placeItem) { |
1183 | if (placeItem->cellX() <= item->cellXWidth() && | 1194 | if (placeItem->cellX() <= item->cellXWidth() && |
1184 | placeItem->cellXWidth() >= item->cellX()) { | 1195 | placeItem->cellXWidth() >= item->cellX()) { |
@@ -1237,13 +1248,13 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem) | |||
1237 | } | 1248 | } |
1238 | // Adjust sub cell geometry of all conflict items of all conflict items | 1249 | // Adjust sub cell geometry of all conflict items of all conflict items |
1239 | for ( item=conflictItems.first(); item != 0; | 1250 | for ( item=conflictItems.first(); item != 0; |
1240 | item=conflictItems.next() ) { | 1251 | item=conflictItems.next() ) { |
1241 | if ( placeItem != item ) { | 1252 | if ( placeItem != item ) { |
1242 | KOAgendaItem *item2; | 1253 | KOAgendaItem *item2; |
1243 | QPtrList<KOAgendaItem> conflictItems2 = item->conflictItems(); | 1254 | Q3PtrList<KOAgendaItem> conflictItems2 = item->conflictItems(); |
1244 | for ( item2=conflictItems2.first(); item2 != 0; | 1255 | for ( item2=conflictItems2.first(); item2 != 0; |
1245 | item2=conflictItems2.next() ) { | 1256 | item2=conflictItems2.next() ) { |
1246 | if ( item2->subCells() != maxSubCells) { | 1257 | if ( item2->subCells() != maxSubCells) { |
1247 | item2->setSubCells(maxSubCells); | 1258 | item2->setSubCells(maxSubCells); |
1248 | int diff = 0; | 1259 | int diff = 0; |
1249 | if (mAllDayMode) { | 1260 | if (mAllDayMode) { |
@@ -1322,15 +1333,15 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | |||
1322 | int vxSel, vySel; | 1333 | int vxSel, vySel; |
1323 | contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel); | 1334 | contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel); |
1324 | int off = mSelectionHeight; | 1335 | int off = mSelectionHeight; |
1325 | if ( vySel < 0 ) | 1336 | if ( vySel < 0 ) |
1326 | off += vySel; | 1337 | off += vySel; |
1327 | //qDebug("OFF %d %d %d", off,vySel, vy ); | 1338 | //qDebug("OFF %d %d %d", off,vySel, vy ); |
1328 | bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP); | 1339 | bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,QPainter::CompositionMode_Source); |
1329 | } else { | 1340 | } else { |
1330 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); | 1341 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source); |
1331 | } | 1342 | } |
1332 | } | 1343 | } |
1333 | if ( mSelectionHeight > 0 ) { | 1344 | if ( mSelectionHeight > 0 ) { |
1334 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); | 1345 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); |
1335 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | 1346 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && |
1336 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { | 1347 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { |
@@ -1339,13 +1350,13 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | |||
1339 | int hei = mSelectionHeight; | 1350 | int hei = mSelectionHeight; |
1340 | int offset = 0; | 1351 | int offset = 0; |
1341 | while ( hei > 0 ) { | 1352 | while ( hei > 0 ) { |
1342 | int p_hei = 5; | 1353 | int p_hei = 5; |
1343 | if ( hei < 5 ) p_hei = hei; | 1354 | if ( hei < 5 ) p_hei = hei; |
1344 | hei -= 5; | 1355 | hei -= 5; |
1345 | bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); | 1356 | bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source); |
1346 | offset += 5; | 1357 | offset += 5; |
1347 | } | 1358 | } |
1348 | } | 1359 | } |
1349 | } | 1360 | } |
1350 | p->begin( pd ); | 1361 | p->begin( pd ); |
1351 | } else { | 1362 | } else { |
@@ -1362,13 +1373,13 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | |||
1362 | int selectionX = KOGlobals::self()->reverseLayout() ? | 1373 | int selectionX = KOGlobals::self()->reverseLayout() ? |
1363 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : | 1374 | (mColumns - 1 - mSelectionCellX) * mGridSpacingX : |
1364 | mSelectionCellX * mGridSpacingX; | 1375 | mSelectionCellX * mGridSpacingX; |
1365 | contentsToViewport ( cx, cy, vx,vy); | 1376 | contentsToViewport ( cx, cy, vx,vy); |
1366 | // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; | 1377 | // qDebug(" %d %d %d %d ", cx, cy, cw,ch) ; |
1367 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) | 1378 | if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) ) |
1368 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP); | 1379 | bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source); |
1369 | 1380 | ||
1370 | if ( mSelectionHeight > 0 ) { | 1381 | if ( mSelectionHeight > 0 ) { |
1371 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); | 1382 | //qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight ); |
1372 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && | 1383 | if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && |
1373 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { | 1384 | ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { |
1374 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); | 1385 | contentsToViewport ( selectionX, mSelectionYTop, vx,vy); |
@@ -1376,13 +1387,13 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | |||
1376 | int hei = mSelectionHeight; | 1387 | int hei = mSelectionHeight; |
1377 | int offset = 0; | 1388 | int offset = 0; |
1378 | while ( hei > 0 ) { | 1389 | while ( hei > 0 ) { |
1379 | int p_hei = 5; | 1390 | int p_hei = 5; |
1380 | if ( hei < 5 ) p_hei = hei; | 1391 | if ( hei < 5 ) p_hei = hei; |
1381 | hei -= 5; | 1392 | hei -= 5; |
1382 | bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP); | 1393 | bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source); |
1383 | offset += 5; | 1394 | offset += 5; |
1384 | } | 1395 | } |
1385 | } | 1396 | } |
1386 | } | 1397 | } |
1387 | p->begin( pd ); | 1398 | p->begin( pd ); |
1388 | } | 1399 | } |
@@ -1573,20 +1584,20 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i | |||
1573 | } | 1584 | } |
1574 | } | 1585 | } |
1575 | // Draw horizontal lines of grid | 1586 | // Draw horizontal lines of grid |
1576 | int y = ((int)(cy/lGridSpacingY))*lGridSpacingY; | 1587 | int y = ((int)(cy/lGridSpacingY))*lGridSpacingY; |
1577 | if ( lGridSpacingY > 0 ) { | 1588 | if ( lGridSpacingY > 0 ) { |
1578 | while (y < cy + ch) { | 1589 | while (y < cy + ch) { |
1579 | p->setPen( SolidLine ); | 1590 | p->setPen( Qt::SolidLine ); |
1580 | p->drawLine(cx,y,cx+cw,y); | 1591 | p->drawLine(cx,y,cx+cw,y); |
1581 | y+=lGridSpacingY; | 1592 | y+=lGridSpacingY; |
1582 | p->setPen( DotLine ); | 1593 | p->setPen( Qt::DotLine ); |
1583 | p->drawLine(cx,y,cx+cw,y); | 1594 | p->drawLine(cx,y,cx+cw,y); |
1584 | y+=lGridSpacingY; | 1595 | y+=lGridSpacingY; |
1585 | } | 1596 | } |
1586 | p->setPen( SolidLine ); | 1597 | p->setPen( Qt::SolidLine ); |
1587 | } | 1598 | } |
1588 | mPixPainter.end() ; | 1599 | mPixPainter.end() ; |
1589 | } | 1600 | } |
1590 | 1601 | ||
1591 | /* | 1602 | /* |
1592 | Convert srcollview contents coordinates to agenda grid coordinates. | 1603 | Convert srcollview contents coordinates to agenda grid coordinates. |
@@ -1714,13 +1725,13 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) | |||
1714 | //qDebug("item found "); | 1725 | //qDebug("item found "); |
1715 | item->hide(); | 1726 | item->hide(); |
1716 | item->setCellX(-2, -1 ); | 1727 | item->setCellX(-2, -1 ); |
1717 | item->select(false); | 1728 | item->select(false); |
1718 | mUnusedItems.append( item ); | 1729 | mUnusedItems.append( item ); |
1719 | mItems.remove( item ); | 1730 | mItems.remove( item ); |
1720 | QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); | 1731 | Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); |
1721 | KOAgendaItem *itemit; | 1732 | KOAgendaItem *itemit; |
1722 | //globalFlagBlockAgendaItemPaint = 1; | 1733 | //globalFlagBlockAgendaItemPaint = 1; |
1723 | for ( itemit=oldconflictItems.first(); itemit != 0; | 1734 | for ( itemit=oldconflictItems.first(); itemit != 0; |
1724 | itemit=oldconflictItems.next() ) { | 1735 | itemit=oldconflictItems.next() ) { |
1725 | if ( itemit != item ) | 1736 | if ( itemit != item ) |
1726 | placeSubCells(itemit); | 1737 | placeSubCells(itemit); |
@@ -1744,13 +1755,13 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) | |||
1744 | return; | 1755 | return; |
1745 | } | 1756 | } |
1746 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) | 1757 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) |
1747 | return; | 1758 | return; |
1748 | //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); | 1759 | //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); |
1749 | QDate currentDate = QDate::currentDate(); | 1760 | QDate currentDate = QDate::currentDate(); |
1750 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); | 1761 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); |
1751 | QDateTime dt; | 1762 | QDateTime dt; |
1752 | if ( todo->hasCompletedDate() ) | 1763 | if ( todo->hasCompletedDate() ) |
1753 | dt = todo->completed(); | 1764 | dt = todo->completed(); |
1754 | else | 1765 | else |
1755 | dt = todo->dtDue(); | 1766 | dt = todo->dtDue(); |
1756 | if ( overdue ) { | 1767 | if ( overdue ) { |
@@ -1776,13 +1787,13 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) | |||
1776 | int startY = endY - 1-hi; | 1787 | int startY = endY - 1-hi; |
1777 | item = insertItem(todo,currentDate,days,startY,endY); | 1788 | item = insertItem(todo,currentDate,days,startY,endY); |
1778 | item->show(); | 1789 | item->show(); |
1779 | } | 1790 | } |
1780 | qApp->processEvents(); | 1791 | qApp->processEvents(); |
1781 | globalFlagBlockAgendaItemPaint = 0; | 1792 | globalFlagBlockAgendaItemPaint = 0; |
1782 | QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); | 1793 | Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); |
1783 | KOAgendaItem *itemit; | 1794 | KOAgendaItem *itemit; |
1784 | for ( itemit=oldconflictItems.first(); itemit != 0; | 1795 | for ( itemit=oldconflictItems.first(); itemit != 0; |
1785 | itemit=oldconflictItems.next() ) { | 1796 | itemit=oldconflictItems.next() ) { |
1786 | globalFlagBlockAgendaItemUpdate = 0; | 1797 | globalFlagBlockAgendaItemUpdate = 0; |
1787 | itemit->repaintMe(); | 1798 | itemit->repaintMe(); |
1788 | globalFlagBlockAgendaItemUpdate = 1; | 1799 | globalFlagBlockAgendaItemUpdate = 1; |
@@ -1864,13 +1875,13 @@ void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, | |||
1864 | 1875 | ||
1865 | int cellX,cellYTop,cellYBottom; | 1876 | int cellX,cellYTop,cellYBottom; |
1866 | QString newtext; | 1877 | QString newtext; |
1867 | int width = XEnd - XBegin + 1; | 1878 | int width = XEnd - XBegin + 1; |
1868 | int count = 0; | 1879 | int count = 0; |
1869 | KOAgendaItem *current = 0; | 1880 | KOAgendaItem *current = 0; |
1870 | QPtrList<KOAgendaItem> multiItems; | 1881 | Q3PtrList<KOAgendaItem> multiItems; |
1871 | for (cellX = XBegin;cellX <= XEnd;++cellX) { | 1882 | for (cellX = XBegin;cellX <= XEnd;++cellX) { |
1872 | if (cellX == XBegin) cellYTop = YTop; | 1883 | if (cellX == XBegin) cellYTop = YTop; |
1873 | else cellYTop = 0; | 1884 | else cellYTop = 0; |
1874 | if (cellX == XEnd) cellYBottom = YBottom; | 1885 | if (cellX == XEnd) cellYBottom = YBottom; |
1875 | else cellYBottom = rows() - 1; | 1886 | else cellYBottom = rows() - 1; |
1876 | newtext = QString("(%1/%2): ").arg(++count).arg(width); | 1887 | newtext = QString("(%1/%2): ").arg(++count).arg(width); |
@@ -1924,13 +1935,13 @@ void KOAgenda::finishResize ( ) | |||
1924 | */ | 1935 | */ |
1925 | void KOAgenda::resizeEvent ( QResizeEvent *ev ) | 1936 | void KOAgenda::resizeEvent ( QResizeEvent *ev ) |
1926 | { | 1937 | { |
1927 | mSelectionHeight = 0; | 1938 | mSelectionHeight = 0; |
1928 | mResizeTimer.start( 150 , true ); | 1939 | mResizeTimer.start( 150 , true ); |
1929 | computeSizes(); | 1940 | computeSizes(); |
1930 | QScrollView::resizeEvent( ev ); | 1941 | Q3ScrollView::resizeEvent( ev ); |
1931 | return; | 1942 | return; |
1932 | 1943 | ||
1933 | } | 1944 | } |
1934 | void KOAgenda::computeSizes() | 1945 | void KOAgenda::computeSizes() |
1935 | { | 1946 | { |
1936 | if ( globalFlagBlockStartup ) | 1947 | if ( globalFlagBlockStartup ) |
@@ -2013,13 +2024,13 @@ void KOAgenda::popupAlarm() | |||
2013 | if (!mClickedItem) { | 2024 | if (!mClickedItem) { |
2014 | qDebug("KOAgenda::popupAlarm() called without having a clicked item "); | 2025 | qDebug("KOAgenda::popupAlarm() called without having a clicked item "); |
2015 | return; | 2026 | return; |
2016 | } | 2027 | } |
2017 | // TODO: deal correctly with multiple alarms | 2028 | // TODO: deal correctly with multiple alarms |
2018 | Alarm* alarm; | 2029 | Alarm* alarm; |
2019 | QPtrList<Alarm> list(mClickedItem->incidence()->alarms()); | 2030 | Q3PtrList<Alarm> list(mClickedItem->incidence()->alarms()); |
2020 | for(alarm=list.first();alarm;alarm=list.next()) { | 2031 | for(alarm=list.first();alarm;alarm=list.next()) { |
2021 | alarm->toggleAlarm(); | 2032 | alarm->toggleAlarm(); |
2022 | } | 2033 | } |
2023 | emit itemModified( mClickedItem , KOGlobals::EVENTEDITED ); | 2034 | emit itemModified( mClickedItem , KOGlobals::EVENTEDITED ); |
2024 | mClickedItem->paintMe( true ); | 2035 | mClickedItem->paintMe( true ); |
2025 | mClickedItem->repaint( false ); | 2036 | mClickedItem->repaint( false ); |
@@ -2104,22 +2115,22 @@ void KOAgenda::selectItem(KOAgendaItem *item) | |||
2104 | } | 2115 | } |
2105 | 2116 | ||
2106 | // This function seems never be called. | 2117 | // This function seems never be called. |
2107 | void KOAgenda::keyPressEvent( QKeyEvent *kev ) | 2118 | void KOAgenda::keyPressEvent( QKeyEvent *kev ) |
2108 | { | 2119 | { |
2109 | switch(kev->key()) { | 2120 | switch(kev->key()) { |
2110 | case Key_PageDown: | 2121 | case Qt::Key_PageDown: |
2111 | verticalScrollBar()->addPage(); | 2122 | verticalScrollBar()->addPage(); |
2112 | break; | 2123 | break; |
2113 | case Key_PageUp: | 2124 | case Qt::Key_PageUp: |
2114 | verticalScrollBar()->subtractPage(); | 2125 | verticalScrollBar()->subtractPage(); |
2115 | break; | 2126 | break; |
2116 | case Key_Down: | 2127 | case Qt::Key_Down: |
2117 | verticalScrollBar()->addLine(); | 2128 | verticalScrollBar()->addLine(); |
2118 | break; | 2129 | break; |
2119 | case Key_Up: | 2130 | case Qt::Key_Up: |
2120 | verticalScrollBar()->subtractLine(); | 2131 | verticalScrollBar()->subtractLine(); |
2121 | break; | 2132 | break; |
2122 | default: | 2133 | default: |
2123 | ; | 2134 | ; |
2124 | } | 2135 | } |
2125 | } | 2136 | } |
@@ -2143,13 +2154,13 @@ DateList KOAgenda::dateList() const | |||
2143 | 2154 | ||
2144 | void KOAgenda::setDateList(const DateList &selectedDates) | 2155 | void KOAgenda::setDateList(const DateList &selectedDates) |
2145 | { | 2156 | { |
2146 | mSelectedDates = selectedDates; | 2157 | mSelectedDates = selectedDates; |
2147 | } | 2158 | } |
2148 | 2159 | ||
2149 | void KOAgenda::setHolidayMask(QMemArray<bool> *mask) | 2160 | void KOAgenda::setHolidayMask(Q3MemArray<bool> *mask) |
2150 | { | 2161 | { |
2151 | mHolidayMask = mask; | 2162 | mHolidayMask = mask; |
2152 | 2163 | ||
2153 | /* | 2164 | /* |
2154 | kdDebug() << "HolidayMask: "; | 2165 | kdDebug() << "HolidayMask: "; |
2155 | for(uint i=0;i<mask->count();++i) { | 2166 | for(uint i=0;i<mask->count();++i) { |
@@ -2159,13 +2170,13 @@ void KOAgenda::setHolidayMask(QMemArray<bool> *mask) | |||
2159 | */ | 2170 | */ |
2160 | } | 2171 | } |
2161 | 2172 | ||
2162 | void KOAgenda::contentsMousePressEvent ( QMouseEvent *event ) | 2173 | void KOAgenda::contentsMousePressEvent ( QMouseEvent *event ) |
2163 | { | 2174 | { |
2164 | 2175 | ||
2165 | QScrollView::contentsMousePressEvent(event); | 2176 | Q3ScrollView::contentsMousePressEvent(event); |
2166 | } | 2177 | } |
2167 | 2178 | ||
2168 | void KOAgenda::storePosition() | 2179 | void KOAgenda::storePosition() |
2169 | { | 2180 | { |
2170 | //mContentPosition | 2181 | //mContentPosition |
2171 | int max = mGridSpacingY*4*24; | 2182 | int max = mGridSpacingY*4*24; |
@@ -2193,19 +2204,19 @@ void KOAgenda::restorePosition() | |||
2193 | //qDebug("posY %d hei %d", posY, max); | 2204 | //qDebug("posY %d hei %d", posY, max); |
2194 | 2205 | ||
2195 | } | 2206 | } |
2196 | void KOAgenda::moveChild( QWidget *w, int x , int y ) | 2207 | void KOAgenda::moveChild( QWidget *w, int x , int y ) |
2197 | { | 2208 | { |
2198 | ++x; | 2209 | ++x; |
2199 | QScrollView::moveChild( w, x , y ); | 2210 | Q3ScrollView::moveChild( w, x , y ); |
2200 | } | 2211 | } |
2201 | #include <qmessagebox.h> | 2212 | #include <qmessagebox.h> |
2202 | #ifdef DESKTOP_VERSION | 2213 | #ifdef DESKTOP_VERSION |
2203 | #include <qprinter.h> | 2214 | #include <qprinter.h> |
2204 | #include <qpainter.h> | 2215 | #include <qpainter.h> |
2205 | #include <qpaintdevicemetrics.h> | 2216 | #include <q3paintdevicemetrics.h> |
2206 | 2217 | ||
2207 | #endif | 2218 | #endif |
2208 | void KOAgenda::printSelection() | 2219 | void KOAgenda::printSelection() |
2209 | { | 2220 | { |
2210 | #ifdef DESKTOP_VERSION | 2221 | #ifdef DESKTOP_VERSION |
2211 | if ( mStartCellY == mCurrentCellY ) { | 2222 | if ( mStartCellY == mCurrentCellY ) { |
@@ -2228,13 +2239,13 @@ void KOAgenda::printSelection() | |||
2228 | QPrinter* printer = new QPrinter(); | 2239 | QPrinter* printer = new QPrinter(); |
2229 | if ( !printer->setup()) { | 2240 | if ( !printer->setup()) { |
2230 | delete printer; | 2241 | delete printer; |
2231 | return; | 2242 | return; |
2232 | } | 2243 | } |
2233 | QPainter p( printer ); | 2244 | QPainter p( printer ); |
2234 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( printer ); | 2245 | Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( printer ); |
2235 | QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); | 2246 | QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() ); |
2236 | //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); | 2247 | //date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true ); |
2237 | int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); | 2248 | int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height(); |
2238 | // p.drawText( 0, 0, date ); | 2249 | // p.drawText( 0, 0, date ); |
2239 | int offset = m.width()/8; | 2250 | int offset = m.width()/8; |
2240 | // compute the scale | 2251 | // compute the scale |
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 380ce62..0708341 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h | |||
@@ -20,33 +20,42 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOAGENDA_H | 23 | #ifndef KOAGENDA_H |
24 | #define KOAGENDA_H | 24 | #define KOAGENDA_H |
25 | 25 | ||
26 | #include <qscrollview.h> | 26 | #include <q3scrollview.h> |
27 | #include <qtimer.h> | 27 | #include <qtimer.h> |
28 | #include <qmemarray.h> | 28 | #include <q3memarray.h> |
29 | #include <qpainter.h> | 29 | #include <qpainter.h> |
30 | #include <qpixmap.h> | 30 | #include <qpixmap.h> |
31 | #include <qguardedptr.h> | 31 | #include <qpointer.h> |
32 | //Added by qt3to4: | ||
33 | #include <QResizeEvent> | ||
34 | #include <Q3Frame> | ||
35 | #include <QLabel> | ||
36 | #include <QMouseEvent> | ||
37 | #include <Q3PtrList> | ||
38 | #include <Q3PopupMenu> | ||
39 | #include <QKeyEvent> | ||
40 | #include <QEvent> | ||
32 | 41 | ||
33 | #include "koagendaitem.h" | 42 | #include "koagendaitem.h" |
34 | #include "koeventview.h" | 43 | #include "koeventview.h" |
35 | 44 | ||
36 | class QPopupMenu; | 45 | class Q3PopupMenu; |
37 | class QTime; | 46 | class QTime; |
38 | class KConfig; | 47 | class KConfig; |
39 | class QFrame; | 48 | class Q3Frame; |
40 | class KOAgenda; | 49 | class KOAgenda; |
41 | class KCal::Event; | 50 | class KCal::Event; |
42 | class KCal::Todo; | 51 | class KCal::Todo; |
43 | 52 | ||
44 | using namespace KCal; | 53 | using namespace KCal; |
45 | 54 | ||
46 | class MarcusBains : public QFrame { | 55 | class MarcusBains : public Q3Frame { |
47 | Q_OBJECT | 56 | Q_OBJECT |
48 | public: | 57 | public: |
49 | MarcusBains(KOAgenda *agenda=0,const char *name=0); | 58 | MarcusBains(KOAgenda *agenda=0,const char *name=0); |
50 | virtual ~MarcusBains(); | 59 | virtual ~MarcusBains(); |
51 | void hideMe(); | 60 | void hideMe(); |
52 | public slots: | 61 | public slots: |
@@ -60,23 +69,23 @@ class MarcusBains : public QFrame { | |||
60 | KOAgenda *agenda; | 69 | KOAgenda *agenda; |
61 | QTime oldTime; | 70 | QTime oldTime; |
62 | int oldToday; | 71 | int oldToday; |
63 | }; | 72 | }; |
64 | 73 | ||
65 | 74 | ||
66 | class KOAgenda : public QScrollView | 75 | class KOAgenda : public Q3ScrollView |
67 | { | 76 | { |
68 | Q_OBJECT | 77 | Q_OBJECT |
69 | public: | 78 | public: |
70 | enum MouseActionType { NOP, MOVE, SELECT, | 79 | enum MouseActionType { NOP, MOVE, SELECT, |
71 | RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; | 80 | RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; |
72 | 81 | ||
73 | KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, | 82 | KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, |
74 | const char * name=0, WFlags f=0 ); | 83 | const char * name=0, Qt::WFlags f=0 ); |
75 | KOAgenda ( int columns, QWidget * parent=0, | 84 | KOAgenda ( int columns, QWidget * parent=0, |
76 | const char * name=0, WFlags f=0 ); | 85 | const char * name=0, Qt::WFlags f=0 ); |
77 | virtual ~KOAgenda(); | 86 | virtual ~KOAgenda(); |
78 | bool mInvalidPixmap; | 87 | bool mInvalidPixmap; |
79 | 88 | ||
80 | Incidence *selectedIncidence() const; | 89 | Incidence *selectedIncidence() const; |
81 | QDate selectedIncidenceDate() const; | 90 | QDate selectedIncidenceDate() const; |
82 | 91 | ||
@@ -114,13 +123,13 @@ class KOAgenda : public QScrollView | |||
114 | virtual int minimumWidth() const; | 123 | virtual int minimumWidth() const; |
115 | /** Update configuration from preference settings */ | 124 | /** Update configuration from preference settings */ |
116 | void updateConfig(); | 125 | void updateConfig(); |
117 | 126 | ||
118 | void checkScrollBoundaries(); | 127 | void checkScrollBoundaries(); |
119 | 128 | ||
120 | void setHolidayMask(QMemArray<bool> *); | 129 | void setHolidayMask(Q3MemArray<bool> *); |
121 | void setDateList(const DateList &selectedDates); | 130 | void setDateList(const DateList &selectedDates); |
122 | DateList dateList() const; | 131 | DateList dateList() const; |
123 | void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); | 132 | void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); |
124 | void finishUpdate(); | 133 | void finishUpdate(); |
125 | void printSelection(); | 134 | void printSelection(); |
126 | void storePosition(); | 135 | void storePosition(); |
@@ -274,35 +283,35 @@ class KOAgenda : public QScrollView | |||
274 | DateList mSelectedDates; | 283 | DateList mSelectedDates; |
275 | 284 | ||
276 | // The KOAgendaItem, which has been right-clicked last | 285 | // The KOAgendaItem, which has been right-clicked last |
277 | KOAgendaItem *mClickedItem; | 286 | KOAgendaItem *mClickedItem; |
278 | 287 | ||
279 | // The KOAgendaItem, which is being moved/resized | 288 | // The KOAgendaItem, which is being moved/resized |
280 | QGuardedPtr<KOAgendaItem> mActionItem; | 289 | QPointer<KOAgendaItem> mActionItem; |
281 | 290 | ||
282 | // Currently selected item | 291 | // Currently selected item |
283 | QGuardedPtr<KOAgendaItem> mSelectedItem; | 292 | QPointer<KOAgendaItem> mSelectedItem; |
284 | 293 | ||
285 | // The Marcus Bains Line widget. | 294 | // The Marcus Bains Line widget. |
286 | MarcusBains *mMarcusBains; | 295 | MarcusBains *mMarcusBains; |
287 | void computeSizes(); | 296 | void computeSizes(); |
288 | 297 | ||
289 | MouseActionType mActionType; | 298 | MouseActionType mActionType; |
290 | 299 | ||
291 | bool mItemMoved; | 300 | bool mItemMoved; |
292 | 301 | ||
293 | // List of all Items contained in agenda | 302 | // List of all Items contained in agenda |
294 | QPtrList<KOAgendaItem> mItems; | 303 | Q3PtrList<KOAgendaItem> mItems; |
295 | QPtrList<KOAgendaItem> mUnusedItems; | 304 | Q3PtrList<KOAgendaItem> mUnusedItems; |
296 | KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport); | 305 | KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport); |
297 | QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems | 306 | Q3PopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems |
298 | QPopupMenu *mNewItemPopup; | 307 | Q3PopupMenu *mNewItemPopup; |
299 | 308 | ||
300 | int mOldLowerScrollValue; | 309 | int mOldLowerScrollValue; |
301 | int mOldUpperScrollValue; | 310 | int mOldUpperScrollValue; |
302 | KOAgendaItem * getItemForTodo ( Todo * todo ); | 311 | KOAgendaItem * getItemForTodo ( Todo * todo ); |
303 | QMemArray<bool> *mHolidayMask; | 312 | Q3MemArray<bool> *mHolidayMask; |
304 | int mCurPixWid; | 313 | int mCurPixWid; |
305 | int mCurPixHei; | 314 | int mCurPixHei; |
306 | }; | 315 | }; |
307 | 316 | ||
308 | #endif // KOAGENDA_H | 317 | #endif // KOAGENDA_H |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 407424d..0f9a38f 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -16,19 +16,29 @@ | |||
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qhbox.h> | 22 | #include <q3hbox.h> |
23 | #include <qvbox.h> | 23 | #include <q3vbox.h> |
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qwhatsthis.h> | 25 | #include <q3whatsthis.h> |
26 | #include <qdragobject.h> | 26 | #include <q3dragobject.h> |
27 | #include <qdrawutil.h> | 27 | #include <qdrawutil.h> |
28 | #include <qpainter.h> | 28 | #include <qpainter.h> |
29 | #include <QDesktopWidget> | ||
30 | //Added by qt3to4: | ||
31 | #include <Q3PtrList> | ||
32 | #include <QPixmap> | ||
33 | #include <QDragEnterEvent> | ||
34 | #include <QDropEvent> | ||
35 | #include <QResizeEvent> | ||
36 | #include <QMouseEvent> | ||
37 | #include <QEvent> | ||
38 | #include <QPaintEvent> | ||
29 | 39 | ||
30 | #include <kiconloader.h> | 40 | #include <kiconloader.h> |
31 | #include <kdebug.h> | 41 | #include <kdebug.h> |
32 | #include <kglobal.h> | 42 | #include <kglobal.h> |
33 | #include <klocale.h> | 43 | #include <klocale.h> |
34 | #ifndef DESKTOP_VERSION | 44 | #ifndef DESKTOP_VERSION |
@@ -54,36 +64,36 @@ extern int globalFlagBlockAgendaItemUpdate; | |||
54 | //-------------------------------------------------------------------------- | 64 | //-------------------------------------------------------------------------- |
55 | 65 | ||
56 | QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; | 66 | QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; |
57 | 67 | ||
58 | //-------------------------------------------------------------------------- | 68 | //-------------------------------------------------------------------------- |
59 | 69 | ||
60 | class KOAgendaItemWhatsThis :public QWhatsThis | 70 | class KOAgendaItemWhatsThis :public Q3WhatsThis |
61 | { | 71 | { |
62 | public: | 72 | public: |
63 | KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; | 73 | KOAgendaItemWhatsThis( KOAgendaItem* view ) : Q3WhatsThis( view ),_view (view) { }; |
64 | 74 | ||
65 | protected: | 75 | protected: |
66 | virtual QString text( const QPoint& ) | 76 | virtual QString text( const QPoint& ) |
67 | { | 77 | { |
68 | return _view->getWhatsThisText() ; | 78 | return _view->getWhatsThisText() ; |
69 | } | 79 | } |
70 | private: | 80 | private: |
71 | KOAgendaItem * _view; | 81 | KOAgendaItem * _view; |
72 | }; | 82 | }; |
73 | 83 | ||
74 | KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, | 84 | KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, |
75 | const char *name,WFlags) : | 85 | const char *name,Qt::WFlags) : |
76 | QWidget(parent, name), mIncidence(incidence), mDate(qd) | 86 | QWidget(parent, name), mIncidence(incidence), mDate(qd) |
77 | { | 87 | { |
78 | #ifndef DESKTOP_VERSION | 88 | #ifndef DESKTOP_VERSION |
79 | //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); | 89 | //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); |
80 | #endif | 90 | #endif |
81 | mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); | 91 | mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); |
82 | int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase | 92 | Qt::WindowFlags wflags = windowFlags() |Qt::WRepaintNoErase;// WResizeNoErase |
83 | setWFlags ( wflags); | 93 | setWindowFlags ( wflags); |
84 | mAllDay = allday; | 94 | mAllDay = allday; |
85 | init ( incidence, qd ); | 95 | init ( incidence, qd ); |
86 | //setMouseTracking(true); | 96 | //setMouseTracking(true); |
87 | //setAcceptDrops(true); | 97 | //setAcceptDrops(true); |
88 | xPaintCoord = -1; | 98 | xPaintCoord = -1; |
89 | yPaintCoord = -1; | 99 | yPaintCoord = -1; |
@@ -100,13 +110,13 @@ QString KOAgendaItem::getWhatsThisText() | |||
100 | 110 | ||
101 | void KOAgendaItem::initColor () | 111 | void KOAgendaItem::initColor () |
102 | { | 112 | { |
103 | if ( (mIncidence->typeID() == todoID ) && | 113 | if ( (mIncidence->typeID() == todoID ) && |
104 | ( !((static_cast<Todo*>(mIncidence))->isCompleted()) && | 114 | ( !((static_cast<Todo*>(mIncidence))->isCompleted()) && |
105 | ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { | 115 | ((static_cast<Todo*>(mIncidence))->dtDue().date() <= QDate::currentDate()) ) ) { |
106 | if ( (static_cast<Todo*>(mIncidence))->dtDue() < QDateTime::currentDateTime().date()) | 116 | if ( (static_cast<Todo*>(mIncidence))->dtDue() < (QDateTime)QDateTime::currentDateTime().date()) |
107 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; | 117 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; |
108 | else | 118 | else |
109 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; | 119 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; |
110 | } | 120 | } |
111 | else { | 121 | else { |
112 | QStringList categories = mIncidence->categories(); | 122 | QStringList categories = mIncidence->categories(); |
@@ -129,13 +139,13 @@ void KOAgendaItem::initColor () | |||
129 | QColor BackgroundColor ( mBackgroundColor ); | 139 | QColor BackgroundColor ( mBackgroundColor ); |
130 | if ( mIncidence->calID() > 1 ) { | 140 | if ( mIncidence->calID() > 1 ) { |
131 | //BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); | 141 | //BackgroundColor = KOPrefs::instance()->defaultColor( mIncidence->calID() ); |
132 | } | 142 | } |
133 | mColorGroup = QColorGroup( BackgroundColor.light(), | 143 | mColorGroup = QColorGroup( BackgroundColor.light(), |
134 | BackgroundColor.dark(),BackgroundColor.light(), | 144 | BackgroundColor.dark(),BackgroundColor.light(), |
135 | BackgroundColor.dark(),BackgroundColor, black, BackgroundColor) ; | 145 | BackgroundColor.dark(),BackgroundColor, Qt::black, BackgroundColor) ; |
136 | setBackgroundColor( mBackgroundColor ); | 146 | setBackgroundColor( mBackgroundColor ); |
137 | mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); | 147 | mWhiteText = (mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue() < 250); |
138 | } | 148 | } |
139 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | 149 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) |
140 | { | 150 | { |
141 | mIncidence = incidence; | 151 | mIncidence = incidence; |
@@ -225,62 +235,62 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) | |||
225 | if ( horLayout ) | 235 | if ( horLayout ) |
226 | ++xOff; | 236 | ++xOff; |
227 | else | 237 | else |
228 | ++yOff; | 238 | ++yOff; |
229 | } | 239 | } |
230 | if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { | 240 | if (mIncidence->isAlarmEnabled() && mIncidence->alarmEnabled()) { |
231 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); | 241 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::red ); |
232 | if ( horLayout ) | 242 | if ( horLayout ) |
233 | ++xOff; | 243 | ++xOff; |
234 | else | 244 | else |
235 | ++yOff; | 245 | ++yOff; |
236 | } | 246 | } |
237 | if (mIncidence->doesRecur()) { | 247 | if (mIncidence->doesRecur()) { |
238 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); | 248 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::blue ); |
239 | if ( horLayout ) | 249 | if ( horLayout ) |
240 | ++xOff; | 250 | ++xOff; |
241 | else | 251 | else |
242 | ++yOff; | 252 | ++yOff; |
243 | } | 253 | } |
244 | if (mIncidence->description().length() > 0) { | 254 | if (mIncidence->description().length() > 0) { |
245 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); | 255 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkGreen ); |
246 | if ( horLayout ) | 256 | if ( horLayout ) |
247 | ++xOff; | 257 | ++xOff; |
248 | else | 258 | else |
249 | ++yOff; | 259 | ++yOff; |
250 | } | 260 | } |
251 | if (mIncidence->isReadOnly()) { | 261 | if (mIncidence->isReadOnly()) { |
252 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); | 262 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::white ); |
253 | if ( horLayout ) | 263 | if ( horLayout ) |
254 | ++xOff; | 264 | ++xOff; |
255 | else | 265 | else |
256 | ++yOff; | 266 | ++yOff; |
257 | } | 267 | } |
258 | 268 | ||
259 | if (mIncidence->attendeeCount()>0) { | 269 | if (mIncidence->attendeeCount()>0) { |
260 | 270 | ||
261 | if (mIncidence->organizer() == KOPrefs::instance()->email()) { | 271 | if (mIncidence->organizer() == KOPrefs::instance()->email()) { |
262 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); | 272 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::black ); |
263 | if ( horLayout ) | 273 | if ( horLayout ) |
264 | ++xOff; | 274 | ++xOff; |
265 | else | 275 | else |
266 | ++yOff; | 276 | ++yOff; |
267 | } else { | 277 | } else { |
268 | Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); | 278 | Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); |
269 | if (me!=0) { | 279 | if (me!=0) { |
270 | 280 | ||
271 | 281 | ||
272 | } else { | 282 | } else { |
273 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); | 283 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::yellow ); |
274 | if ( horLayout ) | 284 | if ( horLayout ) |
275 | ++xOff; | 285 | ++xOff; |
276 | else | 286 | else |
277 | ++yOff; | 287 | ++yOff; |
278 | 288 | ||
279 | } | 289 | } |
280 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); | 290 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, Qt::darkYellow ); |
281 | if ( horLayout ) | 291 | if ( horLayout ) |
282 | ++xOff; | 292 | ++xOff; |
283 | else | 293 | else |
284 | ++yOff; | 294 | ++yOff; |
285 | 295 | ||
286 | } | 296 | } |
@@ -417,39 +427,39 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) | |||
417 | else | 427 | else |
418 | if ( nfh < h -2 ) | 428 | if ( nfh < h -2 ) |
419 | ++yy; | 429 | ++yy; |
420 | } | 430 | } |
421 | int align; | 431 | int align; |
422 | #ifndef DESKTOP_VERSION | 432 | #ifndef DESKTOP_VERSION |
423 | align = ( AlignLeft|WordBreak|AlignTop); | 433 | align = ( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop); |
424 | #else | 434 | #else |
425 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 435 | align = ( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); |
426 | #endif | 436 | #endif |
427 | if ( addIcon ) { | 437 | if ( addIcon ) { |
428 | if ( ! horLayout ) { | 438 | if ( ! horLayout ) { |
429 | x += AGENDA_ICON_SIZE+3; | 439 | x += AGENDA_ICON_SIZE+3; |
430 | w -= (AGENDA_ICON_SIZE+3); | 440 | w -= (AGENDA_ICON_SIZE+3); |
431 | } | 441 | } |
432 | else { | 442 | else { |
433 | yy+= AGENDA_ICON_SIZE+2; | 443 | yy+= AGENDA_ICON_SIZE+2; |
434 | h -=(AGENDA_ICON_SIZE+3); | 444 | h -=(AGENDA_ICON_SIZE+3); |
435 | } | 445 | } |
436 | } | 446 | } |
437 | if ( mWhiteText ) | 447 | if ( mWhiteText ) |
438 | paint->setPen ( white); | 448 | paint->setPen ( Qt::white); |
439 | if ( x < 0 ) { | 449 | if ( x < 0 ) { |
440 | w = w+x-3; | 450 | w = w+x-3; |
441 | x = 3; | 451 | x = 3; |
442 | if ( !horLayout && addIcon ) | 452 | if ( !horLayout && addIcon ) |
443 | x += AGENDA_ICON_SIZE+3; | 453 | x += AGENDA_ICON_SIZE+3; |
444 | if ( w > parentWidget()->width() ){ | 454 | if ( w > parentWidget()->width() ){ |
445 | w = parentWidget()->width() - 6; | 455 | w = parentWidget()->width() - 6; |
446 | #ifndef DESKTOP_VERSION | 456 | #ifndef DESKTOP_VERSION |
447 | align = ( AlignHCenter|WordBreak|AlignTop); | 457 | align = ( Qt::AlignHCenter|Qt::TextWordWrap|Qt::AlignTop); |
448 | #else | 458 | #else |
449 | align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); | 459 | align = ( Qt::AlignHCenter|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); |
450 | #endif | 460 | #endif |
451 | 461 | ||
452 | } | 462 | } |
453 | } | 463 | } |
454 | QRect dr; | 464 | QRect dr; |
455 | if ( w + x > parentWidget()->width() ) | 465 | if ( w + x > parentWidget()->width() ) |
@@ -558,13 +568,13 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) | |||
558 | if ( rw <= 1 ) { | 568 | if ( rw <= 1 ) { |
559 | //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); | 569 | //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); |
560 | return; | 570 | return; |
561 | } | 571 | } |
562 | } | 572 | } |
563 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); | 573 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); |
564 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); | 574 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,QPainter::CompositionMode_Source); |
565 | } | 575 | } |
566 | void KOAgendaItem::computeText() | 576 | void KOAgendaItem::computeText() |
567 | { | 577 | { |
568 | mDisplayedText = mIncidence->summary(); | 578 | mDisplayedText = mIncidence->summary(); |
569 | if ( (mIncidence->typeID() == todoID ) ) { | 579 | if ( (mIncidence->typeID() == todoID ) ) { |
570 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { | 580 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { |
@@ -625,13 +635,13 @@ void KOAgendaItem::computeText() | |||
625 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); | 635 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); |
626 | } | 636 | } |
627 | 637 | ||
628 | if (!mIncidence->location().isEmpty()) { | 638 | if (!mIncidence->location().isEmpty()) { |
629 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); | 639 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); |
630 | } | 640 | } |
631 | QToolTip::add(this,tipText,toolTipGroup(),""); | 641 | QToolTip::add(this,tipText /*TODO:hacker: ,toolTipGroup(),"" */); |
632 | #endif | 642 | #endif |
633 | } | 643 | } |
634 | void KOAgendaItem::updateItem() | 644 | void KOAgendaItem::updateItem() |
635 | { | 645 | { |
636 | computeText(); | 646 | computeText(); |
637 | 647 | ||
@@ -792,33 +802,33 @@ void KOAgendaItem::expandRight(int dx) | |||
792 | if (newXWidth < newX) newXWidth = newX; | 802 | if (newXWidth < newX) newXWidth = newX; |
793 | setCellX(newX,newXWidth); | 803 | setCellX(newX,newXWidth); |
794 | } | 804 | } |
795 | 805 | ||
796 | QToolTipGroup *KOAgendaItem::toolTipGroup() | 806 | QToolTipGroup *KOAgendaItem::toolTipGroup() |
797 | { | 807 | { |
798 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); | 808 | /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */ |
799 | return mToolTipGroup; | 809 | return mToolTipGroup; |
800 | } | 810 | } |
801 | 811 | ||
802 | void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) | 812 | void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) |
803 | { | 813 | { |
804 | #ifndef KORG_NODND | 814 | #ifndef KORG_NODND |
805 | if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || | 815 | if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || |
806 | !QTextDrag::canDecode( e ) ) { | 816 | !Q3TextDrag::canDecode( e ) ) { |
807 | e->ignore(); | 817 | e->ignore(); |
808 | return; | 818 | return; |
809 | } | 819 | } |
810 | e->accept(); | 820 | e->accept(); |
811 | #endif | 821 | #endif |
812 | } | 822 | } |
813 | 823 | ||
814 | void KOAgendaItem::dropEvent( QDropEvent *e ) | 824 | void KOAgendaItem::dropEvent( QDropEvent *e ) |
815 | { | 825 | { |
816 | #ifndef KORG_NODND | 826 | #ifndef KORG_NODND |
817 | QString text; | 827 | QString text; |
818 | if(QTextDrag::decode(e,text)) | 828 | if(Q3TextDrag::decode(e,text)) |
819 | { | 829 | { |
820 | kdDebug() << "Dropped : " << text << endl; | 830 | kdDebug() << "Dropped : " << text << endl; |
821 | QStringList emails = QStringList::split(",",text); | 831 | QStringList emails = QStringList::split(",",text); |
822 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { | 832 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { |
823 | kdDebug() << " Email: " << (*it) << endl; | 833 | kdDebug() << " Email: " << (*it) << endl; |
824 | int pos = (*it).find("<"); | 834 | int pos = (*it).find("<"); |
@@ -830,18 +840,18 @@ void KOAgendaItem::dropEvent( QDropEvent *e ) | |||
830 | } | 840 | } |
831 | } | 841 | } |
832 | #endif | 842 | #endif |
833 | } | 843 | } |
834 | 844 | ||
835 | 845 | ||
836 | QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() | 846 | Q3PtrList<KOAgendaItem> KOAgendaItem::conflictItems() |
837 | { | 847 | { |
838 | return mConflictItems; | 848 | return mConflictItems; |
839 | } | 849 | } |
840 | 850 | ||
841 | void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) | 851 | void KOAgendaItem::setConflictItems(Q3PtrList<KOAgendaItem> ci) |
842 | { | 852 | { |
843 | mConflictItems = ci; | 853 | mConflictItems = ci; |
844 | KOAgendaItem *item; | 854 | KOAgendaItem *item; |
845 | for ( item=mConflictItems.first(); item != 0; | 855 | for ( item=mConflictItems.first(); item != 0; |
846 | item=mConflictItems.next() ) { | 856 | item=mConflictItems.next() ) { |
847 | item->addConflictItem(this); | 857 | item->addConflictItem(this); |
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 27ee720..17cf975 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h | |||
@@ -16,17 +16,24 @@ | |||
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | #ifndef KOAGENDAITEM_H | 19 | #ifndef KOAGENDAITEM_H |
20 | #define KOAGENDAITEM_H | 20 | #define KOAGENDAITEM_H |
21 | 21 | ||
22 | #include <qframe.h> | 22 | #include <q3frame.h> |
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qpixmap.h> | 24 | #include <qpixmap.h> |
25 | #include <qdatetime.h> | 25 | #include <qdatetime.h> |
26 | #include <qpalette.h> | 26 | #include <qpalette.h> |
27 | //Added by qt3to4: | ||
28 | #include <QDropEvent> | ||
29 | #include <QPaintEvent> | ||
30 | #include <QResizeEvent> | ||
31 | #include <Q3PtrList> | ||
32 | #include <QEvent> | ||
33 | #include <QDragEnterEvent> | ||
27 | 34 | ||
28 | #include <libkcal/incidence.h> | 35 | #include <libkcal/incidence.h> |
29 | 36 | ||
30 | class KOAgendaItemWhatsThis; | 37 | class KOAgendaItemWhatsThis; |
31 | class QToolTipGroup; | 38 | class QToolTipGroup; |
32 | class QDragEnterEvent; | 39 | class QDragEnterEvent; |
@@ -42,13 +49,13 @@ using namespace KCal; | |||
42 | */ | 49 | */ |
43 | class KOAgendaItem : public QWidget | 50 | class KOAgendaItem : public QWidget |
44 | { | 51 | { |
45 | Q_OBJECT | 52 | Q_OBJECT |
46 | public: | 53 | public: |
47 | KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0, | 54 | KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0, |
48 | WFlags f=0 ); | 55 | Qt::WFlags f=0 ); |
49 | ~KOAgendaItem(); | 56 | ~KOAgendaItem(); |
50 | QString getWhatsThisText(); | 57 | QString getWhatsThisText(); |
51 | void init ( Incidence *incidence, QDate qd ); | 58 | void init ( Incidence *incidence, QDate qd ); |
52 | int cellX() { return mCellX; } | 59 | int cellX() { return mCellX; } |
53 | int cellXWidth() { return mCellXWidth; } | 60 | int cellXWidth() { return mCellXWidth; } |
54 | int cellYTop() { return mCellYTop; } | 61 | int cellYTop() { return mCellYTop; } |
@@ -93,14 +100,14 @@ class KOAgendaItem : public QWidget | |||
93 | QString text () { return mDisplayedText; } | 100 | QString text () { return mDisplayedText; } |
94 | 101 | ||
95 | virtual bool eventFilter ( QObject *, QEvent * ); | 102 | virtual bool eventFilter ( QObject *, QEvent * ); |
96 | 103 | ||
97 | static QToolTipGroup *toolTipGroup(); | 104 | static QToolTipGroup *toolTipGroup(); |
98 | 105 | ||
99 | QPtrList<KOAgendaItem> conflictItems(); | 106 | Q3PtrList<KOAgendaItem> conflictItems(); |
100 | void setConflictItems(QPtrList<KOAgendaItem>); | 107 | void setConflictItems(Q3PtrList<KOAgendaItem>); |
101 | void addConflictItem(KOAgendaItem *ci); | 108 | void addConflictItem(KOAgendaItem *ci); |
102 | void paintMe( bool, QPainter* painter = 0 ); | 109 | void paintMe( bool, QPainter* painter = 0 ); |
103 | void repaintMe(); | 110 | void repaintMe(); |
104 | static QPixmap * paintPix(); | 111 | static QPixmap * paintPix(); |
105 | static QPixmap * paintPixAllday(); | 112 | static QPixmap * paintPixAllday(); |
106 | void updateItem(); | 113 | void updateItem(); |
@@ -158,10 +165,10 @@ class KOAgendaItem : public QWidget | |||
158 | static QToolTipGroup *mToolTipGroup; | 165 | static QToolTipGroup *mToolTipGroup; |
159 | 166 | ||
160 | QColor mBackgroundColor; | 167 | QColor mBackgroundColor; |
161 | QColorGroup mColorGroup; | 168 | QColorGroup mColorGroup; |
162 | QString mDisplayedText; | 169 | QString mDisplayedText; |
163 | bool mSelected; | 170 | bool mSelected; |
164 | QPtrList<KOAgendaItem> mConflictItems; | 171 | Q3PtrList<KOAgendaItem> mConflictItems; |
165 | }; | 172 | }; |
166 | 173 | ||
167 | #endif // KOAGENDAITEM_H | 174 | #endif // KOAGENDAITEM_H |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 6e65a03..87993ae 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -18,27 +18,39 @@ | |||
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qhbox.h> | 24 | #include <q3hbox.h> |
25 | #include <qvbox.h> | 25 | #include <q3vbox.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qframe.h> | 27 | #include <q3frame.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #ifndef KORG_NOSPLITTER | 29 | #ifndef KORG_NOSPLITTER |
30 | #include <qsplitter.h> | 30 | #include <qsplitter.h> |
31 | #endif | 31 | #endif |
32 | #include <qfont.h> | 32 | #include <qfont.h> |
33 | #include <qfontmetrics.h> | 33 | #include <qfontmetrics.h> |
34 | #include <qpopupmenu.h> | 34 | #include <q3popupmenu.h> |
35 | #include <qtooltip.h> | 35 | #include <qtooltip.h> |
36 | #include <qpainter.h> | 36 | #include <qpainter.h> |
37 | #include <qpushbutton.h> | 37 | #include <qpushbutton.h> |
38 | #include <qapplication.h> | 38 | #include <qapplication.h> |
39 | #include <QDesktopWidget> | ||
40 | //Added by qt3to4: | ||
41 | #include <QResizeEvent> | ||
42 | #include <QPixmap> | ||
43 | #include <QMouseEvent> | ||
44 | #include <Q3GridLayout> | ||
45 | #include <Q3ValueList> | ||
46 | #include <QKeyEvent> | ||
47 | #include <Q3HBoxLayout> | ||
48 | #include <Q3VBoxLayout> | ||
49 | #include <QPaintEvent> | ||
50 | #include <Q3PtrList> | ||
39 | 51 | ||
40 | #include <kapplication.h> | 52 | #include <kapplication.h> |
41 | #include <KDGanttMinimizeSplitter.h> | 53 | #include <KDGanttMinimizeSplitter.h> |
42 | #include <kdebug.h> | 54 | #include <kdebug.h> |
43 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
44 | #include <kiconloader.h> | 56 | #include <kiconloader.h> |
@@ -75,14 +87,14 @@ extern int globalFlagBlockAgendaItemPaint; | |||
75 | extern int globalFlagBlockAgendaItemUpdate; | 87 | extern int globalFlagBlockAgendaItemUpdate; |
76 | extern int globalFlagBlockLabel; | 88 | extern int globalFlagBlockLabel; |
77 | using namespace KOrg; | 89 | using namespace KOrg; |
78 | 90 | ||
79 | #define IDLETIMEOUT 45 | 91 | #define IDLETIMEOUT 45 |
80 | 92 | ||
81 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : | 93 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,Qt::WFlags f) : |
82 | QScrollView(parent,name,f) | 94 | Q3ScrollView(parent,name,f) |
83 | { | 95 | { |
84 | myPix.resize( 1, 1 ); | 96 | myPix.resize( 1, 1 ); |
85 | mRows = rows; | 97 | mRows = rows; |
86 | 98 | ||
87 | mRedrawNeeded = true; | 99 | mRedrawNeeded = true; |
88 | setMinimumHeight( 20 ); | 100 | setMinimumHeight( 20 ); |
@@ -92,13 +104,13 @@ TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : | |||
92 | 104 | ||
93 | setHScrollBarMode(AlwaysOff); | 105 | setHScrollBarMode(AlwaysOff); |
94 | setVScrollBarMode(AlwaysOff); | 106 | setVScrollBarMode(AlwaysOff); |
95 | 107 | ||
96 | resizeContents(50,mRows * mCellHeight); | 108 | resizeContents(50,mRows * mCellHeight); |
97 | 109 | ||
98 | viewport()->setBackgroundMode( PaletteBackground ); | 110 | viewport()->setBackgroundMode( Qt::PaletteBackground ); |
99 | } | 111 | } |
100 | 112 | ||
101 | void TimeLabels::setCellHeight(int height) | 113 | void TimeLabels::setCellHeight(int height) |
102 | { | 114 | { |
103 | mCellHeight = height; | 115 | mCellHeight = height; |
104 | } | 116 | } |
@@ -280,13 +292,13 @@ void TimeLabels::paintEvent(QPaintEvent*) | |||
280 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); | 292 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); |
281 | } | 293 | } |
282 | 294 | ||
283 | //////////////////////////////////////////////////////////////////////////// | 295 | //////////////////////////////////////////////////////////////////////////// |
284 | 296 | ||
285 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) | 297 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) |
286 | : QFrame(parent,name) | 298 | : Q3Frame(parent,name) |
287 | { | 299 | { |
288 | mColumns = 1; | 300 | mColumns = 1; |
289 | mTopBox = 0; | 301 | mTopBox = 0; |
290 | mLocation = loc; | 302 | mLocation = loc; |
291 | mTopLayout = 0; | 303 | mTopLayout = 0; |
292 | mPaintWidget = 0; | 304 | mPaintWidget = 0; |
@@ -390,60 +402,60 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
390 | if ( KOPrefs::instance()->mVerticalScreen ) { | 402 | if ( KOPrefs::instance()->mVerticalScreen ) { |
391 | expandPix = SmallIcon( "1updownarrow" ); | 403 | expandPix = SmallIcon( "1updownarrow" ); |
392 | } else { | 404 | } else { |
393 | expandPix = SmallIcon("1leftrightarrow" ); | 405 | expandPix = SmallIcon("1leftrightarrow" ); |
394 | } | 406 | } |
395 | 407 | ||
396 | QBoxLayout *topLayout = new QVBoxLayout(this); | 408 | Q3BoxLayout *topLayout = new Q3VBoxLayout(this); |
397 | 409 | ||
398 | // Create day name labels for agenda columns | 410 | // Create day name labels for agenda columns |
399 | // Create agenda splitter | 411 | // Create agenda splitter |
400 | 412 | ||
401 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 413 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
402 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 414 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
403 | topLayout->addWidget( mSplitterAgenda ); | 415 | topLayout->addWidget( mSplitterAgenda ); |
404 | mAllDayFrame = new QHBox(mSplitterAgenda); | 416 | mAllDayFrame = new Q3HBox(mSplitterAgenda); |
405 | mAllDayFrame->setFocusPolicy(NoFocus); | 417 | mAllDayFrame->setFocusPolicy(Qt::NoFocus); |
406 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); | 418 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); |
407 | agendaFrame->setFocusPolicy(NoFocus); | 419 | agendaFrame->setFocusPolicy(Qt::NoFocus); |
408 | 420 | ||
409 | // Create all-day agenda widget | 421 | // Create all-day agenda widget |
410 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); | 422 | mDummyAllDayLeft = new Q3VBox( mAllDayFrame ); |
411 | 423 | ||
412 | mExpandButton = new QPushButton(mDummyAllDayLeft); | 424 | mExpandButton = new QPushButton(mDummyAllDayLeft); |
413 | mExpandButton->setPixmap( expandPix ); | 425 | mExpandButton->setPixmap( expandPix ); |
414 | int widebut = mExpandButton->sizeHint().width()+4; | 426 | int widebut = mExpandButton->sizeHint().width()+4; |
415 | int heibut = mExpandButton->sizeHint().height()+4; | 427 | int heibut = mExpandButton->sizeHint().height()+4; |
416 | if ( heibut > widebut ) | 428 | if ( heibut > widebut ) |
417 | widebut = heibut ; | 429 | widebut = heibut ; |
418 | 430 | ||
419 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, | 431 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, |
420 | // QSizePolicy::Fixed ) ); | 432 | // QSizePolicy::Fixed ) ); |
421 | mExpandButton->setFixedSize( widebut, widebut); | 433 | mExpandButton->setFixedSize( widebut, widebut); |
422 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); | 434 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); |
423 | mExpandButton->setFocusPolicy(NoFocus); | 435 | mExpandButton->setFocusPolicy(Qt::NoFocus); |
424 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); | 436 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); |
425 | mAllDayAgenda->setFocusPolicy(NoFocus); | 437 | mAllDayAgenda->setFocusPolicy(Qt::NoFocus); |
426 | QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); | 438 | QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); |
427 | 439 | ||
428 | // Create event context menu for all day agenda | 440 | // Create event context menu for all day agenda |
429 | //mAllDayAgendaPopup = eventPopup(); | 441 | //mAllDayAgendaPopup = eventPopup(); |
430 | 442 | ||
431 | // Create agenda frame | 443 | // Create agenda frame |
432 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); | 444 | Q3GridLayout *agendaLayout = new Q3GridLayout(agendaFrame,4,3); |
433 | // QHBox *agendaFrame = new QHBox(splitterAgenda); | 445 | // QHBox *agendaFrame = new QHBox(splitterAgenda); |
434 | 446 | ||
435 | // create event indicator bars | 447 | // create event indicator bars |
436 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); | 448 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); |
437 | #ifndef DESKTOP_VERSION | 449 | #ifndef DESKTOP_VERSION |
438 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); | 450 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); |
439 | #endif | 451 | #endif |
440 | mDayLabelsFrame = new QHBox(agendaFrame); | 452 | mDayLabelsFrame = new Q3HBox(agendaFrame); |
441 | //topLayout->addWidget(mDayLabelsFrame); | 453 | //topLayout->addWidget(mDayLabelsFrame); |
442 | mDayLabels = new QFrame (mDayLabelsFrame); | 454 | mDayLabels = new Q3Frame (mDayLabelsFrame); |
443 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); | 455 | mLayoutDayLabels = new Q3HBoxLayout(mDayLabels); |
444 | agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); | 456 | agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); |
445 | agendaLayout->addWidget(mEventIndicatorTop,1,1); | 457 | agendaLayout->addWidget(mEventIndicatorTop,1,1); |
446 | 458 | ||
447 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, | 459 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, |
448 | agendaFrame); | 460 | agendaFrame); |
449 | agendaLayout->addWidget(mEventIndicatorBottom,3,1); | 461 | agendaLayout->addWidget(mEventIndicatorBottom,3,1); |
@@ -457,18 +469,18 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | |||
457 | this,SLOT(updateConfig())); | 469 | this,SLOT(updateConfig())); |
458 | 470 | ||
459 | // Create agenda | 471 | // Create agenda |
460 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); | 472 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); |
461 | agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); | 473 | agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); |
462 | agendaLayout->setColStretch(1,1); | 474 | agendaLayout->setColStretch(1,1); |
463 | mAgenda->setFocusPolicy(NoFocus); | 475 | mAgenda->setFocusPolicy(Qt::NoFocus); |
464 | // Create event context menu for agenda | 476 | // Create event context menu for agenda |
465 | mAllAgendaPopup = eventPopup(); | 477 | mAllAgendaPopup = eventPopup(); |
466 | 478 | ||
467 | #if 0 | 479 | #if 0 |
468 | mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), | 480 | mAllAgendaPopup->addAdditionalItem(QIcon(SmallIcon("bell")), |
469 | i18n("Toggle Alarm"),mAgenda, | 481 | i18n("Toggle Alarm"),mAgenda, |
470 | SLOT(popupAlarm()),true); | 482 | SLOT(popupAlarm()),true); |
471 | 483 | ||
472 | #endif | 484 | #endif |
473 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 485 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
474 | mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 486 | mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
@@ -915,15 +927,15 @@ int KOAgendaView::maxDatesHint() | |||
915 | 927 | ||
916 | int KOAgendaView::currentDateCount() | 928 | int KOAgendaView::currentDateCount() |
917 | { | 929 | { |
918 | return mSelectedDates.count(); | 930 | return mSelectedDates.count(); |
919 | } | 931 | } |
920 | 932 | ||
921 | QPtrList<Incidence> KOAgendaView::selectedIncidences() | 933 | Q3PtrList<Incidence> KOAgendaView::selectedIncidences() |
922 | { | 934 | { |
923 | QPtrList<Incidence> selected; | 935 | Q3PtrList<Incidence> selected; |
924 | Incidence *incidence; | 936 | Incidence *incidence; |
925 | 937 | ||
926 | incidence = mAgenda->selectedIncidence(); | 938 | incidence = mAgenda->selectedIncidence(); |
927 | if (incidence) selected.append(incidence); | 939 | if (incidence) selected.append(incidence); |
928 | 940 | ||
929 | incidence = mAllDayAgenda->selectedIncidence(); | 941 | incidence = mAllDayAgenda->selectedIncidence(); |
@@ -984,14 +996,14 @@ void KOAgendaView::updateConfig() | |||
984 | // for some reason, this needs to be called explicitly | 996 | // for some reason, this needs to be called explicitly |
985 | mTimeLabels->repaint(); | 997 | mTimeLabels->repaint(); |
986 | 998 | ||
987 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 999 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
988 | 1000 | ||
989 | // ToolTips displaying summary of events | 1001 | // ToolTips displaying summary of events |
990 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() | 1002 | /* TODO:hacker: KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() |
991 | ->mEnableToolTips); | 1003 | ->mEnableToolTips); */ |
992 | 1004 | ||
993 | //setHolidayMasks(); | 1005 | //setHolidayMasks(); |
994 | 1006 | ||
995 | //createDayLabels(); called by via updateView(); | 1007 | //createDayLabels(); called by via updateView(); |
996 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); | 1008 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); |
997 | updateView(); | 1009 | updateView(); |
@@ -1114,13 +1126,13 @@ void KOAgendaView::showDates( const QDate &start, const QDate &end ) | |||
1114 | 1126 | ||
1115 | // and update the view | 1127 | // and update the view |
1116 | fillAgenda(); | 1128 | fillAgenda(); |
1117 | } | 1129 | } |
1118 | 1130 | ||
1119 | 1131 | ||
1120 | void KOAgendaView::showEvents(QPtrList<Event>) | 1132 | void KOAgendaView::showEvents(Q3PtrList<Event>) |
1121 | { | 1133 | { |
1122 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; | 1134 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; |
1123 | } | 1135 | } |
1124 | 1136 | ||
1125 | void KOAgendaView::changeEventDisplay(Event *, int) | 1137 | void KOAgendaView::changeEventDisplay(Event *, int) |
1126 | { | 1138 | { |
@@ -1162,17 +1174,17 @@ void KOAgendaView::fillAgenda() | |||
1162 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); | 1174 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); |
1163 | setHolidayMasks(); | 1175 | setHolidayMasks(); |
1164 | 1176 | ||
1165 | mMinY.resize(mSelectedDates.count()); | 1177 | mMinY.resize(mSelectedDates.count()); |
1166 | mMaxY.resize(mSelectedDates.count()); | 1178 | mMaxY.resize(mSelectedDates.count()); |
1167 | 1179 | ||
1168 | QPtrList<Event> dayEvents; | 1180 | Q3PtrList<Event> dayEvents; |
1169 | 1181 | ||
1170 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1182 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1171 | // Therefore, gtodoset all of them. | 1183 | // Therefore, gtodoset all of them. |
1172 | QPtrList<Todo> todos = calendar()->todos(); | 1184 | Q3PtrList<Todo> todos = calendar()->todos(); |
1173 | 1185 | ||
1174 | mAgenda->setDateList(mSelectedDates); | 1186 | mAgenda->setDateList(mSelectedDates); |
1175 | 1187 | ||
1176 | QDate today = QDate::currentDate(); | 1188 | QDate today = QDate::currentDate(); |
1177 | 1189 | ||
1178 | DateList::ConstIterator dit; | 1190 | DateList::ConstIterator dit; |
@@ -1297,13 +1309,13 @@ void KOAgendaView::fillAgenda() | |||
1297 | 1309 | ||
1298 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date | 1310 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date |
1299 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) continue; | 1311 | if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) continue; |
1300 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1312 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1301 | // Already completed items can be displayed on their original due date | 1313 | // Already completed items can be displayed on their original due date |
1302 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda | 1314 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda |
1303 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; | 1315 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)today) && KOPrefs::instance()->mShowTodoInAgenda; |
1304 | bool fillIn = false; | 1316 | bool fillIn = false; |
1305 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) | 1317 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) |
1306 | fillIn = true; | 1318 | fillIn = true; |
1307 | if ( ! fillIn && !todo->hasCompletedDate() ) | 1319 | if ( ! fillIn && !todo->hasCompletedDate() ) |
1308 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); | 1320 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); |
1309 | if ( fillIn ) { | 1321 | if ( fillIn ) { |
@@ -1500,13 +1512,13 @@ void KOAgendaView::readSettings(KConfig *config) | |||
1500 | { | 1512 | { |
1501 | // kdDebug() << "KOAgendaView::readSettings()" << endl; | 1513 | // kdDebug() << "KOAgendaView::readSettings()" << endl; |
1502 | 1514 | ||
1503 | config->setGroup("Views"); | 1515 | config->setGroup("Views"); |
1504 | 1516 | ||
1505 | //#ifndef KORG_NOSPLITTER | 1517 | //#ifndef KORG_NOSPLITTER |
1506 | QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); | 1518 | Q3ValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); |
1507 | if (sizes.count() == 2) { | 1519 | if (sizes.count() == 2) { |
1508 | if ( sizes[0] < 20 ) { | 1520 | if ( sizes[0] < 20 ) { |
1509 | sizes[1] = sizes[1] +20 - sizes[0]; | 1521 | sizes[1] = sizes[1] +20 - sizes[0]; |
1510 | sizes[0] = 20; | 1522 | sizes[0] = 20; |
1511 | } | 1523 | } |
1512 | mSplitterAgenda->setSizes(sizes); | 1524 | mSplitterAgenda->setSizes(sizes); |
@@ -1521,13 +1533,13 @@ void KOAgendaView::writeSettings(KConfig *config) | |||
1521 | { | 1533 | { |
1522 | // kdDebug() << "KOAgendaView::writeSettings()" << endl; | 1534 | // kdDebug() << "KOAgendaView::writeSettings()" << endl; |
1523 | 1535 | ||
1524 | config->setGroup("Views"); | 1536 | config->setGroup("Views"); |
1525 | 1537 | ||
1526 | //#ifndef KORG_NOSPLITTER | 1538 | //#ifndef KORG_NOSPLITTER |
1527 | QValueList<int> list = mSplitterAgenda->sizes(); | 1539 | Q3ValueList<int> list = mSplitterAgenda->sizes(); |
1528 | config->writeEntry("Separator AgendaView",list); | 1540 | config->writeEntry("Separator AgendaView",list); |
1529 | //qDebug("write %d %d ", list[0],list[1] ); | 1541 | //qDebug("write %d %d ", list[0],list[1] ); |
1530 | //#endif | 1542 | //#endif |
1531 | } | 1543 | } |
1532 | 1544 | ||
1533 | void KOAgendaView::setHolidayMasks() | 1545 | void KOAgendaView::setHolidayMasks() |
@@ -1538,13 +1550,13 @@ void KOAgendaView::setHolidayMasks() | |||
1538 | for(i=0;i<mSelectedDates.count();++i) { | 1550 | for(i=0;i<mSelectedDates.count();++i) { |
1539 | QDate date = mSelectedDates[i]; | 1551 | QDate date = mSelectedDates[i]; |
1540 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); | 1552 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); |
1541 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); | 1553 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); |
1542 | bool showHoliday = false; | 1554 | bool showHoliday = false; |
1543 | if ( KOPrefs::instance()->mExcludeHolidays ) { | 1555 | if ( KOPrefs::instance()->mExcludeHolidays ) { |
1544 | QPtrList<Event> events = calendar()->events( date, true ); | 1556 | Q3PtrList<Event> events = calendar()->events( date, true ); |
1545 | Event *event; | 1557 | Event *event; |
1546 | for( event = events.first(); event; event = events.next() ) { | 1558 | for( event = events.first(); event; event = events.next() ) { |
1547 | if ( event->isHoliday()) { | 1559 | if ( event->isHoliday()) { |
1548 | showHoliday = true; | 1560 | showHoliday = true; |
1549 | break; | 1561 | break; |
1550 | } | 1562 | } |
@@ -1660,13 +1672,13 @@ void KOAgendaView::updateTodo( Todo * t, int ) | |||
1660 | da = t->dtDue().date(); | 1672 | da = t->dtDue().date(); |
1661 | if ( ! t->hasDueDate() && !t->hasCompletedDate() ) { | 1673 | if ( ! t->hasDueDate() && !t->hasCompletedDate() ) { |
1662 | remove = true; | 1674 | remove = true; |
1663 | removeAD = true; | 1675 | removeAD = true; |
1664 | } | 1676 | } |
1665 | else { | 1677 | else { |
1666 | bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; | 1678 | bool overdue = (!t->isCompleted()) && (t->dtDue() < (QDateTime)QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; |
1667 | if ( overdue && | 1679 | if ( overdue && |
1668 | QDate::currentDate() >= mSelectedDates.first() && | 1680 | QDate::currentDate() >= mSelectedDates.first() && |
1669 | QDate::currentDate() <= mSelectedDates.last()) { | 1681 | QDate::currentDate() <= mSelectedDates.last()) { |
1670 | removeAD = false; | 1682 | removeAD = false; |
1671 | remove = true; | 1683 | remove = true; |
1672 | } | 1684 | } |
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 5e68146..3b871d9 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h | |||
@@ -20,27 +20,37 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOAGENDAVIEW_H | 23 | #ifndef KOAGENDAVIEW_H |
24 | #define KOAGENDAVIEW_H | 24 | #define KOAGENDAVIEW_H |
25 | 25 | ||
26 | #include <qscrollview.h> | 26 | #include <q3scrollview.h> |
27 | #include <qdatetime.h> | 27 | #include <qdatetime.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <Q3BoxLayout> | ||
30 | #ifndef DESKTOP_VERSION | 31 | #ifndef DESKTOP_VERSION |
31 | #include <qksplitter.h> | 32 | #include <qksplitter.h> |
32 | #else | 33 | #else |
33 | #include <qsplitter.h> | 34 | #include <qsplitter.h> |
34 | #endif | 35 | #endif |
35 | #include <qmemarray.h> | 36 | #include <q3memarray.h> |
37 | //Added by qt3to4: | ||
38 | #include <QPaintEvent> | ||
39 | #include <QResizeEvent> | ||
40 | #include <Q3Frame> | ||
41 | #include <QPixmap> | ||
42 | #include <QLabel> | ||
43 | #include <QMouseEvent> | ||
44 | #include <Q3PtrList> | ||
45 | #include <QKeyEvent> | ||
36 | 46 | ||
37 | #include "koeventview.h" | 47 | #include "koeventview.h" |
38 | 48 | ||
39 | class QHBox; | 49 | class Q3HBox; |
40 | class QFrame; | 50 | class Q3Frame; |
41 | class QLabel; | 51 | class QLabel; |
42 | class QPushButton; | 52 | class QPushButton; |
43 | class CalendarView; | 53 | class CalendarView; |
44 | class KOAgenda; | 54 | class KOAgenda; |
45 | class KOAgendaItem; | 55 | class KOAgendaItem; |
46 | class KConfig; | 56 | class KConfig; |
@@ -52,13 +62,13 @@ class KOAgendaButton : public QPushButton | |||
52 | public: | 62 | public: |
53 | KOAgendaButton( QWidget *parent=0, const char *name=0 ) : | 63 | KOAgendaButton( QWidget *parent=0, const char *name=0 ) : |
54 | QPushButton( parent, name ) | 64 | QPushButton( parent, name ) |
55 | { | 65 | { |
56 | mNum = -3; | 66 | mNum = -3; |
57 | setFlat( true ); | 67 | setFlat( true ); |
58 | setFocusPolicy(NoFocus); | 68 | setFocusPolicy(Qt::NoFocus); |
59 | setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); | 69 | setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); |
60 | connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) ); | 70 | connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) ); |
61 | }; | 71 | }; |
62 | 72 | ||
63 | QSize sizeHint () const { return QSize( 5,5) ;} | 73 | QSize sizeHint () const { return QSize( 5,5) ;} |
64 | void setNum( int n) { mNum = n; } | 74 | void setNum( int n) { mNum = n; } |
@@ -67,16 +77,16 @@ private slots: | |||
67 | signals: | 77 | signals: |
68 | void numClicked( int ); | 78 | void numClicked( int ); |
69 | private: | 79 | private: |
70 | int mNum; | 80 | int mNum; |
71 | }; | 81 | }; |
72 | 82 | ||
73 | class TimeLabels : public QScrollView { | 83 | class TimeLabels : public Q3ScrollView { |
74 | Q_OBJECT | 84 | Q_OBJECT |
75 | public: | 85 | public: |
76 | TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); | 86 | TimeLabels(int rows,QWidget *parent=0,const char *name=0,Qt::WFlags f=0); |
77 | 87 | ||
78 | void setCellHeight(int height); | 88 | void setCellHeight(int height); |
79 | 89 | ||
80 | /** Calculates the minimum width */ | 90 | /** Calculates the minimum width */ |
81 | virtual int minimumWidth() const; | 91 | virtual int minimumWidth() const; |
82 | 92 | ||
@@ -110,13 +120,13 @@ class TimeLabels : public QScrollView { | |||
110 | int mCellHeight; | 120 | int mCellHeight; |
111 | 121 | ||
112 | /** */ | 122 | /** */ |
113 | KOAgenda* mAgenda; | 123 | KOAgenda* mAgenda; |
114 | }; | 124 | }; |
115 | 125 | ||
116 | class EventIndicator : public QFrame { | 126 | class EventIndicator : public Q3Frame { |
117 | Q_OBJECT | 127 | Q_OBJECT |
118 | public: | 128 | public: |
119 | enum Location { Top, Bottom }; | 129 | enum Location { Top, Bottom }; |
120 | EventIndicator(Location loc=Top,QWidget *parent=0,const char *name=0); | 130 | EventIndicator(Location loc=Top,QWidget *parent=0,const char *name=0); |
121 | virtual ~EventIndicator(); | 131 | virtual ~EventIndicator(); |
122 | 132 | ||
@@ -129,17 +139,17 @@ class EventIndicator : public QFrame { | |||
129 | void drawContents(QPainter *); | 139 | void drawContents(QPainter *); |
130 | 140 | ||
131 | private: | 141 | private: |
132 | int mXOffset; | 142 | int mXOffset; |
133 | KDGanttMinimizeSplitter* mPaintWidget; | 143 | KDGanttMinimizeSplitter* mPaintWidget; |
134 | int mColumns; | 144 | int mColumns; |
135 | QHBox *mTopBox; | 145 | Q3HBox *mTopBox; |
136 | QBoxLayout *mTopLayout; | 146 | Q3BoxLayout *mTopLayout; |
137 | Location mLocation; | 147 | Location mLocation; |
138 | QPixmap mPixmap; | 148 | QPixmap mPixmap; |
139 | QMemArray<bool> mEnabled; | 149 | Q3MemArray<bool> mEnabled; |
140 | }; | 150 | }; |
141 | 151 | ||
142 | /** | 152 | /** |
143 | KOAgendaView is the agenda-like view used to display events in an one or | 153 | KOAgendaView is the agenda-like view used to display events in an one or |
144 | multi-day view. | 154 | multi-day view. |
145 | */ | 155 | */ |
@@ -156,13 +166,13 @@ class KOAgendaView : public KOEventView { | |||
156 | virtual int maxDatesHint(); | 166 | virtual int maxDatesHint(); |
157 | 167 | ||
158 | /** Returns number of currently shown dates. */ | 168 | /** Returns number of currently shown dates. */ |
159 | virtual int currentDateCount(); | 169 | virtual int currentDateCount(); |
160 | 170 | ||
161 | /** returns the currently selected events */ | 171 | /** returns the currently selected events */ |
162 | virtual QPtrList<Incidence> selectedIncidences(); | 172 | virtual Q3PtrList<Incidence> selectedIncidences(); |
163 | 173 | ||
164 | /** returns the currently selected events */ | 174 | /** returns the currently selected events */ |
165 | virtual DateList selectedDates(); | 175 | virtual DateList selectedDates(); |
166 | 176 | ||
167 | /** Remove all events from view */ | 177 | /** Remove all events from view */ |
168 | void clearView(); | 178 | void clearView(); |
@@ -182,13 +192,13 @@ class KOAgendaView : public KOEventView { | |||
182 | void repaintAgenda(); | 192 | void repaintAgenda(); |
183 | public slots: | 193 | public slots: |
184 | void setInitStartHour(); | 194 | void setInitStartHour(); |
185 | virtual void updateView(); | 195 | virtual void updateView(); |
186 | virtual void updateConfig(); | 196 | virtual void updateConfig(); |
187 | virtual void showDates(const QDate &start, const QDate &end); | 197 | virtual void showDates(const QDate &start, const QDate &end); |
188 | virtual void showEvents(QPtrList<Event> eventList); | 198 | virtual void showEvents(Q3PtrList<Event> eventList); |
189 | 199 | ||
190 | void updateTodo( Todo *, int ); | 200 | void updateTodo( Todo *, int ); |
191 | void changeEventDisplay(Event *, int); | 201 | void changeEventDisplay(Event *, int); |
192 | 202 | ||
193 | void clearSelection(); | 203 | void clearSelection(); |
194 | 204 | ||
@@ -257,16 +267,16 @@ class KOAgendaView : public KOEventView { | |||
257 | 267 | ||
258 | private: | 268 | private: |
259 | bool flag_blockfillAgenda; | 269 | bool flag_blockfillAgenda; |
260 | QTimer* mIdleTimer; | 270 | QTimer* mIdleTimer; |
261 | QDateTime mIdleStart; | 271 | QDateTime mIdleStart; |
262 | // view widgets | 272 | // view widgets |
263 | QFrame *mDayLabels; | 273 | Q3Frame *mDayLabels; |
264 | QHBox *mDayLabelsFrame; | 274 | Q3HBox *mDayLabelsFrame; |
265 | QBoxLayout *mLayoutDayLabels; | 275 | Q3BoxLayout *mLayoutDayLabels; |
266 | QFrame *mAllDayFrame; | 276 | Q3Frame *mAllDayFrame; |
267 | KOAgenda *mAllDayAgenda; | 277 | KOAgenda *mAllDayAgenda; |
268 | KOAgenda *mAgenda; | 278 | KOAgenda *mAgenda; |
269 | TimeLabels *mTimeLabels; | 279 | TimeLabels *mTimeLabels; |
270 | QWidget *mDummyAllDayLeft; | 280 | QWidget *mDummyAllDayLeft; |
271 | 281 | ||
272 | KDGanttMinimizeSplitter* mSplitterAgenda; | 282 | KDGanttMinimizeSplitter* mSplitterAgenda; |
@@ -281,18 +291,18 @@ class KOAgendaView : public KOEventView { | |||
281 | KOEventPopupMenu *mAllAgendaPopup; | 291 | KOEventPopupMenu *mAllAgendaPopup; |
282 | //KOEventPopupMenu *mAllDayAgendaPopup; | 292 | //KOEventPopupMenu *mAllDayAgendaPopup; |
283 | 293 | ||
284 | EventIndicator *mEventIndicatorTop; | 294 | EventIndicator *mEventIndicatorTop; |
285 | EventIndicator *mEventIndicatorBottom; | 295 | EventIndicator *mEventIndicatorBottom; |
286 | 296 | ||
287 | QMemArray<int> mMinY; | 297 | Q3MemArray<int> mMinY; |
288 | QMemArray<int> mMaxY; | 298 | Q3MemArray<int> mMaxY; |
289 | 299 | ||
290 | QMemArray<bool> mHolidayMask; | 300 | Q3MemArray<bool> mHolidayMask; |
291 | 301 | ||
292 | QPtrList<KOAgendaButton> mDayLabelsList; | 302 | Q3PtrList<KOAgendaButton> mDayLabelsList; |
293 | QDateTime mTimeSpanBegin; | 303 | QDateTime mTimeSpanBegin; |
294 | QDateTime mTimeSpanEnd; | 304 | QDateTime mTimeSpanEnd; |
295 | bool mTimeSpanInAllDay; | 305 | bool mTimeSpanInAllDay; |
296 | void keyPressEvent ( QKeyEvent * e ); | 306 | void keyPressEvent ( QKeyEvent * e ); |
297 | }; | 307 | }; |
298 | 308 | ||
diff --git a/korganizer/kocounterdialog.h b/korganizer/kocounterdialog.h index c8dcf45..493d9e1 100644 --- a/korganizer/kocounterdialog.h +++ b/korganizer/kocounterdialog.h | |||
@@ -19,13 +19,13 @@ | |||
19 | #ifndef KOCOUNTERDIALOG_H | 19 | #ifndef KOCOUNTERDIALOG_H |
20 | #define KOCOUNTERDIALOG_H | 20 | #define KOCOUNTERDIALOG_H |
21 | // | 21 | // |
22 | // Viewer dialog for counter events. | 22 | // Viewer dialog for counter events. |
23 | // | 23 | // |
24 | 24 | ||
25 | #include <qtextview.h> | 25 | #include <q3textview.h> |
26 | 26 | ||
27 | #include <kdialogbase.h> | 27 | #include <kdialogbase.h> |
28 | 28 | ||
29 | #include <libkcal/event.h> | 29 | #include <libkcal/event.h> |
30 | 30 | ||
31 | using namespace KCal; | 31 | using namespace KCal; |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 52fd1e8..4f681b3 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -21,15 +21,24 @@ | |||
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source ode for Qt in the source distribution. | 22 | without including the source ode for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qevent.h> | 25 | #include <qevent.h> |
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qptrlist.h> | 27 | #include <q3ptrlist.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qwhatsthis.h> | 29 | #include <q3whatsthis.h> |
30 | //Added by qt3to4: | ||
31 | #include <QDragLeaveEvent> | ||
32 | #include <Q3Frame> | ||
33 | #include <QDragEnterEvent> | ||
34 | #include <QDragMoveEvent> | ||
35 | #include <QDropEvent> | ||
36 | #include <QResizeEvent> | ||
37 | #include <QMouseEvent> | ||
38 | #include <QPaintEvent> | ||
30 | 39 | ||
31 | #include <kglobal.h> | 40 | #include <kglobal.h> |
32 | #include <kdebug.h> | 41 | #include <kdebug.h> |
33 | #include <klocale.h> | 42 | #include <klocale.h> |
34 | 43 | ||
35 | #include <libkcal/vcaldrag.h> | 44 | #include <libkcal/vcaldrag.h> |
@@ -51,21 +60,21 @@ | |||
51 | 60 | ||
52 | // ============================================================================ | 61 | // ============================================================================ |
53 | // D Y N A M I C T I P | 62 | // D Y N A M I C T I P |
54 | // ============================================================================ | 63 | // ============================================================================ |
55 | 64 | ||
56 | DynamicTip::DynamicTip( QWidget * parent ) | 65 | DynamicTip::DynamicTip( QWidget * parent ) |
57 | : QToolTip( parent ) | 66 | /* TODO:hacker: : QToolTip( parent ) */ |
58 | { | 67 | { |
59 | matrix = (KODayMatrix*)parent; | 68 | matrix = (KODayMatrix*)parent; |
60 | } | 69 | } |
61 | 70 | ||
62 | class KODaymatrixWhatsThis :public QWhatsThis | 71 | class KODaymatrixWhatsThis :public Q3WhatsThis |
63 | { | 72 | { |
64 | public: | 73 | public: |
65 | KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;}; | 74 | KODaymatrixWhatsThis( KODayMatrix* view ) : Q3WhatsThis( view ),_view (view) { ;}; |
66 | ~KODaymatrixWhatsThis() { ; }; | 75 | ~KODaymatrixWhatsThis() { ; }; |
67 | 76 | ||
68 | protected: | 77 | protected: |
69 | virtual QString text( const QPoint& p ) | 78 | virtual QString text( const QPoint& p ) |
70 | { | 79 | { |
71 | return _view->getWhatsThisText( p ) ; | 80 | return _view->getWhatsThisText( p ) ; |
@@ -88,25 +97,25 @@ void DynamicTip::maybeTip( const QPoint &pos ) | |||
88 | // kdDebug() << "DynamicTip::maybeTip matrix cell index [" << | 97 | // kdDebug() << "DynamicTip::maybeTip matrix cell index [" << |
89 | // col << "][" << row << "] => " <<(col+row*7) << endl; | 98 | // col << "][" << row << "] => " <<(col+row*7) << endl; |
90 | 99 | ||
91 | //show holiday names only | 100 | //show holiday names only |
92 | QString str = matrix->getHolidayLabel(col+row*7); | 101 | QString str = matrix->getHolidayLabel(col+row*7); |
93 | if (str.isEmpty()) return; | 102 | if (str.isEmpty()) return; |
94 | tip(rct, str); | 103 | /* TODO:hacker: tip(rct, str);*/ |
95 | } | 104 | } |
96 | 105 | ||
97 | 106 | ||
98 | // ============================================================================ | 107 | // ============================================================================ |
99 | // K O D A Y M A T R I X | 108 | // K O D A Y M A T R I X |
100 | // ============================================================================ | 109 | // ============================================================================ |
101 | 110 | ||
102 | const int KODayMatrix::NOSELECTION = -1000; | 111 | const int KODayMatrix::NOSELECTION = -1000; |
103 | const int KODayMatrix::NUMDAYS = 42; | 112 | const int KODayMatrix::NUMDAYS = 42; |
104 | 113 | ||
105 | KODayMatrix::KODayMatrix( QWidget *parent, const char *name ) | 114 | KODayMatrix::KODayMatrix( QWidget *parent, const char *name ) |
106 | : QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 ) | 115 | : Q3Frame( parent, name , Qt::WNoAutoErase ), mCalendar( 0 ) |
107 | 116 | ||
108 | 117 | ||
109 | { | 118 | { |
110 | mLastView = -1; | 119 | mLastView = -1; |
111 | oldW = 0; | 120 | oldW = 0; |
112 | oldH = 0; | 121 | oldH = 0; |
@@ -148,13 +157,13 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) | |||
148 | { | 157 | { |
149 | 158 | ||
150 | int tmp = getDayIndexFrom(p.x(), p.y()); | 159 | int tmp = getDayIndexFrom(p.x(), p.y()); |
151 | if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) | 160 | if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) |
152 | return QString(); | 161 | return QString(); |
153 | QDate mDate = days[tmp]; | 162 | QDate mDate = days[tmp]; |
154 | QPtrList<Event> eventlist = mCalendar->events(mDate); | 163 | Q3PtrList<Event> eventlist = mCalendar->events(mDate); |
155 | Event *event; | 164 | Event *event; |
156 | QStringList mToolTip; | 165 | QStringList mToolTip; |
157 | for(event=eventlist.first();event != 0;event=eventlist.next()) { | 166 | for(event=eventlist.first();event != 0;event=eventlist.next()) { |
158 | QString mToolTipText; | 167 | QString mToolTipText; |
159 | QString text; | 168 | QString text; |
160 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day | 169 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day |
@@ -202,13 +211,13 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) | |||
202 | mToolTipText += " (" + event->location() + ")"; | 211 | mToolTipText += " (" + event->location() + ")"; |
203 | //qDebug("TTT: %s ", mToolTipText.latin1()); | 212 | //qDebug("TTT: %s ", mToolTipText.latin1()); |
204 | mToolTip.append( deTag( mToolTipText ) ); | 213 | mToolTip.append( deTag( mToolTipText ) ); |
205 | } | 214 | } |
206 | mToolTip.sort(); | 215 | mToolTip.sort(); |
207 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | 216 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { |
208 | QPtrList<Todo> todolist = mCalendar->todos(mDate); | 217 | Q3PtrList<Todo> todolist = mCalendar->todos(mDate); |
209 | Todo *todo; | 218 | Todo *todo; |
210 | for(todo=todolist.first();todo != 0;todo=todolist.next()) { | 219 | for(todo=todolist.first();todo != 0;todo=todolist.next()) { |
211 | QString mToolTipText; | 220 | QString mToolTipText; |
212 | if ( !todo->doesFloat() ) | 221 | if ( !todo->doesFloat() ) |
213 | mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" "; | 222 | mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" "; |
214 | mToolTipText += todo->summary(); | 223 | mToolTipText += todo->summary(); |
@@ -217,13 +226,13 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) | |||
217 | mToolTipText = deTag( mToolTipText); | 226 | mToolTipText = deTag( mToolTipText); |
218 | mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText; | 227 | mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText; |
219 | mToolTip.append( mToolTipText ); | 228 | mToolTip.append( mToolTipText ); |
220 | } | 229 | } |
221 | } | 230 | } |
222 | if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | 231 | if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { |
223 | QPtrList<Journal> j_list = mCalendar->journals4Date( mDate ); | 232 | Q3PtrList<Journal> j_list = mCalendar->journals4Date( mDate ); |
224 | Journal *j = j_list.first(); | 233 | Journal *j = j_list.first(); |
225 | while ( j ) { | 234 | while ( j ) { |
226 | QString mToolTipText; | 235 | QString mToolTipText; |
227 | if ( !j->summary().isEmpty() ) { | 236 | if ( !j->summary().isEmpty() ) { |
228 | mToolTipText = j->summary().left(30); | 237 | mToolTipText = j->summary().left(30); |
229 | if ( j->summary().length() > 30 ) | 238 | if ( j->summary().length() > 30 ) |
@@ -438,13 +447,13 @@ void KODayMatrix::updateViewTimed() | |||
438 | } | 447 | } |
439 | #if 1 | 448 | #if 1 |
440 | 449 | ||
441 | 450 | ||
442 | int i; | 451 | int i; |
443 | int timeSpan = NUMDAYS-1; | 452 | int timeSpan = NUMDAYS-1; |
444 | QPtrList<Event> events = mCalendar->events(); | 453 | Q3PtrList<Event> events = mCalendar->events(); |
445 | Event *event; | 454 | Event *event; |
446 | QDateTime dt; | 455 | QDateTime dt; |
447 | bool ok; | 456 | bool ok; |
448 | bDays.fill( false); | 457 | bDays.fill( false); |
449 | pDays.fill( false); | 458 | pDays.fill( false); |
450 | hDays.fill( false); | 459 | hDays.fill( false); |
@@ -523,13 +532,13 @@ void KODayMatrix::updateViewTimed() | |||
523 | pDays.setBit(i); | 532 | pDays.setBit(i); |
524 | } | 533 | } |
525 | } | 534 | } |
526 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | 535 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { |
527 | bDays.fill( false); | 536 | bDays.fill( false); |
528 | // insert due todos | 537 | // insert due todos |
529 | QPtrList<Todo> todos = mCalendar->todos( ); | 538 | Q3PtrList<Todo> todos = mCalendar->todos( ); |
530 | Todo *todo; | 539 | Todo *todo; |
531 | for(todo = todos.first(); todo; todo = todos.next()) { | 540 | for(todo = todos.first(); todo; todo = todos.next()) { |
532 | //insertTodo( todo ); | 541 | //insertTodo( todo ); |
533 | if ( todo->hasDueDate() ) { | 542 | if ( todo->hasDueDate() ) { |
534 | int day = mStartDate.daysTo( todo->dtDue().date() ); | 543 | int day = mStartDate.daysTo( todo->dtDue().date() ); |
535 | if ( day >= 0 && day < timeSpan + 1) { | 544 | if ( day >= 0 && day < timeSpan + 1) { |
@@ -548,13 +557,13 @@ void KODayMatrix::updateViewTimed() | |||
548 | } | 557 | } |
549 | } | 558 | } |
550 | } | 559 | } |
551 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | 560 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { |
552 | bDays.fill( false); | 561 | bDays.fill( false); |
553 | // insert due todos | 562 | // insert due todos |
554 | QPtrList<Journal> todos = mCalendar->journals( ); | 563 | Q3PtrList<Journal> todos = mCalendar->journals( ); |
555 | Journal *todo; | 564 | Journal *todo; |
556 | for(todo = todos.first(); todo; todo = todos.next()) { | 565 | for(todo = todos.first(); todo; todo = todos.next()) { |
557 | int day = mStartDate.daysTo( todo->dtStart().date() ); | 566 | int day = mStartDate.daysTo( todo->dtStart().date() ); |
558 | if ( day >= 0 && day < timeSpan + 1) { | 567 | if ( day >= 0 && day < timeSpan + 1) { |
559 | int i = day; | 568 | int i = day; |
560 | QString holiStr = mHolidays[i]; | 569 | QString holiStr = mHolidays[i]; |
@@ -572,13 +581,13 @@ void KODayMatrix::updateViewTimed() | |||
572 | } | 581 | } |
573 | } | 582 | } |
574 | #else | 583 | #else |
575 | //qDebug("KODayMatrix::updateViewTimed "); | 584 | //qDebug("KODayMatrix::updateViewTimed "); |
576 | for(int i = 0; i < NUMDAYS; i++) { | 585 | for(int i = 0; i < NUMDAYS; i++) { |
577 | // if events are set for the day then remember to draw it bold | 586 | // if events are set for the day then remember to draw it bold |
578 | QPtrList<Event> eventlist = mCalendar->events(days[i]); | 587 | Q3PtrList<Event> eventlist = mCalendar->events(days[i]); |
579 | Event *event; | 588 | Event *event; |
580 | int numEvents = eventlist.count(); | 589 | int numEvents = eventlist.count(); |
581 | QString holiStr = ""; | 590 | QString holiStr = ""; |
582 | bDays.clearBit(i); | 591 | bDays.clearBit(i); |
583 | hDays.clearBit(i); | 592 | hDays.clearBit(i); |
584 | eDays.clearBit(i); | 593 | eDays.clearBit(i); |
@@ -672,13 +681,13 @@ void KODayMatrix::updateView(QDate actdate) | |||
672 | void KODayMatrix::updateEvents() | 681 | void KODayMatrix::updateEvents() |
673 | { | 682 | { |
674 | if ( !mCalendar ) return; | 683 | if ( !mCalendar ) return; |
675 | 684 | ||
676 | for( int i = 0; i < NUMDAYS; i++ ) { | 685 | for( int i = 0; i < NUMDAYS; i++ ) { |
677 | // if events are set for the day then remember to draw it bold | 686 | // if events are set for the day then remember to draw it bold |
678 | QPtrList<Event> eventlist = mCalendar->events( days[ i ] ); | 687 | Q3PtrList<Event> eventlist = mCalendar->events( days[ i ] ); |
679 | int numEvents = eventlist.count(); | 688 | int numEvents = eventlist.count(); |
680 | Event *event; | 689 | Event *event; |
681 | for( event = eventlist.first(); event != 0;event=eventlist.next()) { | 690 | for( event = eventlist.first(); event != 0;event=eventlist.next()) { |
682 | ushort recurType = event->doesRecur(); | 691 | ushort recurType = event->doesRecur(); |
683 | 692 | ||
684 | if ( ( recurType == Recurrence::rDaily && | 693 | if ( ( recurType == Recurrence::rDaily && |
@@ -736,26 +745,26 @@ int KODayMatrix::getDayIndexFrom(int x, int y) | |||
736 | // M O U S E E V E N T H A N D L I N G | 745 | // M O U S E E V E N T H A N D L I N G |
737 | // ---------------------------------------------------------------------------- | 746 | // ---------------------------------------------------------------------------- |
738 | 747 | ||
739 | void KODayMatrix::mousePressEvent (QMouseEvent* e) | 748 | void KODayMatrix::mousePressEvent (QMouseEvent* e) |
740 | { | 749 | { |
741 | 750 | ||
742 | if ( e->button() == LeftButton ) | 751 | if ( e->button() == Qt::LeftButton ) |
743 | mouseDown = true; | 752 | mouseDown = true; |
744 | mSelStart = getDayIndexFrom(e->x(), e->y()); | 753 | mSelStart = getDayIndexFrom(e->x(), e->y()); |
745 | if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1; | 754 | if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1; |
746 | mSelInit = mSelStart; | 755 | mSelInit = mSelStart; |
747 | mSelEnd = mSelStart; | 756 | mSelEnd = mSelStart; |
748 | mRedrawNeeded = true; | 757 | mRedrawNeeded = true; |
749 | repaint(false); | 758 | repaint(false); |
750 | } | 759 | } |
751 | 760 | ||
752 | void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) | 761 | void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) |
753 | { | 762 | { |
754 | mRedrawNeeded = true; | 763 | mRedrawNeeded = true; |
755 | if ( e->button() == LeftButton ) | 764 | if ( e->button() == Qt::LeftButton ) |
756 | if ( ! mouseDown ) { | 765 | if ( ! mouseDown ) { |
757 | return; | 766 | return; |
758 | } | 767 | } |
759 | else | 768 | else |
760 | mouseDown = false; | 769 | mouseDown = false; |
761 | int tmp = getDayIndexFrom(e->x(), e->y()); | 770 | int tmp = getDayIndexFrom(e->x(), e->y()); |
@@ -1192,26 +1201,26 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
1192 | p.setPen(mDefaultTextColor); | 1201 | p.setPen(mDefaultTextColor); |
1193 | p.drawRect(0, 0, width(), height()); | 1202 | p.drawRect(0, 0, width(), height()); |
1194 | } else { | 1203 | } else { |
1195 | //qDebug("NO redraw "); | 1204 | //qDebug("NO redraw "); |
1196 | } | 1205 | } |
1197 | 1206 | ||
1198 | bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP); | 1207 | bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,QPainter::CompositionMode_Source); |
1199 | mRedrawNeeded = false; | 1208 | mRedrawNeeded = false; |
1200 | } | 1209 | } |
1201 | 1210 | ||
1202 | // ---------------------------------------------------------------------------- | 1211 | // ---------------------------------------------------------------------------- |
1203 | // R E SI Z E E V E N T H A N D L I N G | 1212 | // R E SI Z E E V E N T H A N D L I N G |
1204 | // ---------------------------------------------------------------------------- | 1213 | // ---------------------------------------------------------------------------- |
1205 | 1214 | ||
1206 | void KODayMatrix::resizeEvent(QResizeEvent * e) | 1215 | void KODayMatrix::resizeEvent(QResizeEvent * e) |
1207 | { | 1216 | { |
1208 | QRect sz = frameRect(); | 1217 | QRect sz = frameRect(); |
1209 | daysize.setHeight(sz.height()*7 / NUMDAYS); | 1218 | daysize.setHeight(sz.height()*7 / NUMDAYS); |
1210 | daysize.setWidth(sz.width() / 7); | 1219 | daysize.setWidth(sz.width() / 7); |
1211 | QFrame::resizeEvent( e ); | 1220 | Q3Frame::resizeEvent( e ); |
1212 | } | 1221 | } |
1213 | 1222 | ||
1214 | QSize KODayMatrix::sizeHint() const | 1223 | QSize KODayMatrix::sizeHint() const |
1215 | { | 1224 | { |
1216 | 1225 | ||
1217 | QFontMetrics fm ( font() ); | 1226 | QFontMetrics fm ( font() ); |
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index b96e08f..6edf7cd 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h | |||
@@ -23,20 +23,28 @@ | |||
23 | #ifndef _KODAYMAT_H | 23 | #ifndef _KODAYMAT_H |
24 | #define _KODAYMAT_H | 24 | #define _KODAYMAT_H |
25 | 25 | ||
26 | #include <libkcal/calendar.h> | 26 | #include <libkcal/calendar.h> |
27 | 27 | ||
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | #include <qframe.h> | 29 | #include <q3frame.h> |
30 | #include <qcolor.h> | 30 | #include <qcolor.h> |
31 | #include <qpen.h> | 31 | #include <qpen.h> |
32 | #include <qdatetime.h> | 32 | #include <qdatetime.h> |
33 | #include <qtooltip.h> | 33 | #include <qtooltip.h> |
34 | #include <qpixmap.h> | 34 | #include <qpixmap.h> |
35 | #include <qbitarray.h> | 35 | #include <qbitarray.h> |
36 | #include <qmap.h> | 36 | #include <qmap.h> |
37 | //Added by qt3to4: | ||
38 | #include <QDragMoveEvent> | ||
39 | #include <QDropEvent> | ||
40 | #include <QDragLeaveEvent> | ||
41 | #include <QPaintEvent> | ||
42 | #include <QResizeEvent> | ||
43 | #include <QMouseEvent> | ||
44 | #include <QDragEnterEvent> | ||
37 | 45 | ||
38 | class QDragEnterEvent; | 46 | class QDragEnterEvent; |
39 | class QDragMoveEvent; | 47 | class QDragMoveEvent; |
40 | class QDragLeaveEvent; | 48 | class QDragLeaveEvent; |
41 | class QDropEvent; | 49 | class QDropEvent; |
42 | 50 | ||
@@ -48,13 +56,13 @@ using namespace KCal; | |||
48 | 56 | ||
49 | /** | 57 | /** |
50 | * small helper class to dynamically show tooltips inside the day matrix. | 58 | * small helper class to dynamically show tooltips inside the day matrix. |
51 | * This class asks the day matrix object for a appropriate label which | 59 | * This class asks the day matrix object for a appropriate label which |
52 | * is in our special case the name of the holiday or null if this day is no holiday. | 60 | * is in our special case the name of the holiday or null if this day is no holiday. |
53 | */ | 61 | */ |
54 | class DynamicTip : public QToolTip | 62 | class DynamicTip /* TODO:hacker: : public QToolTip */ |
55 | { | 63 | { |
56 | public: | 64 | public: |
57 | 65 | ||
58 | /** | 66 | /** |
59 | * Constructor that expects a KODayMatrix object as parent. | 67 | * Constructor that expects a KODayMatrix object as parent. |
60 | * | 68 | * |
@@ -100,13 +108,13 @@ private: | |||
100 | * adjust the selection and leave some days undisplayed while scrolling through the months | 108 | * adjust the selection and leave some days undisplayed while scrolling through the months |
101 | * | 109 | * |
102 | * @short day matrix widget of the KDateNavigator | 110 | * @short day matrix widget of the KDateNavigator |
103 | * | 111 | * |
104 | * @author Eitzenberger Thomas | 112 | * @author Eitzenberger Thomas |
105 | */ | 113 | */ |
106 | class KODayMatrix: public QFrame { | 114 | class KODayMatrix: public Q3Frame { |
107 | 115 | ||
108 | Q_OBJECT | 116 | Q_OBJECT |
109 | 117 | ||
110 | public: | 118 | public: |
111 | 119 | ||
112 | /** constructor to create a day matrix widget. | 120 | /** constructor to create a day matrix widget. |
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index ea30fac..deb1e46 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -38,12 +38,14 @@ | |||
38 | #include "archivedialog.h" | 38 | #include "archivedialog.h" |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | #include "kconfig.h" | 41 | #include "kconfig.h" |
42 | #include "kodialogmanager.h" | 42 | #include "kodialogmanager.h" |
43 | #include <kapplication.h> | 43 | #include <kapplication.h> |
44 | //Added by qt3to4: | ||
45 | #include <Q3PtrList> | ||
44 | 46 | ||
45 | KODialogManager::KODialogManager( CalendarView *mainView ) : | 47 | KODialogManager::KODialogManager( CalendarView *mainView ) : |
46 | QObject(), mMainView( mainView ) | 48 | QObject(), mMainView( mainView ) |
47 | { | 49 | { |
48 | mOutgoingDialog = 0; | 50 | mOutgoingDialog = 0; |
49 | mIncomingDialog = 0; | 51 | mIncomingDialog = 0; |
@@ -185,14 +187,14 @@ void KODialogManager::showSearchDialog() | |||
185 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), | 187 | connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), |
186 | mMainView, SLOT(cloneIncidence(Incidence *))); | 188 | mMainView, SLOT(cloneIncidence(Incidence *))); |
187 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), | 189 | connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), |
188 | mMainView, SLOT(beamIncidence(Incidence *))); | 190 | mMainView, SLOT(beamIncidence(Incidence *))); |
189 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), | 191 | connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), |
190 | mMainView, SLOT(moveIncidence(Incidence *))); | 192 | mMainView, SLOT(moveIncidence(Incidence *))); |
191 | connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), | 193 | connect(lview, SIGNAL(beamIncidenceList(Q3PtrList<Incidence> )), |
192 | mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); | 194 | mMainView, SLOT(beamIncidenceList(Q3PtrList<Incidence> ))); |
193 | 195 | ||
194 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); | 196 | connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); |
195 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); | 197 | connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); |
196 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), | 198 | // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), |
197 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 199 | // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
198 | #ifndef DESKTOP_VERSION | 200 | #ifndef DESKTOP_VERSION |
@@ -243,13 +245,13 @@ void KODialogManager::showArchiveDialog() | |||
243 | 245 | ||
244 | // Workaround. | 246 | // Workaround. |
245 | QApplication::restoreOverrideCursor(); | 247 | QApplication::restoreOverrideCursor(); |
246 | #endif | 248 | #endif |
247 | } | 249 | } |
248 | 250 | ||
249 | void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) | 251 | void KODialogManager::showFilterEditDialog(Q3PtrList<CalFilter> *filters) |
250 | { | 252 | { |
251 | if (!mFilterEditDialog) { | 253 | if (!mFilterEditDialog) { |
252 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); | 254 | mFilterEditDialog = new FilterEditDialog(filters,mMainView); |
253 | connect(mFilterEditDialog,SIGNAL(filterChanged()), | 255 | connect(mFilterEditDialog,SIGNAL(filterChanged()), |
254 | mMainView,SLOT(filterEdited())); | 256 | mMainView,SLOT(filterEdited())); |
255 | 257 | ||
diff --git a/korganizer/kodialogmanager.h b/korganizer/kodialogmanager.h index b68ddc2..00ad1df 100644 --- a/korganizer/kodialogmanager.h +++ b/korganizer/kodialogmanager.h | |||
@@ -22,13 +22,13 @@ | |||
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef KODIALOGMANAGER_H | 24 | #ifndef KODIALOGMANAGER_H |
25 | #define KODIALOGMANAGER_H | 25 | #define KODIALOGMANAGER_H |
26 | 26 | ||
27 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | #include <qptrlist.h> | 28 | #include <q3ptrlist.h> |
29 | 29 | ||
30 | #include <libkcal/calfilter.h> | 30 | #include <libkcal/calfilter.h> |
31 | 31 | ||
32 | class CalendarView; | 32 | class CalendarView; |
33 | class OutgoingDialog; | 33 | class OutgoingDialog; |
34 | class IncomingDialog; | 34 | class IncomingDialog; |
@@ -75,13 +75,13 @@ class KODialogManager : public QObject | |||
75 | void showSyncOptions(); | 75 | void showSyncOptions(); |
76 | void showIncomingDialog(); | 76 | void showIncomingDialog(); |
77 | void showOutgoingDialog(); | 77 | void showOutgoingDialog(); |
78 | // void showCategoryEditDialog(); | 78 | // void showCategoryEditDialog(); |
79 | void showSearchDialog(); | 79 | void showSearchDialog(); |
80 | void showArchiveDialog(); | 80 | void showArchiveDialog(); |
81 | void showFilterEditDialog(QPtrList<CalFilter> *filters); | 81 | void showFilterEditDialog(Q3PtrList<CalFilter> *filters); |
82 | void showPluginDialog(); | 82 | void showPluginDialog(); |
83 | void hideSearchDialog(); | 83 | void hideSearchDialog(); |
84 | 84 | ||
85 | private: | 85 | private: |
86 | void createOutgoingDialog(); | 86 | void createOutgoingDialog(); |
87 | void createIncomingDialog(); | 87 | void createIncomingDialog(); |
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp index 9a4b4ec..a01c838 100644 --- a/korganizer/koeditordetails.cpp +++ b/korganizer/koeditordetails.cpp | |||
@@ -19,20 +19,26 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qfiledialog.h> | 25 | #include <q3filedialog.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qvbox.h> | 27 | #include <q3vbox.h> |
28 | #include <qbuttongroup.h> | 28 | #include <q3buttongroup.h> |
29 | #include <qvgroupbox.h> | 29 | #include <q3vgroupbox.h> |
30 | #include <qwidgetstack.h> | 30 | #include <q3widgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qapp.h> | 32 | #include <qapplication.h> |
33 | #include <QDesktopWidget> | ||
34 | //Added by qt3to4: | ||
35 | #include <Q3GridLayout> | ||
36 | #include <QLabel> | ||
37 | #include <Q3PtrList> | ||
38 | #include <Q3VBoxLayout> | ||
33 | 39 | ||
34 | #include <klocale.h> | 40 | #include <klocale.h> |
35 | #include <kglobal.h> | 41 | #include <kglobal.h> |
36 | #include <kdialog.h> | 42 | #include <kdialog.h> |
37 | #include <kiconloader.h> | 43 | #include <kiconloader.h> |
38 | #include <kstandarddirs.h> | 44 | #include <kstandarddirs.h> |
@@ -77,13 +83,13 @@ void CustomListViewItem<Attendee *>::updateItem() | |||
77 | } | 83 | } |
78 | 84 | ||
79 | 85 | ||
80 | KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | 86 | KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) |
81 | : QWidget( parent, name), mDisableItemUpdate( false ) | 87 | : QWidget( parent, name), mDisableItemUpdate( false ) |
82 | { | 88 | { |
83 | QGridLayout *topLayout = new QGridLayout(this); | 89 | Q3GridLayout *topLayout = new Q3GridLayout(this); |
84 | topLayout->setSpacing(spacing); | 90 | topLayout->setSpacing(spacing); |
85 | topLayout->setMargin(KDialog::marginHint()-2); | 91 | topLayout->setMargin(KDialog::marginHint()-2); |
86 | 92 | ||
87 | QString organizer = KOPrefs::instance()->email(); | 93 | QString organizer = KOPrefs::instance()->email(); |
88 | mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); | 94 | mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); |
89 | 95 | ||
@@ -98,17 +104,17 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | |||
98 | if ( QApplication::desktop()->height() <= 240 ) | 104 | if ( QApplication::desktop()->height() <= 240 ) |
99 | hei = 60; | 105 | hei = 60; |
100 | mListView->setFixedHeight(hei); | 106 | mListView->setFixedHeight(hei); |
101 | } | 107 | } |
102 | mListView->setAllColumnsShowFocus (true ); | 108 | mListView->setAllColumnsShowFocus (true ); |
103 | //mListView->setSingleClick( true ); | 109 | //mListView->setSingleClick( true ); |
104 | connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), | 110 | connect(mListView,SIGNAL(selectionChanged(Q3ListViewItem *)), |
105 | SLOT(updateAttendeeInput())); | 111 | SLOT(updateAttendeeInput())); |
106 | 112 | ||
107 | connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), | 113 | connect(mListView,SIGNAL(executed(Q3ListViewItem * ,const QPoint&, int )), |
108 | SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); | 114 | SLOT(itemClicked(Q3ListViewItem * ,const QPoint& , int ))); |
109 | 115 | ||
110 | mRsvpButton = new QCheckBox(this); | 116 | mRsvpButton = new QCheckBox(this); |
111 | mRsvpButton->setText(i18n("Request response")); | 117 | mRsvpButton->setText(i18n("Request response")); |
112 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); | 118 | mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); |
113 | QLabel *attendeeLabel = new QLabel(this); | 119 | QLabel *attendeeLabel = new QLabel(this); |
114 | attendeeLabel->setText(i18n("Name:")); | 120 | attendeeLabel->setText(i18n("Name:")); |
@@ -137,13 +143,13 @@ KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) | |||
137 | mStatusCombo->insertStringList(Attendee::statusList()); | 143 | mStatusCombo->insertStringList(Attendee::statusList()); |
138 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); | 144 | connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); |
139 | 145 | ||
140 | 146 | ||
141 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); | 147 | connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); |
142 | QWidget *buttonBox = new QWidget(this); | 148 | QWidget *buttonBox = new QWidget(this); |
143 | QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); | 149 | Q3VBoxLayout *buttonLayout = new Q3VBoxLayout(buttonBox); |
144 | 150 | ||
145 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); | 151 | QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); |
146 | buttonLayout->addWidget(newButton); | 152 | buttonLayout->addWidget(newButton); |
147 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); | 153 | connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); |
148 | 154 | ||
149 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); | 155 | mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); |
@@ -362,25 +368,25 @@ void KOEditorDetails::setDefaults() | |||
362 | 368 | ||
363 | void KOEditorDetails::readEvent(Incidence *event) | 369 | void KOEditorDetails::readEvent(Incidence *event) |
364 | { | 370 | { |
365 | setDefaults(); | 371 | setDefaults(); |
366 | //mListView->clear(); | 372 | //mListView->clear(); |
367 | //mdelAttendees.clear(); | 373 | //mdelAttendees.clear(); |
368 | QPtrList<Attendee> tmpAList = event->attendees(); | 374 | Q3PtrList<Attendee> tmpAList = event->attendees(); |
369 | Attendee *a; | 375 | Attendee *a; |
370 | for (a = tmpAList.first(); a; a = tmpAList.next()) | 376 | for (a = tmpAList.first(); a; a = tmpAList.next()) |
371 | insertAttendee(new Attendee(*a)); | 377 | insertAttendee(new Attendee(*a)); |
372 | 378 | ||
373 | mListView->setSelected( mListView->firstChild(), true ); | 379 | mListView->setSelected( mListView->firstChild(), true ); |
374 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); | 380 | mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); |
375 | } | 381 | } |
376 | 382 | ||
377 | void KOEditorDetails::writeEvent(Incidence *event) | 383 | void KOEditorDetails::writeEvent(Incidence *event) |
378 | { | 384 | { |
379 | event->clearAttendees(); | 385 | event->clearAttendees(); |
380 | QListViewItem *item; | 386 | Q3ListViewItem *item; |
381 | AttendeeListItem *a; | 387 | AttendeeListItem *a; |
382 | for (item = mListView->firstChild(); item; | 388 | for (item = mListView->firstChild(); item; |
383 | item = item->nextSibling()) { | 389 | item = item->nextSibling()) { |
384 | a = (AttendeeListItem *)item; | 390 | a = (AttendeeListItem *)item; |
385 | event->addAttendee(new Attendee(*(a->data()))); | 391 | event->addAttendee(new Attendee(*(a->data()))); |
386 | } | 392 | } |
@@ -401,13 +407,13 @@ bool KOEditorDetails::validateInput() | |||
401 | { | 407 | { |
402 | return true; | 408 | return true; |
403 | } | 409 | } |
404 | 410 | ||
405 | void KOEditorDetails::updateAttendeeInput() | 411 | void KOEditorDetails::updateAttendeeInput() |
406 | { | 412 | { |
407 | QListViewItem *item = mListView->selectedItem(); | 413 | Q3ListViewItem *item = mListView->selectedItem(); |
408 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); | 414 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); |
409 | if (aItem) { | 415 | if (aItem) { |
410 | fillAttendeeInput( aItem ); | 416 | fillAttendeeInput( aItem ); |
411 | } else { | 417 | } else { |
412 | clearAttendeeInput(); | 418 | clearAttendeeInput(); |
413 | } | 419 | } |
@@ -448,24 +454,24 @@ void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) | |||
448 | mStatusCombo->setEnabled( enabled ); | 454 | mStatusCombo->setEnabled( enabled ); |
449 | mRsvpButton->setEnabled( enabled ); | 455 | mRsvpButton->setEnabled( enabled ); |
450 | 456 | ||
451 | mRemoveButton->setEnabled( enabled ); | 457 | mRemoveButton->setEnabled( enabled ); |
452 | } | 458 | } |
453 | 459 | ||
454 | void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c ) | 460 | void KOEditorDetails::itemClicked(Q3ListViewItem * item ,const QPoint & pnt, int c ) |
455 | { | 461 | { |
456 | if ( item && c == 4 ) { | 462 | if ( item && c == 4 ) { |
457 | mRsvpButton->setChecked( !mRsvpButton->isChecked() ); | 463 | mRsvpButton->setChecked( !mRsvpButton->isChecked() ); |
458 | updateAttendeeItem(); | 464 | updateAttendeeItem(); |
459 | } | 465 | } |
460 | } | 466 | } |
461 | void KOEditorDetails::updateAttendeeItem() | 467 | void KOEditorDetails::updateAttendeeItem() |
462 | { | 468 | { |
463 | if (mDisableItemUpdate) return; | 469 | if (mDisableItemUpdate) return; |
464 | 470 | ||
465 | QListViewItem *item = mListView->selectedItem(); | 471 | Q3ListViewItem *item = mListView->selectedItem(); |
466 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); | 472 | AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); |
467 | if ( !aItem ) return; | 473 | if ( !aItem ) return; |
468 | 474 | ||
469 | Attendee *a = aItem->data(); | 475 | Attendee *a = aItem->data(); |
470 | 476 | ||
471 | a->setName( mNameEdit->text() ); | 477 | a->setName( mNameEdit->text() ); |
diff --git a/korganizer/koeditordetails.h b/korganizer/koeditordetails.h index 5f8f6f2..40e896c 100644 --- a/korganizer/koeditordetails.h +++ b/korganizer/koeditordetails.h | |||
@@ -21,23 +21,23 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _KOEDITORDETAILS_H | 23 | #ifndef _KOEDITORDETAILS_H |
24 | #define _KOEDITORDETAILS_H | 24 | #define _KOEDITORDETAILS_H |
25 | 25 | ||
26 | #include <qmap.h> | 26 | #include <qmap.h> |
27 | #include <qframe.h> | 27 | #include <q3frame.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qcheckbox.h> | 29 | #include <qcheckbox.h> |
30 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
31 | #include <qgroupbox.h> | 31 | #include <q3groupbox.h> |
32 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qmultilineedit.h> | 34 | #include <q3multilineedit.h> |
35 | #include <klistview.h> | 35 | #include <klistview.h> |
36 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
37 | #include <qptrlist.h> | 37 | #include <q3ptrlist.h> |
38 | 38 | ||
39 | #include <kapplication.h> | 39 | #include <kapplication.h> |
40 | 40 | ||
41 | #include <libkcal/event.h> | 41 | #include <libkcal/event.h> |
42 | 42 | ||
43 | #include "ktimeedit.h" | 43 | #include "ktimeedit.h" |
@@ -80,13 +80,13 @@ class KOEditorDetails : public QWidget | |||
80 | void addNewAttendee(); | 80 | void addNewAttendee(); |
81 | void removeAttendee(); | 81 | void removeAttendee(); |
82 | void openAddressBook(); | 82 | void openAddressBook(); |
83 | void updateAttendeeInput(); | 83 | void updateAttendeeInput(); |
84 | void clearAttendeeInput(); | 84 | void clearAttendeeInput(); |
85 | void fillAttendeeInput(AttendeeListItem *); | 85 | void fillAttendeeInput(AttendeeListItem *); |
86 | void itemClicked(QListViewItem *,const QPoint & pnt, int c); | 86 | void itemClicked(Q3ListViewItem *,const QPoint & pnt, int c); |
87 | void updateAttendeeItem(); | 87 | void updateAttendeeItem(); |
88 | void setEnabledAttendeeInput(bool); | 88 | void setEnabledAttendeeInput(bool); |
89 | 89 | ||
90 | private: | 90 | private: |
91 | bool mDisableItemUpdate; | 91 | bool mDisableItemUpdate; |
92 | 92 | ||
@@ -100,10 +100,10 @@ class KOEditorDetails : public QWidget | |||
100 | QLabel *mOrganizerLabel; | 100 | QLabel *mOrganizerLabel; |
101 | 101 | ||
102 | QPushButton* mAddButton; | 102 | QPushButton* mAddButton; |
103 | QPushButton* mRemoveButton; | 103 | QPushButton* mRemoveButton; |
104 | QPushButton* mAddressBookButton; | 104 | QPushButton* mAddressBookButton; |
105 | 105 | ||
106 | QPtrList<Attendee> mdelAttendees; | 106 | Q3PtrList<Attendee> mdelAttendees; |
107 | }; | 107 | }; |
108 | 108 | ||
109 | #endif | 109 | #endif |
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 21f220c..8105432 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -21,21 +21,28 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qwidget.h> | 24 | #include <qwidget.h> |
25 | #include <qtooltip.h> | 25 | #include <qtooltip.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qvbox.h> | 27 | #include <q3vbox.h> |
28 | #include <qbuttongroup.h> | 28 | #include <q3buttongroup.h> |
29 | #include <qvgroupbox.h> | 29 | #include <q3vgroupbox.h> |
30 | #include <qwidgetstack.h> | 30 | #include <q3widgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qfile.h> | 33 | #include <qfile.h> |
34 | #include <qregexp.h> | 34 | #include <qregexp.h> |
35 | //Added by qt3to4: | ||
36 | #include <Q3HBoxLayout> | ||
37 | #include <QLabel> | ||
38 | #include <Q3GridLayout> | ||
39 | #include <Q3PtrList> | ||
40 | #include <Q3PopupMenu> | ||
35 | 41 | ||
42 | #include <QDesktopWidget> | ||
36 | 43 | ||
37 | #include <kglobal.h> | 44 | #include <kglobal.h> |
38 | #include <kdialog.h> | 45 | #include <kdialog.h> |
39 | #include <kdebug.h> | 46 | #include <kdebug.h> |
40 | #include <klocale.h> | 47 | #include <klocale.h> |
41 | #include <kiconloader.h> | 48 | #include <kiconloader.h> |
@@ -66,15 +73,15 @@ KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : | |||
66 | } | 73 | } |
67 | 74 | ||
68 | KOEditorGeneral::~KOEditorGeneral() | 75 | KOEditorGeneral::~KOEditorGeneral() |
69 | { | 76 | { |
70 | } | 77 | } |
71 | 78 | ||
72 | void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) | 79 | void KOEditorGeneral::initHeader(QWidget *parent,Q3BoxLayout *topLayout) |
73 | { | 80 | { |
74 | QGridLayout *headerLayout = new QGridLayout(topLayout); | 81 | Q3GridLayout *headerLayout = new Q3GridLayout(topLayout); |
75 | 82 | ||
76 | #if 0 | 83 | #if 0 |
77 | mOwnerLabel = new QLabel(i18n("Owner:"),parent); | 84 | mOwnerLabel = new QLabel(i18n("Owner:"),parent); |
78 | headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); | 85 | headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); |
79 | #endif | 86 | #endif |
80 | // 1 on pda | 87 | // 1 on pda |
@@ -192,16 +199,16 @@ void KOEditorGeneral::selectedCatPopup( int index ) | |||
192 | categories.prepend( colcat ); | 199 | categories.prepend( colcat ); |
193 | } | 200 | } |
194 | } | 201 | } |
195 | setCategories( categories.join(",") ); | 202 | setCategories( categories.join(",") ); |
196 | } | 203 | } |
197 | 204 | ||
198 | void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) | 205 | void KOEditorGeneral::initCategories(QWidget *parent, Q3BoxLayout *topLayout) |
199 | { | 206 | { |
200 | QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); | 207 | Q3BoxLayout *categoriesLayout = new Q3HBoxLayout( topLayout ); |
201 | mCatPopup = new QPopupMenu ( parent ); | 208 | mCatPopup = new Q3PopupMenu ( parent ); |
202 | mCatPopup->setCheckable (true); | 209 | mCatPopup->setCheckable (true); |
203 | connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); | 210 | connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); |
204 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); | 211 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); |
205 | mCategoriesButton = new QPushButton(parent); | 212 | mCategoriesButton = new QPushButton(parent); |
206 | mCategoriesButton->setText(i18n("Categories...")); | 213 | mCategoriesButton->setText(i18n("Categories...")); |
207 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); | 214 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); |
@@ -211,27 +218,27 @@ void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) | |||
211 | mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); | 218 | mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); |
212 | mCategoriesLabel->setPopup( mCatPopup ); | 219 | mCategoriesLabel->setPopup( mCatPopup ); |
213 | //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); | 220 | //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); |
214 | categoriesLayout->addWidget(mCategoriesLabel,1); | 221 | categoriesLayout->addWidget(mCategoriesLabel,1); |
215 | } | 222 | } |
216 | 223 | ||
217 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) | 224 | void KOEditorGeneral::initSecrecy(QWidget *parent, Q3BoxLayout *topLayout) |
218 | { | 225 | { |
219 | QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); | 226 | Q3BoxLayout *secrecyLayout = new Q3HBoxLayout( topLayout ); |
220 | 227 | ||
221 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); | 228 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); |
222 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); | 229 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); |
223 | secrecyLayout->addWidget(mCancelBox); | 230 | secrecyLayout->addWidget(mCancelBox); |
224 | secrecyLayout->addWidget(secrecyLabel); | 231 | secrecyLayout->addWidget(secrecyLabel); |
225 | 232 | ||
226 | mSecrecyCombo = new QComboBox(parent); | 233 | mSecrecyCombo = new QComboBox(parent); |
227 | mSecrecyCombo->insertStringList(Incidence::secrecyList()); | 234 | mSecrecyCombo->insertStringList(Incidence::secrecyList()); |
228 | secrecyLayout->addWidget(mSecrecyCombo); | 235 | secrecyLayout->addWidget(mSecrecyCombo); |
229 | } | 236 | } |
230 | 237 | ||
231 | void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) | 238 | void KOEditorGeneral::initDescription(QWidget *parent,Q3BoxLayout *topLayout) |
232 | { | 239 | { |
233 | mDescriptionEdit = new KTextEdit(parent); | 240 | mDescriptionEdit = new KTextEdit(parent); |
234 | mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); | 241 | mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); |
235 | mDescriptionEdit->append(""); | 242 | mDescriptionEdit->append(""); |
236 | mDescriptionEdit->setReadOnly(false); | 243 | mDescriptionEdit->setReadOnly(false); |
237 | mDescriptionEdit->setOverwriteMode(false); | 244 | mDescriptionEdit->setOverwriteMode(false); |
@@ -240,15 +247,15 @@ void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) | |||
240 | #ifndef DESKTOP_VERSION | 247 | #ifndef DESKTOP_VERSION |
241 | QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); | 248 | QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); |
242 | #endif | 249 | #endif |
243 | 250 | ||
244 | } | 251 | } |
245 | 252 | ||
246 | void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) | 253 | void KOEditorGeneral::initAlarm(QWidget *parent,Q3BoxLayout *topLayout) |
247 | { | 254 | { |
248 | QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); | 255 | Q3BoxLayout *alarmLayout = new Q3HBoxLayout(topLayout); |
249 | 256 | ||
250 | //mAlarmBell = new QLabel(parent); | 257 | //mAlarmBell = new QLabel(parent); |
251 | //mAlarmBell->setPixmap(SmallIcon("bell")); | 258 | //mAlarmBell->setPixmap(SmallIcon("bell")); |
252 | //alarmLayout->addWidget(mAlarmBell); | 259 | //alarmLayout->addWidget(mAlarmBell); |
253 | if ( QApplication::desktop()->width() < 320 ) | 260 | if ( QApplication::desktop()->width() < 320 ) |
254 | mAlarmButton = new QCheckBox(i18n("Rem."),parent); | 261 | mAlarmButton = new QCheckBox(i18n("Rem."),parent); |
@@ -525,13 +532,13 @@ void KOEditorGeneral::readIncidence(Incidence *event) | |||
525 | mSecrecyCombo->setCurrentItem(event->secrecy()); | 532 | mSecrecyCombo->setCurrentItem(event->secrecy()); |
526 | mCancelBox->setChecked( event->cancelled() ); | 533 | mCancelBox->setChecked( event->cancelled() ); |
527 | mAlarmProgramButton->setOn(false); | 534 | mAlarmProgramButton->setOn(false); |
528 | mAlarmSoundButton->setOn(false); | 535 | mAlarmSoundButton->setOn(false); |
529 | 536 | ||
530 | // set up alarm stuff | 537 | // set up alarm stuff |
531 | QPtrList<Alarm> alarms = event->alarms(); | 538 | Q3PtrList<Alarm> alarms = event->alarms(); |
532 | Alarm* alarm; | 539 | Alarm* alarm; |
533 | mAlarmIncrCombo->setCurrentItem(0); | 540 | mAlarmIncrCombo->setCurrentItem(0); |
534 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 541 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
535 | int offset; | 542 | int offset; |
536 | if ( alarm->hasTime() ) { | 543 | if ( alarm->hasTime() ) { |
537 | QDateTime t = alarm->time(); | 544 | QDateTime t = alarm->time(); |
@@ -587,13 +594,13 @@ void KOEditorGeneral::writeIncidence(Incidence *event) | |||
587 | event->setSecrecy(mSecrecyCombo->currentItem()); | 594 | event->setSecrecy(mSecrecyCombo->currentItem()); |
588 | event->setCancelled(mCancelBox->isChecked() );; | 595 | event->setCancelled(mCancelBox->isChecked() );; |
589 | // alarm stuff | 596 | // alarm stuff |
590 | if (mAlarmButton->isChecked()) { | 597 | if (mAlarmButton->isChecked()) { |
591 | if (event->alarms().count() == 0) | 598 | if (event->alarms().count() == 0) |
592 | event->newAlarm(); | 599 | event->newAlarm(); |
593 | QPtrList<Alarm> alarms = event->alarms(); | 600 | Q3PtrList<Alarm> alarms = event->alarms(); |
594 | Alarm *alarm; | 601 | Alarm *alarm; |
595 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 602 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
596 | alarm->setEnabled(true); | 603 | alarm->setEnabled(true); |
597 | int j = mAlarmTimeEdit->value()* -60; | 604 | int j = mAlarmTimeEdit->value()* -60; |
598 | if (mAlarmIncrCombo->currentItem() == 1) | 605 | if (mAlarmIncrCombo->currentItem() == 1) |
599 | j = j * 60; | 606 | j = j * 60; |
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index b10a5d4..45f26fd 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h | |||
@@ -20,25 +20,26 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOEDITORGENERAL_H | 23 | #ifndef KOEDITORGENERAL_H |
24 | #define KOEDITORGENERAL_H | 24 | #define KOEDITORGENERAL_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <q3frame.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qpopupmenu.h> | 30 | #include <q3popupmenu.h> |
31 | #include <qgroupbox.h> | 31 | #include <q3groupbox.h> |
32 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qlistview.h> | 34 | #include <q3listview.h> |
35 | #include <qradiobutton.h> | 35 | #include <qradiobutton.h> |
36 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qcombobox.h> | 38 | #include <qcombobox.h> |
39 | #include <Q3BoxLayout> | ||
39 | 40 | ||
40 | #include <ktextedit.h> | 41 | #include <ktextedit.h> |
41 | #include <krestrictedline.h> | 42 | #include <krestrictedline.h> |
42 | 43 | ||
43 | #include <libkcal/incidence.h> | 44 | #include <libkcal/incidence.h> |
44 | 45 | ||
@@ -52,17 +53,17 @@ class KOEditorGeneral : public QObject | |||
52 | { | 53 | { |
53 | Q_OBJECT | 54 | Q_OBJECT |
54 | public: | 55 | public: |
55 | KOEditorGeneral (QObject* parent=0,const char* name=0); | 56 | KOEditorGeneral (QObject* parent=0,const char* name=0); |
56 | virtual ~KOEditorGeneral(); | 57 | virtual ~KOEditorGeneral(); |
57 | void setFocusOn( int i ); | 58 | void setFocusOn( int i ); |
58 | void initHeader(QWidget *,QBoxLayout *); | 59 | void initHeader(QWidget *,Q3BoxLayout *); |
59 | void initDescription(QWidget *,QBoxLayout *); | 60 | void initDescription(QWidget *,Q3BoxLayout *); |
60 | void initSecrecy(QWidget *,QBoxLayout *); | 61 | void initSecrecy(QWidget *,Q3BoxLayout *); |
61 | void initCategories(QWidget *,QBoxLayout *); | 62 | void initCategories(QWidget *,Q3BoxLayout *); |
62 | void initAlarm(QWidget *,QBoxLayout *); | 63 | void initAlarm(QWidget *,Q3BoxLayout *); |
63 | 64 | ||
64 | /** Set widgets to default values */ | 65 | /** Set widgets to default values */ |
65 | void setDefaults(bool allDay); | 66 | void setDefaults(bool allDay); |
66 | /** Read event object and setup widgets accordingly */ | 67 | /** Read event object and setup widgets accordingly */ |
67 | void readIncidence(Incidence *); | 68 | void readIncidence(Incidence *); |
68 | /** Write event settings to event object */ | 69 | /** Write event settings to event object */ |
@@ -112,13 +113,13 @@ class KOEditorGeneral : public QObject | |||
112 | QComboBox *mSecrecyCombo; | 113 | QComboBox *mSecrecyCombo; |
113 | QCheckBox *mCancelBox; | 114 | QCheckBox *mCancelBox; |
114 | QPushButton *mCategoriesButton; | 115 | QPushButton *mCategoriesButton; |
115 | QPushButton *mCategoriesLabel; | 116 | QPushButton *mCategoriesLabel; |
116 | 117 | ||
117 | private: | 118 | private: |
118 | QPopupMenu * mCatPopup; | 119 | Q3PopupMenu * mCatPopup; |
119 | QString getFittingPath( const QString &) ; | 120 | QString getFittingPath( const QString &) ; |
120 | QString mAlarmSound; | 121 | QString mAlarmSound; |
121 | QString mAlarmProgram; | 122 | QString mAlarmProgram; |
122 | QString mAlarmMessage; | 123 | QString mAlarmMessage; |
123 | }; | 124 | }; |
124 | 125 | ||
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 2c6ed9f..73a4139 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp | |||
@@ -20,17 +20,23 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qvbox.h> | 26 | #include <q3vbox.h> |
27 | #include <qbuttongroup.h> | 27 | #include <q3buttongroup.h> |
28 | #include <qvgroupbox.h> | 28 | #include <q3vgroupbox.h> |
29 | #include <qwidgetstack.h> | 29 | #include <q3widgetstack.h> |
30 | #include <qdatetime.h> | 30 | #include <qdatetime.h> |
31 | //Added by qt3to4: | ||
32 | #include <Q3HBoxLayout> | ||
33 | #include <Q3GridLayout> | ||
34 | #include <Q3Frame> | ||
35 | #include <QLabel> | ||
36 | #include <Q3VBoxLayout> | ||
31 | 37 | ||
32 | #include <kdebug.h> | 38 | #include <kdebug.h> |
33 | #include <kglobal.h> | 39 | #include <kglobal.h> |
34 | #include <kdialog.h> | 40 | #include <kdialog.h> |
35 | #include <klocale.h> | 41 | #include <klocale.h> |
36 | #include <kiconloader.h> | 42 | #include <kiconloader.h> |
@@ -81,25 +87,25 @@ void KOEditorGeneralEvent::finishSetup() | |||
81 | 87 | ||
82 | 88 | ||
83 | mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); | 89 | mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); |
84 | mSummaryEdit->setFocus(); | 90 | mSummaryEdit->setFocus(); |
85 | } | 91 | } |
86 | 92 | ||
87 | void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) | 93 | void KOEditorGeneralEvent::initTime(QWidget *parent,Q3BoxLayout *topLayout) |
88 | { | 94 | { |
89 | QBoxLayout *timeLayout = new QVBoxLayout(topLayout); | 95 | Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout); |
90 | 96 | ||
91 | QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, | 97 | Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal, |
92 | i18n("Date && Time"),parent); | 98 | i18n("Date && Time"),parent); |
93 | timeLayout->addWidget(timeGroupBox); | 99 | timeLayout->addWidget(timeGroupBox); |
94 | 100 | ||
95 | timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() ); | 101 | timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() ); |
96 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); | 102 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); |
97 | QFrame *timeBoxFrame = new QFrame(timeGroupBox); | 103 | Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox); |
98 | 104 | ||
99 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3); | 105 | Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,2,3); |
100 | layoutTimeBox->setSpacing(topLayout->spacing()); | 106 | layoutTimeBox->setSpacing(topLayout->spacing()); |
101 | 107 | ||
102 | mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame); | 108 | mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame); |
103 | layoutTimeBox->addWidget(mStartDateLabel,0,0); | 109 | layoutTimeBox->addWidget(mStartDateLabel,0,0); |
104 | 110 | ||
105 | mStartDateEdit = new KDateEdit(timeBoxFrame); | 111 | mStartDateEdit = new KDateEdit(timeBoxFrame); |
@@ -115,24 +121,24 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
115 | mEndDateEdit = new KDateEdit(timeBoxFrame); | 121 | mEndDateEdit = new KDateEdit(timeBoxFrame); |
116 | layoutTimeBox->addWidget(mEndDateEdit,1,1); | 122 | layoutTimeBox->addWidget(mEndDateEdit,1,1); |
117 | 123 | ||
118 | mEndTimeEdit = new KOTimeEdit(timeBoxFrame); | 124 | mEndTimeEdit = new KOTimeEdit(timeBoxFrame); |
119 | layoutTimeBox->addWidget(mEndTimeEdit,1,2); | 125 | layoutTimeBox->addWidget(mEndTimeEdit,1,2); |
120 | QWidget* duration = new QWidget( timeBoxFrame ); | 126 | QWidget* duration = new QWidget( timeBoxFrame ); |
121 | QHBoxLayout *flagsBox = new QHBoxLayout( duration ); | 127 | Q3HBoxLayout *flagsBox = new Q3HBoxLayout( duration ); |
122 | mNoTimeButton = new QCheckBox(i18n("All day event"),duration); | 128 | mNoTimeButton = new QCheckBox(i18n("All day event"),duration); |
123 | flagsBox->addWidget(mNoTimeButton); | 129 | flagsBox->addWidget(mNoTimeButton); |
124 | connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool))); | 130 | connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool))); |
125 | mDurationLabel = new QLabel( duration ); | 131 | mDurationLabel = new QLabel( duration ); |
126 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 132 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
127 | //layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 ); | 133 | //layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 ); |
128 | //} else { | 134 | //} else { |
129 | flagsBox->addWidget( mDurationLabel ); | 135 | flagsBox->addWidget( mDurationLabel ); |
130 | //} | 136 | //} |
131 | flagsBox->setStretchFactor(mDurationLabel, 10 ); | 137 | flagsBox->setStretchFactor(mDurationLabel, 10 ); |
132 | mDurationLabel->setAlignment( AlignRight | AlignVCenter); | 138 | mDurationLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter); |
133 | layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 ); | 139 | layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 ); |
134 | 140 | ||
135 | // time widgets are checked if they contain a valid time | 141 | // time widgets are checked if they contain a valid time |
136 | connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)), | 142 | connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)), |
137 | this, SLOT(startTimeChanged(QTime))); | 143 | this, SLOT(startTimeChanged(QTime))); |
138 | connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)), | 144 | connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)), |
@@ -144,15 +150,15 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
144 | connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), | 150 | connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), |
145 | this, SLOT(endDateChanged(QDate))); | 151 | this, SLOT(endDateChanged(QDate))); |
146 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime))); | 152 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime))); |
147 | connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime))); | 153 | connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime))); |
148 | } | 154 | } |
149 | 155 | ||
150 | void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) | 156 | void KOEditorGeneralEvent::initClass(QWidget *parent,Q3BoxLayout *topLayout) |
151 | { | 157 | { |
152 | QBoxLayout *classLayout = new QHBoxLayout(topLayout); | 158 | Q3BoxLayout *classLayout = new Q3HBoxLayout(topLayout); |
153 | 159 | ||
154 | QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent); | 160 | QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent); |
155 | classLayout->addWidget(freeTimeLabel); | 161 | classLayout->addWidget(freeTimeLabel); |
156 | 162 | ||
157 | mFreeTimeCombo = new QComboBox(false, parent); | 163 | mFreeTimeCombo = new QComboBox(false, parent); |
158 | mFreeTimeCombo->insertItem(i18n("Busy")); | 164 | mFreeTimeCombo->insertItem(i18n("Busy")); |
diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h index d798905..5d97a5c 100644 --- a/korganizer/koeditorgeneralevent.h +++ b/korganizer/koeditorgeneralevent.h | |||
@@ -20,21 +20,21 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _KOEDITORGENERALEVENT_H | 23 | #ifndef _KOEDITORGENERALEVENT_H |
24 | #define _KOEDITORGENERALEVENT_H | 24 | #define _KOEDITORGENERALEVENT_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <q3frame.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qgroupbox.h> | 30 | #include <q3groupbox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qmultilineedit.h> | 33 | #include <q3multilineedit.h> |
34 | #include <qlistview.h> | 34 | #include <q3listview.h> |
35 | #include <qradiobutton.h> | 35 | #include <qradiobutton.h> |
36 | 36 | ||
37 | #include <krestrictedline.h> | 37 | #include <krestrictedline.h> |
38 | 38 | ||
39 | #include "koeditorgeneral.h" | 39 | #include "koeditorgeneral.h" |
40 | 40 | ||
@@ -48,14 +48,14 @@ class KOEditorGeneralEvent : public KOEditorGeneral | |||
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | KOEditorGeneralEvent (QObject* parent=0,const char* name=0); | 51 | KOEditorGeneralEvent (QObject* parent=0,const char* name=0); |
52 | virtual ~KOEditorGeneralEvent(); | 52 | virtual ~KOEditorGeneralEvent(); |
53 | 53 | ||
54 | void initTime(QWidget *,QBoxLayout *); | 54 | void initTime(QWidget *,Q3BoxLayout *); |
55 | void initClass(QWidget *,QBoxLayout *); | 55 | void initClass(QWidget *,Q3BoxLayout *); |
56 | 56 | ||
57 | void finishSetup(); | 57 | void finishSetup(); |
58 | 58 | ||
59 | /** Set widgets to default values */ | 59 | /** Set widgets to default values */ |
60 | void setDefaults(QDateTime from,QDateTime to,bool allDay); | 60 | void setDefaults(QDateTime from,QDateTime to,bool allDay); |
61 | /** | 61 | /** |
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index d32d5a5..baee9fc 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp | |||
@@ -19,20 +19,27 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qfiledialog.h> | 25 | #include <q3filedialog.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qvbox.h> | 27 | #include <q3vbox.h> |
28 | #include <qbuttongroup.h> | 28 | #include <q3buttongroup.h> |
29 | #include <qvgroupbox.h> | 29 | #include <q3vgroupbox.h> |
30 | #include <qwidgetstack.h> | 30 | #include <q3widgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <QDesktopWidget> | ||
34 | //Added by qt3to4: | ||
35 | #include <Q3HBoxLayout> | ||
36 | #include <Q3GridLayout> | ||
37 | #include <Q3Frame> | ||
38 | #include <QLabel> | ||
39 | #include <Q3VBoxLayout> | ||
33 | 40 | ||
34 | #include <kglobal.h> | 41 | #include <kglobal.h> |
35 | #include <klocale.h> | 42 | #include <klocale.h> |
36 | #include <kiconloader.h> | 43 | #include <kiconloader.h> |
37 | #include <kmessagebox.h> | 44 | #include <kmessagebox.h> |
38 | #include <kdebug.h> | 45 | #include <kdebug.h> |
@@ -79,24 +86,24 @@ void KOEditorGeneralTodo::finishSetup() | |||
79 | // QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo); | 86 | // QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo); |
80 | // QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit); | 87 | // QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit); |
81 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); | 88 | mSummaryEdit->load(KOLocationBox::SUMMARYTODO); |
82 | mSummaryEdit->setFocus(); | 89 | mSummaryEdit->setFocus(); |
83 | } | 90 | } |
84 | 91 | ||
85 | void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | 92 | void KOEditorGeneralTodo::initTime(QWidget *parent,Q3BoxLayout *topLayout) |
86 | { | 93 | { |
87 | QBoxLayout *timeLayout = new QVBoxLayout(topLayout); | 94 | Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout); |
88 | 95 | ||
89 | QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, | 96 | Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal, |
90 | i18n("Date && Time"),parent); | 97 | i18n("Date && Time"),parent); |
91 | timeLayout->addWidget(timeGroupBox); | 98 | timeLayout->addWidget(timeGroupBox); |
92 | timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); | 99 | timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); |
93 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); | 100 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); |
94 | QFrame *timeBoxFrame = new QFrame(timeGroupBox); | 101 | Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox); |
95 | 102 | ||
96 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); | 103 | Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,3,3); |
97 | layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); | 104 | layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); |
98 | layoutTimeBox->setColStretch( 1, 1 ); | 105 | layoutTimeBox->setColStretch( 1, 1 ); |
99 | 106 | ||
100 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); | 107 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); |
101 | layoutTimeBox->addWidget(mStartCheck,0,0); | 108 | layoutTimeBox->addWidget(mStartCheck,0,0); |
102 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); | 109 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); |
@@ -130,13 +137,13 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | |||
130 | this, SLOT(startDateChanged(QDate))); | 137 | this, SLOT(startDateChanged(QDate))); |
131 | // some more layouting | 138 | // some more layouting |
132 | //layoutTimeBox->setColStretch(3,1); | 139 | //layoutTimeBox->setColStretch(3,1); |
133 | } | 140 | } |
134 | 141 | ||
135 | 142 | ||
136 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) | 143 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, Q3BoxLayout *topLayout) |
137 | { | 144 | { |
138 | mCompletedCombo = new QComboBox(parent); | 145 | mCompletedCombo = new QComboBox(parent); |
139 | // xgettext:no-c-format | 146 | // xgettext:no-c-format |
140 | mCompletedCombo->insertItem(i18n(" 0 %")); | 147 | mCompletedCombo->insertItem(i18n(" 0 %")); |
141 | // xgettext:no-c-format | 148 | // xgettext:no-c-format |
142 | mCompletedCombo->insertItem(i18n(" 20 %")); | 149 | mCompletedCombo->insertItem(i18n(" 20 %")); |
@@ -170,31 +177,31 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) | |||
170 | else | 177 | else |
171 | mCompleteDateEdit->setMaximumWidth( 140 ); | 178 | mCompleteDateEdit->setMaximumWidth( 140 ); |
172 | topLayout->setSpacing( 0 ); | 179 | topLayout->setSpacing( 0 ); |
173 | } | 180 | } |
174 | } | 181 | } |
175 | 182 | ||
176 | void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) | 183 | void KOEditorGeneralTodo::initPriority(QWidget *parent, Q3BoxLayout *topLayout) |
177 | { | 184 | { |
178 | 185 | ||
179 | QHBox* h = new QHBox ( parent ); | 186 | Q3HBox* h = new Q3HBox ( parent ); |
180 | topLayout->addWidget( h ); | 187 | topLayout->addWidget( h ); |
181 | QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); | 188 | QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); |
182 | // topLayout->addWidget(priorityLabel); | 189 | // topLayout->addWidget(priorityLabel); |
183 | mPriorityCombo = new QComboBox( h ); | 190 | mPriorityCombo = new QComboBox( h ); |
184 | mPriorityCombo->insertItem(i18n("1 (high)")); | 191 | mPriorityCombo->insertItem(i18n("1 (high)")); |
185 | mPriorityCombo->insertItem(i18n("2")); | 192 | mPriorityCombo->insertItem(i18n("2")); |
186 | mPriorityCombo->insertItem(i18n("3")); | 193 | mPriorityCombo->insertItem(i18n("3")); |
187 | mPriorityCombo->insertItem(i18n("4")); | 194 | mPriorityCombo->insertItem(i18n("4")); |
188 | mPriorityCombo->insertItem(i18n("5 (low)")); | 195 | mPriorityCombo->insertItem(i18n("5 (low)")); |
189 | //topLayout->addWidget(mPriorityCombo); | 196 | //topLayout->addWidget(mPriorityCombo); |
190 | } | 197 | } |
191 | 198 | ||
192 | void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) | 199 | void KOEditorGeneralTodo::initStatus(QWidget *parent,Q3BoxLayout *topLayout) |
193 | { | 200 | { |
194 | QBoxLayout *statusLayout = new QHBoxLayout(topLayout); | 201 | Q3BoxLayout *statusLayout = new Q3HBoxLayout(topLayout); |
195 | 202 | ||
196 | initCompletion( parent, statusLayout ); | 203 | initCompletion( parent, statusLayout ); |
197 | 204 | ||
198 | statusLayout->addStretch( 1 ); | 205 | statusLayout->addStretch( 1 ); |
199 | 206 | ||
200 | initPriority( parent, statusLayout ); | 207 | initPriority( parent, statusLayout ); |
@@ -393,13 +400,13 @@ void KOEditorGeneralTodo::enableStartEdit( bool enable ) | |||
393 | } | 400 | } |
394 | emit datesChecked(); | 401 | emit datesChecked(); |
395 | } | 402 | } |
396 | void KOEditorGeneralTodo::startDateChanged(QDate newdate) | 403 | void KOEditorGeneralTodo::startDateChanged(QDate newdate) |
397 | { | 404 | { |
398 | if ( mDueCheck->isChecked() ) | 405 | if ( mDueCheck->isChecked() ) |
399 | emit dateTimesChanged(newdate,mDueDateEdit->date()); | 406 | emit dateTimesChanged((QDateTime)newdate,(QDateTime)mDueDateEdit->date()); |
400 | } | 407 | } |
401 | void KOEditorGeneralTodo::enableTimeEdits(bool enable) | 408 | void KOEditorGeneralTodo::enableTimeEdits(bool enable) |
402 | { | 409 | { |
403 | if(mStartCheck->isChecked()) { | 410 | if(mStartCheck->isChecked()) { |
404 | mStartTimeEdit->setEnabled( enable ); | 411 | mStartTimeEdit->setEnabled( enable ); |
405 | } | 412 | } |
diff --git a/korganizer/koeditorgeneraltodo.h b/korganizer/koeditorgeneraltodo.h index 2e56a7a..2e97ff5 100644 --- a/korganizer/koeditorgeneraltodo.h +++ b/korganizer/koeditorgeneraltodo.h | |||
@@ -20,21 +20,21 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _KOEDITORGENERALTODO_H | 23 | #ifndef _KOEDITORGENERALTODO_H |
24 | #define _KOEDITORGENERALTODO_H | 24 | #define _KOEDITORGENERALTODO_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <q3frame.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qgroupbox.h> | 30 | #include <q3groupbox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qmultilineedit.h> | 33 | #include <q3multilineedit.h> |
34 | #include <qlistview.h> | 34 | #include <q3listview.h> |
35 | #include <qradiobutton.h> | 35 | #include <qradiobutton.h> |
36 | 36 | ||
37 | #include "koeditorgeneral.h" | 37 | #include "koeditorgeneral.h" |
38 | #include "koglobals.h" | 38 | #include "koglobals.h" |
39 | 39 | ||
40 | class KRestrictedLine; | 40 | class KRestrictedLine; |
@@ -47,16 +47,16 @@ class KOEditorGeneralTodo : public KOEditorGeneral | |||
47 | { | 47 | { |
48 | Q_OBJECT | 48 | Q_OBJECT |
49 | public: | 49 | public: |
50 | KOEditorGeneralTodo (QObject* parent=0,const char* name=0); | 50 | KOEditorGeneralTodo (QObject* parent=0,const char* name=0); |
51 | virtual ~KOEditorGeneralTodo(); | 51 | virtual ~KOEditorGeneralTodo(); |
52 | 52 | ||
53 | void initTime(QWidget *, QBoxLayout *); | 53 | void initTime(QWidget *, Q3BoxLayout *); |
54 | void initStatus(QWidget *, QBoxLayout *); | 54 | void initStatus(QWidget *, Q3BoxLayout *); |
55 | void initCompletion(QWidget *, QBoxLayout *); | 55 | void initCompletion(QWidget *, Q3BoxLayout *); |
56 | void initPriority(QWidget *, QBoxLayout *); | 56 | void initPriority(QWidget *, Q3BoxLayout *); |
57 | 57 | ||
58 | void finishSetup(); | 58 | void finishSetup(); |
59 | 59 | ||
60 | /** Set widgets to default values */ | 60 | /** Set widgets to default values */ |
61 | void setDefaults(QDateTime due,bool allDay); | 61 | void setDefaults(QDateTime due,bool allDay); |
62 | /** Read todo object and setup widgets accordingly */ | 62 | /** Read todo object and setup widgets accordingly */ |
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp index e0380c4..e0ae3a0 100644 --- a/korganizer/koeditorrecurrence.cpp +++ b/korganizer/koeditorrecurrence.cpp | |||
@@ -19,23 +19,31 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qfiledialog.h> | 25 | #include <q3filedialog.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qvbox.h> | 27 | #include <q3vbox.h> |
28 | #include <qbuttongroup.h> | 28 | #include <q3buttongroup.h> |
29 | #include <qvgroupbox.h> | 29 | #include <q3vgroupbox.h> |
30 | #include <qwidgetstack.h> | 30 | #include <q3widgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qlistbox.h> | 32 | #include <q3listbox.h> |
33 | #include <qspinbox.h> | 33 | #include <qspinbox.h> |
34 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
35 | #include <qapplication.h> | 35 | #include <qapplication.h> |
36 | #include <QDesktopWidget> | ||
37 | //Added by qt3to4: | ||
38 | #include <Q3HBoxLayout> | ||
39 | #include <QLabel> | ||
40 | #include <Q3GridLayout> | ||
41 | #include <Q3PtrList> | ||
42 | #include <Q3Frame> | ||
43 | #include <Q3VBoxLayout> | ||
36 | 44 | ||
37 | #include <kdialog.h> | 45 | #include <kdialog.h> |
38 | #include <kglobal.h> | 46 | #include <kglobal.h> |
39 | #include <klocale.h> | 47 | #include <klocale.h> |
40 | #include <kiconloader.h> | 48 | #include <kiconloader.h> |
41 | #include <kdebug.h> | 49 | #include <kdebug.h> |
@@ -78,13 +86,13 @@ int RecurBase::frequency() | |||
78 | 86 | ||
79 | /////////////////////////// RecurDaily /////////////////////////////// | 87 | /////////////////////////// RecurDaily /////////////////////////////// |
80 | 88 | ||
81 | RecurDaily::RecurDaily( QWidget *parent, const char *name ) : | 89 | RecurDaily::RecurDaily( QWidget *parent, const char *name ) : |
82 | RecurBase( parent, name ) | 90 | RecurBase( parent, name ) |
83 | { | 91 | { |
84 | QBoxLayout *topLayout = new QHBoxLayout( this ); | 92 | Q3BoxLayout *topLayout = new Q3HBoxLayout( this ); |
85 | topLayout->setSpacing( KDialog::spacingHint() ); | 93 | topLayout->setSpacing( KDialog::spacingHint() ); |
86 | topLayout->setMargin( KDialog::marginHintSmall() ); | 94 | topLayout->setMargin( KDialog::marginHintSmall() ); |
87 | 95 | ||
88 | QLabel *preLabel = new QLabel( i18n("Recur every"), this ); | 96 | QLabel *preLabel = new QLabel( i18n("Recur every"), this ); |
89 | topLayout->addWidget( preLabel ); | 97 | topLayout->addWidget( preLabel ); |
90 | 98 | ||
@@ -97,30 +105,30 @@ RecurDaily::RecurDaily( QWidget *parent, const char *name ) : | |||
97 | 105 | ||
98 | /////////////////////////// RecurWeekly /////////////////////////////// | 106 | /////////////////////////// RecurWeekly /////////////////////////////// |
99 | 107 | ||
100 | RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) : | 108 | RecurWeekly::RecurWeekly( QWidget *parent, const char *name ) : |
101 | RecurBase( parent, name ) | 109 | RecurBase( parent, name ) |
102 | { | 110 | { |
103 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 111 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
104 | topLayout->setSpacing( KDialog::spacingHint() ); | 112 | topLayout->setSpacing( KDialog::spacingHint() ); |
105 | topLayout->setMargin( KDialog::marginHintSmall() ); | 113 | topLayout->setMargin( KDialog::marginHintSmall() ); |
106 | 114 | ||
107 | //topLayout->addStretch( 1 ); | 115 | //topLayout->addStretch( 1 ); |
108 | 116 | ||
109 | QBoxLayout *weeksLayout = new QHBoxLayout( topLayout ); | 117 | Q3BoxLayout *weeksLayout = new Q3HBoxLayout( topLayout ); |
110 | 118 | ||
111 | QLabel *preLabel = new QLabel( i18n("Recur every"), this ); | 119 | QLabel *preLabel = new QLabel( i18n("Recur every"), this ); |
112 | weeksLayout->addWidget( preLabel ); | 120 | weeksLayout->addWidget( preLabel ); |
113 | 121 | ||
114 | weeksLayout->addWidget( frequencyEdit() ); | 122 | weeksLayout->addWidget( frequencyEdit() ); |
115 | 123 | ||
116 | QLabel *postLabel = new QLabel( i18n("week(s) on:"), this ); | 124 | QLabel *postLabel = new QLabel( i18n("week(s) on:"), this ); |
117 | weeksLayout->addWidget( postLabel ); | 125 | weeksLayout->addWidget( postLabel ); |
118 | 126 | ||
119 | QHBox *dayBox = new QHBox( this ); | 127 | Q3HBox *dayBox = new Q3HBox( this ); |
120 | topLayout->addWidget( dayBox, 1, AlignVCenter ); | 128 | topLayout->addWidget( dayBox, 1, Qt::AlignVCenter ); |
121 | // TODO: Respect start of week setting | 129 | // TODO: Respect start of week setting |
122 | for ( int i = 0; i < 7; ++i ) { | 130 | for ( int i = 0; i < 7; ++i ) { |
123 | QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true ); | 131 | QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true ); |
124 | int left = 1; | 132 | int left = 1; |
125 | if ( QApplication::desktop()->width() > 480 ) { | 133 | if ( QApplication::desktop()->width() > 480 ) { |
126 | ++left; | 134 | ++left; |
@@ -153,46 +161,46 @@ QBitArray RecurWeekly::days() | |||
153 | 161 | ||
154 | /////////////////////////// RecurMonthly /////////////////////////////// | 162 | /////////////////////////// RecurMonthly /////////////////////////////// |
155 | 163 | ||
156 | RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : | 164 | RecurMonthly::RecurMonthly( QWidget *parent, const char *name ) : |
157 | RecurBase( parent, name ) | 165 | RecurBase( parent, name ) |
158 | { | 166 | { |
159 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 167 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
160 | topLayout->setSpacing( KDialog::spacingHint() ); | 168 | topLayout->setSpacing( KDialog::spacingHint() ); |
161 | topLayout->setMargin( KDialog::marginHintSmall() ); | 169 | topLayout->setMargin( KDialog::marginHintSmall() ); |
162 | 170 | ||
163 | 171 | ||
164 | QBoxLayout *freqLayout = new QHBoxLayout( topLayout ); | 172 | Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout ); |
165 | 173 | ||
166 | QLabel *preLabel = new QLabel( i18n("every"), this ); | 174 | QLabel *preLabel = new QLabel( i18n("every"), this ); |
167 | freqLayout->addWidget( preLabel ); | 175 | freqLayout->addWidget( preLabel ); |
168 | 176 | ||
169 | freqLayout->addWidget( frequencyEdit() ); | 177 | freqLayout->addWidget( frequencyEdit() ); |
170 | 178 | ||
171 | QLabel *postLabel = new QLabel( i18n("month(s)"), this ); | 179 | QLabel *postLabel = new QLabel( i18n("month(s)"), this ); |
172 | freqLayout->addWidget( postLabel ); | 180 | freqLayout->addWidget( postLabel ); |
173 | 181 | ||
174 | 182 | ||
175 | QButtonGroup *buttonGroup = new QButtonGroup( this ); | 183 | Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this ); |
176 | buttonGroup->setFrameStyle( QFrame::NoFrame ); | 184 | buttonGroup->setFrameStyle( Q3Frame::NoFrame ); |
177 | topLayout->addWidget( buttonGroup, 1, AlignVCenter ); | 185 | topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter ); |
178 | 186 | ||
179 | QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 ); | 187 | Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 3, 2 ); |
180 | buttonLayout->setSpacing( KDialog::spacingHint() ); | 188 | buttonLayout->setSpacing( KDialog::spacingHint() ); |
181 | buttonLayout->setMargin( KDialog::marginHintSmall() ); | 189 | buttonLayout->setMargin( KDialog::marginHintSmall() ); |
182 | 190 | ||
183 | 191 | ||
184 | QString recurOnText; | 192 | QString recurOnText; |
185 | if ( QApplication::desktop()->width() > 320 ) { | 193 | if ( QApplication::desktop()->width() > 320 ) { |
186 | recurOnText = i18n("Recur on the"); | 194 | recurOnText = i18n("Recur on the"); |
187 | } | 195 | } |
188 | 196 | ||
189 | mByDayRadio = new QRadioButton( recurOnText, buttonGroup ); | 197 | mByDayRadio = new QRadioButton( recurOnText, buttonGroup ); |
190 | buttonLayout->addWidget( mByDayRadio, 0, 0 ); | 198 | buttonLayout->addWidget( mByDayRadio, 0, 0 ); |
191 | 199 | ||
192 | mByDayCombo = new QComboBox( buttonGroup ); | 200 | mByDayCombo = new Q3ComboBox( buttonGroup ); |
193 | mByDayCombo->setSizeLimit( 7 ); | 201 | mByDayCombo->setSizeLimit( 7 ); |
194 | mByDayCombo->insertItem( i18n("1st") ); | 202 | mByDayCombo->insertItem( i18n("1st") ); |
195 | mByDayCombo->insertItem( i18n("2nd") ); | 203 | mByDayCombo->insertItem( i18n("2nd") ); |
196 | mByDayCombo->insertItem( i18n("3rd") ); | 204 | mByDayCombo->insertItem( i18n("3rd") ); |
197 | mByDayCombo->insertItem( i18n("4th") ); | 205 | mByDayCombo->insertItem( i18n("4th") ); |
198 | mByDayCombo->insertItem( i18n("5th") ); | 206 | mByDayCombo->insertItem( i18n("5th") ); |
@@ -290,40 +298,40 @@ int RecurMonthly::weekday() | |||
290 | 298 | ||
291 | /////////////////////////// RecurYearly /////////////////////////////// | 299 | /////////////////////////// RecurYearly /////////////////////////////// |
292 | 300 | ||
293 | RecurYearly::RecurYearly( QWidget *parent, const char *name ) : | 301 | RecurYearly::RecurYearly( QWidget *parent, const char *name ) : |
294 | RecurBase( parent, name ) | 302 | RecurBase( parent, name ) |
295 | { | 303 | { |
296 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 304 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
297 | topLayout->setSpacing( KDialog::spacingHint() ); | 305 | topLayout->setSpacing( KDialog::spacingHint() ); |
298 | topLayout->setMargin( KDialog::marginHintSmall() ); | 306 | topLayout->setMargin( KDialog::marginHintSmall() ); |
299 | 307 | ||
300 | 308 | ||
301 | QBoxLayout *freqLayout = new QHBoxLayout( topLayout ); | 309 | Q3BoxLayout *freqLayout = new Q3HBoxLayout( topLayout ); |
302 | 310 | ||
303 | QLabel *preLabel = new QLabel( i18n("every"), this ); | 311 | QLabel *preLabel = new QLabel( i18n("every"), this ); |
304 | freqLayout->addWidget( preLabel ); | 312 | freqLayout->addWidget( preLabel ); |
305 | 313 | ||
306 | freqLayout->addWidget( frequencyEdit() ); | 314 | freqLayout->addWidget( frequencyEdit() ); |
307 | 315 | ||
308 | QLabel *postLabel = new QLabel( i18n("year(s)"), this ); | 316 | QLabel *postLabel = new QLabel( i18n("year(s)"), this ); |
309 | freqLayout->addWidget( postLabel ); | 317 | freqLayout->addWidget( postLabel ); |
310 | 318 | ||
311 | 319 | ||
312 | QButtonGroup *buttonGroup = new QButtonGroup( this ); | 320 | Q3ButtonGroup *buttonGroup = new Q3ButtonGroup( this ); |
313 | buttonGroup->setFrameStyle( QFrame::NoFrame ); | 321 | buttonGroup->setFrameStyle( Q3Frame::NoFrame ); |
314 | topLayout->addWidget( buttonGroup, 1, AlignVCenter ); | 322 | topLayout->addWidget( buttonGroup, 1, Qt::AlignVCenter ); |
315 | 323 | ||
316 | QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 2, 3 ); | 324 | Q3GridLayout *buttonLayout = new Q3GridLayout( buttonGroup, 2, 3 ); |
317 | 325 | ||
318 | mByMonthRadio = new QRadioButton( i18n("On day "), buttonGroup); | 326 | mByMonthRadio = new QRadioButton( i18n("On day "), buttonGroup); |
319 | buttonLayout->addWidget( mByMonthRadio, 0, 0 , Qt::AlignRight); | 327 | buttonLayout->addWidget( mByMonthRadio, 0, 0 , Qt::AlignRight); |
320 | mByDayLabel = new QLabel( i18n("%1 of ").arg(1), buttonGroup ); | 328 | mByDayLabel = new QLabel( i18n("%1 of ").arg(1), buttonGroup ); |
321 | 329 | ||
322 | buttonLayout->addWidget( mByDayLabel, 0, 1 ); | 330 | buttonLayout->addWidget( mByDayLabel, 0, 1 ); |
323 | mByMonthCombo = new QComboBox( buttonGroup ); | 331 | mByMonthCombo = new Q3ComboBox( buttonGroup ); |
324 | mByMonthCombo->insertItem( i18n("January") ); | 332 | mByMonthCombo->insertItem( i18n("January") ); |
325 | mByMonthCombo->insertItem( i18n("February") ); | 333 | mByMonthCombo->insertItem( i18n("February") ); |
326 | mByMonthCombo->insertItem( i18n("March") ); | 334 | mByMonthCombo->insertItem( i18n("March") ); |
327 | mByMonthCombo->insertItem( i18n("April") ); | 335 | mByMonthCombo->insertItem( i18n("April") ); |
328 | mByMonthCombo->insertItem( i18n("May") ); | 336 | mByMonthCombo->insertItem( i18n("May") ); |
329 | mByMonthCombo->insertItem( i18n("June") ); | 337 | mByMonthCombo->insertItem( i18n("June") ); |
@@ -380,33 +388,33 @@ int RecurYearly::day() | |||
380 | 388 | ||
381 | //////////////////////////// ExceptionsWidget ////////////////////////// | 389 | //////////////////////////// ExceptionsWidget ////////////////////////// |
382 | 390 | ||
383 | ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) : | 391 | ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) : |
384 | QWidget( parent, name ) | 392 | QWidget( parent, name ) |
385 | { | 393 | { |
386 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 394 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
387 | 395 | ||
388 | QGroupBox *groupBox = new QGroupBox( 1, Horizontal, i18n("Exceptions"), | 396 | Q3GroupBox *groupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Exceptions"), |
389 | this ); | 397 | this ); |
390 | topLayout->addWidget( groupBox ); | 398 | topLayout->addWidget( groupBox ); |
391 | 399 | ||
392 | QWidget *box = new QWidget( groupBox ); | 400 | QWidget *box = new QWidget( groupBox ); |
393 | 401 | ||
394 | QGridLayout *boxLayout = new QGridLayout( box ); | 402 | Q3GridLayout *boxLayout = new Q3GridLayout( box ); |
395 | 403 | ||
396 | mExceptionDateEdit = new KDateEdit( box ); | 404 | mExceptionDateEdit = new KDateEdit( box ); |
397 | boxLayout->addWidget( mExceptionDateEdit, 0, 0 ); | 405 | boxLayout->addWidget( mExceptionDateEdit, 0, 0 ); |
398 | 406 | ||
399 | QPushButton *addExceptionButton = new QPushButton( i18n("Add"), box ); | 407 | QPushButton *addExceptionButton = new QPushButton( i18n("Add"), box ); |
400 | boxLayout->addWidget( addExceptionButton, 1, 0 ); | 408 | boxLayout->addWidget( addExceptionButton, 1, 0 ); |
401 | QPushButton *changeExceptionButton = new QPushButton( i18n("Change"), box ); | 409 | QPushButton *changeExceptionButton = new QPushButton( i18n("Change"), box ); |
402 | boxLayout->addWidget( changeExceptionButton, 2, 0 ); | 410 | boxLayout->addWidget( changeExceptionButton, 2, 0 ); |
403 | QPushButton *deleteExceptionButton = new QPushButton( i18n("Delete"), box ); | 411 | QPushButton *deleteExceptionButton = new QPushButton( i18n("Delete"), box ); |
404 | boxLayout->addWidget( deleteExceptionButton, 3, 0 ); | 412 | boxLayout->addWidget( deleteExceptionButton, 3, 0 ); |
405 | 413 | ||
406 | mExceptionList = new QListBox( box ); | 414 | mExceptionList = new Q3ListBox( box ); |
407 | boxLayout->addMultiCellWidget( mExceptionList, 0, 3, 1, 1 ); | 415 | boxLayout->addMultiCellWidget( mExceptionList, 0, 3, 1, 1 ); |
408 | 416 | ||
409 | boxLayout->setRowStretch( 4, 1 ); | 417 | boxLayout->setRowStretch( 4, 1 ); |
410 | boxLayout->setColStretch( 1, 3 ); | 418 | boxLayout->setColStretch( 1, 3 ); |
411 | 419 | ||
412 | connect( addExceptionButton, SIGNAL( clicked() ), | 420 | connect( addExceptionButton, SIGNAL( clicked() ), |
@@ -503,46 +511,46 @@ DateList ExceptionsDialog::dates() | |||
503 | ///////////////////////// RecurrenceRangeWidget /////////////////////////// | 511 | ///////////////////////// RecurrenceRangeWidget /////////////////////////// |
504 | 512 | ||
505 | RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent, | 513 | RecurrenceRangeWidget::RecurrenceRangeWidget( QWidget *parent, |
506 | const char *name ) | 514 | const char *name ) |
507 | : QWidget( parent, name ) | 515 | : QWidget( parent, name ) |
508 | { | 516 | { |
509 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 517 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
510 | 518 | ||
511 | mRangeGroupBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Range"), | 519 | mRangeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Range"), |
512 | this ); | 520 | this ); |
513 | topLayout->addWidget( mRangeGroupBox ); | 521 | topLayout->addWidget( mRangeGroupBox ); |
514 | 522 | ||
515 | QWidget *rangeBox = new QWidget( mRangeGroupBox ); | 523 | QWidget *rangeBox = new QWidget( mRangeGroupBox ); |
516 | QVBoxLayout *rangeLayout = new QVBoxLayout( rangeBox ); | 524 | Q3VBoxLayout *rangeLayout = new Q3VBoxLayout( rangeBox ); |
517 | rangeLayout->setSpacing( KDialog::spacingHint() ); | 525 | rangeLayout->setSpacing( KDialog::spacingHint() ); |
518 | rangeLayout->setMargin( KDialog::marginHintSmall() ); | 526 | rangeLayout->setMargin( KDialog::marginHintSmall() ); |
519 | 527 | ||
520 | mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox ); | 528 | mStartDateLabel = new QLabel( i18n("Begin on:"), rangeBox ); |
521 | rangeLayout->addWidget( mStartDateLabel ); | 529 | rangeLayout->addWidget( mStartDateLabel ); |
522 | 530 | ||
523 | mRangeButtonGroup = new QButtonGroup; | 531 | mRangeButtonGroup = new Q3ButtonGroup; |
524 | 532 | ||
525 | mNoEndDateButton = new QRadioButton( i18n("No ending date"), rangeBox ); | 533 | mNoEndDateButton = new QRadioButton( i18n("No ending date"), rangeBox ); |
526 | mRangeButtonGroup->insert( mNoEndDateButton ); | 534 | mRangeButtonGroup->insert( mNoEndDateButton ); |
527 | rangeLayout->addWidget( mNoEndDateButton ); | 535 | rangeLayout->addWidget( mNoEndDateButton ); |
528 | 536 | ||
529 | QBoxLayout *durationLayout = new QHBoxLayout( rangeLayout ); | 537 | Q3BoxLayout *durationLayout = new Q3HBoxLayout( rangeLayout ); |
530 | durationLayout->setSpacing( KDialog::spacingHint() ); | 538 | durationLayout->setSpacing( KDialog::spacingHint() ); |
531 | 539 | ||
532 | mEndDurationButton = new QRadioButton( i18n("End after"), rangeBox ); | 540 | mEndDurationButton = new QRadioButton( i18n("End after"), rangeBox ); |
533 | mRangeButtonGroup->insert( mEndDurationButton ); | 541 | mRangeButtonGroup->insert( mEndDurationButton ); |
534 | durationLayout->addWidget( mEndDurationButton ); | 542 | durationLayout->addWidget( mEndDurationButton ); |
535 | 543 | ||
536 | mEndDurationEdit = new QSpinBox( 1, 9999, 1, rangeBox ); | 544 | mEndDurationEdit = new QSpinBox( 1, 9999, 1, rangeBox ); |
537 | durationLayout->addWidget( mEndDurationEdit ); | 545 | durationLayout->addWidget( mEndDurationEdit ); |
538 | 546 | ||
539 | QLabel *endDurationLabel = new QLabel( i18n("occurrence(s)"), rangeBox ); | 547 | QLabel *endDurationLabel = new QLabel( i18n("occurrence(s)"), rangeBox ); |
540 | durationLayout ->addWidget( endDurationLabel ); | 548 | durationLayout ->addWidget( endDurationLabel ); |
541 | 549 | ||
542 | QBoxLayout *endDateLayout = new QHBoxLayout( rangeLayout ); | 550 | Q3BoxLayout *endDateLayout = new Q3HBoxLayout( rangeLayout ); |
543 | endDateLayout->setSpacing( KDialog::spacingHint() ); | 551 | endDateLayout->setSpacing( KDialog::spacingHint() ); |
544 | 552 | ||
545 | mEndDateButton = new QRadioButton( i18n("End by:"), rangeBox ); | 553 | mEndDateButton = new QRadioButton( i18n("End by:"), rangeBox ); |
546 | mRangeButtonGroup->insert( mEndDateButton ); | 554 | mRangeButtonGroup->insert( mEndDateButton ); |
547 | endDateLayout->addWidget( mEndDateButton ); | 555 | endDateLayout->addWidget( mEndDateButton ); |
548 | 556 | ||
@@ -663,13 +671,13 @@ void RecurrenceRangeDialog::setDateTimes( const QDateTime &start, | |||
663 | 671 | ||
664 | //////////////////////////// RecurrenceChooser //////////////////////// | 672 | //////////////////////////// RecurrenceChooser //////////////////////// |
665 | 673 | ||
666 | RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) : | 674 | RecurrenceChooser::RecurrenceChooser( QWidget *parent, const char *name ) : |
667 | QWidget( parent, name ) | 675 | QWidget( parent, name ) |
668 | { | 676 | { |
669 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 677 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
670 | 678 | ||
671 | mTypeCombo = new QComboBox( this ); | 679 | mTypeCombo = new QComboBox( this ); |
672 | mTypeCombo->insertItem( i18n("Daily") ); | 680 | mTypeCombo->insertItem( i18n("Daily") ); |
673 | mTypeCombo->insertItem( i18n("Weekly") ); | 681 | mTypeCombo->insertItem( i18n("Weekly") ); |
674 | mTypeCombo->insertItem( i18n("Monthly") ); | 682 | mTypeCombo->insertItem( i18n("Monthly") ); |
675 | mTypeCombo->insertItem( i18n("Yearly") ); | 683 | mTypeCombo->insertItem( i18n("Yearly") ); |
@@ -722,23 +730,23 @@ void RecurrenceChooser::emitChoice() | |||
722 | 730 | ||
723 | /////////////////////////////// Main Widget ///////////////////////////// | 731 | /////////////////////////////// Main Widget ///////////////////////////// |
724 | 732 | ||
725 | KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : | 733 | KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : |
726 | QWidget( parent, name ) | 734 | QWidget( parent, name ) |
727 | { | 735 | { |
728 | QGridLayout *topLayout = new QGridLayout( this, 2,2 ); | 736 | Q3GridLayout *topLayout = new Q3GridLayout( this, 2,2 ); |
729 | topLayout->setSpacing( KDialog::spacingHint() ); | 737 | topLayout->setSpacing( KDialog::spacingHint() ); |
730 | topLayout->setMargin( KDialog::marginHintSmall() ); | 738 | topLayout->setMargin( KDialog::marginHintSmall() ); |
731 | 739 | ||
732 | mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this ); | 740 | mEnabledCheck = new QCheckBox( i18n("Enable Recurrence"), this ); |
733 | connect( mEnabledCheck, SIGNAL( toggled( bool ) ), | 741 | connect( mEnabledCheck, SIGNAL( toggled( bool ) ), |
734 | SLOT( setEnabled( bool ) ) ); | 742 | SLOT( setEnabled( bool ) ) ); |
735 | topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 ); | 743 | topLayout->addMultiCellWidget( mEnabledCheck, 0, 0, 0, 1 ); |
736 | 744 | ||
737 | 745 | ||
738 | mTimeGroupBox = new QGroupBox( 1, Horizontal, i18n("Time"), | 746 | mTimeGroupBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Time"), |
739 | this ); | 747 | this ); |
740 | topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 ); | 748 | topLayout->addMultiCellWidget( mTimeGroupBox, 1, 1 , 0 , 1 ); |
741 | 749 | ||
742 | if ( QApplication::desktop()->width() <= 640 ) { | 750 | if ( QApplication::desktop()->width() <= 640 ) { |
743 | mTimeGroupBox->hide(); | 751 | mTimeGroupBox->hide(); |
744 | } | 752 | } |
@@ -749,20 +757,20 @@ KOEditorRecurrence::KOEditorRecurrence( QWidget* parent, const char *name ) : | |||
749 | 757 | ||
750 | mDateTimeLabel = new QLabel( mTimeGroupBox ); | 758 | mDateTimeLabel = new QLabel( mTimeGroupBox ); |
751 | // mDateTimeLabel = new QLabel( timeFrame ); | 759 | // mDateTimeLabel = new QLabel( timeFrame ); |
752 | // layoutTimeFrame->addWidget( mDateTimeLabel ); | 760 | // layoutTimeFrame->addWidget( mDateTimeLabel ); |
753 | //mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) ); | 761 | //mTimeGroupBox->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ) ); |
754 | //mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) ); | 762 | //mDateTimeLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum) ); |
755 | mRuleBox = new QGroupBox( 1, Horizontal, i18n("Recurrence Rule"), this ); | 763 | mRuleBox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Recurrence Rule"), this ); |
756 | topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); | 764 | topLayout->addMultiCellWidget( mRuleBox, 2, 2, 0, 1 ); |
757 | mRecurrenceChooser = new RecurrenceChooser( mRuleBox ); | 765 | mRecurrenceChooser = new RecurrenceChooser( mRuleBox ); |
758 | connect( mRecurrenceChooser, SIGNAL( chosen( int ) ), | 766 | connect( mRecurrenceChooser, SIGNAL( chosen( int ) ), |
759 | SLOT( showCurrentRule( int ) ) ); | 767 | SLOT( showCurrentRule( int ) ) ); |
760 | 768 | ||
761 | 769 | ||
762 | mRuleStack = new QWidgetStack( mRuleBox ); | 770 | mRuleStack = new Q3WidgetStack( mRuleBox ); |
763 | 771 | ||
764 | mDaily = new RecurDaily( mRuleStack ); | 772 | mDaily = new RecurDaily( mRuleStack ); |
765 | mRuleStack->addWidget( mDaily, 0 ); | 773 | mRuleStack->addWidget( mDaily, 0 ); |
766 | 774 | ||
767 | mWeekly = new RecurWeekly( mRuleStack ); | 775 | mWeekly = new RecurWeekly( mRuleStack ); |
768 | mRuleStack->addWidget( mWeekly, 0 ); | 776 | mRuleStack->addWidget( mWeekly, 0 ); |
@@ -893,14 +901,14 @@ void KOEditorRecurrence::readEvent(Incidence *event) | |||
893 | dtEnd = ((Event*)event)->dtEnd(); | 901 | dtEnd = ((Event*)event)->dtEnd(); |
894 | else | 902 | else |
895 | dtEnd = ((Todo*)event)->dtDue(); | 903 | dtEnd = ((Todo*)event)->dtDue(); |
896 | 904 | ||
897 | setDefaults( event->dtStart(), dtEnd ); | 905 | setDefaults( event->dtStart(), dtEnd ); |
898 | QBitArray rDays( 7 ); | 906 | QBitArray rDays( 7 ); |
899 | QPtrList<Recurrence::rMonthPos> rmp; | 907 | Q3PtrList<Recurrence::rMonthPos> rmp; |
900 | QPtrList<int> rmd; | 908 | Q3PtrList<int> rmd; |
901 | int day = 0; | 909 | int day = 0; |
902 | int count = 0; | 910 | int count = 0; |
903 | int month = 0; | 911 | int month = 0; |
904 | setDateTimes( event->dtStart(), dtEnd ); | 912 | setDateTimes( event->dtStart(), dtEnd ); |
905 | 913 | ||
906 | 914 | ||
@@ -965,13 +973,13 @@ void KOEditorRecurrence::readEvent(Incidence *event) | |||
965 | month = *rmd.first(); | 973 | month = *rmd.first(); |
966 | else | 974 | else |
967 | month = event->dtStart().date().month() ; | 975 | month = event->dtStart().date().month() ; |
968 | mYearly->setByMonth( month, day ); | 976 | mYearly->setByMonth( month, day ); |
969 | #if 0 | 977 | #if 0 |
970 | //qDebug("2day = %d ",day ); | 978 | //qDebug("2day = %d ",day ); |
971 | QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions(); | 979 | Q3PtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions(); |
972 | int month; | 980 | int month; |
973 | if ( !monthlist.isEmpty() ) { | 981 | if ( !monthlist.isEmpty() ) { |
974 | month = monthlist.first()->rPos ; | 982 | month = monthlist.first()->rPos ; |
975 | } else { | 983 | } else { |
976 | month = event->dtStart().date().month() ; | 984 | month = event->dtStart().date().month() ; |
977 | } | 985 | } |
diff --git a/korganizer/koeditorrecurrence.h b/korganizer/koeditorrecurrence.h index 75e0c73..6c012bd 100644 --- a/korganizer/koeditorrecurrence.h +++ b/korganizer/koeditorrecurrence.h | |||
@@ -20,31 +20,33 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _KOEDITORRECURRENCE_H | 23 | #ifndef _KOEDITORRECURRENCE_H |
24 | #define _KOEDITORRECURRENCE_H | 24 | #define _KOEDITORRECURRENCE_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <q3frame.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qgroupbox.h> | 30 | #include <q3groupbox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qmultilineedit.h> | 33 | #include <q3multilineedit.h> |
34 | #include <qlistview.h> | 34 | #include <q3listview.h> |
35 | #include <qradiobutton.h> | 35 | #include <qradiobutton.h> |
36 | #include <qbuttongroup.h> | 36 | #include <q3buttongroup.h> |
37 | #include <Q3ListBox> | ||
38 | #include <Q3ComboBox> | ||
37 | 39 | ||
38 | #include <kdialogbase.h> | 40 | #include <kdialogbase.h> |
39 | 41 | ||
40 | #include <libkcal/event.h> | 42 | #include <libkcal/event.h> |
41 | 43 | ||
42 | #include "ktimeedit.h" | 44 | #include "ktimeedit.h" |
43 | 45 | ||
44 | class QWidgetStack; | 46 | class Q3WidgetStack; |
45 | class QSpinBox; | 47 | class QSpinBox; |
46 | 48 | ||
47 | class KDateEdit; | 49 | class KDateEdit; |
48 | 50 | ||
49 | using namespace KCal; | 51 | using namespace KCal; |
50 | 52 | ||
@@ -95,13 +97,13 @@ class RecurMonthly : public RecurBase | |||
95 | 97 | ||
96 | int count(); | 98 | int count(); |
97 | int weekday(); | 99 | int weekday(); |
98 | 100 | ||
99 | private: | 101 | private: |
100 | QRadioButton *mByDayRadio; | 102 | QRadioButton *mByDayRadio; |
101 | QComboBox *mByDayCombo; | 103 | Q3ComboBox *mByDayCombo; |
102 | 104 | ||
103 | QRadioButton *mByPosRadio; | 105 | QRadioButton *mByPosRadio; |
104 | QComboBox *mByPosCountCombo; | 106 | QComboBox *mByPosCountCombo; |
105 | QComboBox *mByPosWeekdayCombo; | 107 | QComboBox *mByPosWeekdayCombo; |
106 | }; | 108 | }; |
107 | 109 | ||
@@ -119,13 +121,13 @@ class RecurYearly : public RecurBase | |||
119 | int month(); | 121 | int month(); |
120 | int day(); | 122 | int day(); |
121 | 123 | ||
122 | private: | 124 | private: |
123 | int mDay; | 125 | int mDay; |
124 | QRadioButton *mByMonthRadio; | 126 | QRadioButton *mByMonthRadio; |
125 | QComboBox *mByMonthCombo; | 127 | Q3ComboBox *mByMonthCombo; |
126 | QLabel* mByDayLabel; | 128 | QLabel* mByDayLabel; |
127 | QLabel* mDayOfLabel; | 129 | QLabel* mDayOfLabel; |
128 | QRadioButton *mByDayRadio; | 130 | QRadioButton *mByDayRadio; |
129 | }; | 131 | }; |
130 | 132 | ||
131 | class RecurrenceChooser : public QWidget | 133 | class RecurrenceChooser : public QWidget |
@@ -177,13 +179,13 @@ class ExceptionsWidget : public QWidget, public ExceptionsBase | |||
177 | void addException(); | 179 | void addException(); |
178 | void changeException(); | 180 | void changeException(); |
179 | void deleteException(); | 181 | void deleteException(); |
180 | 182 | ||
181 | private: | 183 | private: |
182 | KDateEdit *mExceptionDateEdit; | 184 | KDateEdit *mExceptionDateEdit; |
183 | QListBox *mExceptionList; | 185 | Q3ListBox *mExceptionList; |
184 | DateList mExceptionDates; | 186 | DateList mExceptionDates; |
185 | }; | 187 | }; |
186 | 188 | ||
187 | class ExceptionsDialog : public KDialogBase, public ExceptionsBase | 189 | class ExceptionsDialog : public KDialogBase, public ExceptionsBase |
188 | { | 190 | { |
189 | public: | 191 | public: |
@@ -232,14 +234,14 @@ class RecurrenceRangeWidget : public QWidget, public RecurrenceRangeBase | |||
232 | const QDateTime &end = QDateTime() ); | 234 | const QDateTime &end = QDateTime() ); |
233 | 235 | ||
234 | protected slots: | 236 | protected slots: |
235 | void showCurrentRange(); | 237 | void showCurrentRange(); |
236 | 238 | ||
237 | private: | 239 | private: |
238 | QButtonGroup *mRangeButtonGroup; | 240 | Q3ButtonGroup *mRangeButtonGroup; |
239 | QGroupBox *mRangeGroupBox; | 241 | Q3GroupBox *mRangeGroupBox; |
240 | QLabel *mStartDateLabel; | 242 | QLabel *mStartDateLabel; |
241 | QRadioButton *mNoEndDateButton; | 243 | QRadioButton *mNoEndDateButton; |
242 | QRadioButton *mEndDurationButton; | 244 | QRadioButton *mEndDurationButton; |
243 | QSpinBox *mEndDurationEdit; | 245 | QSpinBox *mEndDurationEdit; |
244 | QRadioButton *mEndDateButton; | 246 | QRadioButton *mEndDateButton; |
245 | KDateEdit *mEndDateEdit; | 247 | KDateEdit *mEndDateEdit; |
@@ -297,17 +299,17 @@ class KOEditorRecurrence : public QWidget | |||
297 | void showExceptionsDialog(); | 299 | void showExceptionsDialog(); |
298 | void showRecurrenceRangeDialog(); | 300 | void showRecurrenceRangeDialog(); |
299 | 301 | ||
300 | private: | 302 | private: |
301 | QCheckBox *mEnabledCheck; | 303 | QCheckBox *mEnabledCheck; |
302 | 304 | ||
303 | QGroupBox *mTimeGroupBox; | 305 | Q3GroupBox *mTimeGroupBox; |
304 | QLabel *mDateTimeLabel; | 306 | QLabel *mDateTimeLabel; |
305 | 307 | ||
306 | QGroupBox *mRuleBox; | 308 | Q3GroupBox *mRuleBox; |
307 | QWidgetStack *mRuleStack; | 309 | Q3WidgetStack *mRuleStack; |
308 | RecurrenceChooser *mRecurrenceChooser; | 310 | RecurrenceChooser *mRecurrenceChooser; |
309 | 311 | ||
310 | RecurDaily *mDaily; | 312 | RecurDaily *mDaily; |
311 | RecurWeekly *mWeekly; | 313 | RecurWeekly *mWeekly; |
312 | RecurMonthly *mMonthly; | 314 | RecurMonthly *mMonthly; |
313 | RecurYearly *mYearly; | 315 | RecurYearly *mYearly; |
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 3e87197..62ad250 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp | |||
@@ -19,20 +19,25 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qframe.h> | 25 | #include <q3frame.h> |
26 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
27 | #include <qhbox.h> | 27 | #include <q3hbox.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qdir.h> | 29 | #include <qdir.h> |
30 | #include <qlayout.h> | 30 | #include <qlayout.h> |
31 | #include <qwidgetstack.h> | 31 | #include <q3widgetstack.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <QDesktopWidget> | ||
34 | //Added by qt3to4: | ||
35 | #include <Q3HBoxLayout> | ||
36 | #include <Q3PtrList> | ||
37 | #include <Q3VBoxLayout> | ||
33 | 38 | ||
34 | #include <kiconloader.h> | 39 | #include <kiconloader.h> |
35 | #include <kstandarddirs.h> | 40 | #include <kstandarddirs.h> |
36 | #include <kdebug.h> | 41 | #include <kdebug.h> |
37 | #include <klocale.h> | 42 | #include <klocale.h> |
38 | #include <kfiledialog.h> | 43 | #include <kfiledialog.h> |
@@ -102,33 +107,33 @@ void KOEventEditor::setCategories( QString s ) | |||
102 | void KOEventEditor::setupGeneral() | 107 | void KOEventEditor::setupGeneral() |
103 | { | 108 | { |
104 | mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); | 109 | mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); |
105 | connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); | 110 | connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); |
106 | 111 | ||
107 | if( KOPrefs::instance()->mCompactDialogs ) { | 112 | if( KOPrefs::instance()->mCompactDialogs ) { |
108 | QFrame *topFrame = addPage(i18n("General")); | 113 | Q3Frame *topFrame = addPage(i18n("General")); |
109 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 114 | Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); |
110 | topLayout->setSpacing(spacingHint()-1); | 115 | topLayout->setSpacing(spacingHint()-1); |
111 | topLayout->setMargin(marginHint()-1); | 116 | topLayout->setMargin(marginHint()-1); |
112 | topLayout->addStretch ( 1 ); | 117 | topLayout->addStretch ( 1 ); |
113 | mGeneral->initHeader(topFrame,topLayout); | 118 | mGeneral->initHeader(topFrame,topLayout); |
114 | topLayout->addStretch ( 1 ); | 119 | topLayout->addStretch ( 1 ); |
115 | mGeneral->initTime(topFrame,topLayout); | 120 | mGeneral->initTime(topFrame,topLayout); |
116 | topLayout->addStretch ( 1 ); | 121 | topLayout->addStretch ( 1 ); |
117 | // QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); | 122 | // QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); |
118 | mGeneral->initAlarm(topFrame,topLayout); | 123 | mGeneral->initAlarm(topFrame,topLayout); |
119 | topLayout->addStretch ( 1 ); | 124 | topLayout->addStretch ( 1 ); |
120 | mGeneral->enableAlarm( false ); | 125 | mGeneral->enableAlarm( false ); |
121 | 126 | ||
122 | QBoxLayout *buttonLayout; | 127 | Q3BoxLayout *buttonLayout; |
123 | if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 ) | 128 | if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 ) |
124 | buttonLayout = new QVBoxLayout( topLayout ); | 129 | buttonLayout = new Q3VBoxLayout( topLayout ); |
125 | else | 130 | else |
126 | buttonLayout = new QHBoxLayout( topLayout ); | 131 | buttonLayout = new Q3HBoxLayout( topLayout ); |
127 | QHBox* buttonWidget = new QHBox (topFrame); | 132 | Q3HBox* buttonWidget = new Q3HBox (topFrame); |
128 | QIconSet icon; | 133 | QIcon icon; |
129 | if ( QApplication::desktop()->width() < 321 ) | 134 | if ( QApplication::desktop()->width() < 321 ) |
130 | icon = SmallIcon("fileexport16"); | 135 | icon = SmallIcon("fileexport16"); |
131 | else | 136 | else |
132 | icon = SmallIcon("fileexport"); | 137 | icon = SmallIcon("fileexport"); |
133 | QPushButton * loadTemplate = new QPushButton( buttonWidget); | 138 | QPushButton * loadTemplate = new QPushButton( buttonWidget); |
134 | QPushButton * saveTemplate = new QPushButton( buttonWidget); | 139 | QPushButton * saveTemplate = new QPushButton( buttonWidget); |
@@ -143,50 +148,50 @@ void KOEventEditor::setupGeneral() | |||
143 | loadTemplate->setFixedSize( size, size ); | 148 | loadTemplate->setFixedSize( size, size ); |
144 | buttonLayout->addWidget( buttonWidget ); | 149 | buttonLayout->addWidget( buttonWidget ); |
145 | mGeneral->initCategories( topFrame, buttonLayout ); | 150 | mGeneral->initCategories( topFrame, buttonLayout ); |
146 | 151 | ||
147 | topLayout->addStretch( 1 ); | 152 | topLayout->addStretch( 1 ); |
148 | 153 | ||
149 | QFrame *topFrame2 = addPage(i18n("Details")); | 154 | Q3Frame *topFrame2 = addPage(i18n("Details")); |
150 | 155 | ||
151 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); | 156 | Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2); |
152 | topLayout2->setSpacing(spacingHint()-1); | 157 | topLayout2->setSpacing(spacingHint()-1); |
153 | topLayout2->setMargin(marginHint()-1); | 158 | topLayout2->setMargin(marginHint()-1); |
154 | topLayout2->setSpacing(spacingHint()); | 159 | topLayout2->setSpacing(spacingHint()); |
155 | 160 | ||
156 | mGeneral->initClass(topFrame2,topLayout2); | 161 | mGeneral->initClass(topFrame2,topLayout2); |
157 | mGeneral->initSecrecy( topFrame2, topLayout2 ); | 162 | mGeneral->initSecrecy( topFrame2, topLayout2 ); |
158 | mGeneral->initDescription(topFrame2,topLayout2); | 163 | mGeneral->initDescription(topFrame2,topLayout2); |
159 | 164 | ||
160 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 165 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
161 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 166 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
162 | } else { | 167 | } else { |
163 | QFrame *topFrame = addPage(i18n("General")); | 168 | Q3Frame *topFrame = addPage(i18n("General")); |
164 | 169 | ||
165 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 170 | Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); |
166 | topLayout->setSpacing(spacingHint()); | 171 | topLayout->setSpacing(spacingHint()); |
167 | 172 | ||
168 | mGeneral->initHeader(topFrame,topLayout); | 173 | mGeneral->initHeader(topFrame,topLayout); |
169 | mGeneral->initTime(topFrame,topLayout); | 174 | mGeneral->initTime(topFrame,topLayout); |
170 | QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); | 175 | Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout); |
171 | mGeneral->initAlarm(topFrame,alarmLineLayout); | 176 | mGeneral->initAlarm(topFrame,alarmLineLayout); |
172 | mGeneral->initClass(topFrame,alarmLineLayout); | 177 | mGeneral->initClass(topFrame,alarmLineLayout); |
173 | mGeneral->initDescription(topFrame,topLayout); | 178 | mGeneral->initDescription(topFrame,topLayout); |
174 | QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); | 179 | Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout); |
175 | mGeneral->initCategories( topFrame, detailsLayout ); | 180 | mGeneral->initCategories( topFrame, detailsLayout ); |
176 | mGeneral->initSecrecy( topFrame, detailsLayout ); | 181 | mGeneral->initSecrecy( topFrame, detailsLayout ); |
177 | } | 182 | } |
178 | 183 | ||
179 | mGeneral->finishSetup(); | 184 | mGeneral->finishSetup(); |
180 | 185 | ||
181 | } | 186 | } |
182 | 187 | ||
183 | void KOEventEditor::setupRecurrence() | 188 | void KOEventEditor::setupRecurrence() |
184 | { | 189 | { |
185 | QFrame *topFrame = addPage( i18n("Recurrence") ); | 190 | Q3Frame *topFrame = addPage( i18n("Recurrence") ); |
186 | QBoxLayout *topLayout = new QVBoxLayout( topFrame ); | 191 | Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); |
187 | 192 | ||
188 | mRecurrence = new KOEditorRecurrence( topFrame ); | 193 | mRecurrence = new KOEditorRecurrence( topFrame ); |
189 | topLayout->addWidget( mRecurrence ); | 194 | topLayout->addWidget( mRecurrence ); |
190 | } | 195 | } |
191 | 196 | ||
192 | void KOEventEditor::editEvent(Event *event, bool showDescription) | 197 | void KOEventEditor::editEvent(Event *event, bool showDescription) |
@@ -353,13 +358,13 @@ void KOEventEditor::slotLoadTemplate() | |||
353 | ICalFormat format; | 358 | ICalFormat format; |
354 | if ( !format.load( &cal, fileName ) ) { | 359 | if ( !format.load( &cal, fileName ) ) { |
355 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 360 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
356 | .arg( fileName ) ); | 361 | .arg( fileName ) ); |
357 | return ; | 362 | return ; |
358 | } | 363 | } |
359 | QPtrList<Event> events = cal.events(); | 364 | Q3PtrList<Event> events = cal.events(); |
360 | Event* event = events.first(); | 365 | Event* event = events.first(); |
361 | if ( !event ) { | 366 | if ( !event ) { |
362 | KMessageBox::error( this, | 367 | KMessageBox::error( this, |
363 | i18n("Template does not contain\na valid Event.")); | 368 | i18n("Template does not contain\na valid Event.")); |
364 | } else { | 369 | } else { |
365 | kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; | 370 | kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; |
diff --git a/korganizer/koeventpopupmenu.cpp b/korganizer/koeventpopupmenu.cpp index fc4d9a4..81047c1 100644 --- a/korganizer/koeventpopupmenu.cpp +++ b/korganizer/koeventpopupmenu.cpp | |||
@@ -19,23 +19,26 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qcursor.h> | 24 | #include <qcursor.h> |
25 | //Added by qt3to4: | ||
26 | #include <Q3ValueList> | ||
27 | #include <Q3PopupMenu> | ||
25 | 28 | ||
26 | #include <klocale.h> | 29 | #include <klocale.h> |
27 | #include <kdebug.h> | 30 | #include <kdebug.h> |
28 | #include <kiconloader.h> | 31 | #include <kiconloader.h> |
29 | 32 | ||
30 | #include <libkcal/event.h> | 33 | #include <libkcal/event.h> |
31 | 34 | ||
32 | #include "koeventpopupmenu.h" | 35 | #include "koeventpopupmenu.h" |
33 | #include "koprefs.h" | 36 | #include "koprefs.h" |
34 | 37 | ||
35 | KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() | 38 | KOEventPopupMenu::KOEventPopupMenu(): Q3PopupMenu() |
36 | { | 39 | { |
37 | mCurrentIncidence = 0; | 40 | mCurrentIncidence = 0; |
38 | mHasAdditionalItems = false; | 41 | mHasAdditionalItems = false; |
39 | 42 | ||
40 | 43 | ||
41 | mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow()))); | 44 | mSingleOnlyItems.append( insertItem (i18n("&Show"),this,SLOT(popupShow()))); |
@@ -50,34 +53,34 @@ KOEventPopupMenu::KOEventPopupMenu(): QPopupMenu() | |||
50 | mEditOnlyItems.append(insertItem (i18n("&Beam..."), | 53 | mEditOnlyItems.append(insertItem (i18n("&Beam..."), |
51 | this,SLOT(popupBeam()))); | 54 | this,SLOT(popupBeam()))); |
52 | #endif | 55 | #endif |
53 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), | 56 | mEditOnlyItems.append(insertItem (i18n("&Toggle Cancel"), |
54 | this,SLOT(popupCancel()))); | 57 | this,SLOT(popupCancel()))); |
55 | isDisabled = false; | 58 | isDisabled = false; |
56 | mCatPopup = new QPopupMenu ( this ); | 59 | mCatPopup = new Q3PopupMenu ( this ); |
57 | mCatPopup->setCheckable (true); | 60 | mCatPopup->setCheckable (true); |
58 | connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); | 61 | connect(mCatPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCatPopup())); |
59 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); | 62 | connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCatPopup( int ))); |
60 | mCalPopup = new QPopupMenu ( this ); | 63 | mCalPopup = new Q3PopupMenu ( this ); |
61 | mCalPopup->setCheckable (true); | 64 | mCalPopup->setCheckable (true); |
62 | connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); | 65 | connect(mCalPopup,SIGNAL( aboutToShow ()), this ,SLOT( fillCalPopup())); |
63 | connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); | 66 | connect(mCalPopup,SIGNAL( activated ( int ) ), this ,SLOT( computeCalPopup( int ))); |
64 | //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); | 67 | //mEditOnlyItems.append(insertItem (i18n("Categories"),mCatPopup )); |
65 | //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); | 68 | //mEditOnlyItems.append(insertItem (i18n("Calendar"),mCalPopup )); |
66 | insertItem (i18n("Categories"),mCatPopup ); | 69 | insertItem (i18n("Categories"),mCatPopup ); |
67 | insertItem (i18n("Calendar"),mCalPopup ); | 70 | insertItem (i18n("Calendar"),mCalPopup ); |
68 | QValueList<int>::Iterator it; | 71 | Q3ValueList<int>::Iterator it; |
69 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | 72 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { |
70 | mSingleOnlyItems.append(*it); | 73 | mSingleOnlyItems.append(*it); |
71 | } | 74 | } |
72 | 75 | ||
73 | } | 76 | } |
74 | void KOEventPopupMenu::enableDefault( bool enable ) | 77 | void KOEventPopupMenu::enableDefault( bool enable ) |
75 | { | 78 | { |
76 | isDisabled = !enable; | 79 | isDisabled = !enable; |
77 | QValueList<int>::Iterator it; | 80 | Q3ValueList<int>::Iterator it; |
78 | for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) { | 81 | for( it = mSingleOnlyItems.begin(); it != mSingleOnlyItems.end(); ++it ) { |
79 | setItemEnabled(*it,enable); | 82 | setItemEnabled(*it,enable); |
80 | } | 83 | } |
81 | } | 84 | } |
82 | 85 | ||
83 | void KOEventPopupMenu::fillCalPopup() // CAL | 86 | void KOEventPopupMenu::fillCalPopup() // CAL |
@@ -143,22 +146,22 @@ void KOEventPopupMenu::showIncidencePopup(Incidence *incidence) | |||
143 | if ( !incidence) return; | 146 | if ( !incidence) return; |
144 | mCurrentIncidence = incidence; | 147 | mCurrentIncidence = incidence; |
145 | 148 | ||
146 | if (mCurrentIncidence) { | 149 | if (mCurrentIncidence) { |
147 | // Enable/Disabled menu items only valid for editable events. | 150 | // Enable/Disabled menu items only valid for editable events. |
148 | if ( !isDisabled ) { | 151 | if ( !isDisabled ) { |
149 | QValueList<int>::Iterator it; | 152 | Q3ValueList<int>::Iterator it; |
150 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { | 153 | for( it = mEditOnlyItems.begin(); it != mEditOnlyItems.end(); ++it ) { |
151 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); | 154 | setItemEnabled(*it,!mCurrentIncidence->isReadOnly()); |
152 | } | 155 | } |
153 | } | 156 | } |
154 | popup(QCursor::pos()); | 157 | popup(QCursor::pos()); |
155 | } | 158 | } |
156 | } | 159 | } |
157 | 160 | ||
158 | void KOEventPopupMenu::addAdditionalItem(const QIconSet &icon,const QString &text, | 161 | void KOEventPopupMenu::addAdditionalItem(const QIcon &icon,const QString &text, |
159 | const QObject *receiver, const char *member, | 162 | const QObject *receiver, const char *member, |
160 | bool editOnly) | 163 | bool editOnly) |
161 | { | 164 | { |
162 | if (!mHasAdditionalItems) { | 165 | if (!mHasAdditionalItems) { |
163 | mHasAdditionalItems = true; | 166 | mHasAdditionalItems = true; |
164 | insertSeparator(); | 167 | insertSeparator(); |
diff --git a/korganizer/koeventpopupmenu.h b/korganizer/koeventpopupmenu.h index e28745b..de5220b 100644 --- a/korganizer/koeventpopupmenu.h +++ b/korganizer/koeventpopupmenu.h | |||
@@ -23,24 +23,26 @@ | |||
23 | #ifndef KOEVENTPOPUPMENU_H | 23 | #ifndef KOEVENTPOPUPMENU_H |
24 | #define KOEVENTPOPUPMENU_H | 24 | #define KOEVENTPOPUPMENU_H |
25 | // | 25 | // |
26 | // Context menu for event views with standard event actions | 26 | // Context menu for event views with standard event actions |
27 | // | 27 | // |
28 | 28 | ||
29 | #include <qpopupmenu.h> | 29 | #include <q3popupmenu.h> |
30 | //Added by qt3to4: | ||
31 | #include <Q3ValueList> | ||
30 | 32 | ||
31 | #include <libkcal/incidence.h> | 33 | #include <libkcal/incidence.h> |
32 | 34 | ||
33 | using namespace KCal; | 35 | using namespace KCal; |
34 | 36 | ||
35 | class KOEventPopupMenu : public QPopupMenu { | 37 | class KOEventPopupMenu : public Q3PopupMenu { |
36 | Q_OBJECT | 38 | Q_OBJECT |
37 | public: | 39 | public: |
38 | KOEventPopupMenu(); | 40 | KOEventPopupMenu(); |
39 | 41 | ||
40 | void addAdditionalItem(const QIconSet &icon,const QString &text, | 42 | void addAdditionalItem(const QIcon &icon,const QString &text, |
41 | const QObject *receiver, const char *member, | 43 | const QObject *receiver, const char *member, |
42 | bool editOnly=false); | 44 | bool editOnly=false); |
43 | 45 | ||
44 | 46 | ||
45 | public slots: | 47 | public slots: |
46 | void showIncidencePopup(Incidence *); | 48 | void showIncidencePopup(Incidence *); |
@@ -70,14 +72,14 @@ class KOEventPopupMenu : public QPopupMenu { | |||
70 | void categoryChanged( Incidence * ); | 72 | void categoryChanged( Incidence * ); |
71 | 73 | ||
72 | private: | 74 | private: |
73 | Incidence *mCurrentIncidence; | 75 | Incidence *mCurrentIncidence; |
74 | 76 | ||
75 | bool mHasAdditionalItems; | 77 | bool mHasAdditionalItems; |
76 | QValueList<int> mEditOnlyItems; | 78 | Q3ValueList<int> mEditOnlyItems; |
77 | QValueList<int> mSingleOnlyItems; | 79 | Q3ValueList<int> mSingleOnlyItems; |
78 | bool isDisabled; | 80 | bool isDisabled; |
79 | QPopupMenu *mCatPopup; | 81 | Q3PopupMenu *mCatPopup; |
80 | QPopupMenu *mCalPopup; | 82 | Q3PopupMenu *mCalPopup; |
81 | }; | 83 | }; |
82 | 84 | ||
83 | #endif | 85 | #endif |
diff --git a/korganizer/koeventview.cpp b/korganizer/koeventview.cpp index 1d26930..a4ba85e 100644 --- a/korganizer/koeventview.cpp +++ b/korganizer/koeventview.cpp | |||
@@ -18,13 +18,13 @@ | |||
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qpopupmenu.h> | 24 | #include <q3popupmenu.h> |
25 | #include <qcursor.h> | 25 | #include <qcursor.h> |
26 | 26 | ||
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | #include <kiconloader.h> | 29 | #include <kiconloader.h> |
30 | #include <kmessagebox.h> | 30 | #include <kmessagebox.h> |
@@ -70,13 +70,13 @@ KOEventPopupMenu *KOEventView::eventPopup() | |||
70 | 70 | ||
71 | return eventPopup; | 71 | return eventPopup; |
72 | } | 72 | } |
73 | 73 | ||
74 | //--------------------------------------------------------------------------- | 74 | //--------------------------------------------------------------------------- |
75 | 75 | ||
76 | void KOEventView::showIncidencePopup(QPopupMenu *popup,Incidence *event) | 76 | void KOEventView::showIncidencePopup(Q3PopupMenu *popup,Incidence *event) |
77 | { | 77 | { |
78 | mCurrentIncidence = event; | 78 | mCurrentIncidence = event; |
79 | if (event) popup->popup(QCursor::pos()); | 79 | if (event) popup->popup(QCursor::pos()); |
80 | } | 80 | } |
81 | 81 | ||
82 | //--------------------------------------------------------------------------- | 82 | //--------------------------------------------------------------------------- |
diff --git a/korganizer/koeventview.h b/korganizer/koeventview.h index 77ec111..f28e68b 100644 --- a/korganizer/koeventview.h +++ b/korganizer/koeventview.h | |||
@@ -27,12 +27,14 @@ | |||
27 | #include <libkcal/calendar.h> | 27 | #include <libkcal/calendar.h> |
28 | #include <libkcal/event.h> | 28 | #include <libkcal/event.h> |
29 | 29 | ||
30 | #include <korganizer/baseview.h> | 30 | #include <korganizer/baseview.h> |
31 | 31 | ||
32 | #include "koeventpopupmenu.h" | 32 | #include "koeventpopupmenu.h" |
33 | //Added by qt3to4: | ||
34 | #include <Q3PopupMenu> | ||
33 | 35 | ||
34 | using namespace KCal; | 36 | using namespace KCal; |
35 | 37 | ||
36 | class CalPrinter; | 38 | class CalPrinter; |
37 | 39 | ||
38 | /** | 40 | /** |
@@ -84,13 +86,13 @@ class KOEventView : public KOrg::BaseView | |||
84 | 86 | ||
85 | /** | 87 | /** |
86 | * Show context menu for event. | 88 | * Show context menu for event. |
87 | * @param event event, which is to be manipulated by the menu actions | 89 | * @param event event, which is to be manipulated by the menu actions |
88 | * @param popup a popop menu created with eventPopup() | 90 | * @param popup a popop menu created with eventPopup() |
89 | */ | 91 | */ |
90 | void showIncidencePopup(QPopupMenu *popup, Incidence *event); | 92 | void showIncidencePopup(Q3PopupMenu *popup, Incidence *event); |
91 | 93 | ||
92 | /** | 94 | /** |
93 | Perform the default action for an incidence, e.g. open the event editor, | 95 | Perform the default action for an incidence, e.g. open the event editor, |
94 | when double-clicking an event in the agenda view. | 96 | when double-clicking an event in the agenda view. |
95 | */ | 97 | */ |
96 | void defaultAction( Incidence * ); | 98 | void defaultAction( Incidence * ); |
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index c0acf34..4df26a9 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -14,18 +14,23 @@ | |||
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qcstring.h> | 20 | #include <q3cstring.h> |
21 | #include <qwhatsthis.h> | 21 | #include <q3whatsthis.h> |
22 | #include <qdialog.h> | 22 | #include <qdialog.h> |
23 | #include <qapplication.h> | 23 | #include <qapplication.h> |
24 | #include <QDesktopWidget> | ||
24 | #include <qlabel.h> | 25 | #include <qlabel.h> |
25 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | //Added by qt3to4: | ||
28 | #include <QKeyEvent> | ||
29 | #include <Q3PtrList> | ||
30 | #include <Q3VBoxLayout> | ||
26 | 31 | ||
27 | #include <klocale.h> | 32 | #include <klocale.h> |
28 | #include <kapplication.h> | 33 | #include <kapplication.h> |
29 | #include <libkcal/event.h> | 34 | #include <libkcal/event.h> |
30 | #include <libkcal/todo.h> | 35 | #include <libkcal/todo.h> |
31 | #include <kdebug.h> | 36 | #include <kdebug.h> |
@@ -52,20 +57,20 @@ | |||
52 | 57 | ||
53 | #ifdef DESKTOP_VERSION | 58 | #ifdef DESKTOP_VERSION |
54 | #include <kabc/addresseedialog.h> | 59 | #include <kabc/addresseedialog.h> |
55 | #include <kabc/addresseeview.h> | 60 | #include <kabc/addresseeview.h> |
56 | #include <qprinter.h> | 61 | #include <qprinter.h> |
57 | #include <qpainter.h> | 62 | #include <qpainter.h> |
58 | #include <qpaintdevicemetrics.h> | 63 | #include <q3paintdevicemetrics.h> |
59 | #else //DESKTOP_VERSION | 64 | #else //DESKTOP_VERSION |
60 | #include <qtopia/qcopenvelope_qws.h> | 65 | #include <qtopia/qcopenvelope_qws.h> |
61 | #endif //DESKTOP_VERSION | 66 | #endif //DESKTOP_VERSION |
62 | #include <externalapphandler.h> | 67 | #include <externalapphandler.h> |
63 | 68 | ||
64 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) | 69 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) |
65 | : QTextBrowser(parent,name) | 70 | : Q3TextBrowser(parent,name) |
66 | { | 71 | { |
67 | mSyncMode = false; | 72 | mSyncMode = false; |
68 | mColorMode = 0; | 73 | mColorMode = 0; |
69 | } | 74 | } |
70 | 75 | ||
71 | KOEventViewer::~KOEventViewer() | 76 | KOEventViewer::~KOEventViewer() |
@@ -83,13 +88,13 @@ void KOEventViewer::printMe() | |||
83 | 88 | ||
84 | QPrinter printer; | 89 | QPrinter printer; |
85 | if (!printer.setup() ) | 90 | if (!printer.setup() ) |
86 | return; | 91 | return; |
87 | QPainter p; | 92 | QPainter p; |
88 | p.begin ( &printer ); | 93 | p.begin ( &printer ); |
89 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | 94 | Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); |
90 | float dx, dy; | 95 | float dx, dy; |
91 | int wid = (m.width() * 9)/10; | 96 | int wid = (m.width() * 9)/10; |
92 | dx = (float) wid/(float)contentsWidth (); | 97 | dx = (float) wid/(float)contentsWidth (); |
93 | dy = (float)(m.height()) / (float)contentsHeight (); | 98 | dy = (float)(m.height()) / (float)contentsHeight (); |
94 | float scale; | 99 | float scale; |
95 | // scale to fit the width or height of the paper | 100 | // scale to fit the width or height of the paper |
@@ -131,13 +136,13 @@ void KOEventViewer::setSource(const QString& n) | |||
131 | 136 | ||
132 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); | 137 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); |
133 | if (n == uid ) { | 138 | if (n == uid ) { |
134 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); | 139 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); |
135 | QDialog dia( this,"dia123", true ); | 140 | QDialog dia( this,"dia123", true ); |
136 | dia.setCaption( i18n("Details of attendee") ); | 141 | dia.setCaption( i18n("Details of attendee") ); |
137 | QVBoxLayout lay ( &dia ); | 142 | Q3VBoxLayout lay ( &dia ); |
138 | KABC::AddresseeView av ( &dia ); | 143 | KABC::AddresseeView av ( &dia ); |
139 | av.setAddressee( (*it) ); | 144 | av.setAddressee( (*it) ); |
140 | lay.addWidget( &av ); | 145 | lay.addWidget( &av ); |
141 | if ( QApplication::desktop()->width() < 480 ) | 146 | if ( QApplication::desktop()->width() < 480 ) |
142 | dia.resize( 220, 240); | 147 | dia.resize( 220, 240); |
143 | else { | 148 | else { |
@@ -152,13 +157,13 @@ void KOEventViewer::setSource(const QString& n) | |||
152 | #else | 157 | #else |
153 | { | 158 | { |
154 | if ( "uid:organizer" == n ) { | 159 | if ( "uid:organizer" == n ) { |
155 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); | 160 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); |
156 | return; | 161 | return; |
157 | } | 162 | } |
158 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | 163 | Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees(); |
159 | if (attendees.count()) { | 164 | if (attendees.count()) { |
160 | Attendee *a; | 165 | Attendee *a; |
161 | for(a=attendees.first();a;a=attendees.next()) { | 166 | for(a=attendees.first();a;a=attendees.next()) { |
162 | if ( "uid:"+a->uid() == n ) { | 167 | if ( "uid:"+a->uid() == n ) { |
163 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); | 168 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); |
164 | return; | 169 | return; |
@@ -197,20 +202,20 @@ void KOEventViewer::setSource(const QString& n) | |||
197 | return; | 202 | return; |
198 | } else if (n.startsWith("uid:")) { | 203 | } else if (n.startsWith("uid:")) { |
199 | DCOPClient *client = KApplication::kApplication()->dcopClient(); | 204 | DCOPClient *client = KApplication::kApplication()->dcopClient(); |
200 | const QByteArray noParamData; | 205 | const QByteArray noParamData; |
201 | const QByteArray paramData; | 206 | const QByteArray paramData; |
202 | QByteArray replyData; | 207 | QByteArray replyData; |
203 | QCString replyTypeStr; | 208 | Q3CString replyTypeStr; |
204 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) | 209 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) |
205 | bool foundAbbrowser = PING_ABBROWSER; | 210 | bool foundAbbrowser = PING_ABBROWSER; |
206 | 211 | ||
207 | if (foundAbbrowser) { | 212 | if (foundAbbrowser) { |
208 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor | 213 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor |
209 | //client->send("kaddressbook","KAddressBookIface", | 214 | //client->send("kaddressbook","KAddressBookIface", |
210 | QDataStream arg(paramData, IO_WriteOnly); | 215 | QDataStream arg(paramData, QIODevice::WriteOnly); |
211 | arg << n.mid(6); | 216 | arg << n.mid(6); |
212 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); | 217 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); |
213 | return; | 218 | return; |
214 | } else { | 219 | } else { |
215 | /* | 220 | /* |
216 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. | 221 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. |
@@ -228,13 +233,13 @@ void KOEventViewer::setSource(const QString& n) | |||
228 | //QTextBrowser::setSource(n); | 233 | //QTextBrowser::setSource(n); |
229 | } | 234 | } |
230 | #endif | 235 | #endif |
231 | } | 236 | } |
232 | void KOEventViewer::mailToAttendees( bool all ) | 237 | void KOEventViewer::mailToAttendees( bool all ) |
233 | { | 238 | { |
234 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | 239 | Q3PtrList<Attendee> attendees = mCurrentIncidence->attendees(); |
235 | if (attendees.count() == 0) return; | 240 | if (attendees.count() == 0) return; |
236 | QStringList nameList; | 241 | QStringList nameList; |
237 | QStringList emailList; | 242 | QStringList emailList; |
238 | QStringList uidList; | 243 | QStringList uidList; |
239 | Attendee* a; | 244 | Attendee* a; |
240 | for(a=attendees.first();a;a=attendees.next()) { | 245 | for(a=attendees.first();a;a=attendees.next()) { |
@@ -257,13 +262,13 @@ void KOEventViewer::mailToAttendees( bool all ) | |||
257 | ExternalAppHandler::instance()->mailToMultipleContacts( emailList.join(","), mMailSubject ); | 262 | ExternalAppHandler::instance()->mailToMultipleContacts( emailList.join(","), mMailSubject ); |
258 | #endif | 263 | #endif |
259 | 264 | ||
260 | } | 265 | } |
261 | void KOEventViewer::addTag(const QString & tag,const QString & text) | 266 | void KOEventViewer::addTag(const QString & tag,const QString & text) |
262 | { | 267 | { |
263 | int number=text.contains("\n"); | 268 | int number=text.count("\n"); |
264 | QString str = "<" + tag + ">"; | 269 | QString str = "<" + tag + ">"; |
265 | QString tmpText=text; | 270 | QString tmpText=text; |
266 | QString tmpStr=str; | 271 | QString tmpStr=str; |
267 | if(number !=-1) | 272 | if(number !=-1) |
268 | { | 273 | { |
269 | if (number > 0) { | 274 | if (number > 0) { |
@@ -584,13 +589,13 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) | |||
584 | mText += "<a href=\"todo_uid:" + event->relatedTo()->uid() + "\">"; | 589 | mText += "<a href=\"todo_uid:" + event->relatedTo()->uid() + "\">"; |
585 | mText += deTag(event->relatedTo()->summary()); | 590 | mText += deTag(event->relatedTo()->summary()); |
586 | mText += "</a><br>"; | 591 | mText += "</a><br>"; |
587 | 592 | ||
588 | // mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>"); | 593 | // mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>"); |
589 | } | 594 | } |
590 | QPtrList<Incidence> Relations = event->relations(); | 595 | Q3PtrList<Incidence> Relations = event->relations(); |
591 | Incidence *to; | 596 | Incidence *to; |
592 | if ( Relations.first() ) | 597 | if ( Relations.first() ) |
593 | addTag("b",i18n("Sub todos:<br>")); | 598 | addTag("b",i18n("Sub todos:<br>")); |
594 | for (to=Relations.first();to;to=Relations.next()) { | 599 | for (to=Relations.first();to;to=Relations.next()) { |
595 | QString t_name = "[" +QString::number(((Todo*)to)->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%] ";// +to->relatedTo()->summary()); | 600 | QString t_name = "[" +QString::number(((Todo*)to)->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%] ";// +to->relatedTo()->summary()); |
596 | mText += t_name; | 601 | mText += t_name; |
@@ -618,13 +623,13 @@ void KOEventViewer::formatCategories(Incidence *event) | |||
618 | addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ; | 623 | addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ; |
619 | } | 624 | } |
620 | } | 625 | } |
621 | } | 626 | } |
622 | void KOEventViewer::formatAttendees(Incidence *event) | 627 | void KOEventViewer::formatAttendees(Incidence *event) |
623 | { | 628 | { |
624 | QPtrList<Attendee> attendees = event->attendees(); | 629 | Q3PtrList<Attendee> attendees = event->attendees(); |
625 | if (attendees.count()) { | 630 | if (attendees.count()) { |
626 | 631 | ||
627 | 632 | ||
628 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 633 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
629 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); | 634 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); |
630 | addTag("h3",i18n("Organizer")); | 635 | addTag("h3",i18n("Organizer")); |
@@ -651,13 +656,13 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
651 | 656 | ||
652 | 657 | ||
653 | #else | 658 | #else |
654 | mText.append(event->organizer()); | 659 | mText.append(event->organizer()); |
655 | #endif | 660 | #endif |
656 | 661 | ||
657 | if (iconPath) { | 662 | if (!iconPath.isEmpty()) { |
658 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; | 663 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; |
659 | mText += "<IMG src=\"" + iconPath + "\">"; | 664 | mText += "<IMG src=\"" + iconPath + "\">"; |
660 | mText += "</a>\n"; | 665 | mText += "</a>\n"; |
661 | } | 666 | } |
662 | mText.append("</li></ul>"); | 667 | mText.append("</li></ul>"); |
663 | 668 | ||
@@ -701,13 +706,13 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
701 | else mText += a->email(); | 706 | else mText += a->email(); |
702 | mText += "</a>\n"; | 707 | mText += "</a>\n"; |
703 | #endif | 708 | #endif |
704 | 709 | ||
705 | 710 | ||
706 | if (!a->email().isEmpty()) { | 711 | if (!a->email().isEmpty()) { |
707 | if (iconPath) { | 712 | if (!iconPath.isEmpty()) { |
708 | mText += "<a href=\"mailto:" + a->realName() +" <" + a->email() + ">:" + mMailSubject + "\">"; | 713 | mText += "<a href=\"mailto:" + a->realName() +" <" + a->email() + ">:" + mMailSubject + "\">"; |
709 | if ( a->RSVP() ) { | 714 | if ( a->RSVP() ) { |
710 | ++a_count_nr; | 715 | ++a_count_nr; |
711 | mText += "<IMG src=\"" + iconPath + "\">"; | 716 | mText += "<IMG src=\"" + iconPath + "\">"; |
712 | } | 717 | } |
713 | else { | 718 | else { |
@@ -859,10 +864,10 @@ void KOEventViewer::keyPressEvent ( QKeyEvent * e ) | |||
859 | switch ( e->key() ) { | 864 | switch ( e->key() ) { |
860 | case Qt::Key_Return: | 865 | case Qt::Key_Return: |
861 | case Qt::Key_Enter : | 866 | case Qt::Key_Enter : |
862 | e->ignore(); | 867 | e->ignore(); |
863 | break; | 868 | break; |
864 | default: | 869 | default: |
865 | QTextBrowser::keyPressEvent ( e ); | 870 | Q3TextBrowser::keyPressEvent ( e ); |
866 | break; | 871 | break; |
867 | } | 872 | } |
868 | } | 873 | } |
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 64eb4ff..3df667f 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h | |||
@@ -19,13 +19,16 @@ | |||
19 | #ifndef KOEVENTVIEWER_H | 19 | #ifndef KOEVENTVIEWER_H |
20 | #define KOEVENTVIEWER_H | 20 | #define KOEVENTVIEWER_H |
21 | // | 21 | // |
22 | // Viewer widget for events. | 22 | // Viewer widget for events. |
23 | // | 23 | // |
24 | 24 | ||
25 | #include <qtextbrowser.h> | 25 | #include <q3textbrowser.h> |
26 | //Added by qt3to4: | ||
27 | #include <Q3VBoxLayout> | ||
28 | #include <QKeyEvent> | ||
26 | 29 | ||
27 | #include <libkcal/event.h> | 30 | #include <libkcal/event.h> |
28 | #include <libkcal/journal.h> | 31 | #include <libkcal/journal.h> |
29 | 32 | ||
30 | 33 | ||
31 | using namespace KCal; | 34 | using namespace KCal; |
@@ -34,29 +37,29 @@ using namespace KCal; | |||
34 | 37 | ||
35 | #include <qradiobutton.h> | 38 | #include <qradiobutton.h> |
36 | #include <qpushbutton.h> | 39 | #include <qpushbutton.h> |
37 | #include <qlayout.h> | 40 | #include <qlayout.h> |
38 | #include <qdialog.h> | 41 | #include <qdialog.h> |
39 | #include <qlabel.h> | 42 | #include <qlabel.h> |
40 | #include <qbuttongroup.h> | 43 | #include <q3buttongroup.h> |
41 | #include <kglobal.h> | 44 | #include <kglobal.h> |
42 | 45 | ||
43 | class KOPrintPrefs : public QDialog | 46 | class KOPrintPrefs : public QDialog |
44 | { | 47 | { |
45 | public: | 48 | public: |
46 | KOPrintPrefs( QWidget *parent=0, const char *name=0 ) : | 49 | KOPrintPrefs( QWidget *parent=0, const char *name=0 ) : |
47 | QDialog( parent, name, true ) | 50 | QDialog( parent, name, true ) |
48 | { | 51 | { |
49 | setCaption( i18n("KO/Pi Printout") ); | 52 | setCaption( i18n("KO/Pi Printout") ); |
50 | QVBoxLayout* lay = new QVBoxLayout( this ); | 53 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
51 | lay->setSpacing( 9 ); | 54 | lay->setSpacing( 9 ); |
52 | lay->setMargin( 9 ); | 55 | lay->setMargin( 9 ); |
53 | QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n"), this ); | 56 | QLabel * lab = new QLabel( i18n("This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n"), this ); |
54 | lay->addWidget( lab ); | 57 | lay->addWidget( lab ); |
55 | lab->setAlignment( AlignCenter ); | 58 | lab->setAlignment( Qt::AlignCenter ); |
56 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this ); | 59 | Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Printout Mode"), this ); |
57 | lay->addWidget( format ); | 60 | lay->addWidget( format ); |
58 | format->setExclusive ( true ) ; | 61 | format->setExclusive ( true ) ; |
59 | pmNo = new QRadioButton(i18n("Print unscaled"), format ); | 62 | pmNo = new QRadioButton(i18n("Print unscaled"), format ); |
60 | pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format ); | 63 | pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format ); |
61 | new QRadioButton(i18n("Print scaled up/down to fit one page"), format ); | 64 | new QRadioButton(i18n("Print scaled up/down to fit one page"), format ); |
62 | pmScaledDown->setChecked( true ); | 65 | pmScaledDown->setChecked( true ); |
@@ -80,13 +83,13 @@ private: | |||
80 | QRadioButton* pmNo; | 83 | QRadioButton* pmNo; |
81 | QRadioButton* pmScaledDown; | 84 | QRadioButton* pmScaledDown; |
82 | }; | 85 | }; |
83 | 86 | ||
84 | #endif | 87 | #endif |
85 | 88 | ||
86 | class KOEventViewer : public QTextBrowser { | 89 | class KOEventViewer : public Q3TextBrowser { |
87 | Q_OBJECT | 90 | Q_OBJECT |
88 | public: | 91 | public: |
89 | KOEventViewer(QWidget *parent=0,const char *name=0); | 92 | KOEventViewer(QWidget *parent=0,const char *name=0); |
90 | virtual ~KOEventViewer(); | 93 | virtual ~KOEventViewer(); |
91 | 94 | ||
92 | void setSource(const QString &); | 95 | void setSource(const QString &); |
@@ -114,13 +117,13 @@ class KOEventViewer : public QTextBrowser { | |||
114 | void formatCategories(Incidence *event); | 117 | void formatCategories(Incidence *event); |
115 | void formatAttendees(Incidence *event); | 118 | void formatAttendees(Incidence *event); |
116 | void formatReadOnly(Incidence *event); | 119 | void formatReadOnly(Incidence *event); |
117 | void keyPressEvent ( QKeyEvent * e ); | 120 | void keyPressEvent ( QKeyEvent * e ); |
118 | 121 | ||
119 | private: | 122 | private: |
120 | QTextBrowser *mEventTextView; | 123 | Q3TextBrowser *mEventTextView; |
121 | bool mSyncMode; | 124 | bool mSyncMode; |
122 | QString deTag(QString text); | 125 | QString deTag(QString text); |
123 | 126 | ||
124 | QString mText; | 127 | QString mText; |
125 | QString mMailSubject; | 128 | QString mMailSubject; |
126 | Incidence* mCurrentIncidence; | 129 | Incidence* mCurrentIncidence; |
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index 2e936f3..3a37852 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp | |||
@@ -19,18 +19,21 @@ | |||
19 | 19 | ||
20 | #include <klocale.h> | 20 | #include <klocale.h> |
21 | 21 | ||
22 | #include <libkcal/event.h> | 22 | #include <libkcal/event.h> |
23 | #include <qtimer.h> | 23 | #include <qtimer.h> |
24 | #include <qpushbutton.h> | 24 | #include <qpushbutton.h> |
25 | //Added by qt3to4: | ||
26 | #include <QHideEvent> | ||
27 | #include <QKeyEvent> | ||
25 | 28 | ||
26 | #include "koeventviewer.h" | 29 | #include "koeventviewer.h" |
27 | #include <kmessagebox.h> | 30 | #include <kmessagebox.h> |
28 | #include "koprefs.h" | 31 | #include "koprefs.h" |
29 | #include <libkcal/todo.h> | 32 | #include <libkcal/todo.h> |
30 | #include "qapp.h" | 33 | #include "qapplication.h" |
31 | 34 | ||
32 | #include "koeventviewerdialog.h" | 35 | #include "koeventviewerdialog.h" |
33 | extern int globalFlagBlockAgenda; | 36 | extern int globalFlagBlockAgenda; |
34 | 37 | ||
35 | KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) | 38 | KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) |
36 | : KDialogBase(parent,name, | 39 | : KDialogBase(parent,name, |
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h index 71696f4..947c10b 100644 --- a/korganizer/koeventviewerdialog.h +++ b/korganizer/koeventviewerdialog.h | |||
@@ -19,13 +19,16 @@ | |||
19 | #ifndef KOEVENTVIEWERDIALOG_H | 19 | #ifndef KOEVENTVIEWERDIALOG_H |
20 | #define KOEVENTVIEWERDIALOG_H | 20 | #define KOEVENTVIEWERDIALOG_H |
21 | // | 21 | // |
22 | // Viewer dialog for events. | 22 | // Viewer dialog for events. |
23 | // | 23 | // |
24 | 24 | ||
25 | #include <qtextview.h> | 25 | #include <q3textview.h> |
26 | //Added by qt3to4: | ||
27 | #include <QKeyEvent> | ||
28 | #include <QHideEvent> | ||
26 | 29 | ||
27 | #include <kdialogbase.h> | 30 | #include <kdialogbase.h> |
28 | 31 | ||
29 | #include <libkcal/event.h> | 32 | #include <libkcal/event.h> |
30 | 33 | ||
31 | using namespace KCal; | 34 | using namespace KCal; |
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index ee9c9f6..8335ba9 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -24,16 +24,20 @@ | |||
24 | #include <qcheckbox.h> | 24 | #include <qcheckbox.h> |
25 | #include <qcombobox.h> | 25 | #include <qcombobox.h> |
26 | #include <qpushbutton.h> | 26 | #include <qpushbutton.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qdialog.h> | 29 | #include <qdialog.h> |
30 | #include <qtextstream.h> | 30 | #include <q3textstream.h> |
31 | #include <qtextcodec.h> | 31 | #include <qtextcodec.h> |
32 | #include <qwhatsthis.h> | 32 | #include <q3whatsthis.h> |
33 | #include <qdir.h> | 33 | #include <qdir.h> |
34 | //Added by qt3to4: | ||
35 | #include <Q3GridLayout> | ||
36 | #include <Q3Frame> | ||
37 | #include <Q3PtrList> | ||
34 | 38 | ||
35 | 39 | ||
36 | #include <libkcal/calfilter.h> | 40 | #include <libkcal/calfilter.h> |
37 | 41 | ||
38 | #include "kofilterview.h" | 42 | #include "kofilterview.h" |
39 | #include "koprefs.h" | 43 | #include "koprefs.h" |
@@ -44,14 +48,14 @@ | |||
44 | #include <kmessagebox.h> | 48 | #include <kmessagebox.h> |
45 | 49 | ||
46 | 50 | ||
47 | 51 | ||
48 | 52 | ||
49 | 53 | ||
50 | KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent, | 54 | KOFilterView::KOFilterView(Q3PtrList<CalFilter> *filterList,QWidget* parent, |
51 | const char* name,WFlags fl ) | 55 | const char* name,Qt::WFlags fl ) |
52 | : KOFilterView_base(parent,name,fl) | 56 | : KOFilterView_base(parent,name,fl) |
53 | { | 57 | { |
54 | mFilters = filterList; | 58 | mFilters = filterList; |
55 | 59 | ||
56 | connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); | 60 | connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); |
57 | connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); | 61 | connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); |
@@ -111,20 +115,20 @@ void KOFilterView::setSelectedFilter( int fil ) | |||
111 | } | 115 | } |
112 | 116 | ||
113 | 117 | ||
114 | 118 | ||
115 | KOCalEditView::KOCalEditView(QWidget* parent, | 119 | KOCalEditView::KOCalEditView(QWidget* parent, |
116 | const char* name ) | 120 | const char* name ) |
117 | : QScrollView(parent,name) | 121 | : Q3ScrollView(parent,name) |
118 | { | 122 | { |
119 | mw = 0; | 123 | mw = 0; |
120 | setResizePolicy( AutoOneFit ); | 124 | setResizePolicy( AutoOneFit ); |
121 | setFrameStyle ( QFrame::Panel | QFrame::Plain ); | 125 | setFrameStyle ( Q3Frame::Panel | Q3Frame::Plain ); |
122 | setLineWidth ( 1 ); | 126 | setLineWidth ( 1 ); |
123 | setMidLineWidth ( 1 ); | 127 | setMidLineWidth ( 1 ); |
124 | setFocusPolicy(NoFocus); | 128 | setFocusPolicy(Qt::NoFocus); |
125 | } | 129 | } |
126 | 130 | ||
127 | KOCalEditView::~KOCalEditView() | 131 | KOCalEditView::~KOCalEditView() |
128 | { | 132 | { |
129 | // no need to delete child widgets, Qt does it all for us | 133 | // no need to delete child widgets, Qt does it all for us |
130 | } | 134 | } |
@@ -244,61 +248,61 @@ void KOCalEditView::readConfig() | |||
244 | mROB.clear(); | 248 | mROB.clear(); |
245 | 249 | ||
246 | if ( mw ) delete mw; | 250 | if ( mw ) delete mw; |
247 | mw = new QWidget ( viewport() ); | 251 | mw = new QWidget ( viewport() ); |
248 | addChild(mw); | 252 | addChild(mw); |
249 | int ii = 0; | 253 | int ii = 0; |
250 | mainLayout = new QGridLayout ( mw , 2, 8 ); | 254 | mainLayout = new Q3GridLayout ( mw , 2, 8 ); |
251 | mainLayout->setMargin( 2 ); | 255 | mainLayout->setMargin( 2 ); |
252 | mainLayout->setSpacing( 2 ); | 256 | mainLayout->setSpacing( 2 ); |
253 | QPushButton * addButT = new QPushButton ( mw ); | 257 | QPushButton * addButT = new QPushButton ( mw ); |
254 | addButT->setFocusPolicy(NoFocus); | 258 | addButT->setFocusPolicy(Qt::NoFocus); |
255 | mainLayout->addWidget( addButT,0,0 ); | 259 | mainLayout->addWidget( addButT,0,0 ); |
256 | addButT->setText( "D"); | 260 | addButT->setText( "D"); |
257 | connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); | 261 | connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); |
258 | QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); | 262 | Q3WhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); |
259 | //addBut->setPixmap ( SmallIcon("greenhook16")); | 263 | //addBut->setPixmap ( SmallIcon("greenhook16")); |
260 | QPushButton *addBut = new QPushButton ( mw ); | 264 | QPushButton *addBut = new QPushButton ( mw ); |
261 | addBut->setFocusPolicy(NoFocus); | 265 | addBut->setFocusPolicy(Qt::NoFocus); |
262 | mainLayout->addWidget( addBut,0,++ii ); | 266 | mainLayout->addWidget( addBut,0,++ii ); |
263 | addBut->setPixmap ( SmallIcon("eye")); | 267 | addBut->setPixmap ( SmallIcon("eye")); |
264 | QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") ); | 268 | Q3WhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") ); |
265 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); | 269 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); |
266 | int max = addBut->sizeHint().height(); | 270 | int max = addBut->sizeHint().height(); |
267 | addBut->setMaximumWidth( max ); | 271 | addBut->setMaximumWidth( max ); |
268 | addButT->setFixedSize( QSize( max, max ) ); | 272 | addButT->setFixedSize( QSize( max, max ) ); |
269 | QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); | 273 | QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); |
270 | mainLayout->addWidget( lab,0,++ii ); | 274 | mainLayout->addWidget( lab,0,++ii ); |
271 | QWhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") ); | 275 | Q3WhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") ); |
272 | //lab = new QLabel ( i18n(" "), mw ); | 276 | //lab = new QLabel ( i18n(" "), mw ); |
273 | //mainLayout->addWidget( lab,0,++ii ); | 277 | //mainLayout->addWidget( lab,0,++ii ); |
274 | //lab->setFixedWidth( 1 ); | 278 | //lab->setFixedWidth( 1 ); |
275 | addBut = new QPushButton ( mw ); | 279 | addBut = new QPushButton ( mw ); |
276 | addBut->setFocusPolicy(NoFocus); | 280 | addBut->setFocusPolicy(Qt::NoFocus); |
277 | mainLayout->addWidget( addBut,0,++ii ); | 281 | mainLayout->addWidget( addBut,0,++ii ); |
278 | addBut->setPixmap ( SmallIcon("bell")); | 282 | addBut->setPixmap ( SmallIcon("bell")); |
279 | QWhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") ); | 283 | Q3WhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") ); |
280 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); | 284 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); |
281 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 285 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
282 | 286 | ||
283 | addBut = new QPushButton ( mw ); | 287 | addBut = new QPushButton ( mw ); |
284 | addBut->setFocusPolicy(NoFocus); | 288 | addBut->setFocusPolicy(Qt::NoFocus); |
285 | mainLayout->addWidget( addBut,0,++ii ); | 289 | mainLayout->addWidget( addBut,0,++ii ); |
286 | addBut->setPixmap ( SmallIcon("pencil")); | 290 | addBut->setPixmap ( SmallIcon("pencil")); |
287 | QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.") ); | 291 | Q3WhatsThis::add( addBut, i18n("In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.") ); |
288 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); | 292 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); |
289 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 293 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
290 | lab = new QLabel ( "", mw ); | 294 | lab = new QLabel ( "", mw ); |
291 | mainLayout->addWidget( lab,0,++ii ); | 295 | mainLayout->addWidget( lab,0,++ii ); |
292 | 296 | ||
293 | addBut = new QPushButton ( mw ); | 297 | addBut = new QPushButton ( mw ); |
294 | addBut->setFocusPolicy(NoFocus); | 298 | addBut->setFocusPolicy(Qt::NoFocus); |
295 | mainLayout->addWidget( addBut,0,++ii ); | 299 | mainLayout->addWidget( addBut,0,++ii ); |
296 | addBut->setPixmap ( SmallIcon("plus")); | 300 | addBut->setPixmap ( SmallIcon("plus")); |
297 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); | 301 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); |
298 | QWhatsThis::add( addBut, i18n("Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.") ); | 302 | Q3WhatsThis::add( addBut, i18n("Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.") ); |
299 | lab = new QLabel ( " ", mw ); | 303 | lab = new QLabel ( " ", mw ); |
300 | mainLayout->addWidget( lab,0,++ii ); | 304 | mainLayout->addWidget( lab,0,++ii ); |
301 | 305 | ||
302 | 306 | ||
303 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 307 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
304 | int row = 1; | 308 | int row = 1; |
@@ -428,17 +432,17 @@ int KOCalEditView::addCalendar( QString name, QString file, bool ask ) | |||
428 | } | 432 | } |
429 | if (!fi.exists() ) { | 433 | if (!fi.exists() ) { |
430 | if ( ask ) | 434 | if ( ask ) |
431 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( KGlobal::formatMessage (absFile,0) ) )== KMessageBox::No ) | 435 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( KGlobal::formatMessage (absFile,0) ) )== KMessageBox::No ) |
432 | return 0; | 436 | return 0; |
433 | QFile fileIn( absFile ); | 437 | QFile fileIn( absFile ); |
434 | if (!fileIn.open( IO_WriteOnly ) ) { | 438 | if (!fileIn.open( QIODevice::WriteOnly ) ) { |
435 | KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); | 439 | KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); |
436 | return 0; | 440 | return 0; |
437 | } | 441 | } |
438 | QTextStream tsIn( &fileIn ); | 442 | Q3TextStream tsIn( &fileIn ); |
439 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 443 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
440 | tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n"; | 444 | tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n"; |
441 | fileIn.close(); | 445 | fileIn.close(); |
442 | } | 446 | } |
443 | KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); | 447 | KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); |
444 | kkf->mName = name; | 448 | kkf->mName = name; |
@@ -472,13 +476,13 @@ void KOCalEditView::enableAlarm() | |||
472 | toggleList( mAlarmB ); | 476 | toggleList( mAlarmB ); |
473 | } | 477 | } |
474 | void KOCalEditView::disableRO() | 478 | void KOCalEditView::disableRO() |
475 | { | 479 | { |
476 | toggleList( mROB, false ); | 480 | toggleList( mROB, false ); |
477 | } | 481 | } |
478 | void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list , bool enable ) | 482 | void KOCalEditView::toggleList ( Q3PtrList<KOCalCheckButton> list , bool enable ) |
479 | { | 483 | { |
480 | bool dis = !enable; | 484 | bool dis = !enable; |
481 | KOCalCheckButton* it = list.first(); | 485 | KOCalCheckButton* it = list.first(); |
482 | while ( it ) { | 486 | while ( it ) { |
483 | if ( !it->isChecked() == enable && it->isEnabled() ) { | 487 | if ( !it->isChecked() == enable && it->isEnabled() ) { |
484 | dis = !dis; | 488 | dis = !dis; |
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 0dd423a..f1bbab4 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -23,41 +23,47 @@ | |||
23 | #ifndef KOFILTERVIEW_H | 23 | #ifndef KOFILTERVIEW_H |
24 | #define KOFILTERVIEW_H | 24 | #define KOFILTERVIEW_H |
25 | 25 | ||
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qcheckbox.h> | 27 | #include <qcheckbox.h> |
28 | #include <qapplication.h> | 28 | #include <qapplication.h> |
29 | #include <QDesktopWidget> | ||
29 | #include <qradiobutton.h> | 30 | #include <qradiobutton.h> |
30 | #include <qlayout.h> | 31 | #include <qlayout.h> |
31 | #include <qlabel.h> | 32 | #include <qlabel.h> |
32 | #include <qdialog.h> | 33 | #include <qdialog.h> |
33 | #include <qscrollview.h> | 34 | #include <q3scrollview.h> |
34 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | //Added by qt3to4: | ||
37 | #include <Q3GridLayout> | ||
38 | #include <Q3PtrList> | ||
39 | #include <QKeyEvent> | ||
40 | #include <Q3VBoxLayout> | ||
35 | #include <kconfig.h> | 41 | #include <kconfig.h> |
36 | #include "kofilterview_base.h" | 42 | #include "kofilterview_base.h" |
37 | 43 | ||
38 | #include <libkcal/calfilter.h> | 44 | #include <libkcal/calfilter.h> |
39 | 45 | ||
40 | #include <kurlrequester.h> | 46 | #include <kurlrequester.h> |
41 | #include <klineedit.h> | 47 | #include <klineedit.h> |
42 | #include <kglobal.h> | 48 | #include <kglobal.h> |
43 | #include <kmessagebox.h> | 49 | #include <kmessagebox.h> |
44 | 50 | ||
45 | class QGridLayout; | 51 | class Q3GridLayout; |
46 | 52 | ||
47 | using namespace KCal; | 53 | using namespace KCal; |
48 | 54 | ||
49 | class KONewCalPrefs : public QDialog | 55 | class KONewCalPrefs : public QDialog |
50 | { | 56 | { |
51 | Q_OBJECT | 57 | Q_OBJECT |
52 | public: | 58 | public: |
53 | KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : | 59 | KONewCalPrefs( QWidget *parent=0, const char *name=0 ) : |
54 | QDialog( parent, name, true ) | 60 | QDialog( parent, name, true ) |
55 | { | 61 | { |
56 | setCaption( i18n("Add new Calendar") ); | 62 | setCaption( i18n("Add new Calendar") ); |
57 | QVBoxLayout* lay = new QVBoxLayout( this ); | 63 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
58 | lay->setSpacing( 3 ); | 64 | lay->setSpacing( 3 ); |
59 | lay->setMargin( 3 ); | 65 | lay->setMargin( 3 ); |
60 | QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); | 66 | QLabel * lab = new QLabel( i18n("<b>Name of new calendar:</b>"), this ); |
61 | lay->addWidget( lab ); | 67 | lay->addWidget( lab ); |
62 | nameE = new KLineEdit( this ); | 68 | nameE = new KLineEdit( this ); |
63 | lay->addWidget( nameE ); | 69 | lay->addWidget( nameE ); |
@@ -107,13 +113,13 @@ class KOCalButton : public QPushButton | |||
107 | KOCalButton( QWidget *parent=0, const char *name=0 ) : | 113 | KOCalButton( QWidget *parent=0, const char *name=0 ) : |
108 | QPushButton( parent, name) | 114 | QPushButton( parent, name) |
109 | { | 115 | { |
110 | connect( this, SIGNAL( clicked() ), | 116 | connect( this, SIGNAL( clicked() ), |
111 | SLOT( bottonClicked() )); | 117 | SLOT( bottonClicked() )); |
112 | mNumber = -1; | 118 | mNumber = -1; |
113 | setFocusPolicy(NoFocus); | 119 | setFocusPolicy(Qt::NoFocus); |
114 | } | 120 | } |
115 | void setNum ( int num ) {mNumber = num; } | 121 | void setNum ( int num ) {mNumber = num; } |
116 | signals: | 122 | signals: |
117 | void selectNum ( int ); | 123 | void selectNum ( int ); |
118 | private: | 124 | private: |
119 | int mNumber; | 125 | int mNumber; |
@@ -132,13 +138,13 @@ class KOCalCheckButton : public QCheckBox | |||
132 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : | 138 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : |
133 | QCheckBox( parent, name) | 139 | QCheckBox( parent, name) |
134 | { | 140 | { |
135 | connect( this, SIGNAL( toggled ( bool ) ), | 141 | connect( this, SIGNAL( toggled ( bool ) ), |
136 | SLOT( bottonClicked( bool ) )); | 142 | SLOT( bottonClicked( bool ) )); |
137 | mNumber = -1; | 143 | mNumber = -1; |
138 | setFocusPolicy(NoFocus); | 144 | setFocusPolicy(Qt::NoFocus); |
139 | //setMaximumWidth( 10 ); | 145 | //setMaximumWidth( 10 ); |
140 | 146 | ||
141 | } | 147 | } |
142 | void setNum ( int num ) {mNumber = num; } | 148 | void setNum ( int num ) {mNumber = num; } |
143 | signals: | 149 | signals: |
144 | void selectNum ( int, bool ); | 150 | void selectNum ( int, bool ); |
@@ -160,13 +166,13 @@ class KOCalRadioButton : public QRadioButton | |||
160 | KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : | 166 | KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : |
161 | QRadioButton( parent, name) | 167 | QRadioButton( parent, name) |
162 | { | 168 | { |
163 | connect( this, SIGNAL( toggled ( bool ) ), | 169 | connect( this, SIGNAL( toggled ( bool ) ), |
164 | SLOT( bottonClicked( bool ) )); | 170 | SLOT( bottonClicked( bool ) )); |
165 | mNumber = -1; | 171 | mNumber = -1; |
166 | setFocusPolicy(NoFocus); | 172 | setFocusPolicy(Qt::NoFocus); |
167 | //setMaximumWidth( 10 ); | 173 | //setMaximumWidth( 10 ); |
168 | 174 | ||
169 | } | 175 | } |
170 | int num() { return mNumber;} | 176 | int num() { return mNumber;} |
171 | void setNum ( int num ) {mNumber = num; } | 177 | void setNum ( int num ) {mNumber = num; } |
172 | signals: | 178 | signals: |
@@ -185,13 +191,13 @@ private slots : | |||
185 | 191 | ||
186 | 192 | ||
187 | class KOFilterView : public KOFilterView_base | 193 | class KOFilterView : public KOFilterView_base |
188 | { | 194 | { |
189 | Q_OBJECT | 195 | Q_OBJECT |
190 | public: | 196 | public: |
191 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); | 197 | KOFilterView(Q3PtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, Qt::WFlags fl=0); |
192 | ~KOFilterView(); | 198 | ~KOFilterView(); |
193 | 199 | ||
194 | void updateFilters(); | 200 | void updateFilters(); |
195 | 201 | ||
196 | bool filtersEnabled(); | 202 | bool filtersEnabled(); |
197 | void setFiltersEnabled(bool); | 203 | void setFiltersEnabled(bool); |
@@ -201,16 +207,16 @@ class KOFilterView : public KOFilterView_base | |||
201 | 207 | ||
202 | signals: | 208 | signals: |
203 | void filterChanged(); | 209 | void filterChanged(); |
204 | void editFilters(); | 210 | void editFilters(); |
205 | 211 | ||
206 | private: | 212 | private: |
207 | QPtrList<CalFilter> *mFilters; | 213 | Q3PtrList<CalFilter> *mFilters; |
208 | }; | 214 | }; |
209 | 215 | ||
210 | class KOCalEditView : public QScrollView | 216 | class KOCalEditView : public Q3ScrollView |
211 | { | 217 | { |
212 | Q_OBJECT | 218 | Q_OBJECT |
213 | public: | 219 | public: |
214 | KOCalEditView( QWidget* parent=0,const char* name=0); | 220 | KOCalEditView( QWidget* parent=0,const char* name=0); |
215 | ~KOCalEditView(); | 221 | ~KOCalEditView(); |
216 | int addCalendar( QString calName, QString fileName, bool ask = true ); | 222 | int addCalendar( QString calName, QString fileName, bool ask = true ); |
@@ -241,17 +247,17 @@ class KOCalEditView : public QScrollView | |||
241 | void needsUpdate(); | 247 | void needsUpdate(); |
242 | void checkCalendar(); | 248 | void checkCalendar(); |
243 | void requestCalendarInfo( int id ); | 249 | void requestCalendarInfo( int id ); |
244 | 250 | ||
245 | private: | 251 | private: |
246 | QWidget *mw; | 252 | QWidget *mw; |
247 | void toggleList ( QPtrList<KOCalCheckButton> , bool b = true ); | 253 | void toggleList ( Q3PtrList<KOCalCheckButton> , bool b = true ); |
248 | QPtrList<KOCalRadioButton> mStdandardB; | 254 | Q3PtrList<KOCalRadioButton> mStdandardB; |
249 | QPtrList<KOCalCheckButton> mEnabledB; | 255 | Q3PtrList<KOCalCheckButton> mEnabledB; |
250 | QPtrList<KOCalCheckButton> mAlarmB; | 256 | Q3PtrList<KOCalCheckButton> mAlarmB; |
251 | QPtrList<KOCalCheckButton> mROB; | 257 | Q3PtrList<KOCalCheckButton> mROB; |
252 | QGridLayout* mainLayout; | 258 | Q3GridLayout* mainLayout; |
253 | }; | 259 | }; |
254 | 260 | ||
255 | 261 | ||
256 | 262 | ||
257 | #endif // KOFILTERVIEW_H | 263 | #endif // KOFILTERVIEW_H |
diff --git a/korganizer/koimportoldialog.cpp b/korganizer/koimportoldialog.cpp index 79b97e8..63d044c 100644 --- a/korganizer/koimportoldialog.cpp +++ b/korganizer/koimportoldialog.cpp | |||
@@ -19,26 +19,26 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qframe.h> | 25 | #include <q3frame.h> |
26 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qprogressbar.h> | 28 | #include <q3progressbar.h> |
29 | #include <qprogressdialog.h> | 29 | #include <q3progressdialog.h> |
30 | #include <qwidgetstack.h> | 30 | #include <q3widgetstack.h> |
31 | #include <qdatetime.h> | 31 | #include <qdatetime.h> |
32 | #include <qdir.h> | 32 | #include <qdir.h> |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qhbox.h> | 34 | #include <q3hbox.h> |
35 | #include <qregexp.h> | 35 | #include <qregexp.h> |
36 | #include <qheader.h> | 36 | #include <q3header.h> |
37 | #include <qdatetime.h> | 37 | #include <qdatetime.h> |
38 | #include <qlistview.h> | 38 | #include <q3listview.h> |
39 | 39 | ||
40 | #include <kdebug.h> | 40 | #include <kdebug.h> |
41 | #include <klocale.h> | 41 | #include <klocale.h> |
42 | #include <kstandarddirs.h> | 42 | #include <kstandarddirs.h> |
43 | #include <kmessagebox.h> | 43 | #include <kmessagebox.h> |
44 | #include <kfiledialog.h> | 44 | #include <kfiledialog.h> |
@@ -67,34 +67,34 @@ QDateTime mDdate2Qdtr( DATE dt) | |||
67 | odt = dt; | 67 | odt = dt; |
68 | odt.GetAsSystemTime(st); | 68 | odt.GetAsSystemTime(st); |
69 | QDateTime qdt (QDate(st.wYear, st.wMonth,st.wDay ),QTime( st.wHour, st.wMinute,st.wSecond ) ); | 69 | QDateTime qdt (QDate(st.wYear, st.wMonth,st.wDay ),QTime( st.wHour, st.wMinute,st.wSecond ) ); |
70 | return qdt; | 70 | return qdt; |
71 | } | 71 | } |
72 | 72 | ||
73 | class OLEListViewItem : public QCheckListItem | 73 | class OLEListViewItem : public Q3CheckListItem |
74 | { | 74 | { |
75 | public: | 75 | public: |
76 | OLEListViewItem( QListView *parent, QString text ) : | 76 | OLEListViewItem( Q3ListView *parent, QString text ) : |
77 | QCheckListItem( parent, text, QCheckListItem::CheckBox ) { mData = 0; }; | 77 | Q3CheckListItem( parent, text, Q3CheckListItem::CheckBox ) { mData = 0; }; |
78 | OLEListViewItem( QListViewItem *after, QString text ) : | 78 | OLEListViewItem( Q3ListViewItem *after, QString text ) : |
79 | QCheckListItem( after, text, QCheckListItem::CheckBox ) { mData = 0; }; | 79 | Q3CheckListItem( after, text, Q3CheckListItem::CheckBox ) { mData = 0; }; |
80 | ~OLEListViewItem() {}; | 80 | ~OLEListViewItem() {}; |
81 | void setData( DWORD data ) {mData= data; }; | 81 | void setData( DWORD data ) {mData= data; }; |
82 | DWORD data() { return mData ;}; | 82 | DWORD data() { return mData ;}; |
83 | private: | 83 | private: |
84 | DWORD mData; | 84 | DWORD mData; |
85 | }; | 85 | }; |
86 | 86 | ||
87 | KOImportOLdialog::KOImportOLdialog( const QString &caption, | 87 | KOImportOLdialog::KOImportOLdialog( const QString &caption, |
88 | Calendar *calendar, QWidget *parent ) : | 88 | Calendar *calendar, QWidget *parent ) : |
89 | KDialogBase( Plain, caption, User1 | Close, Ok, | 89 | KDialogBase( Plain, caption, User1 | Close, Ok, |
90 | parent, caption, true, false, i18n("Import!") ) | 90 | parent, caption, true, false, i18n("Import!") ) |
91 | { | 91 | { |
92 | QHBox * mw = new QHBox( this ); | 92 | Q3HBox * mw = new Q3HBox( this ); |
93 | setMainWidget( mw ); | 93 | setMainWidget( mw ); |
94 | mListView = new QListView( mw ); | 94 | mListView = new Q3ListView( mw ); |
95 | mListView->addColumn(i18n("Select Folder to import")); | 95 | mListView->addColumn(i18n("Select Folder to import")); |
96 | mListView->addColumn(i18n("Content Type")); | 96 | mListView->addColumn(i18n("Content Type")); |
97 | mCalendar = calendar; | 97 | mCalendar = calendar; |
98 | connect( this, SIGNAL( user1Clicked() ),SLOT ( slotApply())); | 98 | connect( this, SIGNAL( user1Clicked() ),SLOT ( slotApply())); |
99 | setupFolderView(); | 99 | setupFolderView(); |
100 | resize( sizeHint().width()+50, sizeHint().height()+50 ); | 100 | resize( sizeHint().width()+50, sizeHint().height()+50 ); |
@@ -209,13 +209,13 @@ void KOImportOLdialog::readCalendarData( DWORD folder ) | |||
209 | mf.m_lpDispatch->AddRef(); | 209 | mf.m_lpDispatch->AddRef(); |
210 | _Items folderItems; | 210 | _Items folderItems; |
211 | _variant_t indx((long)0); | 211 | _variant_t indx((long)0); |
212 | LPDISPATCH itm; | 212 | LPDISPATCH itm; |
213 | int i; | 213 | int i; |
214 | folderItems = mf.GetItems(); | 214 | folderItems = mf.GetItems(); |
215 | QProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this ); | 215 | Q3ProgressDialog bar( i18n("Importing calendar data"),i18n("Abort"), folderItems.GetCount(),this ); |
216 | bar.setCaption (i18n("Importing!") ); | 216 | bar.setCaption (i18n("Importing!") ); |
217 | int h = bar.sizeHint().height() ; | 217 | int h = bar.sizeHint().height() ; |
218 | int w = 300; | 218 | int w = 300; |
219 | int dw = QApplication::desktop()->width(); | 219 | int dw = QApplication::desktop()->width(); |
220 | int dh = QApplication::desktop()->height(); | 220 | int dh = QApplication::desktop()->height(); |
221 | //bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 221 | //bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
diff --git a/korganizer/koimportoldialog.h b/korganizer/koimportoldialog.h index c8847c5..d66f099 100644 --- a/korganizer/koimportoldialog.h +++ b/korganizer/koimportoldialog.h | |||
@@ -28,13 +28,13 @@ | |||
28 | #include <afxdisp.h> | 28 | #include <afxdisp.h> |
29 | #include <libkcal/calendar.h> | 29 | #include <libkcal/calendar.h> |
30 | #include <libkcal/event.h> | 30 | #include <libkcal/event.h> |
31 | 31 | ||
32 | 32 | ||
33 | class QDateTime; | 33 | class QDateTime; |
34 | class QListView; | 34 | class Q3ListView; |
35 | class OLEListViewItem; | 35 | class OLEListViewItem; |
36 | class _AppointmentItem; | 36 | class _AppointmentItem; |
37 | namespace KPIM { class CategorySelectDialog; } | 37 | namespace KPIM { class CategorySelectDialog; } |
38 | 38 | ||
39 | using namespace KCal; | 39 | using namespace KCal; |
40 | 40 | ||
@@ -69,13 +69,13 @@ class KOImportOLdialog : public KDialogBase | |||
69 | void setupFolderView(); | 69 | void setupFolderView(); |
70 | void addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent); | 70 | void addFolder(OLEListViewItem* iParent, LPDISPATCH dispParent); |
71 | void readCalendarData( DWORD folder ); | 71 | void readCalendarData( DWORD folder ); |
72 | void ol2kopiCalendar( _AppointmentItem * , bool computeRecurrence = true ); | 72 | void ol2kopiCalendar( _AppointmentItem * , bool computeRecurrence = true ); |
73 | 73 | ||
74 | Calendar *mCalendar; | 74 | Calendar *mCalendar; |
75 | QListView * mListView; | 75 | Q3ListView * mListView; |
76 | QString getUidByEmail( QString email ); | 76 | QString getUidByEmail( QString email ); |
77 | 77 | ||
78 | private: | 78 | private: |
79 | int importedItems; | 79 | int importedItems; |
80 | }; | 80 | }; |
81 | 81 | ||
diff --git a/korganizer/koincidenceeditor.cpp b/korganizer/koincidenceeditor.cpp index 236f6f9..2060ea1 100644 --- a/korganizer/koincidenceeditor.cpp +++ b/korganizer/koincidenceeditor.cpp | |||
@@ -19,18 +19,20 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qframe.h> | 25 | #include <q3frame.h> |
26 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qwidgetstack.h> | 28 | #include <q3widgetstack.h> |
29 | #include <qdatetime.h> | 29 | #include <qdatetime.h> |
30 | #include <qdir.h> | 30 | #include <qdir.h> |
31 | //Added by qt3to4: | ||
32 | #include <Q3VBoxLayout> | ||
31 | 33 | ||
32 | #include <kdebug.h> | 34 | #include <kdebug.h> |
33 | #include <klocale.h> | 35 | #include <klocale.h> |
34 | #include <kstandarddirs.h> | 36 | #include <kstandarddirs.h> |
35 | #include <kmessagebox.h> | 37 | #include <kmessagebox.h> |
36 | #include <kfiledialog.h> | 38 | #include <kfiledialog.h> |
@@ -79,15 +81,15 @@ KOIncidenceEditor::~KOIncidenceEditor() | |||
79 | { | 81 | { |
80 | //delete mCategoryDialog; | 82 | //delete mCategoryDialog; |
81 | } | 83 | } |
82 | 84 | ||
83 | void KOIncidenceEditor::setupAttendeesTab() | 85 | void KOIncidenceEditor::setupAttendeesTab() |
84 | { | 86 | { |
85 | QFrame *topFrame = addPage(i18n("Attendees")); | 87 | Q3Frame *topFrame = addPage(i18n("Attendees")); |
86 | 88 | ||
87 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 89 | Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); |
88 | 90 | ||
89 | mDetails = new KOEditorDetails(spacingHint()-2,topFrame); | 91 | mDetails = new KOEditorDetails(spacingHint()-2,topFrame); |
90 | topLayout->addWidget(mDetails); | 92 | topLayout->addWidget(mDetails); |
91 | } | 93 | } |
92 | 94 | ||
93 | void KOIncidenceEditor::alarmWarning() | 95 | void KOIncidenceEditor::alarmWarning() |
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 406df5a..51594ff 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp | |||
@@ -22,19 +22,25 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | // | 24 | // |
25 | // View of Journal entries | 25 | // View of Journal entries |
26 | 26 | ||
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qscrollview.h> | 28 | #include <q3scrollview.h> |
29 | #include <qpopupmenu.h> | 29 | #include <q3popupmenu.h> |
30 | #include <qhbox.h> | 30 | #include <q3hbox.h> |
31 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
32 | #include <qlabel.h> | 32 | #include <qlabel.h> |
33 | #include <qpushbutton.h> | 33 | #include <qpushbutton.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | #include <QDesktopWidget> | ||
36 | //Added by qt3to4: | ||
37 | #include <QPixmap> | ||
38 | #include <Q3PtrList> | ||
39 | #include <QKeyEvent> | ||
40 | #include <Q3VBoxLayout> | ||
35 | 41 | ||
36 | #include <klocale.h> | 42 | #include <klocale.h> |
37 | #include <kdebug.h> | 43 | #include <kdebug.h> |
38 | #include "koprefs.h" | 44 | #include "koprefs.h" |
39 | #include <kglobal.h> | 45 | #include <kglobal.h> |
40 | #include <ktextedit.h> | 46 | #include <ktextedit.h> |
@@ -48,33 +54,33 @@ using namespace KOrg; | |||
48 | 54 | ||
49 | KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, | 55 | KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, |
50 | const char *name) | 56 | const char *name) |
51 | : KOrg::BaseView(calendar, parent, name) | 57 | : KOrg::BaseView(calendar, parent, name) |
52 | { | 58 | { |
53 | mCalendar = calendar; | 59 | mCalendar = calendar; |
54 | QHBox * vb = new QHBox ( this ); | 60 | Q3HBox * vb = new Q3HBox ( this ); |
55 | QPushButton * newJournal = new QPushButton( vb ); | 61 | QPushButton * newJournal = new QPushButton( vb ); |
56 | QPixmap icon; | 62 | QPixmap icon; |
57 | if ( QApplication::desktop()->width() < 321 ) | 63 | if ( QApplication::desktop()->width() < 321 ) |
58 | icon = SmallIcon("ko16old"); | 64 | icon = SmallIcon("ko16old"); |
59 | else | 65 | else |
60 | icon = SmallIcon("ko24old"); | 66 | icon = SmallIcon("ko24old"); |
61 | newJournal->setPixmap (icon ) ; | 67 | newJournal->setPixmap (icon ) ; |
62 | int size = newJournal->sizeHint().height(); | 68 | int size = newJournal->sizeHint().height(); |
63 | newJournal->setFixedSize( size, size ); | 69 | newJournal->setFixedSize( size, size ); |
64 | mDateLabel = new QLabel ( vb ); | 70 | mDateLabel = new QLabel ( vb ); |
65 | mDateLabel->setMargin(1); | 71 | mDateLabel->setMargin(1); |
66 | mDateLabel->setAlignment(AlignCenter); | 72 | mDateLabel->setAlignment(Qt::AlignCenter); |
67 | QScrollView * sv = new QScrollView( this ); | 73 | Q3ScrollView * sv = new Q3ScrollView( this ); |
68 | QVBoxLayout * hbl = new QVBoxLayout( this ); | 74 | Q3VBoxLayout * hbl = new Q3VBoxLayout( this ); |
69 | hbl->addWidget( vb ); | 75 | hbl->addWidget( vb ); |
70 | hbl->addWidget( sv ); | 76 | hbl->addWidget( sv ); |
71 | parWid = new QWidget( sv->viewport() ); | 77 | parWid = new QWidget( sv->viewport() ); |
72 | sv->addChild(parWid); | 78 | sv->addChild(parWid); |
73 | sv->setResizePolicy( QScrollView:: AutoOneFit ); | 79 | sv->setResizePolicy( Q3ScrollView:: AutoOneFit ); |
74 | mTopLayout = new QVBoxLayout(parWid); | 80 | mTopLayout = new Q3VBoxLayout(parWid); |
75 | connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); | 81 | connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); |
76 | getNewEntry(); | 82 | getNewEntry(); |
77 | } | 83 | } |
78 | 84 | ||
79 | KOJournalView::~KOJournalView() | 85 | KOJournalView::~KOJournalView() |
80 | { | 86 | { |
@@ -93,15 +99,15 @@ JournalEntry* KOJournalView::getNewEntry() | |||
93 | connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; | 99 | connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; |
94 | connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; | 100 | connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; |
95 | connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; | 101 | connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; |
96 | return Entry; | 102 | return Entry; |
97 | } | 103 | } |
98 | 104 | ||
99 | QPtrList<Incidence> KOJournalView::selectedIncidences() | 105 | Q3PtrList<Incidence> KOJournalView::selectedIncidences() |
100 | { | 106 | { |
101 | QPtrList<Incidence> eventList; | 107 | Q3PtrList<Incidence> eventList; |
102 | 108 | ||
103 | return eventList; | 109 | return eventList; |
104 | } | 110 | } |
105 | void KOJournalView::updateConfig() | 111 | void KOJournalView::updateConfig() |
106 | { | 112 | { |
107 | JournalEntry* mEntry = jEntries.first(); | 113 | JournalEntry* mEntry = jEntries.first(); |
@@ -159,19 +165,19 @@ void KOJournalView::showOnly ( Journal* j ) | |||
159 | //qDebug("showOnly %x ", j); | 165 | //qDebug("showOnly %x ", j); |
160 | flushView(); | 166 | flushView(); |
161 | if ( j == 0 ) { | 167 | if ( j == 0 ) { |
162 | showDates( mDate, QDate() ); | 168 | showDates( mDate, QDate() ); |
163 | return; | 169 | return; |
164 | } | 170 | } |
165 | QPtrList<Journal> jl; | 171 | Q3PtrList<Journal> jl; |
166 | jl.append ( j ); | 172 | jl.append ( j ); |
167 | showList( jl ); | 173 | showList( jl ); |
168 | JournalEntry* mEntry = jEntries.first(); | 174 | JournalEntry* mEntry = jEntries.first(); |
169 | mEntry->setShowOnly(); | 175 | mEntry->setShowOnly(); |
170 | } | 176 | } |
171 | void KOJournalView::showList(QPtrList<Journal> jl) | 177 | void KOJournalView::showList(Q3PtrList<Journal> jl) |
172 | { | 178 | { |
173 | static bool ff = false; | 179 | static bool ff = false; |
174 | if ( ff ) return; | 180 | if ( ff ) return; |
175 | ff = true; | 181 | ff = true; |
176 | //qDebug("KOJournalView::showList %d",jl.count() ); | 182 | //qDebug("KOJournalView::showList %d",jl.count() ); |
177 | JournalEntry* mEntry = jEntries.first(); | 183 | JournalEntry* mEntry = jEntries.first(); |
@@ -222,17 +228,17 @@ void KOJournalView::showList(QPtrList<Journal> jl) | |||
222 | } | 228 | } |
223 | 229 | ||
224 | void KOJournalView::showDates(const QDate &start, const QDate &) | 230 | void KOJournalView::showDates(const QDate &start, const QDate &) |
225 | { | 231 | { |
226 | mDate = start; | 232 | mDate = start; |
227 | mDateLabel->setText(KGlobal::locale()->formatDate(mDate)); | 233 | mDateLabel->setText(KGlobal::locale()->formatDate(mDate)); |
228 | QPtrList<Journal> jl = calendar()->journals4Date( start ); | 234 | Q3PtrList<Journal> jl = calendar()->journals4Date( start ); |
229 | showList( jl ); | 235 | showList( jl ); |
230 | } | 236 | } |
231 | 237 | ||
232 | void KOJournalView::showEvents(QPtrList<Event>) | 238 | void KOJournalView::showEvents(Q3PtrList<Event>) |
233 | { | 239 | { |
234 | // After new creation of list view no events are selected. | 240 | // After new creation of list view no events are selected. |
235 | // emit incidenceSelected( 0 ); | 241 | // emit incidenceSelected( 0 ); |
236 | } | 242 | } |
237 | 243 | ||
238 | void KOJournalView::changeEventDisplay(Event *, int /*action*/) | 244 | void KOJournalView::changeEventDisplay(Event *, int /*action*/) |
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h index 7fa94ae..22f26cd 100644 --- a/korganizer/kojournalview.h +++ b/korganizer/kojournalview.h | |||
@@ -22,12 +22,17 @@ | |||
22 | */ | 22 | */ |
23 | #ifndef _KOJOURNALVIEW_H | 23 | #ifndef _KOJOURNALVIEW_H |
24 | #define _KOJOURNALVIEW_H | 24 | #define _KOJOURNALVIEW_H |
25 | 25 | ||
26 | #include <korganizer/baseview.h> | 26 | #include <korganizer/baseview.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | //Added by qt3to4: | ||
29 | #include <QKeyEvent> | ||
30 | #include <Q3PtrList> | ||
31 | #include <QLabel> | ||
32 | #include <Q3BoxLayout> | ||
28 | 33 | ||
29 | class JournalEntry; | 34 | class JournalEntry; |
30 | class QLabel; | 35 | class QLabel; |
31 | 36 | ||
32 | /** | 37 | /** |
33 | * This class provides a journal view. | 38 | * This class provides a journal view. |
@@ -43,13 +48,13 @@ class KOJournalView : public KOrg::BaseView | |||
43 | KOJournalView(Calendar *calendar, QWidget *parent = 0, | 48 | KOJournalView(Calendar *calendar, QWidget *parent = 0, |
44 | const char *name = 0); | 49 | const char *name = 0); |
45 | ~KOJournalView(); | 50 | ~KOJournalView(); |
46 | 51 | ||
47 | virtual int currentDateCount(); | 52 | virtual int currentDateCount(); |
48 | void clearList(); | 53 | void clearList(); |
49 | virtual QPtrList<Incidence> selectedIncidences(); | 54 | virtual Q3PtrList<Incidence> selectedIncidences(); |
50 | DateList selectedDates() | 55 | DateList selectedDates() |
51 | {DateList q; | 56 | {DateList q; |
52 | return q;}; | 57 | return q;}; |
53 | void checkModified(); | 58 | void checkModified(); |
54 | signals: | 59 | signals: |
55 | void deleteJournal(Journal *); | 60 | void deleteJournal(Journal *); |
@@ -57,23 +62,23 @@ class KOJournalView : public KOrg::BaseView | |||
57 | void showOnly ( Journal* ); | 62 | void showOnly ( Journal* ); |
58 | void newJournal(); | 63 | void newJournal(); |
59 | void updateView(); | 64 | void updateView(); |
60 | void flushView(); | 65 | void flushView(); |
61 | void updateConfig(); | 66 | void updateConfig(); |
62 | void showDates( const QDate &start, const QDate &end ); | 67 | void showDates( const QDate &start, const QDate &end ); |
63 | void showEvents(QPtrList<Event> eventList); | 68 | void showEvents(Q3PtrList<Event> eventList); |
64 | 69 | ||
65 | void changeEventDisplay(Event *, int); | 70 | void changeEventDisplay(Event *, int); |
66 | 71 | ||
67 | private: | 72 | private: |
68 | void showList(QPtrList<Journal> jl); | 73 | void showList(Q3PtrList<Journal> jl); |
69 | Calendar *mCalendar; | 74 | Calendar *mCalendar; |
70 | JournalEntry* getNewEntry(); | 75 | JournalEntry* getNewEntry(); |
71 | QPtrList<JournalEntry> jEntries; | 76 | Q3PtrList<JournalEntry> jEntries; |
72 | void keyPressEvent ( QKeyEvent * ) ; | 77 | void keyPressEvent ( QKeyEvent * ) ; |
73 | QBoxLayout *mTopLayout; | 78 | Q3BoxLayout *mTopLayout; |
74 | QWidget *parWid; | 79 | QWidget *parWid; |
75 | QLabel * mDateLabel; | 80 | QLabel * mDateLabel; |
76 | QDate mDate; | 81 | QDate mDate; |
77 | 82 | ||
78 | }; | 83 | }; |
79 | 84 | ||
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 192f8c0..0ea1d50 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -19,26 +19,35 @@ | |||
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qlistview.h> | 25 | #include <q3listview.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qpopupmenu.h> | 28 | #include <q3popupmenu.h> |
29 | #include <qprogressbar.h> | 29 | #include <q3progressbar.h> |
30 | #include <qfileinfo.h> | 30 | #include <qfileinfo.h> |
31 | #include <qmessagebox.h> | 31 | #include <qmessagebox.h> |
32 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | #include <qtextstream.h> | 33 | #include <q3textstream.h> |
34 | #include <qdir.h> | 34 | #include <qdir.h> |
35 | #include <qwhatsthis.h> | 35 | #include <q3whatsthis.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qpainter.h> | 37 | #include <qpainter.h> |
38 | #include <qpaintdevicemetrics.h> | 38 | #include <q3paintdevicemetrics.h> |
39 | //Added by qt3to4: | ||
40 | #include <QPixmap> | ||
41 | #include <QMouseEvent> | ||
42 | #include <QKeyEvent> | ||
43 | #include <QEvent> | ||
44 | #include <Q3VBoxLayout> | ||
45 | #include <Q3PtrList> | ||
46 | |||
47 | #include<QDesktopWidget> | ||
39 | 48 | ||
40 | #include <klocale.h> | 49 | #include <klocale.h> |
41 | #include <kdebug.h> | 50 | #include <kdebug.h> |
42 | #include <kiconloader.h> | 51 | #include <kiconloader.h> |
43 | #include <kglobal.h> | 52 | #include <kglobal.h> |
44 | 53 | ||
@@ -67,16 +76,16 @@ | |||
67 | #include "kolistview.h" | 76 | #include "kolistview.h" |
68 | #include "koeventviewer.h" | 77 | #include "koeventviewer.h" |
69 | 78 | ||
70 | extern QPixmap* sgListViewCompletedPix[6]; | 79 | extern QPixmap* sgListViewCompletedPix[6]; |
71 | extern QPixmap* sgListViewJournalPix; | 80 | extern QPixmap* sgListViewJournalPix; |
72 | 81 | ||
73 | class KOListViewWhatsThis :public QWhatsThis | 82 | class KOListViewWhatsThis :public Q3WhatsThis |
74 | { | 83 | { |
75 | public: | 84 | public: |
76 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 85 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { }; |
77 | 86 | ||
78 | protected: | 87 | protected: |
79 | virtual QString text( const QPoint& p) | 88 | virtual QString text( const QPoint& p) |
80 | { | 89 | { |
81 | return _view->getWhatsThisText(p) ; | 90 | return _view->getWhatsThisText(p) ; |
82 | } | 91 | } |
@@ -271,69 +280,69 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
271 | mListView->addColumn(i18n("Recurs")); // recurs? | 280 | mListView->addColumn(i18n("Recurs")); // recurs? |
272 | mListView->addColumn(i18n("Cancelled")); | 281 | mListView->addColumn(i18n("Cancelled")); |
273 | mListView->addColumn(i18n("Categories")); | 282 | mListView->addColumn(i18n("Categories")); |
274 | mListView->addColumn(i18n("Calendar")); | 283 | mListView->addColumn(i18n("Calendar")); |
275 | mListView->addColumn(i18n("Last Modified")); | 284 | mListView->addColumn(i18n("Last Modified")); |
276 | 285 | ||
277 | mListView->setColumnAlignment(0,AlignLeft); | 286 | mListView->setColumnAlignment(0,Qt::AlignLeft); |
278 | mListView->setColumnAlignment(1,AlignLeft); | 287 | mListView->setColumnAlignment(1,Qt::AlignLeft); |
279 | mListView->setColumnAlignment(2,AlignHCenter); | 288 | mListView->setColumnAlignment(2,Qt::AlignHCenter); |
280 | mListView->setColumnAlignment(3,AlignLeft); | 289 | mListView->setColumnAlignment(3,Qt::AlignLeft); |
281 | mListView->setColumnAlignment(4,AlignHCenter); | 290 | mListView->setColumnAlignment(4,Qt::AlignHCenter); |
282 | mListView->setColumnAlignment(5,AlignLeft); | 291 | mListView->setColumnAlignment(5,Qt::AlignLeft); |
283 | mListView->setColumnAlignment(6,AlignLeft); | 292 | mListView->setColumnAlignment(6,Qt::AlignLeft); |
284 | mListView->setColumnAlignment(7,AlignLeft); | 293 | mListView->setColumnAlignment(7,Qt::AlignLeft); |
285 | mListView->setColumnAlignment(8,AlignLeft); | 294 | mListView->setColumnAlignment(8,Qt::AlignLeft); |
286 | mListView->setColumnAlignment(9,AlignLeft); | 295 | mListView->setColumnAlignment(9,Qt::AlignLeft); |
287 | mListView->setColumnAlignment(10,AlignLeft); | 296 | mListView->setColumnAlignment(10,Qt::AlignLeft); |
288 | mListView->setColumnAlignment(11,AlignLeft); | 297 | mListView->setColumnAlignment(11,Qt::AlignLeft); |
289 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); | 298 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); |
290 | 299 | ||
291 | int iii = 0; | 300 | int iii = 0; |
292 | for ( iii = 0; iii< 12 ; ++iii ) | 301 | for ( iii = 0; iii< 12 ; ++iii ) |
293 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 302 | mListView->setColumnWidthMode( iii, Q3ListView::Manual ); |
294 | 303 | ||
295 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 304 | Q3BoxLayout *layoutTop = new Q3VBoxLayout(this); |
296 | layoutTop->addWidget(mListView); | 305 | layoutTop->addWidget(mListView); |
297 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 306 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
298 | mPopupMenu = eventPopup(); | 307 | mPopupMenu = eventPopup(); |
299 | QPopupMenu* selPopup = new QPopupMenu ( this ); | 308 | Q3PopupMenu* selPopup = new Q3PopupMenu ( this ); |
300 | mPopupMenu->insertSeparator(); | 309 | mPopupMenu->insertSeparator(); |
301 | 310 | ||
302 | selPopup->insertItem(i18n("All"),this, | 311 | selPopup->insertItem(i18n("All"),this, |
303 | SLOT(allSelection())); | 312 | SLOT(allSelection())); |
304 | selPopup->insertItem(i18n("None"),this, | 313 | selPopup->insertItem(i18n("None"),this, |
305 | SLOT(clearSelection())); | 314 | SLOT(clearSelection())); |
306 | selPopup->insertItem(i18n("Delete selected..."),this, | 315 | selPopup->insertItem(i18n("Delete selected..."),this, |
307 | SLOT(deleteAll())); | 316 | SLOT(deleteAll())); |
308 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); | 317 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); |
309 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 318 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
310 | i18n("Hide all selected"),this, | 319 | i18n("Hide all selected"),this, |
311 | SLOT(hideAll()),true); | 320 | SLOT(hideAll()),true); |
312 | 321 | ||
313 | selPopup->insertSeparator(); | 322 | selPopup->insertSeparator(); |
314 | QPopupMenu * exportPO = new QPopupMenu ( this ); | 323 | Q3PopupMenu * exportPO = new Q3PopupMenu ( this ); |
315 | selPopup->insertItem( i18n("Export"), exportPO ); | 324 | selPopup->insertItem( i18n("Export"), exportPO ); |
316 | #ifdef DESKTOP_VERSION | 325 | #ifdef DESKTOP_VERSION |
317 | mPopupMenu->insertSeparator(); | 326 | mPopupMenu->insertSeparator(); |
318 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 327 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
319 | i18n("Print complete list..."),this, | 328 | i18n("Print complete list..."),this, |
320 | SLOT(printList()),true); | 329 | SLOT(printList()),true); |
321 | #endif | 330 | #endif |
322 | mCalPopup = new QPopupMenu ( this ); | 331 | mCalPopup = new Q3PopupMenu ( this ); |
323 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); | 332 | selPopup->insertItem( i18n("Set Calendar"), mCalPopup ); |
324 | 333 | ||
325 | selPopup->insertItem(i18n("Set categories")+"...",this, | 334 | selPopup->insertItem(i18n("Set categories")+"...",this, |
326 | SLOT(setCat()) ); | 335 | SLOT(setCat()) ); |
327 | selPopup->insertItem( i18n("Set alarm..."),this, | 336 | selPopup->insertItem( i18n("Set alarm..."),this, |
328 | SLOT(setAlarm())); | 337 | SLOT(setAlarm())); |
329 | #if 0 | 338 | #if 0 |
330 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 339 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
331 | i18n("Set categories")+"...",this, | 340 | i18n("Set categories")+"...",this, |
332 | SLOT(setCat()),true); | 341 | SLOT(setCat()),true); |
333 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 342 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
334 | i18n("Set alarm..."),this, | 343 | i18n("Set alarm..."),this, |
335 | SLOT(setAlarm()),true); | 344 | SLOT(setAlarm()),true); |
336 | #endif | 345 | #endif |
337 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, | 346 | QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this, |
338 | SLOT( populateCalPopup() )); | 347 | SLOT( populateCalPopup() )); |
339 | QObject::connect(mCalPopup,SIGNAL(activated( int )),this, | 348 | QObject::connect(mCalPopup,SIGNAL(activated( int )),this, |
@@ -353,13 +362,13 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
353 | //mPopupMenu->insertSeparator(); | 362 | //mPopupMenu->insertSeparator(); |
354 | #ifndef DESKTOP_VERSION | 363 | #ifndef DESKTOP_VERSION |
355 | selPopup->insertSeparator(); | 364 | selPopup->insertSeparator(); |
356 | selPopup->insertItem( i18n("Beam via IR..."),this, | 365 | selPopup->insertItem( i18n("Beam via IR..."),this, |
357 | SLOT(beamSelected())); | 366 | SLOT(beamSelected())); |
358 | #if 0 | 367 | #if 0 |
359 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 368 | mPopupMenu->addAdditionalItem(QIcon(QPixmap()), |
360 | i18n("Beam via IR"),this, | 369 | i18n("Beam via IR"),this, |
361 | SLOT(beamSelected()),true); | 370 | SLOT(beamSelected()),true); |
362 | #endif | 371 | #endif |
363 | #endif | 372 | #endif |
364 | /* | 373 | /* |
365 | mPopupMenu = new QPopupMenu; | 374 | mPopupMenu = new QPopupMenu; |
@@ -372,19 +381,19 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
372 | SLOT(showDates())); | 381 | SLOT(showDates())); |
373 | mPopupMenu->insertItem(i18n("Hide Dates"), this, | 382 | mPopupMenu->insertItem(i18n("Hide Dates"), this, |
374 | SLOT(hideDates())); | 383 | SLOT(hideDates())); |
375 | */ | 384 | */ |
376 | QObject::connect(mListView,SIGNAL( newEvent()), | 385 | QObject::connect(mListView,SIGNAL( newEvent()), |
377 | this,SIGNAL(signalNewEvent())); | 386 | this,SIGNAL(signalNewEvent())); |
378 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 387 | QObject::connect(mListView,SIGNAL(doubleClicked(Q3ListViewItem *)), |
379 | this,SLOT(defaultItemAction(QListViewItem *))); | 388 | this,SLOT(defaultItemAction(Q3ListViewItem *))); |
380 | QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *, | 389 | QObject::connect(mListView,SIGNAL(rightButtonPressed( Q3ListViewItem *, |
381 | const QPoint &, int )), | 390 | const QPoint &, int )), |
382 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 391 | this,SLOT(popupMenu(Q3ListViewItem *,const QPoint &,int))); |
383 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 392 | QObject::connect(mListView,SIGNAL(currentChanged(Q3ListViewItem *)), |
384 | SLOT(processSelectionChange(QListViewItem *))); | 393 | SLOT(processSelectionChange(Q3ListViewItem *))); |
385 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 394 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
386 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 395 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
387 | 396 | ||
388 | readSettings(KOGlobals::config(),"KOListView Layout"); | 397 | readSettings(KOGlobals::config(),"KOListView Layout"); |
389 | } | 398 | } |
390 | 399 | ||
@@ -425,13 +434,13 @@ void KOListView::setCalendar( int c ) | |||
425 | i18n("Continue"), i18n("Cancel"), 0, | 434 | i18n("Continue"), i18n("Cancel"), 0, |
426 | 0, 1 ); | 435 | 0, 1 ); |
427 | if ( result != 0 ) { | 436 | if ( result != 0 ) { |
428 | return; | 437 | return; |
429 | } | 438 | } |
430 | 439 | ||
431 | QPtrList<Incidence> delSel = getSelectedIncidences() ; | 440 | Q3PtrList<Incidence> delSel = getSelectedIncidences() ; |
432 | int icount = delSel.count(); | 441 | int icount = delSel.count(); |
433 | if ( icount ) { | 442 | if ( icount ) { |
434 | Incidence *incidence = delSel.first(); | 443 | Incidence *incidence = delSel.first(); |
435 | while ( incidence ) { | 444 | while ( incidence ) { |
436 | incidence->setCalID( c ); | 445 | incidence->setCalID( c ); |
437 | KOListViewItem * item = getItemForEvent( incidence ); | 446 | KOListViewItem * item = getItemForEvent( incidence ); |
@@ -439,13 +448,13 @@ void KOListView::setCalendar( int c ) | |||
439 | ListItemVisitor v(item, mStartDate ); | 448 | ListItemVisitor v(item, mStartDate ); |
440 | incidence->accept(v); | 449 | incidence->accept(v); |
441 | } | 450 | } |
442 | incidence = delSel.next(); | 451 | incidence = delSel.next(); |
443 | } | 452 | } |
444 | } | 453 | } |
445 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 454 | Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
446 | KopiCalendarFile * cal = calendars.first(); | 455 | KopiCalendarFile * cal = calendars.first(); |
447 | while ( cal ) { | 456 | while ( cal ) { |
448 | mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); | 457 | mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); |
449 | mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); | 458 | mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); |
450 | mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); | 459 | mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); |
451 | if ( cal->isStandard ) | 460 | if ( cal->isStandard ) |
@@ -494,13 +503,13 @@ void KOListView::setCat() | |||
494 | 503 | ||
495 | void KOListView::setAlarm() | 504 | void KOListView::setAlarm() |
496 | { | 505 | { |
497 | KOAlarmPrefs kap( this); | 506 | KOAlarmPrefs kap( this); |
498 | if ( !kap.exec() ) | 507 | if ( !kap.exec() ) |
499 | return; | 508 | return; |
500 | QPtrList<Incidence> delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos | 509 | Q3PtrList<Incidence> delSel = getSelectedIncidences( true, true, false, true ); // no journals, only due todos |
501 | Incidence* inc = delSel.first(); | 510 | Incidence* inc = delSel.first(); |
502 | int count = 0; | 511 | int count = 0; |
503 | while ( inc ) { | 512 | while ( inc ) { |
504 | ++count; | 513 | ++count; |
505 | if (kap.mAlarmButton->isChecked()) { | 514 | if (kap.mAlarmButton->isChecked()) { |
506 | if (inc->alarms().count() == 0) | 515 | if (inc->alarms().count() == 0) |
@@ -519,13 +528,13 @@ void KOListView::setAlarm() | |||
519 | } | 528 | } |
520 | else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn()) | 529 | else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn()) |
521 | alarm->setAudioAlarm(kap.mAlarmSound); | 530 | alarm->setAudioAlarm(kap.mAlarmSound); |
522 | else | 531 | else |
523 | alarm->setType(Alarm::Invalid); | 532 | alarm->setType(Alarm::Invalid); |
524 | } else { | 533 | } else { |
525 | QPtrList<Alarm> alarms = inc->alarms(); | 534 | Q3PtrList<Alarm> alarms = inc->alarms(); |
526 | Alarm *alarm; | 535 | Alarm *alarm; |
527 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 536 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
528 | alarm->setEnabled(false); | 537 | alarm->setEnabled(false); |
529 | alarm->setType(Alarm::Invalid); | 538 | alarm->setType(Alarm::Invalid); |
530 | } | 539 | } |
531 | } | 540 | } |
@@ -549,13 +558,13 @@ void KOListView::setCategories( bool removeOld ) | |||
549 | if (! csd->exec()) { | 558 | if (! csd->exec()) { |
550 | delete csd; | 559 | delete csd; |
551 | return; | 560 | return; |
552 | } | 561 | } |
553 | QStringList catList = csd->selectedCategories(); | 562 | QStringList catList = csd->selectedCategories(); |
554 | delete csd; | 563 | delete csd; |
555 | QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; | 564 | Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; |
556 | Incidence* inc = delSel.first(); | 565 | Incidence* inc = delSel.first(); |
557 | while ( inc ) { | 566 | while ( inc ) { |
558 | if ( removeOld ) { | 567 | if ( removeOld ) { |
559 | inc->setCategories( catList, false ); | 568 | inc->setCategories( catList, false ); |
560 | } else { | 569 | } else { |
561 | inc->addCategories( catList, false ); | 570 | inc->addCategories( catList, false ); |
@@ -569,13 +578,13 @@ void KOListView::setCategories( bool removeOld ) | |||
569 | } | 578 | } |
570 | QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); | 579 | QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); |
571 | } | 580 | } |
572 | 581 | ||
573 | void KOListView::beamSelected() | 582 | void KOListView::beamSelected() |
574 | { | 583 | { |
575 | QPtrList<Incidence> delSel = getSelectedIncidences() ; | 584 | Q3PtrList<Incidence> delSel = getSelectedIncidences() ; |
576 | if ( delSel.count() ) | 585 | if ( delSel.count() ) |
577 | emit beamIncidenceList( delSel ); | 586 | emit beamIncidenceList( delSel ); |
578 | } | 587 | } |
579 | 588 | ||
580 | void KOListView::saveDescriptionToFile() | 589 | void KOListView::saveDescriptionToFile() |
581 | { | 590 | { |
@@ -584,13 +593,13 @@ void KOListView::saveDescriptionToFile() | |||
584 | i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."), | 593 | i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."), |
585 | i18n("Continue"), i18n("Cancel"), 0, | 594 | i18n("Continue"), i18n("Cancel"), 0, |
586 | 0, 1 ); | 595 | 0, 1 ); |
587 | if ( result != 0 ) { | 596 | if ( result != 0 ) { |
588 | return; | 597 | return; |
589 | } | 598 | } |
590 | QPtrList<Incidence> delSel = getSelectedIncidences() ; | 599 | Q3PtrList<Incidence> delSel = getSelectedIncidences() ; |
591 | int icount = delSel.count(); | 600 | int icount = delSel.count(); |
592 | if ( icount ) { | 601 | if ( icount ) { |
593 | QString fn = KOPrefs::instance()->mLastSaveFile; | 602 | QString fn = KOPrefs::instance()->mLastSaveFile; |
594 | fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); | 603 | fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); |
595 | 604 | ||
596 | if ( fn == "" ) | 605 | if ( fn == "" ) |
@@ -642,17 +651,17 @@ void KOListView::saveDescriptionToFile() | |||
642 | 651 | ||
643 | } | 652 | } |
644 | } | 653 | } |
645 | incidence = delSel.next(); | 654 | incidence = delSel.next(); |
646 | } | 655 | } |
647 | QFile file( fn ); | 656 | QFile file( fn ); |
648 | if (!file.open( IO_WriteOnly ) ) { | 657 | if (!file.open( QIODevice::WriteOnly ) ) { |
649 | topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); | 658 | topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); |
650 | return; | 659 | return; |
651 | } | 660 | } |
652 | QTextStream ts( &file ); | 661 | Q3TextStream ts( &file ); |
653 | ts << text; | 662 | ts << text; |
654 | file.close(); | 663 | file.close(); |
655 | //qDebug("%s ", text.latin1()); | 664 | //qDebug("%s ", text.latin1()); |
656 | mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); | 665 | mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); |
657 | KOPrefs::instance()->mLastSaveFile = fn; | 666 | KOPrefs::instance()->mLastSaveFile = fn; |
658 | topLevelWidget()->setCaption(mes); | 667 | topLevelWidget()->setCaption(mes); |
@@ -664,18 +673,18 @@ void KOListView::saveToFileVCS() | |||
664 | writeToFile( false ); | 673 | writeToFile( false ); |
665 | } | 674 | } |
666 | void KOListView::saveToFile() | 675 | void KOListView::saveToFile() |
667 | { | 676 | { |
668 | writeToFile( true ); | 677 | writeToFile( true ); |
669 | } | 678 | } |
670 | QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos ) | 679 | Q3PtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool includeTodos, bool includeJournals, bool onlyDueTodos ) |
671 | { | 680 | { |
672 | QPtrList<Incidence> delSel ; | 681 | Q3PtrList<Incidence> delSel ; |
673 | bool addSubTodos = false; | 682 | bool addSubTodos = false; |
674 | bool askSubTodos = true; | 683 | bool askSubTodos = true; |
675 | QListViewItem *item = mListView->firstChild (); | 684 | Q3ListViewItem *item = mListView->firstChild (); |
676 | while ( item ) { | 685 | while ( item ) { |
677 | if ( item->isSelected() ) { | 686 | if ( item->isSelected() ) { |
678 | Incidence* inc = ((KOListViewItem *)item)->data(); | 687 | Incidence* inc = ((KOListViewItem *)item)->data(); |
679 | if ( ( addSubTodos && delSel.findRef( inc ) == -1) || !addSubTodos ) { | 688 | if ( ( addSubTodos && delSel.findRef( inc ) == -1) || !addSubTodos ) { |
680 | if ( (inc->typeID() == todoID && includeTodos) || | 689 | if ( (inc->typeID() == todoID && includeTodos) || |
681 | (inc->typeID() == eventID && includeEvents) || | 690 | (inc->typeID() == eventID && includeEvents) || |
@@ -703,13 +712,13 @@ QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool | |||
703 | } | 712 | } |
704 | if (result == KMessageBox::Yes) | 713 | if (result == KMessageBox::Yes) |
705 | addSubTodos = true; | 714 | addSubTodos = true; |
706 | askSubTodos = false; | 715 | askSubTodos = false; |
707 | } | 716 | } |
708 | if ( addSubTodos ) { | 717 | if ( addSubTodos ) { |
709 | QPtrList<Incidence> tempSel ; | 718 | Q3PtrList<Incidence> tempSel ; |
710 | inc->addRelationsToList( &tempSel ); | 719 | inc->addRelationsToList( &tempSel ); |
711 | Incidence* tempinc = tempSel.first(); | 720 | Incidence* tempinc = tempSel.first(); |
712 | while ( tempinc ) { | 721 | while ( tempinc ) { |
713 | if ( delSel.findRef( tempinc ) == -1 ) { | 722 | if ( delSel.findRef( tempinc ) == -1 ) { |
714 | if ( tempinc->typeID() == todoID && onlyDueTodos ) { | 723 | if ( tempinc->typeID() == todoID && onlyDueTodos ) { |
715 | if ( ((Todo*)tempinc)->hasDueDate() ) | 724 | if ( ((Todo*)tempinc)->hasDueDate() ) |
@@ -727,13 +736,13 @@ QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents, bool | |||
727 | } | 736 | } |
728 | return delSel; | 737 | return delSel; |
729 | } | 738 | } |
730 | 739 | ||
731 | void KOListView::writeToFile( bool iCal ) | 740 | void KOListView::writeToFile( bool iCal ) |
732 | { | 741 | { |
733 | QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; | 742 | Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed; |
734 | if ( !iCal ) { | 743 | if ( !iCal ) { |
735 | bool journal = false; | 744 | bool journal = false; |
736 | Incidence *incidence = delSel.first(); | 745 | Incidence *incidence = delSel.first(); |
737 | while ( incidence ) { | 746 | while ( incidence ) { |
738 | if ( incidence->typeID() == journalID ) { | 747 | if ( incidence->typeID() == journalID ) { |
739 | journal = true; | 748 | journal = true; |
@@ -800,34 +809,34 @@ void KOListView::writeToFile( bool iCal ) | |||
800 | } | 809 | } |
801 | } | 810 | } |
802 | QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); | 811 | QTimer::singleShot( 1, this, SLOT ( resetFocus() ) ); |
803 | } | 812 | } |
804 | void KOListView::hideAll() | 813 | void KOListView::hideAll() |
805 | { | 814 | { |
806 | QPtrList<QListViewItem> delSel ; | 815 | Q3PtrList<Q3ListViewItem> delSel ; |
807 | QListViewItem *item = mListView->firstChild (); | 816 | Q3ListViewItem *item = mListView->firstChild (); |
808 | while ( item ) { | 817 | while ( item ) { |
809 | if ( item->isSelected() ) { | 818 | if ( item->isSelected() ) { |
810 | delSel.append(item); | 819 | delSel.append(item); |
811 | } | 820 | } |
812 | item = item->nextSibling(); | 821 | item = item->nextSibling(); |
813 | } | 822 | } |
814 | item = delSel.first() ; | 823 | item = delSel.first() ; |
815 | while ( item ) { | 824 | while ( item ) { |
816 | QListViewItem * del = item; | 825 | Q3ListViewItem * del = item; |
817 | item = delSel.next(); | 826 | item = delSel.next(); |
818 | delete del; | 827 | delete del; |
819 | } | 828 | } |
820 | } | 829 | } |
821 | void KOListView::printList() | 830 | void KOListView::printList() |
822 | { | 831 | { |
823 | mListView->printList(); | 832 | mListView->printList(); |
824 | } | 833 | } |
825 | void KOListView::deleteAll() | 834 | void KOListView::deleteAll() |
826 | { | 835 | { |
827 | QPtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;; | 836 | Q3PtrList<Incidence> delSel = getSelectedIncidences(); // all inc allowed;; |
828 | if ( delSel.count() ) { | 837 | if ( delSel.count() ) { |
829 | int icount = delSel.count(); | 838 | int icount = delSel.count(); |
830 | Incidence *incidence = delSel.first(); | 839 | Incidence *incidence = delSel.first(); |
831 | Incidence *toDelete; | 840 | Incidence *toDelete; |
832 | KOPrefs *p = KOPrefs::instance(); | 841 | KOPrefs *p = KOPrefs::instance(); |
833 | bool confirm = p->mConfirm; | 842 | bool confirm = p->mConfirm; |
@@ -835,17 +844,17 @@ void KOListView::deleteAll() | |||
835 | mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); | 844 | mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); |
836 | if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { | 845 | if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { |
837 | p->mConfirm = false; | 846 | p->mConfirm = false; |
838 | int delCounter = 0; | 847 | int delCounter = 0; |
839 | QDialog dia ( this, "p-dialog", true ); | 848 | QDialog dia ( this, "p-dialog", true ); |
840 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); | 849 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); |
841 | QVBoxLayout lay( &dia ); | 850 | Q3VBoxLayout lay( &dia ); |
842 | lay.setMargin(7); | 851 | lay.setMargin(7); |
843 | lay.setSpacing(7); | 852 | lay.setSpacing(7); |
844 | lay.addWidget( &lab); | 853 | lay.addWidget( &lab); |
845 | QProgressBar bar( icount, &dia ); | 854 | Q3ProgressBar bar( icount, &dia ); |
846 | lay.addWidget( &bar); | 855 | lay.addWidget( &bar); |
847 | int w = 220; | 856 | int w = 220; |
848 | int h = 50; | 857 | int h = 50; |
849 | int dw = QApplication::desktop()->width(); | 858 | int dw = QApplication::desktop()->width(); |
850 | int dh = QApplication::desktop()->height(); | 859 | int dh = QApplication::desktop()->height(); |
851 | dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 860 | dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
@@ -881,16 +890,16 @@ int KOListView::maxDatesHint() | |||
881 | 890 | ||
882 | int KOListView::currentDateCount() | 891 | int KOListView::currentDateCount() |
883 | { | 892 | { |
884 | return 0; | 893 | return 0; |
885 | } | 894 | } |
886 | 895 | ||
887 | QPtrList<Incidence> KOListView::selectedIncidences() | 896 | Q3PtrList<Incidence> KOListView::selectedIncidences() |
888 | { | 897 | { |
889 | QPtrList<Incidence> eventList; | 898 | Q3PtrList<Incidence> eventList; |
890 | QListViewItem *item = mListView->firstChild (); | 899 | Q3ListViewItem *item = mListView->firstChild (); |
891 | while ( item ) { | 900 | while ( item ) { |
892 | if ( item->isSelected() ) { | 901 | if ( item->isSelected() ) { |
893 | eventList.append(((KOListViewItem *)item)->data()); | 902 | eventList.append(((KOListViewItem *)item)->data()); |
894 | } | 903 | } |
895 | 904 | ||
896 | item = item->nextSibling(); | 905 | item = item->nextSibling(); |
@@ -984,35 +993,35 @@ void KOListView::showDates(const QDate &start, const QDate &end) | |||
984 | } | 993 | } |
985 | //emit incidenceSelected( 0 ); | 994 | //emit incidenceSelected( 0 ); |
986 | updateView(); | 995 | updateView(); |
987 | 996 | ||
988 | } | 997 | } |
989 | 998 | ||
990 | void KOListView::addEvents(QPtrList<Event> eventList) | 999 | void KOListView::addEvents(Q3PtrList<Event> eventList) |
991 | { | 1000 | { |
992 | 1001 | ||
993 | Event *ev; | 1002 | Event *ev; |
994 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 1003 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
995 | addIncidence(ev); | 1004 | addIncidence(ev); |
996 | } | 1005 | } |
997 | if ( !mListView->currentItem() ){ | 1006 | if ( !mListView->currentItem() ){ |
998 | updateView(); | 1007 | updateView(); |
999 | } | 1008 | } |
1000 | } | 1009 | } |
1001 | 1010 | ||
1002 | void KOListView::addTodos(QPtrList<Todo> eventList) | 1011 | void KOListView::addTodos(Q3PtrList<Todo> eventList) |
1003 | { | 1012 | { |
1004 | Todo *ev; | 1013 | Todo *ev; |
1005 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 1014 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
1006 | addIncidence(ev); | 1015 | addIncidence(ev); |
1007 | } | 1016 | } |
1008 | if ( !mListView->currentItem() ){ | 1017 | if ( !mListView->currentItem() ){ |
1009 | updateView(); | 1018 | updateView(); |
1010 | } | 1019 | } |
1011 | } | 1020 | } |
1012 | void KOListView::addJournals(QPtrList<Journal> eventList) | 1021 | void KOListView::addJournals(Q3PtrList<Journal> eventList) |
1013 | { | 1022 | { |
1014 | Journal *ev; | 1023 | Journal *ev; |
1015 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 1024 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
1016 | addIncidence(ev); | 1025 | addIncidence(ev); |
1017 | } | 1026 | } |
1018 | if ( !mListView->currentItem() ){ | 1027 | if ( !mListView->currentItem() ){ |
@@ -1041,13 +1050,13 @@ void KOListView::addIncidence(Incidence *incidence) | |||
1041 | if (incidence->accept(v)) { | 1050 | if (incidence->accept(v)) { |
1042 | return; | 1051 | return; |
1043 | } | 1052 | } |
1044 | else delete item; | 1053 | else delete item; |
1045 | } | 1054 | } |
1046 | 1055 | ||
1047 | void KOListView::showEvents(QPtrList<Event> eventList) | 1056 | void KOListView::showEvents(Q3PtrList<Event> eventList) |
1048 | { | 1057 | { |
1049 | clear(); | 1058 | clear(); |
1050 | 1059 | ||
1051 | addEvents(eventList); | 1060 | addEvents(eventList); |
1052 | 1061 | ||
1053 | // After new creation of list view no events are selected. | 1062 | // After new creation of list view no events are selected. |
@@ -1092,20 +1101,20 @@ KOListViewItem *KOListView::getItemForEvent(Incidence *event) | |||
1092 | if (item->data() == event) return item; | 1101 | if (item->data() == event) return item; |
1093 | item = (KOListViewItem *)item->nextSibling(); | 1102 | item = (KOListViewItem *)item->nextSibling(); |
1094 | } | 1103 | } |
1095 | return 0; | 1104 | return 0; |
1096 | } | 1105 | } |
1097 | 1106 | ||
1098 | void KOListView::defaultItemAction(QListViewItem *i) | 1107 | void KOListView::defaultItemAction(Q3ListViewItem *i) |
1099 | { | 1108 | { |
1100 | KOListViewItem *item = static_cast<KOListViewItem *>( i ); | 1109 | KOListViewItem *item = static_cast<KOListViewItem *>( i ); |
1101 | if ( item ) defaultAction( item->data() ); | 1110 | if ( item ) defaultAction( item->data() ); |
1102 | 1111 | ||
1103 | } | 1112 | } |
1104 | 1113 | ||
1105 | void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) | 1114 | void KOListView::popupMenu(Q3ListViewItem *item,const QPoint &,int) |
1106 | { | 1115 | { |
1107 | mActiveItem = (KOListViewItem *)item; | 1116 | mActiveItem = (KOListViewItem *)item; |
1108 | if (mActiveItem) { | 1117 | if (mActiveItem) { |
1109 | Incidence *incidence = mActiveItem->data(); | 1118 | Incidence *incidence = mActiveItem->data(); |
1110 | mPopupMenu->enableDefault( !mListView->hasMultiSelection( item ) ); | 1119 | mPopupMenu->enableDefault( !mListView->hasMultiSelection( item ) ); |
1111 | mPopupMenu->showIncidencePopup(incidence); | 1120 | mPopupMenu->showIncidencePopup(incidence); |
@@ -1128,13 +1137,13 @@ void KOListView::readSettings(KConfig *config, QString setting) | |||
1128 | void KOListView::writeSettings(KConfig *config, QString setting) | 1137 | void KOListView::writeSettings(KConfig *config, QString setting) |
1129 | { | 1138 | { |
1130 | // qDebug("KOListView::writeSettings "); | 1139 | // qDebug("KOListView::writeSettings "); |
1131 | mListView->saveLayout(config, setting); | 1140 | mListView->saveLayout(config, setting); |
1132 | } | 1141 | } |
1133 | 1142 | ||
1134 | void KOListView::processSelectionChange(QListViewItem *) | 1143 | void KOListView::processSelectionChange(Q3ListViewItem *) |
1135 | { | 1144 | { |
1136 | 1145 | ||
1137 | KOListViewItem *item = | 1146 | KOListViewItem *item = |
1138 | static_cast<KOListViewItem *>( mListView->currentItem() ); | 1147 | static_cast<KOListViewItem *>( mListView->currentItem() ); |
1139 | 1148 | ||
1140 | if ( !item ) { | 1149 | if ( !item ) { |
@@ -1177,30 +1186,30 @@ void KOListView::keyPressEvent ( QKeyEvent *e) | |||
1177 | } | 1186 | } |
1178 | void KOListViewListView::keyPressEvent ( QKeyEvent *e) | 1187 | void KOListViewListView::keyPressEvent ( QKeyEvent *e) |
1179 | { | 1188 | { |
1180 | 1189 | ||
1181 | switch ( e->key() ) { | 1190 | switch ( e->key() ) { |
1182 | case Qt::Key_Down: | 1191 | case Qt::Key_Down: |
1183 | if ( e->state() == ShiftButton ) { | 1192 | if ( e->state() == Qt::ShiftButton ) { |
1184 | QListViewItem* cn = currentItem(); | 1193 | Q3ListViewItem* cn = currentItem(); |
1185 | if ( !cn ) | 1194 | if ( !cn ) |
1186 | cn = firstChild(); | 1195 | cn = firstChild(); |
1187 | if ( !cn ) | 1196 | if ( !cn ) |
1188 | return; | 1197 | return; |
1189 | while ( cn->nextSibling() ) | 1198 | while ( cn->nextSibling() ) |
1190 | cn = cn->nextSibling(); | 1199 | cn = cn->nextSibling(); |
1191 | setCurrentItem ( cn ); | 1200 | setCurrentItem ( cn ); |
1192 | ensureItemVisible ( cn ); | 1201 | ensureItemVisible ( cn ); |
1193 | 1202 | ||
1194 | e->accept(); | 1203 | e->accept(); |
1195 | return; | 1204 | return; |
1196 | } | 1205 | } |
1197 | if ( e->state() == ControlButton ) { | 1206 | if ( e->state() == Qt::ControlButton ) { |
1198 | int count = childCount (); | 1207 | int count = childCount (); |
1199 | int jump = count / 5; | 1208 | int jump = count / 5; |
1200 | QListViewItem* cn; | 1209 | Q3ListViewItem* cn; |
1201 | cn = currentItem(); | 1210 | cn = currentItem(); |
1202 | if ( ! cn ) | 1211 | if ( ! cn ) |
1203 | return; | 1212 | return; |
1204 | if ( jump == 0 ) | 1213 | if ( jump == 0 ) |
1205 | jump = 1; | 1214 | jump = 1; |
1206 | while ( jump && cn->nextSibling() ) { | 1215 | while ( jump && cn->nextSibling() ) { |
@@ -1208,47 +1217,47 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1208 | --jump; | 1217 | --jump; |
1209 | } | 1218 | } |
1210 | setCurrentItem ( cn ); | 1219 | setCurrentItem ( cn ); |
1211 | ensureItemVisible ( cn ); | 1220 | ensureItemVisible ( cn ); |
1212 | 1221 | ||
1213 | } else | 1222 | } else |
1214 | QListView::keyPressEvent ( e ) ; | 1223 | Q3ListView::keyPressEvent ( e ) ; |
1215 | e->accept(); | 1224 | e->accept(); |
1216 | break; | 1225 | break; |
1217 | 1226 | ||
1218 | case Qt::Key_Up: | 1227 | case Qt::Key_Up: |
1219 | if ( e->state() == ShiftButton ) { | 1228 | if ( e->state() == Qt::ShiftButton ) { |
1220 | QListViewItem* cn = firstChild(); | 1229 | Q3ListViewItem* cn = firstChild(); |
1221 | if ( cn ) { | 1230 | if ( cn ) { |
1222 | setCurrentItem ( cn ); | 1231 | setCurrentItem ( cn ); |
1223 | ensureItemVisible ( cn ); | 1232 | ensureItemVisible ( cn ); |
1224 | } | 1233 | } |
1225 | e->accept(); | 1234 | e->accept(); |
1226 | return; | 1235 | return; |
1227 | } | 1236 | } |
1228 | if ( e->state() == ControlButton ) { | 1237 | if ( e->state() == Qt::ControlButton ) { |
1229 | int count = childCount (); | 1238 | int count = childCount (); |
1230 | int jump = count / 5; | 1239 | int jump = count / 5; |
1231 | QListViewItem* cn; | 1240 | Q3ListViewItem* cn; |
1232 | cn = currentItem(); | 1241 | cn = currentItem(); |
1233 | if ( ! cn ) | 1242 | if ( ! cn ) |
1234 | return; | 1243 | return; |
1235 | if ( jump == 0 ) | 1244 | if ( jump == 0 ) |
1236 | jump = 1; | 1245 | jump = 1; |
1237 | while ( jump && cn->itemAbove ()) { | 1246 | while ( jump && cn->itemAbove ()) { |
1238 | cn = cn->itemAbove (); | 1247 | cn = cn->itemAbove (); |
1239 | --jump; | 1248 | --jump; |
1240 | } | 1249 | } |
1241 | setCurrentItem ( cn ); | 1250 | setCurrentItem ( cn ); |
1242 | ensureItemVisible ( cn ); | 1251 | ensureItemVisible ( cn ); |
1243 | } else | 1252 | } else |
1244 | QListView::keyPressEvent ( e ) ; | 1253 | Q3ListView::keyPressEvent ( e ) ; |
1245 | e->accept(); | 1254 | e->accept(); |
1246 | break; | 1255 | break; |
1247 | case Qt::Key_I: { | 1256 | case Qt::Key_I: { |
1248 | QListViewItem* cn; | 1257 | Q3ListViewItem* cn; |
1249 | cn = currentItem(); | 1258 | cn = currentItem(); |
1250 | if ( cn ) { | 1259 | if ( cn ) { |
1251 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1260 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1252 | if ( ci ){ | 1261 | if ( ci ){ |
1253 | //emit showIncidence( ci->data()); | 1262 | //emit showIncidence( ci->data()); |
1254 | cn = cn->nextSibling(); | 1263 | cn = cn->nextSibling(); |
@@ -1262,18 +1271,18 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1262 | e->accept(); | 1271 | e->accept(); |
1263 | } | 1272 | } |
1264 | break; | 1273 | break; |
1265 | case Qt::Key_Return: | 1274 | case Qt::Key_Return: |
1266 | case Qt::Key_Enter: | 1275 | case Qt::Key_Enter: |
1267 | { | 1276 | { |
1268 | QListViewItem* cn; | 1277 | Q3ListViewItem* cn; |
1269 | cn = currentItem(); | 1278 | cn = currentItem(); |
1270 | if ( cn ) { | 1279 | if ( cn ) { |
1271 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 1280 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
1272 | if ( ci ){ | 1281 | if ( ci ){ |
1273 | if ( e->state() == ShiftButton ) | 1282 | if ( e->state() == Qt::ShiftButton ) |
1274 | ci->setSelected( false ); | 1283 | ci->setSelected( false ); |
1275 | else | 1284 | else |
1276 | ci->setSelected( true ); | 1285 | ci->setSelected( true ); |
1277 | cn = cn->nextSibling(); | 1286 | cn = cn->nextSibling(); |
1278 | if ( cn ) { | 1287 | if ( cn ) { |
1279 | setCurrentItem ( cn ); | 1288 | setCurrentItem ( cn ); |
@@ -1297,43 +1306,43 @@ KOListViewListView::KOListViewListView(KOListView * lv ) | |||
1297 | setAllColumnsShowFocus( true ); | 1306 | setAllColumnsShowFocus( true ); |
1298 | mPopupTimer = new QTimer(this); | 1307 | mPopupTimer = new QTimer(this); |
1299 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); | 1308 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); |
1300 | #ifndef DESKTOP_VERSION | 1309 | #ifndef DESKTOP_VERSION |
1301 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1310 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1302 | #endif | 1311 | #endif |
1303 | setSelectionMode( QListView::Multi ); | 1312 | setSelectionMode( Q3ListView::Multi ); |
1304 | setMultiSelection( true); | 1313 | setMultiSelection( true); |
1305 | } | 1314 | } |
1306 | bool KOListViewListView::hasMultiSelection(QListViewItem* item) | 1315 | bool KOListViewListView::hasMultiSelection(Q3ListViewItem* item) |
1307 | { | 1316 | { |
1308 | QListViewItem *qitem = firstChild (); | 1317 | Q3ListViewItem *qitem = firstChild (); |
1309 | while ( qitem ) { | 1318 | while ( qitem ) { |
1310 | if ( qitem->isSelected() && item != qitem ) | 1319 | if ( qitem->isSelected() && item != qitem ) |
1311 | return true; | 1320 | return true; |
1312 | qitem = qitem->nextSibling(); | 1321 | qitem = qitem->nextSibling(); |
1313 | } | 1322 | } |
1314 | return false; | 1323 | return false; |
1315 | } | 1324 | } |
1316 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 1325 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
1317 | { | 1326 | { |
1318 | if (!e) return; | 1327 | if (!e) return; |
1319 | QPoint vp = contentsToViewport(e->pos()); | 1328 | QPoint vp = contentsToViewport(e->pos()); |
1320 | QListViewItem *item = itemAt(vp); | 1329 | Q3ListViewItem *item = itemAt(vp); |
1321 | if (!item) { | 1330 | if (!item) { |
1322 | emit newEvent(); | 1331 | emit newEvent(); |
1323 | return; | 1332 | return; |
1324 | } | 1333 | } |
1325 | KListView::contentsMouseDoubleClickEvent(e); | 1334 | KListView::contentsMouseDoubleClickEvent(e); |
1326 | } | 1335 | } |
1327 | #if 0 | 1336 | #if 0 |
1328 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1337 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1329 | { | 1338 | { |
1330 | //qDebug("contentsMousePressEvent++++ "); | 1339 | //qDebug("contentsMousePressEvent++++ "); |
1331 | KListView::contentsMousePressEvent( e ); | 1340 | KListView::contentsMousePressEvent( e ); |
1332 | if ( e->button() == RightButton ) { | 1341 | if ( e->button() == Qt::RightButton ) { |
1333 | QListViewItem* ci = currentItem(); | 1342 | Q3ListViewItem* ci = currentItem(); |
1334 | clearSelection () ; | 1343 | clearSelection () ; |
1335 | if ( ci ) | 1344 | if ( ci ) |
1336 | ci->setSelected( true ); | 1345 | ci->setSelected( true ); |
1337 | } | 1346 | } |
1338 | } | 1347 | } |
1339 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) | 1348 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) |
@@ -1345,28 +1354,28 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) | |||
1345 | KListView::contentsMouseMoveEvent(e); | 1354 | KListView::contentsMouseMoveEvent(e); |
1346 | } | 1355 | } |
1347 | #endif | 1356 | #endif |
1348 | void KOListViewListView::popupMenu() | 1357 | void KOListViewListView::popupMenu() |
1349 | { | 1358 | { |
1350 | mPopupTimer->stop(); | 1359 | mPopupTimer->stop(); |
1351 | QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, RightButton , RightButton ); | 1360 | QMouseEvent* e = new QMouseEvent( QEvent::MouseButtonPress, mEventPos ,mEventGlobalPos, Qt::RightButton , Qt::RightButton ); |
1352 | QApplication::postEvent( this->viewport(), e ); | 1361 | QApplication::postEvent( this->viewport(), e ); |
1353 | 1362 | ||
1354 | } | 1363 | } |
1355 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1364 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1356 | { | 1365 | { |
1357 | //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); | 1366 | //qDebug("contentsMousePressEvent++++ %d %d", e->pos().y(), e->globalPos().y()); |
1358 | mYMousePos = mapToGlobal( (e->pos())).y(); | 1367 | mYMousePos = mapToGlobal( (e->pos())).y(); |
1359 | if ( e->button() == LeftButton ) { | 1368 | if ( e->button() == Qt::LeftButton ) { |
1360 | mPopupTimer->start( 600 ); | 1369 | mPopupTimer->start( 600 ); |
1361 | mEventPos = contentsToViewport(e->pos()); | 1370 | mEventPos = contentsToViewport(e->pos()); |
1362 | mEventGlobalPos = e->globalPos(); | 1371 | mEventGlobalPos = e->globalPos(); |
1363 | } | 1372 | } |
1364 | KListView::contentsMousePressEvent( e ); | 1373 | KListView::contentsMousePressEvent( e ); |
1365 | if ( e->button() == RightButton ) { | 1374 | if ( e->button() == Qt::RightButton ) { |
1366 | QListViewItem* ci = currentItem(); | 1375 | Q3ListViewItem* ci = currentItem(); |
1367 | //clearSelection(); | 1376 | //clearSelection(); |
1368 | if ( ci ) | 1377 | if ( ci ) |
1369 | ci->setSelected( true ); | 1378 | ci->setSelected( true ); |
1370 | } | 1379 | } |
1371 | } | 1380 | } |
1372 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) | 1381 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) |
@@ -1387,13 +1396,13 @@ void KOListViewListView::contentsMouseMoveEvent(QMouseEvent *e) | |||
1387 | mEventGlobalPos = e->globalPos(); | 1396 | mEventGlobalPos = e->globalPos(); |
1388 | } | 1397 | } |
1389 | KListView::contentsMouseMoveEvent(e); | 1398 | KListView::contentsMouseMoveEvent(e); |
1390 | } | 1399 | } |
1391 | 1400 | ||
1392 | #define protected public | 1401 | #define protected public |
1393 | #include <qheader.h> | 1402 | #include <q3header.h> |
1394 | #undef protected | 1403 | #undef protected |
1395 | void KOListViewListView::printList() | 1404 | void KOListViewListView::printList() |
1396 | { | 1405 | { |
1397 | #ifdef DESKTOP_VERSION | 1406 | #ifdef DESKTOP_VERSION |
1398 | KOPrintPrefs pp ( this ); | 1407 | KOPrintPrefs pp ( this ); |
1399 | if (!pp.exec() ) | 1408 | if (!pp.exec() ) |
@@ -1404,13 +1413,13 @@ void KOListViewListView::printList() | |||
1404 | if (!printer.setup() ) | 1413 | if (!printer.setup() ) |
1405 | return; | 1414 | return; |
1406 | clearSelection (); | 1415 | clearSelection (); |
1407 | QPainter p; | 1416 | QPainter p; |
1408 | p.begin ( &printer ); | 1417 | p.begin ( &printer ); |
1409 | p.setFont(font()); | 1418 | p.setFont(font()); |
1410 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | 1419 | Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); |
1411 | float dx, dy; | 1420 | float dx, dy; |
1412 | int wid = (m.width() * 9)/10; | 1421 | int wid = (m.width() * 9)/10; |
1413 | dx = (float) wid/(float)contentsWidth (); | 1422 | dx = (float) wid/(float)contentsWidth (); |
1414 | dy = (float)(m.height()) / (float)contentsHeight (); | 1423 | dy = (float)(m.height()) / (float)contentsHeight (); |
1415 | float scale; | 1424 | float scale; |
1416 | // scale to fit the width or height of the paper | 1425 | // scale to fit the width or height of the paper |
@@ -1440,13 +1449,13 @@ void KOListViewListView::printList() | |||
1440 | int yOff = 0; | 1449 | int yOff = 0; |
1441 | while ( item ) { | 1450 | while ( item ) { |
1442 | p.translate( 0, yOff ); | 1451 | p.translate( 0, yOff ); |
1443 | p.save(); | 1452 | p.save(); |
1444 | for ( iii = 0; iii < cou; ++iii ) { | 1453 | for ( iii = 0; iii < cou; ++iii ) { |
1445 | int align = columnAlignment( iii ); | 1454 | int align = columnAlignment( iii ); |
1446 | if ( align == AlignAuto ) align = AlignLeft; | 1455 | if ( align == Qt::AlignLeft ) align = Qt::AlignLeft; |
1447 | p.restore(); | 1456 | p.restore(); |
1448 | p.save(); | 1457 | p.save(); |
1449 | p.translate( header()->sectionPos( iii ), 0); | 1458 | p.translate( header()->sectionPos( iii ), 0); |
1450 | item->paintCell( &p, cg, iii, header()->sectionSize (iii), align ); | 1459 | item->paintCell( &p, cg, iii, header()->sectionSize (iii), align ); |
1451 | } | 1460 | } |
1452 | yOff = item->height(); | 1461 | yOff = item->height(); |
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index 99d0561..9fb0b00 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h | |||
@@ -21,15 +21,21 @@ | |||
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef _KOLISTVIEW_H | 24 | #ifndef _KOLISTVIEW_H |
25 | #define _KOLISTVIEW_H | 25 | #define _KOLISTVIEW_H |
26 | 26 | ||
27 | #include <qlistview.h> | 27 | #include <q3listview.h> |
28 | #include <qmap.h> | 28 | #include <qmap.h> |
29 | #include <qdict.h> | 29 | #include <q3dict.h> |
30 | //Added by qt3to4: | ||
31 | #include <QMouseEvent> | ||
32 | #include <Q3PtrList> | ||
33 | #include <Q3PopupMenu> | ||
34 | #include <QKeyEvent> | ||
35 | #include <Q3VBoxLayout> | ||
30 | 36 | ||
31 | #include <klistview.h> | 37 | #include <klistview.h> |
32 | 38 | ||
33 | #include <libkcal/incidence.h> | 39 | #include <libkcal/incidence.h> |
34 | 40 | ||
35 | #include "koeventview.h" | 41 | #include "koeventview.h" |
@@ -44,26 +50,26 @@ class KOListViewWhatsThis; | |||
44 | #include <qdialog.h> | 50 | #include <qdialog.h> |
45 | #include <qtimer.h> | 51 | #include <qtimer.h> |
46 | #include <qcombobox.h> | 52 | #include <qcombobox.h> |
47 | #include <qspinbox.h> | 53 | #include <qspinbox.h> |
48 | #include <qtooltip.h> | 54 | #include <qtooltip.h> |
49 | #include <qcheckbox.h> | 55 | #include <qcheckbox.h> |
50 | #include <qhbox.h> | 56 | #include <q3hbox.h> |
51 | #include <qlabel.h> | 57 | #include <qlabel.h> |
52 | #include <kiconloader.h> | 58 | #include <kiconloader.h> |
53 | #include "kfiledialog.h" | 59 | #include "kfiledialog.h" |
54 | #include "koprefs.h" | 60 | #include "koprefs.h" |
55 | class KOAlarmPrefs : public QDialog | 61 | class KOAlarmPrefs : public QDialog |
56 | { | 62 | { |
57 | Q_OBJECT | 63 | Q_OBJECT |
58 | public: | 64 | public: |
59 | KOAlarmPrefs( QWidget *par=0, const char *name=0 ) : | 65 | KOAlarmPrefs( QWidget *par=0, const char *name=0 ) : |
60 | QDialog( par, name, true ) | 66 | QDialog( par, name, true ) |
61 | { | 67 | { |
62 | setCaption( i18n("Alarm Options") ); | 68 | setCaption( i18n("Alarm Options") ); |
63 | QVBoxLayout* alarmLayout = new QVBoxLayout( this ); | 69 | Q3VBoxLayout* alarmLayout = new Q3VBoxLayout( this ); |
64 | alarmLayout->setSpacing( 3 ); | 70 | alarmLayout->setSpacing( 3 ); |
65 | alarmLayout->setMargin( 3 ); | 71 | alarmLayout->setMargin( 3 ); |
66 | QWidget *parent = this; | 72 | QWidget *parent = this; |
67 | mAlarmButton = new QCheckBox(i18n("Set reminder ON with offset to:"),parent); | 73 | mAlarmButton = new QCheckBox(i18n("Set reminder ON with offset to:"),parent); |
68 | alarmLayout->addWidget(mAlarmButton); | 74 | alarmLayout->addWidget(mAlarmButton); |
69 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; | 75 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; |
@@ -71,13 +77,13 @@ class KOAlarmPrefs : public QDialog | |||
71 | alarmLayout->addWidget(mAlarmTimeEdit); | 77 | alarmLayout->addWidget(mAlarmTimeEdit); |
72 | mAlarmIncrCombo = new QComboBox(false, parent); | 78 | mAlarmIncrCombo = new QComboBox(false, parent); |
73 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); | 79 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); |
74 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); | 80 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); |
75 | mAlarmIncrCombo->insertItem(i18n("day(s)")); | 81 | mAlarmIncrCombo->insertItem(i18n("day(s)")); |
76 | alarmLayout->addWidget(mAlarmIncrCombo); | 82 | alarmLayout->addWidget(mAlarmIncrCombo); |
77 | QHBox * hb = new QHBox ( parent ); | 83 | Q3HBox * hb = new Q3HBox ( parent ); |
78 | alarmLayout->addWidget(hb); | 84 | alarmLayout->addWidget(hb); |
79 | mAlarmSoundButton = new QPushButton(hb); | 85 | mAlarmSoundButton = new QPushButton(hb); |
80 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); | 86 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); |
81 | mAlarmSoundButton->setToggleButton(true); | 87 | mAlarmSoundButton->setToggleButton(true); |
82 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); | 88 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); |
83 | mAlarmProgramButton = new QPushButton(hb); | 89 | mAlarmProgramButton = new QPushButton(hb); |
@@ -207,13 +213,13 @@ class KOListView; | |||
207 | 213 | ||
208 | class KOListViewListView : public KListView | 214 | class KOListViewListView : public KListView |
209 | { | 215 | { |
210 | Q_OBJECT | 216 | Q_OBJECT |
211 | public: | 217 | public: |
212 | KOListViewListView(KOListView * lv ); | 218 | KOListViewListView(KOListView * lv ); |
213 | bool hasMultiSelection(QListViewItem*); | 219 | bool hasMultiSelection(Q3ListViewItem*); |
214 | void printList(); | 220 | void printList(); |
215 | signals: | 221 | signals: |
216 | void newEvent(); | 222 | void newEvent(); |
217 | void showIncidence( Incidence* ); | 223 | void showIncidence( Incidence* ); |
218 | public slots: | 224 | public slots: |
219 | void popupMenu(); | 225 | void popupMenu(); |
@@ -237,42 +243,42 @@ class KOListView : public KOEventView | |||
237 | KOListView(Calendar *calendar, QWidget *parent = 0, | 243 | KOListView(Calendar *calendar, QWidget *parent = 0, |
238 | const char *name = 0); | 244 | const char *name = 0); |
239 | ~KOListView(); | 245 | ~KOListView(); |
240 | 246 | ||
241 | virtual int maxDatesHint(); | 247 | virtual int maxDatesHint(); |
242 | virtual int currentDateCount(); | 248 | virtual int currentDateCount(); |
243 | virtual QPtrList<Incidence> selectedIncidences(); | 249 | virtual Q3PtrList<Incidence> selectedIncidences(); |
244 | virtual DateList selectedDates(); | 250 | virtual DateList selectedDates(); |
245 | 251 | ||
246 | void showDates(bool show); | 252 | void showDates(bool show); |
247 | Incidence* currentItem(); | 253 | Incidence* currentItem(); |
248 | void addTodos(QPtrList<Todo> eventList); | 254 | void addTodos(Q3PtrList<Todo> eventList); |
249 | void addJournals(QPtrList<Journal> eventList); | 255 | void addJournals(Q3PtrList<Journal> eventList); |
250 | virtual void printPreview(CalPrinter *calPrinter, | 256 | virtual void printPreview(CalPrinter *calPrinter, |
251 | const QDate &, const QDate &); | 257 | const QDate &, const QDate &); |
252 | 258 | ||
253 | void readSettings(KConfig *config, QString setting = "KOListView Layout"); | 259 | void readSettings(KConfig *config, QString setting = "KOListView Layout"); |
254 | void writeSettings(KConfig *config, QString setting = "KOListView Layout"); | 260 | void writeSettings(KConfig *config, QString setting = "KOListView Layout"); |
255 | void updateList(); | 261 | void updateList(); |
256 | void clearList(); | 262 | void clearList(); |
257 | void setStartDate(const QDate &start); | 263 | void setStartDate(const QDate &start); |
258 | int count(); | 264 | int count(); |
259 | QString getWhatsThisText(QPoint p); | 265 | QString getWhatsThisText(QPoint p); |
260 | QPtrList<Incidence> KOListView::getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); | 266 | Q3PtrList<Incidence> getSelectedIncidences( bool includeEvents = true, bool includeTodos = true , bool includeJournals = true, bool onlyDueTodos = false ); |
261 | void showCompletedTodos(); | 267 | void showCompletedTodos(); |
262 | signals: | 268 | signals: |
263 | void signalNewEvent(); | 269 | void signalNewEvent(); |
264 | void beamIncidenceList(QPtrList<Incidence>); | 270 | void beamIncidenceList(Q3PtrList<Incidence>); |
265 | 271 | ||
266 | public slots: | 272 | public slots: |
267 | void hideAll(); | 273 | void hideAll(); |
268 | void printList(); | 274 | void printList(); |
269 | void resetFocus(); | 275 | void resetFocus(); |
270 | virtual void updateView(); | 276 | virtual void updateView(); |
271 | virtual void showDates(const QDate &start, const QDate &end); | 277 | virtual void showDates(const QDate &start, const QDate &end); |
272 | virtual void showEvents(QPtrList<Event> eventList); | 278 | virtual void showEvents(Q3PtrList<Event> eventList); |
273 | void clearSelection(); | 279 | void clearSelection(); |
274 | void allSelection(); | 280 | void allSelection(); |
275 | 281 | ||
276 | void clear(); | 282 | void clear(); |
277 | void showDates(); | 283 | void showDates(); |
278 | void hideDates(); | 284 | void hideDates(); |
@@ -284,34 +290,34 @@ class KOListView : public KOEventView | |||
284 | void updateConfig(); | 290 | void updateConfig(); |
285 | void setCat(); | 291 | void setCat(); |
286 | void setAlarm(); | 292 | void setAlarm(); |
287 | void setCategories( bool removeOld ); | 293 | void setCategories( bool removeOld ); |
288 | void changeEventDisplay(Event *, int); | 294 | void changeEventDisplay(Event *, int); |
289 | 295 | ||
290 | void defaultItemAction(QListViewItem *item); | 296 | void defaultItemAction(Q3ListViewItem *item); |
291 | void popupMenu(QListViewItem *item,const QPoint &,int); | 297 | void popupMenu(Q3ListViewItem *item,const QPoint &,int); |
292 | void setCalendar( int c ); | 298 | void setCalendar( int c ); |
293 | void populateCalPopup(); | 299 | void populateCalPopup(); |
294 | 300 | ||
295 | protected slots: | 301 | protected slots: |
296 | void processSelectionChange(QListViewItem *); | 302 | void processSelectionChange(Q3ListViewItem *); |
297 | void catChanged( Incidence* ); | 303 | void catChanged( Incidence* ); |
298 | 304 | ||
299 | protected: | 305 | protected: |
300 | void writeToFile( bool iCal ); | 306 | void writeToFile( bool iCal ); |
301 | void addEvents(QPtrList<Event> eventList); | 307 | void addEvents(Q3PtrList<Event> eventList); |
302 | void addIncidence(Incidence *); | 308 | void addIncidence(Incidence *); |
303 | KOListViewItem *getItemForEvent(Incidence *event); | 309 | KOListViewItem *getItemForEvent(Incidence *event); |
304 | 310 | ||
305 | private: | 311 | private: |
306 | bool mForceShowCompletedTodos; | 312 | bool mForceShowCompletedTodos; |
307 | QPopupMenu* mCalPopup; | 313 | Q3PopupMenu* mCalPopup; |
308 | KOListViewWhatsThis *mKOListViewWhatsThis; | 314 | KOListViewWhatsThis *mKOListViewWhatsThis; |
309 | KOListViewListView *mListView; | 315 | KOListViewListView *mListView; |
310 | KOEventPopupMenu *mPopupMenu; | 316 | KOEventPopupMenu *mPopupMenu; |
311 | KOListViewItem *mActiveItem; | 317 | KOListViewItem *mActiveItem; |
312 | QDict<Incidence> mUidDict; | 318 | Q3Dict<Incidence> mUidDict; |
313 | QDate mStartDate; | 319 | QDate mStartDate; |
314 | void keyPressEvent ( QKeyEvent * ) ; | 320 | void keyPressEvent ( QKeyEvent * ) ; |
315 | }; | 321 | }; |
316 | 322 | ||
317 | #endif | 323 | #endif |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 85e9166..ca55c43 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -14,28 +14,40 @@ | |||
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qpopupmenu.h> | 20 | #include <q3popupmenu.h> |
21 | #include <qfont.h> | 21 | #include <qfont.h> |
22 | #include <qfontmetrics.h> | 22 | #include <qfontmetrics.h> |
23 | #include <qkeycode.h> | 23 | #include <qnamespace.h> |
24 | #include <qhbox.h> | 24 | #include <q3hbox.h> |
25 | #include <qvbox.h> | 25 | #include <q3vbox.h> |
26 | #include <qwidgetstack.h> | 26 | #include <q3widgetstack.h> |
27 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
28 | #include <qtooltip.h> | 28 | #include <qtooltip.h> |
29 | #include <qpainter.h> | 29 | #include <qpainter.h> |
30 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | #include <qwhatsthis.h> | 31 | #include <q3whatsthis.h> |
32 | #ifndef DESKTOP_VERSION | 32 | #ifndef DESKTOP_VERSION |
33 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
34 | #else | 34 | #else |
35 | #include <qapplication.h> | 35 | #include <qapplication.h> |
36 | #include <QDesktopWidget> | ||
37 | //Added by qt3to4: | ||
38 | #include <QResizeEvent> | ||
39 | #include <QLabel> | ||
40 | #include <QPixmap> | ||
41 | #include <QFocusEvent> | ||
42 | #include <QMouseEvent> | ||
43 | #include <QKeyEvent> | ||
44 | #include <Q3VBoxLayout> | ||
45 | #include <Q3Frame> | ||
46 | #include <Q3PointArray> | ||
47 | #include <Q3PtrList> | ||
36 | #endif | 48 | #endif |
37 | 49 | ||
38 | #include <kdebug.h> | 50 | #include <kdebug.h> |
39 | #include <klocale.h> | 51 | #include <klocale.h> |
40 | #include <kglobal.h> | 52 | #include <kglobal.h> |
41 | #include <kconfig.h> | 53 | #include <kconfig.h> |
@@ -56,16 +68,16 @@ | |||
56 | #include "komonthview.h" | 68 | #include "komonthview.h" |
57 | 69 | ||
58 | #define PIXMAP_SIZE 5 | 70 | #define PIXMAP_SIZE 5 |
59 | #ifdef DESKTOP_VERSION | 71 | #ifdef DESKTOP_VERSION |
60 | QToolTipGroup *MonthViewCell::mToolTipGroup = 0; | 72 | QToolTipGroup *MonthViewCell::mToolTipGroup = 0; |
61 | #endif | 73 | #endif |
62 | class KNOWhatsThis :public QWhatsThis | 74 | class KNOWhatsThis :public Q3WhatsThis |
63 | { | 75 | { |
64 | public: | 76 | public: |
65 | KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; | 77 | KNOWhatsThis( KNoScrollListBox* sbox ) : Q3WhatsThis( sbox ), _wid( sbox) { }; |
66 | //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; | 78 | //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); }; |
67 | 79 | ||
68 | protected: | 80 | protected: |
69 | virtual QString text( const QPoint& p) | 81 | virtual QString text( const QPoint& p) |
70 | { | 82 | { |
71 | return _wid->getWhatsThisText(p) ; | 83 | return _wid->getWhatsThisText(p) ; |
@@ -74,22 +86,22 @@ private: | |||
74 | KNoScrollListBox* _wid; | 86 | KNoScrollListBox* _wid; |
75 | 87 | ||
76 | }; | 88 | }; |
77 | 89 | ||
78 | 90 | ||
79 | KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) | 91 | KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) |
80 | : QListBox(parent, name, WRepaintNoErase) | 92 | : Q3ListBox(parent, name, Qt::WNoAutoErase) |
81 | { | 93 | { |
82 | #ifndef DESKTOP_VERSION | 94 | #ifndef DESKTOP_VERSION |
83 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); | 95 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); |
84 | #endif | 96 | #endif |
85 | mBlockDeselect = false; | 97 | mBlockDeselect = false; |
86 | mWT = new KNOWhatsThis(this); | 98 | mWT = new KNOWhatsThis(this); |
87 | resetOnFocusIn = true; | 99 | resetOnFocusIn = true; |
88 | setVScrollBarMode(QScrollView::AlwaysOff); | 100 | setVScrollBarMode(Q3ScrollView::AlwaysOff); |
89 | setHScrollBarMode(QScrollView::AlwaysOff); | 101 | setHScrollBarMode(Q3ScrollView::AlwaysOff); |
90 | } | 102 | } |
91 | KNoScrollListBox::~KNoScrollListBox() | 103 | KNoScrollListBox::~KNoScrollListBox() |
92 | { | 104 | { |
93 | #if QT_VERSION >= 0x030000 | 105 | #if QT_VERSION >= 0x030000 |
94 | 106 | ||
95 | #else | 107 | #else |
@@ -97,94 +109,94 @@ KNoScrollListBox::~KNoScrollListBox() | |||
97 | #endif | 109 | #endif |
98 | } | 110 | } |
99 | 111 | ||
100 | 112 | ||
101 | void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) | 113 | void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) |
102 | { | 114 | { |
103 | QListBox::focusInEvent ( e ); | 115 | Q3ListBox::focusInEvent ( e ); |
104 | if ( count() ){ | 116 | if ( count() ){ |
105 | int ci = currentItem(); | 117 | int ci = currentItem(); |
106 | if ( ci < 0 ) ci = 0; | 118 | if ( ci < 0 ) ci = 0; |
107 | 119 | ||
108 | setCurrentItem( ci ); | 120 | setCurrentItem( ci ); |
109 | setSelected ( ci, true ); | 121 | setSelected ( ci, true ); |
110 | emit highlighted( item ( ci ) ); | 122 | emit highlighted( item ( ci ) ); |
111 | 123 | ||
112 | resetOnFocusIn = true; | 124 | resetOnFocusIn = true; |
113 | 125 | ||
114 | if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { | 126 | if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) { |
115 | QListBoxItem *fi = firstItem (); | 127 | Q3ListBoxItem *fi = firstItem (); |
116 | if (fi ) { | 128 | if (fi ) { |
117 | int ihei = fi->height( this ); | 129 | int ihei = fi->height( this ); |
118 | int hei = numRows () * ihei; | 130 | int hei = numRows () * ihei; |
119 | if ( hei < height() - horizontalScrollBar()->height () ) { | 131 | if ( hei < height() - horizontalScrollBar()->height () ) { |
120 | setVScrollBarMode(QScrollView::AlwaysOff); | 132 | setVScrollBarMode(Q3ScrollView::AlwaysOff); |
121 | } | 133 | } |
122 | else | 134 | else |
123 | setVScrollBarMode(QScrollView::Auto); | 135 | setVScrollBarMode(Q3ScrollView::Auto); |
124 | if ( ihei *3 > height() ) { | 136 | if ( ihei *3 > height() ) { |
125 | setHScrollBarMode(QScrollView::AlwaysOff); | 137 | setHScrollBarMode(Q3ScrollView::AlwaysOff); |
126 | } | 138 | } |
127 | else { | 139 | else { |
128 | setHScrollBarMode(QScrollView::Auto); | 140 | setHScrollBarMode(Q3ScrollView::Auto); |
129 | } | 141 | } |
130 | } else { | 142 | } else { |
131 | setVScrollBarMode(QScrollView::Auto); | 143 | setVScrollBarMode(Q3ScrollView::Auto); |
132 | setHScrollBarMode(QScrollView::Auto); | 144 | setHScrollBarMode(Q3ScrollView::Auto); |
133 | } | 145 | } |
134 | } | 146 | } |
135 | } | 147 | } |
136 | } | 148 | } |
137 | void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) | 149 | void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) |
138 | { | 150 | { |
139 | if ( ! mBlockDeselect ) { | 151 | if ( ! mBlockDeselect ) { |
140 | int i = currentItem (); | 152 | int i = currentItem (); |
141 | if ( i >= 0 ) { | 153 | if ( i >= 0 ) { |
142 | setSelected ( i, false ); | 154 | setSelected ( i, false ); |
143 | } | 155 | } |
144 | QListBox::focusOutEvent ( e ); | 156 | Q3ListBox::focusOutEvent ( e ); |
145 | } | 157 | } |
146 | setVScrollBarMode(QScrollView::AlwaysOff); | 158 | setVScrollBarMode(Q3ScrollView::AlwaysOff); |
147 | setHScrollBarMode(QScrollView::AlwaysOff); | 159 | setHScrollBarMode(Q3ScrollView::AlwaysOff); |
148 | if ( ! mBlockDeselect ) | 160 | if ( ! mBlockDeselect ) |
149 | emit highlightIncidence( 0, (MonthViewCell*)this, 0 ); | 161 | emit highlightIncidence( 0, (MonthViewCell*)this, 0 ); |
150 | mBlockDeselect = false; | 162 | mBlockDeselect = false; |
151 | } | 163 | } |
152 | 164 | ||
153 | QString KNoScrollListBox::getWhatsThisText(QPoint p) | 165 | QString KNoScrollListBox::getWhatsThisText(QPoint p) |
154 | { | 166 | { |
155 | QListBoxItem* item = itemAt ( p ); | 167 | Q3ListBoxItem* item = itemAt ( p ); |
156 | if ( ! item ) { | 168 | if ( ! item ) { |
157 | return i18n("Click in the cell\nto add an event!"); | 169 | return i18n("Click in the cell\nto add an event!"); |
158 | } | 170 | } |
159 | return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(), | 171 | return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(), |
160 | KOPrefs::instance()->mWTshowDetails, | 172 | KOPrefs::instance()->mWTshowDetails, |
161 | KOPrefs::instance()->mWTshowCreated, | 173 | KOPrefs::instance()->mWTshowCreated, |
162 | KOPrefs::instance()->mWTshowChanged); | 174 | KOPrefs::instance()->mWTshowChanged); |
163 | } | 175 | } |
164 | void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | 176 | void KNoScrollListBox::keyPressEvent(QKeyEvent *e) |
165 | { | 177 | { |
166 | //qDebug("KNoScrollListBox::keyPressEvent "); | 178 | //qDebug("KNoScrollListBox::keyPressEvent "); |
167 | switch(e->key()) { | 179 | switch(e->key()) { |
168 | case Key_Right: | 180 | case Qt::Key_Right: |
169 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 181 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
170 | { | 182 | { |
171 | e->ignore(); | 183 | e->ignore(); |
172 | return; | 184 | return; |
173 | } | 185 | } |
174 | scrollBy(10,0); | 186 | scrollBy(10,0); |
175 | break; | 187 | break; |
176 | case Key_Left: | 188 | case Qt::Key_Left: |
177 | if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 189 | if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
178 | { | 190 | { |
179 | e->ignore(); | 191 | e->ignore(); |
180 | return; | 192 | return; |
181 | } | 193 | } |
182 | scrollBy(-10,0); | 194 | scrollBy(-10,0); |
183 | break; | 195 | break; |
184 | case Key_Up: | 196 | case Qt::Key_Up: |
185 | if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { | 197 | if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { |
186 | e->ignore(); | 198 | e->ignore(); |
187 | break; | 199 | break; |
188 | } | 200 | } |
189 | if ( count() ) { | 201 | if ( count() ) { |
190 | if ( currentItem() == 0 ) { | 202 | if ( currentItem() == 0 ) { |
@@ -198,13 +210,13 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
198 | setTopItem(topItem()-1); | 210 | setTopItem(topItem()-1); |
199 | } | 211 | } |
200 | } | 212 | } |
201 | } | 213 | } |
202 | } | 214 | } |
203 | break; | 215 | break; |
204 | case Key_Down: | 216 | case Qt::Key_Down: |
205 | if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { | 217 | if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { |
206 | e->ignore(); | 218 | e->ignore(); |
207 | break; | 219 | break; |
208 | } | 220 | } |
209 | if ( count () ) { | 221 | if ( count () ) { |
210 | if ( ((uint)currentItem()+1) == count () ) { | 222 | if ( ((uint)currentItem()+1) == count () ) { |
@@ -218,28 +230,28 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
218 | setTopItem(topItem()+1); | 230 | setTopItem(topItem()+1); |
219 | } | 231 | } |
220 | } | 232 | } |
221 | } | 233 | } |
222 | } | 234 | } |
223 | break; | 235 | break; |
224 | case Key_I: | 236 | case Qt::Key_I: |
225 | QTimer::singleShot( 1, this, SLOT ( oneDown() ) ); | 237 | QTimer::singleShot( 1, this, SLOT ( oneDown() ) ); |
226 | e->ignore(); | 238 | e->ignore(); |
227 | break; | 239 | break; |
228 | case Key_Return: | 240 | case Qt::Key_Return: |
229 | case Key_Enter: | 241 | case Qt::Key_Enter: |
230 | { | 242 | { |
231 | if ( currentItem() >= 0 ) { | 243 | if ( currentItem() >= 0 ) { |
232 | emit doubleClicked( item( currentItem() ) ); | 244 | emit doubleClicked( item( currentItem() ) ); |
233 | e->accept(); | 245 | e->accept(); |
234 | } else { | 246 | } else { |
235 | e->ignore(); | 247 | e->ignore(); |
236 | } | 248 | } |
237 | } | 249 | } |
238 | break; | 250 | break; |
239 | case Key_Shift: | 251 | case Qt::Key_Shift: |
240 | emit shiftDown(); | 252 | emit shiftDown(); |
241 | break; | 253 | break; |
242 | default: | 254 | default: |
243 | e->ignore(); | 255 | e->ignore(); |
244 | break; | 256 | break; |
245 | } | 257 | } |
@@ -263,31 +275,31 @@ void KNoScrollListBox::oneDown() | |||
263 | } | 275 | } |
264 | } | 276 | } |
265 | } | 277 | } |
266 | void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) | 278 | void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) |
267 | { | 279 | { |
268 | switch(e->key()) { | 280 | switch(e->key()) { |
269 | case Key_Shift: | 281 | case Qt::Key_Shift: |
270 | emit shiftUp(); | 282 | emit shiftUp(); |
271 | break; | 283 | break; |
272 | default: | 284 | default: |
273 | break; | 285 | break; |
274 | } | 286 | } |
275 | } | 287 | } |
276 | 288 | ||
277 | void KNoScrollListBox::mousePressEvent(QMouseEvent *e) | 289 | void KNoScrollListBox::mousePressEvent(QMouseEvent *e) |
278 | { | 290 | { |
279 | QListBox::mousePressEvent(e); | 291 | Q3ListBox::mousePressEvent(e); |
280 | 292 | ||
281 | if(e->button() == RightButton) { | 293 | if(e->button() == Qt::RightButton) { |
282 | emit rightClick(); | 294 | emit rightClick(); |
283 | } | 295 | } |
284 | } | 296 | } |
285 | 297 | ||
286 | MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s) | 298 | MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s) |
287 | : QListBoxItem() | 299 | : Q3ListBoxItem() |
288 | { | 300 | { |
289 | mblockRepaint = true; | 301 | mblockRepaint = true; |
290 | isWeekItem = KOPrefs::instance()->mMonthViewWeek; | 302 | isWeekItem = KOPrefs::instance()->mMonthViewWeek; |
291 | recycle( incidence, s ); | 303 | recycle( incidence, s ); |
292 | } | 304 | } |
293 | void MonthViewItem::recycle( Incidence *incidence, const QString & s) | 305 | void MonthViewItem::recycle( Incidence *incidence, const QString & s) |
@@ -392,20 +404,20 @@ void MonthViewItem::paint(QPainter *p) | |||
392 | if ( mMultiday ) { | 404 | if ( mMultiday ) { |
393 | int yyy = y+(size/2); | 405 | int yyy = y+(size/2); |
394 | int sizeM = size+2; | 406 | int sizeM = size+2; |
395 | p->setBrush( QBrush( textColor ) ); | 407 | p->setBrush( QBrush( textColor ) ); |
396 | p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; | 408 | p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; |
397 | if ( mMultiday == 2 || mMultiday == 3 ) { | 409 | if ( mMultiday == 2 || mMultiday == 3 ) { |
398 | QPointArray pa ( 3 ); | 410 | Q3PointArray pa ( 3 ); |
399 | pa.setPoint (0, x, yyy ); | 411 | pa.setPoint (0, x, yyy ); |
400 | pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); | 412 | pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); |
401 | pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); | 413 | pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); |
402 | p->drawPolygon( pa ); | 414 | p->drawPolygon( pa ); |
403 | } | 415 | } |
404 | if ( mMultiday == 2 || mMultiday == 1 ) { | 416 | if ( mMultiday == 2 || mMultiday == 1 ) { |
405 | QPointArray pa ( 3 ); | 417 | Q3PointArray pa ( 3 ); |
406 | pa.setPoint (0, x+sizeM +sizeM/2, yyy ); | 418 | pa.setPoint (0, x+sizeM +sizeM/2, yyy ); |
407 | pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); | 419 | pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); |
408 | pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); | 420 | pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); |
409 | p->drawPolygon( pa ); | 421 | p->drawPolygon( pa ); |
410 | } | 422 | } |
411 | if ( mMultiday == 1 ) { | 423 | if ( mMultiday == 1 ) { |
@@ -459,21 +471,21 @@ void MonthViewItem::paint(QPainter *p) | |||
459 | int wid = fm.width( pText ); | 471 | int wid = fm.width( pText ); |
460 | p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); | 472 | p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); |
461 | } | 473 | } |
462 | } | 474 | } |
463 | } | 475 | } |
464 | 476 | ||
465 | int MonthViewItem::height(const QListBox *lb) const | 477 | int MonthViewItem::height(const Q3ListBox *lb) const |
466 | { | 478 | { |
467 | int ret = 10; | 479 | int ret = 10; |
468 | if ( lb ) | 480 | if ( lb ) |
469 | ret = lb->fontMetrics().lineSpacing()+1; | 481 | ret = lb->fontMetrics().lineSpacing()+1; |
470 | return ret; | 482 | return ret; |
471 | } | 483 | } |
472 | 484 | ||
473 | int MonthViewItem::width(const QListBox *lb) const | 485 | int MonthViewItem::width(const Q3ListBox *lb) const |
474 | { | 486 | { |
475 | if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { | 487 | if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { |
476 | int size = PIXMAP_SIZE; | 488 | int size = PIXMAP_SIZE; |
477 | if ( QApplication::desktop()->width() < 300 ) | 489 | if ( QApplication::desktop()->width() < 300 ) |
478 | size = 3; | 490 | size = 3; |
479 | int x = 1; | 491 | int x = 1; |
@@ -511,44 +523,44 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) | |||
511 | // mLabel = new QLabel( this );QPushButton | 523 | // mLabel = new QLabel( this );QPushButton |
512 | mLabel = new QPushButton( this ); | 524 | mLabel = new QPushButton( this ); |
513 | //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); | 525 | //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); |
514 | //mLabel->setLineWidth( 1 ); | 526 | //mLabel->setLineWidth( 1 ); |
515 | //mLabel->setAlignment( AlignCenter ); | 527 | //mLabel->setAlignment( AlignCenter ); |
516 | mLabel->setFlat( true ); | 528 | mLabel->setFlat( true ); |
517 | mLabel->setFocusPolicy(NoFocus); | 529 | mLabel->setFocusPolicy(Qt::NoFocus); |
518 | //mItemList = new KNoScrollListBox( this ); | 530 | //mItemList = new KNoScrollListBox( this ); |
519 | setMinimumSize( 10, 10 ); | 531 | setMinimumSize( 10, 10 ); |
520 | setFrameStyle( QFrame::Panel | QFrame::Plain ); | 532 | setFrameStyle( Q3Frame::Panel | Q3Frame::Plain ); |
521 | setLineWidth( 1 ); | 533 | setLineWidth( 1 ); |
522 | //topLayout->addWidget( mItemList ); | 534 | //topLayout->addWidget( mItemList ); |
523 | mLabel->raise(); | 535 | mLabel->raise(); |
524 | // QColor( 0,0,255 ) QColor( 160,1600,255 ) | 536 | // QColor( 0,0,255 ) QColor( 160,1600,255 ) |
525 | mStandardPalette = palette(); | 537 | mStandardPalette = palette(); |
526 | mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); | 538 | mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); |
527 | 539 | ||
528 | enableScrollBars( false ); | 540 | enableScrollBars( false ); |
529 | updateConfig(); | 541 | updateConfig(); |
530 | //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); | 542 | //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); |
531 | connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); | 543 | connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); |
532 | connect( this , SIGNAL( doubleClicked( QListBoxItem *) ), | 544 | connect( this , SIGNAL( doubleClicked( Q3ListBoxItem *) ), |
533 | SLOT( defaultAction( QListBoxItem * ) ) ); | 545 | SLOT( defaultAction( Q3ListBoxItem * ) ) ); |
534 | connect( this, SIGNAL( rightButtonPressed( QListBoxItem *, | 546 | connect( this, SIGNAL( rightButtonPressed( Q3ListBoxItem *, |
535 | const QPoint &) ), | 547 | const QPoint &) ), |
536 | SLOT( contextMenu( QListBoxItem * ) ) ); | 548 | SLOT( contextMenu( Q3ListBoxItem * ) ) ); |
537 | connect( this, SIGNAL( highlighted( QListBoxItem *) ), | 549 | connect( this, SIGNAL( highlighted( Q3ListBoxItem *) ), |
538 | SLOT( selection( QListBoxItem * ) ) ); | 550 | SLOT( selection( Q3ListBoxItem * ) ) ); |
539 | 551 | ||
540 | /* | 552 | /* |
541 | connect( this, SIGNAL( clicked( QListBoxItem * ) ), | 553 | connect( this, SIGNAL( clicked( QListBoxItem * ) ), |
542 | SLOT( selection( QListBoxItem * ) ) ); | 554 | SLOT( selection( QListBoxItem * ) ) ); |
543 | */ | 555 | */ |
544 | } | 556 | } |
545 | #ifdef DESKTOP_VERSION | 557 | #ifdef DESKTOP_VERSION |
546 | QToolTipGroup *MonthViewCell::toolTipGroup() | 558 | QToolTipGroup *MonthViewCell::toolTipGroup() |
547 | { | 559 | { |
548 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); | 560 | /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */ |
549 | return mToolTipGroup; | 561 | return mToolTipGroup; |
550 | } | 562 | } |
551 | #endif | 563 | #endif |
552 | 564 | ||
553 | void MonthViewCell::setDate( const QDate &date ) | 565 | void MonthViewCell::setDate( const QDate &date ) |
554 | { | 566 | { |
@@ -634,13 +646,13 @@ void MonthViewCell::setHoliday( const QString &holiday ) | |||
634 | } | 646 | } |
635 | 647 | ||
636 | void MonthViewCell::startUpdateCell() | 648 | void MonthViewCell::startUpdateCell() |
637 | { | 649 | { |
638 | blockSignals( true ); | 650 | blockSignals( true ); |
639 | mdayCount = 0; | 651 | mdayCount = 0; |
640 | setFocusPolicy(NoFocus); | 652 | setFocusPolicy(Qt::NoFocus); |
641 | if ( !mMonthView->isUpdatePossible() ) | 653 | if ( !mMonthView->isUpdatePossible() ) |
642 | return; | 654 | return; |
643 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); | 655 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); |
644 | while ( mitem ) { | 656 | while ( mitem ) { |
645 | mitem->setBlockRepaint( true ); | 657 | mitem->setBlockRepaint( true ); |
646 | mitem = (MonthViewItem *)mitem->next(); | 658 | mitem = (MonthViewItem *)mitem->next(); |
@@ -689,13 +701,13 @@ int MonthViewCell::insertEvent(Event *event) | |||
689 | { | 701 | { |
690 | bool useToolTips = true; | 702 | bool useToolTips = true; |
691 | #ifndef DESKTOP_VERSION | 703 | #ifndef DESKTOP_VERSION |
692 | useToolTips = false; | 704 | useToolTips = false; |
693 | #endif | 705 | #endif |
694 | QString mToolTipText; | 706 | QString mToolTipText; |
695 | setFocusPolicy(WheelFocus); | 707 | setFocusPolicy(Qt::WheelFocus); |
696 | if ( !(event->doesRecur() == Recurrence::rNone) ) { | 708 | if ( !(event->doesRecur() == Recurrence::rNone) ) { |
697 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) | 709 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) |
698 | return mdayCount; | 710 | return mdayCount; |
699 | else | 711 | else |
700 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) | 712 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) |
701 | return mdayCount; | 713 | return mdayCount; |
@@ -831,13 +843,13 @@ int MonthViewCell::insertEvent(Event *event) | |||
831 | if ( itcount > 1000 ) { | 843 | if ( itcount > 1000 ) { |
832 | qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount); | 844 | qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount); |
833 | itcount = 0; | 845 | itcount = 0; |
834 | } | 846 | } |
835 | for ( i = pos; i < itcount;++i ) { | 847 | for ( i = pos; i < itcount;++i ) { |
836 | // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); | 848 | // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); |
837 | QListBoxItem* it = this->item ( i ); | 849 | Q3ListBoxItem* it = this->item ( i ); |
838 | if ( it && text < it->text() ) { | 850 | if ( it && text < it->text() ) { |
839 | pos = i; | 851 | pos = i; |
840 | break; | 852 | break; |
841 | } | 853 | } |
842 | ++pos; | 854 | ++pos; |
843 | } | 855 | } |
@@ -847,13 +859,13 @@ int MonthViewCell::insertEvent(Event *event) | |||
847 | mToolTip.append( mToolTipText ); | 859 | mToolTip.append( mToolTipText ); |
848 | } | 860 | } |
849 | return mdayCount; | 861 | return mdayCount; |
850 | } | 862 | } |
851 | void MonthViewCell::insertTodo(Todo *todo) | 863 | void MonthViewCell::insertTodo(Todo *todo) |
852 | { | 864 | { |
853 | setFocusPolicy(WheelFocus); | 865 | setFocusPolicy(Qt::WheelFocus); |
854 | QString text; | 866 | QString text; |
855 | if (todo->hasDueDate()) { | 867 | if (todo->hasDueDate()) { |
856 | if (!todo->doesFloat()) { | 868 | if (!todo->doesFloat()) { |
857 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); | 869 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); |
858 | text += " "; | 870 | text += " "; |
859 | } | 871 | } |
@@ -919,13 +931,13 @@ void MonthViewCell::finishUpdateCell() | |||
919 | 931 | ||
920 | 932 | ||
921 | 933 | ||
922 | #ifdef DESKTOP_VERSION | 934 | #ifdef DESKTOP_VERSION |
923 | if (mToolTip.count() > 0 ) { | 935 | if (mToolTip.count() > 0 ) { |
924 | mToolTip.sort(); | 936 | mToolTip.sort(); |
925 | QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); | 937 | /* TODO: hacker: QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); */ |
926 | } | 938 | } |
927 | #endif | 939 | #endif |
928 | //sort(); | 940 | //sort(); |
929 | //setMyPalette(); | 941 | //setMyPalette(); |
930 | setMyPalette(); | 942 | setMyPalette(); |
931 | 943 | ||
@@ -935,19 +947,19 @@ void MonthViewCell::finishUpdateCell() | |||
935 | void MonthViewCell::updateCell() | 947 | void MonthViewCell::updateCell() |
936 | { | 948 | { |
937 | if ( !mMonthView->isUpdatePossible() ) | 949 | if ( !mMonthView->isUpdatePossible() ) |
938 | return; | 950 | return; |
939 | startUpdateCell(); | 951 | startUpdateCell(); |
940 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 952 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
941 | QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); | 953 | Q3PtrList<Event> events = mMonthView->calendar()->events( mDate, true ); |
942 | Event *event; | 954 | Event *event; |
943 | for( event = events.first(); event; event = events.next() ) { // for event | 955 | for( event = events.first(); event; event = events.next() ) { // for event |
944 | insertEvent(event); | 956 | insertEvent(event); |
945 | } | 957 | } |
946 | // insert due todos | 958 | // insert due todos |
947 | QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); | 959 | Q3PtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); |
948 | Todo *todo; | 960 | Todo *todo; |
949 | for(todo = todos.first(); todo; todo = todos.next()) { | 961 | for(todo = todos.first(); todo; todo = todos.next()) { |
950 | insertTodo( todo ); | 962 | insertTodo( todo ); |
951 | } | 963 | } |
952 | finishUpdateCell(); | 964 | finishUpdateCell(); |
953 | // if ( isVisible()) | 965 | // if ( isVisible()) |
@@ -989,34 +1001,34 @@ void MonthViewCell::updateConfig( bool bigFont ) // = false | |||
989 | 1001 | ||
990 | void MonthViewCell::enableScrollBars( bool enabled ) | 1002 | void MonthViewCell::enableScrollBars( bool enabled ) |
991 | { | 1003 | { |
992 | 1004 | ||
993 | return; | 1005 | return; |
994 | if ( enabled ) { | 1006 | if ( enabled ) { |
995 | QListBoxItem *fi = firstItem (); | 1007 | Q3ListBoxItem *fi = firstItem (); |
996 | if (fi ) { | 1008 | if (fi ) { |
997 | int ihei = fi->height( this ); | 1009 | int ihei = fi->height( this ); |
998 | int hei = numRows () * ihei; | 1010 | int hei = numRows () * ihei; |
999 | if ( hei < height() - horizontalScrollBar()->height () ) { | 1011 | if ( hei < height() - horizontalScrollBar()->height () ) { |
1000 | setVScrollBarMode(QScrollView::AlwaysOff); | 1012 | setVScrollBarMode(Q3ScrollView::AlwaysOff); |
1001 | } | 1013 | } |
1002 | else | 1014 | else |
1003 | setVScrollBarMode(QScrollView::Auto); | 1015 | setVScrollBarMode(Q3ScrollView::Auto); |
1004 | if ( ihei *3 > height() ) { | 1016 | if ( ihei *3 > height() ) { |
1005 | setHScrollBarMode(QScrollView::AlwaysOff); | 1017 | setHScrollBarMode(Q3ScrollView::AlwaysOff); |
1006 | } | 1018 | } |
1007 | else { | 1019 | else { |
1008 | setHScrollBarMode(QScrollView::Auto); | 1020 | setHScrollBarMode(Q3ScrollView::Auto); |
1009 | } | 1021 | } |
1010 | } else { | 1022 | } else { |
1011 | setVScrollBarMode(QScrollView::Auto); | 1023 | setVScrollBarMode(Q3ScrollView::Auto); |
1012 | setHScrollBarMode(QScrollView::Auto); | 1024 | setHScrollBarMode(Q3ScrollView::Auto); |
1013 | } | 1025 | } |
1014 | } else { | 1026 | } else { |
1015 | setVScrollBarMode(QScrollView::AlwaysOff); | 1027 | setVScrollBarMode(Q3ScrollView::AlwaysOff); |
1016 | setHScrollBarMode(QScrollView::AlwaysOff); | 1028 | setHScrollBarMode(Q3ScrollView::AlwaysOff); |
1017 | } | 1029 | } |
1018 | } | 1030 | } |
1019 | 1031 | ||
1020 | Incidence *MonthViewCell::selectedIncidence() | 1032 | Incidence *MonthViewCell::selectedIncidence() |
1021 | { | 1033 | { |
1022 | int index = currentItem(); | 1034 | int index = currentItem(); |
@@ -1080,13 +1092,13 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e ) | |||
1080 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 1092 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
1081 | // mItemList->resize ( width(), height () ); | 1093 | // mItemList->resize ( width(), height () ); |
1082 | if ( e ) | 1094 | if ( e ) |
1083 | KNoScrollListBox::resizeEvent ( e ); | 1095 | KNoScrollListBox::resizeEvent ( e ); |
1084 | } | 1096 | } |
1085 | 1097 | ||
1086 | void MonthViewCell::defaultAction( QListBoxItem *item ) | 1098 | void MonthViewCell::defaultAction( Q3ListBoxItem *item ) |
1087 | { | 1099 | { |
1088 | 1100 | ||
1089 | if ( !item ) { | 1101 | if ( !item ) { |
1090 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 1102 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
1091 | emit newEventSignal( dt ); | 1103 | emit newEventSignal( dt ); |
1092 | return; | 1104 | return; |
@@ -1102,24 +1114,24 @@ void MonthViewCell::showDay() | |||
1102 | } | 1114 | } |
1103 | void MonthViewCell::newEvent() | 1115 | void MonthViewCell::newEvent() |
1104 | { | 1116 | { |
1105 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 1117 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
1106 | emit newEventSignal( dt ); | 1118 | emit newEventSignal( dt ); |
1107 | } | 1119 | } |
1108 | void MonthViewCell::cellClicked( QListBoxItem *item ) | 1120 | void MonthViewCell::cellClicked( Q3ListBoxItem *item ) |
1109 | { | 1121 | { |
1110 | mMonthView->setSelectedCell( this ); | 1122 | mMonthView->setSelectedCell( this ); |
1111 | if ( item == 0 ) { | 1123 | if ( item == 0 ) { |
1112 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 1124 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
1113 | emit newEventSignal( dt ); | 1125 | emit newEventSignal( dt ); |
1114 | return; | 1126 | return; |
1115 | } | 1127 | } |
1116 | 1128 | ||
1117 | } | 1129 | } |
1118 | 1130 | ||
1119 | void MonthViewCell::contextMenu( QListBoxItem *item ) | 1131 | void MonthViewCell::contextMenu( Q3ListBoxItem *item ) |
1120 | { | 1132 | { |
1121 | mMonthView->setPopupCell( this ); | 1133 | mMonthView->setPopupCell( this ); |
1122 | if ( !item ) { | 1134 | if ( !item ) { |
1123 | mMonthView->showContextMenu( 0 ); | 1135 | mMonthView->showContextMenu( 0 ); |
1124 | return; | 1136 | return; |
1125 | } | 1137 | } |
@@ -1130,13 +1142,13 @@ void MonthViewCell::contextMenu( QListBoxItem *item ) | |||
1130 | if ( incidence ) { | 1142 | if ( incidence ) { |
1131 | mBlockDeselect = true; | 1143 | mBlockDeselect = true; |
1132 | mMonthView->showContextMenu( incidence ); | 1144 | mMonthView->showContextMenu( incidence ); |
1133 | } | 1145 | } |
1134 | } | 1146 | } |
1135 | 1147 | ||
1136 | void MonthViewCell::selection( QListBoxItem *item ) | 1148 | void MonthViewCell::selection( Q3ListBoxItem *item ) |
1137 | { | 1149 | { |
1138 | if ( !item ) { | 1150 | if ( !item ) { |
1139 | emit highlightIncidence( 0 , this, 0 ); | 1151 | emit highlightIncidence( 0 , this, 0 ); |
1140 | return; | 1152 | return; |
1141 | } | 1153 | } |
1142 | MonthViewItem * it = (static_cast<MonthViewItem *>( item )); | 1154 | MonthViewItem * it = (static_cast<MonthViewItem *>( item )); |
@@ -1182,14 +1194,14 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
1182 | mShortDayLabelsM = false; | 1194 | mShortDayLabelsM = false; |
1183 | mShortDayLabelsW = false; | 1195 | mShortDayLabelsW = false; |
1184 | skipResize = false; | 1196 | skipResize = false; |
1185 | clPending = true; | 1197 | clPending = true; |
1186 | mPopupCell = 0; | 1198 | mPopupCell = 0; |
1187 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); | 1199 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); |
1188 | mWidStack = new QWidgetStack( this ); | 1200 | mWidStack = new Q3WidgetStack( this ); |
1189 | QVBoxLayout* hb = new QVBoxLayout( this ); | 1201 | Q3VBoxLayout* hb = new Q3VBoxLayout( this ); |
1190 | mMonthView = new QWidget( mWidStack ); | 1202 | mMonthView = new QWidget( mWidStack ); |
1191 | mWeekView = new QWidget( mWidStack ); | 1203 | mWeekView = new QWidget( mWidStack ); |
1192 | #if QT_VERSION >= 0x030000 | 1204 | #if QT_VERSION >= 0x030000 |
1193 | mWidStack->addWidget(mMonthView ); | 1205 | mWidStack->addWidget(mMonthView ); |
1194 | mWidStack->addWidget(mWeekView ); | 1206 | mWidStack->addWidget(mWeekView ); |
1195 | #else | 1207 | #else |
@@ -1212,57 +1224,57 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
1212 | bfont.setBold( true ); | 1224 | bfont.setBold( true ); |
1213 | int i; | 1225 | int i; |
1214 | 1226 | ||
1215 | for( i = 0; i < mDaysPerWeek; i++ ) { | 1227 | for( i = 0; i < mDaysPerWeek; i++ ) { |
1216 | QLabel *label = new QLabel( mMonthView ); | 1228 | QLabel *label = new QLabel( mMonthView ); |
1217 | label->setFont(bfont); | 1229 | label->setFont(bfont); |
1218 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 1230 | label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); |
1219 | label->setLineWidth(1); | 1231 | label->setLineWidth(1); |
1220 | label->setAlignment(AlignCenter); | 1232 | label->setAlignment(Qt::AlignCenter); |
1221 | mDayLabels.insert( i, label ); | 1233 | mDayLabels.insert( i, label ); |
1222 | label = new QLabel( mWeekView ); | 1234 | label = new QLabel( mWeekView ); |
1223 | label->setFont(bfont); | 1235 | label->setFont(bfont); |
1224 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 1236 | label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); |
1225 | label->setLineWidth(1); | 1237 | label->setLineWidth(1); |
1226 | label->setAlignment(AlignCenter); | 1238 | label->setAlignment(Qt::AlignCenter); |
1227 | mDayLabelsW.insert( i, label ); | 1239 | mDayLabelsW.insert( i, label ); |
1228 | } | 1240 | } |
1229 | 1241 | ||
1230 | bfont.setBold( false ); | 1242 | bfont.setBold( false ); |
1231 | mWeekLabels.resize( mNumWeeks+1 ); | 1243 | mWeekLabels.resize( mNumWeeks+1 ); |
1232 | mWeekLabelsW.resize( 2 ); | 1244 | mWeekLabelsW.resize( 2 ); |
1233 | for( i = 0; i < mNumWeeks+1; i++ ) { | 1245 | for( i = 0; i < mNumWeeks+1; i++ ) { |
1234 | KOWeekButton *label = new KOWeekButton( mMonthView ); | 1246 | KOWeekButton *label = new KOWeekButton( mMonthView ); |
1235 | label->setFocusPolicy(NoFocus); | 1247 | label->setFocusPolicy(Qt::NoFocus); |
1236 | label->setFont(bfont); | 1248 | label->setFont(bfont); |
1237 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); | 1249 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); |
1238 | label->setFlat(true); | 1250 | label->setFlat(true); |
1239 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); | 1251 | Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); |
1240 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 1252 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
1241 | //label->setLineWidth(1); | 1253 | //label->setLineWidth(1); |
1242 | //label->setAlignment(AlignCenter); | 1254 | //label->setAlignment(AlignCenter); |
1243 | mWeekLabels.insert( i, label ); | 1255 | mWeekLabels.insert( i, label ); |
1244 | } | 1256 | } |
1245 | mWeekLabels[mNumWeeks]->setText( i18n("W")); | 1257 | mWeekLabels[mNumWeeks]->setText( i18n("W")); |
1246 | mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus); | 1258 | mWeekLabels[mNumWeeks]->setFocusPolicy(Qt::WheelFocus); |
1247 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); | 1259 | Q3WhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); |
1248 | 1260 | ||
1249 | for( i = 0; i < 1+1; i++ ) { | 1261 | for( i = 0; i < 1+1; i++ ) { |
1250 | KOWeekButton *label = new KOWeekButton( mWeekView ); | 1262 | KOWeekButton *label = new KOWeekButton( mWeekView ); |
1251 | label->setFocusPolicy(NoFocus); | 1263 | label->setFocusPolicy(Qt::NoFocus); |
1252 | label->setFont(bfont); | 1264 | label->setFont(bfont); |
1253 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); | 1265 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); |
1254 | label->setFlat(true); | 1266 | label->setFlat(true); |
1255 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); | 1267 | Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); |
1256 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 1268 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
1257 | //label->setLineWidth(1); | 1269 | //label->setLineWidth(1); |
1258 | //label->setAlignment(AlignCenter); | 1270 | //label->setAlignment(AlignCenter); |
1259 | mWeekLabelsW.insert( i, label ); | 1271 | mWeekLabelsW.insert( i, label ); |
1260 | } | 1272 | } |
1261 | mWeekLabelsW[1]->setText( i18n("W")); | 1273 | mWeekLabelsW[1]->setText( i18n("W")); |
1262 | mWeekLabelsW[1]->setFocusPolicy(WheelFocus); | 1274 | mWeekLabelsW[1]->setFocusPolicy(Qt::WheelFocus); |
1263 | 1275 | ||
1264 | 1276 | ||
1265 | int row, col; | 1277 | int row, col; |
1266 | mCells.resize( mNumCells ); | 1278 | mCells.resize( mNumCells ); |
1267 | for( row = 0; row < mNumWeeks; ++row ) { | 1279 | for( row = 0; row < mNumWeeks; ++row ) { |
1268 | for( col = 0; col < mDaysPerWeek; ++col ) { | 1280 | for( col = 0; col < mDaysPerWeek; ++col ) { |
@@ -1302,19 +1314,19 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
1302 | SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) )); | 1314 | SLOT( incidenceHighlighted( Incidence *, MonthViewCell *, int ) )); |
1303 | cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); | 1315 | cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); |
1304 | } | 1316 | } |
1305 | 1317 | ||
1306 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); | 1318 | //connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) ); |
1307 | mContextMenu = eventPopup(); | 1319 | mContextMenu = eventPopup(); |
1308 | mContextMenu->addAdditionalItem(QIconSet(QPixmap()), | 1320 | mContextMenu->addAdditionalItem(QIcon(QPixmap()), |
1309 | i18n("New Event..."),this, | 1321 | i18n("New Event..."),this, |
1310 | SLOT(slotNewEvent()),false); | 1322 | SLOT(slotNewEvent()),false); |
1311 | mContextMenu->addAdditionalItem(QIconSet(QPixmap()), | 1323 | mContextMenu->addAdditionalItem(QIcon(QPixmap()), |
1312 | i18n("New Todo..."),this, | 1324 | i18n("New Todo..."),this, |
1313 | SLOT(slotNewTodo()),false); | 1325 | SLOT(slotNewTodo()),false); |
1314 | mContextMenu->addAdditionalItem(QIconSet(QPixmap()), | 1326 | mContextMenu->addAdditionalItem(QIcon(QPixmap()), |
1315 | i18n("Journal"),this, | 1327 | i18n("Journal"),this, |
1316 | SLOT(slotEditJournal()),false); | 1328 | SLOT(slotEditJournal()),false); |
1317 | 1329 | ||
1318 | connect (mContextMenu ,SIGNAL(categoryChanged( Incidence * )),this, | 1330 | connect (mContextMenu ,SIGNAL(categoryChanged( Incidence * )),this, |
1319 | SLOT( catChanged( Incidence * ) )); | 1331 | SLOT( catChanged( Incidence * ) )); |
1320 | 1332 | ||
@@ -1322,13 +1334,13 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
1322 | QString pathString = ""; | 1334 | QString pathString = ""; |
1323 | if ( !KOPrefs::instance()->mToolBarMiniIcons ) { | 1335 | if ( !KOPrefs::instance()->mToolBarMiniIcons ) { |
1324 | if ( QApplication::desktop()->width() < 480 ) | 1336 | if ( QApplication::desktop()->width() < 480 ) |
1325 | pathString += "icons16/"; | 1337 | pathString += "icons16/"; |
1326 | } else | 1338 | } else |
1327 | pathString += "iconsmini/"; | 1339 | pathString += "iconsmini/"; |
1328 | mNewItemMenu = new QPopupMenu( this ); | 1340 | mNewItemMenu = new Q3PopupMenu( this ); |
1329 | mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent())); | 1341 | mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent())); |
1330 | mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false); | 1342 | mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false); |
1331 | mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false); | 1343 | mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false); |
1332 | 1344 | ||
1333 | // updateConfig(); //useless here... | 1345 | // updateConfig(); //useless here... |
1334 | // ... but we need mWidthLongDayLabel computed | 1346 | // ... but we need mWidthLongDayLabel computed |
@@ -1394,13 +1406,13 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int | |||
1394 | if ( mCellsW[i] == mc ) { | 1406 | if ( mCellsW[i] == mc ) { |
1395 | weekview = true; | 1407 | weekview = true; |
1396 | index = i; | 1408 | index = i; |
1397 | break; | 1409 | break; |
1398 | } | 1410 | } |
1399 | } | 1411 | } |
1400 | QPtrVector<MonthViewCell> *cells; | 1412 | Q3PtrVector<MonthViewCell> *cells; |
1401 | if ( weekview ) | 1413 | if ( weekview ) |
1402 | cells = &mCellsW; | 1414 | cells = &mCellsW; |
1403 | else { | 1415 | else { |
1404 | for (uint i = 0; i < mCells.count(); ++i) { | 1416 | for (uint i = 0; i < mCells.count(); ++i) { |
1405 | if ( mCells[i] == mc ) { | 1417 | if ( mCells[i] == mc ) { |
1406 | index = i; | 1418 | index = i; |
@@ -1492,15 +1504,15 @@ int KOMonthView::maxDatesHint() | |||
1492 | 1504 | ||
1493 | int KOMonthView::currentDateCount() | 1505 | int KOMonthView::currentDateCount() |
1494 | { | 1506 | { |
1495 | return mNumCells; | 1507 | return mNumCells; |
1496 | } | 1508 | } |
1497 | 1509 | ||
1498 | QPtrList<Incidence> KOMonthView::selectedIncidences() | 1510 | Q3PtrList<Incidence> KOMonthView::selectedIncidences() |
1499 | { | 1511 | { |
1500 | QPtrList<Incidence> selected; | 1512 | Q3PtrList<Incidence> selected; |
1501 | 1513 | ||
1502 | if ( mSelectedCell ) { | 1514 | if ( mSelectedCell ) { |
1503 | Incidence *incidence = mSelectedCell->selectedIncidence(); | 1515 | Incidence *incidence = mSelectedCell->selectedIncidence(); |
1504 | if ( incidence ) selected.append( incidence ); | 1516 | if ( incidence ) selected.append( incidence ); |
1505 | } | 1517 | } |
1506 | 1518 | ||
@@ -1558,21 +1570,21 @@ void KOMonthView::updateConfig() | |||
1558 | } | 1570 | } |
1559 | 1571 | ||
1560 | for (uint i = 0; i < mCellsW.count(); ++i) { | 1572 | for (uint i = 0; i < mCellsW.count(); ++i) { |
1561 | mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); | 1573 | mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont); |
1562 | } | 1574 | } |
1563 | #ifdef DESKTOP_VERSION | 1575 | #ifdef DESKTOP_VERSION |
1564 | MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); | 1576 | /* TODO:hacker: MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); */ |
1565 | #endif | 1577 | #endif |
1566 | updateView(); | 1578 | updateView(); |
1567 | } | 1579 | } |
1568 | 1580 | ||
1569 | void KOMonthView::updateDayLabels() | 1581 | void KOMonthView::updateDayLabels() |
1570 | { | 1582 | { |
1571 | 1583 | ||
1572 | QPtrVector<QLabel> *mDayLabelsT; | 1584 | Q3PtrVector<QLabel> *mDayLabelsT; |
1573 | 1585 | ||
1574 | mDayLabelsT = &mDayLabelsW; | 1586 | mDayLabelsT = &mDayLabelsW; |
1575 | for (int i = 0; i < 7; i++) { | 1587 | for (int i = 0; i < 7; i++) { |
1576 | { | 1588 | { |
1577 | bool show = mShortDayLabelsW; | 1589 | bool show = mShortDayLabelsW; |
1578 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) | 1590 | if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() ) |
@@ -1607,15 +1619,15 @@ void KOMonthView::clearList() | |||
1607 | } | 1619 | } |
1608 | } | 1620 | } |
1609 | void KOMonthView::showDates(const QDate &start, const QDate &) | 1621 | void KOMonthView::showDates(const QDate &start, const QDate &) |
1610 | { | 1622 | { |
1611 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; | 1623 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; |
1612 | 1624 | ||
1613 | QPtrVector<MonthViewCell> *cells; | 1625 | Q3PtrVector<MonthViewCell> *cells; |
1614 | QPtrVector<QLabel> *dayLabels; | 1626 | Q3PtrVector<QLabel> *dayLabels; |
1615 | QPtrVector<KOWeekButton> *weekLabels; | 1627 | Q3PtrVector<KOWeekButton> *weekLabels; |
1616 | uint weekNum = 6; | 1628 | uint weekNum = 6; |
1617 | mStartDate = start; | 1629 | mStartDate = start; |
1618 | if ( mShowWeekView ) { | 1630 | if ( mShowWeekView ) { |
1619 | weekNum = 1; | 1631 | weekNum = 1; |
1620 | cells = &mCellsW; | 1632 | cells = &mCellsW; |
1621 | dayLabels = &mDayLabelsW; | 1633 | dayLabels = &mDayLabelsW; |
@@ -1665,13 +1677,13 @@ void KOMonthView::showDates(const QDate &start, const QDate &) | |||
1665 | (*weekLabels)[i]->setWeekNum( wno ); | 1677 | (*weekLabels)[i]->setWeekNum( wno ); |
1666 | date = date.addDays( 7 ); | 1678 | date = date.addDays( 7 ); |
1667 | } | 1679 | } |
1668 | updateView(); | 1680 | updateView(); |
1669 | } | 1681 | } |
1670 | 1682 | ||
1671 | void KOMonthView::showEvents(QPtrList<Event>) | 1683 | void KOMonthView::showEvents(Q3PtrList<Event>) |
1672 | { | 1684 | { |
1673 | qDebug("KOMonthView::selectEvents is not implemented yet. "); | 1685 | qDebug("KOMonthView::selectEvents is not implemented yet. "); |
1674 | } | 1686 | } |
1675 | 1687 | ||
1676 | void KOMonthView::changeEventDisplay(Event *, int) | 1688 | void KOMonthView::changeEventDisplay(Event *, int) |
1677 | { | 1689 | { |
@@ -1687,13 +1699,13 @@ void KOMonthView::updateView() | |||
1687 | if ( !updatePossible ) | 1699 | if ( !updatePossible ) |
1688 | return; | 1700 | return; |
1689 | //qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU "); | 1701 | //qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU "); |
1690 | //QTime ti; | 1702 | //QTime ti; |
1691 | //ti.start(); | 1703 | //ti.start(); |
1692 | clearSelection(); | 1704 | clearSelection(); |
1693 | QPtrVector<MonthViewCell> *cells; | 1705 | Q3PtrVector<MonthViewCell> *cells; |
1694 | if ( mShowWeekView ) { | 1706 | if ( mShowWeekView ) { |
1695 | cells = &mCellsW; | 1707 | cells = &mCellsW; |
1696 | } else { | 1708 | } else { |
1697 | cells = &mCells; | 1709 | cells = &mCells; |
1698 | } | 1710 | } |
1699 | #if 1 | 1711 | #if 1 |
@@ -1702,13 +1714,13 @@ void KOMonthView::updateView() | |||
1702 | if ( KOPrefs::instance()->mMonthViewWeek ) | 1714 | if ( KOPrefs::instance()->mMonthViewWeek ) |
1703 | timeSpan = 6; | 1715 | timeSpan = 6; |
1704 | for( i = 0; i < timeSpan + 1; ++i ) { | 1716 | for( i = 0; i < timeSpan + 1; ++i ) { |
1705 | (*cells)[i]->startUpdateCell(); | 1717 | (*cells)[i]->startUpdateCell(); |
1706 | } | 1718 | } |
1707 | 1719 | ||
1708 | QPtrList<Event> events = calendar()->events(); | 1720 | Q3PtrList<Event> events = calendar()->events(); |
1709 | Event *event; | 1721 | Event *event; |
1710 | QDateTime dt; | 1722 | QDateTime dt; |
1711 | QDate endDate = mStartDate.addDays( timeSpan ); | 1723 | QDate endDate = mStartDate.addDays( timeSpan ); |
1712 | for( event = events.first(); event; event = events.next() ) { // for event | 1724 | for( event = events.first(); event; event = events.next() ) { // for event |
1713 | if ( event->doesRecur() ) { | 1725 | if ( event->doesRecur() ) { |
1714 | bool last; | 1726 | bool last; |
@@ -1766,13 +1778,13 @@ void KOMonthView::updateView() | |||
1766 | (*cells)[iii]->insertEvent( event ); | 1778 | (*cells)[iii]->insertEvent( event ); |
1767 | } | 1779 | } |
1768 | } | 1780 | } |
1769 | } | 1781 | } |
1770 | } | 1782 | } |
1771 | // insert due todos | 1783 | // insert due todos |
1772 | QPtrList<Todo> todos = calendar()->todos( ); | 1784 | Q3PtrList<Todo> todos = calendar()->todos( ); |
1773 | Todo *todo; | 1785 | Todo *todo; |
1774 | for(todo = todos.first(); todo; todo = todos.next()) { | 1786 | for(todo = todos.first(); todo; todo = todos.next()) { |
1775 | //insertTodo( todo ); | 1787 | //insertTodo( todo ); |
1776 | if ( todo->hasDueDate() ) { | 1788 | if ( todo->hasDueDate() ) { |
1777 | int day = mStartDate.daysTo( todo->dtDue().date() ); | 1789 | int day = mStartDate.daysTo( todo->dtDue().date() ); |
1778 | if ( day >= 0 && day < timeSpan + 1) { | 1790 | if ( day >= 0 && day < timeSpan + 1) { |
@@ -2222,13 +2234,13 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell ) | |||
2222 | else | 2234 | else |
2223 | emit incidenceSelected( mSelectedCell->selectedIncidence() ); | 2235 | emit incidenceSelected( mSelectedCell->selectedIncidence() ); |
2224 | } | 2236 | } |
2225 | 2237 | ||
2226 | void KOMonthView::processSelectionChange() | 2238 | void KOMonthView::processSelectionChange() |
2227 | { | 2239 | { |
2228 | QPtrList<Incidence> incidences = selectedIncidences(); | 2240 | Q3PtrList<Incidence> incidences = selectedIncidences(); |
2229 | if (incidences.count() > 0) { | 2241 | if (incidences.count() > 0) { |
2230 | emit incidenceSelected( incidences.first() ); | 2242 | emit incidenceSelected( incidences.first() ); |
2231 | } else { | 2243 | } else { |
2232 | emit incidenceSelected( 0 ); | 2244 | emit incidenceSelected( 0 ); |
2233 | clearSelection(); | 2245 | clearSelection(); |
2234 | } | 2246 | } |
@@ -2258,43 +2270,43 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) | |||
2258 | e->accept(); | 2270 | e->accept(); |
2259 | return; | 2271 | return; |
2260 | } | 2272 | } |
2261 | if (! e->isAutoRepeat() ) | 2273 | if (! e->isAutoRepeat() ) |
2262 | mFlagKeyPressed = true; | 2274 | mFlagKeyPressed = true; |
2263 | switch(e->key()) { | 2275 | switch(e->key()) { |
2264 | case Key_Up: | 2276 | case Qt::Key_Up: |
2265 | { | 2277 | { |
2266 | if ( mShowWeekView ) { | 2278 | if ( mShowWeekView ) { |
2267 | emit selectWeekNum ( currentWeek() - 1 ); | 2279 | emit selectWeekNum ( currentWeek() - 1 ); |
2268 | } | 2280 | } |
2269 | else { | 2281 | else { |
2270 | emit prevMonth(); | 2282 | emit prevMonth(); |
2271 | } | 2283 | } |
2272 | } | 2284 | } |
2273 | e->accept(); | 2285 | e->accept(); |
2274 | break; | 2286 | break; |
2275 | case Key_Down: | 2287 | case Qt::Key_Down: |
2276 | { | 2288 | { |
2277 | if ( mShowWeekView ) { | 2289 | if ( mShowWeekView ) { |
2278 | emit selectWeekNum ( currentWeek() +1); | 2290 | emit selectWeekNum ( currentWeek() +1); |
2279 | } | 2291 | } |
2280 | else { | 2292 | else { |
2281 | emit nextMonth(); | 2293 | emit nextMonth(); |
2282 | } | 2294 | } |
2283 | 2295 | ||
2284 | } | 2296 | } |
2285 | e->accept(); | 2297 | e->accept(); |
2286 | break; | 2298 | break; |
2287 | case Key_Return: | 2299 | case Qt::Key_Return: |
2288 | case Key_Enter: | 2300 | case Qt::Key_Enter: |
2289 | { | 2301 | { |
2290 | selectInternalWeekNum ( currentWeek() ); | 2302 | selectInternalWeekNum ( currentWeek() ); |
2291 | } | 2303 | } |
2292 | e->accept(); | 2304 | e->accept(); |
2293 | break; | 2305 | break; |
2294 | case Key_D: | 2306 | case Qt::Key_D: |
2295 | if ( mSelectedCell ) { | 2307 | if ( mSelectedCell ) { |
2296 | mSelectedCell->showDay(); | 2308 | mSelectedCell->showDay(); |
2297 | e->accept(); | 2309 | e->accept(); |
2298 | } else { | 2310 | } else { |
2299 | e->ignore(); | 2311 | e->ignore(); |
2300 | } | 2312 | } |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 1a9d16d..bca76e5 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -18,23 +18,30 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef _KOMONTHVIEW_H | 20 | #ifndef _KOMONTHVIEW_H |
21 | #define _KOMONTHVIEW_H | 21 | #define _KOMONTHVIEW_H |
22 | 22 | ||
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qframe.h> | 24 | #include <q3frame.h> |
25 | #include <qdatetime.h> | 25 | #include <qdatetime.h> |
26 | #include <qlistbox.h> | 26 | #include <q3listbox.h> |
27 | #include <qpoint.h> | 27 | #include <qpoint.h> |
28 | #include <qwidgetstack.h> | 28 | #include <q3widgetstack.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | #include <qintdict.h> | 31 | #include <q3intdict.h> |
32 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
33 | #include <qvaluelist.h> | 33 | #include <q3valuelist.h> |
34 | #include <qptrvector.h> | 34 | #include <q3ptrvector.h> |
35 | //Added by qt3to4: | ||
36 | #include <QResizeEvent> | ||
37 | #include <QFocusEvent> | ||
38 | #include <QMouseEvent> | ||
39 | #include <Q3PtrList> | ||
40 | #include <Q3PopupMenu> | ||
41 | #include <QKeyEvent> | ||
35 | 42 | ||
36 | #include <libkcal/calendar.h> | 43 | #include <libkcal/calendar.h> |
37 | #include <libkcal/event.h> | 44 | #include <libkcal/event.h> |
38 | 45 | ||
39 | #include "koeventview.h" | 46 | #include "koeventview.h" |
40 | #include "navigatorbar.h" | 47 | #include "navigatorbar.h" |
@@ -69,13 +76,13 @@ private: | |||
69 | } | 76 | } |
70 | 77 | ||
71 | private slots : | 78 | private slots : |
72 | void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } | 79 | void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } |
73 | }; | 80 | }; |
74 | 81 | ||
75 | class KNoScrollListBox: public QListBox | 82 | class KNoScrollListBox: public Q3ListBox |
76 | { | 83 | { |
77 | Q_OBJECT | 84 | Q_OBJECT |
78 | public: | 85 | public: |
79 | KNoScrollListBox(QWidget *parent=0, const char *name=0); | 86 | KNoScrollListBox(QWidget *parent=0, const char *name=0); |
80 | ~KNoScrollListBox(); | 87 | ~KNoScrollListBox(); |
81 | QString getWhatsThisText(QPoint p) ; | 88 | QString getWhatsThisText(QPoint p) ; |
@@ -100,13 +107,13 @@ class KNoScrollListBox: public QListBox | |||
100 | private: | 107 | private: |
101 | bool resetOnFocusIn; | 108 | bool resetOnFocusIn; |
102 | KNOWhatsThis * mWT; | 109 | KNOWhatsThis * mWT; |
103 | }; | 110 | }; |
104 | 111 | ||
105 | 112 | ||
106 | class MonthViewItem: public QListBoxItem | 113 | class MonthViewItem: public Q3ListBoxItem |
107 | { | 114 | { |
108 | public: | 115 | public: |
109 | MonthViewItem( Incidence *,const QString & title ); | 116 | MonthViewItem( Incidence *,const QString & title ); |
110 | void recycle( Incidence *incidence, const QString & s); | 117 | void recycle( Incidence *incidence, const QString & s); |
111 | void setRecur(bool on) { mRecur = on; } | 118 | void setRecur(bool on) { mRecur = on; } |
112 | void setAlarm(bool on) { mAlarm = on; } | 119 | void setAlarm(bool on) { mAlarm = on; } |
@@ -123,14 +130,14 @@ class MonthViewItem: public QListBoxItem | |||
123 | QPalette palette() const { return mPalette; } | 130 | QPalette palette() const { return mPalette; } |
124 | bool setHighlightedFalse(); | 131 | bool setHighlightedFalse(); |
125 | Incidence *incidence() const { return mIncidence; } | 132 | Incidence *incidence() const { return mIncidence; } |
126 | 133 | ||
127 | protected: | 134 | protected: |
128 | virtual void paint(QPainter *); | 135 | virtual void paint(QPainter *); |
129 | virtual int height(const QListBox *) const; | 136 | virtual int height(const Q3ListBox *) const; |
130 | virtual int width(const QListBox *) const; | 137 | virtual int width(const Q3ListBox *) const; |
131 | 138 | ||
132 | private: | 139 | private: |
133 | int mdayPos; | 140 | int mdayPos; |
134 | bool isWeekItem; | 141 | bool isWeekItem; |
135 | bool mblockRepaint; | 142 | bool mblockRepaint; |
136 | int mMultiday; | 143 | int mMultiday; |
@@ -195,21 +202,21 @@ class MonthViewCell : public KNoScrollListBox | |||
195 | 202 | ||
196 | public slots: | 203 | public slots: |
197 | void showDay(); | 204 | void showDay(); |
198 | void deHighLight(); | 205 | void deHighLight(); |
199 | void repaintfinishUpdateCell(); | 206 | void repaintfinishUpdateCell(); |
200 | protected slots: | 207 | protected slots: |
201 | void defaultAction( QListBoxItem * ); | 208 | void defaultAction( Q3ListBoxItem * ); |
202 | void contextMenu( QListBoxItem * ); | 209 | void contextMenu( Q3ListBoxItem * ); |
203 | void selection( QListBoxItem * ); | 210 | void selection( Q3ListBoxItem * ); |
204 | void cellClicked( QListBoxItem * ); | 211 | void cellClicked( Q3ListBoxItem * ); |
205 | void newEvent(); | 212 | void newEvent(); |
206 | 213 | ||
207 | private: | 214 | private: |
208 | int mdayCount; | 215 | int mdayCount; |
209 | QPtrList <MonthViewItem> mAvailItemList; | 216 | Q3PtrList <MonthViewItem> mAvailItemList; |
210 | KOMonthView *mMonthView; | 217 | KOMonthView *mMonthView; |
211 | int currentPalette; | 218 | int currentPalette; |
212 | 219 | ||
213 | QDate mDate; | 220 | QDate mDate; |
214 | bool mPrimary; | 221 | bool mPrimary; |
215 | bool mHoliday; | 222 | bool mHoliday; |
@@ -244,13 +251,13 @@ class KOMonthView: public KOEventView | |||
244 | virtual int maxDatesHint(); | 251 | virtual int maxDatesHint(); |
245 | 252 | ||
246 | /** Returns number of currently shown dates. */ | 253 | /** Returns number of currently shown dates. */ |
247 | virtual int currentDateCount(); | 254 | virtual int currentDateCount(); |
248 | 255 | ||
249 | /** returns the currently selected events */ | 256 | /** returns the currently selected events */ |
250 | virtual QPtrList<Incidence> selectedIncidences(); | 257 | virtual Q3PtrList<Incidence> selectedIncidences(); |
251 | 258 | ||
252 | /** returns dates of the currently selected events */ | 259 | /** returns dates of the currently selected events */ |
253 | virtual DateList selectedDates(); | 260 | virtual DateList selectedDates(); |
254 | #if 0 | 261 | #if 0 |
255 | virtual void printPreview(CalPrinter *calPrinter, | 262 | virtual void printPreview(CalPrinter *calPrinter, |
256 | const QDate &, const QDate &); | 263 | const QDate &, const QDate &); |
@@ -266,13 +273,13 @@ class KOMonthView: public KOEventView | |||
266 | void incidenceHighlighted( Incidence *, MonthViewCell*, int ); | 273 | void incidenceHighlighted( Incidence *, MonthViewCell*, int ); |
267 | void nextCell(); | 274 | void nextCell(); |
268 | void prevCell(); | 275 | void prevCell(); |
269 | virtual void updateView(); | 276 | virtual void updateView(); |
270 | virtual void updateConfig(); | 277 | virtual void updateConfig(); |
271 | virtual void showDates(const QDate &start, const QDate &end); | 278 | virtual void showDates(const QDate &start, const QDate &end); |
272 | virtual void showEvents(QPtrList<Event> eventList); | 279 | virtual void showEvents(Q3PtrList<Event> eventList); |
273 | 280 | ||
274 | void changeEventDisplay(Event *, int); | 281 | void changeEventDisplay(Event *, int); |
275 | 282 | ||
276 | void clearSelection(); | 283 | void clearSelection(); |
277 | 284 | ||
278 | void showContextMenu( Incidence * ); | 285 | void showContextMenu( Incidence * ); |
@@ -308,13 +315,13 @@ class KOMonthView: public KOEventView | |||
308 | private: | 315 | private: |
309 | int mKBFcounter; | 316 | int mKBFcounter; |
310 | QTimer* mComputeLayoutTimer; | 317 | QTimer* mComputeLayoutTimer; |
311 | NavigatorBar* mNavigatorBar; | 318 | NavigatorBar* mNavigatorBar; |
312 | int currentWeek(); | 319 | int currentWeek(); |
313 | bool clPending; | 320 | bool clPending; |
314 | QWidgetStack * mWidStack; | 321 | Q3WidgetStack * mWidStack; |
315 | QWidget* mMonthView; | 322 | QWidget* mMonthView; |
316 | QWidget* mWeekView; | 323 | QWidget* mWeekView; |
317 | bool mShowWeekView; | 324 | bool mShowWeekView; |
318 | bool updatePossible; | 325 | bool updatePossible; |
319 | int mDaysPerWeek; | 326 | int mDaysPerWeek; |
320 | int mNumWeeks; | 327 | int mNumWeeks; |
@@ -322,30 +329,30 @@ class KOMonthView: public KOEventView | |||
322 | //bool mWeekStartsMonday; | 329 | //bool mWeekStartsMonday; |
323 | bool mShowSatSunComp; | 330 | bool mShowSatSunComp; |
324 | void computeLayout(); | 331 | void computeLayout(); |
325 | void computeLayoutWeek(); | 332 | void computeLayoutWeek(); |
326 | void doComputeLayoutWeek(); | 333 | void doComputeLayoutWeek(); |
327 | 334 | ||
328 | QPtrVector<MonthViewCell> mCells; | 335 | Q3PtrVector<MonthViewCell> mCells; |
329 | QPtrVector<QLabel> mDayLabels; | 336 | Q3PtrVector<QLabel> mDayLabels; |
330 | QPtrVector<KOWeekButton> mWeekLabels; | 337 | Q3PtrVector<KOWeekButton> mWeekLabels; |
331 | QPtrVector<MonthViewCell> mCellsW; | 338 | Q3PtrVector<MonthViewCell> mCellsW; |
332 | QPtrVector<QLabel> mDayLabelsW; | 339 | Q3PtrVector<QLabel> mDayLabelsW; |
333 | QPtrVector<KOWeekButton> mWeekLabelsW; | 340 | Q3PtrVector<KOWeekButton> mWeekLabelsW; |
334 | 341 | ||
335 | bool mShortDayLabelsM; | 342 | bool mShortDayLabelsM; |
336 | bool mShortDayLabelsW; | 343 | bool mShortDayLabelsW; |
337 | int mWidthLongDayLabel; | 344 | int mWidthLongDayLabel; |
338 | 345 | ||
339 | QDate mStartDate; | 346 | QDate mStartDate; |
340 | 347 | ||
341 | MonthViewCell *mSelectedCell; | 348 | MonthViewCell *mSelectedCell; |
342 | MonthViewCell *mPopupCell; | 349 | MonthViewCell *mPopupCell; |
343 | bool mFlagKeyPressed; | 350 | bool mFlagKeyPressed; |
344 | KOEventPopupMenu *mContextMenu; | 351 | KOEventPopupMenu *mContextMenu; |
345 | QPopupMenu *mNewItemMenu; | 352 | Q3PopupMenu *mNewItemMenu; |
346 | void keyPressEvent ( QKeyEvent * ) ; | 353 | void keyPressEvent ( QKeyEvent * ) ; |
347 | void keyReleaseEvent ( QKeyEvent * ) ; | 354 | void keyReleaseEvent ( QKeyEvent * ) ; |
348 | 355 | ||
349 | }; | 356 | }; |
350 | 357 | ||
351 | #endif | 358 | #endif |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 5078c57..0bd46ea 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -23,13 +23,13 @@ | |||
23 | 23 | ||
24 | #include <time.h> | 24 | #include <time.h> |
25 | #ifndef _WIN32_ | 25 | #ifndef _WIN32_ |
26 | #include <unistd.h> | 26 | #include <unistd.h> |
27 | #endif | 27 | #endif |
28 | #include <qdir.h> | 28 | #include <qdir.h> |
29 | #include <qtextstream.h> | 29 | #include <q3textstream.h> |
30 | #include <qtextcodec.h> | 30 | #include <qtextcodec.h> |
31 | #include <qstring.h> | 31 | #include <qstring.h> |
32 | #include <qregexp.h> | 32 | #include <qregexp.h> |
33 | #include <qfont.h> | 33 | #include <qfont.h> |
34 | #include <qcolor.h> | 34 | #include <qcolor.h> |
35 | #include <qstringlist.h> | 35 | #include <qstringlist.h> |
@@ -302,19 +302,19 @@ KOPrefs::KOPrefs() : | |||
302 | 302 | ||
303 | addItemBool("CompactDialogs",&mCompactDialogs,false); | 303 | addItemBool("CompactDialogs",&mCompactDialogs,false); |
304 | addItemBool("VerticalScreen",&mVerticalScreen,true); | 304 | addItemBool("VerticalScreen",&mVerticalScreen,true); |
305 | 305 | ||
306 | KPrefs::setCurrentGroup("KOrganizer Plugins"); | 306 | KPrefs::setCurrentGroup("KOrganizer Plugins"); |
307 | 307 | ||
308 | addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); | 308 | addItemStringList("SelectedPlugins",&mSelectedPlugins,QStringList("holidays")); |
309 | 309 | ||
310 | KPrefs::setCurrentGroup("Group Scheduling"); | 310 | KPrefs::setCurrentGroup("Group Scheduling"); |
311 | 311 | ||
312 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); | 312 | addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); |
313 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); | 313 | addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); |
314 | addItemStringList("AdditionalMails",&mAdditionalMails,""); | 314 | addItemStringList("AdditionalMails",&mAdditionalMails,QStringList()); |
315 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); | 315 | addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); |
316 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); | 316 | addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); |
317 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); | 317 | addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); |
318 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); | 318 | addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); |
319 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); | 319 | addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); |
320 | 320 | ||
@@ -563,13 +563,13 @@ void KOPrefs::usrWriteConfig() | |||
563 | 563 | ||
564 | config()->setGroup("Personal Settings"); | 564 | config()->setGroup("Personal Settings"); |
565 | config()->writeEntry("user_name",mName); | 565 | config()->writeEntry("user_name",mName); |
566 | config()->writeEntry("user_email",mEmail); | 566 | config()->writeEntry("user_email",mEmail); |
567 | 567 | ||
568 | config()->setGroup("Category Colors"); | 568 | config()->setGroup("Category Colors"); |
569 | QDictIterator<QColor> it(mCategoryColors); | 569 | Q3DictIterator<QColor> it(mCategoryColors); |
570 | while (it.current()) { | 570 | while (it.current()) { |
571 | config()->writeEntry(it.currentKey(),*(it.current())); | 571 | config()->writeEntry(it.currentKey(),*(it.current())); |
572 | ++it; | 572 | ++it; |
573 | } | 573 | } |
574 | KConfig fc (locateLocal("config","kopicalendarrc")); | 574 | KConfig fc (locateLocal("config","kopicalendarrc")); |
575 | fc.setGroup("CC"); | 575 | fc.setGroup("CC"); |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 94bdd33..35c6110 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -22,15 +22,18 @@ | |||
22 | */ | 22 | */ |
23 | #ifndef KOPREFS_H | 23 | #ifndef KOPREFS_H |
24 | #define KOPREFS_H | 24 | #define KOPREFS_H |
25 | 25 | ||
26 | 26 | ||
27 | #include <libkdepim/kpimprefs.h> | 27 | #include <libkdepim/kpimprefs.h> |
28 | #include <qdict.h> | 28 | #include <q3dict.h> |
29 | #include <qdir.h> | 29 | #include <qdir.h> |
30 | #include <qobject.h> | 30 | #include <qobject.h> |
31 | #include <QDateTime> | ||
32 | //Added by qt3to4: | ||
33 | #include <Q3PtrList> | ||
31 | 34 | ||
32 | class KConfig; | 35 | class KConfig; |
33 | class QFont; | 36 | class QFont; |
34 | class QColor; | 37 | class QColor; |
35 | class QStringList; | 38 | class QStringList; |
36 | 39 | ||
@@ -344,13 +347,13 @@ class KOPrefs : public KPimPrefs | |||
344 | bool mEVshowChanged; | 347 | bool mEVshowChanged; |
345 | bool mWTshowDetails; | 348 | bool mWTshowDetails; |
346 | bool mWTshowCreated; | 349 | bool mWTshowCreated; |
347 | bool mWTshowChanged; | 350 | bool mWTshowChanged; |
348 | 351 | ||
349 | int mCurrentDisplayedView; | 352 | int mCurrentDisplayedView; |
350 | QPtrList<KopiCalendarFile> mCalendars; | 353 | Q3PtrList<KopiCalendarFile> mCalendars; |
351 | int mNextAvailableCalendar; | 354 | int mNextAvailableCalendar; |
352 | bool mGlobalUpdateDisabled; | 355 | bool mGlobalUpdateDisabled; |
353 | 356 | ||
354 | 357 | ||
355 | bool mDetectConflicts; | 358 | bool mDetectConflicts; |
356 | bool mIncludeFree; | 359 | bool mIncludeFree; |
@@ -359,14 +362,14 @@ class KOPrefs : public KPimPrefs | |||
359 | bool mCheckConflictsNonADAllDay; | 362 | bool mCheckConflictsNonADAllDay; |
360 | bool mCheckConflictsNonADNonAD; | 363 | bool mCheckConflictsNonADNonAD; |
361 | QString mFilterConflictEditItem; | 364 | QString mFilterConflictEditItem; |
362 | QString mFilterConflictAllItem; | 365 | QString mFilterConflictAllItem; |
363 | 366 | ||
364 | private: | 367 | private: |
365 | QDict<QColor> mCategoryColors; | 368 | Q3Dict<QColor> mCategoryColors; |
366 | QArray<KopiCalendarFile*> mDefCalColors; | 369 | QVector<KopiCalendarFile*> mDefCalColors; |
367 | QColor mDefaultCategoryColor; | 370 | QColor mDefaultCategoryColor; |
368 | 371 | ||
369 | QFont mDefaultTimeBarFont; | 372 | QFont mDefaultTimeBarFont; |
370 | QFont mDefaultViewFont; | 373 | QFont mDefaultViewFont; |
371 | QFont mDefaultMonthViewFont; | 374 | QFont mDefaultMonthViewFont; |
372 | 375 | ||
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index f1a6c3d..43c488f 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -20,30 +20,36 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qgroupbox.h> | 26 | #include <q3groupbox.h> |
27 | #include <qbuttongroup.h> | 27 | #include <q3buttongroup.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qfont.h> | 29 | #include <qfont.h> |
30 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtextstream.h> | 32 | #include <q3textstream.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qvbox.h> | 34 | #include <q3vbox.h> |
35 | #include <qhbox.h> | 35 | #include <q3hbox.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qradiobutton.h> | 40 | #include <qradiobutton.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qstrlist.h> | 42 | #include <q3strlist.h> |
43 | #include <qapplication.h> | 43 | #include <qapplication.h> |
44 | #include <QDesktopWidget> | ||
45 | //Added by qt3to4: | ||
46 | #include <Q3HBoxLayout> | ||
47 | #include <Q3GridLayout> | ||
48 | #include <QPixmap> | ||
49 | #include <Q3Frame> | ||
44 | 50 | ||
45 | #include <kcolorbutton.h> | 51 | #include <kcolorbutton.h> |
46 | #include <kdebug.h> | 52 | #include <kdebug.h> |
47 | #include <klocale.h> | 53 | #include <klocale.h> |
48 | #include <kglobal.h> | 54 | #include <kglobal.h> |
49 | #include <kfontdialog.h> | 55 | #include <kfontdialog.h> |
@@ -113,14 +119,14 @@ void KOPrefsDialog::setupGlobalTab() | |||
113 | 119 | ||
114 | 120 | ||
115 | } | 121 | } |
116 | void KOPrefsDialog::setupLocaleDateTab() | 122 | void KOPrefsDialog::setupLocaleDateTab() |
117 | { | 123 | { |
118 | #if 0 | 124 | #if 0 |
119 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 125 | Q3Frame *topFrame = addPage(i18n("Date Format"),0,0); |
120 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | 126 | Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,2); |
121 | topLayout->setSpacing(mSpacingHint); | 127 | topLayout->setSpacing(mSpacingHint); |
122 | topLayout->setMargin(mMarginHint); | 128 | topLayout->setMargin(mMarginHint); |
123 | int iii = 0; | 129 | int iii = 0; |
124 | 130 | ||
125 | 131 | ||
126 | KPrefsDialogWidRadios *syncPrefsGroup = | 132 | KPrefsDialogWidRadios *syncPrefsGroup = |
@@ -169,14 +175,14 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0); | |||
169 | 175 | ||
170 | } | 176 | } |
171 | 177 | ||
172 | void KOPrefsDialog::setupLocaleTab() | 178 | void KOPrefsDialog::setupLocaleTab() |
173 | { | 179 | { |
174 | #if 0 | 180 | #if 0 |
175 | QFrame *topFrame = addPage(i18n("Locale"),0,0); | 181 | Q3Frame *topFrame = addPage(i18n("Locale"),0,0); |
176 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 182 | Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); |
177 | topLayout->setSpacing(mSpacingHint); | 183 | topLayout->setSpacing(mSpacingHint); |
178 | topLayout->setMargin(mMarginHint); | 184 | topLayout->setMargin(mMarginHint); |
179 | int iii = 0; | 185 | int iii = 0; |
180 | KPrefsDialogWidRadios *syncPrefsGroup = | 186 | KPrefsDialogWidRadios *syncPrefsGroup = |
181 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); | 187 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); |
182 | syncPrefsGroup->addRadio(i18n("English")); | 188 | syncPrefsGroup->addRadio(i18n("English")); |
@@ -208,13 +214,13 @@ void KOPrefsDialog::setupLocaleTab() | |||
208 | addWidBool(i18n("Use short date in (WN/E) view"), | 214 | addWidBool(i18n("Use short date in (WN/E) view"), |
209 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 215 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
210 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 216 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
211 | } | 217 | } |
212 | else { | 218 | else { |
213 | QWidget * hb = new QWidget( topFrame ); | 219 | QWidget * hb = new QWidget( topFrame ); |
214 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); | 220 | Q3HBoxLayout *hbLayout = new Q3HBoxLayout(hb); |
215 | sb = | 221 | sb = |
216 | addWidBool(i18n("Week starts on Sunday"), | 222 | addWidBool(i18n("Week starts on Sunday"), |
217 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); | 223 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); |
218 | hbLayout->addWidget(sb->checkBox() ); | 224 | hbLayout->addWidget(sb->checkBox() ); |
219 | sb = | 225 | sb = |
220 | addWidBool(i18n("Use short date in (WN/E) view"), | 226 | addWidBool(i18n("Use short date in (WN/E) view"), |
@@ -233,16 +239,16 @@ void KOPrefsDialog::setupLocaleTab() | |||
233 | #endif | 239 | #endif |
234 | #endif | 240 | #endif |
235 | } | 241 | } |
236 | 242 | ||
237 | void KOPrefsDialog::setupMainTab() | 243 | void KOPrefsDialog::setupMainTab() |
238 | { | 244 | { |
239 | QFrame *topFrame = addPage(i18n("General"),0,0); | 245 | Q3Frame *topFrame = addPage(i18n("General"),0,0); |
240 | // DesktopIcon("identity",KIcon::SizeMedium)); | 246 | // DesktopIcon("identity",KIcon::SizeMedium)); |
241 | 247 | ||
242 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 248 | Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); |
243 | topLayout->setSpacing(mSpacingHint); | 249 | topLayout->setSpacing(mSpacingHint); |
244 | topLayout->setMargin(mMarginHint); | 250 | topLayout->setMargin(mMarginHint); |
245 | 251 | ||
246 | // KPrefsDialogWidBool *emailControlCenter = | 252 | // KPrefsDialogWidBool *emailControlCenter = |
247 | // addWidBool(i18n("&Use email settings from Control Center"), | 253 | // addWidBool(i18n("&Use email settings from Control Center"), |
248 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | 254 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); |
@@ -284,18 +290,18 @@ void KOPrefsDialog::setupMainTab() | |||
284 | widbool = addWidBool(i18n("Block popup until mouse button release"), | 290 | widbool = addWidBool(i18n("Block popup until mouse button release"), |
285 | &(KOPrefs::instance()->mBlockPopupMenu),topFrame); | 291 | &(KOPrefs::instance()->mBlockPopupMenu),topFrame); |
286 | topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); | 292 | topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); |
287 | ++iii; | 293 | ++iii; |
288 | if ( QApplication::desktop()->height() <= 240 ) { | 294 | if ( QApplication::desktop()->height() <= 240 ) { |
289 | topFrame = addPage(i18n("General") +" 2",0,0); | 295 | topFrame = addPage(i18n("General") +" 2",0,0); |
290 | topLayout = new QGridLayout(topFrame,4,2); | 296 | topLayout = new Q3GridLayout(topFrame,4,2); |
291 | topLayout->setSpacing(2); | 297 | topLayout->setSpacing(2); |
292 | topLayout->setMargin(3); | 298 | topLayout->setMargin(3); |
293 | iii = 0; | 299 | iii = 0; |
294 | } | 300 | } |
295 | QHBox *dummy = new QHBox(topFrame); | 301 | Q3HBox *dummy = new Q3HBox(topFrame); |
296 | new QLabel(i18n("Days in Next-X-Days:"),dummy); | 302 | new QLabel(i18n("Days in Next-X-Days:"),dummy); |
297 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); | 303 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); |
298 | 304 | ||
299 | topLayout->addMultiCellWidget(dummy,iii,iii,0,1); | 305 | topLayout->addMultiCellWidget(dummy,iii,iii,0,1); |
300 | 306 | ||
301 | ++iii; | 307 | ++iii; |
@@ -310,13 +316,13 @@ void KOPrefsDialog::setupMainTab() | |||
310 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); | 316 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); |
311 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); | 317 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); |
312 | 318 | ||
313 | // addWidBool(i18n("Enable automatic saving of calendar"), | 319 | // addWidBool(i18n("Enable automatic saving of calendar"), |
314 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); | 320 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); |
315 | 321 | ||
316 | QHBox *intervalBox = new QHBox(topFrame); | 322 | Q3HBox *intervalBox = new Q3HBox(topFrame); |
317 | // intervalBox->setSpacing(mSpacingHint); | 323 | // intervalBox->setSpacing(mSpacingHint); |
318 | topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); | 324 | topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); |
319 | ++iii; | 325 | ++iii; |
320 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); | 326 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); |
321 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); | 327 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); |
322 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); | 328 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); |
@@ -399,20 +405,20 @@ void KOPrefsDialog::setupMainTab() | |||
399 | */ | 405 | */ |
400 | } | 406 | } |
401 | 407 | ||
402 | 408 | ||
403 | void KOPrefsDialog::setupTimeTab() | 409 | void KOPrefsDialog::setupTimeTab() |
404 | { | 410 | { |
405 | QFrame *topFrame = addPage(i18n("Time"),0,0); | 411 | Q3Frame *topFrame = addPage(i18n("Time"),0,0); |
406 | // DesktopIcon("clock",KIcon::SizeMedium)); | 412 | // DesktopIcon("clock",KIcon::SizeMedium)); |
407 | 413 | ||
408 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 414 | Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); |
409 | topLayout->setSpacing(mSpacingHint); | 415 | topLayout->setSpacing(mSpacingHint); |
410 | topLayout->setMargin(mMarginHint); | 416 | topLayout->setMargin(mMarginHint); |
411 | 417 | ||
412 | QHBox *dummy = new QHBox(topFrame); | 418 | Q3HBox *dummy = new Q3HBox(topFrame); |
413 | KPrefsDialogWidTime *dayBegins = | 419 | KPrefsDialogWidTime *dayBegins = |
414 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 420 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
415 | dummy); | 421 | dummy); |
416 | //topLayout->addWidget(dayBegins->label(),2,0); | 422 | //topLayout->addWidget(dayBegins->label(),2,0); |
417 | 423 | ||
418 | //topLayout->addWidget(dayBegins->spinBox(),2,1); | 424 | //topLayout->addWidget(dayBegins->spinBox(),2,1); |
@@ -438,34 +444,34 @@ void KOPrefsDialog::setupTimeTab() | |||
438 | mAlarmTimeCombo = new QComboBox(topFrame); | 444 | mAlarmTimeCombo = new QComboBox(topFrame); |
439 | mAlarmTimeCombo->insertStringList(alarmList); | 445 | mAlarmTimeCombo->insertStringList(alarmList); |
440 | topLayout->addWidget(mAlarmTimeCombo,3,1); | 446 | topLayout->addWidget(mAlarmTimeCombo,3,1); |
441 | int iii = 4; | 447 | int iii = 4; |
442 | if ( QApplication::desktop()->height() <= 240 ) { | 448 | if ( QApplication::desktop()->height() <= 240 ) { |
443 | topFrame = addPage(i18n("Time") +" 2",0,0); | 449 | topFrame = addPage(i18n("Time") +" 2",0,0); |
444 | topLayout = new QGridLayout(topFrame,1,2); | 450 | topLayout = new Q3GridLayout(topFrame,1,2); |
445 | topLayout->setSpacing(2); | 451 | topLayout->setSpacing(2); |
446 | topLayout->setMargin(3); | 452 | topLayout->setMargin(3); |
447 | iii = 0; | 453 | iii = 0; |
448 | } | 454 | } |
449 | 455 | ||
450 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, | 456 | Q3GroupBox *workingHoursGroup = new Q3GroupBox(1,Qt::Horizontal, |
451 | i18n("Working Hours"), | 457 | i18n("Working Hours"), |
452 | topFrame); | 458 | topFrame); |
453 | topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1); | 459 | topLayout->addMultiCellWidget(workingHoursGroup,iii,iii,0,1); |
454 | workingHoursGroup->layout()->setSpacing( 0 ); | 460 | workingHoursGroup->layout()->setSpacing( 0 ); |
455 | workingHoursGroup->layout()->setMargin( 4 ); | 461 | workingHoursGroup->layout()->setMargin( 4 ); |
456 | QHBox *workStartBox = new QHBox(workingHoursGroup); | 462 | Q3HBox *workStartBox = new Q3HBox(workingHoursGroup); |
457 | // workStartBox->setMargin( 0 ); | 463 | // workStartBox->setMargin( 0 ); |
458 | addWidTime(i18n("Daily starting hour:"), | 464 | addWidTime(i18n("Daily starting hour:"), |
459 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); | 465 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); |
460 | 466 | ||
461 | QHBox *workEndBox = new QHBox(workingHoursGroup); | 467 | Q3HBox *workEndBox = new Q3HBox(workingHoursGroup); |
462 | //workEndBox->setMargin( 0 ); | 468 | //workEndBox->setMargin( 0 ); |
463 | addWidTime(i18n("Daily ending hour:"), | 469 | addWidTime(i18n("Daily ending hour:"), |
464 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); | 470 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); |
465 | QVBox *excludeBox = new QVBox(workingHoursGroup); | 471 | Q3VBox *excludeBox = new Q3VBox(workingHoursGroup); |
466 | //excludeBox->setMargin( 0 ); | 472 | //excludeBox->setMargin( 0 ); |
467 | addWidBool(i18n("Exclude holidays"), | 473 | addWidBool(i18n("Exclude holidays"), |
468 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); | 474 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); |
469 | 475 | ||
470 | addWidBool(i18n("Exclude Saturdays"), | 476 | addWidBool(i18n("Exclude Saturdays"), |
471 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); | 477 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); |
@@ -479,16 +485,16 @@ void KOPrefsDialog::setupTimeTab() | |||
479 | } | 485 | } |
480 | 486 | ||
481 | 487 | ||
482 | void KOPrefsDialog::setupViewsTab() | 488 | void KOPrefsDialog::setupViewsTab() |
483 | { | 489 | { |
484 | 490 | ||
485 | QFrame *topFrame = addPage(i18n("Views"),0,0); | 491 | Q3Frame *topFrame = addPage(i18n("Views"),0,0); |
486 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 492 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
487 | 493 | ||
488 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); | 494 | Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,1); |
489 | topLayout->setSpacing(mSpacingHint); | 495 | topLayout->setSpacing(mSpacingHint); |
490 | topLayout->setMargin(mMarginHint); | 496 | topLayout->setMargin(mMarginHint); |
491 | 497 | ||
492 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; | 498 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; |
493 | // topLayout->addLayout(dayBeginsLayout,0,0); | 499 | // topLayout->addLayout(dayBeginsLayout,0,0); |
494 | 500 | ||
@@ -527,13 +533,13 @@ void KOPrefsDialog::setupViewsTab() | |||
527 | 533 | ||
528 | #if 0 | 534 | #if 0 |
529 | 535 | ||
530 | topFrame = addPage(i18n("ViewChange"),0,0); | 536 | topFrame = addPage(i18n("ViewChange"),0,0); |
531 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 537 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
532 | 538 | ||
533 | topLayout = new QGridLayout(topFrame,6,1); | 539 | topLayout = new Q3GridLayout(topFrame,6,1); |
534 | topLayout->setSpacing(mSpacingHint); | 540 | topLayout->setSpacing(mSpacingHint); |
535 | topLayout->setMargin(mMarginHint); | 541 | topLayout->setMargin(mMarginHint); |
536 | ii = 0; | 542 | ii = 0; |
537 | 543 | ||
538 | #endif | 544 | #endif |
539 | 545 | ||
@@ -591,13 +597,13 @@ void KOPrefsDialog::setupViewsTab() | |||
591 | #endif | 597 | #endif |
592 | // ********************************************************* | 598 | // ********************************************************* |
593 | 599 | ||
594 | topFrame = addPage(i18n("Agenda View"),0,0); | 600 | topFrame = addPage(i18n("Agenda View"),0,0); |
595 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 601 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
596 | 602 | ||
597 | topLayout = new QGridLayout(topFrame,5,1); | 603 | topLayout = new Q3GridLayout(topFrame,5,1); |
598 | topLayout->setSpacing(mSpacingHint); | 604 | topLayout->setSpacing(mSpacingHint); |
599 | topLayout->setMargin(mMarginHint); | 605 | topLayout->setMargin(mMarginHint); |
600 | ii = 0; | 606 | ii = 0; |
601 | 607 | ||
602 | 608 | ||
603 | dummy = | 609 | dummy = |
@@ -649,18 +655,18 @@ void KOPrefsDialog::setupViewsTab() | |||
649 | 655 | ||
650 | 656 | ||
651 | 657 | ||
652 | topFrame = addPage(i18n("Month View"),0,0); | 658 | topFrame = addPage(i18n("Month View"),0,0); |
653 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 659 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
654 | 660 | ||
655 | topLayout = new QGridLayout(topFrame,5,1); | 661 | topLayout = new Q3GridLayout(topFrame,5,1); |
656 | topLayout->setSpacing(mSpacingHint); | 662 | topLayout->setSpacing(mSpacingHint); |
657 | topLayout->setMargin(mMarginHint); | 663 | topLayout->setMargin(mMarginHint); |
658 | ii = 0; | 664 | ii = 0; |
659 | QLabel *lab; | 665 | QLabel *lab; |
660 | QHBox *habo = new QHBox( topFrame ); | 666 | Q3HBox *habo = new Q3HBox( topFrame ); |
661 | if ( QApplication::desktop()->width() <= 480 ) { | 667 | if ( QApplication::desktop()->width() <= 480 ) { |
662 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); | 668 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); |
663 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 669 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
664 | ii++; | 670 | ii++; |
665 | } else { | 671 | } else { |
666 | new QLabel ( i18n("Show events that recur "), habo ); | 672 | new QLabel ( i18n("Show events that recur "), habo ); |
@@ -674,13 +680,13 @@ void KOPrefsDialog::setupViewsTab() | |||
674 | addWidBool(i18n("weekly"), | 680 | addWidBool(i18n("weekly"), |
675 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); | 681 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); |
676 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 682 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
677 | ii++; | 683 | ii++; |
678 | 684 | ||
679 | 685 | ||
680 | habo = new QHBox( topFrame ); | 686 | habo = new Q3HBox( topFrame ); |
681 | if ( QApplication::desktop()->width() <= 480 ) { | 687 | if ( QApplication::desktop()->width() <= 480 ) { |
682 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); | 688 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); |
683 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 689 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
684 | ii++; | 690 | ii++; |
685 | 691 | ||
686 | } else { | 692 | } else { |
@@ -727,13 +733,13 @@ void KOPrefsDialog::setupViewsTab() | |||
727 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 733 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
728 | 734 | ||
729 | 735 | ||
730 | 736 | ||
731 | if ( QApplication::desktop()->height() <= 240 ) { | 737 | if ( QApplication::desktop()->height() <= 240 ) { |
732 | topFrame = addPage(i18n("Month View") +" 2",0,0); | 738 | topFrame = addPage(i18n("Month View") +" 2",0,0); |
733 | topLayout = new QGridLayout(topFrame,4,1); | 739 | topLayout = new Q3GridLayout(topFrame,4,1); |
734 | topLayout->setSpacing(2); | 740 | topLayout->setSpacing(2); |
735 | topLayout->setMargin(1); | 741 | topLayout->setMargin(1); |
736 | ii = 0; | 742 | ii = 0; |
737 | } | 743 | } |
738 | 744 | ||
739 | 745 | ||
@@ -761,25 +767,25 @@ void KOPrefsDialog::setupViewsTab() | |||
761 | topLayout->addWidget(holidayColor->label(),ii,0); | 767 | topLayout->addWidget(holidayColor->label(),ii,0); |
762 | topLayout->addWidget(holidayColor->button(),ii++,1); | 768 | topLayout->addWidget(holidayColor->button(),ii++,1); |
763 | // *********************** What'sNext View | 769 | // *********************** What'sNext View |
764 | topFrame = addPage(i18n("What's Next View"),0,0); | 770 | topFrame = addPage(i18n("What's Next View"),0,0); |
765 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 771 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
766 | 772 | ||
767 | topLayout = new QGridLayout(topFrame,4,1); | 773 | topLayout = new Q3GridLayout(topFrame,4,1); |
768 | topLayout->setSpacing(mSpacingHint); | 774 | topLayout->setSpacing(mSpacingHint); |
769 | topLayout->setMargin(mMarginHint); | 775 | topLayout->setMargin(mMarginHint); |
770 | ii = 0; | 776 | ii = 0; |
771 | 777 | ||
772 | 778 | ||
773 | QHBox* hdummy = new QHBox(topFrame); | 779 | Q3HBox* hdummy = new Q3HBox(topFrame); |
774 | new QLabel(i18n("Days in What's Next:"),hdummy); | 780 | new QLabel(i18n("Days in What's Next:"),hdummy); |
775 | mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); | 781 | mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); |
776 | 782 | ||
777 | topLayout->addWidget(hdummy,ii++,0); | 783 | topLayout->addWidget(hdummy,ii++,0); |
778 | 784 | ||
779 | QHBox *prioBox = new QHBox(topFrame); | 785 | Q3HBox *prioBox = new Q3HBox(topFrame); |
780 | // intervalBox->setSpacing(mSpacingHint); | 786 | // intervalBox->setSpacing(mSpacingHint); |
781 | topLayout->addWidget(prioBox,ii++,0); | 787 | topLayout->addWidget(prioBox,ii++,0); |
782 | 788 | ||
783 | QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox); | 789 | QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox); |
784 | mPrioSpin = new QSpinBox(0,5,1,prioBox); | 790 | mPrioSpin = new QSpinBox(0,5,1,prioBox); |
785 | if ( QApplication::desktop()->width() < 300 ) | 791 | if ( QApplication::desktop()->width() < 300 ) |
@@ -815,13 +821,13 @@ void KOPrefsDialog::setupViewsTab() | |||
815 | 821 | ||
816 | // *********************** Todo View | 822 | // *********************** Todo View |
817 | 823 | ||
818 | topFrame = addPage(i18n("Todo View"),0,0); | 824 | topFrame = addPage(i18n("Todo View"),0,0); |
819 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 825 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
820 | 826 | ||
821 | topLayout = new QGridLayout(topFrame,4,1); | 827 | topLayout = new Q3GridLayout(topFrame,4,1); |
822 | topLayout->setSpacing(mSpacingHint); | 828 | topLayout->setSpacing(mSpacingHint); |
823 | topLayout->setMargin(mMarginHint); | 829 | topLayout->setMargin(mMarginHint); |
824 | ii = 0; | 830 | ii = 0; |
825 | dummy = | 831 | dummy = |
826 | addWidBool(i18n("Hide not running Todos in To-do view"), | 832 | addWidBool(i18n("Hide not running Todos in To-do view"), |
827 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); | 833 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); |
@@ -852,31 +858,31 @@ dummy = | |||
852 | 858 | ||
853 | QWidget* wid = new QWidget( topFrame ); | 859 | QWidget* wid = new QWidget( topFrame ); |
854 | // Todo run today color | 860 | // Todo run today color |
855 | KPrefsDialogWidColor *todoRunColor = | 861 | KPrefsDialogWidColor *todoRunColor = |
856 | addWidColor(i18n("Color for running todos:"), | 862 | addWidColor(i18n("Color for running todos:"), |
857 | &(KOPrefs::instance()->mTodoRunColor),wid); | 863 | &(KOPrefs::instance()->mTodoRunColor),wid); |
858 | QHBoxLayout *widLayout = new QHBoxLayout(wid); | 864 | Q3HBoxLayout *widLayout = new Q3HBoxLayout(wid); |
859 | widLayout->addWidget( todoRunColor->label() ); | 865 | widLayout->addWidget( todoRunColor->label() ); |
860 | widLayout->addWidget( todoRunColor->button() ); | 866 | widLayout->addWidget( todoRunColor->button() ); |
861 | topLayout->addWidget(wid,ii++,0); | 867 | topLayout->addWidget(wid,ii++,0); |
862 | 868 | ||
863 | wid = new QWidget( topFrame ); | 869 | wid = new QWidget( topFrame ); |
864 | // Todo due today color | 870 | // Todo due today color |
865 | KPrefsDialogWidColor *todoDueTodayColor = | 871 | KPrefsDialogWidColor *todoDueTodayColor = |
866 | addWidColor(i18n("Todo due today color:"), | 872 | addWidColor(i18n("Todo due today color:"), |
867 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); | 873 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); |
868 | widLayout = new QHBoxLayout(wid); | 874 | widLayout = new Q3HBoxLayout(wid); |
869 | widLayout->addWidget( todoDueTodayColor->label() ); | 875 | widLayout->addWidget( todoDueTodayColor->label() ); |
870 | widLayout->addWidget( todoDueTodayColor->button() ); | 876 | widLayout->addWidget( todoDueTodayColor->button() ); |
871 | topLayout->addWidget(wid,ii++,0); | 877 | topLayout->addWidget(wid,ii++,0); |
872 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); | 878 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); |
873 | 879 | ||
874 | // Todo overdue color | 880 | // Todo overdue color |
875 | wid = new QWidget( topFrame ); | 881 | wid = new QWidget( topFrame ); |
876 | widLayout = new QHBoxLayout(wid); | 882 | widLayout = new Q3HBoxLayout(wid); |
877 | KPrefsDialogWidColor *todoOverdueColor = | 883 | KPrefsDialogWidColor *todoOverdueColor = |
878 | addWidColor(i18n("Todo overdue color:"), | 884 | addWidColor(i18n("Todo overdue color:"), |
879 | &(KOPrefs::instance()->mTodoOverdueColor),wid); | 885 | &(KOPrefs::instance()->mTodoOverdueColor),wid); |
880 | widLayout->addWidget(todoOverdueColor->label()); | 886 | widLayout->addWidget(todoOverdueColor->label()); |
881 | widLayout->addWidget(todoOverdueColor->button()); | 887 | widLayout->addWidget(todoOverdueColor->button()); |
882 | topLayout->addWidget(wid,ii++,0); | 888 | topLayout->addWidget(wid,ii++,0); |
@@ -887,13 +893,13 @@ dummy = | |||
887 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 893 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
888 | 894 | ||
889 | 895 | ||
890 | 896 | ||
891 | topFrame = addPage(i18n("View Options"),0,0); | 897 | topFrame = addPage(i18n("View Options"),0,0); |
892 | 898 | ||
893 | topLayout = new QGridLayout(topFrame,4,1); | 899 | topLayout = new Q3GridLayout(topFrame,4,1); |
894 | topLayout->setSpacing(mSpacingHint); | 900 | topLayout->setSpacing(mSpacingHint); |
895 | topLayout->setMargin(mMarginHint); | 901 | topLayout->setMargin(mMarginHint); |
896 | ii = 0; | 902 | ii = 0; |
897 | 903 | ||
898 | dummy = | 904 | dummy = |
899 | addWidBool(i18n("Show Sync Events"), | 905 | addWidBool(i18n("Show Sync Events"), |
@@ -926,22 +932,22 @@ dummy = | |||
926 | dummy = addWidBool(i18n("Last modified time"), | 932 | dummy = addWidBool(i18n("Last modified time"), |
927 | &(KOPrefs::instance()->mWTshowChanged),topFrame); | 933 | &(KOPrefs::instance()->mWTshowChanged),topFrame); |
928 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 934 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
929 | 935 | ||
930 | topFrame = addPage(i18n("Conflict detection"),0,0); | 936 | topFrame = addPage(i18n("Conflict detection"),0,0); |
931 | 937 | ||
932 | topLayout = new QGridLayout(topFrame,2,1); | 938 | topLayout = new Q3GridLayout(topFrame,2,1); |
933 | topLayout->setSpacing(mSpacingHint); | 939 | topLayout->setSpacing(mSpacingHint); |
934 | topLayout->setMargin(mMarginHint); | 940 | topLayout->setMargin(mMarginHint); |
935 | ii = 0; | 941 | ii = 0; |
936 | dummy = addWidBool(i18n("Enable conflict detection"), | 942 | dummy = addWidBool(i18n("Enable conflict detection"), |
937 | &(KOPrefs::instance()->mDetectConflicts),topFrame); | 943 | &(KOPrefs::instance()->mDetectConflicts),topFrame); |
938 | topLayout->addWidget(dummy->checkBox(), ii++,0); | 944 | topLayout->addWidget(dummy->checkBox(), ii++,0); |
939 | topFrame = new QFrame( topFrame ); | 945 | topFrame = new Q3Frame( topFrame ); |
940 | topLayout->addWidget(topFrame ,ii++,0); | 946 | topLayout->addWidget(topFrame ,ii++,0); |
941 | topLayout = new QGridLayout(topFrame,4,1); | 947 | topLayout = new Q3GridLayout(topFrame,4,1); |
942 | connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) ); | 948 | connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) ); |
943 | dummy = addWidBool(i18n("Include events which \"show as free\""), | 949 | dummy = addWidBool(i18n("Include events which \"show as free\""), |
944 | &(KOPrefs::instance()->mIncludeFree),topFrame); | 950 | &(KOPrefs::instance()->mIncludeFree),topFrame); |
945 | topLayout->addWidget(dummy->checkBox(), ii++,0); | 951 | topLayout->addWidget(dummy->checkBox(), ii++,0); |
946 | topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping."), topFrame ) , ii++,0); | 952 | topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping."), topFrame ) , ii++,0); |
947 | 953 | ||
@@ -967,13 +973,13 @@ dummy = | |||
967 | 973 | ||
968 | 974 | ||
969 | 975 | ||
970 | topFrame = addPage(i18n("Alarm"),0,0); | 976 | topFrame = addPage(i18n("Alarm"),0,0); |
971 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 977 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
972 | 978 | ||
973 | topLayout = new QGridLayout(topFrame,2,1); | 979 | topLayout = new Q3GridLayout(topFrame,2,1); |
974 | topLayout->setSpacing(mSpacingHint); | 980 | topLayout->setSpacing(mSpacingHint); |
975 | topLayout->setMargin(mMarginHint); | 981 | topLayout->setMargin(mMarginHint); |
976 | int iii = 0; | 982 | int iii = 0; |
977 | 983 | ||
978 | dummy = | 984 | dummy = |
979 | addWidBool(i18n("Use internal alarm notification"), | 985 | addWidBool(i18n("Use internal alarm notification"), |
@@ -986,39 +992,39 @@ dummy = | |||
986 | 992 | ||
987 | topLayout->addWidget(lab ,iii++,0); | 993 | topLayout->addWidget(lab ,iii++,0); |
988 | } | 994 | } |
989 | #ifndef DESKTOP_VERSION | 995 | #ifndef DESKTOP_VERSION |
990 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 996 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
991 | #else | 997 | #else |
992 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 998 | lab->setAlignment( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); |
993 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 999 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
994 | #endif | 1000 | #endif |
995 | 1001 | ||
996 | QHBox* dummyBox = new QHBox(topFrame); | 1002 | Q3HBox* dummyBox = new Q3HBox(topFrame); |
997 | new QLabel(i18n("Play beeps count:"),dummyBox); | 1003 | new QLabel(i18n("Play beeps count:"),dummyBox); |
998 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); | 1004 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); |
999 | topLayout->addWidget(dummyBox,iii++,0); | 1005 | topLayout->addWidget(dummyBox,iii++,0); |
1000 | 1006 | ||
1001 | dummyBox = new QHBox(topFrame); | 1007 | dummyBox = new Q3HBox(topFrame); |
1002 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); | 1008 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); |
1003 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); | 1009 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); |
1004 | topLayout->addWidget(dummyBox,iii++,0); | 1010 | topLayout->addWidget(dummyBox,iii++,0); |
1005 | 1011 | ||
1006 | dummyBox = new QHBox(topFrame); | 1012 | dummyBox = new Q3HBox(topFrame); |
1007 | new QLabel(i18n("Default suspend time in min:"),dummyBox); | 1013 | new QLabel(i18n("Default suspend time in min:"),dummyBox); |
1008 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); | 1014 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); |
1009 | topLayout->addWidget(dummyBox,iii++,0); | 1015 | topLayout->addWidget(dummyBox,iii++,0); |
1010 | 1016 | ||
1011 | dummyBox = new QHBox(topFrame); | 1017 | dummyBox = new Q3HBox(topFrame); |
1012 | new QLabel(i18n("Auto suspend count:"),dummyBox); | 1018 | new QLabel(i18n("Auto suspend count:"),dummyBox); |
1013 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); | 1019 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); |
1014 | topLayout->addWidget(dummyBox,iii++,0); | 1020 | topLayout->addWidget(dummyBox,iii++,0); |
1015 | 1021 | ||
1016 | 1022 | ||
1017 | 1023 | ||
1018 | QHBox* hbo = new QHBox ( topFrame ); | 1024 | Q3HBox* hbo = new Q3HBox ( topFrame ); |
1019 | mDefaultAlarmFile = new QLineEdit(hbo); | 1025 | mDefaultAlarmFile = new QLineEdit(hbo); |
1020 | QPushButton * loadTemplate = new QPushButton(hbo); | 1026 | QPushButton * loadTemplate = new QPushButton(hbo); |
1021 | QPixmap icon; | 1027 | QPixmap icon; |
1022 | if ( QApplication::desktop()->width() < 321 ) | 1028 | if ( QApplication::desktop()->width() < 321 ) |
1023 | icon = SmallIcon("fileimport16"); | 1029 | icon = SmallIcon("fileimport16"); |
1024 | else | 1030 | else |
@@ -1052,16 +1058,16 @@ void KOPrefsDialog::selectSoundFile() | |||
1052 | if ( fileName.length() > 0 ) | 1058 | if ( fileName.length() > 0 ) |
1053 | mDefaultAlarmFile->setText( fileName ); | 1059 | mDefaultAlarmFile->setText( fileName ); |
1054 | } | 1060 | } |
1055 | void KOPrefsDialog::setupFontsTab() | 1061 | void KOPrefsDialog::setupFontsTab() |
1056 | { | 1062 | { |
1057 | 1063 | ||
1058 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 1064 | Q3Frame *topFrame = addPage(i18n("Fonts"),0,0); |
1059 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 1065 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
1060 | 1066 | ||
1061 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 1067 | Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3); |
1062 | topLayout->setSpacing(1); | 1068 | topLayout->setSpacing(1); |
1063 | topLayout->setMargin(3); | 1069 | topLayout->setMargin(3); |
1064 | KPrefsDialogWidFont * tVFont; | 1070 | KPrefsDialogWidFont * tVFont; |
1065 | int i = 0; | 1071 | int i = 0; |
1066 | KPrefsDialogWidFont *timeLabelsFont = | 1072 | KPrefsDialogWidFont *timeLabelsFont = |
1067 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), | 1073 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), |
@@ -1122,13 +1128,13 @@ void KOPrefsDialog::setupFontsTab() | |||
1122 | 1128 | ||
1123 | 1129 | ||
1124 | i = 0; | 1130 | i = 0; |
1125 | topFrame = addPage(i18n("View Fonts"),0, | 1131 | topFrame = addPage(i18n("View Fonts"),0, |
1126 | DesktopIcon("fonts",KIcon::SizeMedium)); | 1132 | DesktopIcon("fonts",KIcon::SizeMedium)); |
1127 | 1133 | ||
1128 | topLayout = new QGridLayout(topFrame,7,3); | 1134 | topLayout = new Q3GridLayout(topFrame,7,3); |
1129 | topLayout->setSpacing(1); | 1135 | topLayout->setSpacing(1); |
1130 | topLayout->setMargin(3); | 1136 | topLayout->setMargin(3); |
1131 | 1137 | ||
1132 | tVFont = | 1138 | tVFont = |
1133 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), | 1139 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), |
1134 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); | 1140 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); |
@@ -1190,26 +1196,26 @@ void KOPrefsDialog::setupFontsTab() | |||
1190 | 1196 | ||
1191 | 1197 | ||
1192 | } | 1198 | } |
1193 | 1199 | ||
1194 | void KOPrefsDialog::setupColorsTab() | 1200 | void KOPrefsDialog::setupColorsTab() |
1195 | { | 1201 | { |
1196 | QFrame *topFrame = addPage(i18n("Colors"),0,0); | 1202 | Q3Frame *topFrame = addPage(i18n("Colors"),0,0); |
1197 | // DesktopIcon("colorize",KIcon::SizeMedium)); | 1203 | // DesktopIcon("colorize",KIcon::SizeMedium)); |
1198 | 1204 | ||
1199 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 1205 | Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); |
1200 | // topLayout->setSpacing(mSpacingHint); | 1206 | // topLayout->setSpacing(mSpacingHint); |
1201 | // topLayout->setMargin(mMarginHint); | 1207 | // topLayout->setMargin(mMarginHint); |
1202 | 1208 | ||
1203 | topLayout->setSpacing(2); | 1209 | topLayout->setSpacing(2); |
1204 | topLayout->setMargin(3); | 1210 | topLayout->setMargin(3); |
1205 | 1211 | ||
1206 | int ii = 1; | 1212 | int ii = 1; |
1207 | QGroupBox *categoryGroup ; | 1213 | Q3GroupBox *categoryGroup ; |
1208 | 1214 | ||
1209 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), | 1215 | categoryGroup = new Q3GroupBox(1,Qt::Vertical,i18n("Categories"), |
1210 | topFrame); | 1216 | topFrame); |
1211 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); | 1217 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); |
1212 | 1218 | ||
1213 | mCategoryCombo = new QComboBox(categoryGroup); | 1219 | mCategoryCombo = new QComboBox(categoryGroup); |
1214 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | 1220 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); |
1215 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); | 1221 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); |
@@ -1247,13 +1253,13 @@ void KOPrefsDialog::setupColorsTab() | |||
1247 | topLayout->addWidget(eventColor->button(),ii++,1); | 1253 | topLayout->addWidget(eventColor->button(),ii++,1); |
1248 | 1254 | ||
1249 | if ( QApplication::desktop()->height() <= 240 ) { | 1255 | if ( QApplication::desktop()->height() <= 240 ) { |
1250 | topFrame = addPage(i18n("Colors") +" 2",0,0); | 1256 | topFrame = addPage(i18n("Colors") +" 2",0,0); |
1251 | // DesktopIcon("colorize",KIcon::SizeMedium)); | 1257 | // DesktopIcon("colorize",KIcon::SizeMedium)); |
1252 | 1258 | ||
1253 | topLayout = new QGridLayout(topFrame,5,2); | 1259 | topLayout = new Q3GridLayout(topFrame,5,2); |
1254 | // topLayout->setSpacing(mSpacingHint); | 1260 | // topLayout->setSpacing(mSpacingHint); |
1255 | // topLayout->setMargin(mMarginHint); | 1261 | // topLayout->setMargin(mMarginHint); |
1256 | 1262 | ||
1257 | topLayout->setSpacing(2); | 1263 | topLayout->setSpacing(2); |
1258 | topLayout->setMargin(3); | 1264 | topLayout->setMargin(3); |
1259 | } | 1265 | } |
@@ -1314,26 +1320,26 @@ void KOPrefsDialog::updateCategoryColor() | |||
1314 | 1320 | ||
1315 | void KOPrefsDialog::setupPrinterTab() | 1321 | void KOPrefsDialog::setupPrinterTab() |
1316 | { | 1322 | { |
1317 | mPrinterTab = addPage(i18n("Printing"),0, | 1323 | mPrinterTab = addPage(i18n("Printing"),0, |
1318 | DesktopIcon("fileprint",KIcon::SizeMedium)); | 1324 | DesktopIcon("fileprint",KIcon::SizeMedium)); |
1319 | 1325 | ||
1320 | QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); | 1326 | Q3GridLayout *topLayout = new Q3GridLayout(mPrinterTab,5,2); |
1321 | topLayout->setSpacing(mSpacingHint); | 1327 | topLayout->setSpacing(mSpacingHint); |
1322 | topLayout->setMargin(mMarginHint); | 1328 | topLayout->setMargin(mMarginHint); |
1323 | 1329 | ||
1324 | topLayout->setRowStretch(4,1); | 1330 | topLayout->setRowStretch(4,1); |
1325 | } | 1331 | } |
1326 | 1332 | ||
1327 | void KOPrefsDialog::setupGroupSchedulingTab() | 1333 | void KOPrefsDialog::setupGroupSchedulingTab() |
1328 | { | 1334 | { |
1329 | #if 0 | 1335 | #if 0 |
1330 | QFrame *topFrame = addPage(i18n("Group Scheduling"),0, | 1336 | Q3Frame *topFrame = addPage(i18n("Group Scheduling"),0, |
1331 | DesktopIcon("personal",KIcon::SizeMedium)); | 1337 | DesktopIcon("personal",KIcon::SizeMedium)); |
1332 | 1338 | ||
1333 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 1339 | Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); |
1334 | topLayout->setSpacing(mSpacingHint); | 1340 | topLayout->setSpacing(mSpacingHint); |
1335 | topLayout->setMargin(mMarginHint); | 1341 | topLayout->setMargin(mMarginHint); |
1336 | 1342 | ||
1337 | #if 0 | 1343 | #if 0 |
1338 | KPrefsDialogWidRadios *schedulerGroup = | 1344 | KPrefsDialogWidRadios *schedulerGroup = |
1339 | addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), | 1345 | addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), |
@@ -1350,13 +1356,13 @@ void KOPrefsDialog::setupGroupSchedulingTab() | |||
1350 | sendGroup->addRadio(i18n("Send to outbox")); | 1356 | sendGroup->addRadio(i18n("Send to outbox")); |
1351 | sendGroup->addRadio(i18n("Send directly")); | 1357 | sendGroup->addRadio(i18n("Send directly")); |
1352 | 1358 | ||
1353 | topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); | 1359 | topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); |
1354 | 1360 | ||
1355 | topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); | 1361 | topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); |
1356 | mAMails = new QListView(topFrame); | 1362 | mAMails = new Q3ListView(topFrame); |
1357 | mAMails->addColumn(i18n("Email"),300); | 1363 | mAMails->addColumn(i18n("Email"),300); |
1358 | topLayout->addMultiCellWidget(mAMails,3,3,0,1); | 1364 | topLayout->addMultiCellWidget(mAMails,3,3,0,1); |
1359 | 1365 | ||
1360 | topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); | 1366 | topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); |
1361 | aEmailsEdit = new QLineEdit(topFrame); | 1367 | aEmailsEdit = new QLineEdit(topFrame); |
1362 | aEmailsEdit->setEnabled(false); | 1368 | aEmailsEdit->setEnabled(false); |
@@ -1368,23 +1374,23 @@ void KOPrefsDialog::setupGroupSchedulingTab() | |||
1368 | topLayout->addWidget(del,5,1); | 1374 | topLayout->addWidget(del,5,1); |
1369 | 1375 | ||
1370 | //topLayout->setRowStretch(2,1); | 1376 | //topLayout->setRowStretch(2,1); |
1371 | connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); | 1377 | connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); |
1372 | connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); | 1378 | connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); |
1373 | connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); | 1379 | connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); |
1374 | connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); | 1380 | connect(mAMails,SIGNAL(selectionChanged(Q3ListViewItem *)),SLOT(updateInput())); |
1375 | #endif | 1381 | #endif |
1376 | } | 1382 | } |
1377 | 1383 | ||
1378 | void KOPrefsDialog::setupGroupAutomationTab() | 1384 | void KOPrefsDialog::setupGroupAutomationTab() |
1379 | { | 1385 | { |
1380 | return; | 1386 | return; |
1381 | QFrame *topFrame = addPage(i18n("Group Automation"),0, | 1387 | Q3Frame *topFrame = addPage(i18n("Group Automation"),0, |
1382 | DesktopIcon("personal",KIcon::SizeMedium)); | 1388 | DesktopIcon("personal",KIcon::SizeMedium)); |
1383 | 1389 | ||
1384 | QGridLayout *topLayout = new QGridLayout(topFrame,5,1); | 1390 | Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,1); |
1385 | topLayout->setSpacing(mSpacingHint); | 1391 | topLayout->setSpacing(mSpacingHint); |
1386 | topLayout->setMargin(mMarginHint); | 1392 | topLayout->setMargin(mMarginHint); |
1387 | 1393 | ||
1388 | KPrefsDialogWidRadios *autoRefreshGroup = | 1394 | KPrefsDialogWidRadios *autoRefreshGroup = |
1389 | addWidRadios(i18n("Auto Send Refresh"), | 1395 | addWidRadios(i18n("Auto Send Refresh"), |
1390 | &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); | 1396 | &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); |
@@ -1512,13 +1518,13 @@ void KOPrefsDialog::usrWriteConfig() | |||
1512 | while ( iii < cat.count() ) { | 1518 | while ( iii < cat.count() ) { |
1513 | if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor ) | 1519 | if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor ) |
1514 | KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor ); | 1520 | KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor ); |
1515 | ++iii; | 1521 | ++iii; |
1516 | } | 1522 | } |
1517 | } | 1523 | } |
1518 | QDictIterator<QColor> it(mCategoryDict); | 1524 | Q3DictIterator<QColor> it(mCategoryDict); |
1519 | while (it.current()) { | 1525 | while (it.current()) { |
1520 | KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); | 1526 | KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); |
1521 | ++it; | 1527 | ++it; |
1522 | } | 1528 | } |
1523 | 1529 | ||
1524 | KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); | 1530 | KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); |
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h index ee7a7aa..ccc1726 100644 --- a/korganizer/koprefsdialog.h +++ b/korganizer/koprefsdialog.h | |||
@@ -20,16 +20,18 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _KOPREFSDIALOG_H | 23 | #ifndef _KOPREFSDIALOG_H |
24 | #define _KOPREFSDIALOG_H | 24 | #define _KOPREFSDIALOG_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <q3frame.h> |
27 | #include <qdict.h> | 27 | #include <q3dict.h> |
28 | #include <qcolor.h> | 28 | #include <qcolor.h> |
29 | #include <qlistview.h> | 29 | #include <q3listview.h> |
30 | //Added by qt3to4: | ||
31 | #include <QLabel> | ||
30 | 32 | ||
31 | #include <kdialogbase.h> | 33 | #include <kdialogbase.h> |
32 | 34 | ||
33 | #include <libkdepim/kprefsdialog.h> | 35 | #include <libkdepim/kprefsdialog.h> |
34 | #include <libkdepim/kdateedit.h> | 36 | #include <libkdepim/kdateedit.h> |
35 | #include <kcmconfigs/kdepimconfigwidget.h> | 37 | #include <kcmconfigs/kdepimconfigwidget.h> |
@@ -91,13 +93,13 @@ class KOPrefsDialog : public KPrefsDialog | |||
91 | 93 | ||
92 | private: | 94 | private: |
93 | QColor mCatDefaultColor; | 95 | QColor mCatDefaultColor; |
94 | KPrefsDialogWidBool *mEnableGroupScheduling; | 96 | KPrefsDialogWidBool *mEnableGroupScheduling; |
95 | KPrefsDialogWidBool *mEnableProjectView; | 97 | KPrefsDialogWidBool *mEnableProjectView; |
96 | 98 | ||
97 | QFrame *mPrinterTab; | 99 | Q3Frame *mPrinterTab; |
98 | 100 | ||
99 | QLineEdit *nameEdit; | 101 | QLineEdit *nameEdit; |
100 | QLineEdit *emailEdit; | 102 | QLineEdit *emailEdit; |
101 | 103 | ||
102 | QComboBox *timeCombo; | 104 | QComboBox *timeCombo; |
103 | QComboBox *tzCombo; | 105 | QComboBox *tzCombo; |
@@ -118,13 +120,13 @@ class KOPrefsDialog : public KPrefsDialog | |||
118 | QSpinBox *mStartTimeSpin; | 120 | QSpinBox *mStartTimeSpin; |
119 | QSpinBox *mDefaultDurationSpin; | 121 | QSpinBox *mDefaultDurationSpin; |
120 | QComboBox *mAlarmTimeCombo; | 122 | QComboBox *mAlarmTimeCombo; |
121 | 123 | ||
122 | QComboBox *mCategoryCombo; | 124 | QComboBox *mCategoryCombo; |
123 | KColorButton *mCategoryButton; | 125 | KColorButton *mCategoryButton; |
124 | QDict<QColor> mCategoryDict; | 126 | Q3Dict<QColor> mCategoryDict; |
125 | 127 | ||
126 | QSlider *mHourSizeSlider; | 128 | QSlider *mHourSizeSlider; |
127 | 129 | ||
128 | QSpinBox *mNextXDaysSpin; | 130 | QSpinBox *mNextXDaysSpin; |
129 | QSpinBox *mWhatsNextSpin; | 131 | QSpinBox *mWhatsNextSpin; |
130 | 132 | ||
diff --git a/korganizer/korganizer.pro b/korganizer/korganizer.pro index df8f8d7..0f3b328 100644 --- a/korganizer/korganizer.pro +++ b/korganizer/korganizer.pro | |||
@@ -1,8 +1,8 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on | 2 | CONFIG += qt warn_on |
3 | TARGET = kopi | 3 | TARGET = kopi |
4 | OBJECTS_DIR = _obj/ | 4 | OBJECTS_DIR = _obj/ |
5 | MOC_DIR = _moc | 5 | MOC_DIR = _moc |
6 | DESTDIR= ../bin | 6 | DESTDIR= ../bin |
7 | 7 | ||
8 | include( ../variables.pri ) | 8 | include( ../variables.pri ) |
@@ -14,48 +14,48 @@ DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER | |||
14 | #KORG_NOPRINTER KORG_NOKABC KORG_NODND | 14 | #KORG_NOPRINTER KORG_NOKABC KORG_NODND |
15 | DEFINES += KORG_NOLVALTERNATION | 15 | DEFINES += KORG_NOLVALTERNATION |
16 | DEFINES += DESKTOP_VERSION | 16 | DEFINES += DESKTOP_VERSION |
17 | unix : { | 17 | unix : { |
18 | staticlib: { | 18 | staticlib: { |
19 | TARGET = kopi_linux | 19 | TARGET = kopi_linux |
20 | LIBS += ../bin/libmicrokabc_qtopia.a | 20 | LIBS += ../bin/libxmicrokabc_qtopia.a |
21 | LIBS += ../bin/libmicrokabc_file.a | 21 | LIBS += ../bin/libxmicrokabc_file.a |
22 | LIBS += ../bin/libmicrokabc_dir.a | 22 | LIBS += ../bin/libxmicrokabc_dir.a |
23 | LIBS += ../bin/libmicrokdepim.a | 23 | LIBS += ../bin/libxmicrokdepim.a |
24 | LIBS += ../bin/libmicrokcal.a | 24 | LIBS += ../bin/libxmicrokcal.a |
25 | LIBS += ../bin/libmicrokabc.a | 25 | LIBS += ../bin/libxmicrokabc.a |
26 | LIBS += ../bin/libmicrokde.a | 26 | LIBS += ../bin/libxmicrokde.a |
27 | LIBS += ../bin/libmicrokabc_qtopia.a | 27 | LIBS += ../bin/libxmicrokabc_qtopia.a |
28 | LIBS += ../bin/libmicrokabc_file.a | 28 | LIBS += ../bin/libxmicrokabc_file.a |
29 | LIBS += ../bin/libmicrokabc_dir.a | 29 | LIBS += ../bin/libxmicrokabc_dir.a |
30 | LIBS += ../bin/libmicrokdepim.a | 30 | LIBS += ../bin/libxmicrokdepim.a |
31 | LIBS += ../bin/libmicrokcal.a | 31 | LIBS += ../bin/libxmicrokcal.a |
32 | LIBS += ../bin/libmicrokabc.a | 32 | LIBS += ../bin/libxmicrokabc.a |
33 | LIBS += ../bin/libmicrokde.a | 33 | LIBS += ../bin/libxmicrokde.a |
34 | LIBS += ../libical/lib/libical.a | 34 | LIBS += ../libical/lib/libical.a |
35 | LIBS += ../libical/lib/libicalss.a | 35 | LIBS += ../libical/lib/libicalss.a |
36 | } else { | 36 | } else { |
37 | LIBS += ../bin/libmicrokdepim.so | 37 | LIBS += ../bin/libxmicrokdepim.so |
38 | LIBS += ../bin/libmicrokcal.so | 38 | LIBS += ../bin/libxmicrokcal.so |
39 | LIBS += ../bin/libmicrokde.so | 39 | LIBS += ../bin/libxmicrokde.so |
40 | LIBS += ../bin/libmicrokabc.so | 40 | LIBS += ../bin/libxmicrokabc.so |
41 | #LIBS += -lbluetooth | 41 | #LIBS += -lbluetooth |
42 | #LIBS += -lsdp | 42 | #LIBS += -lsdp |
43 | 43 | ||
44 | #LIBS += -lldap | 44 | #LIBS += -lldap |
45 | } | 45 | } |
46 | OBJECTS_DIR = obj/unix | 46 | OBJECTS_DIR = obj/unix |
47 | MOC_DIR = moc/unix | 47 | MOC_DIR = moc/unix |
48 | } | 48 | } |
49 | win32: { | 49 | win32: { |
50 | RC_FILE = winicons.rc | 50 | RC_FILE = winicons.rc |
51 | DEFINES += _WIN32_ | 51 | DEFINES += _WIN32_ |
52 | LIBS += ../bin/microkdepim.lib | 52 | LIBS += ../bin/xmicrokdepim.lib |
53 | LIBS += ../bin/microkcal.lib | 53 | LIBS += ../bin/xmicrokcal.lib |
54 | LIBS += ../bin/microkde.lib | 54 | LIBS += ../bin/xmicrokde.lib |
55 | LIBS += ../bin/microkabc.lib | 55 | LIBS += ../bin/xmicrokabc.lib |
56 | LIBS += ../libical/lib/ical.lib | 56 | LIBS += ../libical/lib/ical.lib |
57 | LIBS += ../libical/lib/icalss.lib | 57 | LIBS += ../libical/lib/icalss.lib |
58 | #LIBS += atls.lib | 58 | #LIBS += atls.lib |
59 | QMAKE_LINK += /NODEFAULTLIB:LIBC | 59 | QMAKE_LINK += /NODEFAULTLIB:LIBC |
60 | OBJECTS_DIR = obj/win | 60 | OBJECTS_DIR = obj/win |
61 | MOC_DIR = moc/win | 61 | MOC_DIR = moc/win |
@@ -82,13 +82,14 @@ TARGET = kopi_xp | |||
82 | TARGET = kopi_me | 82 | TARGET = kopi_me |
83 | } | 83 | } |
84 | 84 | ||
85 | } | 85 | } |
86 | 86 | ||
87 | 87 | ||
88 | INTERFACES = kofilterview_base.ui | 88 | #The following line was changed from INTERFACES to FORMS3 by qt3to4 |
89 | FORMS3 = kofilterview_base.ui | ||
89 | #filteredit_base.ui | 90 | #filteredit_base.ui |
90 | 91 | ||
91 | # kdateedit.h \ | 92 | # kdateedit.h \ |
92 | 93 | ||
93 | HEADERS += datenavigatorcontainer.h \ | 94 | HEADERS += datenavigatorcontainer.h \ |
94 | filteredit_base.h \ | 95 | filteredit_base.h \ |
@@ -207,12 +208,18 @@ filteredit_base.cpp \ | |||
207 | statusdialog.cpp \ | 208 | statusdialog.cpp \ |
208 | timeline.cpp \ | 209 | timeline.cpp \ |
209 | timespanview.cpp \ | 210 | timespanview.cpp \ |
210 | ../kalarmd/alarmdialog.cpp | 211 | ../kalarmd/alarmdialog.cpp |
211 | 212 | ||
212 | HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h | 213 | HEADERS += calprintbase.h calprinter.h calprintplugins.h cellitem.h |
213 | INTERFACES += calprintdayconfig_base.ui \ | 214 | #The following line was changed from INTERFACES to FORMS3 by qt3to4 |
215 | FORMS3 += calprintdayconfig_base.ui \ | ||
214 | calprintmonthconfig_base.ui \ | 216 | calprintmonthconfig_base.ui \ |
215 | calprinttodoconfig_base.ui \ | 217 | calprinttodoconfig_base.ui \ |
216 | calprintweekconfig_base.ui | 218 | calprintweekconfig_base.ui |
217 | SOURCES += calprintbase.cpp calprinter.cpp calprintplugins.cpp cellitem.cpp | 219 | SOURCES += calprintbase.cpp calprinter.cpp calprintplugins.cpp cellitem.cpp |
218 | 220 | ||
221 | #The following line was inserted by qt3to4 | ||
222 | QT += xml qt3support | ||
223 | #The following line was inserted by qt3to4 | ||
224 | CONFIG += uic3 | ||
225 | |||
diff --git a/korganizer/korganizerE.pro b/korganizer/korganizerE.pro index 553c265..2c1cd42 100644 --- a/korganizer/korganizerE.pro +++ b/korganizer/korganizerE.pro | |||
@@ -8,15 +8,15 @@ DESTDIR=$(QPEDIR)/bin | |||
8 | INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/libkdepim interfaces $(KDEPIMDIR)/kabc $(QPEDIR)/include | 8 | INCLUDEPATH += $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kio/kfile $(KDEPIMDIR)/microkde/kio/kio $(KDEPIMDIR)/microkde/kdeui $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/libkdepim interfaces $(KDEPIMDIR)/kabc $(QPEDIR)/include |
9 | 9 | ||
10 | DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL | 10 | DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL |
11 | DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER | 11 | DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER |
12 | DEFINES += KORG_NOLVALTERNATION | 12 | DEFINES += KORG_NOLVALTERNATION |
13 | #KORG_NOKABC | 13 | #KORG_NOKABC |
14 | LIBS += -lmicrokdepim | 14 | LIBS += -lxmicrokdepim |
15 | LIBS += -lmicrokcal | 15 | LIBS += -lxmicrokcal |
16 | LIBS += -lmicrokde | 16 | LIBS += -lxmicrokde |
17 | LIBS += -lmicroqtcompat | 17 | LIBS += -lmicroqtcompat |
18 | 18 | ||
19 | LIBS += $(GCC3EXTRALIB1) | 19 | LIBS += $(GCC3EXTRALIB1) |
20 | LIBS += $(GCC3EXTRALIB2) | 20 | LIBS += $(GCC3EXTRALIB2) |
21 | 21 | ||
22 | 22 | ||
diff --git a/korganizer/kotimespanview.cpp b/korganizer/kotimespanview.cpp index 3265a3a..a214720 100644 --- a/korganizer/kotimespanview.cpp +++ b/korganizer/kotimespanview.cpp | |||
@@ -1,20 +1,24 @@ | |||
1 | #include <qlayout.h> | 1 | #include <qlayout.h> |
2 | //Added by qt3to4: | ||
3 | #include <Q3VBoxLayout> | ||
4 | #include <Q3ValueList> | ||
5 | #include <Q3PtrList> | ||
2 | 6 | ||
3 | #include <kconfig.h> | 7 | #include <kconfig.h> |
4 | 8 | ||
5 | #include "timespanview.h" | 9 | #include "timespanview.h" |
6 | #include "koglobals.h" | 10 | #include "koglobals.h" |
7 | 11 | ||
8 | #include "kotimespanview.h" | 12 | #include "kotimespanview.h" |
9 | 13 | ||
10 | KOTimeSpanView::KOTimeSpanView(Calendar *calendar, QWidget *parent, | 14 | KOTimeSpanView::KOTimeSpanView(Calendar *calendar, QWidget *parent, |
11 | const char *name) : | 15 | const char *name) : |
12 | KOEventView( calendar, parent, name ) | 16 | KOEventView( calendar, parent, name ) |
13 | { | 17 | { |
14 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 18 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
15 | 19 | ||
16 | mTimeSpanView = new TimeSpanView( this ); | 20 | mTimeSpanView = new TimeSpanView( this ); |
17 | topLayout->addWidget( mTimeSpanView ); | 21 | topLayout->addWidget( mTimeSpanView ); |
18 | 22 | ||
19 | connect( mTimeSpanView, SIGNAL( dateRangeChanged() ), SLOT( updateView() ) ); | 23 | connect( mTimeSpanView, SIGNAL( dateRangeChanged() ), SLOT( updateView() ) ); |
20 | } | 24 | } |
@@ -31,25 +35,25 @@ void KOTimeSpanView::readSettings() | |||
31 | void KOTimeSpanView::readSettings(KConfig *config) | 35 | void KOTimeSpanView::readSettings(KConfig *config) |
32 | { | 36 | { |
33 | // kdDebug() << "KOTimeSpanView::readSettings()" << endl; | 37 | // kdDebug() << "KOTimeSpanView::readSettings()" << endl; |
34 | 38 | ||
35 | config->setGroup("Views"); | 39 | config->setGroup("Views"); |
36 | 40 | ||
37 | QValueList<int> sizes = config->readIntListEntry("Separator TimeSpanView"); | 41 | Q3ValueList<int> sizes = config->readIntListEntry("Separator TimeSpanView"); |
38 | if (sizes.count() == 2) { | 42 | if (sizes.count() == 2) { |
39 | mTimeSpanView->setSplitterSizes(sizes); | 43 | mTimeSpanView->setSplitterSizes(sizes); |
40 | } | 44 | } |
41 | } | 45 | } |
42 | 46 | ||
43 | void KOTimeSpanView::writeSettings(KConfig *config) | 47 | void KOTimeSpanView::writeSettings(KConfig *config) |
44 | { | 48 | { |
45 | // kdDebug() << "KOTimeSpanView::writeSettings()" << endl; | 49 | // kdDebug() << "KOTimeSpanView::writeSettings()" << endl; |
46 | 50 | ||
47 | config->setGroup("Views"); | 51 | config->setGroup("Views"); |
48 | 52 | ||
49 | QValueList<int> list = mTimeSpanView->splitterSizes(); | 53 | Q3ValueList<int> list = mTimeSpanView->splitterSizes(); |
50 | config->writeEntry("Separator TimeSpanView",list); | 54 | config->writeEntry("Separator TimeSpanView",list); |
51 | } | 55 | } |
52 | 56 | ||
53 | int KOTimeSpanView::maxDatesHint() | 57 | int KOTimeSpanView::maxDatesHint() |
54 | { | 58 | { |
55 | return 0; | 59 | return 0; |
@@ -57,15 +61,15 @@ int KOTimeSpanView::maxDatesHint() | |||
57 | 61 | ||
58 | int KOTimeSpanView::currentDateCount() | 62 | int KOTimeSpanView::currentDateCount() |
59 | { | 63 | { |
60 | return 0; | 64 | return 0; |
61 | } | 65 | } |
62 | 66 | ||
63 | QPtrList<Incidence> KOTimeSpanView::selectedIncidences() | 67 | Q3PtrList<Incidence> KOTimeSpanView::selectedIncidences() |
64 | { | 68 | { |
65 | QPtrList<Incidence> selected; | 69 | Q3PtrList<Incidence> selected; |
66 | 70 | ||
67 | return selected; | 71 | return selected; |
68 | } | 72 | } |
69 | 73 | ||
70 | void KOTimeSpanView::updateView() | 74 | void KOTimeSpanView::updateView() |
71 | { | 75 | { |
@@ -81,15 +85,15 @@ void KOTimeSpanView::showDates(const QDate &start, const QDate &end) | |||
81 | insertItems( s, e ); | 85 | insertItems( s, e ); |
82 | } | 86 | } |
83 | 87 | ||
84 | void KOTimeSpanView::insertItems(const QDate &start, const QDate &end) | 88 | void KOTimeSpanView::insertItems(const QDate &start, const QDate &end) |
85 | { | 89 | { |
86 | mTimeSpanView->clear(); | 90 | mTimeSpanView->clear(); |
87 | mTimeSpanView->setDateRange( start, end ); | 91 | mTimeSpanView->setDateRange( (QDateTime)start, (QDateTime)end ); |
88 | 92 | ||
89 | QPtrList<Event> events = calendar()->events( start, end ); | 93 | Q3PtrList<Event> events = calendar()->events( start, end ); |
90 | Event *event = events.first(); | 94 | Event *event = events.first(); |
91 | while( event ) { | 95 | while( event ) { |
92 | // kdDebug() << "KOTimeSpanView::showDates() add event: " << event->summary() | 96 | // kdDebug() << "KOTimeSpanView::showDates() add event: " << event->summary() |
93 | // << endl; | 97 | // << endl; |
94 | 98 | ||
95 | mTimeSpanView->addItem( event ); | 99 | mTimeSpanView->addItem( event ); |
@@ -97,13 +101,13 @@ void KOTimeSpanView::insertItems(const QDate &start, const QDate &end) | |||
97 | event = events.next(); | 101 | event = events.next(); |
98 | } | 102 | } |
99 | 103 | ||
100 | mTimeSpanView->updateView(); | 104 | mTimeSpanView->updateView(); |
101 | } | 105 | } |
102 | 106 | ||
103 | void KOTimeSpanView::showEvents(QPtrList<Event> eventList) | 107 | void KOTimeSpanView::showEvents(Q3PtrList<Event> eventList) |
104 | { | 108 | { |
105 | } | 109 | } |
106 | 110 | ||
107 | void KOTimeSpanView::changeEventDisplay(Event *, int) | 111 | void KOTimeSpanView::changeEventDisplay(Event *, int) |
108 | { | 112 | { |
109 | } | 113 | } |
diff --git a/korganizer/kotimespanview.h b/korganizer/kotimespanview.h index c682ed8..c3e4b41 100644 --- a/korganizer/kotimespanview.h +++ b/korganizer/kotimespanview.h | |||
@@ -1,10 +1,12 @@ | |||
1 | #ifndef KOTIMESPANVIEW_H | 1 | #ifndef KOTIMESPANVIEW_H |
2 | #define KOTIMESPANVIEW_H | 2 | #define KOTIMESPANVIEW_H |
3 | 3 | ||
4 | #include "koeventview.h" | 4 | #include "koeventview.h" |
5 | //Added by qt3to4: | ||
6 | #include <Q3PtrList> | ||
5 | 7 | ||
6 | class KConfig; | 8 | class KConfig; |
7 | class TimeSpanView; | 9 | class TimeSpanView; |
8 | 10 | ||
9 | class KOTimeSpanView : public KOEventView | 11 | class KOTimeSpanView : public KOEventView |
10 | { | 12 | { |
@@ -13,25 +15,25 @@ class KOTimeSpanView : public KOEventView | |||
13 | KOTimeSpanView(Calendar *calendar, QWidget *parent = 0, | 15 | KOTimeSpanView(Calendar *calendar, QWidget *parent = 0, |
14 | const char *name = 0); | 16 | const char *name = 0); |
15 | ~KOTimeSpanView(); | 17 | ~KOTimeSpanView(); |
16 | 18 | ||
17 | virtual int maxDatesHint(); | 19 | virtual int maxDatesHint(); |
18 | virtual int currentDateCount(); | 20 | virtual int currentDateCount(); |
19 | virtual QPtrList<Incidence> selectedIncidences(); | 21 | virtual Q3PtrList<Incidence> selectedIncidences(); |
20 | DateList selectedDates() | 22 | DateList selectedDates() |
21 | {DateList q; | 23 | {DateList q; |
22 | return q;} | 24 | return q;} |
23 | 25 | ||
24 | void readSettings(); | 26 | void readSettings(); |
25 | void readSettings( KConfig * ); | 27 | void readSettings( KConfig * ); |
26 | void writeSettings( KConfig * ); | 28 | void writeSettings( KConfig * ); |
27 | 29 | ||
28 | public slots: | 30 | public slots: |
29 | virtual void updateView(); | 31 | virtual void updateView(); |
30 | virtual void showDates(const QDate &start, const QDate &end); | 32 | virtual void showDates(const QDate &start, const QDate &end); |
31 | virtual void showEvents(QPtrList<Event> eventList); | 33 | virtual void showEvents(Q3PtrList<Event> eventList); |
32 | 34 | ||
33 | void changeEventDisplay(Event *, int); | 35 | void changeEventDisplay(Event *, int); |
34 | 36 | ||
35 | private: | 37 | private: |
36 | void insertItems( const QDate &start, const QDate & end ); | 38 | void insertItems( const QDate &start, const QDate & end ); |
37 | 39 | ||
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 20a35d2..aeab92a 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp | |||
@@ -20,21 +20,26 @@ | |||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qtooltip.h> | 25 | #include <qtooltip.h> |
26 | #include <qframe.h> | 26 | #include <q3frame.h> |
27 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qhbox.h> | 29 | #include <q3hbox.h> |
30 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | #include <qdatetime.h> | 32 | #include <qdatetime.h> |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <QDesktopWidget> | ||
34 | #include <qtabwidget.h> | 35 | #include <qtabwidget.h> |
36 | //Added by qt3to4: | ||
37 | #include <Q3HBoxLayout> | ||
38 | #include <Q3PtrList> | ||
39 | #include <Q3VBoxLayout> | ||
35 | 40 | ||
36 | #include <kiconloader.h> | 41 | #include <kiconloader.h> |
37 | #include <klocale.h> | 42 | #include <klocale.h> |
38 | #include <kfiledialog.h> | 43 | #include <kfiledialog.h> |
39 | #include <kstandarddirs.h> | 44 | #include <kstandarddirs.h> |
40 | #include <kmessagebox.h> | 45 | #include <kmessagebox.h> |
@@ -78,14 +83,14 @@ void KOTodoEditor::init() | |||
78 | mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") ); | 83 | mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") ); |
79 | connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), | 84 | connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), |
80 | mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime))); | 85 | mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime))); |
81 | } | 86 | } |
82 | void KOTodoEditor::setupRecurrence() | 87 | void KOTodoEditor::setupRecurrence() |
83 | { | 88 | { |
84 | QFrame *topFrame = addPage( i18n("Recurrence") ); | 89 | Q3Frame *topFrame = addPage( i18n("Recurrence") ); |
85 | QBoxLayout *topLayout = new QVBoxLayout( topFrame ); | 90 | Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame ); |
86 | 91 | ||
87 | mRecurrence = new KOEditorRecurrence( topFrame ); | 92 | mRecurrence = new KOEditorRecurrence( topFrame ); |
88 | topLayout->addWidget( mRecurrence ); | 93 | topLayout->addWidget( mRecurrence ); |
89 | } | 94 | } |
90 | 95 | ||
91 | void KOTodoEditor::setCategories( QString s ) | 96 | void KOTodoEditor::setCategories( QString s ) |
@@ -108,15 +113,15 @@ void KOTodoEditor::setupGeneral() | |||
108 | 113 | ||
109 | // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); | 114 | // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); |
110 | //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), | 115 | //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), |
111 | // mGeneral,SLOT(setCategories(const QString &))); | 116 | // mGeneral,SLOT(setCategories(const QString &))); |
112 | 117 | ||
113 | if (KOPrefs::instance()->mCompactDialogs) { | 118 | if (KOPrefs::instance()->mCompactDialogs) { |
114 | QFrame *topFrame = addPage(i18n("General")); | 119 | Q3Frame *topFrame = addPage(i18n("General")); |
115 | 120 | ||
116 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 121 | Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); |
117 | if ( QApplication::desktop()->width() < 480 ) { | 122 | if ( QApplication::desktop()->width() < 480 ) { |
118 | topLayout->setMargin(marginHintSmall()); | 123 | topLayout->setMargin(marginHintSmall()); |
119 | topLayout->setSpacing(spacingHintSmall()); | 124 | topLayout->setSpacing(spacingHintSmall()); |
120 | } else { | 125 | } else { |
121 | topLayout->setMargin(marginHint()); | 126 | topLayout->setMargin(marginHint()); |
122 | topLayout->setSpacing(spacingHint()); | 127 | topLayout->setSpacing(spacingHint()); |
@@ -128,23 +133,23 @@ void KOTodoEditor::setupGeneral() | |||
128 | topLayout->addStretch( 1 ); | 133 | topLayout->addStretch( 1 ); |
129 | mGeneral->initAlarm(topFrame,topLayout); | 134 | mGeneral->initAlarm(topFrame,topLayout); |
130 | topLayout->addStretch( 1 ); | 135 | topLayout->addStretch( 1 ); |
131 | mGeneral->enableAlarm( false ); | 136 | mGeneral->enableAlarm( false ); |
132 | 137 | ||
133 | 138 | ||
134 | QBoxLayout *priorityLayout; | 139 | Q3BoxLayout *priorityLayout; |
135 | if ( QApplication::desktop()->width() < 500 ) | 140 | if ( QApplication::desktop()->width() < 500 ) |
136 | priorityLayout = new QVBoxLayout( topLayout ); | 141 | priorityLayout = new Q3VBoxLayout( topLayout ); |
137 | else | 142 | else |
138 | priorityLayout = new QHBoxLayout( topLayout ); | 143 | priorityLayout = new Q3HBoxLayout( topLayout ); |
139 | QWidget* prioWidget = new QWidget (topFrame); | 144 | QWidget* prioWidget = new QWidget (topFrame); |
140 | priorityLayout->addWidget( prioWidget ); | 145 | priorityLayout->addWidget( prioWidget ); |
141 | QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); | 146 | Q3HBoxLayout* priorityLayout2 = new Q3HBoxLayout( prioWidget); |
142 | 147 | ||
143 | 148 | ||
144 | QIconSet icon; | 149 | QIcon icon; |
145 | if ( QApplication::desktop()->width() < 321 ) | 150 | if ( QApplication::desktop()->width() < 321 ) |
146 | icon = SmallIcon("fileimport16"); | 151 | icon = SmallIcon("fileimport16"); |
147 | else | 152 | else |
148 | icon = SmallIcon("fileimport"); | 153 | icon = SmallIcon("fileimport"); |
149 | QPushButton * loadTemplate = new QPushButton( prioWidget); | 154 | QPushButton * loadTemplate = new QPushButton( prioWidget); |
150 | loadTemplate->setIconSet (icon ) ; | 155 | loadTemplate->setIconSet (icon ) ; |
@@ -161,19 +166,19 @@ void KOTodoEditor::setupGeneral() | |||
161 | priorityLayout2->addWidget(loadTemplate); | 166 | priorityLayout2->addWidget(loadTemplate); |
162 | priorityLayout2->addWidget(saveTemplate); | 167 | priorityLayout2->addWidget(saveTemplate); |
163 | mGeneral->initPriority(prioWidget,priorityLayout2); | 168 | mGeneral->initPriority(prioWidget,priorityLayout2); |
164 | mGeneral->initCategories( topFrame, priorityLayout ); | 169 | mGeneral->initCategories( topFrame, priorityLayout ); |
165 | topLayout->addStretch(1); | 170 | topLayout->addStretch(1); |
166 | 171 | ||
167 | QFrame *topFrame2 = addPage(i18n("Details")); | 172 | Q3Frame *topFrame2 = addPage(i18n("Details")); |
168 | 173 | ||
169 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); | 174 | Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2); |
170 | topLayout2->setMargin(marginHint()); | 175 | topLayout2->setMargin(marginHint()); |
171 | topLayout2->setSpacing(spacingHint()); | 176 | topLayout2->setSpacing(spacingHint()); |
172 | 177 | ||
173 | QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); | 178 | Q3HBoxLayout *completionLayout = new Q3HBoxLayout( topLayout2 ); |
174 | mGeneral->initCompletion(topFrame2,completionLayout); | 179 | mGeneral->initCompletion(topFrame2,completionLayout); |
175 | 180 | ||
176 | 181 | ||
177 | mGeneral->initSecrecy( topFrame2, topLayout2 ); | 182 | mGeneral->initSecrecy( topFrame2, topLayout2 ); |
178 | mGeneral->initDescription(topFrame2,topLayout2); | 183 | mGeneral->initDescription(topFrame2,topLayout2); |
179 | 184 | ||
@@ -182,24 +187,24 @@ void KOTodoEditor::setupGeneral() | |||
182 | // hb->setSpacing( 3 ); | 187 | // hb->setSpacing( 3 ); |
183 | 188 | ||
184 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 189 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
185 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 190 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
186 | 191 | ||
187 | } else { | 192 | } else { |
188 | QFrame *topFrame = addPage(i18n("General")); | 193 | Q3Frame *topFrame = addPage(i18n("General")); |
189 | 194 | ||
190 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 195 | Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); |
191 | topLayout->setSpacing(spacingHint()); | 196 | topLayout->setSpacing(spacingHint()); |
192 | 197 | ||
193 | mGeneral->initHeader(topFrame,topLayout); | 198 | mGeneral->initHeader(topFrame,topLayout); |
194 | mGeneral->initTime(topFrame,topLayout); | 199 | mGeneral->initTime(topFrame,topLayout); |
195 | mGeneral->initStatus(topFrame,topLayout); | 200 | mGeneral->initStatus(topFrame,topLayout); |
196 | QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); | 201 | Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout); |
197 | mGeneral->initAlarm(topFrame,alarmLineLayout); | 202 | mGeneral->initAlarm(topFrame,alarmLineLayout); |
198 | mGeneral->initDescription(topFrame,topLayout); | 203 | mGeneral->initDescription(topFrame,topLayout); |
199 | QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); | 204 | Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout); |
200 | mGeneral->initCategories( topFrame, detailsLayout ); | 205 | mGeneral->initCategories( topFrame, detailsLayout ); |
201 | mGeneral->initSecrecy( topFrame, detailsLayout ); | 206 | mGeneral->initSecrecy( topFrame, detailsLayout ); |
202 | } | 207 | } |
203 | mGeneral->finishSetup(); | 208 | mGeneral->finishSetup(); |
204 | 209 | ||
205 | } | 210 | } |
@@ -424,13 +429,13 @@ void KOTodoEditor::slotLoadTemplate() | |||
424 | ICalFormat format; | 429 | ICalFormat format; |
425 | if ( !format.load( &cal, fileName ) ) { | 430 | if ( !format.load( &cal, fileName ) ) { |
426 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 431 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
427 | .arg( fileName ) ); | 432 | .arg( fileName ) ); |
428 | return ; | 433 | return ; |
429 | } | 434 | } |
430 | QPtrList<Todo> todos = cal.todos(); | 435 | Q3PtrList<Todo> todos = cal.todos(); |
431 | Todo * todo = todos.first(); | 436 | Todo * todo = todos.first(); |
432 | if ( !todo ) { | 437 | if ( !todo ) { |
433 | KMessageBox::error( this, | 438 | KMessageBox::error( this, |
434 | i18n("Template does not\ncontain a valid Todo.")); | 439 | i18n("Template does not\ncontain a valid Todo.")); |
435 | } else { | 440 | } else { |
436 | readTodo( todo ); | 441 | readTodo( todo ); |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index ba94057..2b8fbd3 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -18,23 +18,39 @@ | |||
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <QDesktopWidget> | ||
25 | |||
24 | #include <qlayout.h> | 26 | #include <qlayout.h> |
25 | #include <qheader.h> | 27 | #include <q3header.h> |
26 | #include <qcursor.h> | 28 | #include <qcursor.h> |
27 | #include <qwhatsthis.h> | 29 | #include <q3whatsthis.h> |
28 | #include <qdialog.h> | 30 | #include <qdialog.h> |
29 | #include <qlabel.h> | 31 | #include <qlabel.h> |
30 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
31 | 33 | ||
32 | #include <qinputdialog.h> | 34 | #include <qinputdialog.h> |
33 | 35 | ||
34 | #include <qvbox.h> | 36 | #include <q3vbox.h> |
37 | //Added by qt3to4: | ||
38 | #include <QWheelEvent> | ||
39 | #include <QFocusEvent> | ||
40 | #include <QDragLeaveEvent> | ||
41 | #include <QMouseEvent> | ||
42 | #include <QDragEnterEvent> | ||
43 | #include <QKeyEvent> | ||
44 | #include <Q3HBoxLayout> | ||
45 | #include <Q3VBoxLayout> | ||
46 | #include <QDropEvent> | ||
47 | #include <QDragMoveEvent> | ||
48 | #include <QPaintEvent> | ||
49 | #include <Q3PopupMenu> | ||
50 | #include <Q3PtrList> | ||
35 | #include <kdebug.h> | 51 | #include <kdebug.h> |
36 | #include "koprefs.h" | 52 | #include "koprefs.h" |
37 | #include <klocale.h> | 53 | #include <klocale.h> |
38 | #include <kglobal.h> | 54 | #include <kglobal.h> |
39 | #include <kdateedit.h> | 55 | #include <kdateedit.h> |
40 | #include "ktimeedit.h" | 56 | #include "ktimeedit.h" |
@@ -65,18 +81,18 @@ using namespace KOrg; | |||
65 | 81 | ||
66 | KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *name ) : | 82 | KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *name ) : |
67 | QDialog( parent, name, true ) | 83 | QDialog( parent, name, true ) |
68 | { | 84 | { |
69 | mStopAll = true; | 85 | mStopAll = true; |
70 | setCaption( i18n("Start todo") ); | 86 | setCaption( i18n("Start todo") ); |
71 | QVBoxLayout* lay = new QVBoxLayout( this ); | 87 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
72 | lay->setSpacing( 3 ); | 88 | lay->setSpacing( 3 ); |
73 | lay->setMargin( 3 ); | 89 | lay->setMargin( 3 ); |
74 | QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( sum ), this ); | 90 | QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( sum ), this ); |
75 | lay->addWidget( lab ); | 91 | lay->addWidget( lab ); |
76 | lab->setAlignment( AlignCenter ); | 92 | lab->setAlignment( Qt::AlignCenter ); |
77 | 93 | ||
78 | QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this ); | 94 | QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this ); |
79 | lay->addWidget( ok ); | 95 | lay->addWidget( ok ); |
80 | ok->setDefault( true ); | 96 | ok->setDefault( true ); |
81 | QPushButton * start = new QPushButton( i18n("Start todo"), this ); | 97 | QPushButton * start = new QPushButton( i18n("Start todo"), this ); |
82 | lay->addWidget( start ); | 98 | lay->addWidget( start ); |
@@ -95,26 +111,26 @@ void KOStartTodoPrefs::doStop() | |||
95 | } | 111 | } |
96 | KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name ) : | 112 | KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name ) : |
97 | QDialog( parent, name, true ) | 113 | QDialog( parent, name, true ) |
98 | { | 114 | { |
99 | mTodo = todo; | 115 | mTodo = todo; |
100 | setCaption( i18n("Stop todo") ); | 116 | setCaption( i18n("Stop todo") ); |
101 | QVBoxLayout* lay = new QVBoxLayout( this ); | 117 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
102 | lay->setSpacing( 3 ); | 118 | lay->setSpacing( 3 ); |
103 | lay->setMargin( 3 ); | 119 | lay->setMargin( 3 ); |
104 | QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( todo->summary() ), this ); | 120 | QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( todo->summary() ), this ); |
105 | lay->addWidget( lab ); | 121 | lay->addWidget( lab ); |
106 | lab->setAlignment( AlignHCenter ); | 122 | lab->setAlignment( Qt::AlignHCenter ); |
107 | lab = new QLabel( i18n("Additional Comment:"), this ); | 123 | lab = new QLabel( i18n("Additional Comment:"), this ); |
108 | lay->addWidget( lab ); | 124 | lay->addWidget( lab ); |
109 | mComment = new QLineEdit( this ); | 125 | mComment = new QLineEdit( this ); |
110 | lay->addWidget( mComment ); | 126 | lay->addWidget( mComment ); |
111 | QHBox * start = new QHBox ( this ); | 127 | Q3HBox * start = new Q3HBox ( this ); |
112 | lay->addWidget( start ); | 128 | lay->addWidget( start ); |
113 | lab = new QLabel( i18n("Start:"), start ); | 129 | lab = new QLabel( i18n("Start:"), start ); |
114 | QHBox * end = new QHBox ( this ); | 130 | Q3HBox * end = new Q3HBox ( this ); |
115 | lay->addWidget( end ); | 131 | lay->addWidget( end ); |
116 | lab = new QLabel( i18n("End:"), end ); | 132 | lab = new QLabel( i18n("End:"), end ); |
117 | sde = new KDateEdit( start ); | 133 | sde = new KDateEdit( start ); |
118 | ste = new KOTimeEdit( start ); | 134 | ste = new KOTimeEdit( start ); |
119 | connect ( sde,SIGNAL(setTimeTo( QTime ) ),ste , SLOT ( setTime(QTime ) ) ); | 135 | connect ( sde,SIGNAL(setTimeTo( QTime ) ),ste , SLOT ( setTime(QTime ) ) ); |
120 | ede = new KDateEdit( end ); | 136 | ede = new KDateEdit( end ); |
@@ -170,16 +186,16 @@ void KOStopTodoPrefs::doNotSave() | |||
170 | if (result != KMessageBox::Continue) return; | 186 | if (result != KMessageBox::Continue) return; |
171 | mTodo->stopRunning(); | 187 | mTodo->stopRunning(); |
172 | QDialog::accept(); | 188 | QDialog::accept(); |
173 | } | 189 | } |
174 | 190 | ||
175 | 191 | ||
176 | class KOTodoViewWhatsThis :public QWhatsThis | 192 | class KOTodoViewWhatsThis :public Q3WhatsThis |
177 | { | 193 | { |
178 | public: | 194 | public: |
179 | KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 195 | KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : Q3WhatsThis( wid ), _wid(wid),_view (view) { }; |
180 | 196 | ||
181 | protected: | 197 | protected: |
182 | virtual QString text( const QPoint& p) | 198 | virtual QString text( const QPoint& p) |
183 | { | 199 | { |
184 | return _view->getWhatsThisText(p) ; | 200 | return _view->getWhatsThisText(p) ; |
185 | } | 201 | } |
@@ -211,13 +227,13 @@ KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, | |||
211 | 227 | ||
212 | void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) | 228 | void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) |
213 | { | 229 | { |
214 | #ifndef KORG_NODND | 230 | #ifndef KORG_NODND |
215 | // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; | 231 | // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; |
216 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 232 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
217 | !QTextDrag::canDecode( e ) ) { | 233 | !Q3TextDrag::canDecode( e ) ) { |
218 | e->ignore(); | 234 | e->ignore(); |
219 | return; | 235 | return; |
220 | } | 236 | } |
221 | 237 | ||
222 | mOldCurrent = currentItem(); | 238 | mOldCurrent = currentItem(); |
223 | #endif | 239 | #endif |
@@ -227,13 +243,13 @@ void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) | |||
227 | void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) | 243 | void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) |
228 | { | 244 | { |
229 | #ifndef KORG_NODND | 245 | #ifndef KORG_NODND |
230 | // kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; | 246 | // kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; |
231 | 247 | ||
232 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 248 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
233 | !QTextDrag::canDecode( e ) ) { | 249 | !Q3TextDrag::canDecode( e ) ) { |
234 | e->ignore(); | 250 | e->ignore(); |
235 | return; | 251 | return; |
236 | } | 252 | } |
237 | 253 | ||
238 | e->accept(); | 254 | e->accept(); |
239 | #endif | 255 | #endif |
@@ -252,13 +268,13 @@ void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) | |||
252 | void KOTodoListView::contentsDropEvent(QDropEvent *e) | 268 | void KOTodoListView::contentsDropEvent(QDropEvent *e) |
253 | { | 269 | { |
254 | #ifndef KORG_NODND | 270 | #ifndef KORG_NODND |
255 | // kdDebug() << "KOTodoListView::contentsDropEvent" << endl; | 271 | // kdDebug() << "KOTodoListView::contentsDropEvent" << endl; |
256 | 272 | ||
257 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 273 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
258 | !QTextDrag::canDecode( e ) ) { | 274 | !Q3TextDrag::canDecode( e ) ) { |
259 | e->ignore(); | 275 | e->ignore(); |
260 | return; | 276 | return; |
261 | } | 277 | } |
262 | 278 | ||
263 | DndFactory factory( mCalendar ); | 279 | DndFactory factory( mCalendar ); |
264 | Todo *todo = factory.createDropTodo(e); | 280 | Todo *todo = factory.createDropTodo(e); |
@@ -297,13 +313,13 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) | |||
297 | if ( destinationEvent ) | 313 | if ( destinationEvent ) |
298 | reparentTodoSignal( destinationEvent, todo ); | 314 | reparentTodoSignal( destinationEvent, todo ); |
299 | } | 315 | } |
300 | } | 316 | } |
301 | else { | 317 | else { |
302 | QString text; | 318 | QString text; |
303 | if (QTextDrag::decode(e,text)) { | 319 | if (Q3TextDrag::decode(e,text)) { |
304 | //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); | 320 | //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); |
305 | KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); | 321 | KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); |
306 | qDebug("Dropped : " + text); | 322 | qDebug("Dropped : " + text); |
307 | QStringList emails = QStringList::split(",",text); | 323 | QStringList emails = QStringList::split(",",text); |
308 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { | 324 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { |
309 | int pos = (*it).find("<"); | 325 | int pos = (*it).find("<"); |
@@ -320,20 +336,20 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) | |||
320 | } | 336 | } |
321 | } | 337 | } |
322 | #endif | 338 | #endif |
323 | } | 339 | } |
324 | void KOTodoListView::wheelEvent (QWheelEvent *e) | 340 | void KOTodoListView::wheelEvent (QWheelEvent *e) |
325 | { | 341 | { |
326 | QListView::wheelEvent (e); | 342 | Q3ListView::wheelEvent (e); |
327 | } | 343 | } |
328 | 344 | ||
329 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) | 345 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) |
330 | { | 346 | { |
331 | 347 | ||
332 | QPoint p(contentsToViewport(e->pos())); | 348 | QPoint p(contentsToViewport(e->pos())); |
333 | QListViewItem *i = itemAt(p); | 349 | Q3ListViewItem *i = itemAt(p); |
334 | bool rootClicked = true; | 350 | bool rootClicked = true; |
335 | if (i) { | 351 | if (i) { |
336 | // if the user clicked into the root decoration of the item, don't | 352 | // if the user clicked into the root decoration of the item, don't |
337 | // try to start a drag! | 353 | // try to start a drag! |
338 | int X = p.x(); | 354 | int X = p.x(); |
339 | //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); | 355 | //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); |
@@ -345,41 +361,41 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) | |||
345 | } | 361 | } |
346 | } else { | 362 | } else { |
347 | rootClicked = false; | 363 | rootClicked = false; |
348 | } | 364 | } |
349 | #ifndef KORG_NODND | 365 | #ifndef KORG_NODND |
350 | mMousePressed = false; | 366 | mMousePressed = false; |
351 | if (! rootClicked && !( e->button() == RightButton) ) { | 367 | if (! rootClicked && !( e->button() == Qt::RightButton) ) { |
352 | mPressPos = e->pos(); | 368 | mPressPos = e->pos(); |
353 | mMousePressed = true; | 369 | mMousePressed = true; |
354 | } else { | 370 | } else { |
355 | mMousePressed = false; | 371 | mMousePressed = false; |
356 | } | 372 | } |
357 | #endif | 373 | #endif |
358 | //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); | 374 | //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); |
359 | #ifndef DESKTOP_VERSION | 375 | #ifndef DESKTOP_VERSION |
360 | if (!( e->button() == RightButton && rootClicked) ) | 376 | if (!( e->button() == RightButton && rootClicked) ) |
361 | QListView::contentsMousePressEvent(e); | 377 | Q3ListView::contentsMousePressEvent(e); |
362 | #else | 378 | #else |
363 | QListView::contentsMousePressEvent(e); | 379 | Q3ListView::contentsMousePressEvent(e); |
364 | #endif | 380 | #endif |
365 | } | 381 | } |
366 | void KOTodoListView::paintEvent(QPaintEvent* e) | 382 | void KOTodoListView::paintEvent(QPaintEvent* e) |
367 | { | 383 | { |
368 | emit paintNeeded(); | 384 | emit paintNeeded(); |
369 | QListView::paintEvent( e); | 385 | Q3ListView::paintEvent( e); |
370 | } | 386 | } |
371 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) | 387 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) |
372 | { | 388 | { |
373 | 389 | ||
374 | #ifndef KORG_NODND | 390 | #ifndef KORG_NODND |
375 | //QListView::contentsMouseMoveEvent(e); | 391 | //QListView::contentsMouseMoveEvent(e); |
376 | if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > | 392 | if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > |
377 | QApplication::startDragDistance()*3) { | 393 | QApplication::startDragDistance()*3) { |
378 | mMousePressed = false; | 394 | mMousePressed = false; |
379 | QListViewItem *item = itemAt(contentsToViewport(mPressPos)); | 395 | Q3ListViewItem *item = itemAt(contentsToViewport(mPressPos)); |
380 | if (item) { | 396 | if (item) { |
381 | DndFactory factory( mCalendar ); | 397 | DndFactory factory( mCalendar ); |
382 | ICalDrag *vd = factory.createDrag( | 398 | ICalDrag *vd = factory.createDrag( |
383 | ((KOTodoViewItem *)item)->todo(),viewport()); | 399 | ((KOTodoViewItem *)item)->todo(),viewport()); |
384 | internalDrop = false; | 400 | internalDrop = false; |
385 | // we cannot do any senseful here, because the DnD is still broken in Qt | 401 | // we cannot do any senseful here, because the DnD is still broken in Qt |
@@ -419,19 +435,19 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | |||
419 | e->ignore(); | 435 | e->ignore(); |
420 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 436 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
421 | return; | 437 | return; |
422 | } | 438 | } |
423 | if (! e->isAutoRepeat() ) | 439 | if (! e->isAutoRepeat() ) |
424 | mFlagKeyPressed = true; | 440 | mFlagKeyPressed = true; |
425 | QListViewItem* cn; | 441 | Q3ListViewItem* cn; |
426 | if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { | 442 | if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { |
427 | cn = currentItem(); | 443 | cn = currentItem(); |
428 | if ( cn ) { | 444 | if ( cn ) { |
429 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 445 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
430 | if ( ci ){ | 446 | if ( ci ){ |
431 | if ( e->state() == ShiftButton ) | 447 | if ( e->state() == Qt::ShiftButton ) |
432 | ci->setOn( false ); | 448 | ci->setOn( false ); |
433 | else | 449 | else |
434 | ci->setOn( true ); | 450 | ci->setOn( true ); |
435 | cn = cn->itemBelow(); | 451 | cn = cn->itemBelow(); |
436 | if ( cn ) { | 452 | if ( cn ) { |
437 | setCurrentItem ( cn ); | 453 | setCurrentItem ( cn ); |
@@ -446,18 +462,18 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | |||
446 | } | 462 | } |
447 | 463 | ||
448 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { | 464 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { |
449 | switch ( e->key() ) { | 465 | switch ( e->key() ) { |
450 | case Qt::Key_Down: | 466 | case Qt::Key_Down: |
451 | case Qt::Key_Up: | 467 | case Qt::Key_Up: |
452 | QListView::keyPressEvent ( e ); | 468 | Q3ListView::keyPressEvent ( e ); |
453 | e->accept(); | 469 | e->accept(); |
454 | break; | 470 | break; |
455 | case Qt::Key_Left: | 471 | case Qt::Key_Left: |
456 | case Qt::Key_Right: | 472 | case Qt::Key_Right: |
457 | QListView::keyPressEvent ( e ); | 473 | Q3ListView::keyPressEvent ( e ); |
458 | e->accept(); | 474 | e->accept(); |
459 | return; | 475 | return; |
460 | break; | 476 | break; |
461 | default: | 477 | default: |
462 | e->ignore(); | 478 | e->ignore(); |
463 | break; | 479 | break; |
@@ -465,23 +481,23 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | |||
465 | return; | 481 | return; |
466 | } | 482 | } |
467 | e->ignore(); | 483 | e->ignore(); |
468 | } | 484 | } |
469 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) | 485 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) |
470 | { | 486 | { |
471 | QListView::contentsMouseReleaseEvent(e); | 487 | Q3ListView::contentsMouseReleaseEvent(e); |
472 | mMousePressed = false; | 488 | mMousePressed = false; |
473 | } | 489 | } |
474 | 490 | ||
475 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 491 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
476 | { | 492 | { |
477 | if (!e) return; | 493 | if (!e) return; |
478 | 494 | ||
479 | QPoint vp = contentsToViewport(e->pos()); | 495 | QPoint vp = contentsToViewport(e->pos()); |
480 | 496 | ||
481 | QListViewItem *item = itemAt(vp); | 497 | Q3ListViewItem *item = itemAt(vp); |
482 | 498 | ||
483 | emit double_Clicked(item); | 499 | emit double_Clicked(item); |
484 | if (!item) return; | 500 | if (!item) return; |
485 | 501 | ||
486 | emit doubleClicked(item,vp,0); | 502 | emit doubleClicked(item,vp,0); |
487 | } | 503 | } |
@@ -489,13 +505,13 @@ void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | |||
489 | ///////////////////////////////////////////////////////////////////////////// | 505 | ///////////////////////////////////////////////////////////////////////////// |
490 | 506 | ||
491 | KOQuickTodo::KOQuickTodo(QWidget *parent) : | 507 | KOQuickTodo::KOQuickTodo(QWidget *parent) : |
492 | QLineEdit(parent) | 508 | QLineEdit(parent) |
493 | { | 509 | { |
494 | setText(i18n("Click to add new Todo")); | 510 | setText(i18n("Click to add new Todo")); |
495 | setFocusPolicy ( QWidget::ClickFocus ); | 511 | setFocusPolicy ( Qt::ClickFocus ); |
496 | } | 512 | } |
497 | 513 | ||
498 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) | 514 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) |
499 | { | 515 | { |
500 | if ( text()==i18n("Click to add new Todo") ) | 516 | if ( text()==i18n("Click to add new Todo") ) |
501 | setText(""); | 517 | setText(""); |
@@ -520,20 +536,20 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
520 | mCurItemAbove = 0; | 536 | mCurItemAbove = 0; |
521 | mActiveItem = 0; | 537 | mActiveItem = 0; |
522 | mCategoryPopupMenu = 0; | 538 | mCategoryPopupMenu = 0; |
523 | mPendingUpdateBeforeRepaint = false; | 539 | mPendingUpdateBeforeRepaint = false; |
524 | isFlatDisplay = false; | 540 | isFlatDisplay = false; |
525 | mNavigator = 0; | 541 | mNavigator = 0; |
526 | QBoxLayout *topLayout = new QVBoxLayout(this); | 542 | Q3BoxLayout *topLayout = new Q3VBoxLayout(this); |
527 | mName = QString ( name ); | 543 | mName = QString ( name ); |
528 | mBlockUpdate = false; | 544 | mBlockUpdate = false; |
529 | mQuickBar = new QWidget( this ); | 545 | mQuickBar = new QWidget( this ); |
530 | topLayout->addWidget(mQuickBar); | 546 | topLayout->addWidget(mQuickBar); |
531 | 547 | ||
532 | mQuickAdd = new KOQuickTodo(mQuickBar); | 548 | mQuickAdd = new KOQuickTodo(mQuickBar); |
533 | QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); | 549 | Q3BoxLayout *quickLayout = new Q3HBoxLayout(mQuickBar); |
534 | quickLayout->addWidget( mQuickAdd ); | 550 | quickLayout->addWidget( mQuickAdd ); |
535 | mNewSubBut = new QPushButton( "sub",mQuickBar ); | 551 | mNewSubBut = new QPushButton( "sub",mQuickBar ); |
536 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); | 552 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); |
537 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); | 553 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); |
538 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); | 554 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); |
539 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); | 555 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); |
@@ -565,25 +581,25 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
565 | s_done->setFixedHeight(fixhei ); | 581 | s_done->setFixedHeight(fixhei ); |
566 | allopen->setFixedHeight(fixhei ); | 582 | allopen->setFixedHeight(fixhei ); |
567 | allclose->setFixedHeight(fixhei ); | 583 | allclose->setFixedHeight(fixhei ); |
568 | s_run->setFixedHeight(fixhei ); | 584 | s_run->setFixedHeight(fixhei ); |
569 | mNewSubBut->setFixedHeight(fixhei ); | 585 | mNewSubBut->setFixedHeight(fixhei ); |
570 | 586 | ||
571 | flat->setFocusPolicy( NoFocus ); | 587 | flat->setFocusPolicy( Qt::NoFocus ); |
572 | s_done->setFocusPolicy( NoFocus ); | 588 | s_done->setFocusPolicy( Qt::NoFocus ); |
573 | allopen->setFocusPolicy( NoFocus ); | 589 | allopen->setFocusPolicy( Qt::NoFocus ); |
574 | allclose->setFocusPolicy( NoFocus ); | 590 | allclose->setFocusPolicy( Qt::NoFocus ); |
575 | s_run->setFocusPolicy( NoFocus ); | 591 | s_run->setFocusPolicy( Qt::NoFocus ); |
576 | mNewSubBut->setFocusPolicy( NoFocus ); | 592 | mNewSubBut->setFocusPolicy( Qt::NoFocus ); |
577 | 593 | ||
578 | QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) ); | 594 | Q3WhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) ); |
579 | QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) ); | 595 | Q3WhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) ); |
580 | QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) ); | 596 | Q3WhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) ); |
581 | QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) ); | 597 | Q3WhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) ); |
582 | QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); | 598 | Q3WhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); |
583 | QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) ); | 599 | Q3WhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) ); |
584 | 600 | ||
585 | quickLayout->addWidget( mNewSubBut ); | 601 | quickLayout->addWidget( mNewSubBut ); |
586 | quickLayout->addWidget( s_done ); | 602 | quickLayout->addWidget( s_done ); |
587 | quickLayout->addWidget( s_run ); | 603 | quickLayout->addWidget( s_run ); |
588 | quickLayout->addWidget( allopen ); | 604 | quickLayout->addWidget( allopen ); |
589 | quickLayout->addWidget( allclose ); | 605 | quickLayout->addWidget( allclose ); |
@@ -598,77 +614,77 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
598 | mTodoListView->setAllColumnsShowFocus(true); | 614 | mTodoListView->setAllColumnsShowFocus(true); |
599 | 615 | ||
600 | mTodoListView->setShowSortIndicator(true); | 616 | mTodoListView->setShowSortIndicator(true); |
601 | 617 | ||
602 | mTodoListView->addColumn(i18n("Todo")); | 618 | mTodoListView->addColumn(i18n("Todo")); |
603 | mTodoListView->addColumn(i18n("Prio")); | 619 | mTodoListView->addColumn(i18n("Prio")); |
604 | mTodoListView->setColumnAlignment(1,AlignHCenter); | 620 | mTodoListView->setColumnAlignment(1,Qt::AlignHCenter); |
605 | mTodoListView->addColumn(i18n("Complete")); | 621 | mTodoListView->addColumn(i18n("Complete")); |
606 | mTodoListView->setColumnAlignment(2,AlignCenter); | 622 | mTodoListView->setColumnAlignment(2,Qt::AlignCenter); |
607 | 623 | ||
608 | mTodoListView->addColumn(i18n("Due Date")); | 624 | mTodoListView->addColumn(i18n("Due Date")); |
609 | mTodoListView->setColumnAlignment(3,AlignLeft); | 625 | mTodoListView->setColumnAlignment(3,Qt::AlignLeft); |
610 | mTodoListView->addColumn(i18n("Due Time")); | 626 | mTodoListView->addColumn(i18n("Due Time")); |
611 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 627 | mTodoListView->setColumnAlignment(4,Qt::AlignHCenter); |
612 | 628 | ||
613 | mTodoListView->addColumn(i18n("Start Date")); | 629 | mTodoListView->addColumn(i18n("Start Date")); |
614 | mTodoListView->setColumnAlignment(5,AlignLeft); | 630 | mTodoListView->setColumnAlignment(5,Qt::AlignLeft); |
615 | mTodoListView->addColumn(i18n("Start Time")); | 631 | mTodoListView->addColumn(i18n("Start Time")); |
616 | mTodoListView->setColumnAlignment(6,AlignHCenter); | 632 | mTodoListView->setColumnAlignment(6,Qt::AlignHCenter); |
617 | 633 | ||
618 | //mTodoListView->addColumn(i18n("Cancelled")); | 634 | //mTodoListView->addColumn(i18n("Cancelled")); |
619 | mTodoListView->addColumn(i18n("Categories")); | 635 | mTodoListView->addColumn(i18n("Categories")); |
620 | mTodoListView->addColumn(i18n("Calendar")); | 636 | mTodoListView->addColumn(i18n("Calendar")); |
621 | mTodoListView->addColumn(i18n("Last Modified")); | 637 | mTodoListView->addColumn(i18n("Last Modified")); |
622 | mTodoListView->addColumn(i18n("Created")); | 638 | mTodoListView->addColumn(i18n("Created")); |
623 | mTodoListView->addColumn(i18n("Last Modified Sub")); | 639 | mTodoListView->addColumn(i18n("Last Modified Sub")); |
624 | #if 0 | 640 | #if 0 |
625 | mTodoListView->addColumn(i18n("Sort Id")); | 641 | mTodoListView->addColumn(i18n("Sort Id")); |
626 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 642 | mTodoListView->setColumnAlignment(4,Qt::AlignHCenter); |
627 | #endif | 643 | #endif |
628 | 644 | ||
629 | mTodoListView->setMinimumHeight( 60 ); | 645 | mTodoListView->setMinimumHeight( 60 ); |
630 | mTodoListView->setItemsRenameable( true ); | 646 | mTodoListView->setItemsRenameable( true ); |
631 | mTodoListView->setRenameable( 0 ); | 647 | mTodoListView->setRenameable( 0 ); |
632 | mTodoListView->setColumnWidth( 0, 120 ); | 648 | mTodoListView->setColumnWidth( 0, 120 ); |
633 | int iii = 0; | 649 | int iii = 0; |
634 | for ( iii = 0; iii< 12 ; ++iii ) | 650 | for ( iii = 0; iii< 12 ; ++iii ) |
635 | mTodoListView->setColumnWidthMode( iii, QListView::Manual ); | 651 | mTodoListView->setColumnWidthMode( iii, Q3ListView::Manual ); |
636 | 652 | ||
637 | 653 | ||
638 | mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); | 654 | mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); |
639 | 655 | ||
640 | mPriorityPopupMenu = new QPopupMenu(this); | 656 | mPriorityPopupMenu = new Q3PopupMenu(this); |
641 | for (int i = 1; i <= 5; i++) { | 657 | for (int i = 1; i <= 5; i++) { |
642 | QString label = QString ("%1").arg (i); | 658 | QString label = QString ("%1").arg (i); |
643 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; | 659 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; |
644 | } | 660 | } |
645 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); | 661 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); |
646 | 662 | ||
647 | mPercentageCompletedPopupMenu = new QPopupMenu(this); | 663 | mPercentageCompletedPopupMenu = new Q3PopupMenu(this); |
648 | for (int i = 0; i <= 100; i+=20) { | 664 | for (int i = 0; i <= 100; i+=20) { |
649 | QString label = QString ("%1 %").arg (i); | 665 | QString label = QString ("%1 %").arg (i); |
650 | mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; | 666 | mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; |
651 | } | 667 | } |
652 | connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); | 668 | connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); |
653 | 669 | ||
654 | 670 | ||
655 | mCategoryPopupMenu = new QPopupMenu (this); | 671 | mCategoryPopupMenu = new Q3PopupMenu (this); |
656 | mCategoryPopupMenu->setCheckable (true); | 672 | mCategoryPopupMenu->setCheckable (true); |
657 | connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); | 673 | connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); |
658 | connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); | 674 | connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); |
659 | 675 | ||
660 | mCalPopupMenu = new QPopupMenu (this); | 676 | mCalPopupMenu = new Q3PopupMenu (this); |
661 | mCalPopupMenu->setCheckable (true); | 677 | mCalPopupMenu->setCheckable (true); |
662 | connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); | 678 | connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); |
663 | connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); | 679 | connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); |
664 | 680 | ||
665 | 681 | ||
666 | 682 | ||
667 | 683 | ||
668 | mItemPopupMenu = new QPopupMenu(this); | 684 | mItemPopupMenu = new Q3PopupMenu(this); |
669 | mItemPopupMenu->insertItem(i18n("Show"), this, | 685 | mItemPopupMenu->insertItem(i18n("Show"), this, |
670 | SLOT (showTodo())); | 686 | SLOT (showTodo())); |
671 | mItemPopupMenu->insertItem(i18n("Edit..."), this, | 687 | mItemPopupMenu->insertItem(i18n("Edit..."), this, |
672 | SLOT (editTodo())); | 688 | SLOT (editTodo())); |
673 | mItemPopupMenu->insertItem( i18n("Delete..."), this, | 689 | mItemPopupMenu->insertItem( i18n("Delete..."), this, |
674 | SLOT (deleteTodo())); | 690 | SLOT (deleteTodo())); |
@@ -707,13 +723,13 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
707 | mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), | 723 | mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), |
708 | this, SLOT( toggleQuickTodo() ),0, 34 ); | 724 | this, SLOT( toggleQuickTodo() ),0, 34 ); |
709 | mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), | 725 | mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), |
710 | this, SLOT( toggleRunning() ),0, 35 ); | 726 | this, SLOT( toggleRunning() ),0, 35 ); |
711 | 727 | ||
712 | #endif | 728 | #endif |
713 | mPopupMenu = new QPopupMenu(this); | 729 | mPopupMenu = new Q3PopupMenu(this); |
714 | mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, | 730 | mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, |
715 | SLOT (newTodo()),0,1); | 731 | SLOT (newTodo()),0,1); |
716 | mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), | 732 | mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), |
717 | this, SLOT(purgeCompleted()),0,2); | 733 | this, SLOT(purgeCompleted()),0,2); |
718 | mPopupMenu->insertItem(i18n("Show Completed"), | 734 | mPopupMenu->insertItem(i18n("Show Completed"), |
719 | this, SLOT( toggleCompleted() ),0,3 ); | 735 | this, SLOT( toggleCompleted() ),0,3 ); |
@@ -743,44 +759,44 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
743 | 759 | ||
744 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | 760 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); |
745 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | 761 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); |
746 | 762 | ||
747 | 763 | ||
748 | // Double clicking conflicts with opening/closing the subtree | 764 | // Double clicking conflicts with opening/closing the subtree |
749 | connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), | 765 | connect( mTodoListView, SIGNAL( doubleClicked( Q3ListViewItem *) ), |
750 | SLOT( editItem( QListViewItem *) ) ); | 766 | SLOT( editItem( Q3ListViewItem *) ) ); |
751 | /* | 767 | /* |
752 | connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, | 768 | connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, |
753 | const QPoint &,int ) ), | 769 | const QPoint &,int ) ), |
754 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); | 770 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); |
755 | */ | 771 | */ |
756 | connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, | 772 | connect( mTodoListView, SIGNAL( contextRequest ( Q3ListViewItem *, |
757 | const QPoint &,int ) ), | 773 | const QPoint &,int ) ), |
758 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); | 774 | SLOT( popupMenu( Q3ListViewItem *, const QPoint & ,int) ) ); |
759 | connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), | 775 | connect( mTodoListView, SIGNAL( clicked( Q3ListViewItem * ) ), |
760 | SLOT( itemClicked( QListViewItem * ) ) ); | 776 | SLOT( itemClicked( Q3ListViewItem * ) ) ); |
761 | connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), | 777 | connect( mTodoListView, SIGNAL( double_Clicked( Q3ListViewItem * ) ), |
762 | SLOT( itemDoubleClicked( QListViewItem * ) ) ); | 778 | SLOT( itemDoubleClicked( Q3ListViewItem * ) ) ); |
763 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), | 779 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), |
764 | SLOT( updateView() ) ); | 780 | SLOT( updateView() ) ); |
765 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), | 781 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), |
766 | SLOT( todoModified(Todo *, int) ) ); | 782 | SLOT( todoModified(Todo *, int) ) ); |
767 | connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), | 783 | connect( mTodoListView, SIGNAL( expanded( Q3ListViewItem * ) ), |
768 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 784 | SLOT( itemStateChanged( Q3ListViewItem * ) ) ); |
769 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), | 785 | connect( mTodoListView, SIGNAL( collapsed( Q3ListViewItem * ) ), |
770 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 786 | SLOT( itemStateChanged( Q3ListViewItem * ) ) ); |
771 | connect( mTodoListView, SIGNAL( paintNeeded() ), | 787 | connect( mTodoListView, SIGNAL( paintNeeded() ), |
772 | SLOT( paintNeeded()) ); | 788 | SLOT( paintNeeded()) ); |
773 | 789 | ||
774 | #if 0 | 790 | #if 0 |
775 | connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), | 791 | connect(mTodoListView,SIGNAL(selectionChanged(Q3ListViewItem *)), |
776 | SLOT(selectionChanged(QListViewItem *))); | 792 | SLOT(selectionChanged(Q3ListViewItem *))); |
777 | connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), | 793 | connect(mTodoListView,SIGNAL(clicked(Q3ListViewItem *)), |
778 | SLOT(selectionChanged(QListViewItem *))); | 794 | SLOT(selectionChanged(Q3ListViewItem *))); |
779 | connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), | 795 | connect(mTodoListView,SIGNAL(pressed(Q3ListViewItem *)), |
780 | SLOT(selectionChanged(QListViewItem *))); | 796 | SLOT(selectionChanged(Q3ListViewItem *))); |
781 | #endif | 797 | #endif |
782 | 798 | ||
783 | connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); | 799 | connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); |
784 | connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); | 800 | connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); |
785 | connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); | 801 | connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); |
786 | 802 | ||
@@ -878,13 +894,13 @@ void KOTodoView::updateView() | |||
878 | } | 894 | } |
879 | } | 895 | } |
880 | 896 | ||
881 | mTodoListView->setFont( fo ); | 897 | mTodoListView->setFont( fo ); |
882 | // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); | 898 | // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); |
883 | //mTodoListView->header()->setMaximumHeight(fm.height()); | 899 | //mTodoListView->header()->setMaximumHeight(fm.height()); |
884 | QPtrList<Todo> todoList = calendar()->todos(); | 900 | Q3PtrList<Todo> todoList = calendar()->todos(); |
885 | 901 | ||
886 | /* | 902 | /* |
887 | kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; | 903 | kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; |
888 | Event *t; | 904 | Event *t; |
889 | for(t = todoList.first(); t; t = todoList.next()) { | 905 | for(t = todoList.first(); t; t = todoList.next()) { |
890 | kdDebug() << " " << t->getSummary() << endl; | 906 | kdDebug() << " " << t->getSummary() << endl; |
@@ -1041,13 +1057,13 @@ bool KOTodoView::checkTodo( Todo * todo ) | |||
1041 | if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) | 1057 | if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) |
1042 | return false; | 1058 | return false; |
1043 | } | 1059 | } |
1044 | return true; | 1060 | return true; |
1045 | } | 1061 | } |
1046 | 1062 | ||
1047 | void KOTodoView::restoreItemState( QListViewItem *item ) | 1063 | void KOTodoView::restoreItemState( Q3ListViewItem *item ) |
1048 | { | 1064 | { |
1049 | pendingSubtodo = 0; | 1065 | pendingSubtodo = 0; |
1050 | while( item ) { | 1066 | while( item ) { |
1051 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1067 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1052 | todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); | 1068 | todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); |
1053 | if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); | 1069 | if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); |
@@ -1093,26 +1109,26 @@ KOTodoView::insertTodoItem(Todo *todo) | |||
1093 | void KOTodoView::updateConfig() | 1109 | void KOTodoView::updateConfig() |
1094 | { | 1110 | { |
1095 | updateView(); | 1111 | updateView(); |
1096 | mTodoListView->repaintContents(); | 1112 | mTodoListView->repaintContents(); |
1097 | } | 1113 | } |
1098 | 1114 | ||
1099 | QPtrList<Incidence> KOTodoView::selectedIncidences() | 1115 | Q3PtrList<Incidence> KOTodoView::selectedIncidences() |
1100 | { | 1116 | { |
1101 | QPtrList<Incidence> selected; | 1117 | Q3PtrList<Incidence> selected; |
1102 | 1118 | ||
1103 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); | 1119 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); |
1104 | // if (!item) item = mActiveItem; | 1120 | // if (!item) item = mActiveItem; |
1105 | if (item) selected.append(item->todo()); | 1121 | if (item) selected.append(item->todo()); |
1106 | 1122 | ||
1107 | return selected; | 1123 | return selected; |
1108 | } | 1124 | } |
1109 | 1125 | ||
1110 | QPtrList<Todo> KOTodoView::selectedTodos() | 1126 | Q3PtrList<Todo> KOTodoView::selectedTodos() |
1111 | { | 1127 | { |
1112 | QPtrList<Todo> selected; | 1128 | Q3PtrList<Todo> selected; |
1113 | 1129 | ||
1114 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); | 1130 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); |
1115 | // if (!item) item = mActiveItem; | 1131 | // if (!item) item = mActiveItem; |
1116 | if (item) selected.append(item->todo()); | 1132 | if (item) selected.append(item->todo()); |
1117 | 1133 | ||
1118 | return selected; | 1134 | return selected; |
@@ -1124,38 +1140,38 @@ void KOTodoView::changeEventDisplay(Event *, int) | |||
1124 | } | 1140 | } |
1125 | 1141 | ||
1126 | void KOTodoView::showDates(const QDate &, const QDate &) | 1142 | void KOTodoView::showDates(const QDate &, const QDate &) |
1127 | { | 1143 | { |
1128 | } | 1144 | } |
1129 | 1145 | ||
1130 | void KOTodoView::showEvents(QPtrList<Event>) | 1146 | void KOTodoView::showEvents(Q3PtrList<Event>) |
1131 | { | 1147 | { |
1132 | kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; | 1148 | kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; |
1133 | } | 1149 | } |
1134 | 1150 | ||
1135 | void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 1151 | void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
1136 | const QDate &td) | 1152 | const QDate &td) |
1137 | { | 1153 | { |
1138 | #ifndef KORG_NOPRINTER | 1154 | #ifndef KORG_NOPRINTER |
1139 | calPrinter->preview(CalPrinter::Todolist, fd, td); | 1155 | calPrinter->preview(CalPrinter::Todolist, fd, td); |
1140 | #endif | 1156 | #endif |
1141 | } | 1157 | } |
1142 | 1158 | ||
1143 | void KOTodoView::editItem(QListViewItem *item ) | 1159 | void KOTodoView::editItem(Q3ListViewItem *item ) |
1144 | { | 1160 | { |
1145 | if ( item ) | 1161 | if ( item ) |
1146 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); | 1162 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); |
1147 | } | 1163 | } |
1148 | 1164 | ||
1149 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) | 1165 | void KOTodoView::showItem(Q3ListViewItem *item,const QPoint &,int) |
1150 | { | 1166 | { |
1151 | if ( item ) | 1167 | if ( item ) |
1152 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); | 1168 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); |
1153 | } | 1169 | } |
1154 | 1170 | ||
1155 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) | 1171 | void KOTodoView::popupMenu(Q3ListViewItem *item,const QPoint &p,int column) |
1156 | { | 1172 | { |
1157 | pendingSubtodo = 0; | 1173 | pendingSubtodo = 0; |
1158 | mActiveItem = (KOTodoViewItem *)item; | 1174 | mActiveItem = (KOTodoViewItem *)item; |
1159 | if (item) { | 1175 | if (item) { |
1160 | switch (column){ | 1176 | switch (column){ |
1161 | case 1: | 1177 | case 1: |
@@ -1358,13 +1374,13 @@ void KOTodoView::toggleRunningItemQuick() | |||
1358 | } else { | 1374 | } else { |
1359 | t->setRunning( true ); | 1375 | t->setRunning( true ); |
1360 | mActiveItem->construct(); | 1376 | mActiveItem->construct(); |
1361 | topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); | 1377 | topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); |
1362 | } | 1378 | } |
1363 | } | 1379 | } |
1364 | void KOTodoView::itemDoubleClicked(QListViewItem *item) | 1380 | void KOTodoView::itemDoubleClicked(Q3ListViewItem *item) |
1365 | { | 1381 | { |
1366 | if ( pendingSubtodo != 0 ) { | 1382 | if ( pendingSubtodo != 0 ) { |
1367 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1383 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1368 | } | 1384 | } |
1369 | pendingSubtodo = 0; | 1385 | pendingSubtodo = 0; |
1370 | //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); | 1386 | //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); |
@@ -1425,26 +1441,26 @@ void KOTodoView::toggleRunningItem() | |||
1425 | t->setRunning( true ); | 1441 | t->setRunning( true ); |
1426 | updateTodo ( t, KOGlobals::EVENTEDITED ); | 1442 | updateTodo ( t, KOGlobals::EVENTEDITED ); |
1427 | } | 1443 | } |
1428 | } | 1444 | } |
1429 | } | 1445 | } |
1430 | 1446 | ||
1431 | void KOTodoView::itemClicked(QListViewItem *item) | 1447 | void KOTodoView::itemClicked(Q3ListViewItem *item) |
1432 | { | 1448 | { |
1433 | //qDebug("KOTodoView::itemClicked %d", item); | 1449 | //qDebug("KOTodoView::itemClicked %d", item); |
1434 | if (!item) { | 1450 | if (!item) { |
1435 | if ( pendingSubtodo != 0 ) { | 1451 | if ( pendingSubtodo != 0 ) { |
1436 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1452 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1437 | } | 1453 | } |
1438 | pendingSubtodo = 0; | 1454 | pendingSubtodo = 0; |
1439 | return; | 1455 | return; |
1440 | } | 1456 | } |
1441 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1457 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1442 | if ( pendingSubtodo != 0 ) { | 1458 | if ( pendingSubtodo != 0 ) { |
1443 | bool allowReparent = true; | 1459 | bool allowReparent = true; |
1444 | QListViewItem *par = item; | 1460 | Q3ListViewItem *par = item; |
1445 | while ( par ) { | 1461 | while ( par ) { |
1446 | if ( par == pendingSubtodo ) { | 1462 | if ( par == pendingSubtodo ) { |
1447 | allowReparent = false; | 1463 | allowReparent = false; |
1448 | break; | 1464 | break; |
1449 | } | 1465 | } |
1450 | par = par->parent(); | 1466 | par = par->parent(); |
@@ -1466,13 +1482,13 @@ void KOTodoView::itemClicked(QListViewItem *item) | |||
1466 | void KOTodoView::setDocumentId( const QString &id ) | 1482 | void KOTodoView::setDocumentId( const QString &id ) |
1467 | { | 1483 | { |
1468 | 1484 | ||
1469 | mDocPrefs->setDoc( id ); | 1485 | mDocPrefs->setDoc( id ); |
1470 | } | 1486 | } |
1471 | 1487 | ||
1472 | void KOTodoView::itemStateChanged( QListViewItem *item ) | 1488 | void KOTodoView::itemStateChanged( Q3ListViewItem *item ) |
1473 | { | 1489 | { |
1474 | if (!item) return; | 1490 | if (!item) return; |
1475 | 1491 | ||
1476 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1492 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1477 | 1493 | ||
1478 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; | 1494 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; |
@@ -1539,13 +1555,13 @@ void KOTodoView::setAllClose() | |||
1539 | } else { | 1555 | } else { |
1540 | storeCurrentItem(); | 1556 | storeCurrentItem(); |
1541 | } | 1557 | } |
1542 | setOpen(mTodoListView->firstChild(), false); | 1558 | setOpen(mTodoListView->firstChild(), false); |
1543 | resetCurrentItem(); | 1559 | resetCurrentItem(); |
1544 | } | 1560 | } |
1545 | void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) | 1561 | void KOTodoView::setOpen( Q3ListViewItem* item, bool setOpenI) |
1546 | { | 1562 | { |
1547 | 1563 | ||
1548 | while ( item ) { | 1564 | while ( item ) { |
1549 | setOpen( item->firstChild(), setOpenI ); | 1565 | setOpen( item->firstChild(), setOpenI ); |
1550 | item->setOpen( setOpenI ); | 1566 | item->setOpen( setOpenI ); |
1551 | item = item->nextSibling(); | 1567 | item = item->nextSibling(); |
@@ -1560,13 +1576,13 @@ void KOTodoView::displayAllFlat() | |||
1560 | if ( mBlockUpdate ) { | 1576 | if ( mBlockUpdate ) { |
1561 | return; | 1577 | return; |
1562 | } | 1578 | } |
1563 | clearList (); | 1579 | clearList (); |
1564 | mPopupMenu->setItemChecked( 8,true ); | 1580 | mPopupMenu->setItemChecked( 8,true ); |
1565 | isFlatDisplay = true; | 1581 | isFlatDisplay = true; |
1566 | QPtrList<Todo> todoList = calendar()->todos(); | 1582 | Q3PtrList<Todo> todoList = calendar()->todos(); |
1567 | Todo *todo; | 1583 | Todo *todo; |
1568 | for(todo = todoList.first(); todo; todo = todoList.next()) { | 1584 | for(todo = todoList.first(); todo; todo = todoList.next()) { |
1569 | if ( checkTodo( todo ) ) { | 1585 | if ( checkTodo( todo ) ) { |
1570 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); | 1586 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); |
1571 | mTodoMap.insert(todo,todoItem); | 1587 | mTodoMap.insert(todo,todoItem); |
1572 | } | 1588 | } |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 0cbc087..a9e7f30 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -23,21 +23,31 @@ | |||
23 | #ifndef KOTODOVIEW_H | 23 | #ifndef KOTODOVIEW_H |
24 | #define KOTODOVIEW_H | 24 | #define KOTODOVIEW_H |
25 | 25 | ||
26 | #include <qfont.h> | 26 | #include <qfont.h> |
27 | #include <qfontmetrics.h> | 27 | #include <qfontmetrics.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qptrlist.h> | 29 | #include <q3ptrlist.h> |
30 | #include <qstrlist.h> | 30 | #include <q3strlist.h> |
31 | #include <qlistbox.h> | 31 | #include <q3listbox.h> |
32 | #include <qpopupmenu.h> | 32 | #include <q3popupmenu.h> |
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qmap.h> | 34 | #include <qmap.h> |
35 | #include <qdialog.h> | 35 | #include <qdialog.h> |
36 | #include <qlabel.h> | 36 | #include <qlabel.h> |
37 | #include <qlistview.h> | 37 | #include <q3listview.h> |
38 | //Added by qt3to4: | ||
39 | #include <QDragMoveEvent> | ||
40 | #include <QDropEvent> | ||
41 | #include <QDragLeaveEvent> | ||
42 | #include <QWheelEvent> | ||
43 | #include <QPaintEvent> | ||
44 | #include <QFocusEvent> | ||
45 | #include <QMouseEvent> | ||
46 | #include <QKeyEvent> | ||
47 | #include <QDragEnterEvent> | ||
38 | #include <klistview.h> | 48 | #include <klistview.h> |
39 | 49 | ||
40 | #include <libkcal/calendar.h> | 50 | #include <libkcal/calendar.h> |
41 | #include <libkcal/todo.h> | 51 | #include <libkcal/todo.h> |
42 | 52 | ||
43 | #include <korganizer/baseview.h> | 53 | #include <korganizer/baseview.h> |
@@ -98,13 +108,13 @@ class KOTodoListView : public KListView | |||
98 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); | 108 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); |
99 | virtual ~KOTodoListView() {} | 109 | virtual ~KOTodoListView() {} |
100 | 110 | ||
101 | signals: | 111 | signals: |
102 | void paintNeeded(); | 112 | void paintNeeded(); |
103 | void todoDropped(Todo *, int); | 113 | void todoDropped(Todo *, int); |
104 | void double_Clicked(QListViewItem *item); | 114 | void double_Clicked(Q3ListViewItem *item); |
105 | void reparentTodoSignal( Todo *,Todo * ); | 115 | void reparentTodoSignal( Todo *,Todo * ); |
106 | void unparentTodoSignal(Todo *); | 116 | void unparentTodoSignal(Todo *); |
107 | void deleteTodo( Todo * ); | 117 | void deleteTodo( Todo * ); |
108 | protected: | 118 | protected: |
109 | void wheelEvent (QWheelEvent *e); | 119 | void wheelEvent (QWheelEvent *e); |
110 | void contentsDragEnterEvent(QDragEnterEvent *); | 120 | void contentsDragEnterEvent(QDragEnterEvent *); |
@@ -121,13 +131,13 @@ class KOTodoListView : public KListView | |||
121 | void paintEvent(QPaintEvent * pevent); | 131 | void paintEvent(QPaintEvent * pevent); |
122 | bool internalDrop; | 132 | bool internalDrop; |
123 | QString mName; | 133 | QString mName; |
124 | Calendar *mCalendar; | 134 | Calendar *mCalendar; |
125 | QPoint mPressPos; | 135 | QPoint mPressPos; |
126 | bool mMousePressed; | 136 | bool mMousePressed; |
127 | QListViewItem *mOldCurrent; | 137 | Q3ListViewItem *mOldCurrent; |
128 | bool mFlagKeyPressed; | 138 | bool mFlagKeyPressed; |
129 | void keyPressEvent ( QKeyEvent * ) ; | 139 | void keyPressEvent ( QKeyEvent * ) ; |
130 | void keyReleaseEvent ( QKeyEvent * ) ; | 140 | void keyReleaseEvent ( QKeyEvent * ) ; |
131 | }; | 141 | }; |
132 | 142 | ||
133 | 143 | ||
@@ -154,14 +164,14 @@ class KOTodoView : public KOrg::BaseView | |||
154 | { | 164 | { |
155 | Q_OBJECT | 165 | Q_OBJECT |
156 | public: | 166 | public: |
157 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); | 167 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); |
158 | ~KOTodoView(); | 168 | ~KOTodoView(); |
159 | 169 | ||
160 | QPtrList<Incidence> selectedIncidences(); | 170 | Q3PtrList<Incidence> selectedIncidences(); |
161 | QPtrList<Todo> selectedTodos(); | 171 | Q3PtrList<Todo> selectedTodos(); |
162 | 172 | ||
163 | DateList selectedDates() | 173 | DateList selectedDates() |
164 | {DateList q; | 174 | {DateList q; |
165 | return q;} | 175 | return q;} |
166 | 176 | ||
167 | /** Return number of shown dates. TodoView does not show dates, */ | 177 | /** Return number of shown dates. TodoView does not show dates, */ |
@@ -181,20 +191,20 @@ class KOTodoView : public KOrg::BaseView | |||
181 | void updateView(); | 191 | void updateView(); |
182 | void updateConfig(); | 192 | void updateConfig(); |
183 | 193 | ||
184 | void changeEventDisplay(Event *, int); | 194 | void changeEventDisplay(Event *, int); |
185 | 195 | ||
186 | void showDates(const QDate &start, const QDate &end); | 196 | void showDates(const QDate &start, const QDate &end); |
187 | void showEvents(QPtrList<Event> eventList); | 197 | void showEvents(Q3PtrList<Event> eventList); |
188 | 198 | ||
189 | void clearSelection(); | 199 | void clearSelection(); |
190 | void jumpToDate (); | 200 | void jumpToDate (); |
191 | 201 | ||
192 | void editItem(QListViewItem *item); | 202 | void editItem(Q3ListViewItem *item); |
193 | void showItem(QListViewItem *item,const QPoint &,int); | 203 | void showItem(Q3ListViewItem *item,const QPoint &,int); |
194 | void popupMenu(QListViewItem *item,const QPoint &,int); | 204 | void popupMenu(Q3ListViewItem *item,const QPoint &,int); |
195 | void newTodo(); | 205 | void newTodo(); |
196 | void newSubTodo(); | 206 | void newSubTodo(); |
197 | void unparentTodo(); | 207 | void unparentTodo(); |
198 | void reparentTodo(); | 208 | void reparentTodo(); |
199 | void showTodo(); | 209 | void showTodo(); |
200 | void editTodo(); | 210 | void editTodo(); |
@@ -216,16 +226,16 @@ class KOTodoView : public KOrg::BaseView | |||
216 | void purgeCompleted(); | 226 | void purgeCompleted(); |
217 | void toggleCompleted(); | 227 | void toggleCompleted(); |
218 | void toggleRunning(); | 228 | void toggleRunning(); |
219 | void toggleQuickTodo(); | 229 | void toggleQuickTodo(); |
220 | void updateTodo( Todo *, int ); | 230 | void updateTodo( Todo *, int ); |
221 | 231 | ||
222 | void itemClicked(QListViewItem *); | 232 | void itemClicked(Q3ListViewItem *); |
223 | void itemStateChanged(QListViewItem *); | 233 | void itemStateChanged(Q3ListViewItem *); |
224 | void modified(bool); | 234 | void modified(bool); |
225 | void itemDoubleClicked(QListViewItem *item); | 235 | void itemDoubleClicked(Q3ListViewItem *item); |
226 | void resetFocusToList(); | 236 | void resetFocusToList(); |
227 | void fillCategories (); | 237 | void fillCategories (); |
228 | void fillCal (); | 238 | void fillCal (); |
229 | void changedCal (int); | 239 | void changedCal (int); |
230 | 240 | ||
231 | signals: | 241 | signals: |
@@ -270,24 +280,24 @@ class KOTodoView : public KOrg::BaseView | |||
270 | KOTodoViewWhatsThis* mKOTodoViewWhatsThis; | 280 | KOTodoViewWhatsThis* mKOTodoViewWhatsThis; |
271 | friend class KOTodoListView; | 281 | friend class KOTodoListView; |
272 | void paintEvent(QPaintEvent * pevent); | 282 | void paintEvent(QPaintEvent * pevent); |
273 | bool mPendingUpdateBeforeRepaint; | 283 | bool mPendingUpdateBeforeRepaint; |
274 | friend class KOTodoViewItem; | 284 | friend class KOTodoViewItem; |
275 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); | 285 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); |
276 | void restoreItemState( QListViewItem * ); | 286 | void restoreItemState( Q3ListViewItem * ); |
277 | 287 | ||
278 | bool checkTodo( Todo * ); | 288 | bool checkTodo( Todo * ); |
279 | bool isFlatDisplay; | 289 | bool isFlatDisplay; |
280 | void setOpen( QListViewItem*, bool setOpen); | 290 | void setOpen( Q3ListViewItem*, bool setOpen); |
281 | KOTodoListView *mTodoListView; | 291 | KOTodoListView *mTodoListView; |
282 | QPopupMenu *mItemPopupMenu; | 292 | Q3PopupMenu *mItemPopupMenu; |
283 | QPopupMenu *mPopupMenu; | 293 | Q3PopupMenu *mPopupMenu; |
284 | QPopupMenu *mPriorityPopupMenu; | 294 | Q3PopupMenu *mPriorityPopupMenu; |
285 | QPopupMenu *mPercentageCompletedPopupMenu; | 295 | Q3PopupMenu *mPercentageCompletedPopupMenu; |
286 | QPopupMenu *mCategoryPopupMenu; | 296 | Q3PopupMenu *mCategoryPopupMenu; |
287 | QPopupMenu *mCalPopupMenu; | 297 | Q3PopupMenu *mCalPopupMenu; |
288 | 298 | ||
289 | QMap<int, int> mPercentage; | 299 | QMap<int, int> mPercentage; |
290 | QMap<int, int> mPriority; | 300 | QMap<int, int> mPriority; |
291 | QMap<int, QString> mCategory; | 301 | QMap<int, QString> mCategory; |
292 | KOTodoViewItem *mActiveItem; | 302 | KOTodoViewItem *mActiveItem; |
293 | 303 | ||
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 519bb16..c21816d 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -16,28 +16,32 @@ | |||
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <klocale.h> | 20 | #include <klocale.h> |
21 | #include <kdebug.h> | 21 | #include <kdebug.h> |
22 | #include <qapp.h> | 22 | #include <qapplication.h> |
23 | #include <QDesktopWidget> | ||
24 | //Added by qt3to4: | ||
25 | #include <Q3PointArray> | ||
26 | #include <QPixmap> | ||
23 | #include <kglobal.h> | 27 | #include <kglobal.h> |
24 | 28 | ||
25 | #include <kiconloader.h> | 29 | #include <kiconloader.h> |
26 | #include "kotodoviewitem.h" | 30 | #include "kotodoviewitem.h" |
27 | #include "kotodoview.h" | 31 | #include "kotodoview.h" |
28 | #include "koprefs.h" | 32 | #include "koprefs.h" |
29 | 33 | ||
30 | KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) | 34 | KOTodoViewItem::KOTodoViewItem( Q3ListView *parent, Todo *todo, KOTodoView *kotodo) |
31 | : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) | 35 | : Q3CheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) |
32 | { | 36 | { |
33 | construct(); | 37 | construct(); |
34 | } | 38 | } |
35 | 39 | ||
36 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) | 40 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) |
37 | : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) | 41 | : Q3CheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) |
38 | { | 42 | { |
39 | construct(); | 43 | construct(); |
40 | } | 44 | } |
41 | 45 | ||
42 | QString KOTodoViewItem::key(int column,bool) const | 46 | QString KOTodoViewItem::key(int column,bool) const |
43 | { | 47 | { |
@@ -77,13 +81,13 @@ void KOTodoViewItem::setSortKey(int column,const QString &key) | |||
77 | } | 81 | } |
78 | 82 | ||
79 | #if QT_VERSION >= 0x030000 | 83 | #if QT_VERSION >= 0x030000 |
80 | void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, | 84 | void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, |
81 | int y,int h) | 85 | int y,int h) |
82 | { | 86 | { |
83 | QListViewItem::paintBranches(p,cg,w,y,h); | 87 | Q3ListViewItem::paintBranches(p,cg,w,y,h); |
84 | } | 88 | } |
85 | #else | 89 | #else |
86 | #endif | 90 | #endif |
87 | 91 | ||
88 | void KOTodoViewItem::construct() | 92 | void KOTodoViewItem::construct() |
89 | { | 93 | { |
@@ -313,22 +317,22 @@ void KOTodoViewItem::stateChange(bool state) | |||
313 | } | 317 | } |
314 | else { | 318 | else { |
315 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); | 319 | if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); |
316 | else setSortKey(2,QString::number(99)); | 320 | else setSortKey(2,QString::number(99)); |
317 | } | 321 | } |
318 | if ( state ) { | 322 | if ( state ) { |
319 | QListViewItem * myChild = firstChild(); | 323 | Q3ListViewItem * myChild = firstChild(); |
320 | KOTodoViewItem *item; | 324 | KOTodoViewItem *item; |
321 | while( myChild ) { | 325 | while( myChild ) { |
322 | //qDebug("stateCH "); | 326 | //qDebug("stateCH "); |
323 | item = static_cast<KOTodoViewItem*>(myChild); | 327 | item = static_cast<KOTodoViewItem*>(myChild); |
324 | item->stateChange(state); | 328 | item->stateChange(state); |
325 | myChild = myChild->nextSibling(); | 329 | myChild = myChild->nextSibling(); |
326 | } | 330 | } |
327 | } else { | 331 | } else { |
328 | QListViewItem * myChild = parent(); | 332 | Q3ListViewItem * myChild = parent(); |
329 | if ( myChild ) | 333 | if ( myChild ) |
330 | (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); | 334 | (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); |
331 | } | 335 | } |
332 | mTodoView->modified(true); | 336 | mTodoView->modified(true); |
333 | setMyPixmap(); | 337 | setMyPixmap(); |
334 | mTodoView->setTodoModified( mTodo ); | 338 | mTodoView->setTodoModified( mTodo ); |
@@ -380,18 +384,18 @@ bool KOTodoViewItem::isAlternate() | |||
380 | m_odd = above ? !above->m_odd : false; | 384 | m_odd = above ? !above->m_odd : false; |
381 | } | 385 | } |
382 | else | 386 | else |
383 | { | 387 | { |
384 | KOTodoViewItem *item; | 388 | KOTodoViewItem *item; |
385 | bool previous = true; | 389 | bool previous = true; |
386 | if (QListViewItem::parent()) | 390 | if (Q3ListViewItem::parent()) |
387 | { | 391 | { |
388 | item = static_cast<KOTodoViewItem *>(QListViewItem::parent()); | 392 | item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent()); |
389 | if (item) | 393 | if (item) |
390 | previous = item->m_odd; | 394 | previous = item->m_odd; |
391 | item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); | 395 | item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent()->firstChild()); |
392 | } | 396 | } |
393 | else | 397 | else |
394 | { | 398 | { |
395 | KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); | 399 | KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); |
396 | item = static_cast<KOTodoViewItem *>(lv->firstChild()); | 400 | item = static_cast<KOTodoViewItem *>(lv->firstChild()); |
397 | } | 401 | } |
@@ -473,36 +477,36 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
473 | 477 | ||
474 | p->fillRect( 0, 0, width, height(), _cg.base() ); // background | 478 | p->fillRect( 0, 0, width, height(), _cg.base() ); // background |
475 | // p->setPen(Qt::black ); //border | 479 | // p->setPen(Qt::black ); //border |
476 | // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling | 480 | // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling |
477 | QColor fc = KOPrefs::instance()->mHighlightColor; | 481 | QColor fc = KOPrefs::instance()->mHighlightColor; |
478 | if ( mTodo->percentComplete() == 100 ) | 482 | if ( mTodo->percentComplete() == 100 ) |
479 | fc = darkGreen; | 483 | fc = Qt::darkGreen; |
480 | p->drawRect( 2, 2, width-4, height()-4); | 484 | p->drawRect( 2, 2, width-4, height()-4); |
481 | p->fillRect( 3, 3, progress, height()-6, | 485 | p->fillRect( 3, 3, progress, height()-6, |
482 | fc ); | 486 | fc ); |
483 | p->restore(); | 487 | p->restore(); |
484 | } else { | 488 | } else { |
485 | QCheckListItem::paintCell(p, _cg, column, width, alignment); | 489 | Q3CheckListItem::paintCell(p, _cg, column, width, alignment); |
486 | } | 490 | } |
487 | return; | 491 | return; |
488 | } | 492 | } |
489 | 493 | ||
490 | int align = alignment; | 494 | int align = alignment; |
491 | 495 | ||
492 | if ( !p ) | 496 | if ( !p ) |
493 | return; | 497 | return; |
494 | 498 | ||
495 | p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); | 499 | p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); |
496 | 500 | ||
497 | QListView *lv = listView(); | 501 | Q3ListView *lv = listView(); |
498 | if ( !lv ) | 502 | if ( !lv ) |
499 | return; | 503 | return; |
500 | int marg = 2;//lv->itemMargin(); | 504 | int marg = 2;//lv->itemMargin(); |
501 | int r = 0; | 505 | int r = 0; |
502 | QCheckListItem::Type myType = QCheckListItem::CheckBox; | 506 | Q3CheckListItem::Type myType = Q3CheckListItem::CheckBox; |
503 | int BoxSize = 20; | 507 | int BoxSize = 20; |
504 | int boxOffset = 2; | 508 | int boxOffset = 2; |
505 | int xOffset = 2; | 509 | int xOffset = 2; |
506 | if (qApp->desktop()->width() < 300 ) { | 510 | if (qApp->desktop()->width() < 300 ) { |
507 | BoxSize = 14; | 511 | BoxSize = 14; |
508 | boxOffset = -1; | 512 | boxOffset = -1; |
@@ -519,13 +523,13 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
519 | 523 | ||
520 | int lineStart = 5; | 524 | int lineStart = 5; |
521 | if ( myType == Controller ) { | 525 | if ( myType == Controller ) { |
522 | if ( !pixmap( 0 ) ) | 526 | if ( !pixmap( 0 ) ) |
523 | r += BoxSize + 4; | 527 | r += BoxSize + 4; |
524 | } else { | 528 | } else { |
525 | ASSERT( lv ); //### | 529 | Q_ASSERT( lv ); //### |
526 | //QFontMetrics fm( lv->font() ); | 530 | //QFontMetrics fm( lv->font() ); |
527 | //int d = fm.height(); | 531 | //int d = fm.height(); |
528 | int x = 0; | 532 | int x = 0; |
529 | int y = (height() - BoxSize) / 2; | 533 | int y = (height() - BoxSize) / 2; |
530 | //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) ); | 534 | //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) ); |
531 | if ( myType == CheckBox ) { | 535 | if ( myType == CheckBox ) { |
@@ -536,13 +540,13 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
536 | p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); | 540 | p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); |
537 | lineStart = x+marg; | 541 | lineStart = x+marg; |
538 | ///////////////////// | 542 | ///////////////////// |
539 | x++; | 543 | x++; |
540 | y++; | 544 | y++; |
541 | if ( isOn() ) { | 545 | if ( isOn() ) { |
542 | QPointArray a( 7*2 ); | 546 | Q3PointArray a( 7*2 ); |
543 | int i, xx, yy; | 547 | int i, xx, yy; |
544 | xx = x+xOffset+marg+(boxOffset/2); | 548 | xx = x+xOffset+marg+(boxOffset/2); |
545 | yy = y+5+boxOffset; | 549 | yy = y+5+boxOffset; |
546 | for ( i=0; i<3; i++ ) { | 550 | for ( i=0; i<3; i++ ) { |
547 | a.setPoint( 2*i, xx, yy ); | 551 | a.setPoint( 2*i, xx, yy ); |
548 | a.setPoint( 2*i+1, xx, yy+2 ); | 552 | a.setPoint( 2*i+1, xx, yy+2 ); |
@@ -552,25 +556,25 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
552 | yy -= 2; | 556 | yy -= 2; |
553 | for ( i=3; i<7; i++ ) { | 557 | for ( i=3; i<7; i++ ) { |
554 | a.setPoint( 2*i, xx, yy ); | 558 | a.setPoint( 2*i, xx, yy ); |
555 | a.setPoint( 2*i+1, xx, yy+2 ); | 559 | a.setPoint( 2*i+1, xx, yy+2 ); |
556 | xx++; yy--; | 560 | xx++; yy--; |
557 | } | 561 | } |
558 | p->setPen( darkGreen ); | 562 | p->setPen( Qt::darkGreen ); |
559 | p->drawLineSegments( a ); | 563 | p->drawLineSegments( a ); |
560 | } | 564 | } |
561 | //////////////////////// | 565 | //////////////////////// |
562 | } | 566 | } |
563 | r += BoxSize + 4; | 567 | r += BoxSize + 4; |
564 | } | 568 | } |
565 | 569 | ||
566 | p->translate( r, 0 ); | 570 | p->translate( r, 0 ); |
567 | p->setPen( QPen( _cg.text() ) ); | 571 | p->setPen( QPen( _cg.text() ) ); |
568 | QListViewItem::paintCell( p, _cg, column, width - r, align ); | 572 | Q3ListViewItem::paintCell( p, _cg, column, width - r, align ); |
569 | if ( mTodo->cancelled () ) { | 573 | if ( mTodo->cancelled () ) { |
570 | p->setPen( black ); | 574 | p->setPen( Qt::black ); |
571 | QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); | 575 | QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); |
572 | int wid = br.width() +lineStart; | 576 | int wid = br.width() +lineStart; |
573 | if ( wid > width-3 ) | 577 | if ( wid > width-3 ) |
574 | wid = width-3; | 578 | wid = width-3; |
575 | p->drawLine( lineStart, height()/2+1, wid, height()/2+1 ); | 579 | p->drawLine( lineStart, height()/2+1, wid, height()/2+1 ); |
576 | 580 | ||
diff --git a/korganizer/kotodoviewitem.h b/korganizer/kotodoviewitem.h index bd024c8..62a635c 100644 --- a/korganizer/kotodoviewitem.h +++ b/korganizer/kotodoviewitem.h | |||
@@ -19,19 +19,19 @@ | |||
19 | #ifndef KOTODOVIEWITEM_H | 19 | #ifndef KOTODOVIEWITEM_H |
20 | #define KOTODOVIEWITEM_H | 20 | #define KOTODOVIEWITEM_H |
21 | 21 | ||
22 | #include <qfont.h> | 22 | #include <qfont.h> |
23 | #include <qfontmetrics.h> | 23 | #include <qfontmetrics.h> |
24 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
25 | #include <qptrlist.h> | 25 | #include <q3ptrlist.h> |
26 | #include <qstrlist.h> | 26 | #include <q3strlist.h> |
27 | #include <qlistbox.h> | 27 | #include <q3listbox.h> |
28 | #include <qpopupmenu.h> | 28 | #include <q3popupmenu.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qmap.h> | 30 | #include <qmap.h> |
31 | #include <qlistview.h> | 31 | #include <q3listview.h> |
32 | #include <qpainter.h> | 32 | #include <qpainter.h> |
33 | 33 | ||
34 | #include <libkcal/calendar.h> | 34 | #include <libkcal/calendar.h> |
35 | #include <libkcal/todo.h> | 35 | #include <libkcal/todo.h> |
36 | 36 | ||
37 | using namespace KCal; | 37 | using namespace KCal; |
@@ -42,22 +42,22 @@ class KOTodoView; | |||
42 | This class provides a way of displaying a single Event of Todo-Type in a | 42 | This class provides a way of displaying a single Event of Todo-Type in a |
43 | KTodoView. | 43 | KTodoView. |
44 | 44 | ||
45 | @author Cornelius Schumacher <schumacher@kde.org> | 45 | @author Cornelius Schumacher <schumacher@kde.org> |
46 | @see KOTodoView | 46 | @see KOTodoView |
47 | */ | 47 | */ |
48 | class KOTodoViewItem : public QCheckListItem | 48 | class KOTodoViewItem : public Q3CheckListItem |
49 | { | 49 | { |
50 | public: | 50 | public: |
51 | /** | 51 | /** |
52 | Constructor. | 52 | Constructor. |
53 | 53 | ||
54 | @param parent is the list view to which this item belongs. | 54 | @param parent is the list view to which this item belongs. |
55 | @param ev is the event to have the item display information for. | 55 | @param ev is the event to have the item display information for. |
56 | */ | 56 | */ |
57 | KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo); | 57 | KOTodoViewItem(Q3ListView *parent, Todo *todo, KOTodoView *kotodo); |
58 | KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); | 58 | KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); |
59 | //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );} | 59 | //~KOTodoViewItem() { qDebug("~KOTodoViewItem() %s ", text(0).latin1() );} |
60 | 60 | ||
61 | void construct(); | 61 | void construct(); |
62 | 62 | ||
63 | Todo *todo() { return mTodo; } | 63 | Todo *todo() { return mTodo; } |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 4057ae0..07c4295 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -20,13 +20,15 @@ | |||
20 | 20 | ||
21 | As a special exception, permission is given to link this program | 21 | As a special exception, permission is given to link this program |
22 | with any edition of Qt, and distribute the resulting executable, | 22 | with any edition of Qt, and distribute the resulting executable, |
23 | without including the source code for Qt in the source distribution. | 23 | without including the source code for Qt in the source distribution. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <qwidgetstack.h> | 26 | #include <q3widgetstack.h> |
27 | //Added by qt3to4: | ||
28 | #include <Q3PtrList> | ||
27 | 29 | ||
28 | #include <kconfig.h> | 30 | #include <kconfig.h> |
29 | #include <kglobal.h> | 31 | #include <kglobal.h> |
30 | #ifndef DESKTOP_VERSION | 32 | #ifndef DESKTOP_VERSION |
31 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
32 | #else | 34 | #else |
@@ -454,14 +456,14 @@ void KOViewManager::showListView() | |||
454 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 456 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
455 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 457 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
456 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 458 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
457 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 459 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
458 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 460 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
459 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 461 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
460 | connect( mListView, SIGNAL( beamIncidenceList( QPtrList<Incidence> ) ), | 462 | connect( mListView, SIGNAL( beamIncidenceList( Q3PtrList<Incidence> ) ), |
461 | mMainView, SLOT ( beamIncidenceList( QPtrList<Incidence> ) ) ); | 463 | mMainView, SLOT ( beamIncidenceList( Q3PtrList<Incidence> ) ) ); |
462 | } | 464 | } |
463 | // bool temp = mFlagShowNextxDays; | 465 | // bool temp = mFlagShowNextxDays; |
464 | //globalFlagBlockPainting = true; | 466 | //globalFlagBlockPainting = true; |
465 | globalFlagBlockAgenda = 1; | 467 | globalFlagBlockAgenda = 1; |
466 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 468 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
467 | mMainView->setBlockShowDates( true ); | 469 | mMainView->setBlockShowDates( true ); |
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index f88403c..bfe930f 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -15,20 +15,26 @@ | |||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlayout.h> | 20 | #include <qlayout.h> |
21 | #include <qtextbrowser.h> | 21 | #include <q3textbrowser.h> |
22 | #include <qtextcodec.h> | 22 | #include <qtextcodec.h> |
23 | #include <qfileinfo.h> | 23 | #include <qfileinfo.h> |
24 | #include <qlabel.h> | 24 | #include <qlabel.h> |
25 | 25 | ||
26 | #include <qapplication.h> | 26 | #include <qapplication.h> |
27 | #include <QDesktopWidget> | ||
27 | #ifdef DESKTOP_VERSION | 28 | #ifdef DESKTOP_VERSION |
28 | #include <qpaintdevicemetrics.h> | 29 | #include <q3paintdevicemetrics.h> |
30 | //Added by qt3to4: | ||
31 | #include <Q3PtrList> | ||
32 | #include <QHideEvent> | ||
33 | #include <Q3VBoxLayout> | ||
34 | #include <QShowEvent> | ||
29 | #endif | 35 | #endif |
30 | #include <kglobal.h> | 36 | #include <kglobal.h> |
31 | #include <klocale.h> | 37 | #include <klocale.h> |
32 | #include <kdebug.h> | 38 | #include <kdebug.h> |
33 | #include <kiconloader.h> | 39 | #include <kiconloader.h> |
34 | #include <kmessagebox.h> | 40 | #include <kmessagebox.h> |
@@ -39,13 +45,13 @@ | |||
39 | #include "calprinter.h" | 45 | #include "calprinter.h" |
40 | #endif | 46 | #endif |
41 | #include "koglobals.h" | 47 | #include "koglobals.h" |
42 | #include "koprefs.h" | 48 | #include "koprefs.h" |
43 | #include "koeventviewerdialog.h" | 49 | #include "koeventviewerdialog.h" |
44 | #include "koeventviewer.h" | 50 | #include "koeventviewer.h" |
45 | #include <qstylesheet.h> | 51 | #include <q3stylesheet.h> |
46 | #include "kowhatsnextview.h" | 52 | #include "kowhatsnextview.h" |
47 | using namespace KOrg; | 53 | using namespace KOrg; |
48 | 54 | ||
49 | void WhatsNextTextBrowser::setSource(const QString& n) | 55 | void WhatsNextTextBrowser::setSource(const QString& n) |
50 | { | 56 | { |
51 | 57 | ||
@@ -53,13 +59,13 @@ void WhatsNextTextBrowser::setSource(const QString& n) | |||
53 | emit showIncidence(n); | 59 | emit showIncidence(n); |
54 | return; | 60 | return; |
55 | } else if (n.startsWith("todo:")) { | 61 | } else if (n.startsWith("todo:")) { |
56 | emit showIncidence(n); | 62 | emit showIncidence(n); |
57 | return; | 63 | return; |
58 | } else { | 64 | } else { |
59 | QTextBrowser::setSource(n); | 65 | Q3TextBrowser::setSource(n); |
60 | } | 66 | } |
61 | } | 67 | } |
62 | void WhatsNextTextBrowser::printMe() | 68 | void WhatsNextTextBrowser::printMe() |
63 | { | 69 | { |
64 | #ifdef DESKTOP_VERSION | 70 | #ifdef DESKTOP_VERSION |
65 | KOPrintPrefs pp ( this ); | 71 | KOPrintPrefs pp ( this ); |
@@ -69,13 +75,13 @@ void WhatsNextTextBrowser::printMe() | |||
69 | 75 | ||
70 | QPrinter printer; | 76 | QPrinter printer; |
71 | if (!printer.setup() ) | 77 | if (!printer.setup() ) |
72 | return; | 78 | return; |
73 | QPainter p; | 79 | QPainter p; |
74 | p.begin ( &printer ); | 80 | p.begin ( &printer ); |
75 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | 81 | Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer ); |
76 | float dx, dy; | 82 | float dx, dy; |
77 | int wid = (m.width() * 9)/10; | 83 | int wid = (m.width() * 9)/10; |
78 | dx = (float) wid/(float)contentsWidth (); | 84 | dx = (float) wid/(float)contentsWidth (); |
79 | dy = (float)(m.height()) / (float)contentsHeight (); | 85 | dy = (float)(m.height()) / (float)contentsHeight (); |
80 | float scale; | 86 | float scale; |
81 | // scale to fit the width or height of the paper | 87 | // scale to fit the width or height of the paper |
@@ -100,25 +106,25 @@ KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, | |||
100 | // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); | 106 | // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); |
101 | // mDateLabel->setMargin(2); | 107 | // mDateLabel->setMargin(2); |
102 | // mDateLabel->setAlignment(AlignCenter); | 108 | // mDateLabel->setAlignment(AlignCenter); |
103 | setFont( KOPrefs::instance()->mWhatsNextFont ); | 109 | setFont( KOPrefs::instance()->mWhatsNextFont ); |
104 | mView = new WhatsNextTextBrowser(this); | 110 | mView = new WhatsNextTextBrowser(this); |
105 | connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); | 111 | connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); |
106 | QStyleSheet* stsh = mView->styleSheet(); | 112 | Q3StyleSheet* stsh = mView->styleSheet(); |
107 | QStyleSheetItem * style ; | 113 | Q3StyleSheetItem * style ; |
108 | style = stsh->item ("h2" ); | 114 | style = stsh->item ("h2" ); |
109 | if ( style ) { | 115 | if ( style ) { |
110 | style->setMargin(QStyleSheetItem::MarginAll,0); | 116 | style->setMargin(Q3StyleSheetItem::MarginAll,0); |
111 | } | 117 | } |
112 | style = stsh->item ("h3" ); | 118 | style = stsh->item ("h3" ); |
113 | if ( style ) { | 119 | if ( style ) { |
114 | style->setMargin(QStyleSheetItem::MarginAll,0); | 120 | style->setMargin(Q3StyleSheetItem::MarginAll,0); |
115 | } | 121 | } |
116 | mEventViewer = 0; | 122 | mEventViewer = 0; |
117 | 123 | ||
118 | QBoxLayout *topLayout = new QVBoxLayout(this); | 124 | Q3BoxLayout *topLayout = new Q3VBoxLayout(this); |
119 | // topLayout->addWidget(mDateLabel); | 125 | // topLayout->addWidget(mDateLabel); |
120 | topLayout->addWidget(mView); | 126 | topLayout->addWidget(mView); |
121 | mTimer = new QTimer( this ); | 127 | mTimer = new QTimer( this ); |
122 | connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); | 128 | connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); |
123 | 129 | ||
124 | connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); | 130 | connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); |
@@ -141,15 +147,15 @@ int KOWhatsNextView::currentDateCount() | |||
141 | 147 | ||
142 | void KOWhatsNextView::clearList() | 148 | void KOWhatsNextView::clearList() |
143 | { | 149 | { |
144 | mTimer->stop(); | 150 | mTimer->stop(); |
145 | mView->setText(" "); | 151 | mView->setText(" "); |
146 | } | 152 | } |
147 | QPtrList<Incidence> KOWhatsNextView::selectedIncidences() | 153 | Q3PtrList<Incidence> KOWhatsNextView::selectedIncidences() |
148 | { | 154 | { |
149 | QPtrList<Incidence> eventList; | 155 | Q3PtrList<Incidence> eventList; |
150 | 156 | ||
151 | return eventList; | 157 | return eventList; |
152 | } | 158 | } |
153 | 159 | ||
154 | void KOWhatsNextView::printMe() | 160 | void KOWhatsNextView::printMe() |
155 | { | 161 | { |
@@ -216,14 +222,14 @@ void KOWhatsNextView::updateView() | |||
216 | #else | 222 | #else |
217 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; | 223 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; |
218 | #endif | 224 | #endif |
219 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; | 225 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; |
220 | int iii; | 226 | int iii; |
221 | mTodos.clear(); | 227 | mTodos.clear(); |
222 | QPtrList<Event> events; | 228 | Q3PtrList<Event> events; |
223 | QPtrList<Todo> todos = calendar()->todos(); | 229 | Q3PtrList<Todo> todos = calendar()->todos(); |
224 | Todo * todo; | 230 | Todo * todo; |
225 | //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; | 231 | //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; |
226 | int daysToShow = KOPrefs::instance()->mWhatsNextDays ; | 232 | int daysToShow = KOPrefs::instance()->mWhatsNextDays ; |
227 | bool itemAdded = false; | 233 | bool itemAdded = false; |
228 | for ( iii = 0; iii < daysToShow; ++iii ) { | 234 | for ( iii = 0; iii < daysToShow; ++iii ) { |
229 | QString date; | 235 | QString date; |
@@ -451,13 +457,13 @@ void KOWhatsNextView::appendDay( int i, QDate eventDate ) | |||
451 | 457 | ||
452 | void KOWhatsNextView::showDates(const QDate &, const QDate &) | 458 | void KOWhatsNextView::showDates(const QDate &, const QDate &) |
453 | { | 459 | { |
454 | updateView(); | 460 | updateView(); |
455 | } | 461 | } |
456 | 462 | ||
457 | void KOWhatsNextView::showEvents(QPtrList<Event>) | 463 | void KOWhatsNextView::showEvents(Q3PtrList<Event>) |
458 | { | 464 | { |
459 | } | 465 | } |
460 | 466 | ||
461 | void KOWhatsNextView::changeEventDisplay(Event *, int action) | 467 | void KOWhatsNextView::changeEventDisplay(Event *, int action) |
462 | { | 468 | { |
463 | switch(action) { | 469 | switch(action) { |
@@ -738,13 +744,13 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) | |||
738 | mText += "</p>\n"; | 744 | mText += "</p>\n"; |
739 | } | 745 | } |
740 | else { | 746 | else { |
741 | ind += "-"; | 747 | ind += "-"; |
742 | mText += "</li>\n"; | 748 | mText += "</li>\n"; |
743 | } | 749 | } |
744 | QPtrList<Incidence> Relations = ev->relations(); | 750 | Q3PtrList<Incidence> Relations = ev->relations(); |
745 | Incidence *to; | 751 | Incidence *to; |
746 | for (to=Relations.first();to;to=Relations.next()) { | 752 | for (to=Relations.first();to;to=Relations.next()) { |
747 | if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio ) | 753 | if (!((Todo*)to)->isCompleted() && ((Todo*)to)->priority() <= mCurrentMaxPrio ) |
748 | appendTodo( to, ind , true ); | 754 | appendTodo( to, ind , true ); |
749 | } | 755 | } |
750 | 756 | ||
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h index 93574ef..49fc448 100644 --- a/korganizer/kowhatsnextview.h +++ b/korganizer/kowhatsnextview.h | |||
@@ -16,28 +16,34 @@ | |||
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | #ifndef KOWHATSNEXTVIEW_H | 19 | #ifndef KOWHATSNEXTVIEW_H |
20 | #define KOWHATSNEXTVIEW_H | 20 | #define KOWHATSNEXTVIEW_H |
21 | 21 | ||
22 | #include <qtextbrowser.h> | 22 | #include <q3textbrowser.h> |
23 | #include <qtimer.h> | 23 | #include <qtimer.h> |
24 | //Added by qt3to4: | ||
25 | #include <QShowEvent> | ||
26 | #include <QHideEvent> | ||
27 | #include <QLabel> | ||
28 | #include <Q3ValueList> | ||
29 | #include <Q3PtrList> | ||
24 | 30 | ||
25 | #include <korganizer/baseview.h> | 31 | #include <korganizer/baseview.h> |
26 | 32 | ||
27 | class QListView; | 33 | class Q3ListView; |
28 | class QLabel; | 34 | class QLabel; |
29 | 35 | ||
30 | class KOEventViewerDialog; | 36 | class KOEventViewerDialog; |
31 | 37 | ||
32 | #include <qpainter.h> | 38 | #include <qpainter.h> |
33 | #include <qwidget.h> | 39 | #include <qwidget.h> |
34 | class WhatsNextTextBrowser : public QTextBrowser { | 40 | class WhatsNextTextBrowser : public Q3TextBrowser { |
35 | Q_OBJECT | 41 | Q_OBJECT |
36 | public: | 42 | public: |
37 | WhatsNextTextBrowser(QWidget *parent) : QTextBrowser(parent) {}; | 43 | WhatsNextTextBrowser(QWidget *parent) : Q3TextBrowser(parent) {}; |
38 | 44 | ||
39 | void setSource(const QString &); | 45 | void setSource(const QString &); |
40 | void printMe(); | 46 | void printMe(); |
41 | 47 | ||
42 | signals: | 48 | signals: |
43 | void showIncidence(const QString &uid); | 49 | void showIncidence(const QString &uid); |
@@ -55,25 +61,25 @@ class KOWhatsNextView : public KOrg::BaseView | |||
55 | const char *name = 0); | 61 | const char *name = 0); |
56 | ~KOWhatsNextView(); | 62 | ~KOWhatsNextView(); |
57 | 63 | ||
58 | virtual int maxDatesHint(); | 64 | virtual int maxDatesHint(); |
59 | virtual int currentDateCount(); | 65 | virtual int currentDateCount(); |
60 | void setEventViewer(KOEventViewerDialog* v ); | 66 | void setEventViewer(KOEventViewerDialog* v ); |
61 | virtual QPtrList<Incidence> selectedIncidences(); | 67 | virtual Q3PtrList<Incidence> selectedIncidences(); |
62 | void clearList(); | 68 | void clearList(); |
63 | DateList selectedDates() | 69 | DateList selectedDates() |
64 | {DateList q; | 70 | {DateList q; |
65 | return q;} | 71 | return q;} |
66 | virtual void printPreview(CalPrinter *calPrinter, | 72 | virtual void printPreview(CalPrinter *calPrinter, |
67 | const QDate &, const QDate &); | 73 | const QDate &, const QDate &); |
68 | 74 | ||
69 | public slots: | 75 | public slots: |
70 | virtual void updateView(); | 76 | virtual void updateView(); |
71 | void printMe(); | 77 | void printMe(); |
72 | virtual void showDates(const QDate &start, const QDate &end); | 78 | virtual void showDates(const QDate &start, const QDate &end); |
73 | virtual void showEvents(QPtrList<Event> eventList); | 79 | virtual void showEvents(Q3PtrList<Event> eventList); |
74 | void updateConfig(); | 80 | void updateConfig(); |
75 | void changeEventDisplay(Event *, int); | 81 | void changeEventDisplay(Event *, int); |
76 | 82 | ||
77 | protected: | 83 | protected: |
78 | bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false); | 84 | bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false); |
79 | bool appendTodo(Incidence *, QString ind = "", bool isSub = false ); | 85 | bool appendTodo(Incidence *, QString ind = "", bool isSub = false ); |
@@ -93,10 +99,10 @@ class KOWhatsNextView : public KOrg::BaseView | |||
93 | QTimer* mTimer; | 99 | QTimer* mTimer; |
94 | WhatsNextTextBrowser *mView; | 100 | WhatsNextTextBrowser *mView; |
95 | QString mText; | 101 | QString mText; |
96 | // QLabel *mDateLabel; | 102 | // QLabel *mDateLabel; |
97 | KOEventViewerDialog *mEventViewer; | 103 | KOEventViewerDialog *mEventViewer; |
98 | 104 | ||
99 | QValueList<Incidence *> mTodos; | 105 | Q3ValueList<Incidence *> mTodos; |
100 | }; | 106 | }; |
101 | 107 | ||
102 | #endif | 108 | #endif |
diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp index df9b2fc..e2ae4a6 100644 --- a/korganizer/ktimeedit.cpp +++ b/korganizer/ktimeedit.cpp | |||
@@ -18,18 +18,21 @@ | |||
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qkeycode.h> | 24 | #include <qnamespace.h> |
25 | #include <qcombobox.h> | 25 | #include <qcombobox.h> |
26 | #include <qdatetime.h> | 26 | #include <qdatetime.h> |
27 | #include <qlineedit.h> | 27 | #include <qlineedit.h> |
28 | #include <qlistbox.h> | 28 | #include <q3listbox.h> |
29 | #include <qapplication.h> | 29 | #include <qapplication.h> |
30 | #include <QDesktopWidget> | ||
31 | //Added by qt3to4: | ||
32 | #include <QKeyEvent> | ||
30 | 33 | ||
31 | #include <kmessagebox.h> | 34 | #include <kmessagebox.h> |
32 | #include <kglobal.h> | 35 | #include <kglobal.h> |
33 | #include <kdebug.h> | 36 | #include <kdebug.h> |
34 | #include <klocale.h> | 37 | #include <klocale.h> |
35 | #include <kpimglobalprefs.h> | 38 | #include <kpimglobalprefs.h> |
@@ -42,13 +45,13 @@ | |||
42 | // Mostly locale aware. Author: David Faure <faure@kde.org> | 45 | // Mostly locale aware. Author: David Faure <faure@kde.org> |
43 | 46 | ||
44 | // KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox. | 47 | // KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox. |
45 | // Difficult to get all in one... | 48 | // Difficult to get all in one... |
46 | // But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help. | 49 | // But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help. |
47 | KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) | 50 | KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) |
48 | : QComboBox(TRUE, parent, name) | 51 | : Q3ComboBox(TRUE, parent, name) |
49 | { | 52 | { |
50 | setInsertionPolicy(NoInsertion); | 53 | setInsertionPolicy(NoInsertion); |
51 | mFlagKeyPressed = false; | 54 | mFlagKeyPressed = false; |
52 | if ( QApplication::desktop()->height() <= 480 ) { | 55 | if ( QApplication::desktop()->height() <= 480 ) { |
53 | setSizeLimit ( 6 ); | 56 | setSizeLimit ( 6 ); |
54 | } else { | 57 | } else { |
@@ -61,18 +64,18 @@ KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) | |||
61 | 64 | ||
62 | // Fill combo box with selection of times in localized format. | 65 | // Fill combo box with selection of times in localized format. |
63 | QTime timeEntry(0,0,0); | 66 | QTime timeEntry(0,0,0); |
64 | do { | 67 | do { |
65 | insertItem(KGlobal::locale()->formatTime(timeEntry)); | 68 | insertItem(KGlobal::locale()->formatTime(timeEntry)); |
66 | timeEntry = timeEntry.addSecs(60*15); | 69 | timeEntry = timeEntry.addSecs(60*15); |
67 | } while (!timeEntry.isNull()); | 70 | } while ( !( timeEntry.hour() || timeEntry.minute() ) ); |
68 | // Add end of day. | 71 | // Add end of day. |
69 | insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) ); | 72 | insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) ); |
70 | 73 | ||
71 | updateText(); | 74 | updateText(); |
72 | setFocusPolicy(QWidget::StrongFocus); | 75 | setFocusPolicy(Qt::StrongFocus); |
73 | 76 | ||
74 | connect(this, SIGNAL(activated(int)), this, SLOT(activ(int))); | 77 | connect(this, SIGNAL(activated(int)), this, SLOT(activ(int))); |
75 | connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int))); | 78 | connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int))); |
76 | connect(this,SIGNAL(textChanged(const QString&)),this,SLOT(changedText())); | 79 | connect(this,SIGNAL(textChanged(const QString&)),this,SLOT(changedText())); |
77 | QFontMetrics fm ( font() ); | 80 | QFontMetrics fm ( font() ); |
78 | QString timeString = "24:00"; | 81 | QString timeString = "24:00"; |
@@ -205,30 +208,30 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) | |||
205 | return; | 208 | return; |
206 | } | 209 | } |
207 | if (! e->isAutoRepeat() ) { | 210 | if (! e->isAutoRepeat() ) { |
208 | mFlagKeyPressed = true; | 211 | mFlagKeyPressed = true; |
209 | } | 212 | } |
210 | // Tap -> Focus Next Widget | 213 | // Tap -> Focus Next Widget |
211 | if ( e->key() == Key_Tab ) { | 214 | if ( e->key() == Qt::Key_Tab ) { |
212 | QComboBox::keyPressEvent(e); | 215 | Q3ComboBox::keyPressEvent(e); |
213 | return; | 216 | return; |
214 | } | 217 | } |
215 | 218 | ||
216 | // save Text from QLineEdit and CursorPosition | 219 | // save Text from QLineEdit and CursorPosition |
217 | QString text = lineEdit()->text(); | 220 | QString text = lineEdit()->text(); |
218 | int cpos = lineEdit()->cursorPosition(); | 221 | int cpos = lineEdit()->cursorPosition(); |
219 | // qDebug("cpos %d ", cpos); | 222 | // qDebug("cpos %d ", cpos); |
220 | 223 | ||
221 | // Switch for arrows, backspace and escape | 224 | // Switch for arrows, backspace and escape |
222 | switch(e->key()) { | 225 | switch(e->key()) { |
223 | case Key_Escape: | 226 | case Qt::Key_Escape: |
224 | lineEdit()->deselect(); | 227 | lineEdit()->deselect(); |
225 | case Key_Tab: | 228 | case Qt::Key_Tab: |
226 | QComboBox::keyPressEvent(e); | 229 | Q3ComboBox::keyPressEvent(e); |
227 | break; | 230 | break; |
228 | case Key_Up: | 231 | case Qt::Key_Up: |
229 | if ( e->state () == Qt::ControlButton ) { | 232 | if ( e->state () == Qt::ControlButton ) { |
230 | addTime(QTime(0,15,0), false ); | 233 | addTime(QTime(0,15,0), false ); |
231 | lineEdit()->setCursorPosition(3); | 234 | lineEdit()->setCursorPosition(3); |
232 | setSelect( 3 , 2 ); | 235 | setSelect( 3 , 2 ); |
233 | } | 236 | } |
234 | else | 237 | else |
@@ -264,13 +267,13 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) | |||
264 | case 0: | 267 | case 0: |
265 | addTime(QTime(1,0,0), false ); | 268 | addTime(QTime(1,0,0), false ); |
266 | setSelect ( 0, 2 ); | 269 | setSelect ( 0, 2 ); |
267 | break; | 270 | break; |
268 | } | 271 | } |
269 | break; | 272 | break; |
270 | case Key_Down: | 273 | case Qt::Key_Down: |
271 | if ( e->state () == Qt::ControlButton ) { | 274 | if ( e->state () == Qt::ControlButton ) { |
272 | subTime(QTime(0,15,0), false ); | 275 | subTime(QTime(0,15,0), false ); |
273 | lineEdit()->setCursorPosition(3); | 276 | lineEdit()->setCursorPosition(3); |
274 | setSelect( 3 , 2 ); | 277 | setSelect( 3 , 2 ); |
275 | } | 278 | } |
276 | else | 279 | else |
@@ -307,55 +310,55 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) | |||
307 | subTime(QTime(1,0,0), false ); | 310 | subTime(QTime(1,0,0), false ); |
308 | setSelect ( 0 , 2 ); | 311 | setSelect ( 0 , 2 ); |
309 | break; | 312 | break; |
310 | } | 313 | } |
311 | break; | 314 | break; |
312 | // set cursor to correct place | 315 | // set cursor to correct place |
313 | case Key_Left: | 316 | case Qt::Key_Left: |
314 | if ( cpos == 3 ) | 317 | if ( cpos == 3 ) |
315 | --cpos; | 318 | --cpos; |
316 | if ( cpos > 0) { | 319 | if ( cpos > 0) { |
317 | lineEdit()->setCursorPosition(--cpos); | 320 | lineEdit()->setCursorPosition(--cpos); |
318 | setSelect ( cpos , 1 ); | 321 | setSelect ( cpos , 1 ); |
319 | } | 322 | } |
320 | else | 323 | else |
321 | setSelect ( 0 , 1 ); | 324 | setSelect ( 0 , 1 ); |
322 | break; | 325 | break; |
323 | // set cursor to correct place | 326 | // set cursor to correct place |
324 | case Key_Right: | 327 | case Qt::Key_Right: |
325 | if ( cpos == 1 ) | 328 | if ( cpos == 1 ) |
326 | ++cpos; | 329 | ++cpos; |
327 | if ( cpos < maxpos ) { | 330 | if ( cpos < maxpos ) { |
328 | lineEdit()->setCursorPosition(++cpos); | 331 | lineEdit()->setCursorPosition(++cpos); |
329 | setSelect ( cpos , 1 ); | 332 | setSelect ( cpos , 1 ); |
330 | } | 333 | } |
331 | break; | 334 | break; |
332 | // rest | 335 | // rest |
333 | case Key_Prior: | 336 | case Qt::Key_Prior: |
334 | subTime(QTime(1,0,0)); | 337 | subTime(QTime(1,0,0)); |
335 | break; | 338 | break; |
336 | case Key_Next: | 339 | case Qt::Key_Next: |
337 | addTime(QTime(1,0,0)); | 340 | addTime(QTime(1,0,0)); |
338 | break; | 341 | break; |
339 | case Key_Backspace: | 342 | case Qt::Key_Backspace: |
340 | if ( cpos > 0) { | 343 | if ( cpos > 0) { |
341 | if ( cpos == 3 ) | 344 | if ( cpos == 3 ) |
342 | --cpos; | 345 | --cpos; |
343 | if ( cpos > 5) | 346 | if ( cpos > 5) |
344 | cpos = 5; | 347 | cpos = 5; |
345 | text.at( cpos-1 ) = '0'; | 348 | text[ cpos-1 ] = '0'; |
346 | lineEdit()->setText( text ); | 349 | lineEdit()->setText( text ); |
347 | lineEdit()->setCursorPosition(--cpos); | 350 | lineEdit()->setCursorPosition(--cpos); |
348 | setSelect ( cpos , 1 ); | 351 | setSelect ( cpos , 1 ); |
349 | changedText(); | 352 | changedText(); |
350 | } | 353 | } |
351 | break; | 354 | break; |
352 | } // switch arrows | 355 | } // switch arrows |
353 | 356 | ||
354 | // if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos | 357 | // if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos |
355 | if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Key_Left ) { | 358 | if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Qt::Key_Left ) { |
356 | lineEdit()->deselect(); | 359 | lineEdit()->deselect(); |
357 | cpos = 0; | 360 | cpos = 0; |
358 | lineEdit()->setCursorPosition(cpos); | 361 | lineEdit()->setCursorPosition(cpos); |
359 | setSelect(cpos , 1); | 362 | setSelect(cpos , 1); |
360 | } | 363 | } |
361 | 364 | ||
@@ -364,77 +367,77 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) | |||
364 | } | 367 | } |
365 | 368 | ||
366 | // num keys when cursorPos preEnd | 369 | // num keys when cursorPos preEnd |
367 | if ( cpos < 5 ) { | 370 | if ( cpos < 5 ) { |
368 | // switch another keys | 371 | // switch another keys |
369 | switch(e->key()) { | 372 | switch(e->key()) { |
370 | case Key_Delete: | 373 | case Qt::Key_Delete: |
371 | text.at( cpos ) = '0'; | 374 | text[ cpos ] = '0'; |
372 | lineEdit()->setText( text ); | 375 | lineEdit()->setText( text ); |
373 | lineEdit()->setCursorPosition(cpos); | 376 | lineEdit()->setCursorPosition(cpos); |
374 | setSelect ( cpos , 1 ); | 377 | setSelect ( cpos , 1 ); |
375 | changedText(); | 378 | changedText(); |
376 | break; | 379 | break; |
377 | case Key_9: | 380 | case Qt::Key_9: |
378 | case Key_8: | 381 | case Qt::Key_8: |
379 | case Key_7: | 382 | case Qt::Key_7: |
380 | case Key_6: | 383 | case Qt::Key_6: |
381 | if ( !(cpos == 1 || cpos == 4) ) | 384 | if ( !(cpos == 1 || cpos == 4) ) |
382 | return; | 385 | return; |
383 | if ( cpos == 1 && text.at( 0 ) > '1') | 386 | if ( cpos == 1 && text.at( 0 ) > '1') |
384 | text.at( 0 ) = '1'; | 387 | text[ 0 ] = '1'; |
385 | case Key_5: | 388 | case Qt::Key_5: |
386 | case Key_4: | 389 | case Qt::Key_4: |
387 | case Key_3: | 390 | case Qt::Key_3: |
388 | if ( cpos < 1 ) | 391 | if ( cpos < 1 ) |
389 | return; | 392 | return; |
390 | if ( hour12Format && cpos == 1 ) | 393 | if ( hour12Format && cpos == 1 ) |
391 | return; | 394 | return; |
392 | case Key_2: | 395 | case Qt::Key_2: |
393 | if ( hour12Format && cpos == 0 ) | 396 | if ( hour12Format && cpos == 0 ) |
394 | return; | 397 | return; |
395 | if ( cpos == 0 && text.at( 1 ) > '3') | 398 | if ( cpos == 0 && text.at( 1 ) > '3') |
396 | text.at( 1 ) = '3'; | 399 | text[ 1 ] = '3'; |
397 | case Key_1: | 400 | case Qt::Key_1: |
398 | case Key_0: | 401 | case Qt::Key_0: |
399 | if ( hour12Format ) { | 402 | if ( hour12Format ) { |
400 | if ( e->key() == Key_0 && cpos == 1 && text.at( 0 ) == '0' ) | 403 | if ( e->key() == Qt::Key_0 && cpos == 1 && text.at( 0 ) == '0' ) |
401 | return; | 404 | return; |
402 | if ( e->key() == Key_0 && cpos == 0 && text.at( 1 ) == '0' ) | 405 | if ( e->key() == Qt::Key_0 && cpos == 0 && text.at( 1 ) == '0' ) |
403 | text.at( 1 ) = '1'; | 406 | text[ 1 ] = '1'; |
404 | } | 407 | } |
405 | text.at( cpos ) = QChar ( e->key() ); | 408 | text[ cpos ] = QChar ( e->key() ); |
406 | lineEdit()->setText( text ); | 409 | lineEdit()->setText( text ); |
407 | if ( cpos == 1 ) | 410 | if ( cpos == 1 ) |
408 | ++cpos; | 411 | ++cpos; |
409 | if ( cpos < 5) | 412 | if ( cpos < 5) |
410 | lineEdit()->setCursorPosition(++cpos); | 413 | lineEdit()->setCursorPosition(++cpos); |
411 | setSelect( cpos , 1 ); | 414 | setSelect( cpos , 1 ); |
412 | changedText(); | 415 | changedText(); |
413 | break; | 416 | break; |
414 | case Key_Home: | 417 | case Qt::Key_Home: |
415 | lineEdit()->setCursorPosition(0); | 418 | lineEdit()->setCursorPosition(0); |
416 | setSelect( cpos , 1 ); | 419 | setSelect( cpos , 1 ); |
417 | break; | 420 | break; |
418 | case Key_End: | 421 | case Qt::Key_End: |
419 | lineEdit()->setCursorPosition(5); | 422 | lineEdit()->setCursorPosition(5); |
420 | lineEdit()->deselect(); | 423 | lineEdit()->deselect(); |
421 | break; | 424 | break; |
422 | default: | 425 | default: |
423 | // QComboBox::keyPressEvent(e); | 426 | // QComboBox::keyPressEvent(e); |
424 | break; | 427 | break; |
425 | } // switch num keys | 428 | } // switch num keys |
426 | } else if ( cpos == 5 ) {// if cpos < 5 | 429 | } else if ( cpos == 5 ) {// if cpos < 5 |
427 | if ( hour12Format ) { | 430 | if ( hour12Format ) { |
428 | if ( e->key() == Key_A ) { | 431 | if ( e->key() == Qt::Key_A ) { |
429 | text.at( 5 ) = 'a'; | 432 | text[ 5 ] = 'a'; |
430 | lineEdit()->setText( text ); | 433 | lineEdit()->setText( text ); |
431 | lineEdit()->setCursorPosition(5); | 434 | lineEdit()->setCursorPosition(5); |
432 | 435 | ||
433 | } else if ( e->key() == Key_P ) { | 436 | } else if ( e->key() == Qt::Key_P ) { |
434 | text.at( 5 ) = 'p'; | 437 | text[ 5 ] = 'p'; |
435 | lineEdit()->setText( text ); | 438 | lineEdit()->setText( text ); |
436 | lineEdit()->setCursorPosition(5); | 439 | lineEdit()->setCursorPosition(5); |
437 | 440 | ||
438 | } | 441 | } |
439 | } | 442 | } |
440 | } | 443 | } |
diff --git a/korganizer/ktimeedit.h b/korganizer/ktimeedit.h index b3d842d..1c7d18d 100644 --- a/korganizer/ktimeedit.h +++ b/korganizer/ktimeedit.h | |||
@@ -21,27 +21,30 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _KTIMEEDIT_H | 23 | #ifndef _KTIMEEDIT_H |
24 | #define _KTIMEEDIT_H | 24 | #define _KTIMEEDIT_H |
25 | 25 | ||
26 | #include <qevent.h> | 26 | #include <qevent.h> |
27 | #include <qkeycode.h> | 27 | #include <qnamespace.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | #include <qdatetime.h> | 29 | #include <qdatetime.h> |
30 | #include <qcombobox.h> | 30 | #include <qcombobox.h> |
31 | #include <Q3ComboBox> | ||
32 | //Added by qt3to4: | ||
33 | #include <QKeyEvent> | ||
31 | 34 | ||
32 | #include <kapplication.h> | 35 | #include <kapplication.h> |
33 | 36 | ||
34 | /** | 37 | /** |
35 | This is a class that provides an easy, user friendly way to edit times. | 38 | This is a class that provides an easy, user friendly way to edit times. |
36 | up/down/ increase or decrease time, respectively. | 39 | up/down/ increase or decrease time, respectively. |
37 | 40 | ||
38 | @short Provides a way to edit times in a user-friendly manner. | 41 | @short Provides a way to edit times in a user-friendly manner. |
39 | @author Preston Brown, Ian Dawes | 42 | @author Preston Brown, Ian Dawes |
40 | */ | 43 | */ |
41 | class KOTimeEdit : public QComboBox | 44 | class KOTimeEdit : public Q3ComboBox |
42 | { | 45 | { |
43 | Q_OBJECT | 46 | Q_OBJECT |
44 | public: | 47 | public: |
45 | /** constructs a new time edit. */ | 48 | /** constructs a new time edit. */ |
46 | KOTimeEdit(QWidget *parent=0, QTime qt=QTime(12,0), const char *name=0); | 49 | KOTimeEdit(QWidget *parent=0, QTime qt=QTime(12,0), const char *name=0); |
47 | 50 | ||
diff --git a/korganizer/lineview.cpp b/korganizer/lineview.cpp index e72e41c..012455e 100644 --- a/korganizer/lineview.cpp +++ b/korganizer/lineview.cpp | |||
@@ -4,13 +4,13 @@ | |||
4 | 4 | ||
5 | #include "koprefs.h" | 5 | #include "koprefs.h" |
6 | 6 | ||
7 | #include "lineview.h" | 7 | #include "lineview.h" |
8 | 8 | ||
9 | LineView::LineView( QWidget *parent, const char *name ) : | 9 | LineView::LineView( QWidget *parent, const char *name ) : |
10 | QScrollView( parent, name ) | 10 | Q3ScrollView( parent, name ) |
11 | { | 11 | { |
12 | mPixelWidth = 1000; | 12 | mPixelWidth = 1000; |
13 | 13 | ||
14 | mLines.setAutoDelete( true ); | 14 | mLines.setAutoDelete( true ); |
15 | 15 | ||
16 | resizeContents( mPixelWidth, contentsHeight() ); | 16 | resizeContents( mPixelWidth, contentsHeight() ); |
diff --git a/korganizer/lineview.h b/korganizer/lineview.h index aa34dbc..52ae9cf 100644 --- a/korganizer/lineview.h +++ b/korganizer/lineview.h | |||
@@ -1,13 +1,13 @@ | |||
1 | #ifndef LINEVIEW_H | 1 | #ifndef LINEVIEW_H |
2 | #define LINEVIEW_H | 2 | #define LINEVIEW_H |
3 | 3 | ||
4 | #include <qscrollview.h> | 4 | #include <q3scrollview.h> |
5 | #include <qptrlist.h> | 5 | #include <q3ptrlist.h> |
6 | 6 | ||
7 | class LineView : public QScrollView | 7 | class LineView : public Q3ScrollView |
8 | { | 8 | { |
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | public: | 10 | public: |
11 | LineView( QWidget *parent = 0, const char *name = 0 ); | 11 | LineView( QWidget *parent = 0, const char *name = 0 ); |
12 | virtual ~LineView(); | 12 | virtual ~LineView(); |
13 | 13 | ||
@@ -25,12 +25,12 @@ class LineView : public QScrollView | |||
25 | Line( int c, int s, int e ) : column( c ), start( s ), end( e ) {} | 25 | Line( int c, int s, int e ) : column( c ), start( s ), end( e ) {} |
26 | int column; | 26 | int column; |
27 | int start; | 27 | int start; |
28 | int end; | 28 | int end; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | QPtrList<Line> mLines; | 31 | Q3PtrList<Line> mLines; |
32 | int mPixelWidth; | 32 | int mPixelWidth; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | #endif | 35 | #endif |
36 | 36 | ||
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 4a0e24f..211fde6 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -1,19 +1,19 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #ifndef DESKTOP_VERSION | 3 | #ifndef DESKTOP_VERSION |
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qcopchannel_qws.h> | 5 | #include <qcopchannel_qws.h> |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | //Added by qt3to4: | ||
8 | #include <Q3CString> | ||
7 | #include <stdlib.h> | 9 | #include <stdlib.h> |
8 | #else | 10 | #else |
9 | #include <qapplication.h> | 11 | #include <qapplication.h> |
10 | #include <qstring.h> | 12 | #include <qstring.h> |
11 | #include <qwindowsstyle.h> | 13 | #include <qwindowsstyle.h> |
12 | #include <qplatinumstyle.h> | ||
13 | #include <qsgistyle.h> | ||
14 | #include <stdlib.h> | 14 | #include <stdlib.h> |
15 | #endif | 15 | #endif |
16 | #include <qtextcodec.h> | 16 | #include <qtextcodec.h> |
17 | 17 | ||
18 | #include <qdir.h> | 18 | #include <qdir.h> |
19 | #include <kstandarddirs.h> | 19 | #include <kstandarddirs.h> |
@@ -23,18 +23,18 @@ | |||
23 | #include <libkdepim/kpimglobalprefs.h> | 23 | #include <libkdepim/kpimglobalprefs.h> |
24 | void dumpMissing(); | 24 | void dumpMissing(); |
25 | 25 | ||
26 | 26 | ||
27 | int main( int argc, char **argv ) | 27 | int main( int argc, char **argv ) |
28 | { | 28 | { |
29 | if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi"); | ||
29 | #ifndef DESKTOP_VERSION | 30 | #ifndef DESKTOP_VERSION |
30 | QPEApplication a( argc, argv ); | 31 | QPEApplication a( argc, argv ); |
31 | a.setKeepRunning (); | 32 | a.setKeepRunning (); |
32 | #else | 33 | #else |
33 | QApplication a( argc, argv ); | 34 | QApplication a( argc, argv ); |
34 | QApplication::setStyle( new QPlatinumStyle ()); | ||
35 | #ifdef _WIN32_ | 35 | #ifdef _WIN32_ |
36 | QString hdir ( getenv( "HOME") ); | 36 | QString hdir ( getenv( "HOME") ); |
37 | if ( hdir.isEmpty() ) { | 37 | if ( hdir.isEmpty() ) { |
38 | QString hd ("C:/" ); | 38 | QString hd ("C:/" ); |
39 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); | 39 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); |
40 | if ( QDir::homeDirPath().lower() == hd.lower() ) { | 40 | if ( QDir::homeDirPath().lower() == hd.lower() ) { |
@@ -86,22 +86,22 @@ int main( int argc, char **argv ) | |||
86 | 86 | ||
87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); | 87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); |
88 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 88 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
89 | MainWindow m; | 89 | MainWindow m; |
90 | #ifndef DESKTOP_VERSION | 90 | #ifndef DESKTOP_VERSION |
91 | 91 | ||
92 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receiveStart( const QCString&, const QByteArray& ))); | 92 | QObject::connect( &a, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )),&m, SLOT(receiveStart( const Q3CString&, const QByteArray& ))); |
93 | a.showMainWidget(&m ); | 93 | a.showMainWidget(&m ); |
94 | #else | 94 | #else |
95 | a.setMainWidget(&m ); | 95 | a.setMainWidget(&m ); |
96 | m.show(); | 96 | m.show(); |
97 | //m.resize( 800, 600 ); | 97 | //m.resize( 800, 600 ); |
98 | //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 98 | //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
99 | #endif | 99 | #endif |
100 | if ( argc > 1 ) { | 100 | if ( argc > 1 ) { |
101 | QCString command = argv[1]; | 101 | Q3CString command = argv[1]; |
102 | if ( argc > 2 ) | 102 | if ( argc > 2 ) |
103 | command += argv[2]; | 103 | command += argv[2]; |
104 | m.recieve(command, QByteArray() ); | 104 | m.recieve(command, QByteArray() ); |
105 | 105 | ||
106 | } | 106 | } |
107 | 107 | ||
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 69ccde1..2004939 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1,38 +1,48 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qpopupmenu.h> | 4 | #include <Q3Action> |
5 | #include <q3popupmenu.h> | ||
5 | #include <qpainter.h> | 6 | #include <qpainter.h> |
6 | #include <qwhatsthis.h> | 7 | #include <q3whatsthis.h> |
7 | #include <qpushbutton.h> | 8 | #include <qpushbutton.h> |
8 | #include <qmessagebox.h> | 9 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 10 | #include <qlineedit.h> |
10 | #include <qtextcodec.h> | 11 | #include <qtextcodec.h> |
11 | #include <qfile.h> | 12 | #include <qfile.h> |
12 | #include <qdir.h> | 13 | #include <qdir.h> |
13 | #include <qapp.h> | 14 | #include <qapplication.h> |
14 | #include <qfileinfo.h> | 15 | #include <qfileinfo.h> |
15 | #include <qlabel.h> | 16 | #include <qlabel.h> |
16 | #include <qspinbox.h> | 17 | #include <qspinbox.h> |
17 | #include <qcheckbox.h> | 18 | #include <qcheckbox.h> |
18 | #include <qmap.h> | 19 | #include <qmap.h> |
19 | #include <qwmatrix.h> | 20 | #include <qmatrix.h> |
20 | #include <qtextbrowser.h> | 21 | #include <q3textbrowser.h> |
21 | #include <qtextstream.h> | 22 | #include <q3textstream.h> |
22 | #ifndef DESKTOP_VERSION | 23 | #ifndef DESKTOP_VERSION |
23 | #include <qpe/global.h> | 24 | #include <qpe/global.h> |
24 | #include <qpe/qpetoolbar.h> | 25 | #include <qpe/qpetoolbar.h> |
25 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
26 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
27 | #include <qtopia/alarmserver.h> | 28 | #include <qtopia/alarmserver.h> |
28 | #include <qtopia/qcopenvelope_qws.h> | 29 | #include <qtopia/qcopenvelope_qws.h> |
29 | //#include <unistd.h> // for sleep | 30 | //#include <unistd.h> // for sleep |
30 | #else | 31 | #else |
31 | #include <qtoolbar.h> | 32 | #include <q3toolbar.h> |
32 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | //Added by qt3to4: | ||
35 | #include <QResizeEvent> | ||
36 | #include <QPixmap> | ||
37 | #include <QCloseEvent> | ||
38 | #include <QKeyEvent> | ||
39 | #include <Q3VBoxLayout> | ||
40 | #include <QHideEvent> | ||
41 | #include <Q3CString> | ||
42 | #include <Q3PtrList> | ||
33 | //#include <resource.h> | 43 | //#include <resource.h> |
34 | 44 | ||
35 | #endif | 45 | #endif |
36 | #include <libkcal/calendarlocal.h> | 46 | #include <libkcal/calendarlocal.h> |
37 | #include <libkcal/todo.h> | 47 | #include <libkcal/todo.h> |
38 | #include <libkcal/phoneformat.h> | 48 | #include <libkcal/phoneformat.h> |
@@ -77,41 +87,41 @@ class KOex2phonePrefs : public QDialog | |||
77 | { | 87 | { |
78 | public: | 88 | public: |
79 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 89 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
80 | QDialog( parent, name, true ) | 90 | QDialog( parent, name, true ) |
81 | { | 91 | { |
82 | setCaption( i18n("Export to phone options") ); | 92 | setCaption( i18n("Export to phone options") ); |
83 | QVBoxLayout* lay = new QVBoxLayout( this ); | 93 | Q3VBoxLayout* lay = new Q3VBoxLayout( this ); |
84 | lay->setSpacing( 3 ); | 94 | lay->setSpacing( 3 ); |
85 | lay->setMargin( 3 ); | 95 | lay->setMargin( 3 ); |
86 | QLabel *lab; | 96 | QLabel *lab; |
87 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 97 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
88 | lab->setAlignment (AlignHCenter ); | 98 | lab->setAlignment (Qt::AlignHCenter ); |
89 | QHBox* temphb; | 99 | Q3HBox* temphb; |
90 | temphb = new QHBox( this ); | 100 | temphb = new Q3HBox( this ); |
91 | new QLabel( i18n("I/O device: "), temphb ); | 101 | new QLabel( i18n("I/O device: "), temphb ); |
92 | mPhoneDevice = new QLineEdit( temphb); | 102 | mPhoneDevice = new QLineEdit( temphb); |
93 | lay->addWidget( temphb ); | 103 | lay->addWidget( temphb ); |
94 | temphb = new QHBox( this ); | 104 | temphb = new Q3HBox( this ); |
95 | new QLabel( i18n("Connection: "), temphb ); | 105 | new QLabel( i18n("Connection: "), temphb ); |
96 | mPhoneConnection = new QLineEdit( temphb); | 106 | mPhoneConnection = new QLineEdit( temphb); |
97 | lay->addWidget( temphb ); | 107 | lay->addWidget( temphb ); |
98 | temphb = new QHBox( this ); | 108 | temphb = new Q3HBox( this ); |
99 | new QLabel( i18n("Model(opt.): "), temphb ); | 109 | new QLabel( i18n("Model(opt.): "), temphb ); |
100 | mPhoneModel = new QLineEdit( temphb); | 110 | mPhoneModel = new QLineEdit( temphb); |
101 | lay->addWidget( temphb ); | 111 | lay->addWidget( temphb ); |
102 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 112 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
103 | mWriteBackFuture->setChecked( true ); | 113 | mWriteBackFuture->setChecked( true ); |
104 | lay->addWidget( mWriteBackFuture ); | 114 | lay->addWidget( mWriteBackFuture ); |
105 | temphb = new QHBox( this ); | 115 | temphb = new Q3HBox( this ); |
106 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 116 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
107 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 117 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
108 | mWriteBackFutureWeeks->setValue( 8 ); | 118 | mWriteBackFutureWeeks->setValue( 8 ); |
109 | lay->addWidget( temphb ); | 119 | lay->addWidget( temphb ); |
110 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 120 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
111 | lab->setAlignment (AlignHCenter ); | 121 | lab->setAlignment (Qt::AlignHCenter ); |
112 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 122 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
113 | lay->addWidget( ok ); | 123 | lay->addWidget( ok ); |
114 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 124 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
115 | lay->addWidget( cancel ); | 125 | lay->addWidget( cancel ); |
116 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 126 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
117 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 127 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
@@ -131,13 +141,13 @@ public: | |||
131 | QPixmap* sgListViewCompletedPix[6]; | 141 | QPixmap* sgListViewCompletedPix[6]; |
132 | QPixmap* sgListViewJournalPix; | 142 | QPixmap* sgListViewJournalPix; |
133 | 143 | ||
134 | 144 | ||
135 | int globalFlagBlockStartup; | 145 | int globalFlagBlockStartup; |
136 | MainWindow::MainWindow( QWidget *parent, const char *name ) : | 146 | MainWindow::MainWindow( QWidget *parent, const char *name ) : |
137 | QMainWindow( parent, name ) | 147 | Q3MainWindow( parent, name ) |
138 | { | 148 | { |
139 | sgListViewCompletedPix[5] = &listviewPix; | 149 | sgListViewCompletedPix[5] = &listviewPix; |
140 | sgListViewCompletedPix[0] = &listviewPix0; | 150 | sgListViewCompletedPix[0] = &listviewPix0; |
141 | sgListViewCompletedPix[1] = &listviewPix20; | 151 | sgListViewCompletedPix[1] = &listviewPix20; |
142 | sgListViewCompletedPix[2] = &listviewPix40; | 152 | sgListViewCompletedPix[2] = &listviewPix40; |
143 | sgListViewCompletedPix[3] = &listviewPix60; | 153 | sgListViewCompletedPix[3] = &listviewPix60; |
@@ -182,24 +192,24 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : | |||
182 | setCaption("KO/Pi"); | 192 | setCaption("KO/Pi"); |
183 | KOPrefs *p = KOPrefs::instance(); | 193 | KOPrefs *p = KOPrefs::instance(); |
184 | //KPimGlobalPrefs::instance()->setGlobalConfig(); | 194 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
185 | p->mCurrentDisplayedView = 0; | 195 | p->mCurrentDisplayedView = 0; |
186 | if ( p->mHourSize > 22 ) | 196 | if ( p->mHourSize > 22 ) |
187 | p->mHourSize = 22; | 197 | p->mHourSize = 22; |
188 | QMainWindow::ToolBarDock tbd; | 198 | Qt::ToolBarDock tbd; |
189 | if ( p->mToolBarHor ) { | 199 | if ( p->mToolBarHor ) { |
190 | if ( p->mToolBarUp ) | 200 | if ( p->mToolBarUp ) |
191 | tbd = Bottom; | 201 | tbd = Qt::Bottom; |
192 | else | 202 | else |
193 | tbd = Top; | 203 | tbd = Qt::Top; |
194 | } | 204 | } |
195 | else { | 205 | else { |
196 | if ( p->mToolBarUp ) | 206 | if ( p->mToolBarUp ) |
197 | tbd = Right; | 207 | tbd = Qt::Right; |
198 | else | 208 | else |
199 | tbd = Left; | 209 | tbd = Qt::Left; |
200 | } | 210 | } |
201 | if ( KOPrefs::instance()->mUseAppColors ) | 211 | if ( KOPrefs::instance()->mUseAppColors ) |
202 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 212 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
203 | globalFlagBlockStartup = 1; | 213 | globalFlagBlockStartup = 1; |
204 | iconToolBar = new QPEToolBar( this ); | 214 | iconToolBar = new QPEToolBar( this ); |
205 | addToolBar (iconToolBar , tbd ); | 215 | addToolBar (iconToolBar , tbd ); |
@@ -210,30 +220,30 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : | |||
210 | if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) ) | 220 | if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) ) |
211 | #endif | 221 | #endif |
212 | 222 | ||
213 | { | 223 | { |
214 | if ( p->mToolBarHorF ) { | 224 | if ( p->mToolBarHorF ) { |
215 | if ( p->mToolBarUpF ) | 225 | if ( p->mToolBarUpF ) |
216 | tbd = Bottom; | 226 | tbd = Qt::Bottom; |
217 | else | 227 | else |
218 | tbd = Top; | 228 | tbd = Qt::Top; |
219 | } | 229 | } |
220 | else { | 230 | else { |
221 | if ( p->mToolBarUpF ) | 231 | if ( p->mToolBarUpF ) |
222 | tbd = Right; | 232 | tbd = Qt::Right; |
223 | else | 233 | else |
224 | tbd = Left; | 234 | tbd = Qt::Left; |
225 | } | 235 | } |
226 | filterToolBar = new QPEToolBar ( this ); | 236 | filterToolBar = new QPEToolBar ( this ); |
227 | filterMenubar = new KMenuBar( 0 ); | 237 | filterMenubar = new KMenuBar( 0 ); |
228 | QFontMetrics fm ( filterMenubar->font() ); | 238 | QFontMetrics fm ( filterMenubar->font() ); |
229 | #ifndef DESKTOP_VERSION | 239 | #ifndef DESKTOP_VERSION |
230 | filterToolBar->setFocusPolicy( NoFocus ); | 240 | filterToolBar->setFocusPolicy( NoFocus ); |
231 | filterMenubar->setFocusPolicy( NoFocus ); | 241 | filterMenubar->setFocusPolicy( NoFocus ); |
232 | #endif | 242 | #endif |
233 | filterPopupMenu = new QPopupMenu( this ); | 243 | filterPopupMenu = new Q3PopupMenu( this ); |
234 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 244 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
235 | QString addTest = "A"; | 245 | QString addTest = "A"; |
236 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); | 246 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); |
237 | #ifdef DESKTOP_VERSION | 247 | #ifdef DESKTOP_VERSION |
238 | addTest = "AAAAAABBBCCCx"; | 248 | addTest = "AAAAAABBBCCCx"; |
239 | #else | 249 | #else |
@@ -256,35 +266,35 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : | |||
256 | } else { | 266 | } else { |
257 | #ifndef DESKTOP_VERSION | 267 | #ifndef DESKTOP_VERSION |
258 | setToolBarsMovable( false ); | 268 | setToolBarsMovable( false ); |
259 | #endif | 269 | #endif |
260 | if ( p->mToolBarHorV ) { | 270 | if ( p->mToolBarHorV ) { |
261 | if ( p->mToolBarUpV ) | 271 | if ( p->mToolBarUpV ) |
262 | tbd = Bottom; | 272 | tbd = Qt::Bottom; |
263 | else | 273 | else |
264 | tbd = Top; | 274 | tbd = Qt::Top; |
265 | } | 275 | } |
266 | else { | 276 | else { |
267 | if ( p->mToolBarUpV ) | 277 | if ( p->mToolBarUpV ) |
268 | tbd = Right; | 278 | tbd = Qt::Right; |
269 | else | 279 | else |
270 | tbd = Left; | 280 | tbd = Qt::Left; |
271 | } | 281 | } |
272 | viewToolBar = new QPEToolBar( this ); | 282 | viewToolBar = new QPEToolBar( this ); |
273 | addToolBar (viewToolBar , tbd ); | 283 | addToolBar (viewToolBar , tbd ); |
274 | if ( p->mToolBarHorN ) { | 284 | if ( p->mToolBarHorN ) { |
275 | if ( p->mToolBarUpN ) | 285 | if ( p->mToolBarUpN ) |
276 | tbd = Bottom; | 286 | tbd = Qt::Bottom; |
277 | else | 287 | else |
278 | tbd = Top; | 288 | tbd = Qt::Top; |
279 | } | 289 | } |
280 | else { | 290 | else { |
281 | if ( p->mToolBarUpN ) | 291 | if ( p->mToolBarUpN ) |
282 | tbd = Right; | 292 | tbd = Qt::Right; |
283 | else | 293 | else |
284 | tbd = Left; | 294 | tbd = Qt::Left; |
285 | } | 295 | } |
286 | navigatorToolBar = new QPEToolBar( this ); | 296 | navigatorToolBar = new QPEToolBar( this ); |
287 | addToolBar (navigatorToolBar , tbd ); | 297 | addToolBar (navigatorToolBar , tbd ); |
288 | } | 298 | } |
289 | 299 | ||
290 | 300 | ||
@@ -437,15 +447,15 @@ void MainWindow::loadDataAfterStart() | |||
437 | processIncidenceSelection( 0 ); | 447 | processIncidenceSelection( 0 ); |
438 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 448 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
439 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 449 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
440 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 450 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
441 | SLOT( slotModifiedChanged( bool ) ) ); | 451 | SLOT( slotModifiedChanged( bool ) ) ); |
442 | #ifndef DESKTOP_VERSION | 452 | #ifndef DESKTOP_VERSION |
443 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 453 | connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const Q3CString &, const QByteArray & ))); |
444 | connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& ))); | 454 | connect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(recieve( const Q3CString&, const QByteArray& ))); |
445 | disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& ))); | 455 | disconnect( qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), this, SLOT(receiveStart( const Q3CString&, const QByteArray& ))); |
446 | if ( !mCStringMess.isEmpty() ) | 456 | if ( !mCStringMess.isEmpty() ) |
447 | recieve( mCStringMess, mByteData ); | 457 | recieve( mCStringMess, mByteData ); |
448 | #endif | 458 | #endif |
449 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); | 459 | QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); |
450 | } | 460 | } |
451 | 461 | ||
@@ -506,13 +516,13 @@ void MainWindow::toggleBeamReceive() | |||
506 | brAction->setOn(false); | 516 | brAction->setOn(false); |
507 | return; | 517 | return; |
508 | } | 518 | } |
509 | qDebug("KO: Enable BeamReceive "); | 519 | qDebug("KO: Enable BeamReceive "); |
510 | brAction->setOn(true); | 520 | brAction->setOn(true); |
511 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 521 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
512 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 522 | QObject::connect( infrared, SIGNAL (received ( const Q3CString &, const QByteArray & )),this, SLOT(recieve( const Q3CString&, const QByteArray& ))); |
513 | #endif | 523 | #endif |
514 | } | 524 | } |
515 | void MainWindow::showMaximized () | 525 | void MainWindow::showMaximized () |
516 | { | 526 | { |
517 | #ifndef DESKTOP_VERSION | 527 | #ifndef DESKTOP_VERSION |
518 | if ( ! globalFlagBlockStartup ) | 528 | if ( ! globalFlagBlockStartup ) |
@@ -597,28 +607,28 @@ void MainWindow::closeEvent( QCloseEvent* ce ) | |||
597 | default: | 607 | default: |
598 | break; | 608 | break; |
599 | } | 609 | } |
600 | 610 | ||
601 | 611 | ||
602 | } | 612 | } |
603 | void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data ) | 613 | void MainWindow::receiveStart( const Q3CString& cmsg, const QByteArray& data ) |
604 | { | 614 | { |
605 | qDebug("KO: QCOP start message received: %s ", cmsg.data() ); | 615 | qDebug("KO: QCOP start message received: %s ", cmsg.data() ); |
606 | mCStringMess = cmsg; | 616 | mCStringMess = cmsg; |
607 | mByteData = data; | 617 | mByteData = data; |
608 | } | 618 | } |
609 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 619 | void MainWindow::recieve( const Q3CString& cmsg, const QByteArray& data ) |
610 | { | 620 | { |
611 | QDataStream stream( data, IO_ReadOnly ); | 621 | QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); |
612 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 622 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
613 | //QString datamess; | 623 | //QString datamess; |
614 | //qDebug("message "); | 624 | //qDebug("message "); |
615 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 625 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
616 | 626 | ||
617 | if ( cmsg == "setDocument(QString)" ) { | 627 | if ( cmsg == "setDocument(QString)" ) { |
618 | QDataStream stream( data, IO_ReadOnly ); | 628 | QDataStream stream( const_cast<QByteArray*>(&data), QIODevice::ReadOnly ); |
619 | QString fileName; | 629 | QString fileName; |
620 | stream >> fileName; | 630 | stream >> fileName; |
621 | //qDebug("filename %s ", fileName.latin1()); | 631 | //qDebug("filename %s ", fileName.latin1()); |
622 | showMaximized(); | 632 | showMaximized(); |
623 | raise(); | 633 | raise(); |
624 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 634 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
@@ -741,27 +751,27 @@ void MainWindow::initActions() | |||
741 | { | 751 | { |
742 | //KOPrefs::instance()->mShowFullMenu | 752 | //KOPrefs::instance()->mShowFullMenu |
743 | iconToolBar->clear(); | 753 | iconToolBar->clear(); |
744 | KOPrefs *p = KOPrefs::instance(); | 754 | KOPrefs *p = KOPrefs::instance(); |
745 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 755 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
746 | 756 | ||
747 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 757 | Q3PopupMenu *viewMenu = new Q3PopupMenu( this ); |
748 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 758 | Q3PopupMenu *actionMenu = new Q3PopupMenu( this ); |
749 | mCurrentItemMenu = new QPopupMenu ( this ); | 759 | mCurrentItemMenu = new Q3PopupMenu ( this ); |
750 | QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); | 760 | Q3PopupMenu *nextConflictMenu = new Q3PopupMenu ( this ); |
751 | QPopupMenu *importMenu = new QPopupMenu( this ); | 761 | Q3PopupMenu *importMenu = new Q3PopupMenu( this ); |
752 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 762 | Q3PopupMenu *importMenu_X = new Q3PopupMenu( this ); |
753 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 763 | Q3PopupMenu *exportMenu_X = new Q3PopupMenu( this ); |
754 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 764 | Q3PopupMenu *beamMenu_X = new Q3PopupMenu( this ); |
755 | selectFilterMenu = new QPopupMenu( this ); | 765 | selectFilterMenu = new Q3PopupMenu( this ); |
756 | selectFilterMenu->setCheckable( true ); | 766 | selectFilterMenu->setCheckable( true ); |
757 | syncMenu = new QPopupMenu( this ); | 767 | syncMenu = new Q3PopupMenu( this ); |
758 | configureAgendaMenu = new QPopupMenu( this ); | 768 | configureAgendaMenu = new Q3PopupMenu( this ); |
759 | configureToolBarMenu = new QPopupMenu( this ); | 769 | configureToolBarMenu = new Q3PopupMenu( this ); |
760 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 770 | Q3PopupMenu *helpMenu = new Q3PopupMenu( this ); |
761 | QIconSet icon; | 771 | QIcon icon; |
762 | int pixWid = 22, pixHei = 22; | 772 | int pixWid = 22, pixHei = 22; |
763 | QString pathString = ""; | 773 | QString pathString = ""; |
764 | if ( !p->mToolBarMiniIcons ) { | 774 | if ( !p->mToolBarMiniIcons ) { |
765 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { | 775 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { |
766 | pathString += "icons16/"; | 776 | pathString += "icons16/"; |
767 | pixWid = 18; pixHei = 16; | 777 | pixWid = 18; pixHei = 16; |
@@ -788,13 +798,13 @@ void MainWindow::initActions() | |||
788 | #endif | 798 | #endif |
789 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 799 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
790 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 800 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
791 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 801 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
792 | } else { | 802 | } else { |
793 | menuBar1 = new KMenuBar( iconToolBar ); | 803 | menuBar1 = new KMenuBar( iconToolBar ); |
794 | QPopupMenu *menuBar = new QPopupMenu( this ); | 804 | Q3PopupMenu *menuBar = new Q3PopupMenu( this ); |
795 | icon = loadPixmap( pathString + "z_menu" ); | 805 | icon = loadPixmap( pathString + "z_menu" ); |
796 | menuBar1->insertItem( icon.pixmap(), menuBar); | 806 | menuBar1->insertItem( icon.pixmap(), menuBar); |
797 | //menuBar1->insertItem( i18n("ME"), menuBar); | 807 | //menuBar1->insertItem( i18n("ME"), menuBar); |
798 | menuBar->insertItem( i18n("File"), importMenu ); | 808 | menuBar->insertItem( i18n("File"), importMenu ); |
799 | menuBar->insertItem( i18n("View"), viewMenu ); | 809 | menuBar->insertItem( i18n("View"), viewMenu ); |
800 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); | 810 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); |
@@ -815,13 +825,13 @@ void MainWindow::initActions() | |||
815 | 825 | ||
816 | 826 | ||
817 | mWeekBgColor = iconToolBar->backgroundColor(); | 827 | mWeekBgColor = iconToolBar->backgroundColor(); |
818 | mWeekPixmap.resize( pixWid , pixHei ); | 828 | mWeekPixmap.resize( pixWid , pixHei ); |
819 | mWeekPixmap.fill( mWeekBgColor ); | 829 | mWeekPixmap.fill( mWeekBgColor ); |
820 | icon = mWeekPixmap; | 830 | icon = mWeekPixmap; |
821 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 831 | mWeekAction = new Q3Action( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
822 | if ( p-> mShowIconWeekNum ) | 832 | if ( p-> mShowIconWeekNum ) |
823 | mWeekAction->addTo( iconToolBar ); | 833 | mWeekAction->addTo( iconToolBar ); |
824 | mWeekFont = font(); | 834 | mWeekFont = font(); |
825 | 835 | ||
826 | int fontPoint = mWeekFont.pointSize(); | 836 | int fontPoint = mWeekFont.pointSize(); |
827 | QFontMetrics f( mWeekFont ); | 837 | QFontMetrics f( mWeekFont ); |
@@ -837,24 +847,24 @@ void MainWindow::initActions() | |||
837 | connect( mWeekAction, SIGNAL( activated() ), | 847 | connect( mWeekAction, SIGNAL( activated() ), |
838 | this, SLOT( weekAction() ) ); | 848 | this, SLOT( weekAction() ) ); |
839 | 849 | ||
840 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 850 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
841 | if ( p->mShowIconFilterview ) { | 851 | if ( p->mShowIconFilterview ) { |
842 | icon = loadPixmap( pathString + "filter" ); | 852 | icon = loadPixmap( pathString + "filter" ); |
843 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); | 853 | actionFilterMenuTB = new Q3Action( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); |
844 | connect( actionFilterMenuTB, SIGNAL( activated() ), | 854 | connect( actionFilterMenuTB, SIGNAL( activated() ), |
845 | this, SLOT( fillFilterMenuTB() ) ); | 855 | this, SLOT( fillFilterMenuTB() ) ); |
846 | actionFilterMenuTB->addTo( iconToolBar ); | 856 | actionFilterMenuTB->addTo( iconToolBar ); |
847 | selectFilterMenuTB = new QPopupMenu( this ); | 857 | selectFilterMenuTB = new Q3PopupMenu( this ); |
848 | selectFilterMenuTB->setCheckable( true ); | 858 | selectFilterMenuTB->setCheckable( true ); |
849 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 859 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
850 | } | 860 | } |
851 | 861 | ||
852 | //#endif | 862 | //#endif |
853 | // ****************** | 863 | // ****************** |
854 | QAction *action; | 864 | Q3Action *action; |
855 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 865 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
856 | configureToolBarMenu->setCheckable( true ); | 866 | configureToolBarMenu->setCheckable( true ); |
857 | 867 | ||
858 | 868 | ||
859 | configureAgendaMenu->setCheckable( true ); | 869 | configureAgendaMenu->setCheckable( true ); |
860 | int iii ; | 870 | int iii ; |
@@ -863,58 +873,58 @@ void MainWindow::initActions() | |||
863 | } | 873 | } |
864 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 874 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
865 | 875 | ||
866 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 876 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
867 | this, SLOT( showConfigureAgenda( ) ) ); | 877 | this, SLOT( showConfigureAgenda( ) ) ); |
868 | icon = loadPixmap( pathString + "today" ); | 878 | icon = loadPixmap( pathString + "today" ); |
869 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 879 | Q3Action* today_action = new Q3Action( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
870 | today_action->addTo( actionMenu ); | 880 | today_action->addTo( actionMenu ); |
871 | connect( today_action, SIGNAL( activated() ), | 881 | connect( today_action, SIGNAL( activated() ), |
872 | mView, SLOT( goToday() ) ); | 882 | mView, SLOT( goToday() ) ); |
873 | 883 | ||
874 | icon = loadPixmap( pathString + "picker" ); | 884 | icon = loadPixmap( pathString + "picker" ); |
875 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); | 885 | Q3Action* dPickerAction = new Q3Action( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); |
876 | dPickerAction->addTo( actionMenu ); | 886 | dPickerAction->addTo( actionMenu ); |
877 | connect( dPickerAction, SIGNAL( activated() ), | 887 | connect( dPickerAction, SIGNAL( activated() ), |
878 | mView, SLOT( showDatePicker() ) ); | 888 | mView, SLOT( showDatePicker() ) ); |
879 | 889 | ||
880 | icon = loadPixmap( pathString + "search" ); | 890 | icon = loadPixmap( pathString + "search" ); |
881 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 891 | Q3Action* search_action = new Q3Action( i18n("Search"), icon, i18n("Search..."), 0, this ); |
882 | search_action->addTo( actionMenu ); | 892 | search_action->addTo( actionMenu ); |
883 | connect( search_action, SIGNAL( activated() ), | 893 | connect( search_action, SIGNAL( activated() ), |
884 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 894 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
885 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); | 895 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); |
886 | 896 | ||
887 | action = new QAction( "Undo Delete", i18n("All events"), 0, this ); | 897 | action = new Q3Action( "Undo Delete", i18n("All events"), 0, this ); |
888 | action->addTo( nextConflictMenu ); | 898 | action->addTo( nextConflictMenu ); |
889 | connect( action, SIGNAL( activated() ), | 899 | connect( action, SIGNAL( activated() ), |
890 | mView, SLOT( conflictAll() ) ); | 900 | mView, SLOT( conflictAll() ) ); |
891 | 901 | ||
892 | action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); | 902 | action = new Q3Action( "Undo Delete", i18n("Allday events"), 0, this ); |
893 | action->addTo( nextConflictMenu ); | 903 | action->addTo( nextConflictMenu ); |
894 | connect( action, SIGNAL( activated() ), | 904 | connect( action, SIGNAL( activated() ), |
895 | mView, SLOT( conflictAllday() ) ); | 905 | mView, SLOT( conflictAllday() ) ); |
896 | 906 | ||
897 | action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); | 907 | action = new Q3Action( "Undo Delete", i18n("Events with time"), 0, this ); |
898 | action->addTo( nextConflictMenu ); | 908 | action->addTo( nextConflictMenu ); |
899 | connect( action, SIGNAL( activated() ), | 909 | connect( action, SIGNAL( activated() ), |
900 | mView, SLOT( conflictNotAll() ) ); | 910 | mView, SLOT( conflictNotAll() ) ); |
901 | 911 | ||
902 | actionMenu->insertSeparator(); | 912 | actionMenu->insertSeparator(); |
903 | 913 | ||
904 | icon = loadPixmap( pathString + "newevent" ); | 914 | icon = loadPixmap( pathString + "newevent" ); |
905 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 915 | Q3Action* ne_action = new Q3Action( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
906 | ne_action->addTo( mCurrentItemMenu ); | 916 | ne_action->addTo( mCurrentItemMenu ); |
907 | connect( ne_action, SIGNAL( activated() ), | 917 | connect( ne_action, SIGNAL( activated() ), |
908 | mView, SLOT( newEvent() ) ); | 918 | mView, SLOT( newEvent() ) ); |
909 | icon = loadPixmap( pathString + "newtodo" ); | 919 | icon = loadPixmap( pathString + "newtodo" ); |
910 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 920 | Q3Action* nt_action = new Q3Action( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
911 | nt_action->addTo( mCurrentItemMenu ); | 921 | nt_action->addTo( mCurrentItemMenu ); |
912 | connect( nt_action, SIGNAL( activated() ), | 922 | connect( nt_action, SIGNAL( activated() ), |
913 | mView, SLOT( newTodo() ) ); | 923 | mView, SLOT( newTodo() ) ); |
914 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 924 | mNewSubTodoAction = new Q3Action( "new_subtodo", i18n("New Sub-Todo..."), 0, |
915 | this ); | 925 | this ); |
916 | mNewSubTodoAction->addTo( mCurrentItemMenu ); | 926 | mNewSubTodoAction->addTo( mCurrentItemMenu ); |
917 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 927 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
918 | mView, SLOT( newSubTodo() ) ); | 928 | mView, SLOT( newSubTodo() ) ); |
919 | 929 | ||
920 | mCurrentItemMenu->insertSeparator(); | 930 | mCurrentItemMenu->insertSeparator(); |
@@ -927,84 +937,84 @@ void MainWindow::initActions() | |||
927 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 937 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
928 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 938 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
929 | icon = loadPixmap( pathString + "newtodo" ); | 939 | icon = loadPixmap( pathString + "newtodo" ); |
930 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 940 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
931 | 941 | ||
932 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); | 942 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); |
933 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); | 943 | mShowAction = new Q3Action( "show_incidence", i18n("Show"), 0, this ); |
934 | mShowAction->addTo( mCurrentItemMenu ); | 944 | mShowAction->addTo( mCurrentItemMenu ); |
935 | connect( mShowAction, SIGNAL( activated() ), | 945 | connect( mShowAction, SIGNAL( activated() ), |
936 | mView, SLOT( showIncidence() ) ); | 946 | mView, SLOT( showIncidence() ) ); |
937 | 947 | ||
938 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 948 | mEditAction = new Q3Action( "edit_incidence", i18n("Edit..."), 0, this ); |
939 | mEditAction->addTo( mCurrentItemMenu ); | 949 | mEditAction->addTo( mCurrentItemMenu ); |
940 | connect( mEditAction, SIGNAL( activated() ), | 950 | connect( mEditAction, SIGNAL( activated() ), |
941 | mView, SLOT( editIncidence() ) ); | 951 | mView, SLOT( editIncidence() ) ); |
942 | 952 | ||
943 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 953 | mDeleteAction = new Q3Action( "delete_incidence", i18n("Delete..."), 0, this ); |
944 | mDeleteAction->addTo( mCurrentItemMenu ); | 954 | mDeleteAction->addTo( mCurrentItemMenu ); |
945 | connect( mDeleteAction, SIGNAL( activated() ), | 955 | connect( mDeleteAction, SIGNAL( activated() ), |
946 | mView, SLOT( deleteIncidence() ) ); | 956 | mView, SLOT( deleteIncidence() ) ); |
947 | 957 | ||
948 | 958 | ||
949 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 959 | mCloneAction = new Q3Action( "clone_incidence", i18n("Clone..."), 0, this ); |
950 | mCloneAction->addTo( mCurrentItemMenu ); | 960 | mCloneAction->addTo( mCurrentItemMenu ); |
951 | connect( mCloneAction, SIGNAL( activated() ), | 961 | connect( mCloneAction, SIGNAL( activated() ), |
952 | mView, SLOT( cloneIncidence() ) ); | 962 | mView, SLOT( cloneIncidence() ) ); |
953 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 963 | mMoveAction = new Q3Action( "Move_incidence", i18n("Move..."), 0, this ); |
954 | mMoveAction->addTo( mCurrentItemMenu ); | 964 | mMoveAction->addTo( mCurrentItemMenu ); |
955 | connect( mMoveAction, SIGNAL( activated() ), | 965 | connect( mMoveAction, SIGNAL( activated() ), |
956 | mView, SLOT( moveIncidence() ) ); | 966 | mView, SLOT( moveIncidence() ) ); |
957 | #ifndef DESKTOP_VERSION | 967 | #ifndef DESKTOP_VERSION |
958 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 968 | mBeamAction = new Q3Action( "Beam_incidence", i18n("Beam..."), 0, this ); |
959 | mBeamAction->addTo(mCurrentItemMenu ); | 969 | mBeamAction->addTo(mCurrentItemMenu ); |
960 | connect( mBeamAction, SIGNAL( activated() ), | 970 | connect( mBeamAction, SIGNAL( activated() ), |
961 | mView, SLOT( beamIncidence() ) ); | 971 | mView, SLOT( beamIncidence() ) ); |
962 | #endif | 972 | #endif |
963 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 973 | mCancelAction = new Q3Action( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
964 | mCancelAction->addTo( mCurrentItemMenu ); | 974 | mCancelAction->addTo( mCurrentItemMenu ); |
965 | connect( mCancelAction, SIGNAL( activated() ), | 975 | connect( mCancelAction, SIGNAL( activated() ), |
966 | mView, SLOT( toggleCancelIncidence() ) ); | 976 | mView, SLOT( toggleCancelIncidence() ) ); |
967 | 977 | ||
968 | 978 | ||
969 | mCurrentItemMenu->insertSeparator(); | 979 | mCurrentItemMenu->insertSeparator(); |
970 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 980 | action = new Q3Action( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
971 | action->addTo( mCurrentItemMenu ); | 981 | action->addTo( mCurrentItemMenu ); |
972 | connect( action, SIGNAL( activated() ), | 982 | connect( action, SIGNAL( activated() ), |
973 | mView, SLOT( undo_delete() ) ); | 983 | mView, SLOT( undo_delete() ) ); |
974 | 984 | ||
975 | // *********************** | 985 | // *********************** |
976 | if ( KOPrefs::instance()->mVerticalScreen ) { | 986 | if ( KOPrefs::instance()->mVerticalScreen ) { |
977 | icon = SmallIcon( "1updownarrow" ); | 987 | icon = SmallIcon( "1updownarrow" ); |
978 | } else { | 988 | } else { |
979 | icon = SmallIcon("1leftrightarrow" ); | 989 | icon = SmallIcon("1leftrightarrow" ); |
980 | } | 990 | } |
981 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 991 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
982 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 992 | Q3Action* FSaction = new Q3Action( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
983 | FSaction->addTo( viewMenu ); | 993 | FSaction->addTo( viewMenu ); |
984 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 994 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
985 | 995 | ||
986 | 996 | ||
987 | icon = loadPixmap( pathString + "filter" ); | 997 | icon = loadPixmap( pathString + "filter" ); |
988 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); | 998 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
989 | icon = loadPixmap( pathString + "configure" ); | 999 | icon = loadPixmap( pathString + "configure" ); |
990 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); | 1000 | action = new Q3Action( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); |
991 | action->addTo( viewMenu ); | 1001 | action->addTo( viewMenu ); |
992 | connect( action, SIGNAL( activated() ), | 1002 | connect( action, SIGNAL( activated() ), |
993 | mView, SLOT( toggleFilter() ) ); | 1003 | mView, SLOT( toggleFilter() ) ); |
994 | mToggleFilter = action; | 1004 | mToggleFilter = action; |
995 | icon = loadPixmap( pathString + "navi" ); | 1005 | icon = loadPixmap( pathString + "navi" ); |
996 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 1006 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
997 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 1007 | action = new Q3Action( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
998 | action->addTo( viewMenu ); | 1008 | action->addTo( viewMenu ); |
999 | connect( action, SIGNAL( activated() ), | 1009 | connect( action, SIGNAL( activated() ), |
1000 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 1010 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
1001 | mToggleNav = action ; | 1011 | mToggleNav = action ; |
1002 | icon = loadPixmap( pathString + "allday" ); | 1012 | icon = loadPixmap( pathString + "allday" ); |
1003 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 1013 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
1004 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 1014 | action = new Q3Action( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
1005 | action->addTo( viewMenu ); | 1015 | action->addTo( viewMenu ); |
1006 | connect( action, SIGNAL( activated() ), | 1016 | connect( action, SIGNAL( activated() ), |
1007 | mView, SLOT( toggleAllDaySize() ) ); | 1017 | mView, SLOT( toggleAllDaySize() ) ); |
1008 | mToggleAllday = action; | 1018 | mToggleAllday = action; |
1009 | 1019 | ||
1010 | 1020 | ||
@@ -1028,318 +1038,318 @@ void MainWindow::initActions() | |||
1028 | //******************** | 1038 | //******************** |
1029 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 1039 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
1030 | 1040 | ||
1031 | 1041 | ||
1032 | icon = loadPixmap( pathString + "whatsnext" ); | 1042 | icon = loadPixmap( pathString + "whatsnext" ); |
1033 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 1043 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
1034 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 1044 | Q3Action* whatsnext_action = new Q3Action( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
1035 | whatsnext_action->addTo( viewMenu ); | 1045 | whatsnext_action->addTo( viewMenu ); |
1036 | connect( whatsnext_action, SIGNAL( activated() ), | 1046 | connect( whatsnext_action, SIGNAL( activated() ), |
1037 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 1047 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
1038 | 1048 | ||
1039 | icon = loadPixmap( pathString + "xdays" ); | 1049 | icon = loadPixmap( pathString + "xdays" ); |
1040 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 1050 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
1041 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 1051 | Q3Action* xdays_action = new Q3Action( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
1042 | xdays_action->addTo( viewMenu ); | 1052 | xdays_action->addTo( viewMenu ); |
1043 | connect( xdays_action, SIGNAL( activated() ), | 1053 | connect( xdays_action, SIGNAL( activated() ), |
1044 | mView->viewManager(), SLOT( showNextXView() ) ); | 1054 | mView->viewManager(), SLOT( showNextXView() ) ); |
1045 | 1055 | ||
1046 | 1056 | ||
1047 | icon = loadPixmap( pathString + "journal" ); | 1057 | icon = loadPixmap( pathString + "journal" ); |
1048 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 1058 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
1049 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 1059 | Q3Action* viewjournal_action = new Q3Action( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
1050 | viewjournal_action->addTo( viewMenu ); | 1060 | viewjournal_action->addTo( viewMenu ); |
1051 | connect( viewjournal_action, SIGNAL( activated() ), | 1061 | connect( viewjournal_action, SIGNAL( activated() ), |
1052 | mView->viewManager(), SLOT( showJournalView() ) ); | 1062 | mView->viewManager(), SLOT( showJournalView() ) ); |
1053 | 1063 | ||
1054 | 1064 | ||
1055 | icon = loadPixmap( pathString + "day" ); | 1065 | icon = loadPixmap( pathString + "day" ); |
1056 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 1066 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
1057 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 1067 | Q3Action* day1_action = new Q3Action( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
1058 | day1_action->addTo( viewMenu ); | 1068 | day1_action->addTo( viewMenu ); |
1059 | // action->addTo( toolBar ); | 1069 | // action->addTo( toolBar ); |
1060 | connect( day1_action, SIGNAL( activated() ), | 1070 | connect( day1_action, SIGNAL( activated() ), |
1061 | mView->viewManager(), SLOT( showDayView() ) ); | 1071 | mView->viewManager(), SLOT( showDayView() ) ); |
1062 | 1072 | ||
1063 | icon = loadPixmap( pathString + "workweek" ); | 1073 | icon = loadPixmap( pathString + "workweek" ); |
1064 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 1074 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
1065 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 1075 | Q3Action* day5_action = new Q3Action( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
1066 | day5_action->addTo( viewMenu ); | 1076 | day5_action->addTo( viewMenu ); |
1067 | connect( day5_action, SIGNAL( activated() ), | 1077 | connect( day5_action, SIGNAL( activated() ), |
1068 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 1078 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
1069 | 1079 | ||
1070 | icon = loadPixmap( pathString + "week" ); | 1080 | icon = loadPixmap( pathString + "week" ); |
1071 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 1081 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
1072 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 1082 | Q3Action* day7_action = new Q3Action( i18n("Week"), icon, i18n("Week"), 0, this ); |
1073 | day7_action->addTo( viewMenu ); | 1083 | day7_action->addTo( viewMenu ); |
1074 | connect( day7_action, SIGNAL( activated() ), | 1084 | connect( day7_action, SIGNAL( activated() ), |
1075 | mView->viewManager(), SLOT( showWeekView() ) ); | 1085 | mView->viewManager(), SLOT( showWeekView() ) ); |
1076 | 1086 | ||
1077 | icon = loadPixmap( pathString + "workweek2" ); | 1087 | icon = loadPixmap( pathString + "workweek2" ); |
1078 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 1088 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
1079 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 1089 | Q3Action* day6_action = new Q3Action( i18n("List week"), icon, i18n("List week"), 0, this ); |
1080 | day6_action->addTo( viewMenu ); | 1090 | day6_action->addTo( viewMenu ); |
1081 | connect( day6_action, SIGNAL( activated() ), | 1091 | connect( day6_action, SIGNAL( activated() ), |
1082 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 1092 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
1083 | 1093 | ||
1084 | icon = loadPixmap( pathString + "month" ); | 1094 | icon = loadPixmap( pathString + "month" ); |
1085 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 1095 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
1086 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 1096 | Q3Action* month_action = new Q3Action( i18n("Month"), icon, i18n("Month"), 0, this ); |
1087 | month_action->addTo( viewMenu ); | 1097 | month_action->addTo( viewMenu ); |
1088 | connect( month_action, SIGNAL( activated() ), | 1098 | connect( month_action, SIGNAL( activated() ), |
1089 | mView->viewManager(), SLOT( showMonthView() ) ); | 1099 | mView->viewManager(), SLOT( showMonthView() ) ); |
1090 | 1100 | ||
1091 | icon = loadPixmap( pathString + "list" ); | 1101 | icon = loadPixmap( pathString + "list" ); |
1092 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 1102 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
1093 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 1103 | Q3Action* showlist_action = new Q3Action( i18n("List View"), icon, i18n("List View"), 0, this ); |
1094 | showlist_action->addTo( viewMenu ); | 1104 | showlist_action->addTo( viewMenu ); |
1095 | connect( showlist_action, SIGNAL( activated() ), | 1105 | connect( showlist_action, SIGNAL( activated() ), |
1096 | mView->viewManager(), SLOT( showListView() ) ); | 1106 | mView->viewManager(), SLOT( showListView() ) ); |
1097 | 1107 | ||
1098 | icon = loadPixmap( pathString + "todo" ); | 1108 | icon = loadPixmap( pathString + "todo" ); |
1099 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 1109 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
1100 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 1110 | Q3Action* todoview_action = new Q3Action( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
1101 | todoview_action->addTo( viewMenu ); | 1111 | todoview_action->addTo( viewMenu ); |
1102 | connect( todoview_action, SIGNAL( activated() ), | 1112 | connect( todoview_action, SIGNAL( activated() ), |
1103 | mView->viewManager(), SLOT( showTodoView() ) ); | 1113 | mView->viewManager(), SLOT( showTodoView() ) ); |
1104 | 1114 | ||
1105 | 1115 | ||
1106 | 1116 | ||
1107 | #if 0 | 1117 | #if 0 |
1108 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 1118 | action = new Q3Action( "view_timespan", "Time Span", 0, this ); |
1109 | action->addTo( viewMenu ); | 1119 | action->addTo( viewMenu ); |
1110 | connect( action, SIGNAL( activated() ), | 1120 | connect( action, SIGNAL( activated() ), |
1111 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 1121 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
1112 | #endif | 1122 | #endif |
1113 | 1123 | ||
1114 | 1124 | ||
1115 | 1125 | ||
1116 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, | 1126 | action = new Q3Action( "purge_completed", i18n("Purge Completed..."), 0, |
1117 | this ); | 1127 | this ); |
1118 | action->addTo( actionMenu ); | 1128 | action->addTo( actionMenu ); |
1119 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 1129 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
1120 | 1130 | ||
1121 | 1131 | ||
1122 | icon = loadPixmap( pathString + "search" ); | 1132 | icon = loadPixmap( pathString + "search" ); |
1123 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 1133 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
1124 | 1134 | ||
1125 | 1135 | ||
1126 | 1136 | ||
1127 | actionMenu->insertSeparator(); | 1137 | actionMenu->insertSeparator(); |
1128 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, | 1138 | action = new Q3Action( "manage cat", i18n("Edit category list..."), 0, |
1129 | this ); | 1139 | this ); |
1130 | action->addTo( actionMenu ); | 1140 | action->addTo( actionMenu ); |
1131 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); | 1141 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); |
1132 | 1142 | ||
1133 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 1143 | action = new Q3Action( "manage cat", i18n("Manage new categories..."), 0, |
1134 | this ); | 1144 | this ); |
1135 | action->addTo( actionMenu ); | 1145 | action->addTo( actionMenu ); |
1136 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 1146 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
1137 | 1147 | ||
1138 | 1148 | ||
1139 | actionMenu->insertSeparator(); | 1149 | actionMenu->insertSeparator(); |
1140 | icon = loadPixmap( pathString + "configure" ); | 1150 | icon = loadPixmap( pathString + "configure" ); |
1141 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); | 1151 | action = new Q3Action( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); |
1142 | action->addTo( actionMenu ); | 1152 | action->addTo( actionMenu ); |
1143 | connect( action, SIGNAL( activated() ), | 1153 | connect( action, SIGNAL( activated() ), |
1144 | mView, SLOT( edit_options() ) ); | 1154 | mView, SLOT( edit_options() ) ); |
1145 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); | 1155 | action = new Q3Action( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); |
1146 | action->addTo( actionMenu ); | 1156 | action->addTo( actionMenu ); |
1147 | connect( action, SIGNAL( activated() ), | 1157 | connect( action, SIGNAL( activated() ), |
1148 | this, SLOT( calHint() ) ); | 1158 | this, SLOT( calHint() ) ); |
1149 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); | 1159 | action = new Q3Action( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); |
1150 | action->addTo( actionMenu ); | 1160 | action->addTo( actionMenu ); |
1151 | connect( action, SIGNAL( activated() ), | 1161 | connect( action, SIGNAL( activated() ), |
1152 | mView, SLOT( edit_global_options() ) ); | 1162 | mView, SLOT( edit_global_options() ) ); |
1153 | if ( KOPrefs::instance()->mShowFullMenu ) { | 1163 | if ( KOPrefs::instance()->mShowFullMenu ) { |
1154 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 1164 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
1155 | 1165 | ||
1156 | } | 1166 | } |
1157 | // actionMenu->insertSeparator(); | 1167 | // actionMenu->insertSeparator(); |
1158 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 1168 | action = new Q3Action( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
1159 | this ); | 1169 | this ); |
1160 | action->addTo( importMenu_X ); | 1170 | action->addTo( importMenu_X ); |
1161 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 1171 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
1162 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 1172 | action = new Q3Action( "import_quick", i18n("Import last file"), 0, |
1163 | this ); | 1173 | this ); |
1164 | action->addTo( importMenu_X ); | 1174 | action->addTo( importMenu_X ); |
1165 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 1175 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
1166 | importMenu_X->insertSeparator(); | 1176 | importMenu_X->insertSeparator(); |
1167 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 1177 | action = new Q3Action( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
1168 | this ); | 1178 | this ); |
1169 | action->addTo( importMenu_X ); | 1179 | action->addTo( importMenu_X ); |
1170 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 1180 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
1171 | //#ifndef DESKTOP_VERSION | 1181 | //#ifndef DESKTOP_VERSION |
1172 | importMenu_X->insertSeparator(); | 1182 | importMenu_X->insertSeparator(); |
1173 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 1183 | action = new Q3Action( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
1174 | this ); | 1184 | this ); |
1175 | action->addTo( importMenu_X ); | 1185 | action->addTo( importMenu_X ); |
1176 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 1186 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
1177 | //#else | 1187 | //#else |
1178 | #ifdef _OL_IMPORT_ | 1188 | #ifdef _OL_IMPORT_ |
1179 | importMenu_X->insertSeparator(); | 1189 | importMenu_X->insertSeparator(); |
1180 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 1190 | action = new Q3Action( "import_ol", i18n("Import from OL"), 0, |
1181 | this ); | 1191 | this ); |
1182 | action->addTo( importMenu_X ); | 1192 | action->addTo( importMenu_X ); |
1183 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 1193 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
1184 | #endif | 1194 | #endif |
1185 | //#endif | 1195 | //#endif |
1186 | 1196 | ||
1187 | //importMenu->insertSeparator(); | 1197 | //importMenu->insertSeparator(); |
1188 | #if 0 | 1198 | #if 0 |
1189 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 1199 | action = new Q3Action( "load_cal", i18n("Load Calendar Backup"), 0, |
1190 | this ); | 1200 | this ); |
1191 | action->addTo( importMenu ); | 1201 | action->addTo( importMenu ); |
1192 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 1202 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
1193 | #endif | 1203 | #endif |
1194 | action = new QAction( "save_cal", i18n("Save Backup..."), 0, | 1204 | action = new Q3Action( "save_cal", i18n("Save Backup..."), 0, |
1195 | this ); | 1205 | this ); |
1196 | action->addTo( importMenu ); | 1206 | action->addTo( importMenu ); |
1197 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 1207 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
1198 | importMenu->insertSeparator(); | 1208 | importMenu->insertSeparator(); |
1199 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 1209 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
1200 | //importMenu->insertSeparator(); | 1210 | //importMenu->insertSeparator(); |
1201 | action = new QAction( "export ical", i18n("Export All Data"), 0, | 1211 | action = new Q3Action( "export ical", i18n("Export All Data"), 0, |
1202 | this ); | 1212 | this ); |
1203 | action->addTo( exportMenu_X ); | 1213 | action->addTo( exportMenu_X ); |
1204 | connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) ); | 1214 | connect( action, SIGNAL( activated() ), SLOT( exportICalendar() ) ); |
1205 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 1215 | action = new Q3Action( "import_qtopia", i18n("Export VCalendar"), 0, |
1206 | this ); | 1216 | this ); |
1207 | action->addTo( exportMenu_X ); | 1217 | action->addTo( exportMenu_X ); |
1208 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 1218 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
1209 | 1219 | ||
1210 | 1220 | ||
1211 | //LR | 1221 | //LR |
1212 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 1222 | Q3PopupMenu *ex2phone = new Q3PopupMenu( this ); |
1213 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1223 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1214 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1224 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1215 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 1225 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
1216 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); | 1226 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); |
1217 | 1227 | ||
1218 | importMenu->insertItem( i18n("Export"), exportMenu_X ); | 1228 | importMenu->insertItem( i18n("Export"), exportMenu_X ); |
1219 | mPrintSelAction = 0; | 1229 | mPrintSelAction = 0; |
1220 | #ifndef DESKTOP_VERSION | 1230 | #ifndef DESKTOP_VERSION |
1221 | //importMenu->insertSeparator(); | 1231 | //importMenu->insertSeparator(); |
1222 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 1232 | brAction = new Q3Action( "beam toggle", i18n("Beam receive enabled"), 0, |
1223 | this ); | 1233 | this ); |
1224 | brAction->addTo( beamMenu_X ); | 1234 | brAction->addTo( beamMenu_X ); |
1225 | brAction->setToggleAction (true ) ; | 1235 | brAction->setToggleAction (true ) ; |
1226 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 1236 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
1227 | 1237 | ||
1228 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 1238 | action = new Q3Action( "beam all", i18n("Beam complete calendar..."), 0, |
1229 | this ); | 1239 | this ); |
1230 | action->addTo( beamMenu_X ); | 1240 | action->addTo( beamMenu_X ); |
1231 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 1241 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
1232 | 1242 | ||
1233 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 1243 | action = new Q3Action( "beam all", i18n("Beam filtered calendar..."), 0, |
1234 | this ); | 1244 | this ); |
1235 | action->addTo( beamMenu_X ); | 1245 | action->addTo( beamMenu_X ); |
1236 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 1246 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
1237 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 1247 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
1238 | #else | 1248 | #else |
1239 | //importMenu->insertSeparator(); | 1249 | //importMenu->insertSeparator(); |
1240 | icon = loadPixmap( pathString + "print" ); | 1250 | icon = loadPixmap( pathString + "print" ); |
1241 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 1251 | action = new Q3Action( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
1242 | action->addTo( beamMenu_X ); | 1252 | action->addTo( beamMenu_X ); |
1243 | connect( action, SIGNAL( activated() ), | 1253 | connect( action, SIGNAL( activated() ), |
1244 | this, SLOT( printCal() ) ); | 1254 | this, SLOT( printCal() ) ); |
1245 | 1255 | ||
1246 | icon = loadPixmap( pathString + "week" ); | 1256 | icon = loadPixmap( pathString + "week" ); |
1247 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 1257 | action = new Q3Action( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
1248 | action->addTo( beamMenu_X ); | 1258 | action->addTo( beamMenu_X ); |
1249 | connect( action, SIGNAL( activated() ), | 1259 | connect( action, SIGNAL( activated() ), |
1250 | this, SLOT( printSel() ) ); | 1260 | this, SLOT( printSel() ) ); |
1251 | icon = loadPixmap( pathString + "whatsnext" ); | 1261 | icon = loadPixmap( pathString + "whatsnext" ); |
1252 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 1262 | action = new Q3Action( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
1253 | action->addTo( beamMenu_X ); | 1263 | action->addTo( beamMenu_X ); |
1254 | connect( action, SIGNAL( activated() ), | 1264 | connect( action, SIGNAL( activated() ), |
1255 | mView->viewManager(), SLOT( slotprintWNV() ) ); | 1265 | mView->viewManager(), SLOT( slotprintWNV() ) ); |
1256 | 1266 | ||
1257 | 1267 | ||
1258 | icon = loadPixmap( pathString + "list" ); | 1268 | icon = loadPixmap( pathString + "list" ); |
1259 | action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); | 1269 | action = new Q3Action( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); |
1260 | action->addTo( beamMenu_X ); | 1270 | action->addTo( beamMenu_X ); |
1261 | connect( action, SIGNAL( activated() ), | 1271 | connect( action, SIGNAL( activated() ), |
1262 | this, SLOT( printListView() ) ); | 1272 | this, SLOT( printListView() ) ); |
1263 | 1273 | ||
1264 | icon = loadPixmap( pathString + "newevent" ); | 1274 | icon = loadPixmap( pathString + "newevent" ); |
1265 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); | 1275 | action = new Q3Action( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); |
1266 | action->addTo( beamMenu_X ); | 1276 | action->addTo( beamMenu_X ); |
1267 | connect( action, SIGNAL( activated() ), | 1277 | connect( action, SIGNAL( activated() ), |
1268 | mView, SLOT( slotprintSelInc() ) ); | 1278 | mView, SLOT( slotprintSelInc() ) ); |
1269 | mPrintSelAction = action; | 1279 | mPrintSelAction = action; |
1270 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 1280 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
1271 | #endif | 1281 | #endif |
1272 | 1282 | ||
1273 | importMenu->insertSeparator(); | 1283 | importMenu->insertSeparator(); |
1274 | action = new QAction( "beam all", i18n("Save"), 0, | 1284 | action = new Q3Action( "beam all", i18n("Save"), 0, |
1275 | this ); | 1285 | this ); |
1276 | action->addTo( importMenu ); | 1286 | action->addTo( importMenu ); |
1277 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 1287 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
1278 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 1288 | action = new Q3Action( "beam all", i18n("Exit (+save)"), 0, |
1279 | this ); | 1289 | this ); |
1280 | action->addTo( importMenu ); | 1290 | action->addTo( importMenu ); |
1281 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 1291 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
1282 | 1292 | ||
1283 | //menuBar->insertItem( "Configure",configureMenu ); | 1293 | //menuBar->insertItem( "Configure",configureMenu ); |
1284 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 1294 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
1285 | icon = loadPixmap( "korganizer/korganizer" ); | 1295 | icon = loadPixmap( "korganizer/korganizer" ); |
1286 | 1296 | ||
1287 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 1297 | action = new Q3Action( "Whats New", i18n("What's new?"), 0,this ); |
1288 | action->addTo( helpMenu ); | 1298 | action->addTo( helpMenu ); |
1289 | connect( action, SIGNAL( activated() ), | 1299 | connect( action, SIGNAL( activated() ), |
1290 | SLOT( whatsNew() ) ); | 1300 | SLOT( whatsNew() ) ); |
1291 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 1301 | action = new Q3Action( "featureHowto", i18n("Features + hints..."), 0,this ); |
1292 | action->addTo( helpMenu ); | 1302 | action->addTo( helpMenu ); |
1293 | connect( action, SIGNAL( activated() ), | 1303 | connect( action, SIGNAL( activated() ), |
1294 | SLOT( features() ) ); | 1304 | SLOT( features() ) ); |
1295 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 1305 | action = new Q3Action( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
1296 | action->addTo( helpMenu ); | 1306 | action->addTo( helpMenu ); |
1297 | connect( action, SIGNAL( activated() ), | 1307 | connect( action, SIGNAL( activated() ), |
1298 | SLOT( keyBindings() ) ); | 1308 | SLOT( keyBindings() ) ); |
1299 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); | 1309 | action = new Q3Action( "Storage Howto", i18n("Storage HowTo..."), 0,this ); |
1300 | action->addTo( helpMenu ); | 1310 | action->addTo( helpMenu ); |
1301 | connect( action, SIGNAL( activated() ), | 1311 | connect( action, SIGNAL( activated() ), |
1302 | SLOT( storagehowto() ) ); | 1312 | SLOT( storagehowto() ) ); |
1303 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); | 1313 | action = new Q3Action( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); |
1304 | action->addTo( helpMenu ); | 1314 | action->addTo( helpMenu ); |
1305 | connect( action, SIGNAL( activated() ), | 1315 | connect( action, SIGNAL( activated() ), |
1306 | SLOT( timetrackinghowto() ) ); | 1316 | SLOT( timetrackinghowto() ) ); |
1307 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 1317 | action = new Q3Action( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
1308 | action->addTo( helpMenu ); | 1318 | action->addTo( helpMenu ); |
1309 | connect( action, SIGNAL( activated() ), | 1319 | connect( action, SIGNAL( activated() ), |
1310 | SLOT( synchowto() ) ); | 1320 | SLOT( synchowto() ) ); |
1311 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 1321 | action = new Q3Action( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
1312 | action->addTo( helpMenu ); | 1322 | action->addTo( helpMenu ); |
1313 | connect( action, SIGNAL( activated() ), | 1323 | connect( action, SIGNAL( activated() ), |
1314 | SLOT( kdesynchowto() ) ); | 1324 | SLOT( kdesynchowto() ) ); |
1315 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 1325 | action = new Q3Action( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
1316 | action->addTo( helpMenu ); | 1326 | action->addTo( helpMenu ); |
1317 | connect( action, SIGNAL( activated() ), | 1327 | connect( action, SIGNAL( activated() ), |
1318 | SLOT( multisynchowto() ) ); | 1328 | SLOT( multisynchowto() ) ); |
1319 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 1329 | action = new Q3Action( "Auto saving", i18n("Auto saving..."), 0, this ); |
1320 | action->addTo( helpMenu ); | 1330 | action->addTo( helpMenu ); |
1321 | connect( action, SIGNAL( activated() ), | 1331 | connect( action, SIGNAL( activated() ), |
1322 | SLOT( aboutAutoSaving() ) ); | 1332 | SLOT( aboutAutoSaving() ) ); |
1323 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 1333 | action = new Q3Action( "Problemd", i18n("Known Problems..."), 0,this ); |
1324 | action->addTo( helpMenu ); | 1334 | action->addTo( helpMenu ); |
1325 | connect( action, SIGNAL( activated() ), | 1335 | connect( action, SIGNAL( activated() ), |
1326 | SLOT( aboutKnownBugs() ) ); | 1336 | SLOT( aboutKnownBugs() ) ); |
1327 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 1337 | action = new Q3Action( "Translate Howto", i18n("User translation..."), 0,this ); |
1328 | action->addTo( helpMenu ); | 1338 | action->addTo( helpMenu ); |
1329 | connect( action, SIGNAL( activated() ), | 1339 | connect( action, SIGNAL( activated() ), |
1330 | SLOT( usertrans() ) ); | 1340 | SLOT( usertrans() ) ); |
1331 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 1341 | action = new Q3Action( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
1332 | action->addTo( helpMenu ); | 1342 | action->addTo( helpMenu ); |
1333 | connect( action, SIGNAL( activated() ), | 1343 | connect( action, SIGNAL( activated() ), |
1334 | SLOT( faq() ) ); | 1344 | SLOT( faq() ) ); |
1335 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 1345 | action = new Q3Action( "licence", i18n("Licence..."), 0, this ); |
1336 | action->addTo( helpMenu ); | 1346 | action->addTo( helpMenu ); |
1337 | connect( action, SIGNAL( activated() ), | 1347 | connect( action, SIGNAL( activated() ), |
1338 | SLOT( licence() ) ); | 1348 | SLOT( licence() ) ); |
1339 | action = new QAction( "about", i18n("About..."), 0, this ); | 1349 | action = new Q3Action( "about", i18n("About..."), 0, this ); |
1340 | action->addTo( helpMenu ); | 1350 | action->addTo( helpMenu ); |
1341 | connect( action, SIGNAL( activated() ), | 1351 | connect( action, SIGNAL( activated() ), |
1342 | SLOT( about() ) ); | 1352 | SLOT( about() ) ); |
1343 | //menuBar->insertSeparator(); | 1353 | //menuBar->insertSeparator(); |
1344 | 1354 | ||
1345 | // ****************************************************** | 1355 | // ****************************************************** |
@@ -1353,13 +1363,13 @@ void MainWindow::initActions() | |||
1353 | ne_action->addTo( iconToolBar ); | 1363 | ne_action->addTo( iconToolBar ); |
1354 | if (p->mShowIconNewTodo ) | 1364 | if (p->mShowIconNewTodo ) |
1355 | nt_action->addTo( iconToolBar ); | 1365 | nt_action->addTo( iconToolBar ); |
1356 | if (p-> mShowIconSearch) | 1366 | if (p-> mShowIconSearch) |
1357 | search_action->addTo( iconToolBar ); | 1367 | search_action->addTo( iconToolBar ); |
1358 | if (p-> mShowIconWhatsThis) | 1368 | if (p-> mShowIconWhatsThis) |
1359 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1369 | Q3WhatsThis::whatsThisButton ( iconToolBar ); |
1360 | if (p-> mShowIconNext) | 1370 | if (p-> mShowIconNext) |
1361 | whatsnext_action->addTo( viewToolBar ); | 1371 | whatsnext_action->addTo( viewToolBar ); |
1362 | if (p-> mShowIconNextDays) | 1372 | if (p-> mShowIconNextDays) |
1363 | xdays_action->addTo( viewToolBar ); | 1373 | xdays_action->addTo( viewToolBar ); |
1364 | if (p-> mShowIconJournal) | 1374 | if (p-> mShowIconJournal) |
1365 | viewjournal_action->addTo( viewToolBar ); | 1375 | viewjournal_action->addTo( viewToolBar ); |
@@ -1378,41 +1388,41 @@ void MainWindow::initActions() | |||
1378 | if (p-> mShowIconTodoview) | 1388 | if (p-> mShowIconTodoview) |
1379 | todoview_action->addTo( viewToolBar ); | 1389 | todoview_action->addTo( viewToolBar ); |
1380 | 1390 | ||
1381 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1391 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1382 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); | 1392 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); |
1383 | if (p-> mShowIconBackFast) { | 1393 | if (p-> mShowIconBackFast) { |
1384 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1394 | action = new Q3Action( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1385 | connect( action, SIGNAL( activated() ), | 1395 | connect( action, SIGNAL( activated() ), |
1386 | mView, SLOT( goPreviousMonth() ) ); | 1396 | mView, SLOT( goPreviousMonth() ) ); |
1387 | action->addTo( navigatorToolBar ); | 1397 | action->addTo( navigatorToolBar ); |
1388 | } | 1398 | } |
1389 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1399 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1390 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); | 1400 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); |
1391 | if (p-> mShowIconBack) { | 1401 | if (p-> mShowIconBack) { |
1392 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1402 | action = new Q3Action( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1393 | connect( action, SIGNAL( activated() ), | 1403 | connect( action, SIGNAL( activated() ), |
1394 | mView, SLOT( goPrevious() ) ); | 1404 | mView, SLOT( goPrevious() ) ); |
1395 | action->addTo( navigatorToolBar ); | 1405 | action->addTo( navigatorToolBar ); |
1396 | } | 1406 | } |
1397 | icon = loadPixmap( pathString + "today" ); | 1407 | icon = loadPixmap( pathString + "today" ); |
1398 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1408 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1399 | if (p-> mShowIconToday) | 1409 | if (p-> mShowIconToday) |
1400 | today_action->addTo( navigatorToolBar ); | 1410 | today_action->addTo( navigatorToolBar ); |
1401 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1411 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1402 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1412 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1403 | if (p-> mShowIconForward) { | 1413 | if (p-> mShowIconForward) { |
1404 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1414 | action = new Q3Action( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1405 | connect( action, SIGNAL( activated() ), | 1415 | connect( action, SIGNAL( activated() ), |
1406 | mView, SLOT( goNext() ) ); | 1416 | mView, SLOT( goNext() ) ); |
1407 | action->addTo( navigatorToolBar ); | 1417 | action->addTo( navigatorToolBar ); |
1408 | } | 1418 | } |
1409 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1419 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1410 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1420 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1411 | if (p-> mShowIconForwardFast) { | 1421 | if (p-> mShowIconForwardFast) { |
1412 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1422 | action = new Q3Action( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1413 | connect( action, SIGNAL( activated() ), | 1423 | connect( action, SIGNAL( activated() ), |
1414 | mView, SLOT( goNextMonth() ) ); | 1424 | mView, SLOT( goNextMonth() ) ); |
1415 | action->addTo( navigatorToolBar ); | 1425 | action->addTo( navigatorToolBar ); |
1416 | } | 1426 | } |
1417 | 1427 | ||
1418 | 1428 | ||
@@ -1521,13 +1531,13 @@ void MainWindow::exportToPhone( int mode ) | |||
1521 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1531 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1522 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1532 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1523 | 1533 | ||
1524 | int inFuture = 0; | 1534 | int inFuture = 0; |
1525 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1535 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1526 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1536 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1527 | QPtrList<Incidence> delSel; | 1537 | Q3PtrList<Incidence> delSel; |
1528 | if ( mode == 1 ) | 1538 | if ( mode == 1 ) |
1529 | delSel = mCalendar->rawIncidences(); | 1539 | delSel = mCalendar->rawIncidences(); |
1530 | if ( mode == 2 ) | 1540 | if ( mode == 2 ) |
1531 | delSel = mCalendar->incidences(); | 1541 | delSel = mCalendar->incidences(); |
1532 | CalendarLocal* cal = new CalendarLocal(); | 1542 | CalendarLocal* cal = new CalendarLocal(); |
1533 | cal->setLocalTime(); | 1543 | cal->setLocalTime(); |
@@ -1592,16 +1602,16 @@ QString MainWindow::resourcePath() | |||
1592 | } | 1602 | } |
1593 | 1603 | ||
1594 | void MainWindow::displayText( QString text ,QString cap ) | 1604 | void MainWindow::displayText( QString text ,QString cap ) |
1595 | { | 1605 | { |
1596 | QDialog dia( this, "name", true ); ; | 1606 | QDialog dia( this, "name", true ); ; |
1597 | dia.setCaption( cap ); | 1607 | dia.setCaption( cap ); |
1598 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1608 | Q3VBoxLayout* lay = new Q3VBoxLayout( &dia ); |
1599 | lay->setSpacing( 3 ); | 1609 | lay->setSpacing( 3 ); |
1600 | lay->setMargin( 3 ); | 1610 | lay->setMargin( 3 ); |
1601 | QTextBrowser tb ( &dia ); | 1611 | Q3TextBrowser tb ( &dia ); |
1602 | lay->addWidget( &tb ); | 1612 | lay->addWidget( &tb ); |
1603 | tb.setText( text ); | 1613 | tb.setText( text ); |
1604 | #ifdef DESKTOP_VERSION | 1614 | #ifdef DESKTOP_VERSION |
1605 | dia.resize( 640, 480); | 1615 | dia.resize( 640, 480); |
1606 | #else | 1616 | #else |
1607 | dia.showMaximized(); | 1617 | dia.showMaximized(); |
@@ -1774,15 +1784,15 @@ QString MainWindow::syncFileName() | |||
1774 | void MainWindow::updateWeek(QDate seda) | 1784 | void MainWindow::updateWeek(QDate seda) |
1775 | { | 1785 | { |
1776 | int weekNum = KGlobal::locale()->weekNum ( seda ); | 1786 | int weekNum = KGlobal::locale()->weekNum ( seda ); |
1777 | mWeekPixmap.fill( mWeekBgColor ); | 1787 | mWeekPixmap.fill( mWeekBgColor ); |
1778 | QPainter p ( &mWeekPixmap ); | 1788 | QPainter p ( &mWeekPixmap ); |
1779 | p.setFont( mWeekFont ); | 1789 | p.setFont( mWeekFont ); |
1780 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); | 1790 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),Qt::AlignCenter, QString::number( weekNum) ); |
1781 | p.end(); | 1791 | p.end(); |
1782 | QIconSet icon3 ( mWeekPixmap ); | 1792 | QIcon icon3 ( mWeekPixmap ); |
1783 | mWeekAction->setIconSet ( icon3 ); | 1793 | mWeekAction->setIconSet ( icon3 ); |
1784 | 1794 | ||
1785 | } | 1795 | } |
1786 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1796 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1787 | { | 1797 | { |
1788 | updateWeek( selectedDates.first() ); | 1798 | updateWeek( selectedDates.first() ); |
@@ -1809,13 +1819,13 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
1809 | } else { | 1819 | } else { |
1810 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1820 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1811 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1821 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1812 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1822 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1813 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { | 1823 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { |
1814 | bool ok; | 1824 | bool ok; |
1815 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1825 | QDateTime noc = incidence->getNextOccurence( (QDateTime)mView->startDate().addDays(-1), &ok ); |
1816 | if ( ok ) { | 1826 | if ( ok ) { |
1817 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1827 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1818 | startString += i18n(" (%1 y.)"). arg( years ); | 1828 | startString += i18n(" (%1 y.)"). arg( years ); |
1819 | } | 1829 | } |
1820 | } | 1830 | } |
1821 | else | 1831 | else |
@@ -1843,19 +1853,19 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
1843 | mNewSubTodoAction->setEnabled( false ); | 1853 | mNewSubTodoAction->setEnabled( false ); |
1844 | } | 1854 | } |
1845 | #ifdef DESKTOP_VERSION | 1855 | #ifdef DESKTOP_VERSION |
1846 | static QPixmap jP = SmallIcon( "journal" ); | 1856 | static QPixmap jP = SmallIcon( "journal" ); |
1847 | static QPixmap eP = SmallIcon( "newevent" ); | 1857 | static QPixmap eP = SmallIcon( "newevent" ); |
1848 | static QPixmap tP = SmallIcon( "newtodo" ); | 1858 | static QPixmap tP = SmallIcon( "newtodo" ); |
1849 | QIconSet icon; | 1859 | QIcon icon; |
1850 | if ( incidence->typeID() == todoID ) | 1860 | if ( incidence->typeID() == todoID ) |
1851 | icon = QIconSet ( tP ); | 1861 | icon = QIcon ( tP ); |
1852 | else if ( incidence->typeID() == eventID ) | 1862 | else if ( incidence->typeID() == eventID ) |
1853 | icon = QIconSet ( eP ); | 1863 | icon = QIcon ( eP ); |
1854 | else if ( incidence->typeID() == journalID ) | 1864 | else if ( incidence->typeID() == journalID ) |
1855 | icon = QIconSet ( jP ); | 1865 | icon = QIcon ( jP ); |
1856 | mPrintSelAction->setIconSet ( icon ); | 1866 | mPrintSelAction->setIconSet ( icon ); |
1857 | #endif | 1867 | #endif |
1858 | } | 1868 | } |
1859 | 1869 | ||
1860 | void MainWindow::enableIncidenceActions( bool enabled ) | 1870 | void MainWindow::enableIncidenceActions( bool enabled ) |
1861 | { | 1871 | { |
@@ -2042,13 +2052,13 @@ void MainWindow::backupAllFiles() | |||
2042 | qDebug("KO: Backup cancelled. Will try again tomorrow "); | 2052 | qDebug("KO: Backup cancelled. Will try again tomorrow "); |
2043 | // retval == 0 : backup skipped for today, try again tomorrow | 2053 | // retval == 0 : backup skipped for today, try again tomorrow |
2044 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; | 2054 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; |
2045 | } else if ( retval == 1 ){ | 2055 | } else if ( retval == 1 ){ |
2046 | qDebug("KO: Backup created."); | 2056 | qDebug("KO: Backup created."); |
2047 | // backup ok | 2057 | // backup ok |
2048 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 2058 | Q3PtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
2049 | KopiCalendarFile * cal = calendars.first(); | 2059 | KopiCalendarFile * cal = calendars.first(); |
2050 | cal = calendars.next(); | 2060 | cal = calendars.next(); |
2051 | while ( cal ) { | 2061 | while ( cal ) { |
2052 | if ( !cal->mErrorOnLoad ) { | 2062 | if ( !cal->mErrorOnLoad ) { |
2053 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 2063 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
2054 | } | 2064 | } |
@@ -2338,13 +2348,13 @@ void MainWindow::fillFilterMenuTB() | |||
2338 | selectFilterMenuTB->clear(); | 2348 | selectFilterMenuTB->clear(); |
2339 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); | 2349 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); |
2340 | selectFilterMenuTB->insertSeparator(); | 2350 | selectFilterMenuTB->insertSeparator(); |
2341 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); | 2351 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); |
2342 | 2352 | ||
2343 | selectFilterMenuTB->insertSeparator(); | 2353 | selectFilterMenuTB->insertSeparator(); |
2344 | QPtrList<CalFilter> fili = mView->filters(); | 2354 | Q3PtrList<CalFilter> fili = mView->filters(); |
2345 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2355 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2346 | CalFilter *filter = fili.first(); | 2356 | CalFilter *filter = fili.first(); |
2347 | int iii = 2; | 2357 | int iii = 2; |
2348 | bool checkitem = mView->filterView()->filtersEnabled(); | 2358 | bool checkitem = mView->filterView()->filtersEnabled(); |
2349 | while(filter) { | 2359 | while(filter) { |
2350 | selectFilterMenuTB->insertItem( filter->name(), iii ); | 2360 | selectFilterMenuTB->insertItem( filter->name(), iii ); |
@@ -2383,13 +2393,13 @@ void MainWindow::fillFilterMenu() | |||
2383 | selectFilterMenu->clear(); | 2393 | selectFilterMenu->clear(); |
2384 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 2394 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
2385 | selectFilterMenu->insertSeparator(); | 2395 | selectFilterMenu->insertSeparator(); |
2386 | selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); | 2396 | selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); |
2387 | 2397 | ||
2388 | selectFilterMenu->insertSeparator(); | 2398 | selectFilterMenu->insertSeparator(); |
2389 | QPtrList<CalFilter> fili = mView->filters(); | 2399 | Q3PtrList<CalFilter> fili = mView->filters(); |
2390 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2400 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2391 | CalFilter *filter = fili.first(); | 2401 | CalFilter *filter = fili.first(); |
2392 | int iii = 2; | 2402 | int iii = 2; |
2393 | bool checkitem = mView->filterView()->filtersEnabled(); | 2403 | bool checkitem = mView->filterView()->filtersEnabled(); |
2394 | while(filter) { | 2404 | while(filter) { |
2395 | selectFilterMenu->insertItem( filter->name(), iii ); | 2405 | selectFilterMenu->insertItem( filter->name(), iii ); |
@@ -2404,13 +2414,13 @@ void MainWindow::fillFilterMenu() | |||
2404 | void MainWindow::fillFilterMenuPopup() | 2414 | void MainWindow::fillFilterMenuPopup() |
2405 | { | 2415 | { |
2406 | filterPopupMenu->clear(); | 2416 | filterPopupMenu->clear(); |
2407 | filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); | 2417 | filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); |
2408 | 2418 | ||
2409 | filterPopupMenu->insertSeparator(); | 2419 | filterPopupMenu->insertSeparator(); |
2410 | QPtrList<CalFilter> fili = mView->filters(); | 2420 | Q3PtrList<CalFilter> fili = mView->filters(); |
2411 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2421 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2412 | CalFilter *filter = fili.first(); | 2422 | CalFilter *filter = fili.first(); |
2413 | int iii = 1; | 2423 | int iii = 1; |
2414 | bool checkitem = mView->filterView()->filtersEnabled(); | 2424 | bool checkitem = mView->filterView()->filtersEnabled(); |
2415 | while(filter) { | 2425 | while(filter) { |
2416 | filterPopupMenu->insertItem( filter->name(), iii ); | 2426 | filterPopupMenu->insertItem( filter->name(), iii ); |
@@ -2816,8 +2826,8 @@ void MainWindow::resizeEvent( QResizeEvent* e) | |||
2816 | filterToolBar->hide(); | 2826 | filterToolBar->hide(); |
2817 | else | 2827 | else |
2818 | filterToolBar->show(); | 2828 | filterToolBar->show(); |
2819 | } | 2829 | } |
2820 | } | 2830 | } |
2821 | #endif | 2831 | #endif |
2822 | QMainWindow::resizeEvent( e); | 2832 | Q3MainWindow::resizeEvent( e); |
2823 | } | 2833 | } |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index a533d8b..6756216 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -1,40 +1,48 @@ | |||
1 | #ifndef KORGE_MAINWINDOW_H | 1 | #ifndef KORGE_MAINWINDOW_H |
2 | #define KORGE_MAINWINDOW_H | 2 | #define KORGE_MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <q3mainwindow.h> |
5 | #include <qtimer.h> | 5 | #include <qtimer.h> |
6 | #include <qdict.h> | 6 | #include <q3dict.h> |
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | #include <qmenubar.h> | 8 | #include <qmenubar.h> |
9 | #include <qtextstream.h> | 9 | #include <q3textstream.h> |
10 | #include <qregexp.h> | 10 | #include <qregexp.h> |
11 | //Added by qt3to4: | ||
12 | #include <Q3CString> | ||
13 | #include <QCloseEvent> | ||
14 | #include <QResizeEvent> | ||
15 | #include <QPixmap> | ||
16 | #include <Q3PopupMenu> | ||
17 | #include <QHideEvent> | ||
18 | #include <QKeyEvent> | ||
11 | 19 | ||
12 | #include <libkcal/incidence.h> | 20 | #include <libkcal/incidence.h> |
13 | #include <ksyncmanager.h> | 21 | #include <ksyncmanager.h> |
14 | #include <kpopupmenu.h> | 22 | #include <kpopupmenu.h> |
15 | #ifndef DESKTOP_VERSION | 23 | #ifndef DESKTOP_VERSION |
16 | #include <qcopchannel_qws.h> | 24 | #include <qcopchannel_qws.h> |
17 | #endif | 25 | #endif |
18 | class QAction; | 26 | class Q3Action; |
19 | class CalendarView; | 27 | class CalendarView; |
20 | class KSyncProfile; | 28 | class KSyncProfile; |
21 | #ifdef DESKTOP_VERSION | 29 | #ifdef DESKTOP_VERSION |
22 | 30 | ||
23 | #define QPEToolBar QToolBar | 31 | #define QPEToolBar Q3ToolBar |
24 | #endif | 32 | #endif |
25 | class QPEToolBar; | 33 | class QPEToolBar; |
26 | 34 | ||
27 | 35 | ||
28 | namespace KCal { | 36 | namespace KCal { |
29 | class CalendarLocal; | 37 | class CalendarLocal; |
30 | } | 38 | } |
31 | 39 | ||
32 | using namespace KCal; | 40 | using namespace KCal; |
33 | 41 | ||
34 | class MainWindow : public QMainWindow | 42 | class MainWindow : public Q3MainWindow |
35 | { | 43 | { |
36 | Q_OBJECT | 44 | Q_OBJECT |
37 | public: | 45 | public: |
38 | MainWindow( QWidget *parent = 0, const char *name = 0 ); | 46 | MainWindow( QWidget *parent = 0, const char *name = 0 ); |
39 | ~MainWindow(); | 47 | ~MainWindow(); |
40 | bool beamReceiveEnabled(); | 48 | bool beamReceiveEnabled(); |
@@ -46,14 +54,14 @@ class MainWindow : public QMainWindow | |||
46 | void setCaption ( const QString & ); | 54 | void setCaption ( const QString & ); |
47 | void updateWeekNum(const KCal::DateList &); | 55 | void updateWeekNum(const KCal::DateList &); |
48 | void updateWeek(QDate); | 56 | void updateWeek(QDate); |
49 | void updateFilterToolbar(); | 57 | void updateFilterToolbar(); |
50 | virtual void showMaximized (); | 58 | virtual void showMaximized (); |
51 | void configureAgenda( int ); | 59 | void configureAgenda( int ); |
52 | void recieve( const QCString& msg, const QByteArray& data ); | 60 | void recieve( const Q3CString& msg, const QByteArray& data ); |
53 | void receiveStart( const QCString& msg, const QByteArray& data ); | 61 | void receiveStart( const Q3CString& msg, const QByteArray& data ); |
54 | protected slots: | 62 | protected slots: |
55 | void autoSaveWarning(); | 63 | void autoSaveWarning(); |
56 | void loadDataAfterStart(); | 64 | void loadDataAfterStart(); |
57 | void calHint(); | 65 | void calHint(); |
58 | void startMultiSync(); | 66 | void startMultiSync(); |
59 | void setCaptionToDates(); | 67 | void setCaptionToDates(); |
@@ -121,64 +129,64 @@ class MainWindow : public QMainWindow | |||
121 | void enableIncidenceActions( bool ); | 129 | void enableIncidenceActions( bool ); |
122 | bool askForQuitOnSaveError(); | 130 | bool askForQuitOnSaveError(); |
123 | 131 | ||
124 | private: | 132 | private: |
125 | bool mAutoSaveDisabled; | 133 | bool mAutoSaveDisabled; |
126 | bool checkAutosave(); | 134 | bool checkAutosave(); |
127 | QCString mCStringMess; | 135 | Q3CString mCStringMess; |
128 | QByteArray mByteData; | 136 | QByteArray mByteData; |
129 | 137 | ||
130 | //void setMenuBar( QMenuBar * ); | 138 | //void setMenuBar( QMenuBar * ); |
131 | bool mBRdisabled; | 139 | bool mBRdisabled; |
132 | #ifndef DESKTOP_VERSION | 140 | #ifndef DESKTOP_VERSION |
133 | QCopChannel* infrared; | 141 | QCopChannel* infrared; |
134 | #endif | 142 | #endif |
135 | QAction* brAction; | 143 | Q3Action* brAction; |
136 | KSyncManager* mSyncManager; | 144 | KSyncManager* mSyncManager; |
137 | bool mClosed; | 145 | bool mClosed; |
138 | void saveOnClose(); | 146 | void saveOnClose(); |
139 | bool mFlagKeyPressed; | 147 | bool mFlagKeyPressed; |
140 | bool mBlockAtStartup; | 148 | bool mBlockAtStartup; |
141 | KMenuBar *menuBar1; | 149 | KMenuBar *menuBar1; |
142 | QPEToolBar *iconToolBar; | 150 | QPEToolBar *iconToolBar; |
143 | QPEToolBar *viewToolBar; | 151 | QPEToolBar *viewToolBar; |
144 | QPEToolBar *navigatorToolBar; | 152 | QPEToolBar *navigatorToolBar; |
145 | QPEToolBar *filterToolBar; | 153 | QPEToolBar *filterToolBar; |
146 | KMenuBar *filterMenubar; | 154 | KMenuBar *filterMenubar; |
147 | QPopupMenu * filterPopupMenu; | 155 | Q3PopupMenu * filterPopupMenu; |
148 | QPopupMenu * mCurrentItemMenu; | 156 | Q3PopupMenu * mCurrentItemMenu; |
149 | void initActions(); | 157 | void initActions(); |
150 | void setDefaultPreferences(); | 158 | void setDefaultPreferences(); |
151 | void resizeEvent( QResizeEvent* e); | 159 | void resizeEvent( QResizeEvent* e); |
152 | void keyPressEvent ( QKeyEvent * ) ; | 160 | void keyPressEvent ( QKeyEvent * ) ; |
153 | void keyReleaseEvent ( QKeyEvent * ) ; | 161 | void keyReleaseEvent ( QKeyEvent * ) ; |
154 | QPopupMenu *configureToolBarMenu; | 162 | Q3PopupMenu *configureToolBarMenu; |
155 | QPopupMenu *selectFilterMenu; | 163 | Q3PopupMenu *selectFilterMenu; |
156 | QPopupMenu *selectFilterMenuTB; | 164 | Q3PopupMenu *selectFilterMenuTB; |
157 | QPopupMenu *configureAgendaMenu, *syncMenu; | 165 | Q3PopupMenu *configureAgendaMenu, *syncMenu; |
158 | CalendarLocal *mCalendar; | 166 | CalendarLocal *mCalendar; |
159 | CalendarView *mView; | 167 | CalendarView *mView; |
160 | QAction *mNewSubTodoAction; | 168 | Q3Action *mNewSubTodoAction; |
161 | QAction *mWeekAction; | 169 | Q3Action *mWeekAction; |
162 | QFont mWeekFont; | 170 | QFont mWeekFont; |
163 | QPixmap mWeekPixmap; | 171 | QPixmap mWeekPixmap; |
164 | QColor mWeekBgColor; | 172 | QColor mWeekBgColor; |
165 | 173 | ||
166 | QAction *mShowAction; | 174 | Q3Action *mShowAction; |
167 | QAction *mEditAction; | 175 | Q3Action *mEditAction; |
168 | QAction *mDeleteAction; | 176 | Q3Action *mDeleteAction; |
169 | QAction *mCloneAction; | 177 | Q3Action *mCloneAction; |
170 | QAction *mMoveAction; | 178 | Q3Action *mMoveAction; |
171 | QAction *mBeamAction; | 179 | Q3Action *mBeamAction; |
172 | QAction *mCancelAction; | 180 | Q3Action *mCancelAction; |
173 | QAction *mPrintSelAction; | 181 | Q3Action *mPrintSelAction; |
174 | 182 | ||
175 | QAction *mToggleNav; | 183 | Q3Action *mToggleNav; |
176 | QAction *mToggleFilter; | 184 | Q3Action *mToggleFilter; |
177 | QAction *mToggleAllday; | 185 | Q3Action *mToggleAllday; |
178 | QAction *actionFilterMenuTB; | 186 | Q3Action *actionFilterMenuTB; |
179 | 187 | ||
180 | void closeEvent( QCloseEvent* ce ); | 188 | void closeEvent( QCloseEvent* ce ); |
181 | QTimer mSaveTimer; | 189 | QTimer mSaveTimer; |
182 | QDateTime mSaveTimerStart; | 190 | QDateTime mSaveTimerStart; |
183 | int mSaveDelay; | 191 | int mSaveDelay; |
184 | //bool mBlockSaveFlag; | 192 | //bool mBlockSaveFlag; |
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp index f6a1a6a..59c3e45 100644 --- a/korganizer/navigatorbar.cpp +++ b/korganizer/navigatorbar.cpp | |||
@@ -23,16 +23,19 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qstring.h> | 25 | #include <qstring.h> |
26 | #include <qtooltip.h> | 26 | #include <qtooltip.h> |
27 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qframe.h> | 29 | #include <q3frame.h> |
30 | #include <qlabel.h> | 30 | #include <qlabel.h> |
31 | #include <qpopupmenu.h> | 31 | #include <q3popupmenu.h> |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #include <QDesktopWidget> | ||
34 | //Added by qt3to4: | ||
35 | #include <Q3HBoxLayout> | ||
33 | 36 | ||
34 | #include <kdebug.h> | 37 | #include <kdebug.h> |
35 | #include <klocale.h> | 38 | #include <klocale.h> |
36 | #include <kglobal.h> | 39 | #include <kglobal.h> |
37 | #include <kiconloader.h> | 40 | #include <kiconloader.h> |
38 | #include "libkdepim/kdatepicker.h" | 41 | #include "libkdepim/kdatepicker.h" |
@@ -50,17 +53,17 @@ | |||
50 | 53 | ||
51 | #include "navigatorbar.h" | 54 | #include "navigatorbar.h" |
52 | 55 | ||
53 | NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) | 56 | NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) |
54 | : QWidget( parent, name ) | 57 | : QWidget( parent, name ) |
55 | { | 58 | { |
56 | QBoxLayout *topLayout = new QHBoxLayout( this ); | 59 | Q3BoxLayout *topLayout = new Q3HBoxLayout( this ); |
57 | 60 | ||
58 | // Set up the control buttons and date label | 61 | // Set up the control buttons and date label |
59 | mCtrlFrame = new QFrame( this ); | 62 | mCtrlFrame = new Q3Frame( this ); |
60 | mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); | 63 | mCtrlFrame->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised); |
61 | mCtrlFrame->setLineWidth(1); | 64 | mCtrlFrame->setLineWidth(1); |
62 | 65 | ||
63 | topLayout->addWidget( mCtrlFrame ); | 66 | topLayout->addWidget( mCtrlFrame ); |
64 | 67 | ||
65 | 68 | ||
66 | 69 | ||
@@ -126,13 +129,13 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
126 | } | 129 | } |
127 | 130 | ||
128 | resetFont( font() ); | 131 | resetFont( font() ); |
129 | 132 | ||
130 | 133 | ||
131 | // set up control frame layout | 134 | // set up control frame layout |
132 | QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); | 135 | Q3BoxLayout *ctrlLayout = new Q3HBoxLayout( mCtrlFrame, 1 ); |
133 | ctrlLayout->addWidget( mPrevYear, 3 ); | 136 | ctrlLayout->addWidget( mPrevYear, 3 ); |
134 | ctrlLayout->addWidget( mPrevMonth, 3 ); | 137 | ctrlLayout->addWidget( mPrevMonth, 3 ); |
135 | ctrlLayout->addWidget( mPrevWeek, 3 ); | 138 | ctrlLayout->addWidget( mPrevWeek, 3 ); |
136 | //ctrlLayout->addStretch( 1 ); | 139 | //ctrlLayout->addStretch( 1 ); |
137 | // ctrlLayout->addSpacing( 1 ); | 140 | // ctrlLayout->addSpacing( 1 ); |
138 | // ctrlLayout->addWidget( mDateLabel ); | 141 | // ctrlLayout->addWidget( mDateLabel ); |
@@ -147,19 +150,19 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam | |||
147 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); | 150 | connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); |
148 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); | 151 | connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); |
149 | connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); | 152 | connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); |
150 | connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); | 153 | connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); |
151 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); | 154 | connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); |
152 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); | 155 | connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); |
153 | mPrevYear->setFocusPolicy(NoFocus); | 156 | mPrevYear->setFocusPolicy(Qt::NoFocus); |
154 | mPrevMonth->setFocusPolicy(NoFocus); | 157 | mPrevMonth->setFocusPolicy(Qt::NoFocus); |
155 | mNextMonth->setFocusPolicy(NoFocus); | 158 | mNextMonth->setFocusPolicy(Qt::NoFocus); |
156 | mPrevWeek->setFocusPolicy(NoFocus); | 159 | mPrevWeek->setFocusPolicy(Qt::NoFocus); |
157 | mNextWeek->setFocusPolicy(NoFocus); | 160 | mNextWeek->setFocusPolicy(Qt::NoFocus); |
158 | mNextYear->setFocusPolicy(NoFocus); | 161 | mNextYear->setFocusPolicy(Qt::NoFocus); |
159 | mSelectMonth->setFocusPolicy(NoFocus); | 162 | mSelectMonth->setFocusPolicy(Qt::NoFocus); |
160 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); | 163 | setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); |
161 | 164 | ||
162 | } | 165 | } |
163 | 166 | ||
164 | NavigatorBar::~NavigatorBar() | 167 | NavigatorBar::~NavigatorBar() |
165 | { | 168 | { |
diff --git a/korganizer/navigatorbar.h b/korganizer/navigatorbar.h index 9ccef14..a1880f5 100644 --- a/korganizer/navigatorbar.h +++ b/korganizer/navigatorbar.h | |||
@@ -24,15 +24,18 @@ | |||
24 | #ifndef NAVIGATORBAR_H | 24 | #ifndef NAVIGATORBAR_H |
25 | #define NAVIGATORBAR_H | 25 | #define NAVIGATORBAR_H |
26 | 26 | ||
27 | #include <libkcal/incidencebase.h> | 27 | #include <libkcal/incidencebase.h> |
28 | 28 | ||
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | //Added by qt3to4: | ||
31 | #include <Q3Frame> | ||
32 | #include <QLabel> | ||
30 | 33 | ||
31 | class QPushButton; | 34 | class QPushButton; |
32 | class QFrame; | 35 | class Q3Frame; |
33 | class QLabel; | 36 | class QLabel; |
34 | 37 | ||
35 | class NavigatorBar: public QWidget | 38 | class NavigatorBar: public QWidget |
36 | { | 39 | { |
37 | Q_OBJECT | 40 | Q_OBJECT |
38 | public: | 41 | public: |
@@ -57,13 +60,13 @@ class NavigatorBar: public QWidget | |||
57 | void monthSelected( int ); | 60 | void monthSelected( int ); |
58 | 61 | ||
59 | private: | 62 | private: |
60 | int mCurrentHei; | 63 | int mCurrentHei; |
61 | int mCurrentMinWid; | 64 | int mCurrentMinWid; |
62 | int mCurrentButtonMinWid; | 65 | int mCurrentButtonMinWid; |
63 | QFrame *mCtrlFrame; | 66 | Q3Frame *mCtrlFrame; |
64 | 67 | ||
65 | QPushButton *mPrevYear; | 68 | QPushButton *mPrevYear; |
66 | QPushButton *mPrevMonth; | 69 | QPushButton *mPrevMonth; |
67 | QPushButton *mNextMonth; | 70 | QPushButton *mNextMonth; |
68 | QPushButton *mPrevWeek; | 71 | QPushButton *mPrevWeek; |
69 | QPushButton *mNextWeek; | 72 | QPushButton *mNextWeek; |
diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp index 7253c8e..ab31274 100644 --- a/korganizer/outgoingdialog.cpp +++ b/korganizer/outgoingdialog.cpp | |||
@@ -18,13 +18,13 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <kdebug.h> | 20 | #include <kdebug.h> |
21 | 21 | ||
22 | #include <qfile.h> | 22 | #include <qfile.h> |
23 | #include <qdir.h> | 23 | #include <qdir.h> |
24 | #include <qtextstream.h> | 24 | #include <q3textstream.h> |
25 | 25 | ||
26 | #include <kglobal.h> | 26 | #include <kglobal.h> |
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | #include <ktempfile.h> | 28 | #include <ktempfile.h> |
29 | #include <kstandarddirs.h> | 29 | #include <kstandarddirs.h> |
30 | 30 | ||
@@ -41,16 +41,16 @@ | |||
41 | 41 | ||
42 | #include "koprefs.h" | 42 | #include "koprefs.h" |
43 | #include "outgoingdialog.h" | 43 | #include "outgoingdialog.h" |
44 | #include "koeventviewerdialog.h" | 44 | #include "koeventviewerdialog.h" |
45 | #include "docprefs.h" | 45 | #include "docprefs.h" |
46 | 46 | ||
47 | ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, | 47 | ScheduleItemOut::ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev, |
48 | Scheduler::Method method, | 48 | Scheduler::Method method, |
49 | const QString &recipients) | 49 | const QString &recipients) |
50 | : QListViewItem(parent) | 50 | : Q3ListViewItem(parent) |
51 | { | 51 | { |
52 | mIncidence = ev; | 52 | mIncidence = ev; |
53 | mMethod = method; | 53 | mMethod = method; |
54 | mRecipients = recipients; | 54 | mRecipients = recipients; |
55 | 55 | ||
56 | // kdDebug() << "ScheduleItemOut: setting the summary" << endl; | 56 | // kdDebug() << "ScheduleItemOut: setting the summary" << endl; |
@@ -120,13 +120,13 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, | |||
120 | //Set the Method | 120 | //Set the Method |
121 | setText(5,Scheduler::translatedMethodName(mMethod)); | 121 | setText(5,Scheduler::translatedMethodName(mMethod)); |
122 | } | 122 | } |
123 | 123 | ||
124 | OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, | 124 | OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, |
125 | const char* name,bool modal, | 125 | const char* name,bool modal, |
126 | WFlags fl) | 126 | Qt::WFlags fl) |
127 | : OutgoingDialog_base(parent,name,modal,fl) | 127 | : OutgoingDialog_base(parent,name,modal,fl) |
128 | { | 128 | { |
129 | mCalendar = calendar; | 129 | mCalendar = calendar; |
130 | 130 | ||
131 | mFormat = new ICalFormat; | 131 | mFormat = new ICalFormat; |
132 | 132 | ||
@@ -136,18 +136,18 @@ OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, | |||
136 | #ifndef KORG_NOMAIL | 136 | #ifndef KORG_NOMAIL |
137 | mScheduler = new MailScheduler(mCalendar); | 137 | mScheduler = new MailScheduler(mCalendar); |
138 | #else | 138 | #else |
139 | mScheduler = new DummyScheduler(mCalendar); | 139 | mScheduler = new DummyScheduler(mCalendar); |
140 | #endif | 140 | #endif |
141 | } | 141 | } |
142 | mMessageListView->setColumnAlignment(1,AlignHCenter); | 142 | mMessageListView->setColumnAlignment(1,Qt::AlignHCenter); |
143 | mMessageListView->setColumnAlignment(2,AlignHCenter); | 143 | mMessageListView->setColumnAlignment(2,Qt::AlignHCenter); |
144 | mMessageListView->setColumnAlignment(3,AlignHCenter); | 144 | mMessageListView->setColumnAlignment(3,Qt::AlignHCenter); |
145 | mMessageListView->setColumnAlignment(4,AlignHCenter); | 145 | mMessageListView->setColumnAlignment(4,Qt::AlignHCenter); |
146 | QObject::connect(mMessageListView,SIGNAL(doubleClicked(QListViewItem *)), | 146 | QObject::connect(mMessageListView,SIGNAL(doubleClicked(Q3ListViewItem *)), |
147 | this,SLOT(showEvent(QListViewItem *))); | 147 | this,SLOT(showEvent(Q3ListViewItem *))); |
148 | mDocPrefs = new DocPrefs("groupschedule"); | 148 | mDocPrefs = new DocPrefs("groupschedule"); |
149 | loadMessages(); | 149 | loadMessages(); |
150 | } | 150 | } |
151 | 151 | ||
152 | OutgoingDialog::~OutgoingDialog() | 152 | OutgoingDialog::~OutgoingDialog() |
153 | { | 153 | { |
@@ -233,13 +233,13 @@ void OutgoingDialog::deleteItem() | |||
233 | deleteMessage(item->event()); | 233 | deleteMessage(item->event()); |
234 | delete(item->event()); | 234 | delete(item->event()); |
235 | mMessageListView->takeItem(item); | 235 | mMessageListView->takeItem(item); |
236 | emit numMessagesChanged(mMessageListView->childCount()); | 236 | emit numMessagesChanged(mMessageListView->childCount()); |
237 | } | 237 | } |
238 | 238 | ||
239 | void OutgoingDialog::showEvent(QListViewItem *qitem) | 239 | void OutgoingDialog::showEvent(Q3ListViewItem *qitem) |
240 | { | 240 | { |
241 | ScheduleItemOut *item = (ScheduleItemOut *)qitem; | 241 | ScheduleItemOut *item = (ScheduleItemOut *)qitem; |
242 | Event *event = 0; | 242 | Event *event = 0; |
243 | Todo *todo = 0; | 243 | Todo *todo = 0; |
244 | if ( item->event()->typeID() == eventID ) { | 244 | if ( item->event()->typeID() == eventID ) { |
245 | event = static_cast<Event *>(item->event()); | 245 | event = static_cast<Event *>(item->event()); |
@@ -291,13 +291,13 @@ void OutgoingDialog::showEvent(QListViewItem *qitem) | |||
291 | 291 | ||
292 | bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method method, | 292 | bool OutgoingDialog::saveMessage(IncidenceBase *incidence,Scheduler::Method method, |
293 | const QString &recipients) | 293 | const QString &recipients) |
294 | { | 294 | { |
295 | KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics"); | 295 | KTempFile ktfile(locateLocal("data","korganizer/outgoing/"),"ics"); |
296 | QString messageText = mFormat->createScheduleMessage(incidence,method); | 296 | QString messageText = mFormat->createScheduleMessage(incidence,method); |
297 | QTextStream *qts = ktfile.textStream(); | 297 | Q3TextStream *qts = ktfile.textStream(); |
298 | *qts << messageText; | 298 | *qts << messageText; |
299 | *qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl; | 299 | *qts << "METHOD-BEGIN:" << endl << method << endl << ":METHOD-END" << endl; |
300 | *qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl; | 300 | *qts << "RECIPIENTS-BEGIN:" << endl << recipients << endl << ":RECIPIENTS-END" << endl; |
301 | mMessageMap[incidence]=ktfile.name(); | 301 | mMessageMap[incidence]=ktfile.name(); |
302 | 302 | ||
303 | return true; | 303 | return true; |
@@ -327,17 +327,17 @@ void OutgoingDialog::loadMessages() | |||
327 | bool inserted = false; | 327 | bool inserted = false; |
328 | QMap<IncidenceBase*, QString>::Iterator iter; | 328 | QMap<IncidenceBase*, QString>::Iterator iter; |
329 | for ( iter = mMessageMap.begin(); iter != mMessageMap.end(); ++iter ) { | 329 | for ( iter = mMessageMap.begin(); iter != mMessageMap.end(); ++iter ) { |
330 | if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true; | 330 | if (iter.data() == outgoingDirName + "/" + (*it)) inserted = true; |
331 | } | 331 | } |
332 | if (!inserted) { | 332 | if (!inserted) { |
333 | if (!f.open(IO_ReadOnly)) { | 333 | if (!f.open(QIODevice::ReadOnly)) { |
334 | kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'" | 334 | kdDebug() << "OutgoingDialog::loadMessage(): Can't open file'" |
335 | << (*it) << "'" << endl; | 335 | << (*it) << "'" << endl; |
336 | } else { | 336 | } else { |
337 | QTextStream t(&f); | 337 | Q3TextStream t(&f); |
338 | QString messageString = t.read(); | 338 | QString messageString = t.read(); |
339 | ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar, | 339 | ScheduleMessage *message = mFormat->parseScheduleMessage(mCalendar, |
340 | messageString); | 340 | messageString); |
341 | int begin_pos = messageString.find("METHOD-BEGIN:"); | 341 | int begin_pos = messageString.find("METHOD-BEGIN:"); |
342 | begin_pos = messageString.find('\n',begin_pos)+1; | 342 | begin_pos = messageString.find('\n',begin_pos)+1; |
343 | QString meth = messageString.mid(begin_pos,1); | 343 | QString meth = messageString.mid(begin_pos,1); |
diff --git a/korganizer/outgoingdialog.h b/korganizer/outgoingdialog.h index a3d561a..e727087 100644 --- a/korganizer/outgoingdialog.h +++ b/korganizer/outgoingdialog.h | |||
@@ -20,27 +20,27 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef OUTGOINGDIALOG_H | 23 | #ifndef OUTGOINGDIALOG_H |
24 | #define OUTGOINGDIALOG_H | 24 | #define OUTGOINGDIALOG_H |
25 | 25 | ||
26 | #include <qlistview.h> | 26 | #include <q3listview.h> |
27 | #include <qmap.h> | 27 | #include <qmap.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | 29 | ||
30 | #include <libkcal/scheduler.h> | 30 | #include <libkcal/scheduler.h> |
31 | 31 | ||
32 | #include "docprefs.h" | 32 | #include "docprefs.h" |
33 | #include "outgoingdialog_base.h" | 33 | #include "outgoingdialog_base.h" |
34 | 34 | ||
35 | using namespace KCal; | 35 | using namespace KCal; |
36 | 36 | ||
37 | class ScheduleItemOut : public QListViewItem | 37 | class ScheduleItemOut : public Q3ListViewItem |
38 | { | 38 | { |
39 | public: | 39 | public: |
40 | ScheduleItemOut(QListView *parent,IncidenceBase *ev, | 40 | ScheduleItemOut(Q3ListView *parent,IncidenceBase *ev, |
41 | Scheduler::Method method, const QString &recipients=QString::null); | 41 | Scheduler::Method method, const QString &recipients=QString::null); |
42 | virtual ~ScheduleItemOut() {} | 42 | virtual ~ScheduleItemOut() {} |
43 | 43 | ||
44 | IncidenceBase *event() { return mIncidence; } | 44 | IncidenceBase *event() { return mIncidence; } |
45 | Scheduler::Method method() { return mMethod; } | 45 | Scheduler::Method method() { return mMethod; } |
46 | QString recipients() { return mRecipients; } | 46 | QString recipients() { return mRecipients; } |
@@ -53,13 +53,13 @@ class ScheduleItemOut : public QListViewItem | |||
53 | 53 | ||
54 | class OutgoingDialog : public OutgoingDialog_base | 54 | class OutgoingDialog : public OutgoingDialog_base |
55 | { | 55 | { |
56 | Q_OBJECT | 56 | Q_OBJECT |
57 | public: | 57 | public: |
58 | OutgoingDialog(Calendar *,QWidget* parent=0,const char* name=0, | 58 | OutgoingDialog(Calendar *,QWidget* parent=0,const char* name=0, |
59 | bool modal=false,WFlags fl=0); | 59 | bool modal=false,Qt::WFlags fl=0); |
60 | ~OutgoingDialog(); | 60 | ~OutgoingDialog(); |
61 | 61 | ||
62 | bool addMessage(IncidenceBase *,Scheduler::Method); | 62 | bool addMessage(IncidenceBase *,Scheduler::Method); |
63 | bool addMessage(IncidenceBase *,Scheduler::Method,const QString &recipients); | 63 | bool addMessage(IncidenceBase *,Scheduler::Method,const QString &recipients); |
64 | void setDocumentId( const QString &id ); | 64 | void setDocumentId( const QString &id ); |
65 | 65 | ||
@@ -69,13 +69,13 @@ class OutgoingDialog : public OutgoingDialog_base | |||
69 | signals: | 69 | signals: |
70 | void numMessagesChanged(int); | 70 | void numMessagesChanged(int); |
71 | 71 | ||
72 | protected slots: | 72 | protected slots: |
73 | void send(); | 73 | void send(); |
74 | void deleteItem(); | 74 | void deleteItem(); |
75 | void showEvent(QListViewItem *); | 75 | void showEvent(Q3ListViewItem *); |
76 | 76 | ||
77 | private: | 77 | private: |
78 | bool saveMessage(IncidenceBase *,Scheduler::Method,const QString &recipients=0); | 78 | bool saveMessage(IncidenceBase *,Scheduler::Method,const QString &recipients=0); |
79 | bool deleteMessage(IncidenceBase *); | 79 | bool deleteMessage(IncidenceBase *); |
80 | 80 | ||
81 | Calendar *mCalendar; | 81 | Calendar *mCalendar; |
diff --git a/korganizer/outgoingdialog_base.cpp b/korganizer/outgoingdialog_base.cpp index 1873b44..be8a870 100644 --- a/korganizer/outgoingdialog_base.cpp +++ b/korganizer/outgoingdialog_base.cpp | |||
@@ -8,43 +8,45 @@ | |||
8 | ** WARNING! All changes made in this file will be lost! | 8 | ** WARNING! All changes made in this file will be lost! |
9 | ****************************************************************************/ | 9 | ****************************************************************************/ |
10 | 10 | ||
11 | #include "outgoingdialog_base.h" | 11 | #include "outgoingdialog_base.h" |
12 | 12 | ||
13 | #include <qvariant.h> | 13 | #include <qvariant.h> |
14 | #include <qheader.h> | 14 | #include <q3header.h> |
15 | #include <qlistview.h> | 15 | #include <q3listview.h> |
16 | #include <qpushbutton.h> | 16 | #include <qpushbutton.h> |
17 | #include <qlayout.h> | 17 | #include <qlayout.h> |
18 | #include <qtooltip.h> | 18 | #include <qtooltip.h> |
19 | #include <qwhatsthis.h> | 19 | #include <q3whatsthis.h> |
20 | //Added by qt3to4: | ||
21 | #include <Q3GridLayout> | ||
20 | 22 | ||
21 | /* | 23 | /* |
22 | * Constructs a OutgoingDialog_base as a child of 'parent', with the | 24 | * Constructs a OutgoingDialog_base as a child of 'parent', with the |
23 | * name 'name' and widget flags set to 'f'. | 25 | * name 'name' and widget flags set to 'f'. |
24 | * | 26 | * |
25 | * The dialog will by default be modeless, unless you set 'modal' to | 27 | * The dialog will by default be modeless, unless you set 'modal' to |
26 | * TRUE to construct a modal dialog. | 28 | * TRUE to construct a modal dialog. |
27 | */ | 29 | */ |
28 | OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) | 30 | OutgoingDialog_base::OutgoingDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) |
29 | : QDialog( parent, name, modal, fl ) | 31 | : QDialog( parent, name, modal, fl ) |
30 | 32 | ||
31 | { | 33 | { |
32 | if ( !name ) | 34 | if ( !name ) |
33 | setName( "OutgoingDialog_base" ); | 35 | setName( "OutgoingDialog_base" ); |
34 | OutgoingDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout"); | 36 | OutgoingDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "OutgoingDialog_baseLayout"); |
35 | 37 | ||
36 | mMessageListView = new QListView( this, "mMessageListView" ); | 38 | mMessageListView = new Q3ListView( this, "mMessageListView" ); |
37 | mMessageListView->addColumn( tr2i18n( "Summary" ) ); | 39 | mMessageListView->addColumn( tr2i18n( "Summary" ) ); |
38 | mMessageListView->addColumn( tr2i18n( "Start Date" ) ); | 40 | mMessageListView->addColumn( tr2i18n( "Start Date" ) ); |
39 | mMessageListView->addColumn( tr2i18n( "Start Time" ) ); | 41 | mMessageListView->addColumn( tr2i18n( "Start Time" ) ); |
40 | mMessageListView->addColumn( tr2i18n( "End Date" ) ); | 42 | mMessageListView->addColumn( tr2i18n( "End Date" ) ); |
41 | mMessageListView->addColumn( tr2i18n( "End Time" ) ); | 43 | mMessageListView->addColumn( tr2i18n( "End Time" ) ); |
42 | mMessageListView->addColumn( tr2i18n( "Method" ) ); | 44 | mMessageListView->addColumn( tr2i18n( "Method" ) ); |
43 | mMessageListView->setFrameShape( QListView::StyledPanel ); | 45 | mMessageListView->setFrameShape( Q3ListView::StyledPanel ); |
44 | mMessageListView->setFrameShadow( QListView::Sunken ); | 46 | mMessageListView->setFrameShadow( Q3ListView::Sunken ); |
45 | mMessageListView->setAllColumnsShowFocus( TRUE ); | 47 | mMessageListView->setAllColumnsShowFocus( TRUE ); |
46 | 48 | ||
47 | OutgoingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 3, 0, 0 ); | 49 | OutgoingDialog_baseLayout->addMultiCellWidget( mMessageListView, 0, 3, 0, 0 ); |
48 | 50 | ||
49 | PushButton5 = new QPushButton( this, "PushButton5" ); | 51 | PushButton5 = new QPushButton( this, "PushButton5" ); |
50 | PushButton5->setDefault( FALSE ); | 52 | PushButton5->setDefault( FALSE ); |
diff --git a/korganizer/outgoingdialog_base.h b/korganizer/outgoingdialog_base.h index af71bb1..5e81725 100644 --- a/korganizer/outgoingdialog_base.h +++ b/korganizer/outgoingdialog_base.h | |||
@@ -9,35 +9,39 @@ | |||
9 | 9 | ||
10 | #ifndef OUTGOINGDIALOG_BASE_H | 10 | #ifndef OUTGOINGDIALOG_BASE_H |
11 | #define OUTGOINGDIALOG_BASE_H | 11 | #define OUTGOINGDIALOG_BASE_H |
12 | 12 | ||
13 | #include <qvariant.h> | 13 | #include <qvariant.h> |
14 | #include <qdialog.h> | 14 | #include <qdialog.h> |
15 | 15 | //Added by qt3to4: | |
16 | class QVBoxLayout; | 16 | #include <Q3GridLayout> |
17 | class QHBoxLayout; | 17 | #include <Q3HBoxLayout> |
18 | class QGridLayout; | 18 | #include <Q3VBoxLayout> |
19 | class QListView; | 19 | |
20 | class QListViewItem; | 20 | class Q3VBoxLayout; |
21 | class Q3HBoxLayout; | ||
22 | class Q3GridLayout; | ||
23 | class Q3ListView; | ||
24 | class Q3ListViewItem; | ||
21 | class QPushButton; | 25 | class QPushButton; |
22 | 26 | ||
23 | class OutgoingDialog_base : public QDialog | 27 | class OutgoingDialog_base : public QDialog |
24 | { | 28 | { |
25 | Q_OBJECT | 29 | Q_OBJECT |
26 | 30 | ||
27 | public: | 31 | public: |
28 | OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 32 | OutgoingDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); |
29 | ~OutgoingDialog_base(); | 33 | ~OutgoingDialog_base(); |
30 | 34 | ||
31 | QListView* mMessageListView; | 35 | Q3ListView* mMessageListView; |
32 | QPushButton* PushButton5; | 36 | QPushButton* PushButton5; |
33 | QPushButton* PushButton7; | 37 | QPushButton* PushButton7; |
34 | QPushButton* PushButton6; | 38 | QPushButton* PushButton6; |
35 | 39 | ||
36 | protected: | 40 | protected: |
37 | QGridLayout* OutgoingDialog_baseLayout; | 41 | Q3GridLayout* OutgoingDialog_baseLayout; |
38 | 42 | ||
39 | protected slots: | 43 | protected slots: |
40 | virtual void languageChange(); | 44 | virtual void languageChange(); |
41 | 45 | ||
42 | virtual void send(); | 46 | virtual void send(); |
43 | virtual void deleteItem(); | 47 | virtual void deleteItem(); |
diff --git a/korganizer/publishdialog.cpp b/korganizer/publishdialog.cpp index 2ae6720..ede9840 100644 --- a/korganizer/publishdialog.cpp +++ b/korganizer/publishdialog.cpp | |||
@@ -32,40 +32,40 @@ | |||
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #include "koprefs.h" | 34 | #include "koprefs.h" |
35 | #include "publishdialog.h" | 35 | #include "publishdialog.h" |
36 | 36 | ||
37 | PublishDialog::PublishDialog(QWidget* parent, const char* name, | 37 | PublishDialog::PublishDialog(QWidget* parent, const char* name, |
38 | bool modal, WFlags fl) | 38 | bool modal, Qt::WFlags fl) |
39 | : PublishDialog_base(parent,name,modal,fl) | 39 | : PublishDialog_base(parent,name,modal,fl) |
40 | { | 40 | { |
41 | setCaption(i18n("Select Addresses")); | 41 | setCaption(i18n("Select Addresses")); |
42 | mNameLineEdit->setEnabled(false); | 42 | mNameLineEdit->setEnabled(false); |
43 | mEmailLineEdit->setEnabled(false); | 43 | mEmailLineEdit->setEnabled(false); |
44 | connect(mAddressListView,SIGNAL(selectionChanged(QListViewItem *)), | 44 | connect(mAddressListView,SIGNAL(selectionChanged(Q3ListViewItem *)), |
45 | SLOT(updateInput())); | 45 | SLOT(updateInput())); |
46 | } | 46 | } |
47 | 47 | ||
48 | PublishDialog::~PublishDialog() | 48 | PublishDialog::~PublishDialog() |
49 | { | 49 | { |
50 | } | 50 | } |
51 | 51 | ||
52 | void PublishDialog::addAttendee(Attendee *attendee) | 52 | void PublishDialog::addAttendee(Attendee *attendee) |
53 | { | 53 | { |
54 | mNameLineEdit->setEnabled(true); | 54 | mNameLineEdit->setEnabled(true); |
55 | mEmailLineEdit->setEnabled(true); | 55 | mEmailLineEdit->setEnabled(true); |
56 | QListViewItem *item = new QListViewItem(mAddressListView); | 56 | Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); |
57 | item->setText(0,attendee->name()); | 57 | item->setText(0,attendee->name()); |
58 | item->setText(1,attendee->email()); | 58 | item->setText(1,attendee->email()); |
59 | mAddressListView->insertItem(item); | 59 | mAddressListView->insertItem(item); |
60 | } | 60 | } |
61 | 61 | ||
62 | QString PublishDialog::addresses() | 62 | QString PublishDialog::addresses() |
63 | { | 63 | { |
64 | QString to = ""; | 64 | QString to = ""; |
65 | QListViewItem *item; | 65 | Q3ListViewItem *item; |
66 | int i, count; | 66 | int i, count; |
67 | count = mAddressListView->childCount(); | 67 | count = mAddressListView->childCount(); |
68 | for (i=0;i<count;i++) { | 68 | for (i=0;i<count;i++) { |
69 | item = mAddressListView->firstChild(); | 69 | item = mAddressListView->firstChild(); |
70 | mAddressListView->takeItem(item); | 70 | mAddressListView->takeItem(item); |
71 | to += item->text(1); | 71 | to += item->text(1); |
@@ -77,22 +77,22 @@ QString PublishDialog::addresses() | |||
77 | } | 77 | } |
78 | 78 | ||
79 | void PublishDialog::addItem() | 79 | void PublishDialog::addItem() |
80 | { | 80 | { |
81 | mNameLineEdit->setEnabled(true); | 81 | mNameLineEdit->setEnabled(true); |
82 | mEmailLineEdit->setEnabled(true); | 82 | mEmailLineEdit->setEnabled(true); |
83 | QListViewItem *item = new QListViewItem(mAddressListView); | 83 | Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); |
84 | mAddressListView->insertItem(item); | 84 | mAddressListView->insertItem(item); |
85 | mAddressListView->setSelected(item,true); | 85 | mAddressListView->setSelected(item,true); |
86 | mNameLineEdit->setText(i18n("(EmptyName)")); | 86 | mNameLineEdit->setText(i18n("(EmptyName)")); |
87 | mEmailLineEdit->setText(i18n("(EmptyEmail)")); | 87 | mEmailLineEdit->setText(i18n("(EmptyEmail)")); |
88 | } | 88 | } |
89 | 89 | ||
90 | void PublishDialog::removeItem() | 90 | void PublishDialog::removeItem() |
91 | { | 91 | { |
92 | QListViewItem *item; | 92 | Q3ListViewItem *item; |
93 | item = mAddressListView->selectedItem(); | 93 | item = mAddressListView->selectedItem(); |
94 | if (!item) return; | 94 | if (!item) return; |
95 | mAddressListView->takeItem(item); | 95 | mAddressListView->takeItem(item); |
96 | item = mAddressListView->selectedItem(); | 96 | item = mAddressListView->selectedItem(); |
97 | if (!item) { | 97 | if (!item) { |
98 | mNameLineEdit->setText(""); | 98 | mNameLineEdit->setText(""); |
@@ -116,34 +116,34 @@ void PublishDialog::openAddressbook() | |||
116 | if (!a.isEmpty()) { | 116 | if (!a.isEmpty()) { |
117 | uint i; | 117 | uint i; |
118 | for (i=0;i<addressList.count();i++) { | 118 | for (i=0;i<addressList.count();i++) { |
119 | a = addressList[i]; | 119 | a = addressList[i]; |
120 | mNameLineEdit->setEnabled(true); | 120 | mNameLineEdit->setEnabled(true); |
121 | mEmailLineEdit->setEnabled(true); | 121 | mEmailLineEdit->setEnabled(true); |
122 | QListViewItem *item = new QListViewItem(mAddressListView); | 122 | Q3ListViewItem *item = new Q3ListViewItem(mAddressListView); |
123 | mAddressListView->setSelected(item,true); | 123 | mAddressListView->setSelected(item,true); |
124 | mNameLineEdit->setText(a.realName()); | 124 | mNameLineEdit->setText(a.realName()); |
125 | mEmailLineEdit->setText(a.preferredEmail()); | 125 | mEmailLineEdit->setText(a.preferredEmail()); |
126 | mAddressListView->insertItem(item); | 126 | mAddressListView->insertItem(item); |
127 | } | 127 | } |
128 | } | 128 | } |
129 | #endif | 129 | #endif |
130 | } | 130 | } |
131 | 131 | ||
132 | void PublishDialog::updateItem() | 132 | void PublishDialog::updateItem() |
133 | { | 133 | { |
134 | QListViewItem *item; | 134 | Q3ListViewItem *item; |
135 | item = mAddressListView->selectedItem(); | 135 | item = mAddressListView->selectedItem(); |
136 | if (!item) return; | 136 | if (!item) return; |
137 | item->setText(0,mNameLineEdit->text()); | 137 | item->setText(0,mNameLineEdit->text()); |
138 | item->setText(1,mEmailLineEdit->text()); | 138 | item->setText(1,mEmailLineEdit->text()); |
139 | } | 139 | } |
140 | 140 | ||
141 | void PublishDialog::updateInput() | 141 | void PublishDialog::updateInput() |
142 | { | 142 | { |
143 | QListViewItem *item; | 143 | Q3ListViewItem *item; |
144 | item = mAddressListView->selectedItem(); | 144 | item = mAddressListView->selectedItem(); |
145 | if (!item) return; | 145 | if (!item) return; |
146 | mNameLineEdit->setEnabled(true); | 146 | mNameLineEdit->setEnabled(true); |
147 | mEmailLineEdit->setEnabled(true); | 147 | mEmailLineEdit->setEnabled(true); |
148 | QString mail = item->text(1); | 148 | QString mail = item->text(1); |
149 | mNameLineEdit->setText(item->text(0)); | 149 | mNameLineEdit->setText(item->text(0)); |
diff --git a/korganizer/publishdialog.h b/korganizer/publishdialog.h index 338603c..3ffeec4 100644 --- a/korganizer/publishdialog.h +++ b/korganizer/publishdialog.h | |||
@@ -20,25 +20,25 @@ | |||
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef PUBLISHDIALOG_H | 23 | #ifndef PUBLISHDIALOG_H |
24 | #define PUBLISHDIALOG_H | 24 | #define PUBLISHDIALOG_H |
25 | 25 | ||
26 | #include <qlistview.h> | 26 | #include <q3listview.h> |
27 | #include <libkcal/attendee.h> | 27 | #include <libkcal/attendee.h> |
28 | 28 | ||
29 | #include "publishdialog_base.h" | 29 | #include "publishdialog_base.h" |
30 | 30 | ||
31 | using namespace KCal; | 31 | using namespace KCal; |
32 | 32 | ||
33 | class PublishDialog : public PublishDialog_base | 33 | class PublishDialog : public PublishDialog_base |
34 | { | 34 | { |
35 | Q_OBJECT | 35 | Q_OBJECT |
36 | public: | 36 | public: |
37 | PublishDialog(QWidget* parent=0,const char* name=0, | 37 | PublishDialog(QWidget* parent=0,const char* name=0, |
38 | bool modal=true,WFlags fl=0); | 38 | bool modal=true,Qt::WFlags fl=0); |
39 | ~PublishDialog(); | 39 | ~PublishDialog(); |
40 | 40 | ||
41 | void addAttendee(Attendee *attendee); | 41 | void addAttendee(Attendee *attendee); |
42 | QString addresses(); | 42 | QString addresses(); |
43 | 43 | ||
44 | signals: | 44 | signals: |
diff --git a/korganizer/publishdialog_base.cpp b/korganizer/publishdialog_base.cpp index 683f7e9..ce5c542 100644 --- a/korganizer/publishdialog_base.cpp +++ b/korganizer/publishdialog_base.cpp | |||
@@ -8,38 +8,41 @@ | |||
8 | ** WARNING! All changes made in this file will be lost! | 8 | ** WARNING! All changes made in this file will be lost! |
9 | ****************************************************************************/ | 9 | ****************************************************************************/ |
10 | 10 | ||
11 | #include "publishdialog_base.h" | 11 | #include "publishdialog_base.h" |
12 | 12 | ||
13 | #include <qvariant.h> | 13 | #include <qvariant.h> |
14 | #include <qframe.h> | 14 | #include <q3frame.h> |
15 | #include <qheader.h> | 15 | #include <q3header.h> |
16 | #include <qlabel.h> | 16 | #include <qlabel.h> |
17 | #include <qlineedit.h> | 17 | #include <qlineedit.h> |
18 | #include <qlistview.h> | 18 | #include <q3listview.h> |
19 | #include <qpushbutton.h> | 19 | #include <qpushbutton.h> |
20 | #include <qlayout.h> | 20 | #include <qlayout.h> |
21 | #include <qtooltip.h> | 21 | #include <qtooltip.h> |
22 | #include <qwhatsthis.h> | 22 | #include <q3whatsthis.h> |
23 | //Added by qt3to4: | ||
24 | #include <Q3GridLayout> | ||
25 | #include <Q3HBoxLayout> | ||
23 | 26 | ||
24 | /* | 27 | /* |
25 | * Constructs a PublishDialog_base as a child of 'parent', with the | 28 | * Constructs a PublishDialog_base as a child of 'parent', with the |
26 | * name 'name' and widget flags set to 'f'. | 29 | * name 'name' and widget flags set to 'f'. |
27 | * | 30 | * |
28 | * The dialog will by default be modeless, unless you set 'modal' to | 31 | * The dialog will by default be modeless, unless you set 'modal' to |
29 | * TRUE to construct a modal dialog. | 32 | * TRUE to construct a modal dialog. |
30 | */ | 33 | */ |
31 | PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, WFlags fl ) | 34 | PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) |
32 | : QDialog( parent, name, modal, fl ) | 35 | : QDialog( parent, name, modal, fl ) |
33 | 36 | ||
34 | { | 37 | { |
35 | if ( !name ) | 38 | if ( !name ) |
36 | setName( "PublishDialog_base" ); | 39 | setName( "PublishDialog_base" ); |
37 | PublishDialog_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout"); | 40 | PublishDialog_baseLayout = new Q3GridLayout( this, 1, 1, 11, 6, "PublishDialog_baseLayout"); |
38 | 41 | ||
39 | mAddressListView = new QListView( this, "mAddressListView" ); | 42 | mAddressListView = new Q3ListView( this, "mAddressListView" ); |
40 | mAddressListView->addColumn( tr2i18n( "Name" ) ); | 43 | mAddressListView->addColumn( tr2i18n( "Name" ) ); |
41 | mAddressListView->addColumn( tr2i18n( "Email" ) ); | 44 | mAddressListView->addColumn( tr2i18n( "Email" ) ); |
42 | 45 | ||
43 | PublishDialog_baseLayout->addMultiCellWidget( mAddressListView, 0, 3, 0, 1 ); | 46 | PublishDialog_baseLayout->addMultiCellWidget( mAddressListView, 0, 3, 0, 1 ); |
44 | 47 | ||
45 | TextLabel1 = new QLabel( this, "TextLabel1" ); | 48 | TextLabel1 = new QLabel( this, "TextLabel1" ); |
@@ -69,20 +72,20 @@ PublishDialog_base::PublishDialog_base( QWidget* parent, const char* name, bool | |||
69 | PushButton11 = new QPushButton( this, "PushButton11" ); | 72 | PushButton11 = new QPushButton( this, "PushButton11" ); |
70 | 73 | ||
71 | PublishDialog_baseLayout->addWidget( PushButton11, 1, 2 ); | 74 | PublishDialog_baseLayout->addWidget( PushButton11, 1, 2 ); |
72 | QSpacerItem* spacer = new QSpacerItem( 20, 241, QSizePolicy::Minimum, QSizePolicy::Expanding ); | 75 | QSpacerItem* spacer = new QSpacerItem( 20, 241, QSizePolicy::Minimum, QSizePolicy::Expanding ); |
73 | PublishDialog_baseLayout->addMultiCell( spacer, 3, 5, 2, 2 ); | 76 | PublishDialog_baseLayout->addMultiCell( spacer, 3, 5, 2, 2 ); |
74 | 77 | ||
75 | Line2 = new QFrame( this, "Line2" ); | 78 | Line2 = new Q3Frame( this, "Line2" ); |
76 | Line2->setFrameShape( QFrame::HLine ); | 79 | Line2->setFrameShape( Q3Frame::HLine ); |
77 | Line2->setFrameShadow( QFrame::Sunken ); | 80 | Line2->setFrameShadow( Q3Frame::Sunken ); |
78 | Line2->setFrameShape( QFrame::HLine ); | 81 | Line2->setFrameShape( Q3Frame::HLine ); |
79 | 82 | ||
80 | PublishDialog_baseLayout->addMultiCellWidget( Line2, 6, 6, 0, 2 ); | 83 | PublishDialog_baseLayout->addMultiCellWidget( Line2, 6, 6, 0, 2 ); |
81 | 84 | ||
82 | layout95 = new QHBoxLayout( 0, 0, 6, "layout95"); | 85 | layout95 = new Q3HBoxLayout( 0, 0, 6, "layout95"); |
83 | QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | 86 | QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
84 | layout95->addItem( spacer_2 ); | 87 | layout95->addItem( spacer_2 ); |
85 | 88 | ||
86 | PushButton9 = new QPushButton( this, "PushButton9" ); | 89 | PushButton9 = new QPushButton( this, "PushButton9" ); |
87 | PushButton9->setDefault( TRUE ); | 90 | PushButton9->setDefault( TRUE ); |
88 | layout95->addWidget( PushButton9 ); | 91 | layout95->addWidget( PushButton9 ); |
diff --git a/korganizer/publishdialog_base.h b/korganizer/publishdialog_base.h index 932474e..d1b40ae 100644 --- a/korganizer/publishdialog_base.h +++ b/korganizer/publishdialog_base.h | |||
@@ -9,46 +9,52 @@ | |||
9 | 9 | ||
10 | #ifndef PUBLISHDIALOG_BASE_H | 10 | #ifndef PUBLISHDIALOG_BASE_H |
11 | #define PUBLISHDIALOG_BASE_H | 11 | #define PUBLISHDIALOG_BASE_H |
12 | 12 | ||
13 | #include <qvariant.h> | 13 | #include <qvariant.h> |
14 | #include <qdialog.h> | 14 | #include <qdialog.h> |
15 | //Added by qt3to4: | ||
16 | #include <Q3VBoxLayout> | ||
17 | #include <Q3Frame> | ||
18 | #include <Q3GridLayout> | ||
19 | #include <Q3HBoxLayout> | ||
20 | #include <QLabel> | ||
15 | 21 | ||
16 | class QVBoxLayout; | 22 | class Q3VBoxLayout; |
17 | class QHBoxLayout; | 23 | class Q3HBoxLayout; |
18 | class QGridLayout; | 24 | class Q3GridLayout; |
19 | class QFrame; | 25 | class Q3Frame; |
20 | class QLabel; | 26 | class QLabel; |
21 | class QLineEdit; | 27 | class QLineEdit; |
22 | class QListView; | 28 | class Q3ListView; |
23 | class QListViewItem; | 29 | class Q3ListViewItem; |
24 | class QPushButton; | 30 | class QPushButton; |
25 | 31 | ||
26 | class PublishDialog_base : public QDialog | 32 | class PublishDialog_base : public QDialog |
27 | { | 33 | { |
28 | Q_OBJECT | 34 | Q_OBJECT |
29 | 35 | ||
30 | public: | 36 | public: |
31 | PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 37 | PublishDialog_base( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); |
32 | ~PublishDialog_base(); | 38 | ~PublishDialog_base(); |
33 | 39 | ||
34 | QListView* mAddressListView; | 40 | Q3ListView* mAddressListView; |
35 | QLabel* TextLabel1; | 41 | QLabel* TextLabel1; |
36 | QLabel* TextLabel2; | 42 | QLabel* TextLabel2; |
37 | QLineEdit* mEmailLineEdit; | 43 | QLineEdit* mEmailLineEdit; |
38 | QLineEdit* mNameLineEdit; | 44 | QLineEdit* mNameLineEdit; |
39 | QPushButton* PushButton10; | 45 | QPushButton* PushButton10; |
40 | QPushButton* PushButton12; | 46 | QPushButton* PushButton12; |
41 | QPushButton* PushButton11; | 47 | QPushButton* PushButton11; |
42 | QFrame* Line2; | 48 | Q3Frame* Line2; |
43 | QPushButton* PushButton9; | 49 | QPushButton* PushButton9; |
44 | QPushButton* PushButton8; | 50 | QPushButton* PushButton8; |
45 | 51 | ||
46 | protected: | 52 | protected: |
47 | QGridLayout* PublishDialog_baseLayout; | 53 | Q3GridLayout* PublishDialog_baseLayout; |
48 | QHBoxLayout* layout95; | 54 | Q3HBoxLayout* layout95; |
49 | 55 | ||
50 | protected slots: | 56 | protected slots: |
51 | virtual void languageChange(); | 57 | virtual void languageChange(); |
52 | 58 | ||
53 | virtual void addItem(); | 59 | virtual void addItem(); |
54 | virtual void removeItem(); | 60 | virtual void removeItem(); |
diff --git a/korganizer/savetemplatedialog.cpp b/korganizer/savetemplatedialog.cpp index 3544081..35bedba 100644 --- a/korganizer/savetemplatedialog.cpp +++ b/korganizer/savetemplatedialog.cpp | |||
@@ -19,12 +19,15 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | //Added by qt3to4: | ||
26 | #include <Q3VBoxLayout> | ||
27 | #include <Q3Frame> | ||
25 | 28 | ||
26 | #include <keditlistbox.h> | 29 | #include <keditlistbox.h> |
27 | #include <klocale.h> | 30 | #include <klocale.h> |
28 | 31 | ||
29 | #include "koprefs.h" | 32 | #include "koprefs.h" |
30 | 33 | ||
@@ -32,14 +35,14 @@ | |||
32 | 35 | ||
33 | SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent ) | 36 | SaveTemplateDialog::SaveTemplateDialog( IncidenceType type, QWidget *parent ) |
34 | : KDialogBase( Plain, i18n("Save Template"), Ok | Cancel, Ok, parent, 0, | 37 | : KDialogBase( Plain, i18n("Save Template"), Ok | Cancel, Ok, parent, 0, |
35 | true, false ), | 38 | true, false ), |
36 | mType( type ) | 39 | mType( type ) |
37 | { | 40 | { |
38 | QFrame *topFrame = plainPage(); | 41 | Q3Frame *topFrame = plainPage(); |
39 | QVBoxLayout *topLayout = new QVBoxLayout( topFrame, 0, spacingHint() ); | 42 | Q3VBoxLayout *topLayout = new Q3VBoxLayout( topFrame, 0, spacingHint() ); |
40 | 43 | ||
41 | mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame, | 44 | mEditListBox = new KEditListBox( i18n("Select Template Name"), topFrame, |
42 | 0, false, KEditListBox::Add | | 45 | 0, false, KEditListBox::Add | |
43 | KEditListBox::Remove ); | 46 | KEditListBox::Remove ); |
44 | topLayout->addWidget( mEditListBox ); | 47 | topLayout->addWidget( mEditListBox ); |
45 | connect( mEditListBox, SIGNAL( changed() ), SLOT( slotChanged() ) ); | 48 | connect( mEditListBox, SIGNAL( changed() ), SLOT( slotChanged() ) ); |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 9cfdc35..105b844 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -21,20 +21,27 @@ | |||
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
27 | #include <qgroupbox.h> | 27 | #include <q3groupbox.h> |
28 | #include <qapplication.h> | 28 | #include <qapplication.h> |
29 | #include <QDesktopWidget> | ||
29 | #include <qlabel.h> | 30 | #include <qlabel.h> |
30 | #include <qlistview.h> | 31 | #include <q3listview.h> |
31 | #include <qwhatsthis.h> | 32 | #include <q3whatsthis.h> |
32 | #include <qlineedit.h> | 33 | #include <qlineedit.h> |
33 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
34 | #include <qhbuttongroup.h> | 35 | //#include <qhbuttongroup.h> |
36 | //Added by qt3to4: | ||
37 | #include <Q3HBoxLayout> | ||
38 | #include <Q3Frame> | ||
39 | #include <Q3PtrList> | ||
40 | #include <QKeyEvent> | ||
41 | #include <Q3VBoxLayout> | ||
35 | #include <klocale.h> | 42 | #include <klocale.h> |
36 | #include <kmessagebox.h> | 43 | #include <kmessagebox.h> |
37 | 44 | ||
38 | #include <libkdepim/kdateedit.h> | 45 | #include <libkdepim/kdateedit.h> |
39 | 46 | ||
40 | #include "koglobals.h" | 47 | #include "koglobals.h" |
@@ -43,21 +50,21 @@ | |||
43 | 50 | ||
44 | #include "calendarview.h" | 51 | #include "calendarview.h" |
45 | #include "koviewmanager.h" | 52 | #include "koviewmanager.h" |
46 | #include "searchdialog.h" | 53 | #include "searchdialog.h" |
47 | 54 | ||
48 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | 55 | SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) |
49 | : QVBox( 0 ) | 56 | : Q3VBox( 0 ) |
50 | 57 | ||
51 | { | 58 | { |
52 | mCalendar = calendar; | 59 | mCalendar = calendar; |
53 | QFrame *topFrame = new QFrame( this ) ;//plainPage(); | 60 | Q3Frame *topFrame = new Q3Frame( this ) ;//plainPage(); |
54 | QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); | 61 | Q3VBoxLayout *layout = new Q3VBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); |
55 | 62 | ||
56 | // Search expression | 63 | // Search expression |
57 | QHBoxLayout *subLayout = new QHBoxLayout(); | 64 | Q3HBoxLayout *subLayout = new Q3HBoxLayout(); |
58 | layout->addLayout(subLayout); | 65 | layout->addLayout(subLayout); |
59 | /* | 66 | /* |
60 | searchLabel = new QLabel(topFrame); | 67 | searchLabel = new QLabel(topFrame); |
61 | searchLabel->setText(i18n("Search for:")); | 68 | searchLabel->setText(i18n("Search for:")); |
62 | subLayout->addWidget(searchLabel); | 69 | subLayout->addWidget(searchLabel); |
63 | */ | 70 | */ |
@@ -95,50 +102,50 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) | |||
95 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); | 102 | connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); |
96 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); | 103 | connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); |
97 | // Subjects to search | 104 | // Subjects to search |
98 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), | 105 | // QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"), |
99 | // topFrame); | 106 | // topFrame); |
100 | 107 | ||
101 | incidenceGroup = new QHBox( topFrame ); | 108 | incidenceGroup = new Q3HBox( topFrame ); |
102 | layout->addWidget(incidenceGroup); | 109 | layout->addWidget(incidenceGroup); |
103 | 110 | ||
104 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); | 111 | mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup); |
105 | //mSearchEvent->setChecked(true); | 112 | //mSearchEvent->setChecked(true); |
106 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); | 113 | mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup); |
107 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); | 114 | mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup); |
108 | 115 | ||
109 | subjectGroup = new QHBox( topFrame ); | 116 | subjectGroup = new Q3HBox( topFrame ); |
110 | layout->addWidget(subjectGroup); | 117 | layout->addWidget(subjectGroup); |
111 | 118 | ||
112 | mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); | 119 | mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup); |
113 | mSummaryCheck->setChecked(true); | 120 | mSummaryCheck->setChecked(true); |
114 | mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); | 121 | mDescriptionCheck = new QCheckBox(i18n("Details"),subjectGroup); |
115 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); | 122 | mCategoryCheck = new QCheckBox(i18n("Categories"),subjectGroup); |
116 | 123 | ||
117 | attendeeGroup = new QHBox( topFrame ); | 124 | attendeeGroup = new Q3HBox( topFrame ); |
118 | layout->addWidget(attendeeGroup ); | 125 | layout->addWidget(attendeeGroup ); |
119 | new QLabel( i18n("Attendee:"),attendeeGroup ); | 126 | new QLabel( i18n("Attendee:"),attendeeGroup ); |
120 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); | 127 | mSearchAName = new QCheckBox(i18n("Name"),attendeeGroup ); |
121 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); | 128 | mSearchAEmail = new QCheckBox(i18n("Email"), attendeeGroup ); |
122 | // Date range | 129 | // Date range |
123 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), | 130 | // QGroupBox *rangeGroup = new QGroupBox(1,Horizontal,i18n("Date Range"), |
124 | // topFrame); | 131 | // topFrame); |
125 | // layout->addWidget(rangeGroup); | 132 | // layout->addWidget(rangeGroup); |
126 | 133 | ||
127 | QWidget *rangeWidget = new QWidget(topFrame); | 134 | QWidget *rangeWidget = new QWidget(topFrame); |
128 | int space = KDialog::spacingHint(); | 135 | int space = KDialog::spacingHint(); |
129 | if ( QApplication::desktop()->width() <= 240 ) space = 1; | 136 | if ( QApplication::desktop()->width() <= 240 ) space = 1; |
130 | QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,space); | 137 | Q3HBoxLayout *rangeLayout = new Q3HBoxLayout(rangeWidget,0,space); |
131 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); | 138 | rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); |
132 | mStartDate = new KDateEdit(rangeWidget); | 139 | mStartDate = new KDateEdit(rangeWidget); |
133 | rangeLayout->addWidget(mStartDate); | 140 | rangeLayout->addWidget(mStartDate); |
134 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); | 141 | rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); |
135 | mEndDate = new KDateEdit(rangeWidget); | 142 | mEndDate = new KDateEdit(rangeWidget); |
136 | mEndDate->setDate(QDate::currentDate().addDays(365)); | 143 | mEndDate->setDate(QDate::currentDate().addDays(365)); |
137 | rangeLayout->addWidget(mEndDate); | 144 | rangeLayout->addWidget(mEndDate); |
138 | QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); | 145 | QToolButton *wt = Q3WhatsThis::whatsThisButton ( rangeWidget ); |
139 | rangeLayout->addWidget( (QWidget*)wt ); | 146 | rangeLayout->addWidget( (QWidget*)wt ); |
140 | layout->addWidget(rangeWidget); | 147 | layout->addWidget(rangeWidget); |
141 | // Results list view | 148 | // Results list view |
142 | listView = new KOListView(mCalendar,topFrame); | 149 | listView = new KOListView(mCalendar,topFrame); |
143 | layout->addWidget(listView); | 150 | layout->addWidget(listView); |
144 | listView->showCompletedTodos(); | 151 | listView->showCompletedTodos(); |
@@ -338,13 +345,13 @@ void SearchDialog::updateView() | |||
338 | listView->addTodos(mMatchedTodos); | 345 | listView->addTodos(mMatchedTodos); |
339 | listView->addJournals(mMatchedJournals); | 346 | listView->addJournals(mMatchedJournals); |
340 | } | 347 | } |
341 | 348 | ||
342 | void SearchDialog::search(const QRegExp &re) | 349 | void SearchDialog::search(const QRegExp &re) |
343 | { | 350 | { |
344 | QPtrList<Event> events; | 351 | Q3PtrList<Event> events; |
345 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { | 352 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { |
346 | if ( mRefineItems->isChecked() ) events = mMatchedEvents; | 353 | if ( mRefineItems->isChecked() ) events = mMatchedEvents; |
347 | mMatchedEvents.clear(); | 354 | mMatchedEvents.clear(); |
348 | } | 355 | } |
349 | if ( mSearchEvent->isChecked() ) { | 356 | if ( mSearchEvent->isChecked() ) { |
350 | if ( !mRefineItems->isChecked() ) | 357 | if ( !mRefineItems->isChecked() ) |
@@ -416,13 +423,13 @@ void SearchDialog::search(const QRegExp &re) | |||
416 | mMatchedEvents.append(ev); | 423 | mMatchedEvents.append(ev); |
417 | } | 424 | } |
418 | continue; | 425 | continue; |
419 | } | 426 | } |
420 | } | 427 | } |
421 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { | 428 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { |
422 | QPtrList<Attendee> tmpAList = ev->attendees(); | 429 | Q3PtrList<Attendee> tmpAList = ev->attendees(); |
423 | Attendee *a; | 430 | Attendee *a; |
424 | for (a = tmpAList.first(); a; a = tmpAList.next()) { | 431 | for (a = tmpAList.first(); a; a = tmpAList.next()) { |
425 | if (mSearchAName->isChecked()) { | 432 | if (mSearchAName->isChecked()) { |
426 | #if QT_VERSION >= 0x030000 | 433 | #if QT_VERSION >= 0x030000 |
427 | if (re.search(a->name()) != -1) | 434 | if (re.search(a->name()) != -1) |
428 | #else | 435 | #else |
@@ -455,13 +462,13 @@ void SearchDialog::search(const QRegExp &re) | |||
455 | } | 462 | } |
456 | } | 463 | } |
457 | } | 464 | } |
458 | } | 465 | } |
459 | } | 466 | } |
460 | } | 467 | } |
461 | QPtrList<Todo> todos; | 468 | Q3PtrList<Todo> todos; |
462 | 469 | ||
463 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { | 470 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { |
464 | if ( mRefineItems->isChecked() ) todos = mMatchedTodos ; | 471 | if ( mRefineItems->isChecked() ) todos = mMatchedTodos ; |
465 | mMatchedTodos.clear(); | 472 | mMatchedTodos.clear(); |
466 | } | 473 | } |
467 | 474 | ||
@@ -509,13 +516,13 @@ void SearchDialog::search(const QRegExp &re) | |||
509 | else if (!mMatchedTodos.contains( tod )) | 516 | else if (!mMatchedTodos.contains( tod )) |
510 | mMatchedTodos.append(tod); | 517 | mMatchedTodos.append(tod); |
511 | continue; | 518 | continue; |
512 | } | 519 | } |
513 | } | 520 | } |
514 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { | 521 | if ( mSearchAName->isChecked() || mSearchAEmail->isChecked() ) { |
515 | QPtrList<Attendee> tmpAList = tod->attendees(); | 522 | Q3PtrList<Attendee> tmpAList = tod->attendees(); |
516 | Attendee *a; | 523 | Attendee *a; |
517 | for (a = tmpAList.first(); a; a = tmpAList.next()) { | 524 | for (a = tmpAList.first(); a; a = tmpAList.next()) { |
518 | if (mSearchAName->isChecked()) { | 525 | if (mSearchAName->isChecked()) { |
519 | #if QT_VERSION >= 0x030000 | 526 | #if QT_VERSION >= 0x030000 |
520 | if (re.search(a->name()) != -1) | 527 | if (re.search(a->name()) != -1) |
521 | #else | 528 | #else |
@@ -545,13 +552,13 @@ void SearchDialog::search(const QRegExp &re) | |||
545 | } | 552 | } |
546 | } | 553 | } |
547 | } | 554 | } |
548 | } | 555 | } |
549 | } | 556 | } |
550 | 557 | ||
551 | QPtrList<Journal> journals; | 558 | Q3PtrList<Journal> journals; |
552 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { | 559 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { |
553 | if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; | 560 | if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; |
554 | mMatchedJournals.clear(); | 561 | mMatchedJournals.clear(); |
555 | } | 562 | } |
556 | if (mSearchJournal->isChecked() ) { | 563 | if (mSearchJournal->isChecked() ) { |
557 | if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals(); | 564 | if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals(); |
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h index 945ff65..5df6116 100644 --- a/korganizer/searchdialog.h +++ b/korganizer/searchdialog.h | |||
@@ -23,14 +23,18 @@ | |||
23 | */ | 23 | */ |
24 | #ifndef SEARCHDIALOG_H | 24 | #ifndef SEARCHDIALOG_H |
25 | #define SEARCHDIALOG_H | 25 | #define SEARCHDIALOG_H |
26 | 26 | ||
27 | #include <qregexp.h> | 27 | #include <qregexp.h> |
28 | #include <qradiobutton.h> | 28 | #include <qradiobutton.h> |
29 | //Added by qt3to4: | ||
30 | #include <QLabel> | ||
31 | #include <QKeyEvent> | ||
32 | #include <Q3PtrList> | ||
29 | #include <kdialogbase.h> | 33 | #include <kdialogbase.h> |
30 | #include <qvbox.h> | 34 | #include <q3vbox.h> |
31 | 35 | ||
32 | #include <libkcal/calendar.h> | 36 | #include <libkcal/calendar.h> |
33 | 37 | ||
34 | #include "kolistview.h" | 38 | #include "kolistview.h" |
35 | 39 | ||
36 | class KDateEdit; | 40 | class KDateEdit; |
@@ -38,13 +42,13 @@ class QCheckBox; | |||
38 | class QLineEdit; | 42 | class QLineEdit; |
39 | class KLineEdit; | 43 | class KLineEdit; |
40 | class QLabel; | 44 | class QLabel; |
41 | class CalendarView; | 45 | class CalendarView; |
42 | 46 | ||
43 | using namespace KCal; | 47 | using namespace KCal; |
44 | class SearchDialog : public QVBox | 48 | class SearchDialog : public Q3VBox |
45 | { | 49 | { |
46 | Q_OBJECT | 50 | Q_OBJECT |
47 | public: | 51 | public: |
48 | SearchDialog(Calendar *calendar,CalendarView *parent=0); | 52 | SearchDialog(Calendar *calendar,CalendarView *parent=0); |
49 | virtual ~SearchDialog(); | 53 | virtual ~SearchDialog(); |
50 | KOListView *listview(){ return listView;} | 54 | KOListView *listview(){ return listView;} |
@@ -69,20 +73,20 @@ class SearchDialog : public QVBox | |||
69 | void showEventSignal(Event *); | 73 | void showEventSignal(Event *); |
70 | void editEventSignal(Event *); | 74 | void editEventSignal(Event *); |
71 | void deleteEventSignal(Event *); | 75 | void deleteEventSignal(Event *); |
72 | 76 | ||
73 | private: | 77 | private: |
74 | 78 | ||
75 | QHBox *incidenceGroup ,*subjectGroup ,*attendeeGroup; | 79 | Q3HBox *incidenceGroup ,*subjectGroup ,*attendeeGroup; |
76 | void search(const QRegExp &); | 80 | void search(const QRegExp &); |
77 | 81 | ||
78 | Calendar *mCalendar; | 82 | Calendar *mCalendar; |
79 | 83 | ||
80 | QPtrList<Event> mMatchedEvents; | 84 | Q3PtrList<Event> mMatchedEvents; |
81 | QPtrList<Todo> mMatchedTodos; | 85 | Q3PtrList<Todo> mMatchedTodos; |
82 | QPtrList<Journal> mMatchedJournals; | 86 | Q3PtrList<Journal> mMatchedJournals; |
83 | 87 | ||
84 | QLabel *searchLabel; | 88 | QLabel *searchLabel; |
85 | KLineEdit *searchEdit; | 89 | KLineEdit *searchEdit; |
86 | KOListView *listView; | 90 | KOListView *listView; |
87 | 91 | ||
88 | KDateEdit *mStartDate; | 92 | KDateEdit *mStartDate; |
diff --git a/korganizer/statusdialog.cpp b/korganizer/statusdialog.cpp index 7137c49..8186ebb 100644 --- a/korganizer/statusdialog.cpp +++ b/korganizer/statusdialog.cpp | |||
@@ -18,37 +18,40 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qpushbutton.h> | 21 | #include <qpushbutton.h> |
22 | #include <qstringlist.h> | 22 | #include <qstringlist.h> |
23 | #include <qlayout.h> | 23 | #include <qlayout.h> |
24 | //Added by qt3to4: | ||
25 | #include <Q3VBoxLayout> | ||
26 | #include <Q3HBoxLayout> | ||
24 | 27 | ||
25 | #include <kdebug.h> | 28 | #include <kdebug.h> |
26 | #include <klocale.h> | 29 | #include <klocale.h> |
27 | 30 | ||
28 | #include "statusdialog.h" | 31 | #include "statusdialog.h" |
29 | 32 | ||
30 | StatusDialog::StatusDialog(QWidget* parent, const char* name) : | 33 | StatusDialog::StatusDialog(QWidget* parent, const char* name) : |
31 | KDialog(parent,name,true) | 34 | KDialog(parent,name,true) |
32 | { | 35 | { |
33 | setCaption(i18n("Set Your Status")); | 36 | setCaption(i18n("Set Your Status")); |
34 | 37 | ||
35 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 38 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
36 | topLayout->setSpacing( spacingHint() ); | 39 | topLayout->setSpacing( spacingHint() ); |
37 | topLayout->setMargin( marginHint() ); | 40 | topLayout->setMargin( marginHint() ); |
38 | 41 | ||
39 | QBoxLayout *statusLayout = new QHBoxLayout( topLayout ); | 42 | Q3BoxLayout *statusLayout = new Q3HBoxLayout( topLayout ); |
40 | 43 | ||
41 | QLabel *text = new QLabel(i18n("Set your status"),this); | 44 | QLabel *text = new QLabel(i18n("Set your status"),this); |
42 | statusLayout->addWidget( text ); | 45 | statusLayout->addWidget( text ); |
43 | 46 | ||
44 | mStatus = new QComboBox(false,this); | 47 | mStatus = new QComboBox(false,this); |
45 | mStatus->insertStringList(Attendee::statusList()); | 48 | mStatus->insertStringList(Attendee::statusList()); |
46 | statusLayout->addWidget( mStatus ); | 49 | statusLayout->addWidget( mStatus ); |
47 | 50 | ||
48 | QBoxLayout *buttonLayout = new QHBoxLayout( topLayout ); | 51 | Q3BoxLayout *buttonLayout = new Q3HBoxLayout( topLayout ); |
49 | 52 | ||
50 | QPushButton *ok = new QPushButton(i18n("&OK"), this); | 53 | QPushButton *ok = new QPushButton(i18n("&OK"), this); |
51 | connect ( ok,SIGNAL(clicked()), this,SLOT(accept()) ); | 54 | connect ( ok,SIGNAL(clicked()), this,SLOT(accept()) ); |
52 | buttonLayout->addWidget( ok ); | 55 | buttonLayout->addWidget( ok ); |
53 | 56 | ||
54 | QPushButton *cancel = new QPushButton(i18n("&Cancel"), this); | 57 | QPushButton *cancel = new QPushButton(i18n("&Cancel"), this); |
diff --git a/korganizer/timeline.cpp b/korganizer/timeline.cpp index 11be432..a6c3cdc 100644 --- a/korganizer/timeline.cpp +++ b/korganizer/timeline.cpp | |||
@@ -2,19 +2,19 @@ | |||
2 | 2 | ||
3 | #include <kdebug.h> | 3 | #include <kdebug.h> |
4 | 4 | ||
5 | #include "timeline.h" | 5 | #include "timeline.h" |
6 | 6 | ||
7 | TimeLine::TimeLine( QWidget *parent, const char *name ) : | 7 | TimeLine::TimeLine( QWidget *parent, const char *name ) : |
8 | QScrollView( parent, name ) | 8 | Q3ScrollView( parent, name ) |
9 | { | 9 | { |
10 | mPixelWidth = 1000; | 10 | mPixelWidth = 1000; |
11 | 11 | ||
12 | resizeContents( mPixelWidth, 20 ); | 12 | resizeContents( mPixelWidth, 20 ); |
13 | 13 | ||
14 | viewport()->setBackgroundMode( PaletteBackground ); | 14 | viewport()->setBackgroundMode( Qt::PaletteBackground ); |
15 | 15 | ||
16 | setHScrollBarMode(AlwaysOff); | 16 | setHScrollBarMode(AlwaysOff); |
17 | setVScrollBarMode(AlwaysOff); | 17 | setVScrollBarMode(AlwaysOff); |
18 | } | 18 | } |
19 | 19 | ||
20 | TimeLine::~TimeLine() | 20 | TimeLine::~TimeLine() |
@@ -55,8 +55,8 @@ void TimeLine::setDateRange( const QDateTime &start, const QDateTime &end ) | |||
55 | kdDebug() << "TimeLines::setDateRange(): mDaySpacing: " << mDaySpacing << " mDayOffset: " | 55 | kdDebug() << "TimeLines::setDateRange(): mDaySpacing: " << mDaySpacing << " mDayOffset: " |
56 | << mDayOffset << " mSecsPerPixel: " << mSecsPerPixel << endl; | 56 | << mDayOffset << " mSecsPerPixel: " << mSecsPerPixel << endl; |
57 | } | 57 | } |
58 | 58 | ||
59 | void TimeLine::setContentsPos( int pos ) | 59 | void TimeLine::setContentsPos( int pos ) |
60 | { | 60 | { |
61 | QScrollView::setContentsPos ( pos, 0 ); | 61 | Q3ScrollView::setContentsPos ( pos, 0 ); |
62 | } | 62 | } |
diff --git a/korganizer/timeline.h b/korganizer/timeline.h index ab3e5d3..bf301fa 100644 --- a/korganizer/timeline.h +++ b/korganizer/timeline.h | |||
@@ -1,13 +1,13 @@ | |||
1 | #ifndef TIMELINE_H | 1 | #ifndef TIMELINE_H |
2 | #define TIMELINE_H | 2 | #define TIMELINE_H |
3 | 3 | ||
4 | #include <qscrollview.h> | 4 | #include <q3scrollview.h> |
5 | #include <qdatetime.h> | 5 | #include <qdatetime.h> |
6 | 6 | ||
7 | class TimeLine : public QScrollView | 7 | class TimeLine : public Q3ScrollView |
8 | { | 8 | { |
9 | Q_OBJECT | 9 | Q_OBJECT |
10 | public: | 10 | public: |
11 | TimeLine( QWidget *parent = 0, const char *name = 0 ); | 11 | TimeLine( QWidget *parent = 0, const char *name = 0 ); |
12 | virtual ~TimeLine(); | 12 | virtual ~TimeLine(); |
13 | 13 | ||
diff --git a/korganizer/timespanview.cpp b/korganizer/timespanview.cpp index df8ff88..0908056 100644 --- a/korganizer/timespanview.cpp +++ b/korganizer/timespanview.cpp | |||
@@ -1,16 +1,20 @@ | |||
1 | 1 | ||
2 | #ifndef DESKTOP_VERSION | 2 | #ifndef DESKTOP_VERSION |
3 | #include <qksplitter.h> | 3 | #include <qksplitter.h> |
4 | #else | 4 | #else |
5 | #include <qsplitter.h> | 5 | #include <qsplitter.h> |
6 | #endif | 6 | #endif |
7 | #include <qlistview.h> | 7 | #include <q3listview.h> |
8 | #include <qlayout.h> | 8 | #include <qlayout.h> |
9 | #include <qheader.h> | 9 | #include <q3header.h> |
10 | #include <qpushbutton.h> | 10 | #include <qpushbutton.h> |
11 | //Added by qt3to4: | ||
12 | #include <Q3HBoxLayout> | ||
13 | #include <Q3VBoxLayout> | ||
14 | #include <Q3ValueList> | ||
11 | 15 | ||
12 | #include <klocale.h> | 16 | #include <klocale.h> |
13 | #include <kdebug.h> | 17 | #include <kdebug.h> |
14 | 18 | ||
15 | #include "lineview.h" | 19 | #include "lineview.h" |
16 | #include "timeline.h" | 20 | #include "timeline.h" |
@@ -18,34 +22,34 @@ | |||
18 | #include "timespanview.h" | 22 | #include "timespanview.h" |
19 | 23 | ||
20 | 24 | ||
21 | TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : | 25 | TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : |
22 | QWidget( parent, name ) | 26 | QWidget( parent, name ) |
23 | { | 27 | { |
24 | QBoxLayout *topLayout = new QVBoxLayout( this ); | 28 | Q3BoxLayout *topLayout = new Q3VBoxLayout( this ); |
25 | #ifndef DESKTOP_VERSION | 29 | #ifndef DESKTOP_VERSION |
26 | mSplitter = new QKSplitter( this ); | 30 | mSplitter = new QKSplitter( this ); |
27 | #else | 31 | #else |
28 | mSplitter = new QSplitter( this ); | 32 | mSplitter = new QSplitter( this ); |
29 | #endif | 33 | #endif |
30 | topLayout->addWidget( mSplitter ); | 34 | topLayout->addWidget( mSplitter ); |
31 | 35 | ||
32 | mList = new QListView( mSplitter ); | 36 | mList = new Q3ListView( mSplitter ); |
33 | mList->addColumn( i18n("Summary") ); | 37 | mList->addColumn( i18n("Summary") ); |
34 | 38 | ||
35 | QWidget *rightPane = new QWidget( mSplitter ); | 39 | QWidget *rightPane = new QWidget( mSplitter ); |
36 | QBoxLayout *rightPaneLayout = new QVBoxLayout( rightPane ); | 40 | Q3BoxLayout *rightPaneLayout = new Q3VBoxLayout( rightPane ); |
37 | 41 | ||
38 | mTimeLine = new TimeLine( rightPane ); | 42 | mTimeLine = new TimeLine( rightPane ); |
39 | mTimeLine->setFixedHeight( mList->header()->height() ); | 43 | mTimeLine->setFixedHeight( mList->header()->height() ); |
40 | rightPaneLayout->addWidget( mTimeLine ); | 44 | rightPaneLayout->addWidget( mTimeLine ); |
41 | 45 | ||
42 | mLineView = new LineView( rightPane ); | 46 | mLineView = new LineView( rightPane ); |
43 | rightPaneLayout->addWidget( mLineView ); | 47 | rightPaneLayout->addWidget( mLineView ); |
44 | 48 | ||
45 | QBoxLayout *buttonLayout = new QHBoxLayout( rightPaneLayout ); | 49 | Q3BoxLayout *buttonLayout = new Q3HBoxLayout( rightPaneLayout ); |
46 | 50 | ||
47 | QPushButton *zoomInButton = new QPushButton( i18n("Zoom In"), rightPane ); | 51 | QPushButton *zoomInButton = new QPushButton( i18n("Zoom In"), rightPane ); |
48 | connect( zoomInButton, SIGNAL( clicked() ), SLOT( zoomIn() ) ); | 52 | connect( zoomInButton, SIGNAL( clicked() ), SLOT( zoomIn() ) ); |
49 | buttonLayout->addWidget( zoomInButton ); | 53 | buttonLayout->addWidget( zoomInButton ); |
50 | 54 | ||
51 | QPushButton *zoomOutButton = new QPushButton( i18n("Zoom Out"), rightPane ); | 55 | QPushButton *zoomOutButton = new QPushButton( i18n("Zoom Out"), rightPane ); |
@@ -61,25 +65,25 @@ TimeSpanView::TimeSpanView( QWidget *parent, const char *name ) : | |||
61 | } | 65 | } |
62 | 66 | ||
63 | TimeSpanView::~TimeSpanView() | 67 | TimeSpanView::~TimeSpanView() |
64 | { | 68 | { |
65 | } | 69 | } |
66 | 70 | ||
67 | QValueList<int> TimeSpanView::splitterSizes() | 71 | Q3ValueList<int> TimeSpanView::splitterSizes() |
68 | { | 72 | { |
69 | return mSplitter->sizes(); | 73 | return mSplitter->sizes(); |
70 | } | 74 | } |
71 | 75 | ||
72 | void TimeSpanView::setSplitterSizes( QValueList<int> sizes ) | 76 | void TimeSpanView::setSplitterSizes( Q3ValueList<int> sizes ) |
73 | { | 77 | { |
74 | mSplitter->setSizes( sizes ); | 78 | mSplitter->setSizes( sizes ); |
75 | } | 79 | } |
76 | 80 | ||
77 | void TimeSpanView::addItem( KCal::Event *event ) | 81 | void TimeSpanView::addItem( KCal::Event *event ) |
78 | { | 82 | { |
79 | new QListViewItem( mList, event->summary() ); | 83 | new Q3ListViewItem( mList, event->summary() ); |
80 | 84 | ||
81 | QDateTime startDt = event->dtStart(); | 85 | QDateTime startDt = event->dtStart(); |
82 | QDateTime endDt = event->dtEnd(); | 86 | QDateTime endDt = event->dtEnd(); |
83 | 87 | ||
84 | // kdDebug() << "TimeSpanView::addItem(): start: " << startDt.toString() | 88 | // kdDebug() << "TimeSpanView::addItem(): start: " << startDt.toString() |
85 | // << " end: " << endDt.toString() << endl; | 89 | // << " end: " << endDt.toString() << endl; |
diff --git a/korganizer/timespanview.h b/korganizer/timespanview.h index 34cb1f7..f652374 100644 --- a/korganizer/timespanview.h +++ b/korganizer/timespanview.h | |||
@@ -1,21 +1,23 @@ | |||
1 | #ifndef TIMESPANVIEW_H | 1 | #ifndef TIMESPANVIEW_H |
2 | #define TIMESPANVIEW_H | 2 | #define TIMESPANVIEW_H |
3 | 3 | ||
4 | #include <qwidget.h> | 4 | #include <qwidget.h> |
5 | //Added by qt3to4: | ||
6 | #include <Q3ValueList> | ||
5 | 7 | ||
6 | #include <libkcal/event.h> | 8 | #include <libkcal/event.h> |
7 | 9 | ||
8 | //class QSplitter; | 10 | //class QSplitter; |
9 | #ifndef DESKTOP_VERSION | 11 | #ifndef DESKTOP_VERSION |
10 | class QKSplitter; | 12 | class QKSplitter; |
11 | #else | 13 | #else |
12 | class QSplitter; | 14 | class QSplitter; |
13 | #define QKSplitter QSplitter | 15 | #define QKSplitter QSplitter |
14 | #endif | 16 | #endif |
15 | class QListView; | 17 | class Q3ListView; |
16 | class LineView; | 18 | class LineView; |
17 | class TimeLine; | 19 | class TimeLine; |
18 | 20 | ||
19 | 21 | ||
20 | class TimeSpanView : public QWidget | 22 | class TimeSpanView : public QWidget |
21 | { | 23 | { |
@@ -23,14 +25,14 @@ class TimeSpanView : public QWidget | |||
23 | public: | 25 | public: |
24 | TimeSpanView( QWidget *parent=0, const char *name=0 ); | 26 | TimeSpanView( QWidget *parent=0, const char *name=0 ); |
25 | virtual ~TimeSpanView(); | 27 | virtual ~TimeSpanView(); |
26 | 28 | ||
27 | void addItem( KCal::Event * ); | 29 | void addItem( KCal::Event * ); |
28 | 30 | ||
29 | QValueList<int> splitterSizes(); | 31 | Q3ValueList<int> splitterSizes(); |
30 | void setSplitterSizes( QValueList<int> ); | 32 | void setSplitterSizes( Q3ValueList<int> ); |
31 | 33 | ||
32 | void clear(); | 34 | void clear(); |
33 | 35 | ||
34 | void setDateRange( const QDateTime &start, const QDateTime &end ); | 36 | void setDateRange( const QDateTime &start, const QDateTime &end ); |
35 | 37 | ||
36 | QDateTime startDateTime(); | 38 | QDateTime startDateTime(); |
@@ -45,13 +47,13 @@ class TimeSpanView : public QWidget | |||
45 | 47 | ||
46 | signals: | 48 | signals: |
47 | void dateRangeChanged(); | 49 | void dateRangeChanged(); |
48 | 50 | ||
49 | private: | 51 | private: |
50 | QKSplitter *mSplitter; | 52 | QKSplitter *mSplitter; |
51 | QListView *mList; | 53 | Q3ListView *mList; |
52 | TimeLine *mTimeLine; | 54 | TimeLine *mTimeLine; |
53 | LineView *mLineView; | 55 | LineView *mLineView; |
54 | 56 | ||
55 | QDateTime mStartDate; | 57 | QDateTime mStartDate; |
56 | QDateTime mEndDate; | 58 | QDateTime mEndDate; |
57 | int mSecsPerPixel; | 59 | int mSecsPerPixel; |