Added support for external message editor

This commit is contained in:
Michiel Broek
2002-03-05 21:32:52 +00:00
parent 55734a6215
commit 6b441def07
24 changed files with 315 additions and 109 deletions

View File

@@ -1537,6 +1537,51 @@ int edit_newsmode(int y, int x, int val)
char *getmsgeditor(int val)
{
switch (val) {
case LINEEDIT: return (char *)"Line";
case FSEDIT: return (char *)"FS. ";
case EXTEDIT: return (char *)"Ext.";
default: return NULL;
}
}
void show_msgeditor(int y, int x, int val)
{
mvprintw(y, x, getmsgeditor(val));
}
int edit_msgeditor(int y, int x, int val)
{
int ch;
showhelp((char *)"Toggle ^Message editor^ with spacebar, press <Enter> whene done");
do {
set_color(YELLOW, BLUE);
show_msgeditor(y, x, val);
ch = readkey(y, x, YELLOW, BLUE);
if (ch == ' ') {
if (val < EXTEDIT)
val++;
else
val = LINEEDIT;
}
} while ((ch != KEY_ENTER) && (ch != '\012'));
set_color(WHITE, BLACK);
show_msgeditor(y, x, val);
return val;
}
void show_magictype(int y, int x, int val)
{
mvprintw(y, x, getmagictype(val));

View File

@@ -55,6 +55,9 @@ int edit_service(int, int, int);
char *getnewsmode(int);
void show_newsmode(int, int, int);
int edit_newsmode(int, int, int);
char *getmsgeditor(int);
void show_msgeditor(int, int, int);
int edit_msgeditor(int, int, int);
char *getlinetype(int);
void show_linetype(int, int, int);
int edit_linetype(int, int, int);

View File

@@ -226,6 +226,7 @@ void e_global2(void)
mvprintw( 9, 2, "4. LeaveCase");
mvprintw(10, 2, "5. Ftp base");
mvprintw(11, 2, "6. Arealists");
mvprintw(12, 2, "7. Ext. edit");
for (;;) {
set_color(WHITE, BLACK);
@@ -235,15 +236,17 @@ void e_global2(void)
show_bool(9,16, CFG.leavecase);
show_str(10,16,64, CFG.ftp_base);
show_str(11,16,64, CFG.alists_path);
show_str(12,16,64, CFG.externaleditor);
switch(select_menu(6)) {
switch(select_menu(7)) {
case 0: return;
case 1: E_PTH(16,16,64, CFG.req_magic, "The path to the ^magic filerequest^ files.")
case 2: E_STR(17,16,64, CFG.dospath, "The translated ^DOS^ drive and path, empty disables translation")
case 3: E_PTH(18,16,64, CFG.uxpath, "The translated ^Unix^ path.")
case 4: E_BOOL(19,16, CFG.leavecase, "^Leave^ outbound flo filenames as is, ^No^ forces uppercase.")
case 5: E_PTH(10,16,64, CFG.ftp_base, "The ^FTP home^ directory to strip of the real directory")
case 6: E_PTH(11,16,64, CFG.alists_path, "The path where ^area lists^ and ^filebone lists^ are stored.")
case 1: E_PTH(16,16,64, CFG.req_magic, "The path to the ^magic filerequest^ files.")
case 2: E_STR(17,16,64, CFG.dospath, "The translated ^DOS^ drive and path, empty disables translation")
case 3: E_PTH(18,16,64, CFG.uxpath, "The translated ^Unix^ path.")
case 4: E_BOOL(19,16, CFG.leavecase, "^Leave^ outbound flo filenames as is, ^No^ forces uppercase.")
case 5: E_PTH(10,16,64, CFG.ftp_base, "The ^FTP home^ directory to strip of the real directory")
case 6: E_PTH(11,16,64, CFG.alists_path, "The path where ^area lists^ and ^filebone lists^ are stored.")
case 7: E_STR(12,16,64, CFG.externaleditor, "The full path and filename to the ^external message editor^")
}
};
}
@@ -1528,7 +1531,6 @@ void global_menu(void)
*/
Syslog('+', "Main config, clearing unused fields");
memset(&CFG.alists_path, 0, sizeof(CFG.alists_path));
memset(&CFG.xsequencer, 0, sizeof(CFG.xsequencer));
CFG.xmax_login = 0;
CFG.xUseSysDomain = FALSE;
CFG.xChkMail = FALSE;
@@ -1777,6 +1779,7 @@ int global_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Leave case as is %s\n", getboolean(CFG.leavecase));
fprintf(fp, " FTP base path %s\n", CFG.ftp_base);
fprintf(fp, " Area lists %s\n", CFG.alists_path);
fprintf(fp, " External editor %s\n", CFG.externaleditor);
page = newpage(fp, page);
addtoc(fp, toc, 1, 6, page, (char *)"Global settings");

View File

@@ -113,10 +113,11 @@ void Show_A_Menu(void)
mvprintw(18, 2, "11. Hi-colors");
mvprintw(19, 2, "12. Autoexec");
if (menus.MenuType == 7) {
mvprintw(16,42, "13. No door.sys");
mvprintw(17,42, "14. Y2K style");
mvprintw(18,42, "15. Use Comport");
mvprintw(19,42, "16. Run nosuid");
mvprintw(15,42, "13. No door.sys");
mvprintw(16,42, "14. Y2K style");
mvprintw(17,42, "15. Use Comport");
mvprintw(18,42, "16. Run nosuid");
mvprintw(19,42, "17. No Prompt");
}
set_color(WHITE, BLACK);
@@ -138,10 +139,11 @@ void Show_A_Menu(void)
set_color(WHITE, BLACK);
show_bool(19,16, menus.AutoExec);
if (menus.MenuType == 7) {
show_bool(16,58, menus.NoDoorsys);
show_bool(17,58, menus.Y2Kdoorsys);
show_bool(18,58, menus.Comport);
show_bool(19,58, menus.NoSuid);
show_bool(15,58, menus.NoDoorsys);
show_bool(16,58, menus.Y2Kdoorsys);
show_bool(17,58, menus.Comport);
show_bool(18,58, menus.NoSuid);
show_bool(19,58, menus.NoPrompt);
}
}
@@ -214,7 +216,7 @@ void Edit_A_Menu(void)
Show_A_Menu();
for (;;) {
switch(select_menu(16)) {
switch(select_menu(17)) {
case 0: return;
break;
case 1: E_UPS( 7,16, 1, menus.MenuKey, "The ^key^ to select this menu item")
@@ -249,19 +251,23 @@ void Edit_A_Menu(void)
break;
case 12:E_BOOL(19,16, menus.AutoExec, "Is this an ^Autoexecute^ menu item")
case 13:if (menus.MenuType == 7) {
E_BOOL(16,58, menus.NoDoorsys, "Suppress writing ^door.sys^ dropfile")
E_BOOL(15,58, menus.NoDoorsys, "Suppress writing ^door.sys^ dropfile")
} else
break;
case 14:if (menus.MenuType == 7) {
E_BOOL(17,58, menus.Y2Kdoorsys, "Create ^door.sys^ with 4 digit yearnumbers")
E_BOOL(16,58, menus.Y2Kdoorsys, "Create ^door.sys^ with 4 digit yearnumbers")
} else
break;
case 15:if (menus.MenuType == 7) {
E_BOOL(18,58, menus.Comport, "Write real ^COM port^ in door.sys for Vmodem patch")
E_BOOL(17,58, menus.Comport, "Write real ^COM port^ in door.sys for Vmodem patch")
} else
break;
case 16:if (menus.MenuType == 7) {
E_BOOL(19,58, menus.NoSuid, "Run the door as ^real user (nosuid)^")
E_BOOL(18,58, menus.NoSuid, "Run the door as ^real user (nosuid)^")
} else
break;
case 17:if (menus.MenuType == 7) {
E_BOOL(19,58, menus.NoPrompt, "^Don't display prompt^ when door is finished")
} else
break;
}
@@ -594,6 +600,8 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " No door.sys %s\n", getboolean(menus.NoDoorsys));
fprintf(fp, " Y2K door.sys %s\n", getboolean(menus.Y2Kdoorsys));
fprintf(fp, " Use COM port %s\n", getboolean(menus.Comport));
fprintf(fp, " No setuid %s\n", getboolean(menus.NoSuid));
fprintf(fp, " No Prompt %s\n", getboolean(menus.NoPrompt));
}
fprintf(fp, "\n\n");
j++;

