annotate gui/src/SettingsDialog.cpp @ 13506:c70511cf64ee

Reformatted to GNU Style.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Sun, 17 Jul 2011 22:59:28 +0200
parents 86d6c3b90ad7
children bb3676025b36
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
1 #include "SettingsDialog.h"
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
2 #include "ui_SettingsDialog.h"
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
3 #include <QSettings>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
4
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
5 SettingsDialog::SettingsDialog (QWidget * parent, QString settingsFile):
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
6 QDialog (parent), ui (new Ui::SettingsDialog)
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
7 {
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
8 m_settingsFile = settingsFile;
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
9 ui->setupUi (this);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
10
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
11 QSettings settings (m_settingsFile, QSettings::IniFormat);
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
12 ui->connectOnStartup->setChecked (settings.value ("connectOnStartup").
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
13 toBool ());
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
14 ui->showMessageOfTheDay->setChecked (settings.value ("showMessageOfTheDay").
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
15 toBool ());
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
16 ui->showTopic->setChecked (settings.value ("showTopic").toBool ());
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
17 ui->autoIdentification->setChecked (settings.value ("autoIdentification").
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
18 toBool ());
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
19 ui->nickServPassword->setText (settings.value ("nickServPassword").
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
20 toString ());
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
21 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
23 SettingsDialog::~SettingsDialog ()
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24 {
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
25 QSettings settings (m_settingsFile, QSettings::IniFormat);
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
26 settings.setValue ("connectOnStartup", ui->connectOnStartup->isChecked ());
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
27 settings.setValue ("showMessageOfTheDay",
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
28 ui->showMessageOfTheDay->isChecked ());
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
29 settings.setValue ("showTopic", ui->showTopic->isChecked ());
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
30 settings.setValue ("autoIdentification",
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
31 ui->autoIdentification->isChecked ());
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
32 settings.setValue ("nickServPassword", ui->nickServPassword->text ());
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
33 delete ui;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
34 }