aboutsummaryrefslogtreecommitdiff
path: root/src/dialogs/settingsdialog.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2021-03-15 12:57:36 +0100
committerFelix Queißner <felix@ib-queissner.de>2021-03-17 09:49:58 +0100
commitf60dac9d7ebb5b989aad67d67d5ab3ccef7d278c (patch)
treee2f74ba184d14ee6302d89ce4d61c1972e733360 /src/dialogs/settingsdialog.cpp
parent0d1fd257093c58bfb606aaac530aed3b0877f7fd (diff)
downloadkristall-f60dac9d7ebb5b989aad67d67d5ab3ccef7d278c.tar.gz
Adds option to have old or new session behaviour. Closes #187
Diffstat (limited to 'src/dialogs/settingsdialog.cpp')
-rw-r--r--src/dialogs/settingsdialog.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp
index f6d4728..ea30d4f 100644
--- a/src/dialogs/settingsdialog.cpp
+++ b/src/dialogs/settingsdialog.cpp
@@ -54,6 +54,10 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
this->ui->list_symbol->addItem(tr("Circle"), QVariant::fromValue<int>(int(QTextListFormat::Style::ListCircle)));
this->ui->list_symbol->addItem(tr("Square"), QVariant::fromValue<int>(int(QTextListFormat::Style::ListSquare)));
+ this->ui->session_restore_behaviour->clear();
+ this->ui->session_restore_behaviour->addItem(tr("Start Page"), QVariant::fromValue<int>(GenericSettings::NoSessionRestore));
+ this->ui->session_restore_behaviour->addItem(tr("Restore Last Session"), QVariant::fromValue<int>(GenericSettings::RestoreLastSession));
+
setGeminiStyle(DocumentStyle { });
this->predefined_styles.clear();
@@ -372,6 +376,15 @@ void SettingsDialog::setOptions(const GenericSettings &options)
this->ui->cache_life->setValue(this->current_options.cache_life);
this->ui->enable_unlimited_cache_life->setChecked(this->current_options.cache_unlimited_life);
this->ui->cache_life->setEnabled(!this->current_options.cache_unlimited_life);
+
+ this->ui->session_restore_behaviour->setCurrentIndex(0);
+ for(int i = 0; i < this->ui->session_restore_behaviour->count(); ++i)
+ {
+ if(this->ui->session_restore_behaviour->itemData(i).toInt() == int(options.session_restore_behaviour)) {
+ this->ui->session_restore_behaviour->setCurrentIndex(i);
+ break;
+ }
+ }
}
GenericSettings SettingsDialog::options() const
@@ -970,3 +983,8 @@ void SettingsDialog::on_strip_nav_off_clicked()
{
this->current_options.strip_nav = false;
}
+
+void SettingsDialog::on_session_restore_behaviour_currentIndexChanged(int index)
+{
+ this->current_options.session_restore_behaviour = GenericSettings::SessionRestoreBehaviour(this->ui->session_restore_behaviour->itemData(index).toInt());
+}