X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;ds=sidebyside;f=ui.c;h=7c60b0681c11f3b370435f06d241a896e62036e7;hb=3990095c4ac65c7f6e10b2fa074f763d048a92eb;hp=25c6ba1146448eb5b6e84177caeb36adb108ba1b;hpb=af90a0834fb7f729d77b1312f58c80b187043218;p=pkg%2Fabook.git diff --git a/ui.c b/ui.c index 25c6ba1..7c60b06 100644 --- a/ui.c +++ b/ui.c @@ -472,11 +472,15 @@ get_commands() case 'Z': move_curitem(MOVE_ITEM_DOWN); break; - case 'm': launch_mutt(); break; + case 'm': launch_mutt(list_current_item()); + refresh_screen(); + break; case 'p': ui_print_database(); break; - case 'u': launch_lynx(); break; + case 'u': launch_wwwbrowser(list_current_item()); + refresh_screen(); + break; } } } @@ -556,14 +560,35 @@ ui_print_database() { FILE *handle; char *command = options_get_str("print_command"); + int mode; - if(!statusline_ask_boolean("Print addressbook", FALSE)) + if( list_is_empty() ) return; + statusline_addstr("Print All/Selected/Cancel (a/s/C)?"); + + switch( tolower(getch()) ) { + case 'a': + mode = ENUM_ALL; + break; + case 's': + if( !selected_items() ) { + statusline_msg("No selected items"); + return; + } + mode = ENUM_SELECTED; + break; + default: + clear_statusline(); + return; + } + + clear_statusline(); + if( ! *command || (handle = popen(command, "w")) == NULL) return; - fexport("text", handle); + fexport("text", handle, mode); pclose(handle); }