summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
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 )
}
delete cal;
mes = i18n("KO/Pi: Ready for beaming");
topLevelWidget()->setCaption(mes);
KApplication::convert2latin1( fn );
#ifndef DESKTOP_VERSION
Ir *ir = new Ir( this );
connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
ir->send( fn, description, "text/x-vCalendar" );
#endif
}
}
void CalendarView::beamDone( Ir *ir )
{
#ifndef DESKTOP_VERSION
delete ir;
#endif
topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
topLevelWidget()->raise();
}
void CalendarView::moveIncidence(Incidence * inc )
{
if ( !inc ) return;
- // qDebug("showDatePickerForIncidence( ) ");
- if ( mDateFrame->isVisible() )
- mDateFrame->hide();
- else {
- int w =mDatePicker->sizeHint().width()+2*mDateFrame->lineWidth() ;
- int h = mDatePicker->sizeHint().height()+2*mDateFrame->lineWidth() ;
- int dw = QApplication::desktop()->width();
- int dh = QApplication::desktop()->height();
- mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
- mDateFrame->show();
- }
+ showDatePickerPopup();
mDatePickerMode = 2;
mMoveIncidence = inc ;
QDate da;
if ( mMoveIncidence->type() == "Todo" ) {
Todo * to = (Todo *) mMoveIncidence;
if ( to->hasDueDate() )
da = to->dtDue().date();
else
da = QDate::currentDate();
} else {
da = mMoveIncidence->dtStart().date();
}
//PENDING set date for recurring incidence to date of recurrence
//mMoveIncidenceOldDate;
mDatePicker->setDate( da );
}
-void CalendarView::showDatePicker( )
+void CalendarView::showDatePickerPopup()
{
- //qDebug("CalendarView::showDatePicker( ) ");
if ( mDateFrame->isVisible() )
mDateFrame->hide();
else {
+ int offX = 0, offY = 0;
+#ifdef DESKTOP_VERSION
+ int w =mDatePicker->sizeHint().width() ;
+ int h = mDatePicker->sizeHint().height() ;
+ int dw = topLevelWidget()->width();
+ int dh = topLevelWidget()->height();
+ offX = topLevelWidget()->x();
+ offY = topLevelWidget()->y();
+#else
int w =mDatePicker->sizeHint().width() ;
int h = mDatePicker->sizeHint().height() ;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
- mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
+#endif
+ mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h );
mDateFrame->show();
}
+}
+void CalendarView::showDatePicker( )
+{
+ showDatePickerPopup();
mDatePickerMode = 1;
mDatePicker->setDate( mNavigator->selectedDates().first() );
}
void CalendarView::showEventEditor()
{
#ifdef DESKTOP_VERSION
mEventEditor->show();
#else
if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
qApp->processEvents();
delete mEventEditor;
mEventEditor = mDialogManager->getEventEditor();
topLevelWidget()->setCaption( i18n("") );
}
mEventEditor->showMaximized();
#endif
}
void CalendarView::showTodoEditor()
{
#ifdef DESKTOP_VERSION
mTodoEditor->show();