Commit a2580962 authored by Allen Winter's avatar Allen Winter
Browse files

forward port SVN commit 1181343 by winterz:

add a keyPress handler to trap the <Return> key so it can't be used
to close the reminder accidentally.
kolab/issue4423

svn path=/trunk/KDE/kdepim/korganizer/; revision=1181363
parent d3b516a6
......@@ -58,6 +58,7 @@
#include <phonon/mediaobject.h>
#include <QLabel>
#include <QKeyEvent>
#include <QSpinBox>
#include <QTreeWidget>
#include <QVBoxLayout>
......@@ -320,10 +321,11 @@ void AlarmDialog::addIncidence( const Akonadi::Item &incidenceitem,
item->setText( 2, IncidenceFormatter::dateTimeToString(
item->mTrigger, false, true, KDateTime::Spec::LocalZone() ) );
QString tip =
IncidenceFormatter::toolTipStr( CalendarSupport::displayName( incidenceitem.parentCollection() ),
incidence,
item->mRemindAt.date(), true,
KDateTime::Spec::LocalZone() );
IncidenceFormatter::toolTipStr(
CalendarSupport::displayName( incidenceitem.parentCollection() ),
incidence,
item->mRemindAt.date(), true,
KDateTime::Spec::LocalZone() );
if ( !item->mDisplayText.isEmpty() ) {
tip += "<br>" + item->mDisplayText;
}
......@@ -672,7 +674,8 @@ void AlarmDialog::eventNotification()
}
QString body =
IncidenceFormatter::mailBodyStr( parent.staticCast<IncidenceBase>(), KSystemTimeZones::local() );
IncidenceFormatter::mailBodyStr(
parent.staticCast<IncidenceBase>(), KSystemTimeZones::local() );
if ( !alarm->mailText().isEmpty() ) {
body += '\n' + alarm->mailText();
}
......@@ -881,4 +884,16 @@ void AlarmDialog::slotCalendarChanged()
}
}
void AlarmDialog::keyPressEvent( QKeyEvent *e )
{
const int key = e->key() | e->modifiers();
if ( key == Qt::Key_Enter || key == Qt::Key_Return ) {
e->ignore();
return;
}
KDialog::keyPressEvent( e );
}
#include "alarmdialog.moc"
......@@ -94,11 +94,10 @@ class AlarmDialog : public KDialog
void toggleDetails( QTreeWidgetItem *item, int column );
protected:
void keyPressEvent( QKeyEvent *e );
void closeEvent( QCloseEvent * );
private:
static KDateTime triggerDateForIncidence( const KCalCore::Incidence::Ptr &inc,
const QDateTime &reminderAt,
QString &displayStr );
......
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