]> code.citadel.org Git - citadel.git/blobdiff - citadel/textclient/routines.c
User Biography display: remove call, do through templates directly.
[citadel.git] / citadel / textclient / routines.c
index 1c0675d408deb4dee76bd42e0991fc330425e6cb..f7261ee2dd326db782f19cd90b7a1694f830f384 100644 (file)
@@ -1,5 +1,15 @@
 /*
  * Client-side support functions.
+ *
+ * Copyright (c) 1987-2012 by the citadel.org team
+ *
+ *  This program is open source software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 3.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
  */
 
 #include "sysdep.h"
@@ -53,6 +63,7 @@ struct utmp *getutline(struct utmp *ut);
 #include "commands.h"
 #include "citadel_decls.h"
 #include "routines2.h"
+#include "tuiconfig.h"
 
 #define IFAIDE if(axlevel>=AxAideU)
 #define IFNAIDE if (axlevel<AxAideU)
@@ -74,30 +85,6 @@ void back(int spaces) {
        }
 }
 
-void hit_any_key(CtdlIPC *ipc) {       /* hit any key to continue */
-       int a,b;
-
-       color(COLOR_PUSH);
-       color(DIM_RED);
-       scr_printf("%s\r", ipc->ServInfo.moreprompt);
-       color(COLOR_POP);
-       stty_ctdl(0);
-       b=inkey();
-       for (a=0; !IsEmptyStr(&ipc->ServInfo.moreprompt[a]); ++a)
-               scr_putc(' ');
-       scr_putc(13);
-       stty_ctdl(1);
-       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;
-}
-
 /*
  * Edit or delete a user (cmd=25 to edit/create, 96 to delete)
  */
@@ -250,17 +237,6 @@ void enter_config(CtdlIPC *ipc, int mode)
 
        if (mode == 0 || mode == 1) {
 
-               /* Does anyone still use dialup connections with manual
-                * screen dimensions setting anymore?  For now we'll keep
-                * the system's ability to set these, but remove the prompts
-                * because they're spurious for nearly everyone.
-                * 
-               user->USscreenwidth = intprompt("Enter your screen width",
-                                               user->USscreenwidth, 20, 255);
-               user->USscreenheight = intprompt("Enter your screen height",
-                                                user->USscreenheight, 3, 255);
-                */
                user->flags = set_attr(ipc, user->flags,
                                       "Are you an experienced Citadel user",
                                       US_EXPERT, 0);
@@ -269,49 +245,90 @@ void enter_config(CtdlIPC *ipc, int mode)
                        return;
                }
 
-               user->flags = set_attr(ipc, user->flags,
+               user->flags = set_attr(
+                       ipc,
+                       user->flags,
                        "Print last old message on New message request",
-                       US_LASTOLD, 0);
-
-               user->flags = set_attr(ipc, user->flags,
-                                      "Prompt after each message",
-                                      US_NOPROMPT, 1);
-
-               if ((user->flags & US_NOPROMPT) == 0)
-                       user->flags = set_attr(ipc, user->flags,
-                                              "Use 'disappearing' prompts",
-                                              US_DISAPPEAR, 0);
-
-               user->flags = set_attr(ipc, user->flags,
-                                      "Pause after each screenful of text",
-                                      US_PAGINATOR, 0);
+                       US_LASTOLD,
+                       0
+               );
+
+               user->flags = set_attr(
+                       ipc,
+                       user->flags,
+                       "Prompt after each message",
+                       US_NOPROMPT,
+                       1
+               );
+
+               if ((user->flags & US_NOPROMPT) == 0) {
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
+                               "Use 'disappearing' prompts",
+                               US_DISAPPEAR,
+                               0
+                       );
+               }
 
-               if (rc_prompt_control == 3 && (user->flags & US_PAGINATOR))
-                       user->flags = set_attr(ipc, user->flags,
+               user->flags = set_attr(
+                       ipc,
+                       user->flags,
+                       "Pause after each screenful of text",
+                       US_PAGINATOR,
+                       0
+               );
+
+               if (rc_prompt_control == 3 && (user->flags & US_PAGINATOR)) {
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
                                "<N>ext and <S>top work at paginator prompt",
-                               US_PROMPTCTL, 0);
+                               US_PROMPTCTL,
+                               0
+                       );
+               }
 
-               if (rc_floor_mode == RC_DEFAULT)
-                       user->flags = set_attr(ipc, user->flags,
-                                              "View rooms by floor",
-                                              US_FLOORS, 0);
+               if (rc_floor_mode == RC_DEFAULT) {
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
+                               "View rooms by floor",
+                               US_FLOORS,
+                               0
+                       );
+               }
 
-               if (rc_ansi_color == 3)
-                       user->flags = set_attr(ipc, user->flags,
-                                              "Enable color support",
-                                              US_COLOR, 0);
+               if (rc_ansi_color == 3) {
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
+                               "Enable color support",
+                               US_COLOR,
+                               0
+                       );
+               }
 
-               if ((user->flags & US_EXPERT) == 0)
+               if ((user->flags & US_EXPERT) == 0) {
                        formout(ipc, "unlisted");
+               }
 
-               user->flags = set_attr(ipc, user->flags,
-                                      "Be unlisted in userlog",
-                                      US_UNLISTED, 0);
-
-               if (!IsEmptyStr(editor_paths[0])) {
-                       user->flags = set_attr(ipc, user->flags,
+               user->flags = set_attr(
+                       ipc,
+                       user->flags,
+                       "Be unlisted in userlog",
+                       US_UNLISTED,
+                       0
+               );
+
+               if (!IsEmptyStr(editor_path)) {
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
                                "Always enter messages with the full-screen editor",
-                               US_EXTEDIT, 0);
+                               US_EXTEDIT,
+                               0
+                       );
                }
 
        }
@@ -439,18 +456,16 @@ void progress(CtdlIPC* ipc, unsigned long curr, unsigned long cmax)
        unsigned long a;
 
        if (curr >= cmax) {
-               sln_printf("\r%79s\r","");
-               status_line(ipc->ServInfo.humannode, ipc->ServInfo.site_location,
-                       room_name, secure, 0);
+               scr_printf("\r%79s\r","");
        } else {
                /* a will be range 0-50 rather than 0-100 */
                a=(curr * 50) / cmax;
                sprintf(fmt, "[%%s%%%lds] %%3ld%%%% %%10ld/%%10ld\r", 50 - a);
                strncpy(dots_printed, dots, a);
                dots_printed[a] = 0;
-               sln_printf(fmt, dots_printed, "",
+               scr_printf(fmt, dots_printed, "",
                                curr * 100 / cmax, curr, cmax);
-               sln_flush();
+               scr_flush();
        }
 }