Commit cea869f3 authored by Allen Winter's avatar Allen Winter
Browse files

incidencedialog.cpp - ask to set a default events folder.

When saving a new event, nag the user to set a default
calendar collection if they don't already have one.
Don't bother if they only have 1 events calendar folder.


Test Plan:
- unset my default calendar.
- set my default calendar.
so far works as expected.

Reviewers: vkrause, dvratil, dfaure, mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision:
parent f0fa6438
......@@ -521,6 +521,28 @@ void IncidenceDialogPrivate::handleItemSaveFinish(EditorItemManager::SaveAction
if ((mEditor->type() == KCalendarCore::Incidence::TypeEvent) &&
(mCalSelector->count() > 1) &&
(CalendarSupport::KCalPrefs::instance()->defaultCalendarId() == -1)) {
const QString collectionName = mCalSelector->currentText();
const QString message =
"<para>You have not set a default calendar for your events yet.</para>"
"<para>Setting a default calendar will make creating new events faster and "
"easier with less chance of filing them into the wrong folder.</para>"
"<para>Would you like to set your default events calendar to "
if (KMessageBox::questionYesNo(q,
i18nc("@title:window", "Set Default Calendar?"),
KStandardGuiItem::yes(), // Make collectionName My Default Calendar
KStandardGuiItem::no(), // Do Not Set a Default Calendar at this Time"
QLatin1String("setDefaultCalendarCollection")) == KMessageBox::Yes) {
if (mCloseOnSave) {
} else {
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