Commit ea043f3c authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

add simplified session config

this allows some basic stuff to be configured for KWrite

e.g. should it close on last document, how many recent files
and when to clear meta info

as requested in

BUG: 448786
BUG: 438783

overall menu consistency is fixed, too

BUG: 425061
parent 7f014b34
......@@ -57,12 +57,7 @@ KateConfigDialog::KateConfigDialog(KateMainWindow *parent)
// second: add out own config pages
// this includes all plugin config pages, added to the bottom
addBehaviorPage();
// no sessons for KWrite
if (KateApp::isKate()) {
addSessionPage();
}
addSessionPage();
addFeedbackPage();
// no plugins for KWrite
......@@ -254,6 +249,16 @@ void KateConfigDialog::addSessionPage()
sessionConfigUi.stashUnsavedFilesChanges->setChecked(KateApp::self()->stashManager()->stashUnsavedChanges());
connect(sessionConfigUi.stashNewUnsavedFiles, &QRadioButton::toggled, this, &KateConfigDialog::slotChanged);
connect(sessionConfigUi.stashUnsavedFilesChanges, &QRadioButton::toggled, this, &KateConfigDialog::slotChanged);
// simplify the session page for KWrite
if (KateApp::isKWrite()) {
sessionConfigUi.gbAppStartup->hide();
sessionConfigUi.restoreVC->hide();
sessionConfigUi.label_4->hide();
sessionConfigUi.stashNewUnsavedFiles->hide();
sessionConfigUi.stashUnsavedFilesChanges->hide();
sessionConfigUi.label->hide();
}
}
void KateConfigDialog::addPluginsPage()
......@@ -360,36 +365,33 @@ void KateConfigDialog::slotApply()
if (m_dataChanged) {
KConfigGroup cg = KConfigGroup(config, "General");
// simpler config for KWrite
if (KateApp::isKate()) {
cg.writeEntry("Restore Window Configuration", sessionConfigUi.restoreVC->isChecked());
cg.writeEntry("Restore Window Configuration", sessionConfigUi.restoreVC->isChecked());
cg.writeEntry("Recent File List Entry Count", sessionConfigUi.spinBoxRecentFilesCount->value());
cg.writeEntry("Recent File List Entry Count", sessionConfigUi.spinBoxRecentFilesCount->value());
if (sessionConfigUi.startNewSessionRadioButton->isChecked()) {
cg.writeEntry("Startup Session", "new");
} else if (sessionConfigUi.loadLastUserSessionRadioButton->isChecked()) {
cg.writeEntry("Startup Session", "last");
} else {
cg.writeEntry("Startup Session", "manual");
}
if (sessionConfigUi.startNewSessionRadioButton->isChecked()) {
cg.writeEntry("Startup Session", "new");
} else if (sessionConfigUi.loadLastUserSessionRadioButton->isChecked()) {
cg.writeEntry("Startup Session", "last");
} else {
cg.writeEntry("Startup Session", "manual");
}
cg.writeEntry("Save Meta Infos", sessionConfigUi.saveMetaInfos->isChecked());
KateApp::self()->documentManager()->setSaveMetaInfos(sessionConfigUi.saveMetaInfos->isChecked());
cg.writeEntry("Save Meta Infos", sessionConfigUi.saveMetaInfos->isChecked());
KateApp::self()->documentManager()->setSaveMetaInfos(sessionConfigUi.saveMetaInfos->isChecked());
cg.writeEntry("Days Meta Infos", sessionConfigUi.daysMetaInfos->value());
KateApp::self()->documentManager()->setDaysMetaInfos(sessionConfigUi.daysMetaInfos->value());
cg.writeEntry("Days Meta Infos", sessionConfigUi.daysMetaInfos->value());
KateApp::self()->documentManager()->setDaysMetaInfos(sessionConfigUi.daysMetaInfos->value());
cg.writeEntry("Close After Last", sessionConfigUi.modCloseAfterLast->isChecked());
m_mainWindow->setModCloseAfterLast(sessionConfigUi.modCloseAfterLast->isChecked());
cg.writeEntry("Close After Last", sessionConfigUi.modCloseAfterLast->isChecked());
m_mainWindow->setModCloseAfterLast(sessionConfigUi.modCloseAfterLast->isChecked());
cg.writeEntry("Show output view for message type", m_messageTypes->currentIndex());
cg.writeEntry("Show output view for message type", m_messageTypes->currentIndex());
cg.writeEntry("Stash unsaved file changes", sessionConfigUi.stashUnsavedFilesChanges->isChecked());
KateApp::self()->stashManager()->setStashUnsavedChanges(sessionConfigUi.stashUnsavedFilesChanges->isChecked());
cg.writeEntry("Stash new unsaved files", sessionConfigUi.stashNewUnsavedFiles->isChecked());
KateApp::self()->stashManager()->setStashNewUnsavedFiles(sessionConfigUi.stashNewUnsavedFiles->isChecked());
}
cg.writeEntry("Stash unsaved file changes", sessionConfigUi.stashUnsavedFilesChanges->isChecked());
KateApp::self()->stashManager()->setStashUnsavedChanges(sessionConfigUi.stashUnsavedFilesChanges->isChecked());
cg.writeEntry("Stash new unsaved files", sessionConfigUi.stashNewUnsavedFiles->isChecked());
KateApp::self()->stashManager()->setStashNewUnsavedFiles(sessionConfigUi.stashNewUnsavedFiles->isChecked());
cg.writeEntry("Modified Notification", m_modNotifications->isChecked());
m_mainWindow->setModNotificationEnabled(m_modNotifications->isChecked());
......
......@@ -85,10 +85,10 @@
<item>
<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>
<string>If enabled, the application 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>
<string>Close the application entirely when the last file is closed</string>
</property>
</widget>
</item>
......@@ -144,7 +144,7 @@
<item>
<widget class="QCheckBox" name="restoreVC">
<property name="whatsThis">
<string>Check this if you want all your views and frames restored each time you open Kate.</string>
<string>Check this if you want all your views and frames restored each time you open the application.</string>
</property>
<property name="text">
<string>Include &amp;window configuration</string>
......
Supports Markdown
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