$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
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
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);
}
}
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;
#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.
/* $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);