Commit 0046fb40 authored by Volker Krause's avatar Volker Krause
Browse files

Remove support for editing procedure alarms

Existing ones will be treated like regular display alarms.

Part of korganizer!43.
parent d3edc6af
Pipeline #85563 failed with stage
in 5 minutes and 35 seconds
......@@ -115,14 +115,8 @@ void AlarmDialog::load(const KCalendarCore::Alarm::Ptr &alarm)
mUi->mSoundFile->setUrl(QUrl::fromLocalFile(alarm->audioFile()));
id = 1;
break;
case KCalendarCore::Alarm::Procedure:
mUi->mTypeCombo->setCurrentIndex(2);
mUi->mApplication->setUrl(QUrl::fromLocalFile(alarm->programFile()));
mUi->mAppArguments->setText(alarm->programArguments());
id = 2;
break;
case KCalendarCore::Alarm::Email: {
mUi->mTypeCombo->setCurrentIndex(3);
mUi->mTypeCombo->setCurrentIndex(2);
KCalendarCore::Person::List addresses = alarm->mailAddresses();
QStringList add;
add.reserve(addresses.count());
......@@ -132,9 +126,10 @@ void AlarmDialog::load(const KCalendarCore::Alarm::Ptr &alarm)
}
mUi->mEmailAddress->setText(add.join(QLatin1String(", ")));
mUi->mEmailText->setPlainText(alarm->mailText());
id = 3;
id = 2;
break;
}
case KCalendarCore::Alarm::Procedure:
case KCalendarCore::Alarm::Display:
case KCalendarCore::Alarm::Invalid:
default:
......@@ -195,9 +190,7 @@ 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) { // Application / script
alarm->setProcedureAlarm(mUi->mApplication->url().toLocalFile(), mUi->mAppArguments->text());
} else if (mUi->mTypeCombo->currentIndex() == 3) { // Email
} else if (mUi->mTypeCombo->currentIndex() == 2) { // Email
QStringList addresses = KEmailAddress::splitAddressList(mUi->mEmailAddress->text());
KCalendarCore::Person::List add;
add.reserve(addresses.count());
......
......@@ -264,12 +264,10 @@ QString IncidenceAlarm::stringForAlarm(const KCalendarCore::Alarm::Ptr &alarm)
QString action;
switch (alarm->type()) {
case KCalendarCore::Alarm::Procedure:
case KCalendarCore::Alarm::Display:
action = i18nc("Alarm action", "Display a dialog");
break;
case KCalendarCore::Alarm::Procedure:
action = i18nc("Alarm action", "Execute a script");
break;
case KCalendarCore::Alarm::Email:
action = i18nc("Alarm action", "Send an email");
break;
......
......@@ -240,11 +240,6 @@
<string>Play sound file</string>
</property>
</item>
<item>
<property name="text">
<string>Run application / script</string>
</property>
</item>
<item>
<property name="text">
<string>Send email</string>
......@@ -341,81 +336,6 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="ApplicationStack">
<layout class="QGridLayout" name="gridLayout_3">
<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="mApplicationLabel">
<property name="text">
<string>&amp;Application / Script:</string>
</property>
<property name="buddy">
<cstring>mApplication</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="mApplication">
<property name="toolTip">
<string>Specify a file containing the application to run when the reminder triggers</string>
</property>
<property name="whatsThis">
<string>Use the adjacent file browser to help you find the file you want to use when running an application when the reminder triggers.</string>
</property>
<property name="filter">
<string>*|All files</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mAppArgumentsLabel">
<property name="text">
<string>Ar&amp;guments:</string>
</property>
<property name="buddy">
<cstring>mAppArguments</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="mAppArguments">
<property name="toolTip">
<string>Specify arguments to pass to the application when the reminder triggers</string>
</property>
<property name="whatsThis">
<string>Enter the application arguments to use when running an application when the reminder triggers.</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="EmailStack">
<layout class="QGridLayout" name="gridLayout_4">
<property name="leftMargin">
......@@ -503,11 +423,6 @@ default email configured in Kmail (Settings menu/Configure Kmail/Identities).</s
<extends>QTextEdit</extends>
<header>ktextedit.h</header>
</customwidget>
<customwidget>
<class>QComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="global">PimCommonAkonadi/AddresseeLineEdit</include>
......
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