2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
9 /*********************************************************************************************/
12 #include <proto/intuition.h>
13 #include <proto/muimaster.h>
14 #include <proto/utility.h>
15 #include <proto/dos.h>
18 #include <linklibs/coolimages.h>
20 #include <stdlib.h> /* for exit() */
24 #include <intuition/intuition.h>
25 #include <intuition/gadgetclass.h>
26 #include <intuition/iobsolete.h>
27 #include <libraries/gadtools.h>
29 #include <libraries/mui.h>
30 #include <zune/systemprefswindow.h>
32 #include <prefs/serial.h>
36 #include "sereditor.h"
39 #include <aros/debug.h>
41 #define VERSION "$VER: Serial 2.0 (09.06.2008) AROS Dev Team"
42 /*********************************************************************************************/
50 #define ARG_PUBSCREEN 5
54 /*********************************************************************************************/
56 STATIC CONST_STRPTR TEMPLATE
=(CONST_STRPTR
) "FROM,EDIT/S,USE/S,SAVE/S,MAP/K,PUBSCREEN/K";
57 static struct RDArgs
*myargs
;
58 static IPTR args
[NUM_ARGS
];
60 /*********************************************************************************************/
64 /*********************************************************************************************/
67 * safe (?) error display
70 VOID
ShowMsg(char *msg
)
78 es
.es_StructSize
= sizeof(es
);
80 es
.es_Title
= (CONST_STRPTR
) "Serial";
81 es
.es_TextFormat
= (CONST_STRPTR
) msg
;
82 es
.es_GadgetFormat
= MSG(MSG_OK
);
84 EasyRequestArgs(NULL
, &es
, NULL
, NULL
); /* win=NULL -> wb screen */
86 printf("Serial: %s\n", msg
);
91 /*********************************************************************************************/
93 STATIC ULONG
GetArguments(void)
96 if (!(myargs
= ReadArgs(TEMPLATE
, args
, NULL
)))
98 Fault(IoErr(), NULL
, (STRPTR
) buf
, 255);
103 if (!args
[ARG_FROM
]) args
[ARG_FROM
] = (IPTR
)CONFIGNAME_ENV
;
108 /*********************************************************************************************/
110 STATIC VOID
FreeArguments(void)
112 if (myargs
) FreeArgs(myargs
);
121 D(bug("[serial prefs] InitLocale\n"));
124 D(bug("[serial prefs] started\n"));
127 if( GetArguments() &&
128 InitPrefs((STRPTR
)args
[ARG_FROM
], (args
[ARG_USE
] ? TRUE
: FALSE
), (args
[ARG_SAVE
] ? TRUE
: FALSE
)) )
131 D(bug("[serial prefs] initialized\n"));
133 application
= ApplicationObject
,
134 MUIA_Application_Title
, MSG(MSG_WINTITLE
),
135 MUIA_Application_Version
, (IPTR
) VERSION
,
136 MUIA_Application_Description
, MSG(MSG_WINTITLE
),
137 MUIA_Application_Base
, (IPTR
) "SERIALPREF",
138 SubWindow
, (IPTR
) (window
= SystemPrefsWindowObject
,
139 //MUIA_Window_ID, MAKE_ID('S','O','1','I'),
140 MUIA_Window_ID
, ID_SERL
,
141 WindowContents
, (IPTR
) SerEditorObject
,
146 if (application
!= NULL
&& window
!= NULL
)
148 SET(window
, MUIA_Window_Open
, TRUE
);
149 DoMethod(application
, MUIM_Application_Execute
);
150 SET(window
, MUIA_Window_Open
, FALSE
);
152 MUI_DisposeObject(application
);
161 /*********************************************************************************************/