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
@@ -78,12 +78,18 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
78 78
79 connect( mSearchText, SIGNAL( returnPressed() ), 79 connect( mSearchText, SIGNAL( returnPressed() ),
80 SLOT( announceDoSearch() ) ); 80 SLOT( announceDoSearch() ) );
81 connect( mFieldCombo, SIGNAL( activated( const QString& ) ), 81 connect( mFieldCombo, SIGNAL( activated( const QString& ) ),
82 SLOT( announceFieldChanged() ) ); 82 SLOT( announceFieldChanged() ) );
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 );
85} 91}
86 92
87IncSearchWidget::~IncSearchWidget() 93IncSearchWidget::~IncSearchWidget()
88{ 94{
89 95
@@ -93,13 +99,13 @@ void IncSearchWidget::announceDoSearch2()
93 if ( KABPrefs::instance()->mSearchWithReturn ) 99 if ( KABPrefs::instance()->mSearchWithReturn )
94 return; 100 return;
95 emit doSearch( mSearchText->text() ); 101 emit doSearch( mSearchText->text() );
96 //qDebug("emit dosreach "); 102 //qDebug("emit dosreach ");
97} 103}
98 104
99void IncSearchWidget::announceDoSearch() 105void IncSearchWidget::announceDoSearch()
100{ 106{
101 107
102 emit doSearch( mSearchText->text() ); 108 emit doSearch( mSearchText->text() );
103 // qDebug("emit dosreach "); 109 // qDebug("emit dosreach ");
104} 110}
105 111
diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h
index 5c95438..1546a51 100644
--- a/kaddressbook/incsearchwidget.h
+++ b/kaddressbook/incsearchwidget.h
@@ -45,12 +45,14 @@ class IncSearchWidget : public QWidget
45 KABC::Field *currentField() const; 45 KABC::Field *currentField() const;
46 46
47 void setCurrentItem( int pos ); 47 void setCurrentItem( int pos );
48 int currentItem() const; 48 int currentItem() const;
49 49
50 signals: 50 signals:
51 void scrollUP();
52 void scrollDOWN();
51 /** 53 /**
52 This signal is emmited whenever the text in the input 54 This signal is emmited whenever the text in the input
53 widget is changed. You can get the sorting field by 55 widget is changed. You can get the sorting field by
54 @ref currentField. 56 @ref currentField.
55 */ 57 */
56 void doSearch( const QString& text ); 58 void doSearch( const QString& text );
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index cd261f6..f2d4cd6 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1670,13 +1670,14 @@ void KABCore::initGUI()
1670 // mActionQuit->plug ( mMainWindow->toolBar()); 1670 // mActionQuit->plug ( mMainWindow->toolBar());
1671 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); 1671 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() );
1672 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); 1672 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget);
1673 // mIncSearchWidget->hide(); 1673 // mIncSearchWidget->hide();
1674 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1674 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
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
1678 mJumpButtonBar = new JumpButtonBar( this, this ); 1679 mJumpButtonBar = new JumpButtonBar( this, this );
1679 1680
1680 topLayout->addWidget( mJumpButtonBar ); 1681 topLayout->addWidget( mJumpButtonBar );
1681//US topLayout->setStretchFactor( mJumpButtonBar, 10 ); 1682//US topLayout->setStretchFactor( mJumpButtonBar, 10 );
1682 1683
diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h
index 17106e8..c134e96 100644
--- a/kaddressbook/kaddressbookview.h
+++ b/kaddressbook/kaddressbookview.h
@@ -62,12 +62,14 @@ class KAddressBookView : public QWidget
62 /** 62 /**
63 Must be overloaded in subclasses. Should return a list of 63 Must be overloaded in subclasses. Should return a list of
64 all the uids of selected contacts. 64 all the uids of selected contacts.
65 */ 65 */
66 virtual QStringList selectedUids() = 0; 66 virtual QStringList selectedUids() = 0;
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
69 /** 71 /**
70 Called whenever this view should read the config. This can be used 72 Called whenever this view should read the config. This can be used
71 as a sign that the config has changed, therefore the view should 73 as a sign that the config has changed, therefore the view should
72 assume the worst and rebuild itself if necessary. For example, 74 assume the worst and rebuild itself if necessary. For example,
73 in a table view this method may be called when the user adds or 75 in a table view this method may be called when the user adds or
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index c6baeac..f4fb08b 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -82,13 +82,22 @@ ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name )
82 82
83ViewManager::~ViewManager() 83ViewManager::~ViewManager()
84{ 84{
85 unloadViews(); 85 unloadViews();
86 mViewFactoryDict.clear(); 86 mViewFactoryDict.clear();
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()
90{ 99{
91 mViewNameList = KABPrefs::instance()->mViewNames; 100 mViewNameList = KABPrefs::instance()->mViewNames;
92 QString activeViewName = KABPrefs::instance()->mCurrentView; 101 QString activeViewName = KABPrefs::instance()->mCurrentView;
93 102
94 mActionSelectView->setItems( mViewNameList ); 103 mActionSelectView->setItems( mViewNameList );
diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h
index 6def6b6..585f4e9 100644
--- a/kaddressbook/viewmanager.h
+++ b/kaddressbook/viewmanager.h
@@ -63,12 +63,14 @@ class ViewManager : public QWidget
63 QStringList selectedUids() const; 63 QStringList selectedUids() const;
64 QStringList selectedEmails() const; 64 QStringList selectedEmails() const;
65 KABC::Addressee::List selectedAddressees() const; 65 KABC::Addressee::List selectedAddressees() const;
66 void setListSelected(QStringList); 66 void setListSelected(QStringList);
67 67
68 public slots: 68 public slots:
69 void scrollUP();
70 void scrollDOWN();
69 71
70//US void setSelected( const QString &uid = QString::null, bool selected = true ); 72//US void setSelected( const QString &uid = QString::null, bool selected = true );
71 void setSelected( const QString &uid, bool); 73 void setSelected( const QString &uid, bool);
72//US added another method with no parameter, since my moc compiler does not support default parameters. 74//US added another method with no parameter, since my moc compiler does not support default parameters.
73 void setSelected(); 75 void setSelected();
74 76
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
@@ -24,12 +24,13 @@
24#include <qdragobject.h> 24#include <qdragobject.h>
25#include <qevent.h> 25#include <qevent.h>
26#include <qiconview.h> 26#include <qiconview.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qregexp.h> 29#include <qregexp.h>
30#include <qapplication.h>
30 31
31#include <kabc/addressbook.h> 32#include <kabc/addressbook.h>
32#include <kabc/addressee.h> 33#include <kabc/addressee.h>
33#include <kconfig.h> 34#include <kconfig.h>
34#include <kdebug.h> 35#include <kdebug.h>
35#include <klocale.h> 36#include <klocale.h>
@@ -166,12 +167,23 @@ KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab,
166} 167}
167 168
168KAddressBookCardView::~KAddressBookCardView() 169KAddressBookCardView::~KAddressBookCardView()
169{ 170{
170} 171}
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)
173{ 185{
174 KAddressBookView::readConfig(config); 186 KAddressBookView::readConfig(config);
175 187
176 // costum colors? 188 // costum colors?
177 if ( config->readBoolEntry( "EnableCustomColors", false ) ) 189 if ( config->readBoolEntry( "EnableCustomColors", false ) )
@@ -287,14 +299,18 @@ void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field )
287 } 299 }
288 } 300 }
289 } 301 }
290 } 302 }
291 mCardView->viewport()->setUpdatesEnabled( true ); 303 mCardView->viewport()->setUpdatesEnabled( true );
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}
296QStringList KAddressBookCardView::selectedUids() 312QStringList KAddressBookCardView::selectedUids()
297{ 313{
298 QStringList uidList; 314 QStringList uidList;
299 CardViewItem *item; 315 CardViewItem *item;
300 AddresseeCardViewItem *aItem; 316 AddresseeCardViewItem *aItem;
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
@@ -57,12 +57,14 @@ class KAddressBookCardView : public KAddressBookView
57 void doSearch( const QString& s,KABC::Field *field ); 57 void doSearch( const QString& s,KABC::Field *field );
58 virtual QStringList selectedUids(); 58 virtual QStringList selectedUids();
59 virtual QString type() const { return "Card"; } 59 virtual QString type() const { return "Card"; }
60 60
61 virtual void readConfig(KConfig *config); 61 virtual void readConfig(KConfig *config);
62 virtual void writeConfig(KConfig *); 62 virtual void writeConfig(KConfig *);
63 virtual void scrollUP();
64 virtual void scrollDOWN();
63 65
64 public slots: 66 public slots:
65 void refresh(QString uid = QString::null); 67 void refresh(QString uid = QString::null);
66 void setSelected(QString uid/*US = QString::null*/, bool selected/*US = true*/); 68 void setSelected(QString uid/*US = QString::null*/, bool selected/*US = true*/);
67//US added an additional method without parameter 69//US added an additional method without parameter
68 void setSelected(); 70 void setSelected();
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
@@ -38,12 +38,13 @@
38#include <kabc/addressbook.h> 38#include <kabc/addressbook.h>
39#include "kabprefs.h" 39#include "kabprefs.h"
40#include "viewmanager.h" 40#include "viewmanager.h"
41#include "kaddressbookiconview.h" 41#include "kaddressbookiconview.h"
42#include <qlayout.h> 42#include <qlayout.h>
43#include <qregexp.h> 43#include <qregexp.h>
44#include <qapplication.h>
44#include <kglobal.h> 45#include <kglobal.h>
45/*US transfered to the headerfile 46/*US transfered to the headerfile
46class IconViewFactory : public ViewFactory 47class IconViewFactory : public ViewFactory
47{ 48{
48 public: 49 public:
49 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name ) 50 KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name )
@@ -208,12 +209,22 @@ KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab,
208} 209}
209 210
210KAddressBookIconView::~KAddressBookIconView() 211KAddressBookIconView::~KAddressBookIconView()
211{ 212{
212} 213}
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)
215{ 226{
216 KAddressBookView::readConfig(config); 227 KAddressBookView::readConfig(config);
217 228
218//US method executed is part of KIconView 229//US method executed is part of KIconView
219//US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), 230//US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)),
@@ -277,12 +288,18 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
277 continue; 288 continue;
278 } 289 }
279 } 290 }
280 } 291 }
281 } 292 }
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}
284QStringList KAddressBookIconView::selectedUids() 301QStringList KAddressBookIconView::selectedUids()
285{ 302{
286 QStringList uidList; 303 QStringList uidList;
287 QIconViewItem *item; 304 QIconViewItem *item;
288 AddresseeIconViewItem *aItem; 305 AddresseeIconViewItem *aItem;
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
@@ -58,12 +58,14 @@ class KAddressBookIconView : public KAddressBookView
58 58
59 virtual QStringList selectedUids(); 59 virtual QStringList selectedUids();
60 virtual QString type() const { return "Icon"; } 60 virtual QString type() const { return "Icon"; }
61 void doSearch( const QString& s ,KABC::Field *field ); 61 void doSearch( const QString& s ,KABC::Field *field );
62 62
63 virtual void readConfig(KConfig *config); 63 virtual void readConfig(KConfig *config);
64 virtual void scrollUP();
65 virtual void scrollDOWN();
64 66
65 public slots: 67 public slots:
66 void refresh(QString uid = QString::null); 68 void refresh(QString uid = QString::null);
67#ifndef KAB_EMBEDDED 69#ifndef KAB_EMBEDDED
68//MOC_SKIP_BEGIN 70//MOC_SKIP_BEGIN
69 void setSelected(QString uid = QString::null, bool selected = true); 71 void setSelected(QString uid = QString::null, bool selected = true);
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
@@ -48,13 +48,22 @@ KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab,
48 mListView = 0; 48 mListView = 0;
49} 49}
50 50
51KAddressBookTableView::~KAddressBookTableView() 51KAddressBookTableView::~KAddressBookTableView()
52{ 52{
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()
56{ 65{
57 if (mListView) 66 if (mListView)
58 { 67 {
59 disconnect(mListView, SIGNAL(selectionChanged()), 68 disconnect(mListView, SIGNAL(selectionChanged()),
60 this, SLOT(addresseeSelected())); 69 this, SLOT(addresseeSelected()));
@@ -156,13 +165,18 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
156 } 165 }
157 } 166 }
158 } 167 }
159 // Sometimes the background pixmap gets messed up when we add lots 168 // Sometimes the background pixmap gets messed up when we add lots
160 // of items. 169 // of items.
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
164} 178}
165void KAddressBookTableView::writeConfig(KConfig *config) 179void KAddressBookTableView::writeConfig(KConfig *config)
166{ 180{
167 KAddressBookView::writeConfig(config); 181 KAddressBookView::writeConfig(config);
168 182
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
@@ -60,12 +60,14 @@ friend class ContactListView;
60 virtual QStringList selectedUids(); 60 virtual QStringList selectedUids();
61 virtual void setSelected(QString uid = QString::null, bool selected = false); 61 virtual void setSelected(QString uid = QString::null, bool selected = false);
62 virtual void readConfig(KConfig *config); 62 virtual void readConfig(KConfig *config);
63 virtual void writeConfig(KConfig *config); 63 virtual void writeConfig(KConfig *config);
64 virtual QString type() const { return "Table"; } 64 virtual QString type() const { return "Table"; }
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
67 public slots: 69 public slots:
68 virtual void reconstructListView(); 70 virtual void reconstructListView();
69 71
70 protected slots: 72 protected slots:
71 /** Called whenever the user selects an addressee in the list view. 73 /** Called whenever the user selects an addressee in the list view.
diff --git a/microkde/klineedit.h b/microkde/klineedit.h
index 65e2f59..70c72d1 100644
--- a/microkde/klineedit.h
+++ b/microkde/klineedit.h
@@ -7,18 +7,41 @@
7#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8#endif 8#endif
9 9
10 10
11class KLineEdit : public QLineEdit 11class 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
17 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); 21 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
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};
23 46
24#endif 47#endif