Commit b16b597b authored by Christoph Cullmann's avatar Christoph Cullmann 🐮

move shutdown behavior to session page, like startup behavior

parent 99f4e681
......@@ -96,15 +96,6 @@ void KateConfigDialog::addBehaviorPage()
vbox->addWidget(m_modNotifications);
// Closing last file closes Kate
m_modCloseAfterLast = new QCheckBox(i18n("Close Kate entirely when the last file is closed"), buttonGroup);
m_modCloseAfterLast->setChecked(m_mainWindow->modCloseAfterLast());
m_modCloseAfterLast->setWhatsThis(
i18n("If enabled, Kate will shutdown when the last file being edited is closed, "
"otherwise a blank page will open so that you can start a new file."));
connect(m_modCloseAfterLast, &QCheckBox::toggled, this, &KateConfigDialog::slotChanged);
vbox->addWidget(m_modCloseAfterLast);
buttonGroup->setLayout(vbox);
// quick search
......@@ -200,6 +191,10 @@ void KateConfigDialog::addSessionPage()
connect(sessionConfigUi.startNewSessionRadioButton, &QRadioButton::toggled, this, &KateConfigDialog::slotChanged);
connect(sessionConfigUi.loadLastUserSessionRadioButton, &QRadioButton::toggled, this, &KateConfigDialog::slotChanged);
connect(sessionConfigUi.manuallyChooseSessionRadioButton, &QRadioButton::toggled, this, &KateConfigDialog::slotChanged);
// Closing last file closes Kate
sessionConfigUi.modCloseAfterLast->setChecked(m_mainWindow->modCloseAfterLast());
connect(sessionConfigUi.modCloseAfterLast, &QCheckBox::toggled, this, &KateConfigDialog::slotChanged);
}
void KateConfigDialog::addPluginsPage()
......@@ -355,8 +350,8 @@ void KateConfigDialog::slotApply()
cg.writeEntry("Modified Notification", m_modNotifications->isChecked());
m_mainWindow->setModNotificationEnabled(m_modNotifications->isChecked());
cg.writeEntry("Close After Last", m_modCloseAfterLast->isChecked());
m_mainWindow->setModCloseAfterLast(m_modCloseAfterLast->isChecked());
cg.writeEntry("Close After Last", sessionConfigUi.modCloseAfterLast->isChecked());
m_mainWindow->setModCloseAfterLast(sessionConfigUi.modCloseAfterLast->isChecked());
cg.writeEntry("Quick Open Search Mode", m_cmbQuickOpenMatchMode->currentData().toInt());
m_mainWindow->setQuickOpenMatchMode(m_cmbQuickOpenMatchMode->currentData().toInt());
......
......@@ -81,7 +81,6 @@ private:
bool m_dataChanged = false;
QCheckBox *m_modNotifications;
QCheckBox *m_modCloseAfterLast;
QComboBox *m_cmbQuickOpenMatchMode;
QComboBox *m_cmbQuickOpenListMode;
QSpinBox *m_tabLimit;
......
......@@ -12,43 +12,50 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGroupBox" name="saveMetaInfos">
<property name="whatsThis">
<string>Check this if you want document configuration like for example bookmarks to be saved past editor sessions. The configuration will be restored if the document has not changed when reopened.</string>
</property>
<widget class="QGroupBox" name="gbAppStartup">
<property name="title">
<string>Keep &amp;meta-information past sessions</string>
<string>Application Startup Behavior</string>
</property>
<property name="checkable">
<bool>true</bool>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="startNewSessionRadioButton">
<property name="text">
<string>&amp;Start new session</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="loadLastUserSessionRadioButton">
<property name="text">
<string>&amp;Load last used session</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="manuallyChooseSessionRadioButton">
<property name="text">
<string>&amp;Manually choose a session</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Application Shutdown Behavior</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>&amp;Delete unused meta-information after:</string>
</property>
</widget>
</item>
<item>
<widget class="KPluralHandlingSpinBox" name="daysMetaInfos"/>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="QCheckBox" name="modCloseAfterLast">
<property name="whatsThis">
<string>If enabled, Kate will shutdown when the last file being edited is closed, otherwise a blank page will open so that you can start a new file.</string>
</property>
<property name="text">
<string>Close Kate entirely when the last file is closed</string>
</property>
</widget>
</item>
</layout>
</widget>
......@@ -113,31 +120,43 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gbAppStartup">
<widget class="QGroupBox" name="saveMetaInfos">
<property name="whatsThis">
<string>Check this if you want document configuration like for example bookmarks to be saved past editor sessions. The configuration will be restored if the document has not changed when reopened.</string>
</property>
<property name="title">
<string>Behaviour on Application Startup</string>
<string>Keep &amp;meta-information past sessions</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QRadioButton" name="startNewSessionRadioButton">
<property name="text">
<string>&amp;Start new session</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="loadLastUserSessionRadioButton">
<property name="text">
<string>&amp;Load last used session</string>
</property>
</widget>
</item>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QRadioButton" name="manuallyChooseSessionRadioButton">
<property name="text">
<string>&amp;Manually choose a session</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>&amp;Delete unused meta-information after:</string>
</property>
</widget>
</item>
<item>
<widget class="KPluralHandlingSpinBox" name="daysMetaInfos"/>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment