summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kaddressbookview.cpp4
-rw-r--r--kaddressbook/kaddressbookview.h6
-rw-r--r--kaddressbook/views/cardview.cpp31
-rw-r--r--kaddressbook/views/cardview.h7
-rw-r--r--kaddressbook/views/contactlistview.cpp29
-rw-r--r--kaddressbook/views/contactlistview.h4
-rw-r--r--kaddressbook/views/kaddressbookcardview.cpp4
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp4
-rw-r--r--korganizer/komonthview.cpp19
-rw-r--r--korganizer/komonthview.h3
-rw-r--r--korganizer/mainwindow.cpp26
-rw-r--r--korganizer/mainwindow.h1
12 files changed, 129 insertions, 9 deletions
diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp
index 09859c2..86898e2 100644
--- a/kaddressbook/kaddressbookview.cpp
+++ b/kaddressbook/kaddressbookview.cpp
@@ -45,3 +45,3 @@ KAddressBookView::KAddressBookView( KABC::AddressBook *ab, QWidget *parent,
{
-
+
initGUI();
@@ -183,2 +183,4 @@ ViewConfigureWidget *ViewFactory::configureWidget( KABC::AddressBook *ab,
+
+
#ifndef KAB_EMBEDDED
diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h
index 6bbb9c2..3a3f71a 100644
--- a/kaddressbook/kaddressbookview.h
+++ b/kaddressbook/kaddressbookview.h
@@ -232,3 +232,4 @@ class KAddressBookView : public QWidget
- protected:
+ protected:
+
/**
@@ -306,3 +307,4 @@ class ViewFactory
return 0;
- }
+ }
+
diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp
index 03df444..84d3116 100644
--- a/kaddressbook/views/cardview.cpp
+++ b/kaddressbook/views/cardview.cpp
@@ -35,2 +35,3 @@
#include <qtooltip.h>
+#include <qapplication.h>
@@ -641,2 +642,4 @@ CardView::CardView(QWidget *parent, const char *name)
{
+ mFlagKeyPressed = false;
+ mFlagBlockKeyPressed = false;
d->mItemList.setAutoDelete(true);
@@ -1353,3 +1356,11 @@ void CardView::keyPressEvent( QKeyEvent *e )
}
-
+ if ( mFlagBlockKeyPressed )
+ return;
+ qApp->processEvents();
+ if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
+ e->accept();
+ return;
+ }
+ if (! e->isAutoRepeat() )
+ mFlagKeyPressed = true;
uint pos = d->mItemList.findRef( d->mCurrentItem );
@@ -1717,2 +1728,20 @@ void CardView::setMaxFieldLines( int howmany )
}
+
+void CardView::keyReleaseEvent ( QKeyEvent * e )
+{
+ if ( mFlagBlockKeyPressed )
+ return;
+ if ( !e->isAutoRepeat() ) {
+ mFlagBlockKeyPressed = true;
+ qApp->processEvents();
+ mFlagBlockKeyPressed = false;
+ mFlagKeyPressed = false;
+ }
+ QScrollView::keyReleaseEvent ( e );
+}
+
+
+
+
+
//END Cardview
diff --git a/kaddressbook/views/cardview.h b/kaddressbook/views/cardview.h
index 37dddb6..2ea3771 100644
--- a/kaddressbook/views/cardview.h
+++ b/kaddressbook/views/cardview.h
@@ -407,3 +407,7 @@ class CardView : public QScrollView
- protected:
+ protected:
+ bool mFlagKeyPressed;
+ bool mFlagBlockKeyPressed;
+ virtual void keyPressEvent ( QKeyEvent * );
+ virtual void keyReleaseEvent ( QKeyEvent * );
/** Determines which cards intersect that region and tells them to paint
@@ -446,3 +450,2 @@ class CardView : public QScrollView
- virtual void keyPressEvent( QKeyEvent * );
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp
index e75810e..09d9c03 100644
--- a/kaddressbook/views/contactlistview.cpp
+++ b/kaddressbook/views/contactlistview.cpp
@@ -31,2 +31,3 @@
#include <qevent.h>
+#include <qapplication.h>
@@ -250,2 +251,4 @@ ContactListView::ContactListView(KAddressBookTableView *view,
{
+ mFlagBlockKeyPressed = false;
+ mFlagKeyPressed = false;
mABackground = true;
@@ -397,2 +400,28 @@ void ContactListView::setBackgroundPixmap(const QString &filename)
}
+
+void ContactListView::keyPressEvent ( QKeyEvent * e )
+{
+ if ( mFlagBlockKeyPressed )
+ return;
+ qApp->processEvents();
+ if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
+ e->accept();
+ return;
+ }
+ if (! e->isAutoRepeat() )
+ mFlagKeyPressed = true;
+ KListView::keyPressEvent ( e );
+}
+void ContactListView::keyReleaseEvent ( QKeyEvent * e )
+{
+ if ( mFlagBlockKeyPressed )
+ return;
+ if ( !e->isAutoRepeat() ) {
+ mFlagBlockKeyPressed = true;
+ qApp->processEvents();
+ mFlagBlockKeyPressed = false;
+ mFlagKeyPressed = false;
+ }
+ KListView::keyReleaseEvent ( e );
+}
#ifndef KAB_EMBEDDED
diff --git a/kaddressbook/views/contactlistview.h b/kaddressbook/views/contactlistview.h
index 9d1a672..46477e1 100644
--- a/kaddressbook/views/contactlistview.h
+++ b/kaddressbook/views/contactlistview.h
@@ -94,2 +94,6 @@ public:
protected:
+ bool mFlagKeyPressed;
+ bool mFlagBlockKeyPressed;
+ virtual void keyPressEvent ( QKeyEvent * );
+ virtual void keyReleaseEvent ( QKeyEvent * );
/** Paints the background pixmap in the empty area. This method is needed
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp
index cce68b9..9c35fd6 100644
--- a/kaddressbook/views/kaddressbookcardview.cpp
+++ b/kaddressbook/views/kaddressbookcardview.cpp
@@ -210,2 +210,4 @@ void KAddressBookCardView::scrollUP()
QApplication::postEvent( mCardView, ev );
+ ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Up, 0,0 );
+ QApplication::postEvent( mCardView, ev );
@@ -216,2 +218,4 @@ void KAddressBookCardView::scrollDOWN()
QApplication::postEvent( mCardView, ev );
+ ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 );
+ QApplication::postEvent( mCardView, ev );
}
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index f4b008c..e322473 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -63,2 +63,4 @@ void KAddressBookTableView::scrollUP()
QApplication::postEvent( mListView, ev );
+ ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Up, 0,0 );
+ QApplication::postEvent( mListView, ev );
}
@@ -68,2 +70,4 @@ void KAddressBookTableView::scrollDOWN()
QApplication::postEvent( mListView, ev );
+ ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 );
+ QApplication::postEvent( mListView, ev );
}
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index ca35a86..b9ce4f4 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1002,2 +1002,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
{
+ mFlagKeyPressed = false;
mShortDayLabelsM = false;
@@ -1839,5 +1840,21 @@ void KOMonthView::clearSelection()
}
+
+void KOMonthView::keyReleaseEvent ( QKeyEvent * e)
+{
+ if ( !e->isAutoRepeat() ) {
+ mFlagKeyPressed = false;
+ }
+}
+
void KOMonthView::keyPressEvent ( QKeyEvent * e )
{
- //qDebug("KOMonthView::keyPressEvent ");
+
+ qApp->processEvents();
+ if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
+ //e->ignore();
+ e->accept();
+ return;
+ }
+ if (! e->isAutoRepeat() )
+ mFlagKeyPressed = true;
switch(e->key()) {
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index c1ca3d4..88050fe 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -313,5 +313,6 @@ class KOMonthView: public KOEventView
MonthViewCell *mSelectedCell;
-
+ bool mFlagKeyPressed;
KOEventPopupMenu *mContextMenu;
void keyPressEvent ( QKeyEvent * ) ;
+ void keyReleaseEvent ( QKeyEvent * ) ;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index ae03a09..09a0880 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -168,3 +168,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
- if ( KOPrefs::instance()->mShowIconFilter ) {
+#ifdef DESKTOP_VERSION
+ if ( KOPrefs::instance()->mShowIconFilter )
+#else
+ if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
+#endif
+
+{
if ( p->mToolBarHorF ) {
@@ -195,2 +201,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
+ if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
+ filterToolBar->hide();
} else {
@@ -204,2 +212,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
} else {
+#ifndef DESKTOP_VERSION
+ setToolBarsMovable( false );
+#endif
if ( p->mToolBarHorV ) {
@@ -2412 +2423,14 @@ void MainWindow::hideEvent ( QHideEvent * )
}
+
+void MainWindow::resizeEvent( QResizeEvent* e)
+{
+#ifndef DESKTOP_VERSION
+ if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar ) {
+ if (QApplication::desktop()->width() > QApplication::desktop()->height() )
+ filterToolBar->hide();
+ else
+ filterToolBar->show();
+ }
+#endif
+ QMainWindow::resizeEvent( e);
+}
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 7c16aeb..4d1753f 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -135,2 +135,3 @@ class MainWindow : public QMainWindow
void setDefaultPreferences();
+ void resizeEvent( QResizeEvent* e);
void keyPressEvent ( QKeyEvent * ) ;