contactengine/contactlist.cpp
author John Kern <johnk@symbian.org>
Thu, 16 Sep 2010 10:59:11 -0700
changeset 49 d9d4ea56179a
permissions -rwxr-xr-x
added a listview to support orange lab fw

#include <OLApplication.h>
#include <QMessageBox>
#include "contactlist.h"

ContactList::ContactList(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form)
{
    ui->setupUi(this);

    this->ce = new ContactsEngine(this);

    connect(this->ce, SIGNAL(errorOccurred(QString)),
            this,SLOT(errorOccurred(QString)));

    this->ce->createManager();

    connect(ui->comboBox, SIGNAL( activated ( const QString &  )),
            this->ce, SLOT(setManager(const QString &) ));


    ui->comboBox->addItems(this->ce->dataSources());
    ui->listView->setModel(this->ce);

}


void ContactList::errorOccurred(QString err)
{
    QMessageBox::information(this, "foo", err);
}

// just should all contacts.
void ContactList::showAllContacts()
{
    OLApplication* app = dynamic_cast<OLApplication*>(qApp);
    app->showBanner("(all) NYI", false);
}

// source the list of contacts by proximity to the phone.
void ContactList::sortByGeo()
{
    OLApplication* app = dynamic_cast<OLApplication*>(qApp);
    app->showBanner("(geo) NYI", false);
}

// show all contacts at a particular event.
void ContactList::showEvents()
{
    OLApplication* app = dynamic_cast<OLApplication*>(qApp);
    app->showBanner("(events) NYI", false);
}

// show call log
void ContactList::showLogs()
{
    OLApplication* app = dynamic_cast<OLApplication*>(qApp);
    app->showBanner("(logs) NYI", false);
}