Incidenceeditor

groupwareuidelegate.cpp
1/*
2 SPDX-FileCopyrightText: 2010 Kevin Ottens <ervin@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "groupwareuidelegate.h"
8#include "incidencedialog.h"
9#include "incidencedialogfactory.h"
10#include "incidenceeditor_debug.h"
11
12#include <Akonadi/CalendarUtils>
13#include <Akonadi/Item>
14using namespace IncidenceEditorNG;
15
16void GroupwareUiDelegate::requestIncidenceEditor(const Akonadi::Item &item)
17{
18 // TODO_KDE5:
19 // The GroupwareUiDelegate interface should be a QObject. Right now we have no way of emitting a
20 // finished signal, so we have to use dialog->exec();
21
23 if (!incidence) {
24 qCWarning(INCIDENCEEDITOR_LOG) << "Incidence is null, won't open the editor";
25 return;
26 }
27
28 IncidenceDialog *dialog = IncidenceDialogFactory::create(/*needs initial saving=*/false, incidence->type(), nullptr);
29 dialog->setAttribute(Qt::WA_DeleteOnClose, false);
30 dialog->setIsCounterProposal(true);
31 dialog->load(item, QDate::currentDate());
32 dialog->exec();
33 dialog->deleteLater();
34 Akonadi::Item newItem = dialog->item();
38 }
39}
40
41void GroupwareUiDelegate::setCalendar(const Akonadi::ETMCalendar::Ptr &calendar)
42{
43 // We don't need a calendar.
44 Q_UNUSED(calendar)
45}
46
47void GroupwareUiDelegate::createCalendar()
48{
49 // We don't need a calendar
50}
bool hasPayload() const
T payload() const
The IncidenceDialog class.
virtual void load(const Akonadi::Item &item, const QDate &activeDate=QDate())
Loads the.
AKONADI_CALENDAR_EXPORT KCalendarCore::Incidence::Ptr incidence(const Akonadi::Item &item)
QDate currentDate()
virtual int exec()
void deleteLater()
T qobject_cast(QObject *object)
QSharedPointer< X > staticCast() const const
WA_DeleteOnClose
void setAttribute(Qt::WidgetAttribute attribute, bool on)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:37 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.