diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-04-01 16:07:58 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-04-01 16:07:58 +0200 |
commit | fae6bae6d47b5bf9328627cad851be6a227fd982 (patch) | |
tree | 45ef5d5b62140815601eed0c4d7cd13e1c9dc816 /svdrp.c | |
parent | f1fce1393827ac71875e2b4192e3496ef421dbbb (diff) | |
download | vdr-fae6bae6d47b5bf9328627cad851be6a227fd982.tar.gz vdr-fae6bae6d47b5bf9328627cad851be6a227fd982.tar.bz2 |
The SVDRP HELP command now prints the topics in several columns0.7.2
Diffstat (limited to 'svdrp.c')
-rw-r--r-- | svdrp.c | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 1.17 2001/04/01 15:38:49 kls Exp $ + * $Id: svdrp.c 1.18 2001/04/01 16:06:54 kls Exp $ */ #define _GNU_SOURCE @@ -473,13 +473,24 @@ void cSVDRP::CmdHELP(const char *Option) Reply(-214, "This is VDR version %s", VDRVERSION); Reply(-214, "Topics:"); const char **hp = HelpPages; + int NumPages = 0; while (*hp) { - //TODO multi-column??? - const char *topic = GetHelpTopic(*hp); - if (topic) - Reply(-214, " %s", topic); + NumPages++; hp++; } + const int TopicsPerLine = 5; + int x = 0; + for (int y = 0; (y * TopicsPerLine + x) < NumPages; y++) { + char buffer[TopicsPerLine * (MAXHELPTOPIC + 5)]; + char *q = buffer; + for (x = 0; x < TopicsPerLine && (y * TopicsPerLine + x) < NumPages; x++) { + const char *topic = GetHelpTopic(HelpPages[(y * TopicsPerLine + x)]); + if (topic) + q += sprintf(q, " %s", topic); + } + x = 0; + Reply(-214, buffer); + } Reply(-214, "To report bugs in the implementation send email to"); Reply(-214, " vdr-bugs@cadsoft.de"); } |