-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnoozepage.cpp
40 lines (33 loc) · 1002 Bytes
/
snoozepage.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "snoozepage.h"
#include "ui_snoozepage.h"
SnoozePage::SnoozePage(QWidget *parent) :
QWizardPage(parent),
_ui(new Ui::SnoozePage)
{
_ui->setupUi(this);
registerField("snooze", _ui->snoozeEdit);
connect(_ui->snoozeUp, SIGNAL(clicked()), this, SLOT(up()));
connect(_ui->snoozeDown, SIGNAL(clicked()), this, SLOT(down()));
}
void SnoozePage::initializePage()
{
if ( ! field("snooze").toString().isEmpty() )
_ui->snoozeEdit->setText(field("snooze").toString());
else
_ui->snoozeEdit->setText("05");
}
SnoozePage::~SnoozePage()
{
delete _ui;
}
void SnoozePage::up()
{
int snooze = _ui->snoozeEdit->text().toInt();
_ui->snoozeEdit->setText(QString::number(++snooze).rightJustified(2, '0'));
}
void SnoozePage::down()
{
int snooze = _ui->snoozeEdit->text().toInt();
if ( snooze > 0 )
_ui->snoozeEdit->setText(QString::number(--snooze).rightJustified(2, '0'));
}