Changeset View
Changeset View
Standalone View
Standalone View
kate/kateconfigdialog.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 54 | { | |||
---|---|---|---|---|---|
91 | m_modNotifications->setWhatsThis(i18n( | 91 | m_modNotifications->setWhatsThis(i18n( | ||
92 | "If enabled, when Kate receives focus you will be asked what to do with " | 92 | "If enabled, when Kate receives focus you will be asked what to do with " | ||
93 | "files that have been modified on the hard disk. If not enabled, you will " | 93 | "files that have been modified on the hard disk. If not enabled, you will " | ||
94 | "be asked what to do with a file that has been modified on the hard disk only " | 94 | "be asked what to do with a file that has been modified on the hard disk only " | ||
95 | "when that file is tried to be saved.")); | 95 | "when that file is tried to be saved.")); | ||
96 | connect(m_modNotifications, &QCheckBox::toggled, this, &KateConfigDialog::slotChanged); | 96 | connect(m_modNotifications, &QCheckBox::toggled, this, &KateConfigDialog::slotChanged); | ||
97 | 97 | | |||
98 | vbox->addWidget(m_modNotifications); | 98 | vbox->addWidget(m_modNotifications); | ||
99 | | ||||
100 | // Closing last file closes Kate | ||||
101 | m_modCloseAfterLast = new QCheckBox( | ||||
102 | i18n("Close Kate entirely when the last file is closed"), buttonGroup); | ||||
103 | m_modCloseAfterLast->setChecked(parent->modCloseAfterLast()); | ||||
104 | m_modCloseAfterLast->setWhatsThis(i18n( | ||||
105 | "If enabled, Kate will shutdown when the last file being edited is closed, " | ||||
106 | "otherwise a blank page will open so that you can start a new file.")); | ||||
107 | connect(m_modCloseAfterLast, &QCheckBox::toggled, this, &KateConfigDialog::slotChanged); | ||||
108 | | ||||
109 | vbox->addWidget(m_modCloseAfterLast); | ||||
99 | buttonGroup->setLayout(vbox); | 110 | buttonGroup->setLayout(vbox); | ||
100 | 111 | | |||
101 | // GROUP with the one below: "Meta-information" | 112 | // GROUP with the one below: "Meta-information" | ||
102 | buttonGroup = new QGroupBox(i18n("Meta-Information"), generalFrame); | 113 | buttonGroup = new QGroupBox(i18n("Meta-Information"), generalFrame); | ||
103 | vbox = new QVBoxLayout; | 114 | vbox = new QVBoxLayout; | ||
104 | layout->addWidget(buttonGroup); | 115 | layout->addWidget(buttonGroup); | ||
105 | 116 | | |||
106 | // save meta infos | 117 | // save meta infos | ||
▲ Show 20 Lines • Show All 208 Lines • ▼ Show 20 Line(s) | 310 | if (m_dataChanged) { | |||
315 | KateApp::self()->documentManager()->setSaveMetaInfos(m_saveMetaInfos->isChecked()); | 326 | KateApp::self()->documentManager()->setSaveMetaInfos(m_saveMetaInfos->isChecked()); | ||
316 | 327 | | |||
317 | cg.writeEntry("Days Meta Infos", m_daysMetaInfos->value()); | 328 | cg.writeEntry("Days Meta Infos", m_daysMetaInfos->value()); | ||
318 | KateApp::self()->documentManager()->setDaysMetaInfos(m_daysMetaInfos->value()); | 329 | KateApp::self()->documentManager()->setDaysMetaInfos(m_daysMetaInfos->value()); | ||
319 | 330 | | |||
320 | cg.writeEntry("Modified Notification", m_modNotifications->isChecked()); | 331 | cg.writeEntry("Modified Notification", m_modNotifications->isChecked()); | ||
321 | m_mainWindow->setModNotificationEnabled(m_modNotifications->isChecked()); | 332 | m_mainWindow->setModNotificationEnabled(m_modNotifications->isChecked()); | ||
322 | 333 | | |||
334 | cg.writeEntry("Close After Last", m_modCloseAfterLast->isChecked()); | ||||
335 | m_mainWindow->setModCloseAfterLast(m_modCloseAfterLast->isChecked()); | ||||
336 | | ||||
323 | // patch document modified warn state | 337 | // patch document modified warn state | ||
324 | const QList<KTextEditor::Document *> &docs = KateApp::self()->documentManager()->documentList(); | 338 | const QList<KTextEditor::Document *> &docs = KateApp::self()->documentManager()->documentList(); | ||
325 | foreach(KTextEditor::Document * doc, docs) | 339 | foreach(KTextEditor::Document * doc, docs) | ||
326 | if (qobject_cast<KTextEditor::ModificationInterface *>(doc)) { | 340 | if (qobject_cast<KTextEditor::ModificationInterface *>(doc)) { | ||
327 | qobject_cast<KTextEditor::ModificationInterface *>(doc)->setModifiedOnDiskWarning(!m_modNotifications->isChecked()); | 341 | qobject_cast<KTextEditor::ModificationInterface *>(doc)->setModifiedOnDiskWarning(!m_modNotifications->isChecked()); | ||
328 | } | 342 | } | ||
329 | 343 | | |||
330 | m_mainWindow->saveOptions(); | 344 | m_mainWindow->saveOptions(); | ||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |