-rw-r--r-- | korganizer/calendarview.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 1009956..d6918d3 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -471,24 +471,25 @@ void CalendarView::init() | |||
471 | } | 471 | } |
472 | 472 | ||
473 | 473 | ||
474 | CalendarView::~CalendarView() | 474 | CalendarView::~CalendarView() |
475 | { | 475 | { |
476 | // kdDebug() << "~CalendarView()" << endl; | 476 | // kdDebug() << "~CalendarView()" << endl; |
477 | //qDebug("CalendarView::~CalendarView() "); | 477 | //qDebug("CalendarView::~CalendarView() "); |
478 | delete mDialogManager; | 478 | delete mDialogManager; |
479 | delete mViewManager; | 479 | delete mViewManager; |
480 | delete mStorage; | 480 | delete mStorage; |
481 | delete mDateFrame ; | 481 | delete mDateFrame ; |
482 | delete beamDialog; | 482 | delete beamDialog; |
483 | delete mEventViewerDialog; | ||
483 | //kdDebug() << "~CalendarView() done" << endl; | 484 | //kdDebug() << "~CalendarView() done" << endl; |
484 | } | 485 | } |
485 | 486 | ||
486 | void CalendarView::showDay( QDate d ) | 487 | void CalendarView::showDay( QDate d ) |
487 | { | 488 | { |
488 | dateNavigator()->blockSignals( true ); | 489 | dateNavigator()->blockSignals( true ); |
489 | dateNavigator()->selectDate( d ); | 490 | dateNavigator()->selectDate( d ); |
490 | dateNavigator()->blockSignals( false ); | 491 | dateNavigator()->blockSignals( false ); |
491 | mViewManager->showDayView(); | 492 | mViewManager->showDayView(); |
492 | //dateNavigator()->selectDate( d ); | 493 | //dateNavigator()->selectDate( d ); |
493 | } | 494 | } |
494 | void CalendarView::timerAlarm() | 495 | void CalendarView::timerAlarm() |
@@ -2518,41 +2519,53 @@ void CalendarView::showDatePickerPopup() | |||
2518 | } | 2519 | } |
2519 | } | 2520 | } |
2520 | void CalendarView::showDatePicker( ) | 2521 | void CalendarView::showDatePicker( ) |
2521 | { | 2522 | { |
2522 | showDatePickerPopup(); | 2523 | showDatePickerPopup(); |
2523 | mDatePickerMode = 1; | 2524 | mDatePickerMode = 1; |
2524 | mDatePicker->setDate( mNavigator->selectedDates().first() ); | 2525 | mDatePicker->setDate( mNavigator->selectedDates().first() ); |
2525 | } | 2526 | } |
2526 | 2527 | ||
2527 | void CalendarView::showEventEditor() | 2528 | void CalendarView::showEventEditor() |
2528 | { | 2529 | { |
2529 | #ifdef DESKTOP_VERSION | 2530 | #ifdef DESKTOP_VERSION |
2531 | int x,y,w,h; | ||
2532 | x = mEventEditor->geometry().x(); | ||
2533 | y = mEventEditor->geometry().y(); | ||
2534 | w = mEventEditor->width(); | ||
2535 | h = mEventEditor->height(); | ||
2530 | mEventEditor->show(); | 2536 | mEventEditor->show(); |
2537 | mEventEditor->setGeometry(x,y,w,h); | ||
2531 | #else | 2538 | #else |
2532 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { | 2539 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { |
2533 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2540 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2534 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); | 2541 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); |
2535 | qApp->processEvents(); | 2542 | qApp->processEvents(); |
2536 | delete mEventEditor; | 2543 | delete mEventEditor; |
2537 | mEventEditor = mDialogManager->getEventEditor(); | 2544 | mEventEditor = mDialogManager->getEventEditor(); |
2538 | topLevelWidget()->setCaption( i18n("") ); | 2545 | topLevelWidget()->setCaption( i18n("") ); |
2539 | } | 2546 | } |
2540 | mEventEditor->showMaximized(); | 2547 | mEventEditor->showMaximized(); |
2541 | #endif | 2548 | #endif |
2542 | } | 2549 | } |
2543 | void CalendarView::showTodoEditor() | 2550 | void CalendarView::showTodoEditor() |
2544 | { | 2551 | { |
2545 | #ifdef DESKTOP_VERSION | 2552 | #ifdef DESKTOP_VERSION |
2553 | int x,y,w,h; | ||
2554 | x = mTodoEditor->geometry().x(); | ||
2555 | y = mTodoEditor->geometry().y(); | ||
2556 | w = mTodoEditor->width(); | ||
2557 | h = mTodoEditor->height(); | ||
2546 | mTodoEditor->show(); | 2558 | mTodoEditor->show(); |
2559 | mTodoEditor->setGeometry(x,y,w,h); | ||
2547 | #else | 2560 | #else |
2548 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { | 2561 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { |
2549 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2562 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2550 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); | 2563 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); |
2551 | qApp->processEvents(); | 2564 | qApp->processEvents(); |
2552 | delete mTodoEditor; | 2565 | delete mTodoEditor; |
2553 | mTodoEditor = mDialogManager->getTodoEditor(); | 2566 | mTodoEditor = mDialogManager->getTodoEditor(); |
2554 | topLevelWidget()->setCaption( i18n("") ); | 2567 | topLevelWidget()->setCaption( i18n("") ); |
2555 | } | 2568 | } |
2556 | mTodoEditor->showMaximized(); | 2569 | mTodoEditor->showMaximized(); |
2557 | #endif | 2570 | #endif |
2558 | } | 2571 | } |
@@ -2784,25 +2797,25 @@ void CalendarView::editTodo( Todo *todo ) | |||
2784 | return; | 2797 | return; |
2785 | } | 2798 | } |
2786 | showTodoEditor(); | 2799 | showTodoEditor(); |
2787 | mTodoEditor->editTodo( todo ,mFlagEditDescription); | 2800 | mTodoEditor->editTodo( todo ,mFlagEditDescription); |
2788 | mTodoEditor->exec(); | 2801 | mTodoEditor->exec(); |
2789 | setActiveWindow(); | 2802 | setActiveWindow(); |
2790 | 2803 | ||
2791 | } | 2804 | } |
2792 | 2805 | ||
2793 | KOEventViewerDialog* CalendarView::getEventViewerDialog() | 2806 | KOEventViewerDialog* CalendarView::getEventViewerDialog() |
2794 | { | 2807 | { |
2795 | if ( !mEventViewerDialog ) { | 2808 | if ( !mEventViewerDialog ) { |
2796 | mEventViewerDialog = new KOEventViewerDialog(this); | 2809 | mEventViewerDialog = new KOEventViewerDialog(0); |
2797 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); | 2810 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); |
2798 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); | 2811 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); |
2799 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), | 2812 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), |
2800 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 2813 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
2801 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), | 2814 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), |
2802 | viewManager(), SLOT( showAgendaView( bool ) ) ); | 2815 | viewManager(), SLOT( showAgendaView( bool ) ) ); |
2803 | connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), | 2816 | connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), |
2804 | this, SLOT( slotViewerClosed() ) ); | 2817 | this, SLOT( slotViewerClosed() ) ); |
2805 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), | 2818 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), |
2806 | this, SLOT( todoChanged(Todo *) ) ); | 2819 | this, SLOT( todoChanged(Todo *) ) ); |
2807 | mEventViewerDialog->resize( 640, 480 ); | 2820 | mEventViewerDialog->resize( 640, 480 ); |
2808 | 2821 | ||
@@ -3958,17 +3971,18 @@ void CalendarView::resetFocus() | |||
3958 | { | 3971 | { |
3959 | if ( mViewerCallerIsSearchDialog ) { | 3972 | if ( mViewerCallerIsSearchDialog ) { |
3960 | if ( mDialogManager->getSearchDialog()->isVisible() ){ | 3973 | if ( mDialogManager->getSearchDialog()->isVisible() ){ |
3961 | mDialogManager->getSearchDialog()->raise(); | 3974 | mDialogManager->getSearchDialog()->raise(); |
3962 | mDialogManager->getSearchDialog()->setActiveWindow(); | 3975 | mDialogManager->getSearchDialog()->setActiveWindow(); |
3963 | mDialogManager->getSearchDialog()->listview()->resetFocus(); | 3976 | mDialogManager->getSearchDialog()->listview()->resetFocus(); |
3964 | } else | 3977 | } else |
3965 | mViewerCallerIsSearchDialog = false; | 3978 | mViewerCallerIsSearchDialog = false; |
3966 | } | 3979 | } |
3967 | if ( !mViewerCallerIsSearchDialog ) { | 3980 | if ( !mViewerCallerIsSearchDialog ) { |
3968 | //mViewManager->currentView()->setFocus(); | 3981 | //mViewManager->currentView()->setFocus(); |
3969 | //qDebug("sssssssssssssssset focus "); | 3982 | //qDebug("sssssssssssssssset focus "); |
3983 | topLevelWidget()->raise(); | ||
3970 | setActiveWindow(); | 3984 | setActiveWindow(); |
3971 | //setFocus(); | 3985 | //setFocus(); |
3972 | } | 3986 | } |
3973 | mViewerCallerIsSearchDialog = false; | 3987 | mViewerCallerIsSearchDialog = false; |
3974 | } | 3988 | } |