aboutsummaryrefslogtreecommitdiff
path: root/src/dialogs
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
parent0d1fd257093c58bfb606aaac530aed3b0877f7fd (diff)
downloadkristall-f60dac9d7ebb5b989aad67d67d5ab3ccef7d278c.tar.gz
Adds option to have old or new session behaviour. Closes #187
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/settingsdialog.cpp18
-rw-r--r--src/dialogs/settingsdialog.hpp2
-rw-r--r--src/dialogs/settingsdialog.ui130
3 files changed, 90 insertions, 60 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());
+}
diff --git a/src/dialogs/settingsdialog.hpp b/src/dialogs/settingsdialog.hpp
index 9f996b1..97b1549 100644
--- a/src/dialogs/settingsdialog.hpp
+++ b/src/dialogs/settingsdialog.hpp
@@ -176,6 +176,8 @@ private slots:
void on_strip_nav_off_clicked();
+ void on_session_restore_behaviour_currentIndexChanged(int index);
+
private:
void reloadStylePreview();
diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui
index e33ec43..97121c3 100644
--- a/src/dialogs/settingsdialog.ui
+++ b/src/dialogs/settingsdialog.ui
@@ -60,44 +60,93 @@
</property>
</widget>
</item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_29">
+ <property name="text">
+ <string>Additional toolbar buttons</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_99">
+ <item>
+ <widget class="QCheckBox" name="enable_home_btn">
+ <property name="text">
+ <string>Home</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="enable_newtab_btn">
+ <property name="text">
+ <string>New tab</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="enable_root_btn">
+ <property name="text">
+ <string>Root (/)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="enable_parent_btn">
+ <property name="text">
+ <string>Parent (..)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
<item row="3" column="0">
+ <widget class="QLabel" name="label_19">
+ <property name="text">
+ <string>Startup Behaviour</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QComboBox" name="session_restore_behaviour"/>
+ </item>
+ <item row="4" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>UI Theme</string>
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QComboBox" name="ui_theme"/>
</item>
- <item row="4" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>Icon Theme</string>
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="5" column="1">
<widget class="QComboBox" name="icon_theme"/>
</item>
- <item row="5" column="0">
+ <item row="6" column="0">
<widget class="QLabel" name="label_1">
<property name="text">
<string>UI Density</string>
</property>
</widget>
</item>
- <item row="5" column="1">
+ <item row="6" column="1">
<widget class="QComboBox" name="ui_density"/>
</item>
- <item row="6" column="0">
+ <item row="7" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Enabled Protocols</string>
</property>
</widget>
</item>
- <item row="6" column="1">
+ <item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="enable_gemini">
@@ -142,14 +191,14 @@
</item>
</layout>
</item>
- <item row="7" column="0">
+ <item row="8" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Unknown Scheme</string>
</property>
</widget>
</item>
- <item row="7" column="1">
+ <item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QRadioButton" name="scheme_os_default">
@@ -173,38 +222,38 @@
</item>
</layout>
</item>
- <item row="8" column="0">
+ <item row="9" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Max. Number of Redirections</string>
</property>
</widget>
</item>
- <item row="8" column="1">
+ <item row="9" column="1">
<widget class="QSpinBox" name="max_redirects">
<property name="value">
<number>5</number>
</property>
</widget>
</item>
- <item row="9" column="0">
+ <item row="10" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Redirection Handling</string>
</property>
</widget>
</item>
- <item row="9" column="1">
+ <item row="10" column="1">
<widget class="QComboBox" name="redirection_mode"/>
</item>
- <item row="10" column="0">
+ <item row="11" column="0">
<widget class="QLabel" name="label_28">
<property name="text">
<string>Network Timeout</string>
</property>
</widget>
</item>
- <item row="10" column="1">
+ <item row="11" column="1">
<widget class="QSpinBox" name="network_timeout">
<property name="suffix">
<string> ms</string>
@@ -217,45 +266,6 @@
</property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_29">
- <property name="text">
- <string>Additional toolbar buttons</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_99">
- <item>
- <widget class="QCheckBox" name="enable_home_btn">
- <property name="text">
- <string>Home</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="enable_newtab_btn">
- <property name="text">
- <string>New tab</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="enable_root_btn">
- <property name="text">
- <string>Root (/)</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="enable_parent_btn">
- <property name="text">
- <string>Parent (..)</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
</layout>
</widget>
<widget class="QWidget" name="display_tab">
@@ -1663,14 +1673,14 @@
</connection>
</connections>
<buttongroups>
+ <buttongroup name="buttonGroup_7"/>
+ <buttongroup name="buttonGroup_6"/>
+ <buttongroup name="buttonGroup_5"/>
<buttongroup name="buttonGroup"/>
- <buttongroup name="buttonGroup_2"/>
+ <buttongroup name="buttonGroup_9"/>
+ <buttongroup name="buttonGroup_8"/>
<buttongroup name="buttonGroup_3"/>
<buttongroup name="buttonGroup_4"/>
- <buttongroup name="buttonGroup_5"/>
- <buttongroup name="buttonGroup_6"/>
- <buttongroup name="buttonGroup_7"/>
- <buttongroup name="buttonGroup_8"/>
- <buttongroup name="buttonGroup_9"/>
+ <buttongroup name="buttonGroup_2"/>
</buttongroups>
</ui>