-rw-r--r-- | korganizer/calendarview.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 15c5dd9..a46cd87 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2470,27 +2470,29 @@ void CalendarView::showDatePicker( ) void CalendarView::showEventEditor() { #ifdef DESKTOP_VERSION mEventEditor->show(); #else - if ( mEventEditor->width() != QApplication::desktop()->width() ) { - qDebug("CalendarView: recreate mEventEditor "); + if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { + topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); + qDebug("CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); delete mEventEditor; mEventEditor = mDialogManager->getEventEditor(); } mEventEditor->showMaximized(); #endif } void CalendarView::showTodoEditor() { #ifdef DESKTOP_VERSION mTodoEditor->show(); #else - if ( mTodoEditor->width() != QApplication::desktop()->width() ) { - qDebug("CalendarView: recreate mTodoEditor "); + if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { + topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); + qDebug("CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); delete mTodoEditor; mTodoEditor = mDialogManager->getTodoEditor(); } mTodoEditor->showMaximized(); #endif } @@ -2539,25 +2541,25 @@ void CalendarView::cloneIncidence(Incidence * orgInc ) { Incidence * newInc = orgInc->clone(); newInc->recreate(); if ( newInc->type() == "Todo" ) { Todo* t = (Todo*) newInc; - mTodoEditor->editTodo( t ); showTodoEditor(); + mTodoEditor->editTodo( t ); if ( mTodoEditor->exec() ) { mCalendar->addTodo( t ); updateView(); } else { delete t; } } else { Event* e = (Event*) newInc; - mEventEditor->editEvent( e ); showEventEditor(); + mEventEditor->editEvent( e ); if ( mEventEditor->exec() ) { mCalendar->addEvent( e ); updateView(); } else { delete e; } @@ -2603,22 +2605,22 @@ void CalendarView::newEvent(QDate dt) QDateTime(dt, QTime(0,0,0)), true); } void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) { + showEventEditor(); mEventEditor->newEvent(fromHint,toHint,allDay); if ( mFilterView->filtersEnabled() ) { CalFilter *filter = mFilterView->selectedFilter(); if (filter && filter->showCategories()) { mEventEditor->setCategories(filter->categoryList().join(",") ); } if ( filter ) mEventEditor->setSecrecy( filter->getSecrecy() ); } - showEventEditor(); } void CalendarView::todoAdded(Todo * t) { changeTodoDisplay ( t ,KOGlobals::EVENTADDED); updateTodoViews(); @@ -2641,35 +2643,35 @@ void CalendarView::todoDeleted() void CalendarView::newTodo() { + showTodoEditor(); mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); if ( mFilterView->filtersEnabled() ) { CalFilter *filter = mFilterView->selectedFilter(); if (filter && filter->showCategories()) { mTodoEditor->setCategories(filter->categoryList().join(",") ); } if ( filter ) mTodoEditor->setSecrecy( filter->getSecrecy() ); } - showTodoEditor(); } void CalendarView::newSubTodo() { Todo *todo = selectedTodo(); if ( todo ) newSubTodo( todo ); } void CalendarView::newSubTodo(Todo *parentEvent) { - mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); showTodoEditor(); + mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); } void CalendarView::newFloatingEvent() { DateList tmpList = mNavigator->selectedDates(); QDate date = tmpList.first(); @@ -2684,14 +2686,14 @@ void CalendarView::editEvent( Event *event ) if ( !event ) return; if ( event->isReadOnly() ) { showEvent( event ); return; } - mEventEditor->editEvent( event , mFlagEditDescription); showEventEditor(); + mEventEditor->editEvent( event , mFlagEditDescription); } void CalendarView::editJournal( Journal *jour ) { if ( !jour ) return; mDialogManager->hideSearchDialog(); mViewManager->showJournalView(); @@ -2702,14 +2704,14 @@ void CalendarView::editTodo( Todo *todo ) if ( !todo ) return; if ( todo->isReadOnly() ) { showTodo( todo ); return; } - mTodoEditor->editTodo( todo ,mFlagEditDescription); showTodoEditor(); + mTodoEditor->editTodo( todo ,mFlagEditDescription); } KOEventViewerDialog* CalendarView::getEventViewerDialog() { if ( !mEventViewerDialog ) { |