Changeset 799b60e for functions.c


Ignore:
Timestamp:
Nov 15, 2008, 8:49:55 AM (15 years ago)
Author:
Geoffrey Thomas <geofft@mit.edu>
Branches:
master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
3381399
Parents:
43a306c
git-author:
Geoffrey Thomas <geofft@mit.edu> (11/13/08 01:05:57)
git-committer:
Geoffrey Thomas <geofft@mit.edu> (11/15/08 08:49:55)
Message:
Add the :show quickstart command.

In an effort to make barnowl more self-documenting, add a ':show quickstart'
command, which displays about two lines on using each protocol, a getQuickstart
perl hook, and references to this command in the startup message and :help.

Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r3f3ee61 r799b60e  
    172172}
    173173
     174void owl_function_show_quickstart()
     175{
     176    char *message =
     177    "Move between messages with the arrow keys, and press 'r' to reply.\n"
     178    "For more info, press 'h' or visit http://barnowl.mit.edu/\n\n"
     179#ifdef HAVE_LIBZEPHYR
     180    "@b(Zephyr:)\n"
     181    "To send a message to a user, type ':zwrite @b(username)'. You can also\n"
     182    "press 'z' and then type the username. To subscribe to a class, type\n"
     183    "':sub @b(class)', and then type ':zwrite -c @b(class)' to send.\n\n"
     184#endif
     185    "@b(AIM:)\n"
     186    "Log in to AIM with ':aimlogin @b(screenname)'. Use ':aimwrite @b(screenname)',\n"
     187    "or 'a' and then the screen name, to send someone a message.\n\n"
     188    ;
     189
     190    if (owl_perlconfig_is_function("BarnOwl::Hooks::_get_quickstart")) {
     191        char *perlquickstart = owl_perlconfig_execute("BarnOwl::Hooks::_get_quickstart()");
     192        if (perlquickstart) {
     193            char *result = owl_sprintf("%s%s", message, perlquickstart);
     194            owl_function_adminmsg("BarnOwl Quickstart", result);
     195            owl_free(result);
     196            owl_free(perlquickstart);
     197            return;
     198        }
     199    }
     200    owl_function_adminmsg("BarnOwl Quickstart", message);
     201}
     202
     203
    174204/* Create an admin message, append it to the global list of messages
    175205 * and redisplay if necessary.
     
    602632
    603633  if (!found) {
    604     owl_function_makemsg("already at last%s message%s%s",
     634    owl_function_makemsg("already at last%s message%s%s%s",
    605635                         skip_deleted?" non-deleted":"",
    606                          filter?" in ":"", filter?filter:"");
     636                         filter?" in ":"", filter?filter:"",
     637                         owl_mainwin_is_curmsg_truncated(owl_global_get_mainwin(&g)) ?
     638                         ", press Enter to scroll" : "");
    607639    /* if (!skip_deleted) owl_function_beep(); */
    608640  }
Note: See TracChangeset for help on using the changeset viewer.