Remove button, fixed column width, limited text & fixed 00:00:00
[kitchenalert] / src / createtimersequencedialog.cpp
1 /**************************************************************************
2         KitchenAlert
3
4         Copyright (C) 2010  Heli Hyvättinen
5
6         This file is part of KitchenAlert.
7
8         Kitchen Alert is free software: you can redistribute it and/or modify
9         it under the terms of the GNU General Public License as published by
10         the Free Software Foundation, either version 3 of the License, or
11         (at your option) any later version.
12
13         This program is distributed in the hope that it will be useful,
14         but WITHOUT ANY WARRANTY; without even the implied warranty of
15         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16         GNU General Public License for more details.
17
18         You should have received a copy of the GNU General Public License
19         along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21 **************************************************************************/
22
23
24
25
26
27 #include "createtimersequencedialog.h"
28 #include "ui_createtimersequencedialog.h"
29
30 CreateTimerSequenceDialog::CreateTimerSequenceDialog(QWidget *parent) :
31     QDialog(parent),
32     ui(new Ui::CreateTimerSequenceDialog)
33 {
34     ui->setupUi(this);
35     ui->timer1AlertText->setMaxLength(40);
36 }
37
38 CreateTimerSequenceDialog::~CreateTimerSequenceDialog()
39 {
40     delete ui;
41 }
42
43 void CreateTimerSequenceDialog::changeEvent(QEvent *e)
44 {
45     QDialog::changeEvent(e);
46     switch (e->type()) {
47     case QEvent::LanguageChange:
48         ui->retranslateUi(this);
49         break;
50     default:
51         break;
52     }
53 }
54
55
56 QList<Timer*> CreateTimerSequenceDialog::getTimers()
57 {
58     QList<Timer *> timers;
59     Timer* ptimer =new Timer();
60     int timeInSeconds = (ui->Timer1HoursSpinBox->value() * 60 * 60)  + (ui->timer1minutesSpinBox->value() * 60) + ui->timer1SecondsSpinBox->value();
61     ptimer->setOriginalTimeInSeconds(timeInSeconds);
62     ptimer->setAlertText(ui->timer1AlertText->text());
63     timers.append(ptimer);
64
65     return timers;
66
67
68 }