Commit 48a0dc2c authored by Richard Buckley's avatar Richard Buckley

Changed version number control to use radio buttons.

Version 0.07. Tagged as 'builder-0_07'
parent 28c46159
......@@ -108,13 +108,11 @@ ${TARGET}: ${OBJS}
#
# Dynamic dependencies:o.main: c.main
o.db: c.db
o.file: c.file
o.file: C:h.kernel
o.file: C:h.swis
o.msg: c.msg
o.msg: C:h.kernel
o.msg: C:h.swis
o.msg: h.constants
o.msg: VersionNum
o.msg: h.db
o.msg: h.constants
o.env: c.env
......@@ -124,10 +122,15 @@ o.env: Tbox:h.gadgets
o.env: Tbox:h.toolbox
o.env: Tbox:h.wimp
o.env: h.constants
o.env: VersionNum
o.env: h.db
o.env: h.constants
o.file: c.file
o.file: C:h.kernel
o.file: C:h.swis
o.parse: c.parse
o.parse: h.constants
o.parse: VersionNum
o.parse: h.db
o.parse: h.constants
o.build: c.build
......@@ -136,6 +139,7 @@ o.build: Tbox:h.gadgets
o.build: Tbox:h.toolbox
o.build: Tbox:h.wimp
o.build: h.constants
o.build: VersionNum
o.build: h.db
o.build: h.constants
o.build: h.parse
......@@ -156,6 +160,7 @@ o.main: Tbox:h.proginfo
o.main: Tbox:h.iconbar
o.main: h.resources
o.main: h.constants
o.main: VersionNum
o.main: h.db
o.main: h.constants
o.main: h.msg
......
......@@ -12,6 +12,7 @@ performs the following functions :
* menu click to edit master modules database
* option button selection of phases of build to perform
* saving of current options as default for next time
* provide easy access to version number control
Notes/Requirements :
......@@ -21,20 +22,22 @@ Notes/Requirements :
build directory and env file is sourced and the application is exited.
* A new env file is sourced when the application started up and when a new
environment is selected off the menu.
* <Choices$Write> to point to somewhere useful to save defaults.
* <Build$Dir>.Env to contain all the environment files which in turn source
* <Choices$Write> must point somewhere useful to save defaults.
* <Build$Dir>.Env must contain all the environment files which in turn source
the !Common environment file. Use the construct :
Set Build$Dir <Obey$Dir>
<Build$Dir>.Library.canonical Build$Dir
to remove the pesky ^ that can be found in the path. canonical can be found
in the renaissa/Build/Library directory.
* Module database and component files to live in directory
<Build$Dir>.BuildSys.
* Module database must reside in directory <Build$Dir>.BuildSys.
* The Components file should have the same name as the <Build> environment
variable that is set in the Env file.
variable that is set in the Env file. These live in the directory
<Build$Dir>.BuildSys.Components.
* When the "Build" button on the main window is clicked, the file
!Builder.!build is run with the appropriate command line options. This
file can be customised to run other scripts to set for example build name
environment variables.
* The radio buttons for version number control pass fields to the imagename
perl script which is used to set the Build$ImageName environement variable.
Bug reports/comments to rbuckley@acorn.com
......@@ -5,6 +5,3 @@ env:No environment currently defined. Select an environment and try again.
chk:Build directory specified does not exist or is not a directory.
dir:Cannot create directory <Choices$Dir>.Builder.
def:Problem writing defaults file in <Choices$Dir>.Builder, current options may not be available next time.
don:Version number remains the same.
maj:Major version number to be incremented.
min:Minor version number to be incremented.
No preview for this file type
/* (0.06)
/* (0.07)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.06
#define Module_MajorVersion_CMHG 0.07
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Sep 1997
#define Module_MajorVersion "0.06"
#define Module_MajorVersion "0.07"
#define Module_MinorVersion ""
#define Module_Date "25 Sep 1997"
......@@ -56,7 +56,6 @@ int iconbar_id = 0; /* object ids */
int menu_iconbar_id = 0;
int menu_option_id = 0;
int menu_view_id = 0;
int menu_version_id = 0;
int window_options_id = 0;
int window_build_id = 0;
int proginfo_id = 0;
......@@ -64,7 +63,6 @@ char *build_tree = NULL;
char *default_env = NULL;
build_list_t *build_list = NULL;
int used_default_options = FALSE;
int version_type = 0;
/*
* clean up before exit
......@@ -217,12 +215,6 @@ read_defaults(void)
}
}
}
} else if (cstrcmp(argv[0],"ver")==0) {
for (version_type=0; version_type<(sizeof(versioning)/sizeof(version_t)); version_type++) {
if (strcmp(versioning[version_type].msg,argv[1])==0) {
break;
}
}
}
}
}
......@@ -333,7 +325,6 @@ write_defaults(void)
ERR_CHECK_RETURN(err,stringset_get_selected(0,window_options_id,
OPTIONS_GADGET_ENV,buffer,sizeof(buffer),&i));
fprintf(fh,"env %s\n",buffer);
fprintf(fh,"ver %s\n",versioning[version_type].msg);
fclose(fh);
return 0;
......@@ -367,8 +358,6 @@ attach_other_handlers(int event_code,ToolboxEvent *event,
menu_view_id = id_block->self_id;
} else if (strcmp(template_name, WINDOW_BUILDS_NAME) ==0) {
window_build_id = id_block->self_id;
} else if (strcmp(template_name, MENU_VERSION_NAME) ==0) {
menu_version_id = id_block->self_id;
}
return 0;
}
......@@ -415,9 +404,6 @@ window_show(int event_code,ToolboxEvent *event,
}
}
ERR_CHECK_RETURN(err,displayfield_set_value(0,window_options_id,
OPTIONS_GADGET_VERSION,msg_lookup(versioning[version_type].msg)));
used_default_options = TRUE;
}
} else if (id_block->self_id == window_build_id) {
......@@ -426,29 +412,6 @@ window_show(int event_code,ToolboxEvent *event,
}
return 0;
}
/*
* deal with the menu about to be displayed
*/
int
menu_show(int event_code,ToolboxEvent *event,
IdBlock *id_block, void *handle)
{
_kernel_oserror *err=NULL;
int i;
if (id_block->self_id == menu_version_id) {
for (i=0; i<(sizeof(versioning)/sizeof(version_t)); i++) {
if (version_type == i) {
ERR_CHECK_RETURN(err,menu_set_tick(0,menu_version_id,
versioning[i].id,1));
} else {
ERR_CHECK_RETURN(err,menu_set_tick(0,menu_version_id,
versioning[i].id,0));
}
}
}
return 0;
}
/*
* populate string set prior to it being shown
......@@ -520,7 +483,7 @@ int action_click(int event_code,ToolboxEvent *event,
if (id_block->self_id == window_options_id)
{
char cmd[BUFFER_SIZE];
int state;
int state,gadget;
switch (id_block->self_component)
{
......@@ -531,7 +494,15 @@ int action_click(int event_code,ToolboxEvent *event,
strcpy(cmd,BUILD_FILE);
strcat(cmd," ");
strcat(cmd,versioning[version_type].action);
/* find out which radio button is clicked */
ERR_CHECK_RETURN(err,radiobutton_get_state(0,window_options_id,
OPTIONS_GADGET_DONT,&state,&gadget));
for (i=0; i<(sizeof(versioning)/sizeof(version_t)); i++) {
if (gadget == versioning[i].id) {
break;
}
}
strcat(cmd,versioning[i].action);
for (i=0; i<(sizeof(options)/sizeof(option_t)); i++) {
ERR_CHECK_RETURN(err,optionbutton_get_state(0,window_options_id,
options[i].id,&state));
......@@ -544,6 +515,10 @@ int action_click(int event_code,ToolboxEvent *event,
reg.r[0] = (int)cmd;
ERR_CHECK_RETURN(err,_kernel_swi(Wimp_StartTask,&reg,&reg));
/* reset version number field to "don't" */
ERR_CHECK_RETURN(err,radiobutton_set_state(0,window_options_id,
OPTIONS_GADGET_DONT,1));
break;
}
} else if (id_block->self_id == window_build_id) {
......@@ -655,21 +630,6 @@ menu_selection(int event_code,ToolboxEvent *event,
ERR_CHECK_RETURN(err,_kernel_swi(OS_CLI,&reg,&reg));
break;
}
} else if (id_block->self_id == menu_version_id) {
/* untick previous one */
ERR_CHECK_RETURN(err,menu_set_tick(0,menu_version_id,
versioning[version_type].id,0));
for (version_type=0; version_type<(sizeof(versioning)/sizeof(version_t));
version_type++) {
if (id_block->self_component == versioning[version_type].id) {
break;
}
}
ERR_CHECK_RETURN(err,menu_set_tick(0,menu_version_id,
versioning[version_type].id,1));
ERR_CHECK_RETURN(err,displayfield_set_value(0,window_options_id,
OPTIONS_GADGET_VERSION,msg_lookup(versioning[version_type].msg)));
}
return (0);
......@@ -721,8 +681,6 @@ int main()
event_quit,NULL));
ERR_GOTO(err,event_register_toolbox_handler(-1,Menu_Selection,
menu_selection,NULL));
ERR_GOTO(err,event_register_toolbox_handler(-1,Menu_AboutToBeShown,
menu_show,NULL));
/* Window event handlers */
ERR_GOTO(err,event_register_toolbox_handler(-1,ProgInfo_AboutToBeShown,
......
......@@ -31,14 +31,15 @@
#define MENU_ICONBAR_NAME "bar_menu"
#define MENU_OPTION_NAME "option_menu"
#define MENU_VIEW_NAME "view_menu"
#define MENU_VERSION_NAME "ver_menu"
#define WINDOW_OPTIONS_NAME "options"
#define WINDOW_BUILDS_NAME "builds"
#define OPTIONS_GADGET_BUILD 0x07
#define OPTIONS_GADGET_ENV 0x08
#define OPTIONS_GADGET_TREE 0x15
#define OPTIONS_GADGET_VERSION 0x16
#define OPTIONS_GADGET_DONT 0x17
#define OPTIONS_GADGET_MAJOR 0x18
#define OPTIONS_GADGET_MINOR 0x19
#define BUILD_GADGET_TREE 0x02
#define BUILD_GADGET_REMOVE 0x00
......@@ -51,10 +52,6 @@
#define VIEWMENU_COMPONENTS 0x00
#define VIEWMENU_DATABASE 0x01
#define VERSIONMENU_DONT 0x00
#define VERSIONMENU_MAJOR 0x01
#define VERSIONMENU_MINOR 0x02
#define BARMENU_REGISTER 0x03
#define MENU_QUIT 0x01
#define MENU_EVENT_QUIT 0x102
......@@ -72,8 +69,8 @@ option_t options[] = { "list", 0x13, 0,
"join", 0x0F, 0};
version_t versioning[] = {
"-hack_round_silly_riscosism", "don", VERSIONMENU_DONT,
"-newmajor", "maj", VERSIONMENU_MAJOR,
"-newminor", "min", VERSIONMENU_MINOR};
"-hack_round_silly_riscosism", "don", OPTIONS_GADGET_DONT,
"-newmajor", "maj", OPTIONS_GADGET_MAJOR,
"-newminor", "min", OPTIONS_GADGET_MINOR};
#endif
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