]> git.deb.at Git - pkg/abook.git/commitdiff
ui: makes potentially destructive operations safe to wrong key presses.
authorRaphaël Droz <raphael.droz+floss@gmail.com>
Thu, 18 Apr 2013 15:07:01 +0000 (17:07 +0200)
committerRaphaël Droz <raphael.droz+floss@gmail.com>
Thu, 18 Apr 2013 15:07:01 +0000 (17:07 +0200)
When a deletion, a merge or a deduplication of entries is requested,
accounts (translated) key binding other than [y|n] as a "no" instead
of "yes" to avoid mistakes.

ui.c

diff --git a/ui.c b/ui.c
index 4efcf85e1a3cde7ee45626a325e367c8c9300465..e8798858270654eeccb9daa5a6dbee2e0b1479e9 100644 (file)
--- a/ui.c
+++ b/ui.c
@@ -653,7 +653,7 @@ ui_remove_items()
        if(list_is_empty())
                return;
 
-       if(statusline_ask_boolean(_("Remove selected item(s)"), TRUE))
+       if(statusline_ask_boolean(_("Remove selected item(s)"), FALSE))
                remove_selected_items();
 
        clear_statusline();
@@ -663,7 +663,7 @@ ui_remove_items()
 void
 ui_merge_items()
 {
-       if(statusline_ask_boolean(_("Merge selected items"), TRUE))
+       if(statusline_ask_boolean(_("Merge selected items"), FALSE))
                merge_selected_items();
 
        clear_statusline();
@@ -672,7 +672,7 @@ ui_merge_items()
 
 void           ui_remove_duplicates()
 {
-       if(statusline_ask_boolean(_("Remove duplicates"), TRUE))
+       if(statusline_ask_boolean(_("Remove duplicates"), FALSE))
                remove_duplicates();
        
        clear_statusline();