Commit 5ab12b59 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL
Browse files

Add Save choices menu option

edit.c: Add save choices support code (taken from equivalent operation in SrcEdit).
Resources/UK/Messages: Add new menu item & error message, shuffle interactive help down. Restore missing help on BASIC line increment writeable.

Version 1.74. Tagged as 'EditApp-1_74'
parent 2165052d
No preview for this file type
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.1.
;
GBLS Module_MajorVersion
GBLA Module_Version
......@@ -10,14 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.73"
Module_Version SETA 173
Module_MajorVersion SETS "1.74"
Module_Version SETA 174
Module_MinorVersion SETS ""
Module_Date SETS "03 Apr 2015"
Module_ApplicationDate SETS "03-Apr-15"
Module_ComponentName SETS "Edit"
Module_ComponentPath SETS "castle/RiscOS/Sources/Apps/Edit"
Module_FullVersion SETS "1.73"
Module_HelpVersion SETS "1.73 (03 Apr 2015)"
Module_Date SETS "27 May 2020"
Module_ApplicationDate SETS "27-May-20"
Module_ComponentName SETS "EditApp"
Module_FullVersion SETS "1.74"
Module_HelpVersion SETS "1.74 (27 May 2020)"
END
/* (1.73)
/* (1.74)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.73
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 03 Apr 2015
#define Module_MajorVersion_CMHG 1.74
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 27 May 2020
#define Module_MajorVersion "1.73"
#define Module_Version 173
#define Module_MajorVersion "1.74"
#define Module_Version 174
#define Module_MinorVersion ""
#define Module_Date "03 Apr 2015"
#define Module_Date "27 May 2020"
#define Module_ApplicationDate "03-Apr-15"
#define Module_ApplicationDate "27-May-20"
#define Module_ComponentName "Edit"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Edit"
#define Module_ComponentName "EditApp"
#define Module_FullVersion "1.73"
#define Module_HelpVersion "1.73 (03 Apr 2015)"
#define Module_LibraryVersionInfo "1:73"
#define Module_FullVersion "1.74"
#define Module_HelpVersion "1.74 (27 May 2020)"
#define Module_LibraryVersionInfo "1:74"
......@@ -120,16 +120,17 @@ static void arcedit__clickproc(wimp_i i) {
i=i;
txtedit_new("",0xfff); }
#define MProg 1
#define MCreate 2
#define MProg 1
#define MSaveChoices 2
#define MCreate 3
#if BASIC
#define MOptions 3
#define MQuit 4
#define MOptions 4
#define MQuit 5
#define MStrip 1
#define MIncrm 2
#else
#define MQuit 3
#define MQuit 4
#endif
#define MText 1
......@@ -150,6 +151,33 @@ static void arcedit__iconmenuproc(void *handle, char *hit) {
arceditv_infoaboutprogram();
}
break;
case MSaveChoices:
{
/* save library options */
FILE *libopts_fp;
char libopts[80];
os_regset r;
/* create Edit folder in Choices. */
r.r[0] = 8;
r.r[1] = (int)"<Choices$Write>.Edit";
r.r[4] = 0;
os_swix(OS_File,&r);
/* save library options */
libopts_fp = fopen("<Choices$Write>.Edit.liboptions", "w");
if (libopts_fp == 0)
{
werr(FALSE, msgs_lookup("opt5"));
}
else
{
os_read_var_val("Edit$Options", libopts, sizeof(libopts));
fprintf(libopts_fp, "%s", libopts);
fclose(libopts_fp);
}
}
break;
#if BASIC
case MOptions:
switch (hit[1]) {
......@@ -258,6 +286,20 @@ static void arcedit__createicon(void)
event_attachmenumaker(win_ICONBAR, edit__main_menu_maker, arcedit__iconmenuproc, 0);
}
static void arcedit__read_and_set_liboptions(void)
{
/* read risc_oslib options */
FILE *libopts_fp = fopen("Choices:Edit.liboptions", "r");
if (libopts_fp != 0)
{ char libopts[80], a[255];
fgets(libopts, sizeof(libopts), libopts_fp);
strcpy(a, "Set Edit$Options ");
strncat(a, libopts, sizeof(a) - strlen(a) - 1);
wimpt_complain(os_cli(a));
fclose(libopts_fp);
}
}
/* -------- Hot-key selection copy in background. -------- */
#if FALSE
......@@ -301,16 +343,10 @@ static os_error * save_desktop(int handle)
{
char buffer[300];
char buffer2[256];
char *ptr = buffer;
os_read_var_val("Edit$Options", buffer2, sizeof(buffer2));
if (buffer2[0] != 0) {
sprintf(ptr, "Set Edit$Options %s\n", buffer2);
ptr += strlen(ptr);
}
char *ptr;
os_read_var_val("Edit$Dir",buffer2,sizeof(buffer2));
sprintf(ptr, "Run %s\n",buffer2);
sprintf(buffer, "Run %s\n",buffer2);
for (ptr=buffer; *ptr; ptr++) {
os_error * error = os_swi2(OS_BPut, *ptr, handle);
......@@ -630,6 +666,7 @@ int main(int argc, char *argv[])
dbox_init();
dboxquery_close(0); /* init */
dboxquery_quit(0);
arcedit__read_and_set_liboptions();
txt_init();
txtedit_init();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment