summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 0fbaa9a..a9de65a 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2439,88 +2439,91 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2439 } 2439 }
2440 delete cal; 2440 delete cal;
2441 mes = i18n("KO/Pi: Ready for beaming"); 2441 mes = i18n("KO/Pi: Ready for beaming");
2442 topLevelWidget()->setCaption(mes); 2442 topLevelWidget()->setCaption(mes);
2443 KApplication::convert2latin1( fn ); 2443 KApplication::convert2latin1( fn );
2444#ifndef DESKTOP_VERSION 2444#ifndef DESKTOP_VERSION
2445 Ir *ir = new Ir( this ); 2445 Ir *ir = new Ir( this );
2446 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2446 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2447 ir->send( fn, description, "text/x-vCalendar" ); 2447 ir->send( fn, description, "text/x-vCalendar" );
2448#endif 2448#endif
2449 } 2449 }
2450} 2450}
2451void CalendarView::beamDone( Ir *ir ) 2451void CalendarView::beamDone( Ir *ir )
2452{ 2452{
2453#ifndef DESKTOP_VERSION 2453#ifndef DESKTOP_VERSION
2454 delete ir; 2454 delete ir;
2455#endif 2455#endif
2456 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 2456 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2457 topLevelWidget()->raise(); 2457 topLevelWidget()->raise();
2458} 2458}
2459 2459
2460void CalendarView::moveIncidence(Incidence * inc ) 2460void CalendarView::moveIncidence(Incidence * inc )
2461{ 2461{
2462 if ( !inc ) return; 2462 if ( !inc ) return;
2463 // qDebug("showDatePickerForIncidence( ) "); 2463 showDatePickerPopup();
2464 if ( mDateFrame->isVisible() )
2465 mDateFrame->hide();
2466 else {
2467 int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ;
2468 int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ;
2469 int dw = QApplication::desktop()->width();
2470 int dh = QApplication::desktop()->height();
2471 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2472 mDateFrame->show();
2473 }
2474 mDatePickerMode = 2; 2464 mDatePickerMode = 2;
2475 mMoveIncidence = inc ; 2465 mMoveIncidence = inc ;
2476 QDate da; 2466 QDate da;
2477 if ( mMoveIncidence->type() == "Todo" ) { 2467 if ( mMoveIncidence->type() == "Todo" ) {
2478 Todo * to = (Todo *) mMoveIncidence; 2468 Todo * to = (Todo *) mMoveIncidence;
2479 if ( to->hasDueDate() ) 2469 if ( to->hasDueDate() )
2480 da = to->dtDue().date(); 2470 da = to->dtDue().date();
2481 else 2471 else
2482 da = QDate::currentDate(); 2472 da = QDate::currentDate();
2483 } else { 2473 } else {
2484 da = mMoveIncidence->dtStart().date(); 2474 da = mMoveIncidence->dtStart().date();
2485 } 2475 }
2486 //PENDING set date for recurring incidence to date of recurrence 2476 //PENDING set date for recurring incidence to date of recurrence
2487 //mMoveIncidenceOldDate; 2477 //mMoveIncidenceOldDate;
2488 mDatePicker->setDate( da ); 2478 mDatePicker->setDate( da );
2489} 2479}
2490void CalendarView::showDatePicker( ) 2480void CalendarView::showDatePickerPopup()
2491{ 2481{
2492 //qDebug("CalendarView::showDatePicker( ) ");
2493 if ( mDateFrame->isVisible() ) 2482 if ( mDateFrame->isVisible() )
2494 mDateFrame->hide(); 2483 mDateFrame->hide();
2495 else { 2484 else {
2485 int offX = 0, offY = 0;
2486#ifdef DESKTOP_VERSION
2487 int w =mDatePicker->sizeHint().width() ;
2488 int h = mDatePicker->sizeHint().height() ;
2489 int dw = topLevelWidget()->width();
2490 int dh = topLevelWidget()->height();
2491 offX = topLevelWidget()->x();
2492 offY = topLevelWidget()->y();
2493#else
2496 int w =mDatePicker->sizeHint().width() ; 2494 int w =mDatePicker->sizeHint().width() ;
2497 int h = mDatePicker->sizeHint().height() ; 2495 int h = mDatePicker->sizeHint().height() ;
2498 int dw = QApplication::desktop()->width(); 2496 int dw = QApplication::desktop()->width();
2499 int dh = QApplication::desktop()->height(); 2497 int dh = QApplication::desktop()->height();
2500 mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2498#endif
2499 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h );
2501 mDateFrame->show(); 2500 mDateFrame->show();
2502 } 2501 }
2502}
2503void CalendarView::showDatePicker( )
2504{
2505 showDatePickerPopup();
2503 mDatePickerMode = 1; 2506 mDatePickerMode = 1;
2504 mDatePicker->setDate( mNavigator->selectedDates().first() ); 2507 mDatePicker->setDate( mNavigator->selectedDates().first() );
2505} 2508}
2506 2509
2507void CalendarView::showEventEditor() 2510void CalendarView::showEventEditor()
2508{ 2511{
2509#ifdef DESKTOP_VERSION 2512#ifdef DESKTOP_VERSION
2510 mEventEditor->show(); 2513 mEventEditor->show();
2511#else 2514#else
2512 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { 2515 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
2513 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 2516 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
2514 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); 2517 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
2515 qApp->processEvents(); 2518 qApp->processEvents();
2516 delete mEventEditor; 2519 delete mEventEditor;
2517 mEventEditor = mDialogManager->getEventEditor(); 2520 mEventEditor = mDialogManager->getEventEditor();
2518 topLevelWidget()->setCaption( i18n("") ); 2521 topLevelWidget()->setCaption( i18n("") );
2519 } 2522 }
2520 mEventEditor->showMaximized(); 2523 mEventEditor->showMaximized();
2521#endif 2524#endif
2522} 2525}
2523void CalendarView::showTodoEditor() 2526void CalendarView::showTodoEditor()
2524{ 2527{
2525#ifdef DESKTOP_VERSION 2528#ifdef DESKTOP_VERSION
2526 mTodoEditor->show(); 2529 mTodoEditor->show();