Commit 0b73fd7c authored by Eric Armbruster's avatar Eric Armbruster 🍁 Committed by Christoph Cullmann
Browse files

Rename the show untitled document option

The option is renamed to better match the naming that is used on the
welcome page, so users will not be confused by two totally
different names for one option. Also, there is no need to invert the
checkboxes this way.
parent 20be8ccf
Pipeline #254023 passed with stage
in 15 minutes and 23 seconds
......@@ -569,8 +569,8 @@ void KateConfigDialog::addSessionPage()
connect(sessionConfigUi.manuallyChooseSessionRadioButton, &QRadioButton::toggled, this, &KateConfigDialog::slotChanged);
// New main windows open always a new document if none there
sessionConfigUi.openNewDocumentPerWindow->setChecked(cgGeneral.readEntry("Open untitled document for new window", false));
connect(sessionConfigUi.openNewDocumentPerWindow, &QCheckBox::toggled, this, &KateConfigDialog::slotChanged);
sessionConfigUi.showWelcomeViewForNewWindow->setChecked(cgGeneral.readEntry("Show welcome view for new window", true));
connect(sessionConfigUi.showWelcomeViewForNewWindow, &QCheckBox::toggled, this, &KateConfigDialog::slotChanged);
// When a window is closed, close all documents only visible in that window, too
sessionConfigUi.winClosesDocuments->setChecked(cgGeneral.readEntry("Close documents with window", true));
......@@ -735,7 +735,7 @@ void KateConfigDialog::slotApply()
cg.writeEntry("Days Meta Infos", sessionConfigUi.daysMetaInfos->value());
KateApp::self()->documentManager()->setDaysMetaInfos(sessionConfigUi.daysMetaInfos->value());
cg.writeEntry("Open untitled document for new window", sessionConfigUi.openNewDocumentPerWindow->isChecked());
cg.writeEntry("Show welcome view for new window", sessionConfigUi.showWelcomeViewForNewWindow->isChecked());
cg.writeEntry("Close documents with window", sessionConfigUi.winClosesDocuments->isChecked());
......
......@@ -1628,10 +1628,10 @@ void KateViewManager::showWelcomeViewOrNewDocumentIfNeeded()
// the user can decide: welcome page or a new untitled document for a new window?
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup cgGeneral = KConfigGroup(config, "General");
if (cgGeneral.readEntry("Open untitled document for new window", false)) {
slotDocumentNew();
} else {
if (cgGeneral.readEntry("Show welcome view for new window", true)) {
showWelcomeView();
} else {
slotDocumentNew();
}
triggerActiveViewFocus();
});
......
......@@ -83,9 +83,12 @@
</layout>
</item>
<item>
<widget class="QCheckBox" name="openNewDocumentPerWindow">
<widget class="QCheckBox" name="showWelcomeViewForNewWindow">
<property name="whatsThis">
<string>If disabled, an untitled document will be shown for new windows.</string>
</property>
<property name="text">
<string>Open new window with fresh untitled document</string>
<string>Show welcome view for new windows</string>
</property>
</widget>
</item>
......
......@@ -145,15 +145,15 @@ WelcomeView::WelcomeView(KateViewManager *viewManager, QWidget *parent)
});
}
static const char showForNewWindowKey[] = "Open untitled document for new window";
static const char showForNewWindowKey[] = "Show welcome view for new window";
KConfigGroup configGroup = KSharedConfig::openConfig()->group("General");
checkBoxShowForNewWindow->setChecked(!configGroup.readEntry(showForNewWindowKey, false));
checkBoxShowForNewWindow->setChecked(configGroup.readEntry(showForNewWindowKey, true));
connect(checkBoxShowForNewWindow, &QCheckBox::toggled, this, [configGroup](bool checked) mutable {
configGroup.writeEntry(showForNewWindowKey, !checked);
configGroup.writeEntry(showForNewWindowKey, checked);
});
connect(KateApp::self(), &KateApp::configurationChanged, this, [this, configGroup]() {
checkBoxShowForNewWindow->setChecked(!configGroup.readEntry(showForNewWindowKey, false));
checkBoxShowForNewWindow->setChecked(configGroup.readEntry(showForNewWindowKey, true));
});
updateFonts();
......
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