void
-launch_mutt()
+launch_mutt(int item)
{
int i;
char email[MAX_EMAIL_LEN];
char *cmd;
char *tmp = options_get_str("mutt_command");
- if( list_is_empty() )
+ if( !is_valid_item(item) )
return;
cmd = strconcat(tmp, " '", NULL );
system(cmd);
free(cmd);
- refresh_screen();
}
void
-launch_lynx()
+launch_wwwbrowser(int item)
{
char *cmd = NULL;
- if( list_is_empty() )
+ if( !is_valid_item(item) )
return;
- if( database[list_current_item()][URL] )
+ if( database[item][URL] )
cmd = mkstr("%s '%s'",
options_get_str("www_command"),
- safe_str(database[list_current_item()][URL]));
+ safe_str(database[item][URL]));
else
return;
system(cmd);
free(cmd);
- refresh_screen();
}
void *
void *abook_realloc(void *ptr, size_t size);
FILE *abook_fopen (const char *path, const char *mode);
void quit_abook();
-void launch_lynx();
-void launch_mutt();
+void launch_wwwbrowser(int item);
+void launch_mutt(int item);
#ifdef _AIX
int strcasecmp (const char *, const char *);
int strncasecmp (const char *, const char *, size_t);
editor_print_data(int tab, int item)
{
const int pos_x = EDITW_COLS > 70 ? 8:4;
+ const int start_y = 4;
int i, j;
for(i = 0, j = 1; i < ITEM_FIELDS; i++) {
int k;
char emails[MAX_EMAILS][MAX_EMAIL_LEN];
split_emailstr(item, emails);
- mvwaddstr(editw, (LINES > 21 ? 7:6), pos_x, "E-mail addresses:");
+ mvwaddstr(editw, 6, pos_x, "E-mail addresses:");
for(k=0; k < MAX_EMAILS; k++)
- mvwprintw(editw, (LINES > 21 ? 9:7)+k*2, pos_x,
+ mvwprintw(editw, 7 + k, pos_x,
"%c -\t\t%s", '2' + k, emails[k] );
continue;
}
- mvwprintw(editw, 3+j*2, pos_x, "%d - %s",
+ mvwprintw(editw, start_y + j, pos_x, "%d - %s",
j,
abook_fields[i].name);
- mvwaddch(editw, 3+j*2, 28, ':');
- mvwaddstr(editw, 3+j*2, 30, safe_str(database[item][i]));
+ mvwaddch(editw, start_y + j, 28, ':');
+ mvwaddstr(editw, start_y + j, 30, safe_str(database[item][i]));
+
j++;
}
}
case 'r': roll_emails(item); break;
case '?': display_help(HELP_EDITOR); break;
case 'u': edit_undo(item, RESTORE_ITEM); break;
+ case 'm': launch_mutt(item);
+ case 'v': launch_wwwbrowser(item);
case 12 : clearok(stdscr, 1); break; /* ^L (refresh screen) */
default: return edit_field(tab, c, item);
}
" Z move current item down\n",
"\n",
" m send mail with mutt\n",
-" u view URL with lynx\n",
+" u view URL with www browser\n",
NULL
};
"\n",
" u undo\n",
"\n",
+" m send mail with mutt\n",
+" v view url with WWW browser\n",
+"\n",
NULL
};