X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=edit.c;h=ae7643ea95ef12f060fd15003fbc11f22a9521b8;hb=3990095c4ac65c7f6e10b2fa074f763d048a92eb;hp=d06c20a75fffcfce607d77b077a2042e6cf0583b;hpb=b162f92f3da943d51c5701725827d6c1dcd06796;p=pkg%2Fabook.git diff --git a/edit.c b/edit.c index d06c20a..ae7643e 100644 --- a/edit.c +++ b/edit.c @@ -10,6 +10,7 @@ #include #include #include "abook_curses.h" +#include "ui.h" #include "abook.h" #include "database.h" #include "list.h" @@ -42,7 +43,7 @@ editor_tab(int tab) "/ OTHER \\" }; - mvwhline(editw, TABLINE+1, 0, ACS_HLINE, EDITW_COLS); + mvwhline(editw, TABLINE+1, 0, UI_HLINE_CHAR, EDITW_COLS); for(i=0; i < TABS; i++) mvwaddstr(editw, TABLINE, 16 * i + 3, tab_names[i]); @@ -145,6 +146,7 @@ static void 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++) { @@ -155,18 +157,19 @@ editor_print_data(int tab, int item) 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++; } } @@ -353,6 +356,7 @@ edit_loop(int item) werase(editw); headerline(EDITOR_HELPLINE); + refresh_statusline(); print_editor_header(item); editor_tab(tab); editor_print_data(tab, item); @@ -371,8 +375,10 @@ edit_loop(int item) case KEY_RIGHT: tab = tab == MAX_TAB ? 0 : tab + 1; break; case 'r': roll_emails(item); break; - case '?': display_editor_help(editw); 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); }