summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/kaddressbookiconview.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/views/kaddressbookiconview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbookiconview.cpp17
1 files changed, 17 insertions, 0 deletions
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
@@ -32,24 +32,25 @@
#include <kiconloader.h>
#include <klocale.h>
#else //KAB_EMBEDDED
#endif //KAB_EMBEDDED
#include <kabc/addressbook.h>
#include "kabprefs.h"
#include "viewmanager.h"
#include "kaddressbookiconview.h"
#include <qlayout.h>
#include <qregexp.h>
+#include <qapplication.h>
#include <kglobal.h>
/*US transfered to the headerfile
class IconViewFactory : public ViewFactory
{
public:
KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name )
{
return new KAddressBookIconView( ab, parent, name );
}
QString type() const { return "Icon"; }
@@ -202,24 +203,34 @@ KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab,
connect(mIconView, SIGNAL(selectionChanged()),
this, SLOT(addresseeSelected()));
connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)),
this, SIGNAL(dropped(QDropEvent*)));
connect(mIconView, SIGNAL(startAddresseeDrag()),
this, SIGNAL(startDrag()));
}
KAddressBookIconView::~KAddressBookIconView()
{
}
+void KAddressBookIconView::scrollUP()
+{
+ QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 );
+ QApplication::postEvent( mIconView, ev );
+}
+void KAddressBookIconView::scrollDOWN()
+{
+ QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
+ QApplication::postEvent( mIconView, ev );
+}
void KAddressBookIconView::readConfig(KConfig *config)
{
KAddressBookView::readConfig(config);
//US method executed is part of KIconView
//US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)),
//US this, SLOT(addresseeExecuted(QIconViewItem *)));
disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)),
this, SLOT(addresseeExecuted(QIconViewItem *)));
//US method executed is part of KIconView. Use selectionChanged instead
/*US
@@ -271,24 +282,30 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
if (re.search((*fieldIt)->value( *it ).lower()) != -1)
#else
if (re.match((*fieldIt)->value( *it ).lower()) != -1)
#endif
{
mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView ));
continue;
}
}
}
}
mIconView->arrangeItemsInGrid( true );
+ if ( mIconView->firstItem() ) {
+ mIconView->setCurrentItem ( mIconView->firstItem() );
+ mIconView->setSelected ( mIconView->firstItem() , true );
+ }
+ else
+ emit selected(QString::null);
}
QStringList KAddressBookIconView::selectedUids()
{
QStringList uidList;
QIconViewItem *item;
AddresseeIconViewItem *aItem;
for (item = mIconView->firstItem(); item; item = item->nextItem())
{
if (item->isSelected())
{
#ifndef KAB_EMBEDDED