-
Notifications
You must be signed in to change notification settings - Fork 3
/
settingswindow.cpp
41 lines (38 loc) · 1.2 KB
/
settingswindow.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
41
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. See COPYING file for more details.
*
*/
#include "settingswindow.h"
#include "ui_settingswindow.h"
SettingsWindow::SettingsWindow(QWidget *parent, int pdays, QString pdelimiter, bool ptray) :
QDialog(parent),
ui(new Ui::SettingsWindow)
{
ui->setupUi(this);
//задаём значения по умолчанию
ui->spinBox->setValue(pdays);
ui->lineEdit->setText(pdelimiter);
ui->checkBox->setChecked(ptray);
}
//получаем выбранное значение "Напоминать за Х дней"
int SettingsWindow::getDays()
{
return ui->spinBox->value();
}
//получаем выбранное значение "Разделитель для отображения"
QString SettingsWindow::getDelimiter()
{
return ui->lineEdit->text();
}
//получаем "Сворачивать в трей"
bool SettingsWindow::getTray()
{
return ui->checkBox->isChecked();
}
SettingsWindow::~SettingsWindow()
{
delete ui;
}