Seafood/mainwindow.cpp
author John Kern <johnk@symbian.org>
Tue, 06 Apr 2010 08:02:52 -0700
changeset 14 a16afe3df8c9
parent 11 f3dbeee07821
child 15 0f80a0f39475
permissions -rwxr-xr-x
get nutrition information from db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     1
#include <QFile>
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     2
#include <QIcon>
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     3
#include <QListWidget>
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     4
#include <QMessageBox>
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
     5
#include <QStackedWidget>
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     6
#include <QTableWidget>
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     7
#include <QDesktopServices>
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
     8
#include <QWebView>
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
     9
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    10
#include "Fishes.h"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    11
#include "mainwindow.h"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    12
#include "ui_mainwindow.h"
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    13
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    14
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    15
MainWindow::MainWindow(QWidget *parent) :
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    16
    QMainWindow(parent),
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    17
    ui(new Ui::MainWindow)
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    18
{
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    19
    ui->setupUi(this);
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    20
    setContextMenuPolicy(Qt::NoContextMenu);
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    21
    this->fishDb = new Fishes(this);
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    22
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    23
    this->stackedWidget = new QStackedWidget;
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    24
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    25
    // lists of fish
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    26
    this->tabWidget = new QTabWidget;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    27
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    28
    this->bestList = new QListWidget;
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    29
    this->bestList->addItems(this->fishDb->getBest());
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    30
    this->tabWidget->addTab(this->bestList, "best");
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    31
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    32
    this->okList = new QListWidget;
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    33
    this->okList->addItems(this->fishDb->getOK());
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    34
    this->tabWidget->addTab(this->okList, "ok");
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    35
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    36
    this->worstList = new QListWidget;
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    37
    this->worstList->addItems(this->fishDb->getWorst());
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    38
    this->tabWidget->addTab(this->worstList, "worst");
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    39
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    40
    this->index = EBestList;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    41
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    42
    connect(this->tabWidget, SIGNAL(currentChanged(int)),
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    43
            this, SLOT(setCurrentList(int)));
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    44
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    45
    this->stackedWidget->addWidget(tabWidget); // associated with EListPage
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    46
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    47
    // Eco details
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    48
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    49
    this->ecoDetails = new QWebView;
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    50
    this->ecoDetails->setHtml("<html><title>Eco Details</title><ul><li>not yet implemented</li></ul></html>");
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    51
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    52
    this->stackedWidget->addWidget(this->ecoDetails); // associated with EEcoPage
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    53
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    54
    // Nutrition page
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    55
    // this->model = new QSqlQueryModel;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    56
    // this->model->
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    57
    this->stackedWidget->addWidget(ui->centralWidget); // associated with ENutritionPage
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    58
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    59
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    60
    setCentralWidget(stackedWidget);
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    61
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    62
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    63
}
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    64
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    65
MainWindow::~MainWindow()
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    66
{
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    67
    delete ui;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    68
}
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    69
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    70
void MainWindow::createMenus()
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    71
    {
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    72
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    73
        ecoAction = new QAction(tr("&eco details"),this);
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    74
        menuBar()->addAction(ecoAction);
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    75
        connect(ecoAction, SIGNAL(triggered()),this, SLOT(displayEcoDetails()));
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    76
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    77
        nuAction = new QAction(tr("&Nutrition"),this);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    78
        menuBar()->addAction(nuAction);
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    79
        connect(nuAction, SIGNAL(triggered()),this, SLOT(displayNutrition()));
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    80
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    81
        fishesAction = new QAction(tr("&List Fishes"),this);
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    82
        menuBar()->addAction(fishesAction);
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    83
        connect(fishesAction, SIGNAL(triggered()),this, SLOT(displayList()));
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    84
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    85
        verAction = new QAction(tr("&Version"),this);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    86
        menuBar()->addAction(verAction);
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    87
        connect(verAction, SIGNAL(triggered()),this, SLOT(displayVersion()));
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    88
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    89
        exitAction = new QAction(tr("&Exit"),this);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    90
        menuBar()->addAction(exitAction);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    91
        connect(exitAction, SIGNAL(triggered()),this, SLOT(close()));
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    92
    }
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    93
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    94
void MainWindow::displayVersion()
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
    95
{
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
    96
    QMessageBox::information(this,"Qt Version", qVersion());
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    97
}
John Kern <johnk@symbian.org>
parents: 3
diff changeset
    98
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
    99
 QString MainWindow::currentlySelectedItem()
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   100
 {
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   101
     QString selectedName;
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   102
     QListWidgetItem *item=NULL;
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   103
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   104
     switch (this->index)
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   105
     {
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   106
     case EBestList:
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   107
         item = this->bestList->currentItem();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   108
         if (item)
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   109
         {
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   110
             selectedName = item->text();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   111
         }
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   112
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   113
         break;
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   114
     case EOkList:
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   115
         item = this->okList->currentItem();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   116
         if (item) {
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   117
             selectedName = item->text();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   118
         }
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   119
         break;
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   120
     case EWorstList:
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   121
         item = this->worstList->currentItem();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   122
         if (item) {
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   123
             selectedName = item->text();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   124
         }
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   125
         break;
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   126
     }
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   127
     return selectedName;
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   128
 }
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
   129
