contactengine/mainwindow.cpp
changeset 25 adbe71832e2b
parent 23 51fcdd1558d8
child 30 33e489bb7487
equal deleted inserted replaced
24:2e833c2a6782 25:adbe71832e2b
     1 #include <QComboBox>
     1 #include <QComboBox>
       
     2 #include <QMessageBox>
       
     3 
       
     4 #include <QDebug>
     2 
     5 
     3 #include "mainwindow.h"
     6 #include "mainwindow.h"
     4 #include "ui_mainwindow.h"
     7 #include "ui_mainwindow.h"
     5 #include "contactsengine.h"
     8 #include "contactsengine.h"
     6 
     9 
     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 }