]> git.deb.at Git - pkg/abook.git/commitdiff
add show_cursor config option
authorJaakko Heinonen <jheinonen@users.sourceforge.net>
Sun, 29 May 2005 16:32:24 +0000 (16:32 +0000)
committerJaakko Heinonen <jheinonen@users.sourceforge.net>
Sun, 29 May 2005 16:32:24 +0000 (16:32 +0000)
ChangeLog
abookrc.5
list.c
options.c
options.h
sample.abookrc
ui.c

index ba7374767909d7c862d93514082a321e00398a44..18f056493cc7e6cfc70990a1b73cd0cda8e7400e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+0.5.4
+ - add show_cursor config option (idea from Cheryl Homiak)
+
 0.5.3
  - add allcvs filters (Christoph Sobotka)
  - removed a lefover debug message
index eaedf7d50f8b6fdc61b25e27ff0347a871ec7533..0602c98eaf8b8e47991c4d8c4591c1f349f3da35 100644 (file)
--- a/abookrc.5
+++ b/abookrc.5
@@ -103,6 +103,10 @@ Defines whether to avoid adding addresses already in data. Default is false.
 \fBsort_field\fP=field
 Defines the field to be used by the "sort by field" command. Default is "nick" (Nickname/Alias).
 
+.TP
+\fBshow_cursor\fP=[true|false]
+Defines if the cursor is visible in main display. Default is false.
+
 .SH SAMPLE CONFIGURATION FILE
 
 .nf
@@ -159,6 +163,9 @@ set add_email_prevent_duplicates=false
 # field to be used with "sort by field" command
 set sort_field=nick
 
+# show cursor in main display
+set show_cursor=false
+
 .fi
 
 .SH SEE ALSO
diff --git a/list.c b/list.c
index 62159522a74368d295f03f681d51193f2bfbeadf..9f293e9eb8b88abe2be6499fd712142a670d8edb 100644 (file)
--- a/list.c
+++ b/list.c
@@ -110,6 +110,11 @@ refresh_list()
                print_list_line(i, line, i == curitem);
         }
 
+       if(opt_get_bool(BOOL_SHOW_CURSOR)) {
+               wmove(list, curitem - first_list_item, 0);
+               /* need to call refresh() to update the cursor positions */
+               refresh();
+       }
         wrefresh(list);
 }
 
index 41bde1b920644eb332b4c2d48548403003b8a5dc..81fecde44fe7015f2802f3b43e9061e60e068c6a 100644 (file)
--- a/options.c
+++ b/options.c
@@ -66,6 +66,7 @@ static struct option abook_vars[] = {
 
        { "add_email_prevent_duplicates", OT_BOOL, BOOL_ADD_EMAIL_PREVENT_DUPLICATES, FALSE },
        { "sort_field", OT_STR, STR_SORT_FIELD, UL "nick" },
+       { "show_cursor", OT_BOOL, BOOL_SHOW_CURSOR, FALSE },
 
        { NULL }
 };
index cfdaa6c5c0dbee61730314708db5ad36ffe91a97..73b300cdf59cbcaffeb48e8f2ecf44de9f67d05e 100644 (file)
--- a/options.h
+++ b/options.h
@@ -18,6 +18,7 @@ enum bool_opts {
        BOOL_MUTT_RETURN_ALL_EMAILS,
        BOOL_USE_ASCII_ONLY,
        BOOL_ADD_EMAIL_PREVENT_DUPLICATES,
+       BOOL_SHOW_CURSOR,
        BOOL_MAX
 };
 
index bc352f3ae86e97e0bb6ec52e562698c67a1c8cd2..086235f8185bc465ca628cbb2c676b609c19f3b9 100644 (file)
@@ -52,6 +52,9 @@ set add_email_prevent_duplicates=false
 # field to be used with "sort by field" command
 set sort_field=nick
 
+# show cursor in main display
+set show_cursor=false
+
 # custom fields
 
 #customfield 1 Name1
diff --git a/ui.c b/ui.c
index d99397d4085a33747bc8ccd39e3a1f82c921a786..2799039ca11b0d7d76e146cee03081fde9ff26fa 100644 (file)
--- a/ui.c
+++ b/ui.c
@@ -375,13 +375,15 @@ get_commands()
 
        for(;;) {
                can_resize = TRUE; /* it's safe to resize now */
-               hide_cursor();
-               if( should_resize )
+               if(!opt_get_bool(BOOL_SHOW_CURSOR))
+                       hide_cursor();
+               if(should_resize)
                        refresh_screen();
                ch = getch();
-               show_cursor();
+               if(!opt_get_bool(BOOL_SHOW_CURSOR))
+                       show_cursor();
                can_resize = FALSE; /* it's not safe to resize anymore */
-               switch( ch ) {
+               switch(ch) {
                        case 'q': return;
                        case 'Q': quit_abook(QUIT_DONTSAVE);    break;
                        case 'P': print_stderr(selected_items() ?