View File

@@ -124,8 +124,17 @@ int OpenUsers(void)
*/
memset(&usrconfig, 0, sizeof(usrconfig));
while (fread(&usrconfig, oldsize, 1, fin) == 1) {
fwrite(&usrconfig, sizeof(usrconfig), 1, fout);
memset(&usrconfig, 0, sizeof(usrconfig));
/*
* In version 0.33.20 the message editor has 3 choices,
* adjust settings.
*/
if (usrconfig.xFsMsged && (usrconfig.MsgEditor == LINEEDIT)) {
usrconfig.MsgEditor = FSEDIT;
UsrUpdated = 1;
Syslog('+', "Adjusted editor setting for user %s", usrconfig.sUserName);
}
fwrite(&usrconfig, sizeof(usrconfig), 1, fout);
memset(&usrconfig, 0, sizeof(usrconfig));
}
fclose(fin);
@@ -295,7 +304,7 @@ void Screen2(void)
mvprintw(10,63, "18. Silent");
mvprintw(11,63, "19. CLS");
mvprintw(12,63, "20. More");
mvprintw(13,63, "21. Fs Edit");
mvprintw(13,63, "21. Editor");
mvprintw(14,63, "22. MailScan");
mvprintw(15,63, "23. ShowNews");
mvprintw(16,63, "24. NewFiles");
@@ -331,7 +340,7 @@ void Fields2(void)
show_bool(10,76, usrconfig.DoNotDisturb);
show_bool(11,76, usrconfig.Cls);
show_bool(12,76, usrconfig.More);
show_bool(13,76, usrconfig.FsMsged);
show_msgeditor(13,76, usrconfig.MsgEditor);
show_bool(14,76, usrconfig.MailScan);
show_bool(15,76, usrconfig.ieNEWS);
show_bool(16,76, usrconfig.ieFILE);
@@ -408,7 +417,8 @@ int EditUsrRec2(void)
case 18:E_BOOL(10,76,usrconfig.DoNotDisturb, "User will not be ^disturbed^")
case 19:E_BOOL(11,76,usrconfig.Cls, "Send ^ClearScreen code^ to users terminal")
case 20:E_BOOL(12,76,usrconfig.More, "User uses the ^More prompt^")
case 21:E_BOOL(13,76,usrconfig.FsMsged, "User uses the ^Fullscreen editor^")
case 21:usrconfig.MsgEditor = edit_msgeditor(13,76,usrconfig.MsgEditor);
break;
case 22:E_BOOL(14,76,usrconfig.MailScan, "Don't check for ^new mail^")
case 23:E_BOOL(15,76,usrconfig.ieNEWS, "Show ^News Bulletins^ when logging in")
case 24:E_BOOL(16,76,usrconfig.ieFILE, "Show ^New Files^ when logging in")