summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp7
-rw-r--r--korganizer/calendarview.h3
-rw-r--r--korganizer/koagenda.cpp5
-rw-r--r--korganizer/mainwindow.cpp12
-rw-r--r--korganizer/mainwindow.h5
-rw-r--r--microkde/kdeui/kbuttonbox.cpp2
-rw-r--r--microkde/kdeui/kpopupmenu.cpp19
-rw-r--r--microkde/kdeui/kpopupmenu.h22
-rw-r--r--microkde/microkde.pro2
-rw-r--r--microkde/microkdeE.pro2
10 files changed, 64 insertions, 15 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 5a2482e..17f1659 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -654,8 +654,15 @@ CalendarView::~CalendarView()
delete mDateFrame ;
delete mEventViewerDialog;
//kdDebug() << "~CalendarView() done" << endl;
}
+
+void CalendarView::slotResetFocus()
+{
+ qDebug(" CalendarView::slotResetFocus() %x", qApp->focusWidget());
+
+}
+
void CalendarView::nextConflict( bool all, bool allday )
{
QPtrList<Event> testlist = mCalendar->events();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 799c297..456c2d7 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -199,9 +199,10 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void updateSearchDialog();
void filtersUpdated();
- public slots:
+ public slots:
+ void slotResetFocus();
void nextConflict( bool all, bool allday );
void conflictAll();
void conflictAllday();
void conflictNotAll();
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 779f12e..0dd5ef5 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1634,9 +1634,12 @@ void KOAgenda::setStartHour(int startHour)
setContentsPos(0,startCell * gridSpacingY());
}
QTime KOAgenda::getEndTime()
{
- return QTime ( (contentsY ()+viewport()->height())*24/contentsHeight ()+1,0,0);
+ int tim = (contentsY ()+viewport()->height())*24/contentsHeight ();
+ if ( tim > 23 )
+ return QTime ( 23,59,59);
+ return QTime ( tim,0,0);
}
void KOAgenda::hideUnused()
{
// experimental only
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 4bedb61..21d5a35 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -20,17 +20,15 @@
#include <qtextbrowser.h>
#include <qtextstream.h>
#ifndef DESKTOP_VERSION
#include <qpe/global.h>
-#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <qtopia/alarmserver.h>
#include <qtopia/qcopenvelope_qws.h>
#include <unistd.h> // for sleep
#else
-#include <qmenubar.h>
#include <qtoolbar.h>
#include <qapplication.h>
//#include <resource.h>
@@ -224,9 +222,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
else
tbd = Left;
}
filterToolBar = new QPEToolBar ( this );
- filterMenubar = new QMenuBar( 0 );
+ filterMenubar = new KMenuBar( 0 );
QFontMetrics fm ( filterMenubar->font() );
filterPopupMenu = new QPopupMenu( this );
filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
@@ -681,11 +679,11 @@ void MainWindow::initActions()
} else {
pathString += "iconsmini/";
pixWid = 18; pixHei = 16;
}
+ KMenuBar *menuBar1;
if ( KOPrefs::instance()->mShowFullMenu ) {
- QMenuBar *menuBar1;
- menuBar1 = menuBar();
+ menuBar1 = new KMenuBar( this );//menuBar();
menuBar1->insertItem( i18n("File"), importMenu );
menuBar1->insertItem( i18n("View"), viewMenu );
menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu );
menuBar1->insertItem( i18n("Action"), actionMenu );
@@ -699,10 +697,9 @@ void MainWindow::initActions()
//menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
menuBar1->insertItem( i18n("Help"), helpMenu );
} else {
- QPEMenuBar *menuBar1;
- menuBar1 = new QPEMenuBar( iconToolBar );
+ menuBar1 = new KMenuBar( iconToolBar );
QPopupMenu *menuBar = new QPopupMenu( this );
icon = loadPixmap( pathString + "z_menu" );
menuBar1->insertItem( icon.pixmap(), menuBar);
//menuBar1->insertItem( i18n("ME"), menuBar);
@@ -717,8 +714,9 @@ void MainWindow::initActions()
menuBar->insertItem( i18n("Help"), helpMenu );
//menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
menuBar1->setMaximumSize( menuBar1->sizeHint( ));
}
+ connect ( menuBar1, SIGNAL( lostFocus () ), mView, 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 d648f14..e2de3ba 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -10,8 +10,9 @@
#include <qregexp.h>
#include <libkcal/incidence.h>
#include <ksyncmanager.h>
+#include <kpopupmenu.h>
#ifndef DESKTOP_VERSION
#include <qcopchannel_qws.h>
#endif
class QAction;
@@ -19,12 +20,10 @@ class CalendarView;
class KSyncProfile;
#ifdef DESKTOP_VERSION
#define QPEToolBar QToolBar
-#define QPEMenuBar QMenuBar
#endif
class QPEToolBar;
-class QPEMenuBar;
namespace KCal {
class CalendarLocal;
@@ -127,9 +126,9 @@ class MainWindow : public QMainWindow
QPEToolBar *iconToolBar;
QPEToolBar *viewToolBar;
QPEToolBar *navigatorToolBar;
QPEToolBar *filterToolBar;
- QMenuBar *filterMenubar;
+ KMenuBar *filterMenubar;
QPopupMenu * filterPopupMenu;
QPopupMenu * mCurrentItemMenu;
void initActions();
void setDefaultPreferences();
diff --git a/microkde/kdeui/kbuttonbox.cpp b/microkde/kdeui/kbuttonbox.cpp
index 16206e8..83d622a 100644
--- a/microkde/kdeui/kbuttonbox.cpp
+++ b/microkde/kdeui/kbuttonbox.cpp
@@ -45,9 +45,9 @@
*
*/
//US #include "kbuttonbox.moc"
-
+
#include <kbuttonbox.h>
#include <qpushbutton.h>
#include <qptrlist.h>
#include <assert.h>
diff --git a/microkde/kdeui/kpopupmenu.cpp b/microkde/kdeui/kpopupmenu.cpp
new file mode 100644
index 0000000..96d2a87
--- a/dev/null
+++ b/microkde/kdeui/kpopupmenu.cpp
@@ -0,0 +1,19 @@
+
+#include <kpopupmenu.h>
+#include <qtimer.h>
+
+
+KPopupMenu::KPopupMenu ( QWidget * parent, const char * name )
+ : QPopupMenu ( parent, name ) {;}
+
+
+
+KMenuBar::KMenuBar ( QWidget * parent, const char * name )
+ : QPEMenuBar ( parent, name ) {}
+
+void KMenuBar::focusOutEvent ( QFocusEvent * e)
+{
+ QPEMenuBar::focusOutEvent( e );
+ QTimer::singleShot( 100, this, SIGNAL ( lostFocus() ) );
+
+}
diff --git a/microkde/kdeui/kpopupmenu.h b/microkde/kdeui/kpopupmenu.h
index 1352429..f16ce77 100644
--- a/microkde/kdeui/kpopupmenu.h
+++ b/microkde/kdeui/kpopupmenu.h
@@ -1,14 +1,32 @@
#ifndef KPOPUPMENU_H
#define KPOPUPMENU_H
#include <qpopupmenu.h>
+#ifdef DESKTOP_VERSION
+#include <qmenubar.h>
+#define QPEMenuBar QMenubar
+#else
+#include <qpe/qpemenubar.h>
+#endif
class KPopupMenu : public QPopupMenu
{
+Q_OBJECT
public:
- KPopupMenu ( QWidget * parent=0, const char * name=0 )
- : QPopupMenu ( parent, name ) {}
+ KPopupMenu ( QWidget * parent=0, const char * name=0 );
+
+};
+
+class KMenuBar : public QPEMenuBar
+{
+Q_OBJECT
+ public:
+ KMenuBar ( QWidget * parent=0, const char * name=0 );
+ signals:
+ void lostFocus();
+ protected:
+ void focusOutEvent ( QFocusEvent * e);
};
#endif
diff --git a/microkde/microkde.pro b/microkde/microkde.pro
index 44e5f9d..7120bdd 100644
--- a/microkde/microkde.pro
+++ b/microkde/microkde.pro
@@ -102,8 +102,9 @@ KDGanttMinimizeSplitter.h \
kdeui/ktoolbar.h \
kdeui/ktoolbarbutton.h \
kdeui/ktoolbarhandler.h \
kdeui/kaction.h \
+ kdeui/kpopupmenu.h \
kdeui/kactionclasses.h \
kdeui/kactioncollection.h \
kdecore/kprefs.h \
kdecore/klibloader.h \
@@ -164,8 +165,9 @@ KDGanttMinimizeSplitter.cpp \
kresources/resource.cpp \
kresources/selectdialog.cpp \
kutils/kcmultidialog.cpp \
kdeui/kaction.cpp \
+ kdeui/kpopupmenu.cpp \
kdeui/kactionclasses.cpp \
kdeui/kactioncollection.cpp \
kdeui/kmainwindow.cpp \
kdeui/ktoolbar.cpp \
diff --git a/microkde/microkdeE.pro b/microkde/microkdeE.pro
index 335fcd0..8fe2bd5 100644
--- a/microkde/microkdeE.pro
+++ b/microkde/microkdeE.pro
@@ -55,8 +55,9 @@ KDGanttMinimizeSplitter.h \
ofileselector_p.h \
ofontselector.h \
kdeui/kguiitem.h \
kdeui/kaction.h \
+ kdeui/kpopupmenu.h \
kdeui/kactionclasses.h \
kdeui/kactioncollection.h \
kdeui/kcmodule.h \
kdeui/kstdaction.h \
@@ -138,8 +139,9 @@ KDGanttMinimizeSplitter.cpp fncolordialog.cpp \
kdecore/kshell.cpp \
kdecore/kstandarddirs.cpp \
kdecore/kstringhandler.cpp \
kdeui/kaction.cpp \
+ kdeui/kpopupmenu.cpp \
kdeui/kactionclasses.cpp \
kdeui/kactioncollection.cpp \
kdeui/kbuttonbox.cpp \
kdeui/kcmodule.cpp \