John Kern <johnk@symbian.org>
parents: 3
diff changeset
   130
void MainWindow::displayEcoDetails()
John Kern <johnk@symbian.org>
parents: 3
diff changeset
   131
{
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   132
    QString selectedName = this->currentlySelectedItem();
11
f3dbeee07821 instrumented with debugging output
John Kern <johnk@symbian.org>
parents: 10
diff changeset
   133
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   134
    if (selectedName.isEmpty()) {
11
f3dbeee07821 instrumented with debugging output
John Kern <johnk@symbian.org>
parents: 10
diff changeset
   135
        QMessageBox::information(this,"warning","select an item from list." );
f3dbeee07821 instrumented with debugging output
John Kern <johnk@symbian.org>
parents: 10
diff changeset
   136
    } else {
f3dbeee07821 instrumented with debugging output
John Kern <johnk@symbian.org>
parents: 10
diff changeset
   137
        this->ecoDetails->setHtml( this->fishDb->getEcoDetails(selectedName));
f3dbeee07821 instrumented with debugging output
John Kern <johnk@symbian.org>
parents: 10
diff changeset
   138
        this->stackedWidget->setCurrentIndex(MainWindow::EEcoPage);
f3dbeee07821 instrumented with debugging output
John Kern <johnk@symbian.org>
parents: 10
diff changeset
   139
    }
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
   140
}
John Kern <johnk@symbian.org>
parents: 3
diff changeset
   141
14
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   142
void MainWindow::displayNutrition()
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   143
{
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   144
    QString selectedName = this->currentlySelectedItem();
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   145
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   146
    if (selectedName.isEmpty()) {
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   147
        QMessageBox::information(this,"warning","select an item from list." );
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   148
    } else {
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   149
      // this->ecoDetails->setHtml( this->fishDb->getNutrition(selectedName));
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   150
        this->fishDb->getNutrition(selectedName);
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   151
        this->stackedWidget->setCurrentIndex(MainWindow::ENutritionPage);
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   152
    }
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   153
}
a16afe3df8c9 get nutrition information from db
John Kern <johnk@symbian.org>
parents: 11
diff changeset
   154
7
John Kern <johnk@symbian.org>
parents: 3
diff changeset
   155
void MainWindow::displayList()
John Kern <johnk@symbian.org>
parents: 3
diff changeset
   156
{
John Kern <johnk@symbian.org>
parents: 3
diff changeset
   157
    this->stackedWidget->setCurrentIndex(MainWindow::EListPage);
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   158
}
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   159
10
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   160
void MainWindow::setCurrentList(int l)
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   161
{
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   162
    switch (l)
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   163
    {
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   164
    case 0:
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   165
        this->index = EBestList;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   166
        break;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   167
    case 1:
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   168
        this->index = EOkList;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   169
        break;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   170
    case 2:
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   171
        this->index = EWorstList;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   172
        break;
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   173
    }
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   174
}
79eeacfd15ff implement eco details with webview
User@User-PC.domain_not_set.invalid
parents: 7
diff changeset
   175
3
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   176
void MainWindow::changeEvent(QEvent *e)
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   177
{
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   178
    QMainWindow::changeEvent(e);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   179
    switch (e->type()) {
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   180
    case QEvent::LanguageChange:
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   181
        ui->retranslateUi(this);
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   182
        break;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   183
    default:
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   184
        break;
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   185
    }
e6d1a78b6db9 wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff changeset
   186
}