8 QMainWindow(parent), |
11 QMainWindow(parent), |
9 ui(new Ui::MainWindow) |
12 ui(new Ui::MainWindow) |
10 { |
13 { |
11 ui->setupUi(this); |
14 ui->setupUi(this); |
12 this->ce = new ContactsEngine(this); |
15 this->ce = new ContactsEngine(this); |
13 // this->ce->enumerateMgrs(); |
16 |
14 this->ce->setManager(QString("memory")); |
17 connect(this->ce, SIGNAL(errorOccurred(QString)), |
|
18 this,SLOT(errorOccurred(QString))); |
15 |
19 |
16 connect(ui->comboBox, SIGNAL( activated ( const QString & )), |
20 connect(ui->comboBox, SIGNAL( activated ( const QString & )), |
17 this->ce, SLOT(setManager(const QString &) )); |
21 this->ce, SLOT(setManager(const QString &) )); |
18 |
22 |
|
23 this->ce->createManager(); |
|
24 |
19 ui->comboBox->addItems(this->ce->dataSources()); |
25 ui->comboBox->addItems(this->ce->dataSources()); |
20 this->ce->populateAddresses(); |
|
21 // this->ce->enumerateMgrs(); |
|
22 // this->ce->dumpContactMgr(); |
|
23 ui->listView->setModel(this->ce); |
26 ui->listView->setModel(this->ce); |
24 } |
27 } |
25 |
28 |
26 |
29 void MainWindow::errorOccurred(QString errMsg) |
|
30 { |
|
31 QMessageBox::warning(this,"Err Routed",errMsg); |
|
32 qDebug() << errMsg << endl; |
|
33 } |
27 |
34 |
28 MainWindow::~MainWindow() |
35 MainWindow::~MainWindow() |
29 { |
36 { |
30 delete ui; |
37 delete ui; |
31 } |
38 } |