Merge branch 'master' of https://vcs.maemo.org/git/vlc-remote
[vlc-remote] / configdialog.cpp
1 /*   VLC-REMOTE for MAEMO 5
2  *   Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>
3  *   This program is free software; you can redistribute it and/or modify
4  *   it under the terms of the GNU General Public License version 2,
5  *   or (at your option) any later version, as published by the Free
6  *   Software Foundation
7  *
8  *   This program is distributed in the hope that it will be useful,
9  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  *   GNU General Public License for more details
12  *
13  *   You should have received a copy of the GNU General Public
14  *   License along with this program; if not, write to the
15  *   Free Software Foundation, Inc.,
16  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18 #include "configdialog.h"
19 #include "ui_configdialog.h"
20 #include <QSettings>
21 ConfigDialog::ConfigDialog(QWidget *parent) :
22         QDialog(parent),
23         ui(new Ui::ConfigDialog)
24 {
25     ui->setupUi(this);
26     load();
27     connect(ui->buttonBox,SIGNAL(accepted()),this,SLOT(save()));
28 }
29
30 ConfigDialog::~ConfigDialog()
31 {
32     delete ui;
33 }
34
35 void ConfigDialog::changeEvent(QEvent *e)
36 {
37     QDialog::changeEvent(e);
38     switch (e->type()) {
39     case QEvent::LanguageChange:
40         ui->retranslateUi(this);
41         break;
42     default:
43         break;
44     }
45 }
46 void ConfigDialog::load()
47 {
48
49
50     QSettings settings;
51     ui->lineEdit->setText(settings.value("ip").toString());
52
53 }
54
55 void ConfigDialog::save()
56 {
57
58     QSettings settings;
59     settings.setValue("ip",ui->lineEdit->text());
60
61     emit accept();
62
63
64
65 }