[gnote] Show note title when deleting only 1 note



commit bb7980ff072101f457523afafecf307edcade750
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Tue Aug 30 22:54:01 2011 +0300

    Show note title when deleting only 1 note
    
    Show note title in confirmation dialog instead of number of notes,
    when deleting only one note.

 src/note.cpp |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/note.cpp b/src/note.cpp
index 1571967..158dab9 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -64,19 +64,19 @@ namespace gnote {
     {
       std::string message;
 
-      // %1% is the number of note.
-      message = ngettext("Really delete this note?", "Really delete these %1% notes?", notes.size());
-
-      boost::format format(message);
-      // make sure an exception is not raised for the non-plural form
-      format.exceptions( boost::io::all_error_bits ^ 
-                         ( boost::io::too_many_args_bit | 
-                           boost::io::too_few_args_bit )  );
+      if(notes.size() == 1) {
+        // TRANSLATORS: %1% will be replaced by note title
+        message = str(boost::format("Really delete \"%1%\"?") % notes.front()->get_title());
+      }
+      else {
+        // TRANSLATORS: %1% is number of notes
+        message = str(boost::format(ngettext("Really delete %1% note?", "Really delete %1% notes?", notes.size())) % notes.size());
+      }
 
       utils::HIGMessageDialog dialog(parent, GTK_DIALOG_DESTROY_WITH_PARENT,
                                      Gtk::MESSAGE_QUESTION,
                                      Gtk::BUTTONS_NONE,
-                                     str(format % notes.size()),
+                                     message,
                                      _("If you delete a note it is permanently lost."));
 
       Gtk::Button *button;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]