1 /**************************************************************************
2 * Otter Browser: Web browser controlled by the user, not vice-versa.
3 * Copyright (C) 2013 - 2017 Michal Dutkiewicz aka Emdek <michal@emdek.pl>
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 **************************************************************************/
19 
20 #include "ReloadTimeDialog.h"
21 
22 #include "ui_ReloadTimeDialog.h"
23 
24 namespace Otter
25 {
26 
ReloadTimeDialog(int time,QWidget * parent)27 ReloadTimeDialog::ReloadTimeDialog(int time, QWidget *parent) : Dialog(parent),
28 	m_ui(new Ui::ReloadTimeDialog)
29 {
30 	m_ui->setupUi(this);
31 
32 	const int minutes(time / 60);
33 
34 	m_ui->minutesSpinBox->setValue(minutes);
35 	m_ui->secondsSpinBox->setValue(time - (minutes * 60));
36 }
37 
~ReloadTimeDialog()38 ReloadTimeDialog::~ReloadTimeDialog()
39 {
40 	delete m_ui;
41 }
42 
changeEvent(QEvent * event)43 void ReloadTimeDialog::changeEvent(QEvent *event)
44 {
45 	QDialog::changeEvent(event);
46 
47 	if (event->type() == QEvent::LanguageChange)
48 	{
49 		m_ui->retranslateUi(this);
50 	}
51 }
52 
getReloadTime() const53 int ReloadTimeDialog::getReloadTime() const
54 {
55 	return ((m_ui->minutesSpinBox->value() * 60) + m_ui->secondsSpinBox->value());
56 }
57 
58 }
59