Commit 2db28384 authored by David Jarvie's avatar David Jarvie

Refactor to remove dependencies in KAEvent, KARecurrence and AlarmText on KAlarm

preferences, in preparation for Akonadi migration.
All KAEvent data independent of preferences is not in KAEventData.

svn path=/trunk/KDE/kdepim/; revision=994262
parent dd92de7d
......@@ -27,6 +27,7 @@ set(libkalarm_SRCS
lib/identities.cpp
lib/itembox.cpp
lib/label.cpp
lib/locale.cpp
lib/messagebox.cpp
lib/packedlayout.cpp
lib/pushbutton.cpp
......@@ -48,6 +49,7 @@ set(kalarm_bin_SRCS ${libkalarm_SRCS}
birthdaydlg.cpp
birthdaymodel.cpp
main.cpp
kaeventdata.cpp
alarmevent.cpp
editdlg.cpp
editdlgtypes.cpp
......
KAlarm Change Log
=== Version 2.3.0 --- 10 July 2009 ===
- Alarm edit: warn user if entered start time needs adjustment to fit recurrence.
- Command alarm edit: show error message if no command/script has been entered.
- Allow use of other command line options with --edit-new-* to initialise edit
dialogue options.
- Improve detection of conflicting command line options.
=== Version 2.2.4 --- 23 June 2009 ===
- Alarm edit: keep existing display file name if file select dialogue cancelled.
- Guard against crashes if KAlarm quits while a modal dialogue is open.
......
......@@ -863,7 +863,7 @@ bool AlarmCalendar::addEvent(KAEvent* event, QWidget* promptParent, bool useEven
if (id.isEmpty())
useEventID = false;
if (!useEventID)
event->setEventID(kcalEvent->uid());
event->setEventId(kcalEvent->uid());
}
else
{
......@@ -874,7 +874,7 @@ bool AlarmCalendar::addEvent(KAEvent* event, QWidget* promptParent, bool useEven
if (useEventID)
{
id = KCalEvent::uid(id, type);
event->setEventID(id);
event->setEventId(id);
kcalEvent->setUid(id);
}
event->updateKCalEvent(kcalEvent, false, (type == KCalEvent::ARCHIVED));
......@@ -1003,7 +1003,7 @@ bool AlarmCalendar::modifyEvent(const QString& oldEventId, KAEvent* newEvent)
if (!resources->addEvent(kcalEvent, resource))
return false; // kcalEvent has been deleted by AlarmResources::addEvent()
if (noNewId)
newEvent->setEventID(kcalEvent->uid());
newEvent->setEventId(kcalEvent->uid());
addEvent(resource, newEvent);
}
else
......
This diff is collapsed.
This diff is collapsed.
......@@ -347,8 +347,8 @@ void AlarmText::setUpTranslations()
*/
QString AlarmText::summary(const KAEvent* event, int maxLines, bool* truncated)
{
QString text = (event->action() == KAEvent::EMAIL) ? event->emailSubject() : event->cleanText();
if (event->action() == KAEvent::MESSAGE)
QString text = (event->action() == KAEventData::EMAIL) ? event->emailSubject() : event->cleanText();
if (event->action() == KAEventData::MESSAGE)
{
// If the message is the text of an email, return its headers or just subject line
QString subject = emailHeaders(text, (maxLines <= 1));
......
/*
* birthdaydlg.cpp - dialog to pick birthdays from address book
* Program: kalarm
* Copyright © 2002-2008 by David Jarvie <djarvie@kde.org>
* Copyright © 2002-2009 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -260,7 +260,7 @@ QList<KAEvent> BirthdayDlg::events() const
KAEvent event(KDateTime(date, KDateTime::ClockTime),
mPrefix->text() + data->name + mSuffix->text(),
mFontColourButton->bgColour(), mFontColourButton->fgColour(),
mFontColourButton->font(), KAEvent::MESSAGE, mLateCancel->minutes(),
mFontColourButton->font(), KAEventData::MESSAGE, mLateCancel->minutes(),
mFlags, true);
float fadeVolume;
int fadeSecs;
......@@ -268,7 +268,7 @@ QList<KAEvent> BirthdayDlg::events() const
event.setAudioFile(mSoundPicker->file().prettyUrl(), volume, fadeVolume, fadeSecs);
QList<int> months;
months.append(date.month());
event.setRecurAnnualByDate(1, months, 0, Preferences::defaultFeb29Type(), -1, QDate());
event.setRecurAnnualByDate(1, months, 0, KARecurrence::defaultFeb29Type(), -1, QDate());
event.setRepetition(mSubRepetition->interval(), mSubRepetition->count());
event.setNextOccurrence(todayStart);
if (reminder)
......
......@@ -187,7 +187,7 @@ void BirthdayModel::refresh()
for (int i = 0, end = events.count(); i < end; ++i)
{
KAEvent* event = events[i];
if (event->action() == KAEvent::MESSAGE
if (event->action() == KAEventData::MESSAGE
&& event->recurType() == KARecurrence::ANNUAL_DATE
&& (mPrefix.isEmpty() || event->message().startsWith(mPrefix)))
messageList.append(event->message());
......
......@@ -49,7 +49,7 @@ static const QByteArray VERSION_PROPERTY("VERSION"); // X-KDE-KALARM-VERSION
*/
void CalendarCompat::setID(KCal::CalendarLocal& calendar)
{
calendar.setCustomProperty(KCalendar::APPNAME, VERSION_PROPERTY, KAlarm::currentCalendarVersionString());
calendar.setCustomProperty(KCalendar::APPNAME, VERSION_PROPERTY, KAEventData::currentCalendarVersionString());
}
/******************************************************************************
......@@ -82,7 +82,7 @@ KCalendar::Status CalendarCompat::fix(KCal::CalendarLocal& calendar, const QStri
kDebug() << "KAlarm version" << version;
// Convert events to current KAlarm format for if the calendar is saved
KAEvent::convertKCalEvents(calendar, version, version057_UTC);
KAEventData::convertKCalEvents(calendar, version, version057_UTC, Preferences::startOfDay());
if (!resource)
return KCalendar::Current; // update non-shared calendars regardless
if (resource->ResourceCached::readOnly() || conv == AlarmResource::NO_CONVERT)
......@@ -155,10 +155,10 @@ int CalendarCompat::readKAlarmVersion(KCal::CalendarLocal& calendar, const QStri
return -1; // missing version string
versionString = versionString.left(i); // 'versionString' now contains the KAlarm version string
}
if (versionString == KAlarm::currentCalendarVersionString())
if (versionString == KAEventData::currentCalendarVersionString())
return 0; // the calendar is in the current KAlarm format
int ver = KAlarm::getVersionNumber(versionString, &subVersion);
if (ver >= KAlarm::currentCalendarVersion() && ver <= KAlarm::Version())
if (ver >= KAEventData::currentCalendarVersion() && ver <= KAlarm::Version())
return 0; // the calendar is in the current KAlarm format
return KAlarm::getVersionNumber(versionString, &subVersion);
}
......
......@@ -74,14 +74,14 @@ CommandOptions::CommandOptions()
if (checkCommand("file", NEW))
{
mEditType = EditAlarmDlg::DISPLAY;
mEditAction = KAEvent::FILE;
mEditAction = KAEventData::FILE;
mEditActionSet = true;
mText = mArgs->getOption(mCommandName);
}
if (checkCommand("exec-display", NEW))
{
mEditType = EditAlarmDlg::DISPLAY;
mEditAction = KAEvent::COMMAND;
mEditAction = KAEventData::COMMAND;
mEditActionSet = true;
mFlags |= KAEvent::DISPLAY_COMMAND;
mText = mArgs->getOption(mCommandName);
......@@ -95,7 +95,7 @@ CommandOptions::CommandOptions()
if (checkCommand("exec", NEW))
{
mEditType = EditAlarmDlg::COMMAND;
mEditAction = KAEvent::COMMAND;
mEditAction = KAEventData::COMMAND;
mEditActionSet = true;
mText = mArgs->getOption(mCommandName);
int n = mArgs->count();
......@@ -108,15 +108,15 @@ CommandOptions::CommandOptions()
if (checkCommand("mail", NEW))
{
mEditType = EditAlarmDlg::EMAIL;
mEditAction = KAEvent::EMAIL;
mEditAction = KAEventData::EMAIL;
mEditActionSet = true;
}
if (checkCommand("edit-new-display", EDIT_NEW, EditAlarmDlg::DISPLAY))
{
mEditType = EditAlarmDlg::DISPLAY;
if (!mEditActionSet || (mEditAction != KAEvent::COMMAND && mEditAction != KAEvent::FILE))
if (!mEditActionSet || (mEditAction != KAEventData::COMMAND && mEditAction != KAEventData::FILE))
{
mEditAction = KAEvent::MESSAGE;
mEditAction = KAEventData::MESSAGE;
mEditActionSet = true;
}
if (mArgs->count())
......@@ -125,13 +125,13 @@ CommandOptions::CommandOptions()
if (checkCommand("edit-new-command", EDIT_NEW))
{
mEditType = EditAlarmDlg::COMMAND;
mEditAction = KAEvent::COMMAND;
mEditAction = KAEventData::COMMAND;
mEditActionSet = true;
}
if (checkCommand("edit-new-email", EDIT_NEW, EditAlarmDlg::EMAIL))
{
mEditType = EditAlarmDlg::EMAIL;
mEditAction = KAEvent::EMAIL;
mEditAction = KAEventData::EMAIL;
mEditActionSet = true;
}
if (mError.isEmpty() && mCommand == NONE && mArgs->count())
......@@ -140,12 +140,12 @@ CommandOptions::CommandOptions()
mCommand = NEW;
mCommandName.clear();
mEditType = EditAlarmDlg::DISPLAY;
mEditAction = KAEvent::MESSAGE;
mEditAction = KAEventData::MESSAGE;
mEditActionSet = true;
if (mArgs->count())
mText = mArgs->arg(0);
}
if (mEditAction == KAEvent::EMAIL)
if (mEditAction == KAEventData::EMAIL)
{
if (mArgs->isSet("subject"))
mSubject = mArgs->getOption("subject");
......
......@@ -52,28 +52,28 @@ class CommandOptions
NEW // --file, --exec-display, --exec, --mail, message
};
CommandOptions();
Command command() const { return mCommand; }
QString eventId() const { return mEventId; }
QString templateName() const { return mTemplateName; }
EditAlarmDlg::Type editType() const { return mEditType; }
KAEvent::Action editAction() const { return mEditAction; }
QString text() const { return mText; }
KDateTime alarmTime() const { return mAlarmTime; }
KARecurrence* recurrence() const { return mRecurrence; }
int subRepeatCount() const { return mRepeatCount; }
int subRepeatInterval() const { return mRepeatInterval; }
int lateCancel() const { return mLateCancel; }
QColor bgColour() const { return mBgColour; }
QColor fgColour() const { return mFgColour; }
int reminderMinutes() const { return mReminderMinutes; }
QString audioFile() const { return mAudioFile; }
float audioVolume() const { return mAudioVolume; }
EmailAddressList addressees() const { return mAddressees; }
QStringList attachments() const { return mAttachments; }
QString subject() const { return mSubject; }
uint fromID() const { return mFromID; }
int flags() const { return mFlags; }
static void printError(const QString& errmsg);
Command command() const { return mCommand; }
QString eventId() const { return mEventId; }
QString templateName() const { return mTemplateName; }
EditAlarmDlg::Type editType() const { return mEditType; }
KAEventData::Action editAction() const { return mEditAction; }
QString text() const { return mText; }
KDateTime alarmTime() const { return mAlarmTime; }
KARecurrence* recurrence() const { return mRecurrence; }
int subRepeatCount() const { return mRepeatCount; }
int subRepeatInterval() const { return mRepeatInterval; }
int lateCancel() const { return mLateCancel; }
QColor bgColour() const { return mBgColour; }
QColor fgColour() const { return mFgColour; }
int reminderMinutes() const { return mReminderMinutes; }
QString audioFile() const { return mAudioFile; }
float audioVolume() const { return mAudioVolume; }
EmailAddressList addressees() const { return mAddressees; }
QStringList attachments() const { return mAttachments; }
QString subject() const { return mSubject; }
uint fromID() const { return mFromID; }
int flags() const { return mFlags; }
static void printError(const QString& errmsg);
private:
bool checkCommand(const QByteArray& command, Command, EditAlarmDlg::Type = EditAlarmDlg::NO_TYPE);
......@@ -83,31 +83,31 @@ class CommandOptions
void setErrorIncompatible(const QByteArray& opt1, const QByteArray& opt2);
void checkEditType(EditAlarmDlg::Type, const QByteArray& opt);
KCmdLineArgs* mArgs;
QString mError; // error message
Command mCommand; // the selected command
QByteArray mCommandName; // option string for the selected command
QString mEventId; // TRIGGER_EVENT, CANCEL_EVENT, EDIT: event ID
QString mTemplateName; // EDIT_NEW_PRESET: template name
EditAlarmDlg::Type mEditType; // NEW, EDIT_NEW_*: alarm edit type
KAEvent::Action mEditAction; // NEW: alarm edit sub-type
bool mEditActionSet; // NEW: mEditAction is valid
QString mText; // NEW: alarm text
KDateTime mAlarmTime; // NEW: alarm time
KARecurrence* mRecurrence; // NEW: recurrence
int mRepeatCount; // NEW: sub-repetition count
int mRepeatInterval; // NEW: sub-repetition interval
int mLateCancel; // NEW: late-cancellation interval
QColor mBgColour; // NEW: background colour
QColor mFgColour; // NEW: foreground colour
int mReminderMinutes;// NEW: reminder period, < 0 if once only reminder
QString mAudioFile; // NEW: audio file path
float mAudioVolume; // NEW: audio file volume
EmailAddressList mAddressees; // NEW: email addressees
QStringList mAttachments; // NEW: email attachment file names
QString mSubject; // NEW: email subject
uint mFromID; // NEW: email sender ID
int mFlags; // NEW: event flags
KCmdLineArgs* mArgs;
QString mError; // error message
Command mCommand; // the selected command
QByteArray mCommandName; // option string for the selected command
QString mEventId; // TRIGGER_EVENT, CANCEL_EVENT, EDIT: event ID
QString mTemplateName; // EDIT_NEW_PRESET: template name
EditAlarmDlg::Type mEditType; // NEW, EDIT_NEW_*: alarm edit type
KAEventData::Action mEditAction; // NEW: alarm edit sub-type
bool mEditActionSet; // NEW: mEditAction is valid
QString mText; // NEW: alarm text
KDateTime mAlarmTime; // NEW: alarm time
KARecurrence* mRecurrence; // NEW: recurrence
int mRepeatCount; // NEW: sub-repetition count
int mRepeatInterval; // NEW: sub-repetition interval
int mLateCancel; // NEW: late-cancellation interval
QColor mBgColour; // NEW: background colour
QColor mFgColour; // NEW: foreground colour
int mReminderMinutes;// NEW: reminder period, < 0 if once only reminder
QString mAudioFile; // NEW: audio file path
float mAudioVolume; // NEW: audio file volume
EmailAddressList mAddressees; // NEW: email addressees
QStringList mAttachments; // NEW: email attachment file names
QString mSubject; // NEW: email subject
uint mFromID; // NEW: email sender ID
int mFlags; // NEW: event flags
};
#endif // COMMANDOPTIONS_H
......@@ -233,7 +233,7 @@ bool DBusHandler::scheduleMessage(const QString& message, const KDateTime& start
const KCal::Duration& subRepeatDuration, int subRepeatCount)
{
unsigned kaEventFlags = convertStartFlags(start, flags);
KAEvent::Action action = (kaEventFlags & KAEvent::DISPLAY_COMMAND) ? KAEvent::COMMAND : KAEvent::MESSAGE;
KAEventData::Action action = (kaEventFlags & KAEvent::DISPLAY_COMMAND) ? KAEventData::COMMAND : KAEventData::MESSAGE;
QColor bg = convertBgColour(bgColor);
if (!bg.isValid())
return false;
......@@ -276,7 +276,7 @@ bool DBusHandler::scheduleFile(const KUrl& file,
QColor bg = convertBgColour(bgColor);
if (!bg.isValid())
return false;
return theApp()->scheduleEvent(KAEvent::FILE, file.url(), start, lateCancel, kaEventFlags, bg, Qt::black, QFont(),
return theApp()->scheduleEvent(KAEventData::FILE, file.url(), start, lateCancel, kaEventFlags, bg, Qt::black, QFont(),
audioFile.url(), -1, reminderMins, recurrence, subRepeatDuration, subRepeatCount);
}
......@@ -288,7 +288,7 @@ bool DBusHandler::scheduleCommand(const QString& commandLine,
const KARecurrence& recurrence, const KCal::Duration& subRepeatDuration, int subRepeatCount)
{
unsigned kaEventFlags = convertStartFlags(start, flags);
return theApp()->scheduleEvent(KAEvent::COMMAND, commandLine, start, lateCancel, kaEventFlags, Qt::black, Qt::black, QFont(),
return theApp()->scheduleEvent(KAEventData::COMMAND, commandLine, start, lateCancel, kaEventFlags, Qt::black, Qt::black, QFont(),
QString(), -1, 0, recurrence, subRepeatDuration, subRepeatCount);
}
......@@ -330,7 +330,7 @@ bool DBusHandler::scheduleEmail(const QString& fromID, const QString& addresses,
kError() << "D-Bus call scheduleEmail(): invalid email attachment:" << bad;
return false;
}
return theApp()->scheduleEvent(KAEvent::EMAIL, message, start, lateCancel, kaEventFlags, Qt::black, Qt::black, QFont(),
return theApp()->scheduleEvent(KAEventData::EMAIL, message, start, lateCancel, kaEventFlags, Qt::black, Qt::black, QFont(),
QString(), -1, 0, recurrence, subRepeatDuration, subRepeatCount, senderId, addrs, subject, atts);
}
......
/*
* deferdlg.cpp - dialog to defer an alarm
* Program: kalarm
* Copyright © 2002-2008 by David Jarvie <djarvie@kde.org>
* Copyright © 2002-2009 by David Jarvie <djarvie@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -77,7 +77,7 @@ void DeferAlarmDlg::slotOk()
mAlarmDateTime = mTimeWidget->getDateTime(&mDeferMinutes);
if (!mAlarmDateTime.isValid())
return;
KAEvent::DeferLimitType limitType;
KAEventData::DeferLimitType limitType;
DateTime endTime;
if (!mLimitEventID.isEmpty())
{
......@@ -89,30 +89,30 @@ void DeferAlarmDlg::slotOk()
else
{
endTime = mLimitDateTime;
limitType = mLimitDateTime.isValid() ? KAEvent::LIMIT_MAIN : KAEvent::LIMIT_NONE;
limitType = mLimitDateTime.isValid() ? KAEventData::LIMIT_MAIN : KAEventData::LIMIT_NONE;
}
if (endTime.isValid() && mAlarmDateTime > endTime)
{
QString text;
switch (limitType)
{
case KAEvent::LIMIT_REPETITION:
case KAEventData::LIMIT_REPETITION:
text = i18nc("@info", "Cannot defer past the alarm's next sub-repetition (currently %1)",
endTime.formatLocale());
break;
case KAEvent::LIMIT_RECURRENCE:
case KAEventData::LIMIT_RECURRENCE:
text = i18nc("@info", "Cannot defer past the alarm's next recurrence (currently %1)",
endTime.formatLocale());
break;
case KAEvent::LIMIT_REMINDER:
case KAEventData::LIMIT_REMINDER:
text = i18nc("@info", "Cannot defer past the alarm's next reminder (currently %1)",
endTime.formatLocale());
break;
case KAEvent::LIMIT_MAIN:
case KAEventData::LIMIT_MAIN:
text = i18nc("@info", "Cannot defer reminder past the main alarm time (%1)",
endTime.formatLocale());
break;
case KAEvent::LIMIT_NONE:
case KAEventData::LIMIT_NONE:
break; // can't happen with a valid endTime
}
KMessageBox::sorry(this, text);
......
......@@ -118,13 +118,13 @@ EditAlarmDlg* EditAlarmDlg::create(bool Template, const KAEvent* event, bool new
{
switch (event->action())
{
case KAEvent::COMMAND:
case KAEventData::COMMAND:
if (!event->commandDisplay())
return new EditCommandAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly);
// fall through to MESSAGE
case KAEvent::MESSAGE:
case KAEvent::FILE: return new EditDisplayAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly);
case KAEvent::EMAIL: return new EditEmailAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly);
case KAEventData::MESSAGE:
case KAEventData::FILE: return new EditDisplayAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly);
case KAEventData::EMAIL: return new EditEmailAlarmDlg(Template, event, newAlarm, parent, getResource, readOnly);
}
return 0;
}
......@@ -137,7 +137,7 @@ EditAlarmDlg* EditAlarmDlg::create(bool Template, const KAEvent* event, bool new
* = false to edit/create an alarm.
* event != to initialise the dialog to show the specified event's data.
*/
EditAlarmDlg::EditAlarmDlg(bool Template, KAEvent::Action action, QWidget* parent, GetResourceType getResource)
EditAlarmDlg::EditAlarmDlg(bool Template, KAEventData::Action action, QWidget* parent, GetResourceType getResource)
: KDialog(parent),
mAlarmType(action),
mMainPageShown(false),
......@@ -515,7 +515,7 @@ void EditAlarmDlg::initValues(const KAEvent* event)
}
}
KAEvent::Action action = event->action();
KAEventData::Action action = event->action();
AlarmText altext;
if (event->commandScript())
altext.setScript(event->cleanText());
......@@ -925,7 +925,7 @@ bool EditAlarmDlg::validate()
else
pre = pre.addSecs(-1);
DateTime next;
event.nextOccurrence(pre, next, KAEvent::IGNORE_REPETITION);
event.nextOccurrence(pre, next, KAEventData::IGNORE_REPETITION);
if (next != dt)
{
QString prompt = dateOnly ? i18nc("@info The parameter is a date value",
......@@ -953,7 +953,7 @@ bool EditAlarmDlg::validate()
{
// A timed recurrence has an entered start date which
// has already expired, so we must adjust it.
if (event.nextOccurrence(now, mAlarmDateTime, KAEvent::ALLOW_FOR_REPETITION) == KAEvent::NO_OCCURRENCE)
if (event.nextOccurrence(now, mAlarmDateTime, KAEventData::ALLOW_FOR_REPETITION) == KAEventData::NO_OCCURRENCE)
{
KMessageBox::sorry(this, i18nc("@info", "Recurrence has already expired"));
return false;
......@@ -1088,10 +1088,10 @@ void EditAlarmDlg::slotHelp()
EventListModel::Type type;
switch (mAlarmType)
{
case KAEvent::FILE:
case KAEvent::MESSAGE: type = EventListModel::DISPLAY; break;
case KAEvent::COMMAND: type = EventListModel::COMMAND; break;
case KAEvent::EMAIL: type = EventListModel::EMAIL; break;
case KAEventData::FILE:
case KAEventData::MESSAGE: type = EventListModel::DISPLAY; break;
case KAEventData::COMMAND: type = EventListModel::COMMAND; break;
case KAEventData::EMAIL: type = EventListModel::EMAIL; break;
default:
return;
}
......
......@@ -74,7 +74,7 @@ class EditAlarmDlg : public KDialog
void setTime(const DateTime&); // must be called first to set date-only value
void setRecurrence(const KARecurrence&, int subRepeatInterval, int subRepeatCount);
void setRepeatAtLogin();
virtual void setAction(KAEvent::Action, const AlarmText& = AlarmText()) = 0;
virtual void setAction(KAEventData::Action, const AlarmText& = AlarmText()) = 0;
void setLateCancel(int minutes);
void setShowInKOrganizer(bool);
......@@ -83,7 +83,7 @@ class EditAlarmDlg : public KDialog
static QString i18n_chk_ShowInKOrganizer(); // text of 'Show in KOrganizer' checkbox
protected:
EditAlarmDlg(bool Template, KAEvent::Action, QWidget* parent = 0,
EditAlarmDlg(bool Template, KAEventData::Action, QWidget* parent = 0,
GetResourceType = RES_PROMPT);
EditAlarmDlg(bool Template, const KAEvent*, QWidget* parent = 0,
GetResourceType = RES_PROMPT, bool readOnly = false);
......@@ -140,7 +140,7 @@ class EditAlarmDlg : public KDialog
void showOptions(bool more);
protected:
KAEvent::Action mAlarmType; // actual alarm type
KAEventData::Action mAlarmType; // actual alarm type
private:
KTabWidget* mTabs; // the tabs in the dialog
StackedScrollGroup* mTabScrollGroup;
......
......@@ -103,7 +103,7 @@ QString EditDisplayAlarmDlg::i18n_chk_ConfirmAck() { return i18nc("@option:ch
* event != to initialise the dialog to show the specified event's data.
*/
EditDisplayAlarmDlg::EditDisplayAlarmDlg(bool Template, bool newAlarm, QWidget* parent, GetResourceType getResource)
: EditAlarmDlg(Template, KAEvent::MESSAGE, parent, getResource),
: EditAlarmDlg(Template, KAEventData::MESSAGE, parent, getResource),
mSpecialActionsButton(0),
mReminderDeferral(false),
mReminderArchived(false)
......@@ -251,11 +251,11 @@ void EditDisplayAlarmDlg::type_initValues(const KAEvent* event)
lateCancel()->showAutoClose(true);
if (event)
{
if (mAlarmType == KAEvent::MESSAGE && event->kmailSerialNumber()
if (mAlarmType == KAEventData::MESSAGE && event->kmailSerialNumber()
&& AlarmText::checkIfEmail(event->cleanText()))
mKMailSerialNumber = event->kmailSerialNumber();
lateCancel()->setAutoClose(event->autoClose());
if (event->defaultFont())
if (event->useDefaultFont())
mFontColourButton->setDefaultFont();
else
mFontColourButton->setFont(event->font());
......@@ -361,21 +361,21 @@ void EditDisplayAlarmDlg::setColours(const QColor& fgColour, const QColor& bgCol
/******************************************************************************
* Set the dialog's action and the action's text.
*/
void EditDisplayAlarmDlg::setAction(KAEvent::Action action, const AlarmText& alarmText)
void EditDisplayAlarmDlg::setAction(KAEventData::Action action, const AlarmText& alarmText)
{
QString text = alarmText.displayText();
switch (action)
{
case KAEvent::MESSAGE:
case KAEventData::MESSAGE:
mTypeCombo->setCurrentIndex(tTEXT);
mTextMessageEdit->setPlainText(text);
mKMailSerialNumber = alarmText.isEmail() ? alarmText.kmailSerialNumber() : 0;
break;
case KAEvent::FILE:
case KAEventData::FILE:
mTypeCombo->setCurrentIndex(tFILE);
mFileMessageEdit->setText(text);
break;
case KAEvent::COMMAND:
case KAEventData::COMMAND:
mTypeCombo->setCurrentIndex(tCOMMAND);
mCmdEdit->setText(alarmText);
break;
......@@ -519,17 +519,17 @@ bool EditDisplayAlarmDlg::type_stateChanged() const
*/
void EditDisplayAlarmDlg::type_setEvent(KAEvent& event, const KDateTime& dt, const QString& text, int lateCancel, bool trial)
{
KAEvent::Action type;
KAEventData::Action type;
switch (mTypeCombo->currentIndex())
{
case tFILE: type = KAEvent::FILE; break;
case tCOMMAND: type = KAEvent::COMMAND; break;
case tFILE: type = KAEventData::FILE; break;
case tCOMMAND: type = KAEventData::COMMAND; break;
default:
case tTEXT: type = KAEvent::MESSAGE; break;
case tTEXT: type = KAEventData::MESSAGE; break;
}
event.set(dt, text, mFontColourButton->bgColour(), mFontColourButton->fgColour(), mFontColourButton->font(),
type, lateCancel, getAlarmFlags());
if (type == KAEvent::MESSAGE)
if (type == KAEventData::MESSAGE)
{
if (AlarmText::checkIfEmail(text))
event.setKMailSerialNumber(mKMailSerialNumber);
......@@ -749,7 +749,7 @@ QString EditCommandAlarmDlg::i18n_chk_ExecInTermWindow() { return i18nc("@opti
* event != to initialise the dialog to show the specified event's data.
*/
EditCommandAlarmDlg::EditCommandAlarmDlg(bool Template, bool newAlarm, QWidget* parent, GetResourceType getResource)
: EditAlarmDlg(Template, KAEvent::COMMAND, parent, getResource)
: EditAlarmDlg(Template, KAEventData::COMMAND, parent, getResource)
{
kDebug() << "New";
init(0, newAlarm);
......@@ -878,9 +878,9 @@ void EditCommandAlarmDlg::type_showOptions(bool more)
/******************************************************************************
* Set the dialog's action and the action's text.
*/
void EditCommandAlarmDlg::setAction(KAEvent::Action action, const AlarmText& alarmText)
void EditCommandAlarmDlg::setAction(KAEventData::Action action, const AlarmText& alarmText)
{
Q_ASSERT(action == KAEvent::COMMAND);
Q_ASSERT(action == KAEventData::COMMAND);
mCmdEdit->setText(alarmText);
}
......@@ -935,7 +935,7 @@ bool EditCommandAlarmDlg::type_stateChanged() const
void EditCommandAlarmDlg::type_setEvent(KAEvent& event, const KDateTime& dt, const QString& text, int lateCancel, bool trial)