From 7228f2602bf27efb0f82bb9fedcfbb6a6c0fd992 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 12 Feb 2002 20:15:25 +0000 Subject: [PATCH] * Threw in a few more #ifdef's so the client build doesn't barf on non-curses systems * Added rc_prompt_control (ext/top active at paginator: on/off/user) --- citadel/ChangeLog | 6 +++++- citadel/citadel.c | 6 ++++++ citadel/citadel.rc | 12 +++++++++--- citadel/commands.c | 17 ++++++++++++++--- citadel/ipcdef.h | 3 ++- citadel/routines.c | 16 ++++++++++++---- 6 files changed, 48 insertions(+), 12 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index dd4bee278..38fd64283 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,9 @@ $Log$ + Revision 590.109 2002/02/12 20:15:25 ajc + * Threw in a few more #ifdef's so the client build doesn't barf on + non-curses systems + * Added rc_prompt_control (ext/top active at paginator: on/off/user) + Revision 590.108 2002/02/11 15:52:10 ajc * Don't crash when deleting "purge this vCard" messages @@ -3326,4 +3331,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citadel.c b/citadel/citadel.c index e4b427f6e..4826c247a 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -915,7 +915,9 @@ int main(int argc, char **argv) signal(SIGCONT, catch_sigcont); /* Catch SIGCONT so we can reset terminal */ arg_encrypt = RC_DEFAULT; +#ifdef HAVE_CURSES_H arg_screen = RC_DEFAULT; +#endif /* * Handle command line options as if we were called like /bin/login @@ -935,11 +937,15 @@ int main(int argc, char **argv) argc = shift(argc, argv, a, 1); } if (!strcmp(argv[a], "-s")) { +#ifdef HAVE_CURSES_H arg_screen = RC_NO; +#endif argc = shift(argc, argv, a, 1); } if (!strcmp(argv[a], "-S")) { +#ifdef HAVE_CURSES_H arg_screen = RC_YES; +#endif argc = shift(argc, argv, a, 1); } if (!strcmp(argv[a], "-p")) { diff --git a/citadel/citadel.rc b/citadel/citadel.rc index 849b43b98..a7579dc74 100644 --- a/citadel/citadel.rc +++ b/citadel/citadel.rc @@ -5,8 +5,8 @@ # # The standard client looks for this file in: # 1. $HOME/.citadelrc -# 2. /usr/local/lib/citadel.rc -# 3. /citadel.rc +# 2. /citadel.rc +# 3. /etc/citadel.rc # 4. /citadel.rc # Set ENCRYPT to yes to force SSL/TLS encryption when connecting to a @@ -16,7 +16,7 @@ # systems on the same machine as the client. encrypt=default -# Set FULLSCREN to yes to (attempt to) use full-screen curses mode. +# Set FULLSCREEN to yes to (attempt to) use full-screen curses mode. # This mode presents a status line and a few other niceties. Some # people might not like this, so you can turn it off here or with the # -s command line option. The default is to use full screen if the @@ -53,6 +53,12 @@ local_screen_dimensions=1 # ansi_color=user +# PROMPT_CONTROL should be set to on/off/user to control whether the ext +# and top keys are active when displaying the paginator prompt. If it +# is set to "user" then it's a user-configurable option. +# +prompt_control=user + # If DISPLAY_MESSAGE_NUMBERS is set to 1, then messages will be displayed # with their message numbers in the header. This is ugly but some # people seem to like it anyway... diff --git a/citadel/commands.c b/citadel/commands.c index 2f39edde7..4ea818cea 100644 --- a/citadel/commands.c +++ b/citadel/commands.c @@ -75,6 +75,7 @@ int rc_force_mail_prompts; int rc_remember_passwords; int rc_ansi_color; int num_urls = 0; +int rc_prompt_control = 0; char urls[MAXURLS][SIZ]; char rc_url_cmd[SIZ]; @@ -688,7 +689,9 @@ void load_command_set(void) rc_ansi_color = 0; strcpy(rc_url_cmd, ""); rc_encrypt = RC_DEFAULT; +#ifdef HAVE_CURSES_H rc_screen = RC_DEFAULT; +#endif rc_alt_semantics = 0; /* now try to open the citadel.rc file */ @@ -698,13 +701,13 @@ void load_command_set(void) snprintf(buf, sizeof buf, "%s/.citadelrc", getenv("HOME")); ccfile = fopen(buf, "r"); } - if (ccfile == NULL) { - ccfile = fopen("/usr/local/lib/citadel.rc", "r"); - } if (ccfile == NULL) { snprintf(buf, sizeof buf, "%s/citadel.rc", BBSDIR); ccfile = fopen(buf, "r"); } + if (ccfile == NULL) { + ccfile = fopen("/etc/citadel.rc", "r"); + } if (ccfile == NULL) { ccfile = fopen("./citadel.rc", "r"); } @@ -725,12 +728,14 @@ void load_command_set(void) rc_encrypt = RC_DEFAULT; } +#ifdef HAVE_CURSES_H if (!strncasecmp(buf, "fullscreen=", 11)) { if (!strcasecmp(&buf[11], "yes")) rc_screen = RC_YES; else if (!strcasecmp(&buf[11], "no")) rc_screen = RC_NO; } +#endif if (!strncasecmp(buf, "editor=", 7)) strcpy(editor_path, &buf[7]); @@ -775,6 +780,12 @@ void load_command_set(void) if (!strncasecmp(&buf[11], "user", 4)) rc_ansi_color = 3; /* user config */ } + if (!strncasecmp(buf, "prompt_control=", 15)) { + if (!strncasecmp(&buf[15], "on", 2)) + rc_prompt_control = 1; + if (!strncasecmp(&buf[15], "user", 4)) + rc_prompt_control = 3; /* user config */ + } if (!strncasecmp(buf, "username=", 9)) strcpy(rc_username, &buf[9]); diff --git a/citadel/ipcdef.h b/citadel/ipcdef.h index 4e27f6e6b..60c22e632 100644 --- a/citadel/ipcdef.h +++ b/citadel/ipcdef.h @@ -69,6 +69,7 @@ struct CtdlServInfo { #define US_EXPERT 32 /* Experienced user */ #define US_UNLISTED 64 /* Unlisted userlog entry */ #define US_NOPROMPT 128 /* Don't prompt after each message */ +#define US_PROMPTCTL 256 /* ext & top work at prompt */ #define US_DISAPPEAR 512 /* Use "disappearing msg prompts" */ #define US_REGIS 1024 /* Registered user */ #define US_PAGINATOR 2048 /* Pause after each screen of text */ @@ -77,7 +78,7 @@ struct CtdlServInfo { #define US_COLOR 16384 /* User wants ANSI color support */ #define US_USER_SET (US_LASTOLD | US_EXPERT | US_UNLISTED | \ US_NOPROMPT | US_DISAPPEAR | US_PAGINATOR | \ - US_FLOORS | US_COLOR ) + US_FLOORS | US_COLOR | US_PROMPTCTL ) void serv_puts(char *buf); void serv_gets(char *buf); diff --git a/citadel/routines.c b/citadel/routines.c index f3066596f..cfe19729f 100644 --- a/citadel/routines.c +++ b/citadel/routines.c @@ -70,6 +70,7 @@ extern char sigcaught; extern struct CtdlServInfo serv_info; extern char rc_floor_mode; extern int rc_ansi_color; +extern int rc_prompt_control; void back(int spaces) /* Destructive backspace */ { @@ -92,10 +93,13 @@ void hit_any_key(void) { /* hit any key to continue */ scr_putc(' '); scr_putc(13); sttybbs(1); - if (b == 'q' || b == 'Q' || b == 's' || b == 'S') - b = STOP_KEY; - if (b == 'n' || b == 'N') - b = NEXT_KEY; + if ( (rc_prompt_control == 1) + || ((rc_prompt_control == 3) && (userflags & US_PROMPTCTL)) ) { + if (b == 'q' || b == 'Q' || b == 's' || b == 'S') + b = STOP_KEY; + if (b == 'n' || b == 'N') + b = NEXT_KEY; + } if (b==NEXT_KEY) sigcaught = SIGINT; if (b==STOP_KEY) sigcaught = SIGQUIT; } @@ -222,6 +226,10 @@ void enter_config(int mode) flags = set_attr(flags,"Use 'disappearing' prompts",US_DISAPPEAR); flags = set_attr(flags, "Pause after each screenful of text",US_PAGINATOR); + if ( (rc_prompt_control == 3) && (flags & US_PAGINATOR) ) { + flags = set_attr(flags, + "ext and top work at paginator prompt", US_PROMPTCTL); + } if (rc_floor_mode == RC_DEFAULT) { flags = set_attr(flags, "View rooms by floor",US_FLOORS); -- 2.39.2