Root/abook/patches/001-term-size.patch

1diff -ur abook-0.5.6.orig/abook.h abook-0.5.6/abook.h
2--- abook-0.5.6.orig/abook.h 2011-02-25 23:19:11.845185113 +0300
3+++ abook-0.5.6/abook.h 2011-02-25 23:19:46.911085068 +0300
4@@ -13,12 +13,12 @@
5 int strncasecmp (const char *, const char *, size_t);
6 #endif
7 
8-#define MAIN_HELPLINE N_("q:quit ?:help a:add r:remove")
9+#define MAIN_HELPLINE N_("q:quit ?:help a:add r:remove")
10 
11 #define Y_STATUSLINE (LINES - 2)
12 
13 #define MIN_LINES 20
14-#define MIN_COLS 70
15+#define MIN_COLS 53
16 
17 #define DEFAULT_UMASK 066
18 #define DIR_IN_HOME ".abook"
19diff -ur abook-0.5.6.orig/edit.c abook-0.5.6/edit.c
20--- abook-0.5.6.orig/edit.c 2011-02-25 23:19:11.842184004 +0300
21+++ abook-0.5.6/edit.c 2011-02-25 23:19:28.277058807 +0300
22@@ -39,40 +39,39 @@
23 editor_tab(const int tab)
24 {
25     int i, j;
26- int x_pos = 2; /* current x pos */
27+ int x_pos = 0; /* current x pos */
28     static char *tab_names[] = {
29         N_("CONTACT"),
30         N_("ADDRESS"),
31- N_(" PHONE "),
32- N_(" OTHER "),
33- N_("CUSTOM ")
34+ N_("PHONE"),
35+ N_("OTHER"),
36+ N_("CUSTOM")
37     };
38 
39     mvwhline(editw, TABLINE + 1, 0, UI_HLINE_CHAR, EDITW_COLS);
40 
41     for(i = 0; i < TABS; i++) {
42- int width = strwidth(gettext(tab_names[i])) + 5;
43+ int width = strwidth(gettext(tab_names[i])) + 4;
44 
45         if(x_pos + width + 1 > EDITW_COLS) {
46             statusline_msg(_("Tab name too wide for screen"));
47             break;
48         }
49-
50         mvwaddch(editw, TABLINE + 1, x_pos, UI_TEE_CHAR);
51- mvwaddch(editw, TABLINE + 1, x_pos + width - 2, UI_TEE_CHAR);
52+ mvwaddch(editw, TABLINE + 1, x_pos + width - 1, UI_TEE_CHAR);
53 
54         mvwaddch(editw, TABLINE, x_pos, UI_ULCORNER_CHAR);
55         mvwaddch(editw, TABLINE, x_pos + 1, UI_LBOXLINE_CHAR);
56         mvwaddstr(editw, TABLINE, x_pos + 2, gettext(tab_names[i]));
57- mvwaddch(editw, TABLINE, x_pos + width - 3, UI_RBOXLINE_CHAR);
58- mvwaddch(editw, TABLINE, x_pos + width - 2, UI_URCORNER_CHAR);
59+ mvwaddch(editw, TABLINE, x_pos + width - 2, UI_RBOXLINE_CHAR);
60+ mvwaddch(editw, TABLINE, x_pos + width - 1, UI_URCORNER_CHAR);
61 
62         if(i == tab) {
63             mvwaddch(editw, TABLINE + 1, x_pos, UI_LRCORNER_CHAR);
64- for(j = 0; j < width - 3; j++)
65+ for(j = 0; j < width - 2; j++)
66                 mvwaddstr(editw,
67                     TABLINE + 1, x_pos + j + 1, " ");
68- mvwaddch(editw, TABLINE + 1, x_pos + width - 2,
69+ mvwaddch(editw, TABLINE + 1, x_pos + width - 1,
70                 UI_LLCORNER_CHAR);
71         }
72         x_pos += width;
73diff -ur abook-0.5.6.orig/edit.h abook-0.5.6/edit.h
74--- abook-0.5.6.orig/edit.h 2011-02-25 23:19:11.844183690 +0300
75+++ abook-0.5.6/edit.h 2011-02-25 23:19:28.277058807 +0300
76@@ -5,20 +5,20 @@
77 void get_first_email(char *str, int item);
78 void add_item();
79 
80-#define EDITW_COLS (COLS - 6)
81+#define EDITW_COLS COLS
82 #define EDITW_LINES (LINES - 5)
83 #define EDITW_TOP 2
84-#define EDITW_X 3
85+#define EDITW_X 0
86 
87-#define EDITOR_HELPLINE N_("?:help c:contact a:address p:phone o:other")
88+#define EDITOR_HELPLINE N_("?:help c:cont. a:addr. p:phone o:other")
89 
90 #define TABLINE 1
91 
92 #define MAX_TAB_FIELDS 7
93 
94-#define TAB_COLON_POS 28
95+#define TAB_COLON_POS 19
96 #define FIELDS_START_Y 4
97-#define FIELDS_START_X 4
98+#define FIELDS_START_X 0
99 
100 enum {
101     TAB_CONTACT,
102diff -ur abook-0.5.6.orig/help.h abook-0.5.6/help.h
103--- abook-0.5.6.orig/help.h 2011-02-25 23:19:11.844183690 +0300
104+++ abook-0.5.6/help.h 2011-02-25 23:19:28.277058807 +0300
105@@ -8,43 +8,43 @@
106 /* TODO gettext: handle key and description separately? */
107 static char *mainhelp[] = {
108 
109-N_(" ? help\n"),
110-N_(" q quit\n"),
111-N_(" Q quit without saving\n"),
112-N_(" P quit and output selected item(s) to stderr\n"),
113-N_(" ^L refresh screen\n"),
114-"\n",
115-N_(" arrows / j,k scroll list\n"),
116-N_(" enter view/edit item\n"),
117-N_(" a add item\n"),
118-N_(" r / del remove selected items\n"),
119-N_(" D duplicate item\n"),
120-"\n",
121-N_(" space select item\n"),
122-N_(" + select all\n"),
123-N_(" - unselect all\n"),
124-N_(" * invert selection\n"),
125-"\n",
126-N_(" w write database to disk\n"),
127-N_(" l read database from disk\n"),
128-N_(" C clear whole database\n"),
129-N_(" i import database\n"),
130-N_(" e export database\n"),
131-N_(" p print database\n"),
132-N_(" o open database\n"),
133-"\n",
134-N_(" s sort database\n"),
135-N_(" S \"surname sort\"\n"),
136-N_(" F sort by field (defined in configuration file)\n"),
137+N_(" ? help\n"),
138+N_(" q quit\n"),
139+N_(" Q quit without saving\n"),
140+N_(" P quit and output selected item(s) to stderr\n"),
141+N_(" ^L refresh screen\n"),
142+"\n",
143+N_(" arrows / j,k scroll list\n"),
144+N_(" enter view/edit item\n"),
145+N_(" a add item\n"),
146+N_(" r / del remove selected items\n"),
147+N_(" D duplicate item\n"),
148+"\n",
149+N_(" space select item\n"),
150+N_(" + select all\n"),
151+N_(" - unselect all\n"),
152+N_(" * invert selection\n"),
153+"\n",
154+N_(" w write database to disk\n"),
155+N_(" l read database from disk\n"),
156+N_(" C clear whole database\n"),
157+N_(" i import database\n"),
158+N_(" e export database\n"),
159+N_(" p print database\n"),
160+N_(" o open database\n"),
161+"\n",
162+N_(" s sort database\n"),
163+N_(" S \"surname sort\"\n"),
164+N_(" F sort by field (defined in configuration file)\n"),
165 "\n",
166-N_(" / search\n"),
167-N_(" \\ search next occurrence\n"),
168+N_(" / search\n"),
169+N_(" \\ search next occurrence\n"),
170 "\n",
171-N_(" A move current item up\n"),
172-N_(" Z move current item down\n"),
173+N_(" A move current item up\n"),
174+N_(" Z move current item down\n"),
175 "\n",
176-N_(" m send mail with mutt\n"),
177-N_(" v view URL with web browser\n"),
178+N_(" m send mail with mutt\n"),
179+N_(" v view URL with web browser\n"),
180 NULL
181 
182 };
183@@ -52,19 +52,19 @@
184 static char *editorhelp[] = {
185 
186 "\n",
187-N_(" a,c,p,o,C/arrows/h,l change tab\n"),
188+N_(" a,c,p,o,C/arrows/h,l change tab\n"),
189 "\n",
190-N_(" 1 - 5 edit fields\n"),
191+N_(" 1 - 5 edit fields\n"),
192 "\n",
193-N_(" k or < previous item\n"),
194-N_(" j or > next item\n"),
195+N_(" k or < previous item\n"),
196+N_(" j or > next item\n"),
197 "\n",
198-N_(" r roll e-mail addresses\n"),
199+N_(" r roll e-mail addresses\n"),
200 "\n",
201-N_(" u undo\n"),
202+N_(" u undo\n"),
203 "\n",
204-N_(" m send mail with mutt\n"),
205-N_(" v view url with web browser\n"),
206+N_(" m send mail with mutt\n"),
207+N_(" v view url with web browser\n"),
208 "\n",
209 NULL
210 
211diff -ur abook-0.5.6.orig/options.c abook-0.5.6/options.c
212--- abook-0.5.6.orig/options.c 2011-02-25 23:19:11.845185113 +0300
213+++ abook-0.5.6/options.c 2011-02-25 23:19:28.278059364 +0300
214@@ -49,10 +49,10 @@
215     { "autosave", OT_BOOL, BOOL_AUTOSAVE, TRUE },
216 
217     { "show_all_emails", OT_BOOL, BOOL_SHOW_ALL_EMAILS, TRUE },
218- { "emailpos", OT_INT, INT_EMAILPOS, 25 },
219+ { "emailpos", OT_INT, INT_EMAILPOS, 16 },
220     { "extra_column", OT_STR, STR_EXTRA_COLUMN, UL "phone" },
221     { "extra_alternative", OT_STR, STR_EXTRA_ALTERNATIVE, UL "-1" },
222- { "extrapos", OT_INT, INT_EXTRAPOS, 65 },
223+ { "extrapos", OT_INT, INT_EXTRAPOS, 40 },
224 
225     { "mutt_command", OT_STR, STR_MUTT_COMMAND, UL "mutt" },
226     { "mutt_return_all_emails", OT_BOOL, BOOL_MUTT_RETURN_ALL_EMAILS,
227diff -ur abook-0.5.6.orig/ui.c abook-0.5.6/ui.c
228--- abook-0.5.6.orig/ui.c 2011-02-25 23:19:11.841184150 +0300
229+++ abook-0.5.6/ui.c 2011-02-25 23:19:28.278059364 +0300
230@@ -406,7 +406,7 @@
231         default:return;
232     }
233 
234- helpw = newwin(LINES - 5, COLS - 6, 2, 3);
235+ helpw = newwin(LINES - 5, COLS, 2, 0);
236     erase();
237     headerline(_("help"));
238 
239@@ -588,7 +588,7 @@
240 void
241 ui_print_number_of_items()
242 {
243- char *str = strdup_printf(" " "|%3d/%3d", selected_items(), items);
244+ char *str = strdup_printf(" " "|%3d/%3d", selected_items(), items);
245 
246     mvaddstr(0, COLS-strlen(str), str);
247 
248

Archive Download this file



interactive