summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-23 18:47:45 (UTC)
committer zautrix <zautrix>2005-02-23 18:47:45 (UTC)
commit31f24d21cd23bb7e4033e7ffa000e6c979133ce7 (patch) (unidiff)
tree2fa81f67efc6544a3664e6039a9602ef6f3466b9
parentfaedffc5ce8391204e0340a21eaaf582319ac824 (diff)
downloadkdepimpi-31f24d21cd23bb7e4033e7ffa000e6c979133ce7.zip
kdepimpi-31f24d21cd23bb7e4033e7ffa000e6c979133ce7.tar.gz
kdepimpi-31f24d21cd23bb7e4033e7ffa000e6c979133ce7.tar.bz2
many focus fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp54
-rw-r--r--korganizer/calendarview.h3
-rw-r--r--korganizer/koeventviewer.h2
-rw-r--r--korganizer/koeventviewerdialog.cpp21
-rw-r--r--korganizer/koeventviewerdialog.h10
-rw-r--r--korganizer/kolistview.cpp8
-rw-r--r--korganizer/kolistview.h1
-rw-r--r--korganizer/kotodoview.cpp22
-rw-r--r--korganizer/mainwindow.cpp1
9 files changed, 111 insertions, 11 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 3dac20b..1009956 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -226,16 +226,20 @@ CalendarView::CalendarView( Calendar *calendar,
226 mCalendar( calendar ), 226 mCalendar( calendar ),
227 mResourceManager( 0 ) 227 mResourceManager( 0 )
228{ 228{
229 229
230 mEventEditor = 0; 230 mEventEditor = 0;
231 mTodoEditor = 0; 231 mTodoEditor = 0;
232 init();} 232 init();
233}
233 234
234void CalendarView::init() 235void CalendarView::init()
235{ 236{
237
238 setFocusPolicy ( WheelFocus );
239 mViewerCallerIsSearchDialog = false;
236 mBlockShowDates = false; 240 mBlockShowDates = false;
237 beamDialog = new KOBeamPrefs(); 241 beamDialog = new KOBeamPrefs();
238 mDatePickerMode = 0; 242 mDatePickerMode = 0;
239 mCurrentSyncDevice = ""; 243 mCurrentSyncDevice = "";
240 writeLocale(); 244 writeLocale();
241 mViewManager = new KOViewManager( this ); 245 mViewManager = new KOViewManager( this );
@@ -2617,12 +2621,13 @@ void CalendarView::cloneIncidence(Incidence * orgInc )
2617 mCalendar->addEvent( e ); 2621 mCalendar->addEvent( e );
2618 updateView(); 2622 updateView();
2619 } else { 2623 } else {
2620 delete e; 2624 delete e;
2621 } 2625 }
2622 } 2626 }
2627 setActiveWindow();
2623} 2628}
2624 2629
2625void CalendarView::newEvent() 2630void CalendarView::newEvent()
2626{ 2631{
2627 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 2632 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
2628 KOAgendaView *aView = mViewManager->agendaView(); 2633 KOAgendaView *aView = mViewManager->agendaView();
@@ -2674,12 +2679,14 @@ void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
2674 if (filter && filter->showCategories()) { 2679 if (filter && filter->showCategories()) {
2675 mEventEditor->setCategories(filter->categoryList().join(",") ); 2680 mEventEditor->setCategories(filter->categoryList().join(",") );
2676 } 2681 }
2677 if ( filter ) 2682 if ( filter )
2678 mEventEditor->setSecrecy( filter->getSecrecy() ); 2683 mEventEditor->setSecrecy( filter->getSecrecy() );
2679 } 2684 }
2685 mEventEditor->exec();
2686 setActiveWindow();
2680} 2687}
2681void CalendarView::todoAdded(Todo * t) 2688void CalendarView::todoAdded(Todo * t)
2682{ 2689{
2683 2690
2684 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 2691 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
2685 updateTodoViews(); 2692 updateTodoViews();
@@ -2710,12 +2717,14 @@ void CalendarView::newTodoDateTime( QDateTime dt, bool allday )
2710 if (filter && filter->showCategories()) { 2717 if (filter && filter->showCategories()) {
2711 mTodoEditor->setCategories(filter->categoryList().join(",") ); 2718 mTodoEditor->setCategories(filter->categoryList().join(",") );
2712 } 2719 }
2713 if ( filter ) 2720 if ( filter )
2714 mTodoEditor->setSecrecy( filter->getSecrecy() ); 2721 mTodoEditor->setSecrecy( filter->getSecrecy() );
2715 } 2722 }
2723 mTodoEditor->exec();
2724 setActiveWindow();
2716} 2725}
2717 2726
2718void CalendarView::newTodo() 2727void CalendarView::newTodo()
2719{ 2728{
2720 newTodoDateTime( QDateTime(),true ); 2729 newTodoDateTime( QDateTime(),true );
2721} 2730}
@@ -2727,13 +2736,15 @@ void CalendarView::newSubTodo()
2727} 2736}
2728 2737
2729void CalendarView::newSubTodo(Todo *parentEvent) 2738void CalendarView::newSubTodo(Todo *parentEvent)
2730{ 2739{
2731 2740
2732 showTodoEditor(); 2741 showTodoEditor();
2733 mTodoEditor->newTodo(QDateTime(),parentEvent,true); 2742 mTodoEditor->newTodo(QDateTime(),parentEvent,true);
2743 mTodoEditor->exec();
2744 setActiveWindow();
2734} 2745}
2735 2746
2736void CalendarView::newFloatingEvent() 2747void CalendarView::newFloatingEvent()
2737{ 2748{
2738 DateList tmpList = mNavigator->selectedDates(); 2749 DateList tmpList = mNavigator->selectedDates();
2739 QDate date = tmpList.first(); 2750 QDate date = tmpList.first();
@@ -2750,12 +2761,15 @@ void CalendarView::editEvent( Event *event )
2750 if ( event->isReadOnly() ) { 2761 if ( event->isReadOnly() ) {
2751 showEvent( event ); 2762 showEvent( event );
2752 return; 2763 return;
2753 } 2764 }
2754 showEventEditor(); 2765 showEventEditor();
2755 mEventEditor->editEvent( event , mFlagEditDescription); 2766 mEventEditor->editEvent( event , mFlagEditDescription);
2767 mEventEditor->exec();
2768 setActiveWindow();
2769
2756} 2770}
2757void CalendarView::editJournal( Journal *jour ) 2771void CalendarView::editJournal( Journal *jour )
2758{ 2772{
2759 if ( !jour ) return; 2773 if ( !jour ) return;
2760 mDialogManager->hideSearchDialog(); 2774 mDialogManager->hideSearchDialog();
2761 mViewManager->showJournalView(); 2775 mViewManager->showJournalView();
@@ -2768,12 +2782,14 @@ void CalendarView::editTodo( Todo *todo )
2768 if ( todo->isReadOnly() ) { 2782 if ( todo->isReadOnly() ) {
2769 showTodo( todo ); 2783 showTodo( todo );
2770 return; 2784 return;
2771 } 2785 }
2772 showTodoEditor(); 2786 showTodoEditor();
2773 mTodoEditor->editTodo( todo ,mFlagEditDescription); 2787 mTodoEditor->editTodo( todo ,mFlagEditDescription);
2788 mTodoEditor->exec();
2789 setActiveWindow();
2774 2790
2775} 2791}
2776 2792
2777KOEventViewerDialog* CalendarView::getEventViewerDialog() 2793KOEventViewerDialog* CalendarView::getEventViewerDialog()
2778{ 2794{
2779 if ( !mEventViewerDialog ) { 2795 if ( !mEventViewerDialog ) {
@@ -2781,12 +2797,14 @@ KOEventViewerDialog* CalendarView::getEventViewerDialog()
2781 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 2797 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
2782 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 2798 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
2783 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 2799 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
2784 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 2800 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
2785 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 2801 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
2786 viewManager(), SLOT( showAgendaView( bool ) ) ); 2802 viewManager(), SLOT( showAgendaView( bool ) ) );
2803 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()),
2804 this, SLOT( slotViewerClosed() ) );
2787 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), 2805 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
2788 this, SLOT( todoChanged(Todo *) ) ); 2806 this, SLOT( todoChanged(Todo *) ) );
2789 mEventViewerDialog->resize( 640, 480 ); 2807 mEventViewerDialog->resize( 640, 480 );
2790 2808
2791 } 2809 }
2792 return mEventViewerDialog; 2810 return mEventViewerDialog;
@@ -3735,12 +3753,13 @@ void CalendarView::dialogClosing(Incidence *in)
3735{ 3753{
3736 // mDialogList.remove(in); 3754 // mDialogList.remove(in);
3737} 3755}
3738 3756
3739void CalendarView::showIncidence() 3757void CalendarView::showIncidence()
3740{ 3758{
3759 mViewerCallerIsSearchDialog = false;
3741 Incidence *incidence = currentSelection(); 3760 Incidence *incidence = currentSelection();
3742 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3761 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3743 if ( incidence ) { 3762 if ( incidence ) {
3744 ShowIncidenceVisitor v; 3763 ShowIncidenceVisitor v;
3745 v.act( incidence, this ); 3764 v.act( incidence, this );
3746 } 3765 }
@@ -3770,12 +3789,19 @@ void CalendarView::deleteIncidence()
3770 deleteIncidence(incidence); 3789 deleteIncidence(incidence);
3771 } 3790 }
3772} 3791}
3773 3792
3774void CalendarView::showIncidence(Incidence *incidence) 3793void CalendarView::showIncidence(Incidence *incidence)
3775{ 3794{
3795 mViewerCallerIsSearchDialog = false;
3796 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() );
3797 if ( sender() && mDialogManager->getSearchDialog() ) {
3798 if ( sender () == mDialogManager->getSearchDialog()->listview() ) {
3799 mViewerCallerIsSearchDialog = true;
3800 }
3801 }
3776 if ( incidence ) { 3802 if ( incidence ) {
3777 ShowIncidenceVisitor v; 3803 ShowIncidenceVisitor v;
3778 v.act( incidence, this ); 3804 v.act( incidence, this );
3779 } 3805 }
3780} 3806}
3781 3807
@@ -3919,6 +3945,30 @@ void CalendarView::undo_delete()
3919 i18n("\nAre you sure you want\nto restore this?"), 3945 i18n("\nAre you sure you want\nto restore this?"),
3920 i18n("KO/Pi Confirmation"),i18n("Restore"))) { 3946 i18n("KO/Pi Confirmation"),i18n("Restore"))) {
3921 mCalendar->undoDeleteIncidence(); 3947 mCalendar->undoDeleteIncidence();
3922 updateView(); 3948 updateView();
3923 } 3949 }
3924} 3950}
3951
3952void CalendarView::slotViewerClosed()
3953{
3954 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
3955}
3956
3957void CalendarView::resetFocus()
3958{
3959 if ( mViewerCallerIsSearchDialog ) {
3960 if ( mDialogManager->getSearchDialog()->isVisible() ){
3961 mDialogManager->getSearchDialog()->raise();
3962 mDialogManager->getSearchDialog()->setActiveWindow();
3963 mDialogManager->getSearchDialog()->listview()->resetFocus();
3964 } else
3965 mViewerCallerIsSearchDialog = false;
3966 }
3967 if ( !mViewerCallerIsSearchDialog ) {
3968 //mViewManager->currentView()->setFocus();
3969 //qDebug("sssssssssssssssset focus ");
3970 setActiveWindow();
3971 //setFocus();
3972 }
3973 mViewerCallerIsSearchDialog = false;
3974}
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index e626ea3..664d700 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -453,12 +453,14 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
453 void removeCategories(); 453 void removeCategories();
454 void setSyncDevice( QString ); 454 void setSyncDevice( QString );
455 void setSyncName( QString ); 455 void setSyncName( QString );
456 void showDay( QDate ); 456 void showDay( QDate );
457 void undo_delete(); 457 void undo_delete();
458 protected slots: 458 protected slots:
459 void resetFocus();
460 void slotViewerClosed();
459 void timerAlarm(); 461 void timerAlarm();
460 void suspendAlarm(); 462 void suspendAlarm();
461 void beamDone( Ir *ir ); 463 void beamDone( Ir *ir );
462 /** Select a view or adapt the current view to display the specified dates. */ 464 /** Select a view or adapt the current view to display the specified dates. */
463 void showDates( const KCal::DateList & ); 465 void showDates( const KCal::DateList & );
464 void selectWeekNum ( int ); 466 void selectWeekNum ( int );
@@ -492,12 +494,13 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
492 void showEventEditor(); 494 void showEventEditor();
493 void showTodoEditor(); 495 void showTodoEditor();
494 void writeLocale(); 496 void writeLocale();
495 Todo *selectedTodo(); 497 Todo *selectedTodo();
496 498
497 private: 499 private:
500 bool mViewerCallerIsSearchDialog;
498 bool mBlockShowDates; 501 bool mBlockShowDates;
499 KSyncManager* mSyncManager; 502 KSyncManager* mSyncManager;
500 AlarmDialog * mAlarmDialog; 503 AlarmDialog * mAlarmDialog;
501 QString mAlarmNotification; 504 QString mAlarmNotification;
502 QString mSuspendAlarmNotification; 505 QString mSuspendAlarmNotification;
503 QTimer* mSuspendTimer; 506 QTimer* mSuspendTimer;
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index d8142ca..2d4a08e 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -67,10 +67,10 @@ class KOEventViewer : public QTextBrowser {
67 bool mSyncMode; 67 bool mSyncMode;
68 68
69 QString mText; 69 QString mText;
70 QString mMailSubject; 70 QString mMailSubject;
71 Incidence* mCurrentIncidence; 71 Incidence* mCurrentIncidence;
72 signals: 72 signals:
73 void launchaddressbook(QString uid); 73 void launchaddressbook(QString uid);
74}; 74};
75 75
76#endif 76#endif
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 23e62d3..8bada3b 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -17,12 +17,13 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <klocale.h> 20#include <klocale.h>
21 21
22#include <libkcal/event.h> 22#include <libkcal/event.h>
23#include <qtimer.h>
23#include <qpushbutton.h> 24#include <qpushbutton.h>
24 25
25#include "koeventviewer.h" 26#include "koeventviewer.h"
26#include "koprefs.h" 27#include "koprefs.h"
27#include <libkcal/todo.h> 28#include <libkcal/todo.h>
28#include "qapp.h" 29#include "qapp.h"
@@ -36,13 +37,13 @@ KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
36 true , 37 true ,
37#else 38#else
38 false, 39 false,
39#endif 40#endif
40 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) 41 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda"))
41{ 42{
42 43 sendSignalViewerClosed = true;
43 mEventViewer = new KOEventViewer(this); 44 mEventViewer = new KOEventViewer(this);
44 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 45 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
45 setMainWidget(mEventViewer); 46 setMainWidget(mEventViewer);
46 setButtonText(Ok, i18n("Edit") ); 47 setButtonText(Ok, i18n("Edit") );
47 48
48 QObject::connect(findButton( Ok ),SIGNAL(clicked()), 49 QObject::connect(findButton( Ok ),SIGNAL(clicked()),
@@ -186,12 +187,13 @@ void KOEventViewerDialog::addText(QString text)
186 mEventViewer->addText(text); 187 mEventViewer->addText(text);
187 mEventViewer->setFocus(); 188 mEventViewer->setFocus();
188 //findButton( Close )->setFocus(); 189 //findButton( Close )->setFocus();
189} 190}
190void KOEventViewerDialog::editIncidence() 191void KOEventViewerDialog::editIncidence()
191{ 192{
193 sendSignalViewerClosed = false;
192 if ( mSyncMode ) { 194 if ( mSyncMode ) {
193 mSyncResult = 2; 195 mSyncResult = 2;
194 accept(); 196 accept();
195 return; 197 return;
196 } 198 }
197 if ( mIncidence ){ 199 if ( mIncidence ){
@@ -200,13 +202,13 @@ void KOEventViewerDialog::editIncidence()
200#endif 202#endif
201 emit editIncidence( mIncidence ); 203 emit editIncidence( mIncidence );
202 } 204 }
203} 205}
204void KOEventViewerDialog::showIncidence() 206void KOEventViewerDialog::showIncidence()
205{ 207{
206 208 sendSignalViewerClosed = false;
207 if ( mSyncMode ) { 209 if ( mSyncMode ) {
208 mSyncResult = 1; 210 mSyncResult = 1;
209 accept(); 211 accept();
210 return; 212 return;
211 } 213 }
212 214
@@ -261,6 +263,21 @@ void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
261 default: 263 default:
262 KDialogBase::keyPressEvent ( e ); 264 KDialogBase::keyPressEvent ( e );
263 break; 265 break;
264 } 266 }
265 267
266} 268}
269void KOEventViewerDialog::hideEvent ( QHideEvent * e )
270{
271 KDialogBase::hideEvent ( e );
272 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) );
273}
274
275void KOEventViewerDialog::slotViewerClosed()
276{
277 if ( sendSignalViewerClosed ) {
278 //qDebug("KOEventViewerDialog::hideEvent ");
279 emit signalViewerClosed();
280 }
281 sendSignalViewerClosed = true;
282}
283
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h
index b6b4103..36431ad 100644
--- a/korganizer/koeventviewerdialog.h
+++ b/korganizer/koeventviewerdialog.h
@@ -52,18 +52,22 @@ class KOEventViewerDialog : public KDialogBase {
52 public slots: 52 public slots:
53 void updateConfig(); 53 void updateConfig();
54 signals: 54 signals:
55 void editIncidence( Incidence* ); 55 void editIncidence( Incidence* );
56 void jumpToTime( const QDate &); 56 void jumpToTime( const QDate &);
57 void showAgendaView( bool ); 57 void showAgendaView( bool );
58 void todoCompleted(Todo*); 58 void todoCompleted(Todo*);
59 void signalViewerClosed();
59private slots: 60private slots:
61 void slotViewerClosed();
60 void editIncidence(); 62 void editIncidence();
61 void showIncidence(); 63 void showIncidence();
62 64 protected:
65 void hideEvent ( QHideEvent * e );
63 private: 66 private:
67 bool sendSignalViewerClosed;
64 bool mSyncMode; 68 bool mSyncMode;
65 int mSyncResult; 69 int mSyncResult;
66 KOEventViewer *mEventViewer; 70 KOEventViewer *mEventViewer;
67 Incidence* mIncidence; 71 Incidence* mIncidence;
68 void keyPressEvent ( QKeyEvent * e ); 72 void keyPressEvent ( QKeyEvent * e );
69}; 73};
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 4a6e17d..6acee75 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -781,13 +781,16 @@ void KOListView::showDates()
781} 781}
782 782
783void KOListView::hideDates() 783void KOListView::hideDates()
784{ 784{
785 showDates(false); 785 showDates(false);
786} 786}
787 787void KOListView::resetFocus()
788{
789 mListView->setFocus();
790}
788void KOListView::updateView() 791void KOListView::updateView()
789{ 792{
790 mListView->setFocus(); 793 mListView->setFocus();
791 if ( mListView->firstChild () ) 794 if ( mListView->firstChild () )
792 mListView->setCurrentItem( mListView->firstChild () ); 795 mListView->setCurrentItem( mListView->firstChild () );
793} 796}
@@ -1072,17 +1075,18 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e)
1072 case Qt::Key_I: { 1075 case Qt::Key_I: {
1073 QListViewItem* cn; 1076 QListViewItem* cn;
1074 cn = currentItem(); 1077 cn = currentItem();
1075 if ( cn ) { 1078 if ( cn ) {
1076 KOListViewItem* ci = (KOListViewItem*)( cn ); 1079 KOListViewItem* ci = (KOListViewItem*)( cn );
1077 if ( ci ){ 1080 if ( ci ){
1078 emit showIncidence( ci->data()); 1081 //emit showIncidence( ci->data());
1079 cn = cn->nextSibling(); 1082 cn = cn->nextSibling();
1080 if ( cn ) { 1083 if ( cn ) {
1081 setCurrentItem ( cn ); 1084 setCurrentItem ( cn );
1082 ensureItemVisible ( cn ); 1085 ensureItemVisible ( cn );
1086 emit showIncidence( ci->data());
1083 } 1087 }
1084 } 1088 }
1085 } 1089 }
1086 e->accept(); 1090 e->accept();
1087 } 1091 }
1088 break; 1092 break;
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index bd5bd12..c86449d 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -251,12 +251,13 @@ class KOListView : public KOEventView
251 void readSettings(KConfig *config, QString setting = "KOListView Layout"); 251 void readSettings(KConfig *config, QString setting = "KOListView Layout");
252 void writeSettings(KConfig *config, QString setting = "KOListView Layout"); 252 void writeSettings(KConfig *config, QString setting = "KOListView Layout");
253 void updateList(); 253 void updateList();
254 void setStartDate(const QDate &start); 254 void setStartDate(const QDate &start);
255 int count(); 255 int count();
256 QString getWhatsThisText(QPoint p); 256 QString getWhatsThisText(QPoint p);
257 void resetFocus();
257 signals: 258 signals:
258 void signalNewEvent(); 259 void signalNewEvent();
259 void beamIncidenceList(QPtrList<Incidence>); 260 void beamIncidenceList(QPtrList<Incidence>);
260 261
261 public slots: 262 public slots:
262 virtual void updateView(); 263 virtual void updateView();
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 3483e95..5e8ea27 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -602,12 +602,17 @@ void KOTodoView::updateView()
602 displayAllFlat(); 602 displayAllFlat();
603 return; 603 return;
604 } 604 }
605 //qDebug("update "); 605 //qDebug("update ");
606// kdDebug() << "KOTodoView::updateView()" << endl; 606// kdDebug() << "KOTodoView::updateView()" << endl;
607 QFont fo = KOPrefs::instance()->mTodoViewFont; 607 QFont fo = KOPrefs::instance()->mTodoViewFont;
608 Incidence* oldInc = 0;
609 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
610 if (mActiveItem)
611 oldInc = mActiveItem->todo();
612
608 mTodoListView->clear(); 613 mTodoListView->clear();
609 if ( mName == "todolistsmall" ) { 614 if ( mName == "todolistsmall" ) {
610 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { 615 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
611 int ps = fo.pointSize() -2; 616 int ps = fo.pointSize() -2;
612 if ( ps > 12 ) 617 if ( ps > 12 )
613 ps -= 2; 618 ps -= 2;
@@ -683,12 +688,29 @@ void KOTodoView::updateView()
683 //qDebug("for end "); 688 //qDebug("for end ");
684 // Restore opened/closed state 689 // Restore opened/closed state
685 mTodoListView->blockSignals( true ); 690 mTodoListView->blockSignals( true );
686 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); 691 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() );
687 mTodoListView->blockSignals( false ); 692 mTodoListView->blockSignals( false );
688 mTodoListView->setFocus(); 693 mTodoListView->setFocus();
694 if ( mTodoListView->firstChild () ) {
695 if ( oldInc ) {
696 KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild ();
697 while ( item ) {
698 if ( item->todo() == oldInc ) {
699 mTodoListView->setCurrentItem( item );
700 mTodoListView->ensureItemVisible( item );
701 break;
702 }
703 item = (KOTodoViewItem*)item->itemBelow();
704 }
705 if ( ! item )
706 mTodoListView->setCurrentItem( mTodoListView->firstChild () );
707 } else {
708 mTodoListView->setCurrentItem( mTodoListView->firstChild () );
709 }
710 }
689 processSelectionChange(); 711 processSelectionChange();
690} 712}
691 713
692bool KOTodoView::checkTodo( Todo * todo ) 714bool KOTodoView::checkTodo( Todo * todo )
693{ 715{
694 716
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 4f2cccf..2de7f28 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -284,13 +284,12 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
284#endif 284#endif
285 updateWeek( mView->startDate() ); 285 updateWeek( mView->startDate() );
286 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 286 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
287 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 287 SLOT( updateWeekNum( const KCal::DateList & ) ) );
288 mBRdisabled = false; 288 mBRdisabled = false;
289 //toggleBeamReceive(); 289 //toggleBeamReceive();
290 setFocusPolicy ( WheelFocus );
291} 290}
292MainWindow::~MainWindow() 291MainWindow::~MainWindow()
293{ 292{
294 //qDebug("MainWindow::~MainWindow() "); 293 //qDebug("MainWindow::~MainWindow() ");
295 //save toolbar location 294 //save toolbar location
296 delete mCalendar; 295 delete mCalendar;