From 9c0c43a73e51f90576e1044286dbebfc13cec6a3 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Tue, 26 Jan 2010 11:48:16 +0000 Subject: [PATCH] Fix annotation text (edit or add). svn path=/trunk/KDE/kdepim/kmail/; revision=1080538 --- messageactions.cpp | 22 ++++++++++++++-------- messageactions.h | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/messageactions.cpp b/messageactions.cpp index 1ddad510b..60bfb3273 100644 --- a/messageactions.cpp +++ b/messageactions.cpp @@ -252,13 +252,7 @@ void MessageActions::updateActions() mNoQuoteReplyAction->setEnabled( singleMsg ); mAnnotateAction->setEnabled( singleMsg ); - if( mCurrentItem.isValid() ) { - Nepomuk::Resource resource( mCurrentItem.url() ); - if ( resource.description().isEmpty() ) - mAnnotateAction->setText( i18n( "Add Note..." ) ); - else - mAnnotateAction->setText( i18n( "Edit Note...") ); - } + updateAnnotateAction(); mStatusMenu->setEnabled( multiVisible ); mToggleFlagAction->setEnabled( flagsAvailable ); @@ -509,7 +503,19 @@ void MessageActions::annotateMessage() KPIM::AnnotationEditDialog *dialog = new KPIM::AnnotationEditDialog( mCurrentItem.url() ); dialog->setAttribute( Qt::WA_DeleteOnClose ); - dialog->show(); + dialog->exec(); + updateAnnotateAction(); +} + +void MessageActions::updateAnnotateAction() +{ + if( mCurrentItem.isValid() ) { + Nepomuk::Resource resource( mCurrentItem.url() ); + if ( resource.description().isEmpty() ) + mAnnotateAction->setText( i18n( "Add Note..." ) ); + else + mAnnotateAction->setText( i18n( "Edit Note...") ); + } } #include "messageactions.moc" diff --git a/messageactions.h b/messageactions.h index ccc42c28e..b77f8b94e 100644 --- a/messageactions.h +++ b/messageactions.h @@ -98,7 +98,7 @@ class MessageActions : public QObject void setMessageStatus( KPIM::MessageStatus status, bool toggle = false ); void addMailingListAction( const QString &item, const KUrl &url ); void addMailingListActions( const QString &item, const KUrl::List &list ); - + void updateAnnotateAction(); private slots: void slotReplyToMsg(); void slotReplyAuthorToMsg();