25 #include "resourceselector.moc"
35 #include "alarmresources.h"
45 #include <akonadi/agentmanager.h>
46 #include <akonadi/agentinstancecreatejob.h>
47 #include <akonadi/agenttype.h>
48 #include <akonadi/collectionpropertiesdialog.h>
49 #include <akonadi/entitydisplayattribute.h>
51 #include <kcal/resourcecalendar.h>
57 #include <kcombobox.h>
58 #include <kinputdialog.h>
62 #include <kactioncollection.h>
64 #include <ktoggleaction.h>
65 #include <kcolordialog.h>
69 #include <QPushButton>
73 #include <QResizeEvent>
74 #include <QApplication>
77 using namespace KCalCore;
82 using namespace Akonadi;
97 mActionShowDetails(0),
99 mActionClearColour(0),
111 QBoxLayout* topLayout =
new QVBoxLayout(
this);
112 topLayout->setMargin(KDialog::spacingHint());
114 QLabel* label =
new QLabel(i18nc(
"@title:group",
"Calendars"),
this);
115 topLayout->addWidget(label, 0, Qt::AlignHCenter);
118 mAlarmType->addItem(i18nc(
"@item:inlistbox",
"Active Alarms"));
119 mAlarmType->addItem(i18nc(
"@item:inlistbox",
"Archived Alarms"));
120 mAlarmType->addItem(i18nc(
"@item:inlistbox",
"Alarm Templates"));
121 mAlarmType->setFixedHeight(mAlarmType->sizeHint().height());
122 mAlarmType->setWhatsThis(i18nc(
"@info:whatsthis",
"Choose which type of data to show alarm calendars for"));
123 topLayout->addWidget(mAlarmType);
133 mListView->setModel(filterModel);
135 connect(mListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(selectionChanged()));
136 mListView->setContextMenuPolicy(Qt::CustomContextMenu);
137 connect(mListView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(contextMenuRequested(QPoint)));
138 mListView->setWhatsThis(i18nc(
"@info:whatsthis",
139 "List of available calendars of the selected type. The checked state shows whether a calendar "
140 "is enabled (checked) or disabled (unchecked). The default calendar is shown in bold."));
141 topLayout->addWidget(mListView, 1);
142 topLayout->addSpacing(KDialog::spacingHint());
145 blayout->setMargin(0);
146 blayout->setSpacing(KDialog::spacingHint());
147 topLayout->addLayout(blayout);
149 mAddButton =
new QPushButton(i18nc(
"@action:button",
"Add..."),
this);
150 mEditButton =
new QPushButton(i18nc(
"@action:button",
"Edit..."),
this);
151 mDeleteButton =
new QPushButton(i18nc(
"@action:button",
"Remove"),
this);
152 blayout->addWidget(mAddButton);
153 blayout->addWidget(mEditButton);
154 blayout->addWidget(mDeleteButton);
155 mEditButton->setWhatsThis(i18nc(
"@info:whatsthis",
"Edit the highlighted calendar"));
156 mDeleteButton->setWhatsThis(i18nc(
"@info:whatsthis",
"<para>Remove the highlighted calendar from the list.</para>"
157 "<para>The calendar itself is left intact, and may subsequently be reinstated in the list if desired.</para>"));
158 mEditButton->setDisabled(
true);
159 mDeleteButton->setDisabled(
true);
160 connect(mAddButton, SIGNAL(clicked()), SLOT(addResource()));
161 connect(mEditButton, SIGNAL(clicked()), SLOT(editResource()));
162 connect(mDeleteButton, SIGNAL(clicked()), SLOT(removeResource()));
166 SLOT(slotCollectionAdded(Akonadi::Collection)));
168 connect(mCalendar, SIGNAL(resourceStatusChanged(AlarmResource*,AlarmResources::Change)), SLOT(slotStatusChanged(AlarmResource*,AlarmResources::Change)));
171 connect(mAlarmType, SIGNAL(activated(
int)), SLOT(alarmTypeSelected()));
172 QTimer::singleShot(0,
this, SLOT(alarmTypeSelected()));
174 Preferences::connect(SIGNAL(archivedKeepDaysChanged(
int)),
this, SLOT(archiveDaysChanged(
int)));
182 void ResourceSelector::alarmTypeSelected()
185 switch (mAlarmType->currentIndex())
188 mCurrentAlarmType = CalEvent::ACTIVE;
189 addTip = i18nc(
"@info:tooltip",
"Add a new active alarm calendar");
192 mCurrentAlarmType = CalEvent::ARCHIVED;
193 addTip = i18nc(
"@info:tooltip",
"Add a new archived alarm calendar");
196 mCurrentAlarmType = CalEvent::TEMPLATE;
197 addTip = i18nc(
"@info:tooltip",
"Add a new alarm template calendar");
202 mListView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
203 mListView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
205 mListView->collectionModel()->setEventTypeFilter(mCurrentAlarmType);
209 mAddButton->setWhatsThis(addTip);
210 mAddButton->setToolTip(addTip);
212 QTimer::singleShot(0,
this, SLOT(reinstateAlarmTypeScrollBars()));
232 void ResourceSelector::reinstateAlarmTypeScrollBars()
234 mListView->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
235 mListView->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
241 void ResourceSelector::addResource()
249 AlarmResourceManager* manager = mCalendar->resourceManager();
250 QStringList descs = manager->resourceTypeDescriptions();
252 QString desc = KInputDialog::getItem(i18nc(
"@title:window",
"Calendar Configuration"),
253 i18nc(
"@info",
"Select storage type of new calendar:"), descs, 0,
false, &ok,
this);
254 if (!ok || descs.isEmpty())
256 QString type = manager->resourceTypeNames()[descs.indexOf(desc)];
257 AlarmResource* resource =
dynamic_cast<AlarmResource*
>(manager->createResource(type));
260 KAMessageBox::error(
this, i18nc(
"@info",
"Unable to create calendar of type <resource>%1</resource>.", type));
263 resource->setResourceName(i18nc(
"@info/plain",
"%1 calendar", type));
264 resource->setAlarmType(mCurrentAlarmType);
265 resource->setActive(
false);
271 if (dlg->exec() == QDialog::Accepted)
273 resource->setEnabled(
true);
275 manager->add(resource);
276 manager->writeConfig();
277 mCalendar->resourceAdded(resource);
308 void ResourceSelector::slotCollectionAdded(
const Collection& collection)
310 if (collection.isValid())
312 AgentInstance agent = AgentManager::self()->instance(collection.resource());
315 int i = mAddAgents.indexOf(agent);
319 CalEvent::Types types = CalEvent::types(collection.contentMimeTypes());
321 if (!(types & mCurrentAlarmType))
327 if (types & CalEvent::ACTIVE)
329 else if (types & CalEvent::ARCHIVED)
331 else if (types & CalEvent::TEMPLATE)
335 mAlarmType->setCurrentIndex(index);
339 mAddAgents.removeAt(i);
349 void ResourceSelector::editResource()
352 Collection collection = currentResource();
353 if (collection.isValid())
355 AgentInstance instance = AgentManager::self()->instance(collection.resource());
356 if (instance.isValid())
357 instance.configure(
this);
360 AlarmResource* resource = currentResource();
363 bool readOnly = resource->readOnly();
368 if (dlg->exec() == QDialog::Accepted)
372 if (!readOnly && resource->readOnly() && resource->standardResource())
375 if (resource->alarmType() == CalEvent::ACTIVE)
377 KAMessageBox::sorry(
this, i18nc(
"@info",
"You cannot make your default active alarm calendar read-only."));
378 resource->setReadOnly(
false);
384 KAMessageBox::sorry(
this, i18nc(
"@info",
"You cannot make your default archived alarm calendar "
385 "read-only while expired alarms are configured to be kept."));
386 resource->setReadOnly(
false);
389 == KMessageBox::Cancel)
391 resource->setReadOnly(
false);
403 void ResourceSelector::updateResource()
405 Collection collection = currentResource();
406 if (!collection.isValid())
416 void ResourceSelector::removeResource()
419 Collection collection = currentResource();
420 if (!collection.isValid())
422 QString name = collection.name();
426 CalEvent::Type currentType = currentResourceType();
427 CalEvent::Type stdType = (standardTypes & CalEvent::ACTIVE) ? CalEvent::ACTIVE
428 : (standardTypes & CalEvent::ARCHIVED) ? CalEvent::ARCHIVED
431 AlarmResource* resource = currentResource();
434 QString name = resource->resourceName();
435 bool std = resource->standardResource();
437 CalEvent::Type stdType = std ? resource->alarmType() : CalEvent::EMPTY;
439 if (stdType == CalEvent::ACTIVE)
441 KAMessageBox::sorry(
this, i18nc(
"@info",
"You cannot remove your default active alarm calendar."));
448 KAMessageBox::sorry(
this, i18nc(
"@info",
"You cannot remove your default archived alarm calendar "
449 "while expired alarms are configured to be kept."));
457 if (allTypes != currentType)
462 CalEvent::Types nonStandardTypes(allTypes & ~standardTypes);
463 if (nonStandardTypes != currentType)
465 text = i18nc(
"@info",
"<para><resource>%1</resource> is the default calendar for:%2</para>%3"
466 "<para>Do you really want to remove it from all calendar lists?</para>", name, stdTypes, otherTypes);
469 text = i18nc(
"@info",
"Do you really want to remove your default calendar (<resource>%1</resource>) from the list?", name);
471 else if (allTypes != currentType)
472 text = i18nc(
"@info",
"<para><resource>%1</resource> contains:%2</para><para>Do you really want to remove it from all calendar lists?</para>",
475 text = i18nc(
"@info",
"Do you really want to remove the calendar <resource>%1</resource> from the list?", name);
477 QString text = std ? i18nc(
"@info",
"Do you really want to remove your default calendar (<resource>%1</resource>) from the list?", name)
478 : i18nc(
"@info",
"Do you really want to remove the calendar <resource>%1</resource> from the list?", name);
488 if (resource->alarmType() == CalEvent::TEMPLATE)
493 AlarmResourceManager* manager = mCalendar->resourceManager();
494 manager->remove(resource);
495 manager->writeConfig();
503 void ResourceSelector::selectionChanged()
505 bool state = mListView->selectionModel()->selectedRows().count();
506 mDeleteButton->setEnabled(state);
507 mEditButton->setEnabled(state);
515 mActionReload =
new KAction(KIcon(QLatin1String(
"view-refresh")), i18nc(
"@action Reload calendar",
"Re&load"),
this);
516 actions->addAction(QLatin1String(
"resReload"), mActionReload);
517 connect(mActionReload, SIGNAL(triggered(
bool)), SLOT(reloadResource()));
519 mActionSave =
new KAction(KIcon(QLatin1String(
"document-save")), i18nc(
"@action",
"&Save"),
this);
520 actions->addAction(QLatin1String(
"resSave"), mActionSave);
521 connect(mActionSave, SIGNAL(triggered(
bool)), SLOT(saveResource()));
523 mActionShowDetails =
new KAction(KIcon(QLatin1String(
"help-about")), i18nc(
"@action",
"Show &Details"),
this);
524 actions->addAction(QLatin1String(
"resDetails"), mActionShowDetails);
525 connect(mActionShowDetails, SIGNAL(triggered(
bool)), SLOT(showInfo()));
526 mActionSetColour =
new KAction(KIcon(QLatin1String(
"color-picker")), i18nc(
"@action",
"Set &Color..."),
this);
527 actions->addAction(QLatin1String(
"resSetColour"), mActionSetColour);
528 connect(mActionSetColour, SIGNAL(triggered(
bool)), SLOT(setColour()));
529 mActionClearColour =
new KAction(i18nc(
"@action",
"Clear C&olor"),
this);
530 actions->addAction(QLatin1String(
"resClearColour"), mActionClearColour);
531 connect(mActionClearColour, SIGNAL(triggered(
bool)), SLOT(clearColour()));
532 mActionEdit =
new KAction(KIcon(QLatin1String(
"document-properties")), i18nc(
"@action",
"&Edit..."),
this);
533 actions->addAction(QLatin1String(
"resEdit"), mActionEdit);
534 connect(mActionEdit, SIGNAL(triggered(
bool)), SLOT(editResource()));
536 mActionUpdate =
new KAction(i18nc(
"@action",
"&Update Calendar Format"),
this);
537 actions->addAction(QLatin1String(
"resUpdate"), mActionUpdate);
538 connect(mActionUpdate, SIGNAL(triggered(
bool)), SLOT(updateResource()));
540 mActionRemove =
new KAction(KIcon(QLatin1String(
"edit-delete")), i18nc(
"@action",
"&Remove"),
this);
541 actions->addAction(QLatin1String(
"resRemove"), mActionRemove);
542 connect(mActionRemove, SIGNAL(triggered(
bool)), SLOT(removeResource()));
543 mActionSetDefault =
new KToggleAction(
this);
544 actions->addAction(QLatin1String(
"resDefault"), mActionSetDefault);
545 connect(mActionSetDefault, SIGNAL(triggered(
bool)), SLOT(setStandard()));
546 QAction* action =
new KAction(KIcon(QLatin1String(
"document-new")), i18nc(
"@action",
"&Add..."),
this);
547 actions->addAction(QLatin1String(
"resAdd"), action);
548 connect(action, SIGNAL(triggered(
bool)), SLOT(addResource()));
549 mActionImport =
new KAction(i18nc(
"@action",
"Im&port..."),
this);
550 actions->addAction(QLatin1String(
"resImport"), mActionImport);
551 connect(mActionImport, SIGNAL(triggered(
bool)), SLOT(importCalendar()));
552 mActionExport =
new KAction(i18nc(
"@action",
"E&xport..."),
this);
553 actions->addAction(QLatin1String(
"resExport"), mActionExport);
554 connect(mActionExport, SIGNAL(triggered(
bool)), SLOT(exportCalendar()));
565 void ResourceSelector::contextMenuRequested(
const QPoint& viewportPos)
570 bool writable =
false;
572 bool updatable =
false;
573 Collection collection;
575 AlarmResource* resource = 0;
577 if (mListView->selectionModel()->hasSelection())
579 QModelIndex index = mListView->indexAt(viewportPos);
582 collection = mListView->collectionModel()->collection(index);
587 mListView->clearSelection();
589 CalEvent::Type type = currentResourceType();
591 bool haveCalendar = collection.isValid();
593 bool haveCalendar = resource;
600 KACalendar::Compat compatibility;
604 && (compatibility & ~KACalendar::Converted)
605 && !(compatibility & ~(KACalendar::Convertible | KACalendar::Converted)))
608 type = CalEvent::EMPTY;
610 active = resource->isEnabled();
611 type = resource->alarmType();
612 writable = resource->writable();
615 mActionReload->setEnabled(active);
616 mActionShowDetails->setEnabled(haveCalendar);
617 mActionSetColour->setEnabled(haveCalendar);
618 mActionClearColour->setEnabled(haveCalendar);
622 mActionClearColour->setVisible(resource && resource->colour().isValid());
623 mActionSave->setEnabled(active && writable);
625 mActionEdit->setEnabled(haveCalendar);
627 mActionUpdate->setEnabled(updatable);
629 mActionRemove->setEnabled(haveCalendar);
630 mActionImport->setEnabled(active && writable);
631 mActionExport->setEnabled(active);
635 case CalEvent::ACTIVE: text = i18nc(
"@action",
"Use as &Default for Active Alarms");
break;
636 case CalEvent::ARCHIVED: text = i18nc(
"@action",
"Use as &Default for Archived Alarms");
break;
637 case CalEvent::TEMPLATE: text = i18nc(
"@action",
"Use as &Default for Alarm Templates");
break;
640 mActionSetDefault->setText(text);
644 bool standard = (resource && resource == mCalendar->getStandardResource(static_cast<CalEvent::Type>(type)) && resource->standardResource());
646 mActionSetDefault->setChecked(active && writable && standard);
647 mActionSetDefault->setEnabled(active && writable);
648 mContextMenu->popup(mListView->viewport()->mapToGlobal(viewportPos));
654 void ResourceSelector::reloadResource()
657 Collection collection = currentResource();
658 if (collection.isValid())
661 AlarmResource* resource = currentResource();
670 void ResourceSelector::saveResource()
675 AlarmResource* resource = currentResource();
686 void ResourceSelector::archiveDaysChanged(
int days)
694 if (cols.count() == 1)
697 theApp()->purgeNewArchivedDefault(cols[0]);
701 AlarmResources* resources = AlarmResources::instance();
702 AlarmResource* std = resources->getStandardResource(CalEvent::ARCHIVED);
703 if (std && !std->standardResource())
704 resources->setStandardResource(std);
713 void ResourceSelector::setStandard()
716 Collection collection = currentResource();
717 if (collection.isValid())
719 CalEvent::Type alarmType = currentResourceType();
720 bool standard = mActionSetDefault->isChecked();
724 if (alarmType == CalEvent::ARCHIVED)
725 theApp()->purgeNewArchivedDefault(collection);
728 AlarmResource* resource = currentResource();
731 if (mActionSetDefault->isChecked())
733 resource->setEnabled(
true);
734 mCalendar->setStandardResource(resource);
737 resource->setStandardResource(
false);
746 void ResourceSelector::slotStatusChanged(AlarmResource* resource, AlarmResources::Change change)
748 if (change == AlarmResources::WrongType && resource->isWrongAlarmType())
751 switch (resource->alarmType())
753 case CalEvent::ACTIVE:
754 text = i18nc(
"@info/plain",
"It is not an active alarm calendar.");
756 case CalEvent::ARCHIVED:
757 text = i18nc(
"@info/plain",
"It is not an archived alarm calendar.");
759 case CalEvent::TEMPLATE:
760 text = i18nc(
"@info/plain",
"It is not an alarm template calendar.");
765 KAMessageBox::sorry(
this, i18nc(
"@info",
"<para>Calendar <resource>%1</resource> has been disabled:</para><para>%2</para>", resource->resourceName(),
text));
774 void ResourceSelector::importCalendar()
777 Collection collection = currentResource();
788 void ResourceSelector::exportCalendar()
791 Collection calendar = currentResource();
792 if (calendar.isValid())
794 AlarmResource* calendar = currentResource();
803 void ResourceSelector::setColour()
806 Collection collection = currentResource();
807 if (collection.isValid())
810 if (!colour.isValid())
811 colour = QApplication::palette().color(QPalette::Base);
812 if (KColorDialog::getColor(colour, QColor(),
this) == KColorDialog::Accepted)
816 AlarmResource* resource = currentResource();
819 QColor colour = resource->colour();
820 if (!colour.isValid())
821 colour = QApplication::palette().color(QPalette::Base);
822 if (KColorDialog::getColor(colour, QColor(),
this) == KColorDialog::Accepted)
823 resource->setColour(colour);
832 void ResourceSelector::clearColour()
835 Collection collection = currentResource();
836 if (collection.isValid())
839 AlarmResource* resource = currentResource();
841 resource->setColour(QColor());
848 void ResourceSelector::showInfo()
851 Collection collection = currentResource();
852 if (collection.isValid())
854 const QString name = collection.displayName();
855 QString
id = collection.resource();
856 CalEvent::Type alarmType = currentResourceType();
857 QString calType = AgentManager::self()->instance(
id).type().name();
859 QString location = collection.remoteId();
861 if (url.isLocalFile())
862 location = url.path();
864 QStringList alarmTypes;
865 if (altypes & CalEvent::ACTIVE)
866 alarmTypes << i18nc(
"@info/plain",
"Active alarms");
867 if (altypes & CalEvent::ARCHIVED)
868 alarmTypes << i18nc(
"@info/plain",
"Archived alarms");
869 if (altypes & CalEvent::TEMPLATE)
870 alarmTypes << i18nc(
"@info/plain",
"Alarm templates");
871 QString alarmTypeString = alarmTypes.join(i18nc(
"@info/plain List separator",
", "));
872 KACalendar::Compat compat;
875 perms = i18nc(
"@info/plain",
"Read-write");
877 ? i18nc(
"@info/plain",
"Enabled")
878 : i18nc(
"@info/plain",
"Disabled");
880 ? i18nc(
"@info/plain Parameter in 'Default calendar: Yes/No'",
"Yes")
881 : i18nc(
"@info/plain Parameter in 'Default calendar: Yes/No'",
"No");
882 QString text = i18nc(
"@info",
885 "Calendar type: %3<nl/>"
887 "%5: <filename>%6</filename><nl/>"
888 "Permissions: %7<nl/>"
890 "Default calendar: %9</para>",
891 name,
id, calType, alarmTypeString, storage, location, perms, enabled, std);
897 AlarmResource* resource = currentResource();
911 Collection ResourceSelector::currentResource()
const
913 return mListView->collection(mListView->selectionModel()->currentIndex());
916 AlarmResource* ResourceSelector::currentResource()
const
918 return mListView->resource(mListView->selectionModel()->currentIndex());
925 CalEvent::Type ResourceSelector::currentResourceType()
const
927 switch (mAlarmType->currentIndex())
929 case 0:
return CalEvent::ACTIVE;
930 case 1:
return CalEvent::ARCHIVED;
931 case 2:
return CalEvent::TEMPLATE;
932 default:
return CalEvent::EMPTY;
938 emit resized(re->oldSize(), re->size());
Akonadi::AgentInstance agentInstance() const
static Akonadi::Collection getStandard(CalEvent::Type, bool useDefault=false)
Return the standard collection for a specified mime type.
static QString readOnlyTooltip(const Akonadi::Collection &)
Return the read-only status tooltip for a collection.
static EventListModel * alarms()
static bool importAlarms(QWidget *, AlarmResource *=0)
virtual void resizeEvent(QResizeEvent *)
static void setStandard(Akonadi::Collection &, CalEvent::Type, bool standard)
Set or clear a collection as the standard collection for a specified mime type.
static int isWritableEnabled(const Akonadi::Collection &, CalEvent::Type)
Return whether a collection is both enabled and fully writable for a given alarm type, i.e.
void removeResource(AlarmResource *)
virtual QByteArray text(quint32 serialNumber) const =0
void loadResource(AlarmResource *, QWidget *parent)
static AlarmCalendar * resources()
static void updateToCurrentFormat(const Akonadi::Collection &, bool ignoreKeepFormat, QWidget *parent)
static void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Options(Notify|WindowModal))
static bool isStandard(Akonadi::Collection &, CalEvent::Type)
Return whether a collection is the standard collection for a specified mime type. ...
bool refresh(Akonadi::Collection &) const
Refresh the specified collection instance with up to date data.
static int archivedKeepDays()
Get Days to keep expired alarms.
QString storageType(const Akonadi::Collection &) const
Return the storage type (file/directory/URL etc.) for a collection.
static bool isEnabled(const Akonadi::Collection &, CalEvent::Type)
Return whether a collection is enabled (and valid).
static QString typeListForDisplay(CalEvent::Types)
Return a bulleted list of alarm types for inclusion in an i18n message.
the KAlarm application object
static ResourceModel * instance(QObject *parent=0)
static KTimeZone timeZone(bool reload=false)
static AkonadiModel * instance()
static CalEvent::Types standardTypes(const Akonadi::Collection &, bool useDefault=false)
Return the alarm type(s) for which a collection is the standard collection.
bool removeCollection(const Akonadi::Collection &)
Remove a collection from Akonadi.
bool reloadCollection(const Akonadi::Collection &)
Reload a collection's data from Akonadi storage (not from the backend).
static void connect(const char *signal, const QObject *receiver, const char *member)
static Akonadi::Collection::List enabledCollections(CalEvent::Type, bool writable)
Return the enabled collections which contain a specified mime type.
static EventListModel * templates()
ResourceSelector(AlarmResources *, QWidget *parent=0)
static CalEvent::Types types(const Akonadi::Collection &)
static int warningContinueCancel(QWidget *parent, ButtonCode defaultButton, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const QString &dontAskAgainName=QString())
static void sorry(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Options(Notify|WindowModal))
void initActions(KActionCollection *)
void setBackgroundColor(Akonadi::Collection &, const QColor &)
Set the background color for a collection and its alarms.
void removeResource(AlarmResource *)
static bool exportAlarms(const KAEvent::List &, QWidget *parent)
void setContextMenu(KMenu *)
QColor backgroundColor(Akonadi::Collection &) const
Get the background color for a collection and its alarms.
static void information(QWidget *parent, const QString &text, const QString &caption=QString(), const QString &dontShowAgainName=QString(), Options options=Options(Notify|WindowModal))
static CalEvent::Types setEnabled(const Akonadi::Collection &, CalEvent::Types, bool enabled)
Enable or disable a collection (if it is valid) for specified alarm types.