-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-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 |
5 files changed, 31 insertions, 11 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 3da24c5..8127ef4 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -3,5 +3,5 @@ Info about the changes in new versions of KDE-Pim/Pi ********** VERSION 2.1.16 ************ - +Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus. ********** VERSION 2.1.15 ************ diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 17f1659..a9e402e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -368,5 +368,5 @@ void CalendarView::init() { mNextAlarmDateTime = QDateTime::currentDateTime(); - //setFocusPolicy ( NoFocus ); + setFocusPolicy (NoFocus ); mViewerCallerIsSearchDialog = false; mBlockShowDates = false; @@ -657,9 +657,4 @@ CalendarView::~CalendarView() } -void CalendarView::slotResetFocus() -{ - qDebug(" CalendarView::slotResetFocus() %x", qApp->focusWidget()); - -} void CalendarView::nextConflict( bool all, bool allday ) diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 456c2d7..1debef7 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -202,5 +202,4 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser public slots: - void slotResetFocus(); void nextConflict( bool all, bool allday ); void conflictAll(); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 21d5a35..279955f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -424,5 +424,22 @@ 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) { @@ -681,7 +698,9 @@ void MainWindow::initActions() pixWid = 18; pixHei = 16; } - KMenuBar *menuBar1; + if ( KOPrefs::instance()->mShowFullMenu ) { menuBar1 = new KMenuBar( this );//menuBar(); + //setMenuBar( menuBar1 ); + menuBar1->show(); menuBar1->insertItem( i18n("File"), importMenu ); menuBar1->insertItem( i18n("View"), viewMenu ); @@ -715,6 +734,8 @@ void MainWindow::initActions() //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 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 ) ) ); connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index e2de3ba..7d3d492 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h @@ -103,4 +103,6 @@ class MainWindow : public QMainWindow void selectWeek ( int ); private slots: + void slotResetFocus(); + void slotResetFocusLoop(); void showConfigureAgenda(); void getFile( bool ); @@ -108,4 +110,5 @@ class MainWindow : public QMainWindow protected: + int mFocusLoop; void hideEvent ( QHideEvent * ); QString sentSyncFile(); @@ -114,4 +117,5 @@ class MainWindow : public QMainWindow private: + //void setMenuBar( QMenuBar * ); bool mBRdisabled; #ifndef DESKTOP_VERSION @@ -124,4 +128,5 @@ class MainWindow : public QMainWindow bool mFlagKeyPressed; bool mBlockAtStartup; + KMenuBar *menuBar1; QPEToolBar *iconToolBar; QPEToolBar *viewToolBar; |