Commit 24996756 authored by Volker Krause's avatar Volker Krause
Browse files

Remove support for email alarms

Existing ones will be treated like regular display alarms.

Part of korganizer!54.
parent 2ee2d853
Pipeline #89346 failed with stage
in 5 minutes and 53 seconds
......@@ -115,20 +115,7 @@ void AlarmDialog::load(const KCalendarCore::Alarm::Ptr &alarm)
mUi->mSoundFile->setUrl(QUrl::fromLocalFile(alarm->audioFile()));
id = 1;
break;
case KCalendarCore::Alarm::Email: {
mUi->mTypeCombo->setCurrentIndex(2);
KCalendarCore::Person::List addresses = alarm->mailAddresses();
QStringList add;
add.reserve(addresses.count());
const KCalendarCore::Person::List::ConstIterator end(addresses.constEnd());
for (KCalendarCore::Person::List::ConstIterator it = addresses.constBegin(); it != end; ++it) {
add << (*it).fullName();
}
mUi->mEmailAddress->setText(add.join(QLatin1String(", ")));
mUi->mEmailText->setPlainText(alarm->mailText());
id = 2;
break;
}
case KCalendarCore::Alarm::Email:
case KCalendarCore::Alarm::Procedure:
case KCalendarCore::Alarm::Display:
case KCalendarCore::Alarm::Invalid:
......@@ -190,15 +177,6 @@ void AlarmDialog::save(const KCalendarCore::Alarm::Ptr &alarm) const
if (mUi->mTypeCombo->currentIndex() == 1) { // Audio
alarm->setAudioAlarm(mUi->mSoundFile->url().toLocalFile());
} else if (mUi->mTypeCombo->currentIndex() == 2) { // Email
QStringList addresses = KEmailAddress::splitAddressList(mUi->mEmailAddress->text());
KCalendarCore::Person::List add;
add.reserve(addresses.count());
for (QStringList::Iterator it = addresses.begin(), end = addresses.end(); it != end; ++it) {
add << KCalendarCore::Person::fromFullName(*it);
}
// TODO: Add a subject line and possibilities for attachments
alarm->setEmailAlarm(QString(), mUi->mEmailText->toPlainText(), add);
} else { // Display
alarm->setDisplayAlarm(mUi->mDisplayText->toPlainText());
}
......
......@@ -266,10 +266,8 @@ QString IncidenceAlarm::stringForAlarm(const KCalendarCore::Alarm::Ptr &alarm)
switch (alarm->type()) {
case KCalendarCore::Alarm::Procedure:
case KCalendarCore::Alarm::Display:
action = i18nc("Alarm action", "Display a dialog");
break;
case KCalendarCore::Alarm::Email:
action = i18nc("Alarm action", "Send an email");
action = i18nc("Alarm action", "Display a dialog");
break;
case KCalendarCore::Alarm::Audio:
action = i18nc("Alarm action", "Play an audio file");
......
......@@ -240,11 +240,6 @@
<string>Play sound file</string>
</property>
</item>
<item>
<property name="text">
<string>Send email</string>
</property>
</item>
</widget>
</item>
<item row="3" column="1">
......@@ -336,77 +331,11 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="EmailStack">
<layout class="QGridLayout" name="gridLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="mEmailToLabel">
<property name="text">
<string>&amp;To:</string>
</property>
<property name="buddy">
<cstring>mEmailAddress</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="PimCommon::AddresseeLineEdit" name="mEmailAddress">
<property name="toolTip">
<string>Specify a list of addresses to send email when the reminder triggers.
If the 'To:' field stays empty the email reminder will be sent to the
default email configured in Kmail (Settings menu/Configure Kmail/Identities).</string>
</property>
<property name="whatsThis">
<string>Enter a list comma-separated addresses to which an email will be sent when the reminder triggers</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mEmailTextLabel">
<property name="text">
<string>&amp;Message:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="buddy">
<cstring>mEmailText</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KTextEdit" name="mEmailText">
<property name="toolTip">
<string>Specify text of an email message to send when the reminder triggers</string>
</property>
<property name="whatsThis">
<string>Enter any text you desire for the email message that will be sent when the alarm triggers.</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>PimCommon::AddresseeLineEdit</class>
<extends>KLineEdit</extends>
<header>PimCommonAkonadi/AddresseeLineEdit</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
......@@ -424,9 +353,6 @@ default email configured in Kmail (Settings menu/Configure Kmail/Identities).</s
<header>ktextedit.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="global">PimCommonAkonadi/AddresseeLineEdit</include>
</includes>
<resources/>
<connections>
<connection>
......
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