contactengine/mainwindow.cpp
changeset 23 51fcdd1558d8
parent 19 e4b6ee329501
child 25 adbe71832e2b
equal deleted inserted replaced
22:d5911f90500d 23:51fcdd1558d8
       
     1 #include <QComboBox>
       
     2 
     1 #include "mainwindow.h"
     3 #include "mainwindow.h"
     2 #include "ui_mainwindow.h"
     4 #include "ui_mainwindow.h"
     3 #include "contactsengine.h"
     5 #include "contactsengine.h"
     4 
     6 
     5 MainWindow::MainWindow(QWidget *parent) :
     7 MainWindow::MainWindow(QWidget *parent) :
     6     QMainWindow(parent),
     8     QMainWindow(parent),
     7     ui(new Ui::MainWindow)
     9     ui(new Ui::MainWindow)
     8 {
    10 {
     9     ui->setupUi(this);
    11     ui->setupUi(this);
    10     this->ce = new ContactsEngine(this);
    12     this->ce = new ContactsEngine(this);
       
    13   //  this->ce->enumerateMgrs();
       
    14     this->ce->setManager(QString("memory"));
       
    15 
       
    16     connect(ui->comboBox, SIGNAL( activated ( const QString &  )),
       
    17             this->ce, SLOT(setManager(const QString &) ));
    11 
    18 
    12     ui->comboBox->addItems(this->ce->dataSources());
    19     ui->comboBox->addItems(this->ce->dataSources());
    13 
    20     this->ce->populateAddresses();
       
    21  //   this->ce->enumerateMgrs();
       
    22   //  this->ce->dumpContactMgr();
       
    23     ui->listView->setModel(this->ce);
    14 }
    24 }
    15 
    25 
    16 void MainWindow::backendSelected(QString txt)
    26 
    17 {
       
    18     // based on this string create a contact manager.
       
    19     this->ce->setManager(txt);
       
    20 }
       
    21 
    27 
    22 MainWindow::~MainWindow()
    28 MainWindow::~MainWindow()
    23 {
    29 {
    24     delete ui;
    30     delete ui;
    25 }
    31 }