jcs
/subtext
/amendments
/444
*: Add more prompt help strings
jcs made amendment 444 about 1 year ago
--- folder.c Tue Mar 7 22:46:27 2023
+++ folder.c Thu Mar 23 22:48:07 2023
@@ -124,6 +124,8 @@ folder_list(struct session *s)
{ 'q', "QqXx", "Return to main menu" },
{ '?', "?", "List menu options" },
};
+ static const char prompt_help[] =
+ "#:View Folder L:List Q:Return ?:Help";
short n, fn;
char c;
bool done, show_list, show_help;
@@ -150,8 +152,8 @@ folder_list(struct session *s)
show_list = false;
}
- c = session_menu(s, "File Folders", "Files", opts, nitems(opts),
- show_help, "Folder #", &fn);
+ c = session_menu(s, "File Folders", "Files", (char *)prompt_help,
+ opts, nitems(opts), show_help, "Folder #", &fn);
show_help = false;
handle_opt:
@@ -183,13 +185,15 @@ folder_show(struct session *s, struct folder *folder)
{
static const struct session_menu_option opts[] = {
{ '#', "#", "View file [#]" },
- { '<', "<", "Previous page of files" },
+ { '<', "<", "Newer page of files" },
{ 'l', "Ll", "List files" },
- { '>', ">", "Next page of files" },
+ { '>', ">", "Older page of files" },
{ 'u', "Uu", "Upload new file" },
{ 'q', "QqXx", "Return to main menu" },
{ '?', "?", "List menu options" },
};
+ static const char prompt_help[] =
+ "#:View <:Newer >:Older L:List U:Upload Q:Return ?:Help";
char prompt[6 + member_size(struct folder, name) + 8];
size_t page, pages, nfile_ids;
unsigned long *file_ids = NULL;
@@ -226,8 +230,8 @@ folder_show(struct session *s, struct folder *folder)
show_list = false;
}
- c = session_menu(s, folder->description, prompt, opts,
- nitems(opts), show_help, "File #", &fn);
+ c = session_menu(s, folder->description, prompt, (char *)prompt_help,
+ opts, nitems(opts), show_help, "File #", &fn);
show_help = false;
handle_opt:
@@ -656,6 +660,8 @@ folder_file_view(struct session *s, struct folder *fol
{ 'q', "QqXx", "Return to folder" },
{ '?', "?", "List these options" },
};
+ static const char prompt_help[] =
+ "D:Download R:Delete E:Edit Q:Return ?:Help";
char time[32];
char prompt[6 + member_size(struct folder, name) + 1 +
member_size(struct folder_file, filename)];
@@ -720,8 +726,8 @@ folder_file_view(struct session *s, struct folder *fol
file.filename);
while (!done && !s->ending) {
- c = session_menu(s, file.filename, prompt, dopts, nitems(opts),
- show_help, NULL, NULL);
+ c = session_menu(s, file.filename, prompt, (char *)prompt_help, dopts,
+ nitems(opts), show_help, NULL, NULL);
show_help = false;
switch (c) {
--- mail.c Wed Mar 15 15:14:57 2023
+++ mail.c Thu Mar 23 22:51:34 2023
@@ -135,13 +135,15 @@ mail_menu(struct session *s)
{
static const struct session_menu_option opts[] = {
{ '#', "#", "Read mail message [#]" },
- { '<', "<", "Previous page of messages" },
+ { '<', "<", "Newer messages" },
{ 'l', "Ll", "List mail messages" },
- { '>', ">", "Next page of messages" },
+ { '>', ">", "Older messages" },
{ 'm', "MmNn", "Compose new mail message" },
{ 'q', "QqXx", "Return to main menu" },
{ '?', "?", "Show this help menu" },
};
+ static const char prompt_help[] =
+ "#:Read <:Newer >:Older L:List M:Compose Q:Return ?:Help";
size_t nmsgs, nmail_ids;
unsigned long *mail_ids = NULL, page, pages;
short ret, mpp, mn;
@@ -183,8 +185,8 @@ mail_menu(struct session *s)
show_list = false;
}
- c = session_menu(s, "Private Mail", "Mail", opts, nitems(opts),
- show_help, "Message #", &mn);
+ c = session_menu(s, "Private Mail", "Mail", (char *)prompt_help,
+ opts, nitems(opts), show_help, "Message #", &mn);
show_help = false;
handle_opt:
@@ -571,6 +573,8 @@ mail_read(struct session *s, unsigned long id, short i
{ 'q', "QqXx", "Return to message list" },
{ '?', "?", "Show this help menu" },
};
+ static const char prompt_help[] =
+ "R:Reply D:Delete U:Unread M:New Msg L:List Q:Return ?:Help";
char time[32];
char prompt[24];
char title[50];
@@ -649,8 +653,8 @@ mail_read(struct session *s, unsigned long id, short i
snprintf(title, sizeof(title), "Mail: Message %d", idx);
while (!done && !s->ending) {
- c = session_menu(s, title, prompt, opts, nitems(opts),
- show_help, NULL, NULL);
+ c = session_menu(s, title, prompt, (char *)prompt_help, opts,
+ nitems(opts), show_help, NULL, NULL);
show_help = false;
switch (c) {
--- settings.c Fri Mar 17 16:59:35 2023
+++ settings.c Thu Mar 23 17:43:15 2023
@@ -150,7 +150,7 @@ struct_editor(struct session *s, const struct struct_f
}
}
- c = session_menu(s, NULL, prompt, dopts, nopts, show_list,
+ c = session_menu(s, NULL, prompt, NULL, dopts, nopts, show_list,
"Option #", &on);
show_list = false;
--- sysop.c Tue Mar 14 16:42:09 2023
+++ sysop.c Thu Mar 23 21:24:35 2023
@@ -49,6 +49,8 @@ sysop_menu(struct session *s)
{ 'q', "QqXx", "Return to main menu" },
{ '?', "?", "List menu options" },
};
+ static const char prompt_help[] =
+ "M:MOTD I:Binkp H:Hang Up B:Boards F:Folders U:Users S:Settings";
char c;
bool show_help = true;
bool done = false;
@@ -59,8 +61,8 @@ sysop_menu(struct session *s)
session_logf(s, "Entered sysop menu");
while (!done && !s->ending) {
- c = session_menu(s, "Sysop Menu", "Sysop", opts, nitems(opts),
- show_help, NULL, NULL);
+ c = session_menu(s, "Sysop Menu", "Sysop", (char *)prompt_help,
+ opts, nitems(opts), show_help, NULL, NULL);
show_help = false;
switch (c) {
@@ -143,6 +145,8 @@ sysop_edit_boards(struct session *s)
{ 'd', "Dd", "Delete board" },
{ 'i', "Ii", "Re-index posts" },
};
+ static const char prompt_help[] =
+ "#:Edit Board L:List N:New Q:Return ?:Help";
char prompt[30];
struct board *board, *new_board;
struct bile *new_board_bile;
@@ -173,8 +177,9 @@ sysop_edit_boards(struct session *s)
show_list = false;
}
- c = session_menu(s, "Board Editor", "Sysop:Boards", opts,
- nitems(opts), show_help, "Board #", &bn);
+ c = session_menu(s, "Board Editor", "Sysop:Boards",
+ (char *)prompt_help, opts, nitems(opts), show_help, "Board #",
+ &bn);
show_help = false;
switch (c) {
@@ -292,6 +297,8 @@ sysop_edit_folders(struct session *s)
static const struct session_menu_option edit_opts[] = {
{ 'd', "Dd", "Delete folder" },
};
+ static const char prompt_help[] =
+ "#:Edit Folder L:List N:New Q:Return ?:Help";
char prompt[30];
struct folder *folder, *new_folder;
struct bile *new_folder_bile;
@@ -322,8 +329,9 @@ sysop_edit_folders(struct session *s)
show_list = false;
}
- c = session_menu(s, "Folder Editor", "Sysop:Folders", opts,
- nitems(opts), show_help, "Folder #", &fn);
+ c = session_menu(s, "Folder Editor", "Sysop:Folders",
+ (char *)prompt_help, opts, nitems(opts), show_help, "Folder #",
+ &fn);
show_help = false;
switch (c) {
@@ -433,13 +441,15 @@ sysop_edit_motd(struct session *s)
{ 'q', "QqXx", "Return to sysop menu" },
{ '?', "?", "List menu options" },
};
+ static const char prompt_help[] =
+ "N:New S:Show Q:Return ?:Help";
char c;
bool show_help = true;
bool done = false;
while (!done && !s->ending) {
- c = session_menu(s, "MOTD Editor", "Sysop:MOTD", opts,
- nitems(opts), show_help, NULL, NULL);
+ c = session_menu(s, "MOTD Editor", "Sysop:MOTD", (char *)prompt_help,
+ opts, nitems(opts), show_help, NULL, NULL);
show_help = false;
switch (c) {
@@ -539,6 +549,8 @@ sysop_edit_users(struct session *s)
{ 'q', "QqXx", "Return to sysop menu" },
{ '?', "?", "List menu options" },
};
+ static const char prompt_help[] =
+ "#:Edit User <:Prev >:Next L:List Q:Return ?:Help";
unsigned long *all_user_ids = NULL, *user_ids = NULL;
struct user user;
size_t pages, page, n, size, nall_user_ids, nuser_ids;
@@ -596,8 +608,8 @@ sysop_edit_users(struct session *s)
show_list = false;
}
- c = session_menu(s, "Edit Users", "Sysop:Users", opts,
- nitems(opts), show_help, "User #", &suser_id);
+ c = session_menu(s, "Edit Users", "Sysop:Users", (char *)prompt_help,
+ opts, nitems(opts), show_help, "User #", &suser_id);
show_help = false;
handle_opt:
@@ -673,13 +685,15 @@ void
sysop_edit_user(struct session *s, unsigned long id)
{
static const struct session_menu_option opts[] = {
- { 'd', "Dd", "Delete account" },
- { 'e', "Ee", "Enable/disable account" },
{ 'p', "Pp", "Change password" },
+ { 'e', "Ee", "Enable/disable account" },
+ { 'd', "Dd", "Delete account" },
{ 's', "Ss", "Toggle sysop flag" },
{ 'q', "QqXx", "Return to users menu" },
{ '?', "?", "List menu options" },
};
+ static const char prompt_help[] =
+ "P:Password E:Enable/Disable D:Delete S:Sysop Q:Return ?:Help";
char title[50];
char prompt[25];
struct user user;
@@ -701,8 +715,8 @@ sysop_edit_user(struct session *s, unsigned long id)
snprintf(prompt, sizeof(prompt), "Sysop:Users:%ld", user.id);
while (!done && !s->ending) {
- c = session_menu(s, title, prompt, opts, nitems(opts),
- show_help, NULL, NULL);
+ c = session_menu(s, title, prompt, (char *)prompt_help, opts,
+ nitems(opts), show_help, NULL, NULL);
show_help = false;
handle_opt:
@@ -727,6 +741,9 @@ handle_opt:
case 'e':
user.is_enabled = !user.is_enabled;
user_save(&user);
+ session_printf(s, "User %s is now %sabled.\r\n", user.username,
+ user.is_enabled ? "en" : "dis");
+ session_flush(s);
break;
case 'p':
user_change_password(s, &user);
@@ -740,6 +757,9 @@ handle_opt:
}
user.is_sysop = !user.is_sysop;
user_save(&user);
+ session_printf(s, "User %s is now %sa sysop.\r\n",
+ user.username, user.is_sysop ? "" : "no longer ");
+ session_flush(s);
break;
case '?':
show_help = true;
--- user_settings.c Wed Feb 22 21:30:40 2023
+++ user_settings.c Thu Mar 23 21:27:19 2023
@@ -183,6 +183,8 @@ user_settings_menu(struct session *s)
{ 'q', "QqXx", "Return to main menu" },
{ '?', "?", "List menu options" },
};
+ static const char prompt_help[] =
+ "R:Renegotiate P:Password U:Username Q:Return ?:Help";
char c;
bool show_help = true;
bool done = false;
@@ -190,8 +192,8 @@ user_settings_menu(struct session *s)
session_logf(s, "User settings menu");
while (!done) {
- c = session_menu(s, "Settings", "Settings", opts, nitems(opts),
- show_help, NULL, NULL);
+ c = session_menu(s, "Settings", "Settings", (char *)prompt_help,
+ opts, nitems(opts), show_help, NULL, NULL);
show_help = false;
switch (c) {