summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/incsearchwidget.cpp8
-rw-r--r--kaddressbook/incsearchwidget.h2
-rw-r--r--kaddressbook/kabcore.cpp3
-rw-r--r--kaddressbook/kaddressbookview.h2
-rw-r--r--kaddressbook/viewmanager.cpp11
-rw-r--r--kaddressbook/viewmanager.h2
-rw-r--r--kaddressbook/views/kaddressbookcardview.cpp20
-rw-r--r--kaddressbook/views/kaddressbookcardview.h2
-rw-r--r--kaddressbook/views/kaddressbookiconview.cpp17
-rw-r--r--kaddressbook/views/kaddressbookiconview.h2
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp18
-rw-r--r--kaddressbook/views/kaddressbooktableview.h2
-rw-r--r--microkde/klineedit.h29
13 files changed, 108 insertions, 10 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index 3533427..78eaf65 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -83,2 +83,8 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
83 83
84
85
86 connect( mSearchText, SIGNAL( scrollUP() ), this, SIGNAL( scrollUP() ));
87 connect( mSearchText, SIGNAL( scrollDOWN() ), this, SIGNAL( scrollDOWN() ));
88
89
84 setFocusProxy( mSearchText ); 90 setFocusProxy( mSearchText );
@@ -98,3 +104,3 @@ void IncSearchWidget::announceDoSearch2()
98 104
99void IncSearchWidget::announceDoSearch() 105void IncSearchWidget::announceDoSearch()
100{ 106{
diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h
index 5c95438..1546a51 100644
--- a/kaddressbook/incsearchwidget.h
+++ b/kaddressbook/incsearchwidget.h
@@ -50,2 +50,4 @@ class IncSearchWidget : public QWidget
50 signals: 50 signals:
51 void scrollUP();
52 void scrollDOWN();
51 /** 53 /**
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index cd261f6..f2d4cd6 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1675,3 +1675,4 @@ void KABCore::initGUI()
1675 SLOT( incrementalSearch( const QString& ) ) ); 1675 SLOT( incrementalSearch( const QString& ) ) );
1676 1676 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) );
1677 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) );
1677 1678
diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h
index 17106e8..c134e96 100644
--- a/kaddressbook/kaddressbookview.h
+++ b/kaddressbook/kaddressbookview.h
@@ -67,2 +67,4 @@ class KAddressBookView : public QWidget
67 virtual void doSearch( const QString& s ,KABC::Field *field ) = 0; 67 virtual void doSearch( const QString& s ,KABC::Field *field ) = 0;
68 virtual void scrollUP() = 0;
69 virtual void scrollDOWN() = 0;
68 70
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index c6baeac..f4fb08b 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -87,3 +87,12 @@ ViewManager::~ViewManager()
87} 87}
88 88void ViewManager::scrollUP()
89{
90 if ( mActiveView )
91 mActiveView->scrollUP();
92}
93void ViewManager::scrollDOWN()
94{
95 if ( mActiveView )
96 mActiveView->scrollDOWN();
97}
89void ViewManager::restoreSettings() 98void ViewManager::restoreSettings()
diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h
index 6def6b6..585f4e9 100644
--- a/kaddressbook/viewmanager.h
+++ b/kaddressbook/viewmanager.h
@@ -68,2 +68,4 @@ class ViewManager : public QWidget
68 public slots: 68 public slots:
69 void scrollUP();
70 void scrollDOWN();
69 71
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp
index 4babf67..a7bf6c9 100644
--- a/kaddressbook/views/kaddressbookcardview.cpp
+++ b/kaddressbook/views/kaddressbookcardview.cpp
@@ -29,2 +29,3 @@
29#include <qregexp.h> 29#include <qregexp.h>
30#include <qapplication.h>
30 31
@@ -171,2 +172,13 @@ KAddressBookCardView::~KAddressBookCardView()
171 172
173void KAddressBookCardView::scrollUP()
174{
175 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 );
176 QApplication::postEvent( mCardView, ev );
177
178}
179void KAddressBookCardView::scrollDOWN()
180{
181 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
182 QApplication::postEvent( mCardView, ev );
183}
172void KAddressBookCardView::readConfig(KConfig *config) 184void KAddressBookCardView::readConfig(KConfig *config)
@@ -292,4 +304,8 @@ void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field )
292 mCardView->viewport()->update(); 304 mCardView->viewport()->update();
293 // by default nothing is selected 305 if ( mCardView->firstItem() ) {
294 emit selected(QString::null); 306 mCardView->setCurrentItem ( mCardView->firstItem() );
307 mCardView->setSelected ( mCardView->firstItem() , true );
308 }
309 else
310 emit selected(QString::null);
295} 311}
diff --git a/kaddressbook/views/kaddressbookcardview.h b/kaddressbook/views/kaddressbookcardview.h
index b8efb01..45a9781 100644
--- a/kaddressbook/views/kaddressbookcardview.h
+++ b/kaddressbook/views/kaddressbookcardview.h
@@ -62,2 +62,4 @@ class KAddressBookCardView : public KAddressBookView
62 virtual void writeConfig(KConfig *); 62 virtual void writeConfig(KConfig *);
63 virtual void scrollUP();
64 virtual void scrollDOWN();
63 65
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp
index fdc0db9..f4c68b8 100644
--- a/kaddressbook/views/kaddressbookiconview.cpp
+++ b/kaddressbook/views/kaddressbookiconview.cpp
@@ -43,2 +43,3 @@
43#include <qregexp.h> 43#include <qregexp.h>
44#include <qapplication.h>
44#include <kglobal.h> 45#include <kglobal.h>
@@ -213,2 +214,12 @@ KAddressBookIconView::~KAddressBookIconView()
213 214
215void KAddressBookIconView::scrollUP()
216{
217 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 );
218 QApplication::postEvent( mIconView, ev );
219}
220void KAddressBookIconView::scrollDOWN()
221{
222 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
223 QApplication::postEvent( mIconView, ev );
224}
214void KAddressBookIconView::readConfig(KConfig *config) 225void KAddressBookIconView::readConfig(KConfig *config)
@@ -282,2 +293,8 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
282 mIconView->arrangeItemsInGrid( true ); 293 mIconView->arrangeItemsInGrid( true );
294 if ( mIconView->firstItem() ) {
295 mIconView->setCurrentItem ( mIconView->firstItem() );
296 mIconView->setSelected ( mIconView->firstItem() , true );
297 }
298 else
299 emit selected(QString::null);
283} 300}
diff --git a/kaddressbook/views/kaddressbookiconview.h b/kaddressbook/views/kaddressbookiconview.h
index 963ee7c..acfcd71 100644
--- a/kaddressbook/views/kaddressbookiconview.h
+++ b/kaddressbook/views/kaddressbookiconview.h
@@ -63,2 +63,4 @@ class KAddressBookIconView : public KAddressBookView
63 virtual void readConfig(KConfig *config); 63 virtual void readConfig(KConfig *config);
64 virtual void scrollUP();
65 virtual void scrollDOWN();
64 66
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index fbfddba..2412170 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -53,3 +53,12 @@ KAddressBookTableView::~KAddressBookTableView()
53} 53}
54 54void KAddressBookTableView::scrollUP()
55{
56 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 );
57 QApplication::postEvent( mListView, ev );
58}
59void KAddressBookTableView::scrollDOWN()
60{
61 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
62 QApplication::postEvent( mListView, ev );
63}
55void KAddressBookTableView::reconstructListView() 64void KAddressBookTableView::reconstructListView()
@@ -161,3 +170,8 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
161 mListView->repaint(); 170 mListView->repaint();
162 emit selected(QString::null); 171 if ( mListView->firstChild() ) {
172 mListView->setCurrentItem ( mListView->firstChild() );
173 mListView->setSelected ( mListView->firstChild(), true );
174 }
175 else
176 emit selected(QString::null);
163 177
diff --git a/kaddressbook/views/kaddressbooktableview.h b/kaddressbook/views/kaddressbooktableview.h
index ecfe7a1..865f8d5 100644
--- a/kaddressbook/views/kaddressbooktableview.h
+++ b/kaddressbook/views/kaddressbooktableview.h
@@ -65,2 +65,4 @@ friend class ContactListView;
65 void doSearch( const QString& s ,KABC::Field *field ); 65 void doSearch( const QString& s ,KABC::Field *field );
66 virtual void scrollUP();
67 virtual void scrollDOWN();
66 68
diff --git a/microkde/klineedit.h b/microkde/klineedit.h
index 65e2f59..70c72d1 100644
--- a/microkde/klineedit.h
+++ b/microkde/klineedit.h
@@ -12,5 +12,9 @@ class KLineEdit : public QLineEdit
12{ 12{
13
14 Q_OBJECT
15
13 public: 16 public:
14 KLineEdit( QWidget *parent=0, const char *name=0 ) : 17 KLineEdit( QWidget *parent=0, const char *name=0 ) :
15 QLineEdit( parent, name ) { 18 QLineEdit( parent, name )
19 {
16#ifndef DESKTOP_VERSION 20#ifndef DESKTOP_VERSION
@@ -18,5 +22,24 @@ class KLineEdit : public QLineEdit
18#endif 22#endif
19} 23 }
20 24 void keyPressEvent ( QKeyEvent * e)
25 {
26 switch ( e->key() ) {
27 case Qt::Key_Down:
28 emit scrollDOWN();
29 e->accept();
30 break;
31 case Qt::Key_Up:
32 emit scrollUP();
33 e->accept();
34 break;
35 default:
36 QLineEdit::keyPressEvent ( e );
37 break;
38 }
39
40 }
21 void setTrapReturnKey( bool ) {} 41 void setTrapReturnKey( bool ) {}
42 signals:
43 void scrollUP();
44 void scrollDOWN();
22}; 45};