Updated French translation
[timedsilencer] / mainwindow.cpp
1 /*
2  * This file is part of TimedSilencer.
3  *
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.
8  *
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.
13  *
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/>.
16  */
17
18 #include <QMaemo5ValueButton>
19 #include <QMaemo5TimePickSelector>
20 #include <QMaemo5InformationBox>
21 #include <QVBoxLayout>
22 #include <QLabel>
23 #include <QSpacerItem>
24 #include <QSettings>
25 #include <QCheckBox>
26 #include <QPushButton>
27 #include <QHBoxLayout>
28 #include <QCloseEvent>
29 #include <QIcon>
30 #include "mainwindow.h"
31 #include "switchingeventlist.h"
32 #include "newalarmdlg.h"
33
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);
42   // Auto rotation
43   setAttribute(Qt::WA_Maemo5AutoOrientation, true);
44 }
45
46 MainWindow::~MainWindow() {
47   delete addEventBtn;
48   delete eventList;
49 }
50
51 void MainWindow::loadSettings() {
52
53 }
54
55 void MainWindow::saveSettings() {
56
57 }
58
59 void MainWindow::addEvent() {
60   NewAlarmDlg dlg(this);
61   connect(&dlg, SIGNAL(newEvent(QVariant)), eventList, SLOT(addNewEvent(QVariant)));
62   dlg.exec();
63 }
64