summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp27
1 files changed, 24 insertions, 3 deletions
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 ) ) );