Mercurial > hg > octave-thorsten
annotate gui/src/SettingsDialog.cpp @ 13531:bb3676025b36
User can set a custom file editor instead of the built-in one.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Sun, 24 Jul 2011 20:52:48 +0200 |
parents | c70511cf64ee |
children | 869c62c15e95 |
rev | line source |
---|---|
13501 | 1 #include "SettingsDialog.h" |
2 #include "ui_SettingsDialog.h" | |
3 #include <QSettings> | |
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 | 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 | 10 |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
11 QSettings settings (m_settingsFile, QSettings::IniFormat); |
13531
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
12 ui->connectOnStartup->setChecked (settings.value ("connectOnStartup").toBool ()); |
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
13 ui->showMessageOfTheDay->setChecked (settings.value ("showMessageOfTheDay").toBool ()); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
14 ui->showTopic->setChecked (settings.value ("showTopic").toBool ()); |
13531
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
15 ui->autoIdentification->setChecked (settings.value ("autoIdentification").toBool ()); |
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
16 ui->nickServPassword->setText (settings.value ("nickServPassword").toString ()); |
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
17 ui->useCustomFileEditor->setChecked (settings.value ("useCustomFileEditor").toBool ()); |
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
18 ui->customFileEditor->setText (settings.value ("customFileEditor").toString ()); |
13501 | 19 } |
20 | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
21 SettingsDialog::~SettingsDialog () |
13501 | 22 { |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
23 QSettings settings (m_settingsFile, QSettings::IniFormat); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
24 settings.setValue ("connectOnStartup", ui->connectOnStartup->isChecked ()); |
13531
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
25 settings.setValue ("showMessageOfTheDay", ui->showMessageOfTheDay->isChecked ()); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
26 settings.setValue ("showTopic", ui->showTopic->isChecked ()); |
13531
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
27 settings.setValue ("autoIdentification", ui->autoIdentification->isChecked ()); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
28 settings.setValue ("nickServPassword", ui->nickServPassword->text ()); |
13531
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
29 settings.setValue ("useCustomFileEditor", ui->useCustomFileEditor->isChecked ()); |
bb3676025b36
User can set a custom file editor instead of the built-in one.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13506
diff
changeset
|
30 settings.setValue ("customFileEditor", ui->customFileEditor->text ()); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13501
diff
changeset
|
31 delete ui; |
13501 | 32 } |