summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kaddressbookview.cpp2
-rw-r--r--kaddressbook/kaddressbookview.h2
-rw-r--r--kaddressbook/views/cardview.cpp31
-rw-r--r--kaddressbook/views/cardview.h5
-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
8 files changed, 79 insertions, 2 deletions
diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp
index 09859c2..86898e2 100644
--- a/kaddressbook/kaddressbookview.cpp
+++ b/kaddressbook/kaddressbookview.cpp
@@ -182,4 +182,6 @@ ViewConfigureWidget *ViewFactory::configureWidget( KABC::AddressBook *ab,
182} 182}
183 183
184
185
184#ifndef KAB_EMBEDDED 186#ifndef KAB_EMBEDDED
185#include "kaddressbookview.moc" 187#include "kaddressbookview.moc"
diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h
index 6bbb9c2..3a3f71a 100644
--- a/kaddressbook/kaddressbookview.h
+++ b/kaddressbook/kaddressbookview.h
@@ -232,4 +232,5 @@ class KAddressBookView : public QWidget
232 232
233 protected: 233 protected:
234
234 /** 235 /**
235 Returns a list of the addressees that should be displayed. This method 236 Returns a list of the addressees that should be displayed. This method
@@ -307,4 +308,5 @@ class ViewFactory
307 } 308 }
308 309
310
309}; 311};
310 312
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
@@ -34,4 +34,5 @@
34#include <qcursor.h> 34#include <qcursor.h>
35#include <qtooltip.h> 35#include <qtooltip.h>
36#include <qapplication.h>
36 37
37#include "kabprefs.h" 38#include "kabprefs.h"
@@ -640,4 +641,6 @@ CardView::CardView(QWidget *parent, const char *name)
640 d(new CardViewPrivate()) 641 d(new CardViewPrivate())
641{ 642{
643 mFlagKeyPressed = false;
644 mFlagBlockKeyPressed = false;
642 d->mItemList.setAutoDelete(true); 645 d->mItemList.setAutoDelete(true);
643 d->mSeparatorList.setAutoDelete(true); 646 d->mSeparatorList.setAutoDelete(true);
@@ -1352,5 +1355,13 @@ void CardView::keyPressEvent( QKeyEvent *e )
1352 return; 1355 return;
1353 } 1356 }
1354 1357 if ( mFlagBlockKeyPressed )
1358 return;
1359 qApp->processEvents();
1360 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1361 e->accept();
1362 return;
1363 }
1364 if (! e->isAutoRepeat() )
1365 mFlagKeyPressed = true;
1355 uint pos = d->mItemList.findRef( d->mCurrentItem ); 1366 uint pos = d->mItemList.findRef( d->mCurrentItem );
1356 CardViewItem *aItem = 0L; // item that gets the focus 1367 CardViewItem *aItem = 0L; // item that gets the focus
@@ -1716,4 +1727,22 @@ void CardView::setMaxFieldLines( int howmany )
1716 // FIXME update, forcing the items to recalc height!! 1727 // FIXME update, forcing the items to recalc height!!
1717} 1728}
1729
1730void CardView::keyReleaseEvent ( QKeyEvent * e )
1731{
1732 if ( mFlagBlockKeyPressed )
1733 return;
1734 if ( !e->isAutoRepeat() ) {
1735 mFlagBlockKeyPressed = true;
1736 qApp->processEvents();
1737 mFlagBlockKeyPressed = false;
1738 mFlagKeyPressed = false;
1739 }
1740 QScrollView::keyReleaseEvent ( e );
1741}
1742
1743
1744
1745
1746
1718//END Cardview 1747//END Cardview
1719 1748
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,4 +407,8 @@ class CardView : public QScrollView
407 407
408 protected: 408 protected:
409 bool mFlagKeyPressed;
410 bool mFlagBlockKeyPressed;
411 virtual void keyPressEvent ( QKeyEvent * );
412 virtual void keyReleaseEvent ( QKeyEvent * );
409 /** Determines which cards intersect that region and tells them to paint 413 /** Determines which cards intersect that region and tells them to paint
410 * themselves. 414 * themselves.
@@ -445,5 +449,4 @@ class CardView : public QScrollView
445 virtual void focusOutEvent( QFocusEvent * ); 449 virtual void focusOutEvent( QFocusEvent * );
446 450
447 virtual void keyPressEvent( QKeyEvent * );
448 451
449 /** Overload this method to be told when a drag should be started. 452 /** Overload this method to be told when a drag should be started.
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
@@ -30,4 +30,5 @@
30#include <qbrush.h> 30#include <qbrush.h>
31#include <qevent.h> 31#include <qevent.h>
32#include <qapplication.h>
32 33
33#include <klocale.h> 34#include <klocale.h>
@@ -249,4 +250,6 @@ ContactListView::ContactListView(KAddressBookTableView *view,
249 oldColumn( 0 ) 250 oldColumn( 0 )
250{ 251{
252 mFlagBlockKeyPressed = false;
253 mFlagKeyPressed = false;
251 mABackground = true; 254 mABackground = true;
252 mSingleLine = false; 255 mSingleLine = false;
@@ -396,4 +399,30 @@ void ContactListView::setBackgroundPixmap(const QString &filename)
396 399
397} 400}
401
402void ContactListView::keyPressEvent ( QKeyEvent * e )
403{
404 if ( mFlagBlockKeyPressed )
405 return;
406 qApp->processEvents();
407 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
408 e->accept();
409 return;
410 }
411 if (! e->isAutoRepeat() )
412 mFlagKeyPressed = true;
413 KListView::keyPressEvent ( e );
414}
415void ContactListView::keyReleaseEvent ( QKeyEvent * e )
416{
417 if ( mFlagBlockKeyPressed )
418 return;
419 if ( !e->isAutoRepeat() ) {
420 mFlagBlockKeyPressed = true;
421 qApp->processEvents();
422 mFlagBlockKeyPressed = false;
423 mFlagKeyPressed = false;
424 }
425 KListView::keyReleaseEvent ( e );
426}
398#ifndef KAB_EMBEDDED 427#ifndef KAB_EMBEDDED
399#include "contactlistview.moc" 428#include "contactlistview.moc"
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
@@ -93,4 +93,8 @@ public:
93 93
94protected: 94protected:
95 bool mFlagKeyPressed;
96 bool mFlagBlockKeyPressed;
97 virtual void keyPressEvent ( QKeyEvent * );
98 virtual void keyReleaseEvent ( QKeyEvent * );
95 /** Paints the background pixmap in the empty area. This method is needed 99 /** Paints the background pixmap in the empty area. This method is needed
96 * since Qt::FixedPixmap will not scroll with the list view. 100 * since Qt::FixedPixmap will not scroll with the list view.
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
@@ -209,4 +209,6 @@ void KAddressBookCardView::scrollUP()
209 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); 209 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 );
210 QApplication::postEvent( mCardView, ev ); 210 QApplication::postEvent( mCardView, ev );
211 ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Up, 0,0 );
212 QApplication::postEvent( mCardView, ev );
211 213
212} 214}
@@ -215,4 +217,6 @@ void KAddressBookCardView::scrollDOWN()
215 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); 217 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
216 QApplication::postEvent( mCardView, ev ); 218 QApplication::postEvent( mCardView, ev );
219 ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 );
220 QApplication::postEvent( mCardView, ev );
217} 221}
218void KAddressBookCardView::readConfig(KConfig *config) 222void KAddressBookCardView::readConfig(KConfig *config)
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
@@ -62,4 +62,6 @@ void KAddressBookTableView::scrollUP()
62 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); 62 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 );
63 QApplication::postEvent( mListView, ev ); 63 QApplication::postEvent( mListView, ev );
64 ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Up, 0,0 );
65 QApplication::postEvent( mListView, ev );
64} 66}
65void KAddressBookTableView::scrollDOWN() 67void KAddressBookTableView::scrollDOWN()
@@ -67,4 +69,6 @@ void KAddressBookTableView::scrollDOWN()
67 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); 69 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
68 QApplication::postEvent( mListView, ev ); 70 QApplication::postEvent( mListView, ev );
71 ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 );
72 QApplication::postEvent( mListView, ev );
69} 73}
70void KAddressBookTableView::reconstructListView() 74void KAddressBookTableView::reconstructListView()