summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
authorzautrix <zautrix>2005-02-23 18:47:45 (UTC)
committer zautrix <zautrix>2005-02-23 18:47:45 (UTC)
commit31f24d21cd23bb7e4033e7ffa000e6c979133ce7 (patch) (side-by-side diff)
tree2fa81f67efc6544a3664e6039a9602ef6f3466b9 /korganizer/calendarview.cpp
parentfaedffc5ce8391204e0340a21eaaf582319ac824 (diff)
downloadkdepimpi-31f24d21cd23bb7e4033e7ffa000e6c979133ce7.zip
kdepimpi-31f24d21cd23bb7e4033e7ffa000e6c979133ce7.tar.gz
kdepimpi-31f24d21cd23bb7e4033e7ffa000e6c979133ce7.tar.bz2
many focus fixes
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp52
1 files changed, 51 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 3dac20b..1009956 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -229,10 +229,14 @@ CalendarView::CalendarView( Calendar *calendar,
mEventEditor = 0;
mTodoEditor = 0;
- init();}
+ init();
+}
void CalendarView::init()
{
+
+ setFocusPolicy ( WheelFocus );
+ mViewerCallerIsSearchDialog = false;
mBlockShowDates = false;
beamDialog = new KOBeamPrefs();
mDatePickerMode = 0;
@@ -2620,6 +2624,7 @@ void CalendarView::cloneIncidence(Incidence * orgInc )
delete e;
}
}
+ setActiveWindow();
}
void CalendarView::newEvent()
@@ -2677,6 +2682,8 @@ void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
if ( filter )
mEventEditor->setSecrecy( filter->getSecrecy() );
}
+ mEventEditor->exec();
+ setActiveWindow();
}
void CalendarView::todoAdded(Todo * t)
{
@@ -2713,6 +2720,8 @@ void CalendarView::newTodoDateTime( QDateTime dt, bool allday )
if ( filter )
mTodoEditor->setSecrecy( filter->getSecrecy() );
}
+ mTodoEditor->exec();
+ setActiveWindow();
}
void CalendarView::newTodo()
@@ -2731,6 +2740,8 @@ void CalendarView::newSubTodo(Todo *parentEvent)
showTodoEditor();
mTodoEditor->newTodo(QDateTime(),parentEvent,true);
+ mTodoEditor->exec();
+ setActiveWindow();
}
void CalendarView::newFloatingEvent()
@@ -2753,6 +2764,9 @@ void CalendarView::editEvent( Event *event )
}
showEventEditor();
mEventEditor->editEvent( event , mFlagEditDescription);
+ mEventEditor->exec();
+ setActiveWindow();
+
}
void CalendarView::editJournal( Journal *jour )
{
@@ -2771,6 +2785,8 @@ void CalendarView::editTodo( Todo *todo )
}
showTodoEditor();
mTodoEditor->editTodo( todo ,mFlagEditDescription);
+ mTodoEditor->exec();
+ setActiveWindow();
}
@@ -2784,6 +2800,8 @@ KOEventViewerDialog* CalendarView::getEventViewerDialog()
dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
viewManager(), SLOT( showAgendaView( bool ) ) );
+ connect( mEventViewerDialog, SIGNAL(signalViewerClosed()),
+ this, SLOT( slotViewerClosed() ) );
connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
this, SLOT( todoChanged(Todo *) ) );
mEventViewerDialog->resize( 640, 480 );
@@ -3738,6 +3756,7 @@ void CalendarView::dialogClosing(Incidence *in)
void CalendarView::showIncidence()
{
+ mViewerCallerIsSearchDialog = false;
Incidence *incidence = currentSelection();
if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
if ( incidence ) {
@@ -3773,6 +3792,13 @@ void CalendarView::deleteIncidence()
void CalendarView::showIncidence(Incidence *incidence)
{
+ mViewerCallerIsSearchDialog = false;
+ //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() );
+ if ( sender() && mDialogManager->getSearchDialog() ) {
+ if ( sender () == mDialogManager->getSearchDialog()->listview() ) {
+ mViewerCallerIsSearchDialog = true;
+ }
+ }
if ( incidence ) {
ShowIncidenceVisitor v;
v.act( incidence, this );
@@ -3922,3 +3948,27 @@ void CalendarView::undo_delete()
updateView();
}
}
+
+void CalendarView::slotViewerClosed()
+{
+ QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
+}
+
+void CalendarView::resetFocus()
+{
+ if ( mViewerCallerIsSearchDialog ) {
+ if ( mDialogManager->getSearchDialog()->isVisible() ){
+ mDialogManager->getSearchDialog()->raise();
+ mDialogManager->getSearchDialog()->setActiveWindow();
+ mDialogManager->getSearchDialog()->listview()->resetFocus();
+ } else
+ mViewerCallerIsSearchDialog = false;
+ }
+ if ( !mViewerCallerIsSearchDialog ) {
+ //mViewManager->currentView()->setFocus();
+ //qDebug("sssssssssssssssset focus ");
+ setActiveWindow();
+ //setFocus();
+ }
+ mViewerCallerIsSearchDialog = false;
+}