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