3 Copyright (C) 2010 Christian Pulvermacher
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include <QMaemo5ValueButton>
21 #include <QMaemo5ListPickSelector>
23 #include "preferences.h"
25 Preferences::Preferences(QWidget *parent):
28 setWindowTitle("Preferences");
30 QHBoxLayout *layout1 = new QHBoxLayout();
31 QVBoxLayout *layout2 = new QVBoxLayout();
33 QMaemo5ValueButton *rotation = new QMaemo5ValueButton(tr("Screen Rotation"), this);
34 //rotation->setValueText(settings.value("sound_filename", SOUND_FILE).toString());
35 rotation_selector = new QMaemo5ListPickSelector(this);
36 QStandardItemModel *model = new QStandardItemModel(0, 1, this);
37 model->appendRow(new QStandardItem(tr("Automatic")));
38 model->appendRow(new QStandardItem(tr("Landscape")));
39 model->appendRow(new QStandardItem(tr("Portrait")));
40 rotation_selector->setModel(model);
41 rotation_selector->setCurrentIndex(settings.value("screen_rotation", 0).toInt());
42 rotation->setPickSelector(rotation_selector);
43 rotation->setValueLayout(QMaemo5ValueButton::ValueBesideText);
44 layout2->addWidget(rotation);
46 QPushButton *ok = new QPushButton("OK");
48 layout1->addLayout(layout2);
49 layout1->addWidget(ok);
53 connect(ok, SIGNAL(clicked()),
54 this, SLOT(accept()));
55 connect(this, SIGNAL(accepted()),
59 Preferences::~Preferences()
65 void Preferences::save()
67 settings.setValue("screen_rotation", rotation_selector->currentIndex());