1 /* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2021 Ricardo Villalba <ricardo@smplayer.info>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 #include "timedialog.h"
20
TimeDialog(QWidget * parent,Qt::WindowFlags f)21 TimeDialog::TimeDialog( QWidget* parent, Qt::WindowFlags f )
22 : QDialog(parent, f)
23 {
24 setupUi(this);
25
26 setWindowTitle(tr("SMPlayer - Seek"));
27 time_label->setObjectName("jump_to_label");
28 time_edit->setDisplayFormat("H:mm:ss");
29 }
30
~TimeDialog()31 TimeDialog::~TimeDialog() {
32 }
33
setTime(int seconds)34 void TimeDialog::setTime(int seconds) {
35 QTime t(0,0);
36 time_edit->setTime(t.addSecs(seconds));
37 }
38
time()39 int TimeDialog::time() {
40 QTime t(0,0);
41 return t.secsTo(time_edit->time());
42 }
43
setMaximumTime(int seconds)44 void TimeDialog::setMaximumTime( int seconds ) {
45 QTime t(0,0);
46 time_edit->setMaximumTime(t.addSecs(seconds));
47 }
48
maximumTime()49 int TimeDialog::maximumTime() {
50 QTime t(0,0);
51 return t.secsTo(time_edit->maximumTime());
52 }
53
setLabel(const QString & label)54 void TimeDialog::setLabel(const QString & label) {
55 time_label->setText(label);
56 }
57
label()58 QString TimeDialog::label() {
59 return time_label->text();
60 }
61
62 #include "moc_timedialog.cpp"
63