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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
     1
#include <OLApplication.h>
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
     2
#include <QMessageBox>
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
     3
#include "contactlist.h"
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
     4
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
     5
ContactList::ContactList(QWidget *parent) :
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
     6
    QWidget(parent),
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
     7
    ui(new Ui::Form)
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
     8
{
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
     9
    ui->setupUi(this);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    10
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    11
    this->ce = new ContactsEngine(this);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    12
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    13
    connect(this->ce, SIGNAL(errorOccurred(QString)),
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    14
            this,SLOT(errorOccurred(QString)));
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    15
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    16
    this->ce->createManager();
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    17
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    18
    connect(ui->comboBox, SIGNAL( activated ( const QString &  )),
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    19
            this->ce, SLOT(setManager(const QString &) ));
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    20
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    21
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    22
    ui->comboBox->addItems(this->ce->dataSources());
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    23
    ui->listView->setModel(this->ce);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    24
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    25
}
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    26
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    27
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    28
void ContactList::errorOccurred(QString err)
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    29
{
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    30
    QMessageBox::information(this, "foo", err);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    31
}
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    32
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    33
// just should all contacts.
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    34
void ContactList::showAllContacts()
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    35
{
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    36
    OLApplication* app = dynamic_cast<OLApplication*>(qApp);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    37
    app->showBanner("(all) NYI", false);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    38
}
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    39
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    40
// source the list of contacts by proximity to the phone.
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    41
void ContactList::sortByGeo()
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    42
{
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    43
    OLApplication* app = dynamic_cast<OLApplication*>(qApp);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    44
    app->showBanner("(geo) NYI", false);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    45
}
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    46
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    47
// show all contacts at a particular event.
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    48
void ContactList::showEvents()
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    49
{
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    50
    OLApplication* app = dynamic_cast<OLApplication*>(qApp);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    51
    app->showBanner("(events) NYI", false);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    52
}
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    53
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    54
// show call log
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    55
void ContactList::showLogs()
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    56
{
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    57
    OLApplication* app = dynamic_cast<OLApplication*>(qApp);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    58
    app->showBanner("(logs) NYI", false);
d9d4ea56179a added a listview to support orange lab fw
John Kern <johnk@symbian.org>
parents:
diff changeset
    59
}