diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-08 19:18:50 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-08 19:18:50 +0200 |
| commit | 51f46dce66ac660507dc7abad5506650bc863d7f (patch) | |
| tree | 7f97264f0a9315b357b9c338519146b572b80a96 /src/settingsdialog.cpp | |
| parent | 7caffad75f0e7f7f1b1ce4d9523a67680e9b39a2 (diff) | |
| download | kristall-51f46dce66ac660507dc7abad5506650bc863d7f.tar.gz | |
Adds two new options for text display: gophermap rendering with text or icons, all text documents as text/plain, prepares option for text highlighting.
Diffstat (limited to 'src/settingsdialog.cpp')
| -rw-r--r-- | src/settingsdialog.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index df14fd5..d6b84cf 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -6,6 +6,8 @@ #include <QSettings> #include <QInputDialog> +#include "kristall.hpp" + SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SettingsDialog), @@ -28,7 +30,24 @@ SettingsDialog::SettingsDialog(QWidget *parent) : setGeminiStyle(DocumentStyle { }); -// QSettings settings; + if(global_settings.value("gophermap_display").toString() == "text") { + this->ui->gophermap_text->setChecked(true); + } else { + this->ui->gophermap_icon->setChecked(true); + } + + if(global_settings.value("text_display").toString() == "plain") { + this->ui->fancypants_off->setChecked(true); + } else { + this->ui->fancypants_on->setChecked(true); + } + + if(global_settings.value("text_decoration").toBool()) { + this->ui->texthl_on->setChecked(true); + } else { + this->ui->texthl_off->setChecked(true); + } + // settings.beginGroup("Themes"); // int items = settings.beginReadArray("Themes"); @@ -346,3 +365,10 @@ void SettingsDialog::on_preset_new_clicked() } + +void SettingsDialog::on_SettingsDialog_accepted() +{ + global_settings.setValue("gophermap_display", this->ui->gophermap_text->isChecked() ? "text" : "rendered"); + global_settings.setValue("text_display", this->ui->fancypants_off->isChecked() ? "plain" : "fancy"); + global_settings.setValue("text_decoration", this->ui->texthl_on->isChecked()); +} |
