2 * SomePlayer - An alternate music player for Maemo 5
3 * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #include "timerdialog.h"
21 #include "ui_timerdialog.h"
23 TimerDialog::TimerDialog(QWidget *parent) :
25 ui(new Ui::TimerDialog)
28 ui->disableCheckBox->setChecked(false);
29 ui->disableCheckBox->setVisible(false);
32 TimerDialog::~TimerDialog()
37 void TimerDialog::init() {
41 void TimerDialog::setTime(int h, int m, int s) {
42 if (h < 0 || h > 12 || m < 0 || m > 59 || s < 0 || s > 59)
44 ui->hoursListWidget->setCurrentRow(h);
45 ui->hoursListWidget->scrollTo(ui->hoursListWidget->model()->index(h, 0));
46 ui->minutesListWidget->setCurrentRow(m);
47 ui->minutesListWidget->scrollTo(ui->minutesListWidget->model()->index(m, 0));
48 ui->secondsListWidget->setCurrentRow(s);
49 ui->secondsListWidget->scrollTo(ui->secondsListWidget->model()->index(s, 0));
52 void TimerDialog::getTime(int *h, int *m, int *s) {
53 (*h) = ui->hoursListWidget->currentRow();
54 (*m) = ui->minutesListWidget->currentRow();
55 (*s) = ui->secondsListWidget->currentRow();
58 bool TimerDialog::timerDisabled() {
59 return ui->disableCheckBox->isChecked();
62 void TimerDialog::showDisable() {
63 ui->disableCheckBox->setVisible(true);