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

Archive Download this file



interactive