2 * This file is part of TimedSilencer.
4 * TimedSilencer 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 3 of the License, or
7 * (at your option) any later version.
9 * TimedSilencer 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.
14 * You should have received a copy of the GNU General Public License
15 * along with TimedSilencer. If not, see <http://www.gnu.org/licenses/>.
18 #include <QMaemo5ValueButton>
19 #include <QMaemo5TimePickSelector>
20 #include <QMaemo5InformationBox>
21 #include <QVBoxLayout>
23 #include <QSpacerItem>
26 #include <QPushButton>
27 #include <QHBoxLayout>
28 #include <QCloseEvent>
30 #include "mainwindow.h"
31 #include "switchingeventlist.h"
32 #include "newalarmdlg.h"
34 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
35 setCentralWidget(new QWidget());
36 QVBoxLayout *vLayout = new QVBoxLayout(centralWidget());
37 addEventBtn = new QPushButton(QIcon::fromTheme("general_add"), tr("New profile switching event"));
38 connect(addEventBtn, SIGNAL(clicked()), this, SLOT(addEvent()));
39 vLayout->addWidget(addEventBtn);
40 eventList = new SwitchingEventList;
41 vLayout->addWidget(eventList);
43 setAttribute(Qt::WA_Maemo5AutoOrientation, true);
46 MainWindow::~MainWindow() {
51 void MainWindow::loadSettings() {
55 void MainWindow::saveSettings() {
59 void MainWindow::addEvent() {
60 NewAlarmDlg dlg(this);
61 connect(&dlg, SIGNAL(newEvent(QVariant)), eventList, SLOT(addNewEvent(QVariant)));