Initial Commit
[uktrainplanner] / src / departurewidget.cpp
1 /*
2  *   National Rail Live Departure boards software for the Maemo platform.
3  *   Copyright (C) 2010 Stewart Holmes
4  *
5  *   This program is free software: you can redistribute it and/or modify
6  *   it under the terms of the GNU General Public License as published by
7  *   the Free Software Foundation, either version 3 of the License, or
8  *   (at your option) any later version.
9  *
10  *   This program is distributed in the hope that it will be useful,
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *   GNU General Public License for more details.
14  *
15  *   You should have received a copy of the GNU General Public License
16  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  *   Contact: stewart@stewartholmes.com
19  */
20
21 #include "departurewidget.h"
22 #include "ui_departurewidget.h"
23
24 DepartureWidget::DepartureWidget(QString time, QString dest, QString late, QString platform, QString id, QWidget *parent) : QWidget(parent), ui(new Ui::DepartureWidget)
25 {
26     ui->setupUi(this);
27
28     ui->time->setText(time);
29     ui->destination->setText(dest);
30     ui->status->setText(late);
31     ui->platform->setText(platform);
32     m_id = id;
33 }
34
35 void DepartureWidget::setShowPlatform(bool b)
36 {
37     ui->platform->setVisible(b);
38     ui->platformlabel->setVisible(b);
39 }
40
41 DepartureWidget::~DepartureWidget()
42 {
43     delete ui;
44 }
45
46 void DepartureWidget::changeEvent(QEvent *e)
47 {
48     QWidget::changeEvent(e);
49     switch (e->type()) {
50     case QEvent::LanguageChange:
51         ui->retranslateUi(this);
52         break;
53     default:
54         break;
55     }
56 }