Re: use same numbers for pager(responses) and thread(articles) view
Rado S <[email protected]> Sun, 27 May 2007 13:11:26 +0200
| Newsgroups | gmane.network.tin.devel |
|---|---|
| Message-ID | <[email protected]> |
=- Urs JanÃen wrote on Sat 26.May'07 at 17:01:49 +0200 -=
> now the threadlvel is the only level where the numbering begins
> with 0, in the group or select level and in the menu the numbering
> starts with 1. fixing one ionconsistency by adding another one
> isn't very helpfull.
Ah wait, thread view with its articles is related to the pager and
its articles: they deal with the same items (articles), therefore
the consistency is to mean the same article when you press the same
number.
But they're both unrelated to the other levels, the numbers don't
have any ties to each other.
Group or select (which thread) is independent from that, you won't
hit the same number from thread or pager view in the select or group
view, so you have to note independently which number you want to
press.
Your (in)consistency is just looks, while mine is functional.
If you prefer, we can make all lists begin with 0 or 1, but still
keep the relationship between numbers typed in thread and pager.
> > - if ((num = prompt_num(ch, _(txt_read_resp))) == -1) {
> > + if ((num = prompt_num(ch, _(txt_select_art))) == -1) {
>
> here you remove the last occurence of txt_read_resp but it is
> still in extern.h/lang.c
Oh right, sorry, I also removed the entries from po/*.po, but *.gmo
would have to be regenerated.
I replaced line 608 in lang.c with an empty one, because otherwise
all the references in *.po would be off-by-one. If the comments in
the *.po are generated, too, please delete the line and adjust *.po.
Correction attached.
--
© Rado S. -- You must provide YOUR effort for your goal!
EVERY effort counts: at least to show your attitude.
You're responsible for ALL you do: you get what you give.
samenumber.pat
(text/plain, 7.4 KB)
diff -ur torg/include/extern.h tgo/include/extern.h
--- torg/include/extern.h Tue Mar 27 20:25:48 2007
+++ tgo/include/extern.h Sun May 27 12:30:07 2007
@@ -975,7 +975,6 @@
extern constext txt_range_invalid[];
extern constext txt_read_abort[];
extern constext txt_read_exit[];
-extern constext txt_read_resp[];
extern constext txt_reading_article[];
extern constext txt_reading_arts[];
extern constext txt_reading_attributes_file[];
diff -ur torg/include/proto.h tgo/include/proto.h
--- torg/include/proto.h Tue Mar 27 20:25:48 2007
+++ tgo/include/proto.h Fri May 25 20:32:42 2007
@@ -205,7 +205,7 @@
extern void top_of_list(void);
extern void end_of_list(void);
extern void move_to_item(int n);
-extern void prompt_item_num(int ch, const char *prompt);
+extern void prompt_item_num(int startwith, int ch, const char *prompt);
extern void scroll_down(void);
extern void scroll_up(void);
extern void set_first_screen_item(void);
diff -ur torg/po/de.po tgo/po/de.po
--- torg/po/de.po Tue Mar 27 20:25:49 2007
+++ tgo/po/de.po Sun May 27 12:33:40 2007
@@ -2627,10 +2627,6 @@
msgid "Do you want to exit tin immediately?"
msgstr "Wollen Sie tin augenblicklich verlassen?"
-#: src/lang.c:608
-msgid "Read response> "
-msgstr "Lese Antwort> "
-
#: src/lang.c:609
msgid "Reading ('q' to quit)..."
msgstr "Lesen ('q' zum Beenden)..."
diff -ur torg/po/en_GB.po tgo/po/en_GB.po
--- torg/po/en_GB.po Tue Mar 27 20:25:49 2007
+++ tgo/po/en_GB.po Sun May 27 12:33:55 2007
@@ -2443,10 +2443,6 @@
msgid "Do you want to exit tin immediately?"
msgstr ""
-#: src/lang.c:608
-msgid "Read response> "
-msgstr ""
-
#: src/lang.c:609
msgid "Reading ('q' to quit)..."
msgstr ""
diff -ur torg/po/et.po tgo/po/et.po
--- torg/po/et.po Tue Mar 27 20:25:49 2007
+++ tgo/po/et.po Sun May 27 12:34:23 2007
@@ -2562,10 +2562,6 @@
msgid "Do you want to exit tin immediately?"
msgstr "Kas soovite viivitamata tinist väljuda?"
-#: src/lang.c:608
-msgid "Read response> "
-msgstr "Loen vastust> "
-
#: src/lang.c:609
msgid "Reading ('q' to quit)..."
msgstr "Loen ('q' katkestamiseks)..."
diff -ur torg/po/fr.po tgo/po/fr.po
--- torg/po/fr.po Tue Mar 27 20:25:49 2007
+++ tgo/po/fr.po Sun May 27 12:34:32 2007
@@ -2588,10 +2588,6 @@
msgid "Do you want to exit tin immediately?"
msgstr "Voulez-vous quitter tin immédiatement ?"
-#: src/lang.c:608
-msgid "Read response> "
-msgstr "Lire la réponse> "
-
#: src/lang.c:609
msgid "Reading ('q' to quit)..."
msgstr "Lecture ('q' pour quitter)..."
diff -ur torg/po/ru.po tgo/po/ru.po
--- torg/po/ru.po Tue Mar 27 20:25:49 2007
+++ tgo/po/ru.po Sun May 27 12:34:42 2007
@@ -2527,10 +2527,6 @@
msgid "Do you want to exit tin immediately?"
msgstr "ֈ ÃÃÃÃÃÃ
ÃÃÃÃÃ ÃÃ tin ÃÃ
ÃÃ
ÃÃÃ
ÃÃÃ?"
-#: src/lang.c:608
-msgid "Read response> "
-msgstr "ðÃÃÃÃÃÃÃà ÃÃÃÃ
Ã> "
-
#: src/lang.c:609
msgid "Reading ('q' to quit)..."
msgstr "þÃÃ
ÃÃÃ
('q' - ÃÃÃÃÃ)..."
diff -ur torg/po/rw.po tgo/po/rw.po
--- torg/po/rw.po Tue Mar 27 20:25:49 2007
+++ tgo/po/rw.po Sun May 27 12:34:58 2007
@@ -2784,10 +2784,6 @@
msgid "Do you want to exit tin immediately?"
msgstr "Kuri Gusohoka Ako kanya"
-#: src/lang.c:608
-msgid "Read response> "
-msgstr ""
-
#: src/lang.c:609
#, fuzzy
msgid "Reading ('q' to quit)..."
diff -ur torg/po/sv.po tgo/po/sv.po
--- torg/po/sv.po Tue Mar 27 20:25:49 2007
+++ tgo/po/sv.po Sun May 27 12:35:14 2007
@@ -2454,10 +2454,6 @@
msgid "Do you want to exit tin immediately?"
msgstr "Vill du avsluta tin omedelbart?"
-#: src/lang.c:608
-msgid "Read response> "
-msgstr "Läsa svar> "
-
#: src/lang.c:609
msgid "Reading ('q' to quit)..."
msgstr "Läser (\"q\" för att avsluta)..."
diff -ur torg/po/tin.pot tgo/po/tin.pot
--- torg/po/tin.pot Tue Mar 27 20:25:48 2007
+++ tgo/po/tin.pot Sun May 27 12:36:15 2007
@@ -2509,10 +2509,6 @@
msgid "Do you want to exit tin immediately?"
msgstr ""
-#: src/lang.c:608
-msgid "Read response> "
-msgstr ""
-
#: src/lang.c:609
msgid "Reading ('q' to quit)..."
msgstr ""
diff -ur torg/po/tr.po tgo/po/tr.po
--- torg/po/tr.po Tue Mar 27 20:25:49 2007
+++ tgo/po/tr.po Sun May 27 12:35:27 2007
@@ -2887,11 +2887,6 @@
msgid "Do you want to exit tin immediately?"
msgstr "tin'den hemen çýkmak istediðinizden emin misisniz?"
-#: src/lang.c:608
-#, fuzzy
-msgid "Read response> "
-msgstr "Yanýtý oku> "
-
#: src/lang.c:609
#, fuzzy
msgid "Reading ('q' to quit)..."
diff -ur torg/src/global.c tgo/src/global.c
--- torg/src/global.c Tue Mar 27 20:25:48 2007
+++ tgo/src/global.c Sat May 26 16:23:53 2007
@@ -195,6 +195,7 @@
void
prompt_item_num(
+ int startwith,
int ch,
const char *prompt)
{
@@ -206,8 +207,9 @@
clear_message();
return;
}
+ num += 1 - startwith;
- if (--num < 0) /* index from 0 (internal) vs. 1 (user) */
+ if (--num < 0) /* index from 0 (internal) vs. 1 (user, not for thread.c, begins with 0, too, to match page.c) */
num = 0;
if (num >= currmenu->max)
diff -ur torg/src/group.c tgo/src/group.c
--- torg/src/group.c Tue Mar 27 20:25:48 2007
+++ tgo/src/group.c Fri May 25 20:30:24 2007
@@ -214,7 +214,7 @@
case DIGIT_8:
case DIGIT_9:
if (grpmenu.max)
- prompt_item_num(func_to_key(func, group_keys), _(txt_select_thread));
+ prompt_item_num(1,func_to_key(func, group_keys), _(txt_select_thread));
break;
# ifndef NO_SHELL_ESCAPE
diff -ur torg/src/lang.c tgo/src/lang.c
--- torg/src/lang.c Tue Mar 27 20:25:48 2007
+++ tgo/src/lang.c Sun May 27 12:56:54 2007
@@ -605,7 +605,7 @@
constext txt_range_invalid[] = N_("Invalid range - valid are '0-9.$' eg. 1-$");
constext txt_read_abort[] = N_("Do you want to abort this operation?");
constext txt_read_exit[] = N_("Do you want to exit tin immediately?");
-constext txt_read_resp[] = N_("Read response> ");
+
constext txt_reading_article[] = N_("Reading ('q' to quit)...");
constext txt_reading_arts[] = N_("Reading %sarticles...");
constext txt_reading_attributes_file[] = N_("Reading %sattributes file...\n");
diff -ur torg/src/page.c tgo/src/page.c
--- torg/src/page.c Tue Mar 27 20:25:48 2007
+++ tgo/src/page.c Sat May 26 15:59:17 2007
@@ -1785,7 +1785,7 @@
clear_message();
- if ((num = prompt_num(ch, _(txt_read_resp))) == -1) {
+ if ((num = prompt_num(ch, _(txt_select_art))) == -1) {
clear_message();
return -1;
}
diff -ur torg/src/select.c tgo/src/select.c
--- torg/src/select.c Tue Mar 27 20:25:48 2007
+++ tgo/src/select.c Fri May 25 20:31:45 2007
@@ -146,7 +146,7 @@
case DIGIT_8:
case DIGIT_9:
if (selmenu.max)
- prompt_item_num(func_to_key(func, select_keys), _(txt_select_group));
+ prompt_item_num(1,func_to_key(func, select_keys), _(txt_select_group));
else
info_message(_(txt_no_groups));
break;
diff -ur torg/src/thread.c tgo/src/thread.c
--- torg/src/thread.c Tue Mar 27 20:25:48 2007
+++ tgo/src/thread.c Sat May 26 15:56:43 2007
@@ -152,7 +152,7 @@
sprintf(buffer, "%s ", tin_ltoa(l + 1, 6));
else
#endif /* 0 */
- sprintf(buffer, " %s ", tin_ltoa(l + 1, 4));
+ sprintf(buffer, " %s ", tin_ltoa(l , 4));
rest_of_line -= 7;
/*
@@ -470,6 +470,7 @@
case GLOBAL_ABORT: /* Abort */
break;
+ case DIGIT_0:
case DIGIT_1:
case DIGIT_2:
case DIGIT_3:
@@ -482,7 +483,7 @@
if (thdmenu.max == 1)
info_message(_(txt_no_responses));
else
- prompt_item_num(func_to_key(func, thread_keys), _(txt_select_art));
+ prompt_item_num(0,func_to_key(func, thread_keys), _(txt_select_art));
break;
#ifndef NO_SHELL_ESCAPE