Changeset 799b60e


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>
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r451db9e r799b60e  
    641641              "show keymap <keymap>\n"
    642642              "show license\n"
     643              "show quickstart\n"
    643644              "show startup\n"
    644645              "show status\n"
     
    22072208  } else if (!strcmp(argv[1], "license")) {
    22082209    owl_function_show_license();
     2210  } else if (!strcmp(argv[1], "quickstart")) {
     2211    owl_function_show_quickstart();
    22092212  } else if (!strcmp(argv[1], "startup")) {
    22102213    char *filename;
  • 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  }
  • help.c

    r0398d55 r799b60e  
    1818  owl_fmtext_append_normal
    1919    (&fm,
     20     "  If you're new to BarnOwl, the first thing you should type is\n\n"
     21     "    :show quickstart\n\n"
    2022     "  For help on a specific command use 'help <command>'\n"
    2123     "  For information on advanced keys, use 'show keymaps'.\n"
  • owl.c

    r7ba9ead9 r799b60e  
    322322  sprintf(buff,      "Welcome to barnowl version %s.  Press 'h' for on-line help.            \n", OWL_VERSION_STRING);
    323323  strcat(startupmsg, buff);
     324  strcat(startupmsg, "To see a quick introduction, type ':show quickstart'.                  \n");
    324325  strcat(startupmsg, "                                                                       \n");
    325326  strcat(startupmsg, "BarnOwl is free software. Type ':show license' for more                \n");
    326   strcat(startupmsg, "information.                                                           \n");
    327   strcat(startupmsg, "                                                                 ^ ^   \n");
     327  strcat(startupmsg, "information.                                                     ^ ^   \n");
    328328  strcat(startupmsg, "                                                                 OvO   \n");
    329329  strcat(startupmsg, "Please report any bugs or suggestions to bug-barnowl@mit.edu    (   )  \n");
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm

    re979da9 r799b60e  
    7070        $BarnOwl::Hooks::mainLoop->add("BarnOwl::Module::Jabber::onMainLoop");
    7171        $BarnOwl::Hooks::getBuddyList->add("BarnOwl::Module::Jabber::onGetBuddyList");
     72        $BarnOwl::Hooks::getQuickstart->add("BarnOwl::Module::Jabber::onGetQuickstart");
    7273        $vars{show} = '';
    7374        BarnOwl::new_variable_bool("jabber:show_offline_buddies",
     
    222223}
    223224
     225sub onGetQuickstart {
     226    return <<'EOF'
     227@b(Jabber:)
     228Type ':jabberlogin @b(username@mit.edu)' to log in to Jabber. The command
     229':jroster sub @b(somebody@gmail.com)' will request that they let you message
     230them. Once you get a message saying you are subscribed, you can message
     231them by typing ':jwrite @b(somebody@gmail.com)' or just 'j @b(somebody)'.
     232EOF
     233}
     234
    224235################################################################################
    225236### Owl Commands
  • perlwrap.pm

    r740d5f7 r799b60e  
    810810displayed in a popup window, with zephyr formatting parsed.
    811811
     812=item $getQuickstart
     813
     814Called by :show quickstart to display 2-5 lines of help on how to
     815start using the protocol. The result from every function registered
     816with this hook will be appended and displayed in an admin message,
     817with zephyr formatting parsed. The format should be
     818"@b(Protocol:)\nSome text.\nMore text.\n"
     819
    812820=back
    813821
     
    818826our @EXPORT_OK = qw($startup $shutdown
    819827                    $receiveMessage $newMessage
    820                     $mainLoop $getBuddyList);
     828                    $mainLoop $getBuddyList
     829                    $getQuickstart);
    821830
    822831our %EXPORT_TAGS = (all => [@EXPORT_OK]);
     
    828837our $mainLoop = BarnOwl::Hook->new;
    829838our $getBuddyList = BarnOwl::Hook->new;
     839our $getQuickstart = BarnOwl::Hook->new;
    830840
    831841# Internal startup/shutdown routines called by the C code
     
    921931}
    922932
     933sub _get_quickstart {
     934    return join("\n", $getQuickstart->run);
     935}
     936
    923937################################################################################
    924938# Built-in perl styles
Note: See TracChangeset for help on using the changeset viewer.