1/****************************************************************************
2**
3** Copyright (C) 2008 Ralf Habacker <ralf.habacker@freenet.de>
4** All rights reserved.
5**
6** This file is part of the KDE installer for windows
7**
8** This file may be used under the terms of the GNU General Public
9** License version 2.0 as published by the Free Software Foundation
10** and appearing in the file LICENSE.GPL included in the packaging of
11** this file. Please review the following information to ensure GNU
12** General Public Licensing requirements will be met:
13** http://www.trolltech.com/products/qt/opensource.html
14**
15** If you are unsure which license is appropriate for your use, please
16** review the following information:
17** http://www.trolltech.com/products/qt/licensing.html or contact the
18** sales department at sales@trolltech.com.
19**
20** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
21** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22**
23****************************************************************************/
24
25#include "settings.h"
26#include "settingspage.h"
27#include "database.h"
28#include "mirrors.h"
29
30#include "ui_settingspage.h"
31
32#include <QtDebug>
33#include <QFileDialog>
34#include <QInputDialog>
35
36SettingsPage::SettingsPage(QWidget *parent)
37 : QDialog(parent), ui(new Ui::SettingsDialog), s(Settings::instance())
38{
39// init();
40}
41
42void SettingsPage::init()
43{
44 // required to reset changes from single page access
45 ui->setupUi(this);
46 ui->displayTitlePage->setCheckState(s.isPackageManagerMode() ? Qt::Checked : Qt::Unchecked);
47 ui->installDetails->setCheckState(s.installDetails() ? Qt::Checked : Qt::Unchecked);
48 ui->autoNextStep->setCheckState(s.autoNextStep() ? Qt::Checked : Qt::Unchecked);
49
50}
51
52void SettingsPage::accept()
53{
54 hide();
55
56 s.setPackageManagerMode(ui->displayTitlePage->checkState() == Qt::Checked ? true : false);
57 s.setInstallDetails(ui->installDetails->checkState() == Qt::Checked ? true : false);
58 s.setAutoNextStep(ui->autoNextStep->checkState() == Qt::Checked ? true : false);
59}
60
61void SettingsPage::reject()
62{
63 hide();
64 init(); // reinit page to restore old settings, is this really required ?
65}
66
67#if test
68int main(int argc, char **argv)
69{
70 QApplication app(argc, argv);
71
72 SettingsPage settingsPage;
73
74 settingsPage.show();
75 app.exec();
76}
77#endif
78