diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2021-03-15 12:57:36 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-03-17 09:49:58 +0100 |
| commit | f60dac9d7ebb5b989aad67d67d5ab3ccef7d278c (patch) | |
| tree | e2f74ba184d14ee6302d89ce4d61c1972e733360 /src/dialogs/settingsdialog.cpp | |
| parent | 0d1fd257093c58bfb606aaac530aed3b0877f7fd (diff) | |
| download | kristall-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.cpp | 18 |
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()); +} |
