-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 @@ -2474,6 +2474,7 @@ void CalendarView::showEventEditor() 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(); @@ -2487,6 +2488,7 @@ void CalendarView::showTodoEditor() 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(); @@ -2543,6 +2545,6 @@ void CalendarView::cloneIncidence(Incidence * orgInc ) if ( newInc->type() == "Todo" ) { Todo* t = (Todo*) newInc; - mTodoEditor->editTodo( t ); showTodoEditor(); + mTodoEditor->editTodo( t ); if ( mTodoEditor->exec() ) { mCalendar->addTodo( t ); @@ -2554,6 +2556,6 @@ void CalendarView::cloneIncidence(Incidence * orgInc ) else { Event* e = (Event*) newInc; - mEventEditor->editEvent( e ); showEventEditor(); + mEventEditor->editEvent( e ); if ( mEventEditor->exec() ) { mCalendar->addEvent( e ); @@ -2607,4 +2609,5 @@ void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) { + showEventEditor(); mEventEditor->newEvent(fromHint,toHint,allDay); if ( mFilterView->filtersEnabled() ) { @@ -2616,5 +2619,4 @@ void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) mEventEditor->setSecrecy( filter->getSecrecy() ); } - showEventEditor(); } void CalendarView::todoAdded(Todo * t) @@ -2645,4 +2647,5 @@ void CalendarView::newTodo() { + showTodoEditor(); mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); if ( mFilterView->filtersEnabled() ) { @@ -2654,5 +2657,4 @@ void CalendarView::newTodo() mTodoEditor->setSecrecy( filter->getSecrecy() ); } - showTodoEditor(); } @@ -2666,6 +2668,6 @@ void CalendarView::newSubTodo(Todo *parentEvent) { - mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); showTodoEditor(); + mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); } @@ -2688,6 +2690,6 @@ void CalendarView::editEvent( Event *event ) return; } - mEventEditor->editEvent( event , mFlagEditDescription); showEventEditor(); + mEventEditor->editEvent( event , mFlagEditDescription); } void CalendarView::editJournal( Journal *jour ) @@ -2706,6 +2708,6 @@ void CalendarView::editTodo( Todo *todo ) return; } - mTodoEditor->editTodo( todo ,mFlagEditDescription); showTodoEditor(); + mTodoEditor->editTodo( todo ,mFlagEditDescription); } |