From 51f46dce66ac660507dc7abad5506650bc863d7f Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Mon, 8 Jun 2020 19:18:50 +0200 Subject: Adds two new options for text display: gophermap rendering with text or icons, all text documents as text/plain, prepares option for text highlighting. --- src/settingsdialog.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/settingsdialog.cpp') 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 #include +#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()); +} -- cgit v1.2.3