giftcurs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[giFTcurs-commits] giFTcurs/src ui_help.c


From: Christian Häggström
Subject: [giFTcurs-commits] giFTcurs/src ui_help.c
Date: Mon, 15 Sep 2003 17:51:41 -0400

CVSROOT:        /cvsroot/giftcurs
Module name:    giFTcurs
Branch:         
Changes by:     Christian Häggström <address@hidden>    03/09/15 17:51:41

Modified files:
        src            : ui_help.c 

Log message:
        Use format strings for help screen.

Patches:
Index: giFTcurs/src/ui_help.c
diff -u giFTcurs/src/ui_help.c:1.84 giFTcurs/src/ui_help.c:1.85
--- giFTcurs/src/ui_help.c:1.84 Thu Jul  3 04:02:25 2003
+++ giFTcurs/src/ui_help.c      Mon Sep 15 17:51:40 2003
@@ -18,7 +18,7 @@
  * along with giFTcurs; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,  USA.
  *
- * $Id: ui_help.c,v 1.84 2003/07/03 08:02:25 weinholt Exp $
+ * $Id: ui_help.c,v 1.85 2003/09/15 21:51:40 saturn Exp $
  */
 #include "giftcurs.h"
 
@@ -30,11 +30,13 @@
 #include "ui_mouse.h"
 #include "ui.h"
 #include "ui_draw.h"
+#include "format.h"
 
 static list help = LIST_INITIALIZER;
 static int build_width = -1;
 static int my_screen_number;
 static const ui_methods help_screen_methods;
+static char *generated_text;
 
 /* Rules for the help text, so that line split works:
        - Don't use tab
@@ -43,28 +45,28 @@
 Welcome to giFTcurs!\n\
 \n\
 Key list:\n\
-\vBup\va/\vBdown\va        select item or scroll in a list\n\
-\vBPgUp\va/\vBPgDown\va    scroll lists one screen at a time\n\
-\vBtab\va            move to the next input field\n\
-\vBF1\va             this help screen\n\
-\vBF2\va             the main screen\n\
-    \vBenter\va      download the highlighted file\n\
-    \vBleft\va/\vBright\va change sorting method\n\
-    \vBe\va          expand/collapse search results\n\
-    \vBj\va/\vBk\va        scroll information box\n\
-    \vBp\va          change network in statistics box\n\
-    \vBu\va          browse selected user\n\
-    \vBi\va          ignore selected user, this session\n\
-    \vBshift\va-\vBi\va    ignore selected user, all sessions\n\
-\vBF3\va             the transfer screen\n\
-    \vBenter\va/\vBe\va    expand/collapse transfer\n\
-    \vBleft\va/\vBright\va change sorting method\n\
-    \vBj\va/\vBk\va        move window splitter\n\
-\vBF4\va             the console screen\n\
-    \vBv\va          toggle verbose mode\n\
-    \vBw\va          toggle line wrap\n\
-\vBF5\va             the settings screen\n\
-\vBF10\va/\vBq\va          exit the program\n\
+{%header:B}up{%prev}/{%header:B}down{%prev}        select item or scroll in a 
list\n\
+{%header:B}PgUp{%prev}/{%header:B}PgDown{%prev}    scroll lists one screen at 
a time\n\
+{%header:B}tab{%prev}            move to the next input field\n\
+{%header:B}F1{%prev}             this help screen\n\
+{%header:B}F2{%prev}             the main screen\n\
+    {%header:B}enter{%prev}      download the highlighted file\n\
+    {%header:B}left{%prev}/{%header:B}right{%prev} change sorting method\n\
+    {%header:B}e{%prev}          expand/collapse search results\n\
+    {%header:B}j{%prev}/{%header:B}k{%prev}        scroll information box\n\
+    {%header:B}p{%prev}          change network in statistics box\n\
+    {%header:B}u{%prev}          browse selected user\n\
+    {%header:B}i{%prev}          ignore selected user, this session\n\
+    {%header:B}shift{%prev}-{%header:B}i{%prev}    ignore selected user, all 
sessions\n\
+{%header:B}F3{%prev}             the transfer screen\n\
+    {%header:B}enter{%prev}/{%header:B}e{%prev}    expand/collapse transfer\n\
+    {%header:B}left{%prev}/{%header:B}right{%prev} change sorting method\n\
+    {%header:B}j{%prev}/{%header:B}k{%prev}        move window splitter\n\
+{%header:B}F4{%prev}             the console screen\n\
+    {%header:B}v{%prev}          toggle verbose mode\n\
+    {%header:B}w{%prev}          toggle line wrap\n\
+{%header:B}F5{%prev}             the settings screen\n\
+{%header:B}F10{%prev}/{%header:B}q{%prev}          exit the program\n\
 \n\
 See giFTcurs(1) and giFTcurs.conf(5) for more information.");
 
@@ -101,6 +103,15 @@
 
 void help_screen_init(void)
 {
+       char *fnord;
+
+       format_t tmp = format_compile(_(helptext));
+
+       g_assert(tmp);
+       fnord = format_expand(tmp, NULL, 99999, NULL);
+       generated_text = g_strjoin("\n\n", fnord, _(copyright), license, NULL);
+       g_free(fnord);
+
        help_screen_resize();
 
        my_screen_number = register_screen(&help_screen_methods);
@@ -108,12 +119,8 @@
 
 static void help_screen_resize(void)
 {
-       char *fnord;
-
-       fnord = g_strjoin("\n\n", _(helptext), _(copyright), license, NULL);
        list_free_entries(&help);
-       wrap_lines(&help, fnord, max_x - 4);
-       g_free(fnord);
+       wrap_lines(&help, generated_text, max_x - 4);
        build_width = max_x;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]