Commit 8fde7de6 authored by David Jarvie's avatar David Jarvie
Browse files

Improve NewAlarmAction interface

parent 5b84fb67
Pipeline #48729 failed with stage
in 12 minutes and 54 seconds
/*
* alarmlistdelegate.cpp - handles editing and display of alarm list
* Program: kalarm
* SPDX-FileCopyrightText: 2007-2019 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2007-2021 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -105,7 +105,7 @@ QSize AlarmListDelegate::sizeHint(const QStyleOptionViewItem& option, const QMod
return QItemDelegate::sizeHint(option, index);
}
void AlarmListDelegate::edit(KAEvent* event, EventListView* view)
void AlarmListDelegate::edit(KAEvent& event, EventListView* view)
{
KAlarm::editAlarm(event, static_cast<AlarmListView*>(view)); // edit alarm (view-only mode if archived or read-only)
}
......
/*
* alarmlistdelegate.h - handles editing and display of alarm list
* Program: kalarm
* SPDX-FileCopyrightText: 2007, 2008 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2007-2021 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -14,13 +14,13 @@
class AlarmListDelegate : public EventListDelegate
{
Q_OBJECT
public:
explicit AlarmListDelegate(AlarmListView* parent = nullptr)
: EventListDelegate(parent) {}
void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const override;
QSize sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const override;
void edit(KAEvent*, EventListView*) override;
Q_OBJECT
public:
explicit AlarmListDelegate(AlarmListView* parent = nullptr)
: EventListDelegate(parent) {}
void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const override;
QSize sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const override;
void edit(KAEvent&, EventListView*) override;
};
#endif
......
/*
* editdlg.cpp - dialog to create or modify an alarm or alarm template
* Program: kalarm
* SPDX-FileCopyrightText: 2001-2020 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2001-2021 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -97,10 +97,10 @@ EditAlarmDlg* EditAlarmDlg::create(bool Template, Type type, QWidget* parent, Ge
return nullptr;
}
EditAlarmDlg* EditAlarmDlg::create(bool Template, const KAEvent* event, bool newAlarm, QWidget* parent,
EditAlarmDlg* EditAlarmDlg::create(bool Template, const KAEvent& event, bool newAlarm, QWidget* parent,
GetResourceType getResource, bool readOnly)
{
switch (event->actionTypes())
switch (event.actionTypes())
{
case KAEvent::ACT_COMMAND: return new EditCommandAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly);
case KAEvent::ACT_DISPLAY_COMMAND:
......@@ -119,7 +119,7 @@ EditAlarmDlg* EditAlarmDlg::create(bool Template, const KAEvent* event, bool new
* Parameters:
* Template = true to edit/create an alarm template
* = false to edit/create an alarm.
* event != to initialise the dialog to show the specified event's data.
* event to initialise the dialog to show the specified event's data.
*/
EditAlarmDlg::EditAlarmDlg(bool Template, KAEvent::SubAction action, QWidget* parent, GetResourceType getResource)
: QDialog(parent)
......@@ -129,15 +129,15 @@ EditAlarmDlg::EditAlarmDlg(bool Template, KAEvent::SubAction action, QWidget* pa
, mDesiredReadOnly(false)
, mReadOnly(false)
{
init(nullptr, getResource);
init(KAEvent(), getResource);
mWindowList.append(this);
}
EditAlarmDlg::EditAlarmDlg(bool Template, const KAEvent* event, bool newAlarm, QWidget* parent,
EditAlarmDlg::EditAlarmDlg(bool Template, const KAEvent& event, bool newAlarm, QWidget* parent,
GetResourceType getResource, bool readOnly)
: QDialog(parent)
, mAlarmType(event->actionSubType())
, mEventId(newAlarm ? QString() : event->id())
, mAlarmType(event.actionSubType())
, mEventId(newAlarm ? QString() : event.id())
, mTemplate(Template)
, mNewAlarm(newAlarm)
, mDesiredReadOnly(readOnly)
......@@ -147,14 +147,14 @@ EditAlarmDlg::EditAlarmDlg(bool Template, const KAEvent* event, bool newAlarm, Q
mWindowList.append(this);
}
void EditAlarmDlg::init(const KAEvent* event, GetResourceType getResource)
void EditAlarmDlg::init(const KAEvent& event, GetResourceType getResource)
{
switch (getResource)
{
case RES_USE_EVENT_ID:
if (event)
if (event.isValid())
{
mResourceEventId = event->id();
mResourceEventId = event.id();
mUseResourceEventId = true;
break;
}
......@@ -171,14 +171,14 @@ void EditAlarmDlg::init(const KAEvent* event, GetResourceType getResource)
}
}
void EditAlarmDlg::init(const KAEvent* event)
void EditAlarmDlg::init(const KAEvent& event)
{
setObjectName(mTemplate ? QStringLiteral("TemplEditDlg") : QStringLiteral("EditDlg")); // used by LikeBack
QString caption;
if (mReadOnly)
caption = mTemplate ? i18nc("@title:window", "Alarm Template [read-only]")
: event->expired() ? i18nc("@title:window", "Archived Alarm [read-only]")
: i18nc("@title:window", "Alarm [read-only]");
: event.expired() ? i18nc("@title:window", "Archived Alarm [read-only]")
: i18nc("@title:window", "Alarm [read-only]");
else
caption = type_caption();
setWindowTitle(caption);
......@@ -434,7 +434,7 @@ void EditAlarmDlg::init(const KAEvent* event)
if (!mNewAlarm)
{
// Save the initial state of all controls so that we can later tell if they have changed
saveState((event && (mTemplate || !event->isTemplate())) ? event : nullptr);
saveState((event.isValid() && (mTemplate || !event.isTemplate())) ? &event : nullptr);
contentsChanged(); // enable/disable OK button
}
......@@ -471,7 +471,7 @@ int EditAlarmDlg::instanceCount()
/******************************************************************************
* Initialise the dialog controls from the specified event.
*/
void EditAlarmDlg::initValues(const KAEvent* event)
void EditAlarmDlg::initValues(const KAEvent& event)
{
setReadOnly(mDesiredReadOnly);
......@@ -480,42 +480,42 @@ void EditAlarmDlg::initValues(const KAEvent* event)
mExpiredRecurrence = false;
mLateCancel->showAutoClose(false);
bool deferGroupVisible = false;
if (event)
if (event.isValid())
{
// Set the values to those for the specified event
if (mName)
mName->setText(event->name());
bool recurs = event->recurs();
if ((recurs || event->repetition()) && !mTemplate && event->deferred())
mName->setText(event.name());
bool recurs = event.recurs();
if ((recurs || event.repetition()) && !mTemplate && event.deferred())
{
deferGroupVisible = true;
mDeferDateTime = event->deferDateTime();
mDeferDateTime = event.deferDateTime();
mDeferTimeLabel->setText(mDeferDateTime.formatLocale());
mDeferGroup->show();
}
if (mTemplate)
{
// Editing a template
int afterTime = event->isTemplate() ? event->templateAfterTime() : -1;
int afterTime = event.isTemplate() ? event.templateAfterTime() : -1;
bool noTime = !afterTime;
bool useTime = !event->mainDateTime().isDateOnly();
bool useTime = !event.mainDateTime().isDateOnly();
RadioButton* button = noTime ? mTemplateDefaultTime :
(afterTime > 0) ? mTemplateUseTimeAfter :
useTime ? mTemplateUseTime : mTemplateAnyTime;
button->setChecked(true);
mTemplateTimeAfter->setValue(afterTime > 0 ? afterTime : 1);
if (!noTime && useTime)
mTemplateTime->setValue(event->mainDateTime().kDateTime().time());
mTemplateTime->setValue(event.mainDateTime().kDateTime().time());
else
mTemplateTime->setValue(0);
}
else
{
if (event->isTemplate())
if (event.isTemplate())
{
// Initialising from an alarm template: use current date
const KADateTime now = KADateTime::currentDateTime(Preferences::timeSpec());
int afterTime = event->templateAfterTime();
int afterTime = event.templateAfterTime();
if (afterTime >= 0)
{
mTimeWidget->setDateTime(now.addSecs(afterTime * 60));
......@@ -523,7 +523,7 @@ void EditAlarmDlg::initValues(const KAEvent* event)
}
else
{
KADateTime dt = event->startDateTime().kDateTime();
KADateTime dt = event.startDateTime().kDateTime();
dt.setTimeSpec(Preferences::timeSpec());
QDate d = now.date();
if (!dt.isDateOnly() && now.time() >= dt.time())
......@@ -534,27 +534,27 @@ void EditAlarmDlg::initValues(const KAEvent* event)
}
else
{
mExpiredRecurrence = recurs && event->mainExpired();
mTimeWidget->setDateTime(recurs || event->category() == CalEvent::ARCHIVED ? event->startDateTime()
: event->mainExpired() ? event->deferDateTime() : event->mainDateTime());
mExpiredRecurrence = recurs && event.mainExpired();
mTimeWidget->setDateTime(recurs || event.category() == CalEvent::ARCHIVED ? event.startDateTime()
: event.mainExpired() ? event.deferDateTime() : event.mainDateTime());
}
}
KAEvent::SubAction action = event->actionSubType();
KAEvent::SubAction action = event.actionSubType();
AlarmText altext;
if (event->commandScript())
altext.setScript(event->cleanText());
if (event.commandScript())
altext.setScript(event.cleanText());
else
altext.setText(event->cleanText());
altext.setText(event.cleanText());
setAction(action, altext);
mLateCancel->setMinutes(event->lateCancel(), event->startDateTime().isDateOnly(),
mLateCancel->setMinutes(event.lateCancel(), event.startDateTime().isDateOnly(),
TimePeriod::HoursMinutes);
if (mShowInKorganizer)
mShowInKorganizer->setChecked(event->copyToKOrganizer());
mShowInKorganizer->setChecked(event.copyToKOrganizer());
type_initValues(event);
mRecurrenceEdit->set(*event); // must be called after mTimeWidget is set up, to ensure correct date-only enabling
mTabs->setTabText(mRecurPageIndex, recurText(*event));
mRecurrenceEdit->set(event); // must be called after mTimeWidget is set up, to ensure correct date-only enabling
mTabs->setTabText(mRecurPageIndex, recurText(event));
}
else
{
......@@ -571,7 +571,7 @@ void EditAlarmDlg::initValues(const KAEvent* event)
mLateCancel->setMinutes((Preferences::defaultLateCancel() ? 1 : 0), false, TimePeriod::HoursMinutes);
if (mShowInKorganizer)
mShowInKorganizer->setChecked(Preferences::defaultCopyToKOrganizer());
type_initValues(nullptr);
type_initValues(KAEvent());
mRecurrenceEdit->setDefaults(defaultTime); // must be called after mTimeWidget is set up, to ensure correct date-only enabling
slotRecurFrequencyChange(); // update the Recurrence text
}
......@@ -1206,7 +1206,7 @@ void EditAlarmDlg::slotHelp()
if (dlg->exec() == QDialog::Accepted)
{
KAEvent event = dlg->selectedTemplate();
initValues(&event);
initValues(event);
}
}
......
/*
* editdlg.h - dialog to create or modify an alarm or alarm template
* Program: kalarm
* SPDX-FileCopyrightText: 2001-2020 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2001-2021 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -55,7 +55,7 @@ public:
static EditAlarmDlg* create(bool Template, Type, QWidget* parent = nullptr,
GetResourceType = RES_PROMPT);
static EditAlarmDlg* create(bool Template, const KAEvent*, bool newAlarm, QWidget* parent = nullptr,
static EditAlarmDlg* create(bool Template, const KAEvent&, bool newAlarm, QWidget* parent = nullptr,
GetResourceType = RES_PROMPT, bool readOnly = false);
~EditAlarmDlg() override;
bool getEvent(KAEvent&, Resource&);
......@@ -79,16 +79,16 @@ public:
protected:
EditAlarmDlg(bool Template, KAEvent::SubAction, QWidget* parent = nullptr,
GetResourceType = RES_PROMPT);
EditAlarmDlg(bool Template, const KAEvent*, bool newAlarm, QWidget* parent = nullptr,
EditAlarmDlg(bool Template, const KAEvent&, bool newAlarm, QWidget* parent = nullptr,
GetResourceType = RES_PROMPT, bool readOnly = false);
void init(const KAEvent* event);
void init(const KAEvent& event);
void resizeEvent(QResizeEvent*) override;
void showEvent(QShowEvent*) override;
void closeEvent(QCloseEvent*) override;
bool eventFilter(QObject*, QEvent*) override;
virtual QString type_caption() const = 0;
virtual void type_init(QWidget* parent, QVBoxLayout* frameLayout) = 0;
virtual void type_initValues(const KAEvent*) = 0;
virtual void type_initValues(const KAEvent&) = 0;
virtual void type_showOptions(bool more) = 0;
virtual void setReadOnly(bool readOnly) = 0;
virtual void saveState(const KAEvent*) = 0;
......@@ -131,8 +131,8 @@ private Q_SLOTS:
void focusFixTimer();
private:
void init(const KAEvent* event, GetResourceType getResource);
void initValues(const KAEvent*);
void init(const KAEvent& event, GetResourceType getResource);
void initValues(const KAEvent&);
void setEvent(KAEvent&, const QString& text, bool trial);
bool validate();
virtual bool stateChanged() const;
......
/*
* editdlgtypes.cpp - dialogs to create or edit alarm or alarm template types
* Program: kalarm
* SPDX-FileCopyrightText: 2001-2020 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2001-2021 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -102,10 +102,10 @@ EditDisplayAlarmDlg::EditDisplayAlarmDlg(bool Template, QWidget* parent, GetReso
: EditAlarmDlg(Template, KAEvent::MESSAGE, parent, getResource)
{
qCDebug(KALARM_LOG) << "EditDisplayAlarmDlg: New";
init(nullptr);
init(KAEvent());
}
EditDisplayAlarmDlg::EditDisplayAlarmDlg(bool Template, const KAEvent* event, bool newAlarm, QWidget* parent,
EditDisplayAlarmDlg::EditDisplayAlarmDlg(bool Template, const KAEvent& event, bool newAlarm, QWidget* parent,
GetResourceType getResource, bool readOnly)
: EditAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly)
{
......@@ -292,54 +292,54 @@ CheckBox* EditDisplayAlarmDlg::createConfirmAckCheckbox(QWidget* parent)
/******************************************************************************
* Initialise the dialog controls from the specified event.
*/
void EditDisplayAlarmDlg::type_initValues(const KAEvent* event)
void EditDisplayAlarmDlg::type_initValues(const KAEvent& event)
{
mTryButton->setToolTip(i18nc("@info:tooltip", "Display the alarm now"));
mAkonadiItemId = -1;
lateCancel()->showAutoClose(true);
if (event)
if (event.isValid())
{
if (mAlarmType == KAEvent::MESSAGE && event->akonadiItemId()
&& AlarmText::checkIfEmail(event->cleanText()))
mAkonadiItemId = event->akonadiItemId();
lateCancel()->setAutoClose(event->autoClose());
if (event->useDefaultFont())
if (mAlarmType == KAEvent::MESSAGE && event.akonadiItemId()
&& AlarmText::checkIfEmail(event.cleanText()))
mAkonadiItemId = event.akonadiItemId();
lateCancel()->setAutoClose(event.autoClose());
if (event.useDefaultFont())
mFontColourButton->setDefaultFont();
else
mFontColourButton->setFont(event->font());
mFontColourButton->setBgColour(event->bgColour());
mFontColourButton->setFgColour(event->fgColour());
setColours(event->fgColour(), event->bgColour());
mDisplayMethodCombo->setCurrentIndex(event->notify() ? dNOTIFY : dWINDOW);
mConfirmAck->setChecked(event->confirmAck());
const bool recurs = event->recurs();
int reminderMins = event->reminderMinutes();
if (reminderMins > 0 && !event->reminderActive())
mFontColourButton->setFont(event.font());
mFontColourButton->setBgColour(event.bgColour());
mFontColourButton->setFgColour(event.fgColour());
setColours(event.fgColour(), event.bgColour());
mDisplayMethodCombo->setCurrentIndex(event.notify() ? dNOTIFY : dWINDOW);
mConfirmAck->setChecked(event.confirmAck());
const bool recurs = event.recurs();
int reminderMins = event.reminderMinutes();
if (reminderMins > 0 && !event.reminderActive())
reminderMins = 0; // don't show advance reminder which has already passed
if (!reminderMins)
{
if (event->reminderDeferral() && !recurs)
if (event.reminderDeferral() && !recurs)
{
reminderMins = event->deferDateTime().minsTo(event->mainDateTime());
reminderMins = event.deferDateTime().minsTo(event.mainDateTime());
mReminderDeferral = true;
}
else if (event->reminderMinutes() && recurs)
else if (event.reminderMinutes() && recurs)
{
reminderMins = event->reminderMinutes();
reminderMins = event.reminderMinutes();
mReminderArchived = true;
}
}
reminder()->setMinutes(reminderMins, dateOnly());
reminder()->setOnceOnly(event->reminderOnceOnly());
reminder()->setOnceOnly(event.reminderOnceOnly());
reminder()->enableOnceOnly(recurs);
if (mSpecialActionsButton)
mSpecialActionsButton->setActions(event->preAction(), event->postAction(), event->extraActionOptions());
Preferences::SoundType soundType = event->speak() ? Preferences::Sound_Speak
: event->beep() ? Preferences::Sound_Beep
: !event->audioFile().isEmpty() ? Preferences::Sound_File
: Preferences::Sound_None;
mSoundPicker->set(soundType, event->audioFile(), event->soundVolume(),
event->fadeVolume(), event->fadeSeconds(), event->repeatSoundPause());
mSpecialActionsButton->setActions(event.preAction(), event.postAction(), event.extraActionOptions());
Preferences::SoundType soundType = event.speak() ? Preferences::Sound_Speak
: event.beep() ? Preferences::Sound_Beep
: !event.audioFile().isEmpty() ? Preferences::Sound_File
: Preferences::Sound_None;
mSoundPicker->set(soundType, event.audioFile(), event.soundVolume(),
event.fadeVolume(), event.fadeSeconds(), event.repeatSoundPause());
}
else
{
......@@ -824,10 +824,10 @@ EditCommandAlarmDlg::EditCommandAlarmDlg(bool Template, QWidget* parent, GetReso
: EditAlarmDlg(Template, KAEvent::COMMAND, parent, getResource)
{
qCDebug(KALARM_LOG) << "EditCommandAlarmDlg: New";
init(nullptr);
init(KAEvent());
}
EditCommandAlarmDlg::EditCommandAlarmDlg(bool Template, const KAEvent* event, bool newAlarm, QWidget* parent,
EditCommandAlarmDlg::EditCommandAlarmDlg(bool Template, const KAEvent& event, bool newAlarm, QWidget* parent,
GetResourceType getResource, bool readOnly)
: EditAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly)
{
......@@ -927,18 +927,18 @@ void EditCommandAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
/******************************************************************************
* Initialise the dialog controls from the specified event.
*/
void EditCommandAlarmDlg::type_initValues(const KAEvent* event)
void EditCommandAlarmDlg::type_initValues(const KAEvent& event)
{
if (event)
if (event.isValid())
{
// Set the values to those for the specified event
RadioButton* logType = event->commandXterm() ? mCmdExecInTerm
: !event->logFile().isEmpty() ? mCmdLogToFile
RadioButton* logType = event.commandXterm() ? mCmdExecInTerm
: !event.logFile().isEmpty() ? mCmdLogToFile
: mCmdDiscardOutput;
if (logType == mCmdLogToFile)
mCmdLogFileEdit->setText(event->logFile()); // set file name before setting radio button
mCmdLogFileEdit->setText(event.logFile()); // set file name before setting radio button
logType->setChecked(true);
mCmdDontShowError->setChecked(event->commandHideError());
mCmdDontShowError->setChecked(event.commandHideError());
}
else
{
......@@ -1151,10 +1151,10 @@ EditEmailAlarmDlg::EditEmailAlarmDlg(bool Template, QWidget* parent, GetResource
: EditAlarmDlg(Template, KAEvent::EMAIL, parent, getResource)
{
qCDebug(KALARM_LOG) << "EditEmailAlarmDlg: New";
init(nullptr);
init(KAEvent());
}
EditEmailAlarmDlg::EditEmailAlarmDlg(bool Template, const KAEvent* event, bool newAlarm, QWidget* parent,
EditEmailAlarmDlg::EditEmailAlarmDlg(bool Template, const KAEvent& event, bool newAlarm, QWidget* parent,
GetResourceType getResource, bool readOnly)
: EditAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly)
{
......@@ -1278,17 +1278,17 @@ void EditEmailAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
/******************************************************************************
* Initialise the dialog controls from the specified event.
*/
void EditEmailAlarmDlg::type_initValues(const KAEvent* event)
void EditEmailAlarmDlg::type_initValues(const KAEvent& event)
{
if (event)
if (event.isValid())
{
// Set the values to those for the specified event
mEmailAttachList->addItems(event->emailAttachments());
mEmailToEdit->setText(event->emailAddresses(QStringLiteral(", ")));
mEmailSubjectEdit->setText(event->emailSubject());
mEmailBcc->setChecked(event->emailBcc());
mEmailAttachList->addItems(event.emailAttachments());
mEmailToEdit->setText(event.emailAddresses(QStringLiteral(", ")));
mEmailSubjectEdit->setText(event.emailSubject());
mEmailBcc->setChecked(event.emailBcc());
if (mEmailFromList)
mEmailFromList->setCurrentIdentity(event->emailFromId());
mEmailFromList->setCurrentIdentity(event.emailFromId());
}
else
{
......@@ -1600,10 +1600,10 @@ EditAudioAlarmDlg::EditAudioAlarmDlg(bool Template, QWidget* parent, GetResource
: EditAlarmDlg(Template, KAEvent::AUDIO, parent, getResource)
{
qCDebug(KALARM_LOG) << "EditAudioAlarmDlg: New";
init(nullptr);
init(KAEvent());
}
EditAudioAlarmDlg::EditAudioAlarmDlg(bool Template, const KAEvent* event, bool newAlarm, QWidget* parent,
EditAudioAlarmDlg::EditAudioAlarmDlg(bool Template, const KAEvent& event, bool newAlarm, QWidget* parent,
GetResourceType getResource, bool readOnly)
: EditAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly)
{
......@@ -1648,12 +1648,12 @@ void EditAudioAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
/******************************************************************************
* Initialise the dialog controls from the specified event.
*/
void EditAudioAlarmDlg::type_initValues(const KAEvent* event)
void EditAudioAlarmDlg::type_initValues(const KAEvent& event)
{
if (event)
if (event.isValid())
{
mSoundConfig->set(event->audioFile(), event->soundVolume(), event->fadeVolume(), event->fadeSeconds(),
(event->flags() & KAEvent::REPEAT_SOUND) ? event->repeatSoundPause() : -1);
mSoundConfig->set(event.audioFile(), event.soundVolume(), event.fadeVolume(), event.fadeSeconds(),
(event.flags() & KAEvent::REPEAT_SOUND) ? event.repeatSoundPause() : -1);
}
else
{
......
/*
* editdlgtypes.h - dialogues to create or edit alarm or alarm template types
* Program: kalarm
* SPDX-FileCopyrightText: 2001-2020 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2001-2021 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -41,7 +41,7 @@ class EditDisplayAlarmDlg : public EditAlarmDlg
Q_OBJECT
public:
explicit EditDisplayAlarmDlg(bool Template, QWidget* parent = nullptr, GetResourceType = RES_PROMPT);
EditDisplayAlarmDlg(bool Template, const KAEvent*, bool newAlarm, QWidget* parent = nullptr,
EditDisplayAlarmDlg(bool Template, const KAEvent&, bool newAlarm, QWidget* parent = nullptr,
GetResourceType = RES_PROMPT, bool readOnly = false);
// Methods to initialise values in the New Alarm dialogue.
......@@ -67,7 +67,7 @@ public:
protected:
QString type_caption() const override;
void type_init(QWidget* parent, QVBoxLayout* frameLayout) override;
void type_initValues(const KAEvent*) override;
void type_initValues(const KAEvent&) override;
void type_showOptions(bool more) override;
void setReadOnly(bool readOnly) override;
void saveState(const KAEvent*) override;
......@@ -138,7 +138,7 @@ class EditCommandAlarmDlg : public EditAlarmDlg
Q_OBJECT
public:
explicit EditCommandAlarmDlg(bool Template, QWidget* parent = nullptr, GetResourceType = RES_PROMPT);
EditCommandAlarmDlg(bool Template, const KAEvent*, bool newAlarm, QWidget* parent = nullptr,
EditCommandAlarmDlg(bool Template, const KAEvent&, bool newAlarm, QWidget* parent = nullptr,
GetResourceType = RES_PROMPT, bool readOnly = false);
// Methods to initialise values in the New Alarm dialogue.
......@@ -153,7 +153,7 @@ public:
protected:
QString type_caption() const override;
void type_init(QWidget* parent, QVBoxLayout* frameLayout) override;
void type_initValues(const KAEvent*) override;
void type_initValues(const KAEvent&) override;
void type_showOptions(bool more) override;
void setReadOnly(bool readOnly) override;
void saveState(const KAEvent*) override;
......@@ -192,7 +192,7 @@ class EditEmailAlarmDlg : public EditAlarmDlg
Q_OBJECT
public:
explicit EditEmailAlarmDlg(bool Template, QWidget* parent = nullptr, GetResourceType = RES_PROMPT);
EditEmailAlarmDlg(bool Template, const KAEvent*, bool newAlarm, QWidget* parent = nullptr,
EditEmailAlarmDlg(bool Template, const KAEvent&, bool newAlarm, QWidget* parent = nullptr,
GetResourceType = RES_PROMPT, bool readOnly = false);
// Methods to initialise values in the New Alarm dialogue.
......@@ -208,7 +208,7 @@ public:
protected:
QString type_caption() const override;
void type_init(QWidget* parent, QVBoxLayout* frameLayout) override;
void type_initValues(const KAEvent*) override;
void type_initValues(const KAEvent&) override;
void type_showOptions(bool) override {}
void setReadOnly(bool readOnly) override;
void saveState(const KAEvent*) override;
......@@ -258,7 +258,7 @@ class EditAudioAlarmDlg : public EditAlarmDlg
Q_OBJECT
public:
explicit EditAudioAlarmDlg(bool Template, QWidget* parent = nullptr, GetResourceType = RES_PROMPT);
EditAudioAlarmDlg(bool Template, const KAEvent*, bool newAlarm, QWidget* parent = nullptr,
EditAudioAlarmDlg(bool Template, const KAEvent&, bool newAlarm, QWidget* parent = nullptr,
GetResourceType = RES_PROMPT, bool readOnly = false);
// Methods to initialise values in the New Alarm dialogue.
......@@ -270,7 +270,7 @@ public:
protected:
QString type_caption() const override;
void type_init(QWidget* parent, QVBoxLayout* frameLayout) override;
void type_initValues(const KAEvent*) override;
void type_initValues(const KAEvent&) override;
void type_showOptions(bool) override {}
void setReadOnly(bool readOnly) override;
void saveState(const KAEvent*) override;
......