-rw-r--r-- | korganizer/calendarview.cpp | 7 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 27 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 5 |
4 files changed, 30 insertions, 10 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 17f1659..a9e402e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -369,3 +369,3 @@ void CalendarView::init() mNextAlarmDateTime = QDateTime::currentDateTime(); - //setFocusPolicy ( NoFocus ); + setFocusPolicy (NoFocus ); mViewerCallerIsSearchDialog = false; @@ -658,7 +658,2 @@ CalendarView::~CalendarView() -void CalendarView::slotResetFocus() -{ - qDebug(" CalendarView::slotResetFocus() %x", qApp->focusWidget()); - -} diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 456c2d7..1debef7 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -203,3 +203,2 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser public slots: - void slotResetFocus(); void nextConflict( bool all, bool allday ); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 21d5a35..279955f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -425,3 +425,20 @@ MainWindow::~MainWindow() } - +void MainWindow::slotResetFocus() +{ + //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); + mFocusLoop = 3; + QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); +} +void MainWindow::slotResetFocusLoop() +{ + --mFocusLoop; + QWidget* fw = mView->viewManager()->currentView(); + if ( fw ) { + //qDebug("loop "); + fw->setFocus(); + if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) + QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); + } + +} void MainWindow::disableBR(bool b) @@ -682,5 +699,7 @@ void MainWindow::initActions() } - KMenuBar *menuBar1; + if ( KOPrefs::instance()->mShowFullMenu ) { menuBar1 = new KMenuBar( this );//menuBar(); + //setMenuBar( menuBar1 ); + menuBar1->show(); menuBar1->insertItem( i18n("File"), importMenu ); @@ -716,4 +735,6 @@ void MainWindow::initActions() menuBar1->setMaximumSize( menuBar1->sizeHint( )); + connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) ); } - connect ( menuBar1, SIGNAL( lostFocus () ), mView, SLOT ( slotResetFocus() ) ); + connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); + //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index e2de3ba..7d3d492 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -104,2 +104,4 @@ class MainWindow : public QMainWindow private slots: + void slotResetFocus(); + void slotResetFocusLoop(); void showConfigureAgenda(); @@ -109,2 +111,3 @@ class MainWindow : public QMainWindow protected: + int mFocusLoop; void hideEvent ( QHideEvent * ); @@ -115,2 +118,3 @@ class MainWindow : public QMainWindow private: + //void setMenuBar( QMenuBar * ); bool mBRdisabled; @@ -125,2 +129,3 @@ class MainWindow : public QMainWindow bool mBlockAtStartup; + KMenuBar *menuBar1; QPEToolBar *iconToolBar; |