]> code.citadel.org Git - citadel.git/commitdiff
* Cosmetics for the client status line
authorMichael Hampton <io_error@uncensored.citadel.org>
Sat, 19 Jan 2002 15:10:25 +0000 (15:10 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Sat, 19 Jan 2002 15:10:25 +0000 (15:10 +0000)
citadel/ChangeLog
citadel/citadel.c
citadel/screen.c
citadel/screen.h

index bb7b159fd5adde9e9089833f482661440f9184dd..611e6eda6c959b1272673870deb8fc2270e757a2 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 590.75  2002/01/19 15:10:25  error
+ * Cosmetics for the client status line
+
  Revision 590.74  2002/01/19 11:59:33  error
  * A real status line for the text client
 
@@ -3197,4 +3200,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index ed587f6d822f702c20f81be30de58b410a09e1c7..5793f1681b845cd91885285c3b8caff6c30ac250 100644 (file)
@@ -438,18 +438,11 @@ void dotgoto(char *towhere, int display_name)
                        color(DIM_WHITE);
                }
                oldmailcount = newmailcount;
-               sln_printf_if("%s at %s in %s | %s | %d unread mail\n",
-                               serv_info.serv_humannode,
-                               serv_info.serv_bbs_city,
-                               room_name,
-                               secure ? "Secure" : "Not secure",
-                               newmailcount);
+               status_line(serv_info.serv_humannode, serv_info.serv_bbs_city,
+                               room_name, secure, newmailcount);
        } else {
-               sln_printf_if("%s at %s in %s | %s\n",
-                               serv_info.serv_humannode,
-                               serv_info.serv_bbs_city,
-                               room_name,
-                               secure ? "Secure" : "Not secure");
+               status_line(serv_info.serv_humannode, serv_info.serv_bbs_city,
+                               room_name, secure, -1);
        }
 }
 
@@ -1025,10 +1018,8 @@ int main(int argc, char **argv)
        scr_flush();
 
        secure = starttls();
-       sln_printf_if("%s at %s | %s\n",
-                       serv_info.serv_humannode,
-                       serv_info.serv_bbs_city,
-                       secure ? "Secure" : "Not secure");
+       status_line(serv_info.serv_humannode, serv_info.serv_bbs_city, NULL,
+                       secure, -1);
 
        screenwidth = 80;       /* default screen dimensions */
        screenheight = 24;
index 65305e7b9b8a8dff04b2699c57959ff8b2ece92d..153c14403af8e2c95b9a36646ea341c44cc6c941 100644 (file)
@@ -37,6 +37,35 @@ extern void check_screen_dims(void);
 #endif
 
 
+/*
+ * status_line() is a convenience function for writing a "typical"
+ * status line to the window.
+ */
+void status_line(const char *humannode, const char *bbs_city,
+                const char *room_name, int secure, int newmailcount)
+{
+#ifdef HAVE_CURSES_H
+       if (statuswindow) {
+               if (secure)
+                       sln_printf("Secure ");
+               else
+                       sln_printf("Not secure ");
+               waddch(statuswindow, ACS_VLINE);
+               waddch(statuswindow, ' ');
+               if (humannode && bbs_city)
+                       sln_printf("%s at %s ", humannode, bbs_city);
+               if (room_name)
+                       sln_printf("in %s ", room_name);
+               if (newmailcount > -1) {
+                       waddch(statuswindow, ACS_VLINE);
+                       sln_printf(" %d unread mail", newmailcount);
+               }
+               mvwinch(statuswindow, 0, 0);
+       }
+#endif /* HAVE_CURSES_H */
+}
+
+
 /*
  * Initialize the screen.  If newterm() fails, myscreen will be NULL and
  * further handlers will assume we should be in line mode.
index ac35f0e78a361d28591e06f435db0d39c182b4b7..81df04ccda31098e6409b5a0de5af29bdf242ebc 100644 (file)
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+void status_line(const char *humannode, const char *bbs_city,
+                const char *room_name, int secure, int newmailcount);
 void screen_new(void);
 void screen_delete(void);
 int screen_set(void);