Skip to content

Commit

Permalink
convert easyrequestargs calls to mui requesters
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcoles committed Aug 23, 2023
1 parent 895c73c commit cabb8b8
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 132 deletions.
5 changes: 3 additions & 2 deletions axSetupTool/axSetupTool.e
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ OPT OSVERSION = 37,STACK=60000,LARGE
OPT PREPROCESS

/*
ftpport ftpdataport httpport missing in bbsconfig
window.pubscreen can be WINDOW.PUBSCREEN or WINDOW.PUBSCREEN=

help screens
help screen
add warning about incorrect rexxdoor if nodes>10
add warning to restart on exit if ACP running
restart bbs

user editor
Expand Down
14 changes: 4 additions & 10 deletions axSetupTool/frmAddComplexItem.e
Original file line number Diff line number Diff line change
Expand Up @@ -94,30 +94,24 @@ PROC canClose() OF frmAddComplexItem
ENDPROC TRUE

PROC canSave() OF frmAddComplexItem
DEF win,newName,i
DEF newName,i

MOVE.L (A1),self
GetA4()

get(self.winMain,MUIA_Window_Window,{win})
get(self.txtAreaName, MUIA_String_Contents,{newName})

IF self.existingItems ANDALSO self.existingItems.contains(newName)
EasyRequestArgs( win , [ 20 , 0 ,
'Error' ,
'An item already exists with this name.',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*Ok','An item already exists with this name.',0)
RETURN FALSE
ENDIF
ENDPROC TRUE

PROC unsavedChangesWarning() OF frmAddComplexItem
DEF win
get(self.winMain,MUIA_Window_Window,{win})
IF EasyRequestArgs( win , [ 20 , 0 ,
'Unsaved changes' ,
'You have unsaved changes,\nif you continue you will lose them.',
'_OK|_CANCEL' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Unsaved changes','*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE

ENDPROC TRUE

PROC editArea(acpName,areaName,oldArea:PTR TO area, existingAreas:PTR TO stdlist) OF frmAddComplexItem
Expand Down
34 changes: 8 additions & 26 deletions axSetupTool/frmConfEdit.e
Original file line number Diff line number Diff line change
Expand Up @@ -654,30 +654,18 @@ PROC canClose() OF frmConfEdit
ENDPROC TRUE

PROC unsavedChangesWarning() OF frmConfEdit
DEF win
get(self.winMain,MUIA_Window_Window,{win})
IF EasyRequestArgs( win , [ 20 , 0 ,
'Unsaved changes' ,
'You have unsaved changes,\nif you continue you will lose them.',
'_OK|_CANCEL' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Unsaved changes',
'*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE
ENDPROC TRUE

PROC deleteConfWarning() OF frmConfEdit
DEF win
get(self.winMain,MUIA_Window_Window,{win})
IF EasyRequestArgs( win , [ 20 , 0 ,
'Warning' ,
'Are you sure you wish to delete this conference?',
'_Yes|No' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Warning',
'*Yes|No','Are you sure you wish to delete this conference?',0)=0 THEN RETURN FALSE
ENDPROC TRUE

PROC deleteConfFolderRequest() OF frmConfEdit
DEF win
get(self.winMain,MUIA_Window_Window,{win})
IF EasyRequestArgs( win , [ 20 , 0 ,
'Warning' ,
'Do you wish to also remove the Conf folder contents?',
'_Yes|No' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Warning',
'*Yes|No','Do you wish to also remove the Conf folder contents?',0)=0 THEN RETURN FALSE
ENDPROC TRUE

PROC saveChanges() OF frmConfEdit
Expand All @@ -695,19 +683,13 @@ PROC saveChanges() OF frmConfEdit

fullTrim(self.strConfName2.getValue(),tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( window , [ 20 , 0 ,
'Error' ,
'Conference Name is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','Conference Name is a mandatory field',0)
RETURN
ENDIF

fullTrim(self.paConfPath.getValue(),tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( window , [ 20 , 0 ,
'Error' ,
'Conference Path is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','Conference Path is a mandatory field',0)
RETURN
ENDIF

Expand Down
6 changes: 2 additions & 4 deletions axSetupTool/frmEditList.e
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,8 @@ PROC canClose() OF frmEditList
ENDPROC TRUE

PROC unsavedChangesWarning() OF frmEditList
IF EasyRequestArgs( NIL , [ 20 , 0 ,
'Unsaved changes' ,
'You have unsaved changes,\nif you continue you will lose them.',
'_OK|_CANCEL' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Unsaved changes',
'*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE
ENDPROC TRUE


Expand Down
8 changes: 3 additions & 5 deletions axSetupTool/frmMain.e
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,15 @@ PROC exitbuttonPressed() OF frmMain
domethod(self.app.app,[MUIM_Application_ReturnID,MUIA_Window_CloseRequest])
ENDPROC


PROC aboutbuttonPressed() OF frmMain
DEF win
MOVE.L (A1),self
GetA4()
get(self.winMain,MUIA_Window_Window,{win})
EasyRequestArgs( win , [ 20 , 0 ,
'About Ami-Express Setup Tool' ,
'This tool can assist you in configuring\nalmost every aspect of Ami-Express.\n\n(c)2023 Darren Coles.',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'About Ami-Express Setup Tool' ,'*Ok','This tool can assist you in configuring\nalmost every aspect of Ami-Express.\n\n(c)2023 Darren Coles.',0)
ENDPROC


PROC computersbuttonPressed() OF frmMain
DEF listEdit:PTR TO frmEditList
MOVE.L (A1),self
Expand Down
43 changes: 7 additions & 36 deletions axSetupTool/frmNodeEdit.e
Original file line number Diff line number Diff line change
Expand Up @@ -705,48 +705,29 @@ PROC canClose() OF frmNodeEdit
ENDPROC TRUE

PROC unsavedChangesWarning() OF frmNodeEdit
DEF win
get(self.winMain,MUIA_Window_Window,{win})
IF EasyRequestArgs( win , [ 20 , 0 ,
'Unsaved changes' ,
'You have unsaved changes,\nif you continue you will lose them.',
'_OK|_CANCEL' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Unsaved changes',
'*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE
ENDPROC TRUE

PROC deleteNodeWarning() OF frmNodeEdit
DEF win
get(self.winMain,MUIA_Window_Window,{win})
IF EasyRequestArgs( win , [ 20 , 0 ,
'Warning' ,
'Are you sure you wish to delete this node?',
'_Yes|No' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Warning','*Yes|No','Are you sure you wish to delete this node?',0)=0 THEN RETURN FALSE
ENDPROC TRUE

PROC deleteNodeFolderRequest() OF frmNodeEdit
DEF win
get(self.winMain,MUIA_Window_Window,{win})
IF EasyRequestArgs( win , [ 20 , 0 ,
'Warning' ,
'Do you wish to also remove the Node folder contents?',
'_Yes|No' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Warning','*Yes|No','Do you wish to also remove the Node folder contents?',0)=0 THEN RETURN FALSE
ENDPROC TRUE

PROC validateTime(timeStr:PTR TO CHAR,startControl,endControl) OF frmNodeEdit
DEF win
DEF timeVal,timeEntry
DEF errorText[255]:STRING

get(self.winMain,MUIA_Window_Window,{win})
get(startControl, MUIA_String_Contents,{timeEntry})

IF StrLen(timeEntry)>0
timeVal:=Val(timeEntry)
IF (Mod(timeVal,100)>59) OR (timeVal>2359) OR (timeVal<0)
StringF(errorText,'You have entered an invalid time for \s baud start time',timeStr)
EasyRequestArgs( win , [ 20 , 0 ,
'Error ' ,
errorText,
'OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK',errorText,0)
RETURN FALSE
ENDIF
ENDIF
Expand All @@ -757,10 +738,7 @@ PROC validateTime(timeStr:PTR TO CHAR,startControl,endControl) OF frmNodeEdit
timeVal:=Val(timeEntry)
IF (Mod(timeVal,100)>59) OR (timeVal>2359) OR (timeVal<0)
StringF(errorText,'You have entered an invalid time for \s baud end time',timeStr)
EasyRequestArgs( win , [ 20 , 0 ,
'Error ' ,
errorText,
'OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK',errorText,0)
RETURN FALSE
ENDIF
ENDIF
Expand All @@ -776,20 +754,15 @@ PROC saveChanges() OF frmNodeEdit
DEF windowTooltype[255]:STRING
DEF timeTooltype[255]:STRING
DEF timeItem:PTR TO timeItem
DEF window
DEF val

MOVE.L (A1),self
GetA4()

get(self.winMain,MUIA_Window_Window,{window})

fullTrim(self.strNodeStart.getValue(),tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( window , [ 20 , 0 ,
'Error' ,
'Express File is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','Express File is a mandatory field',0)
RETURN
ENDIF

Expand All @@ -802,8 +775,6 @@ PROC saveChanges() OF frmNodeEdit
readToolType(self.acpName,'BBS_LOCATION',bbsPath)
StringF(nodeStr,'\sNode\d',bbsPath,self.currNode)

get(self.winMain,MUIA_Window_Window,{window})

IF (self.newNode)
//create the folder structure
makeDir(nodeStr)
Expand Down
26 changes: 5 additions & 21 deletions axSetupTool/frmPresetsEdit.e
Original file line number Diff line number Diff line change
Expand Up @@ -164,49 +164,33 @@ PROC canClose() OF frmPresetsEdit
ENDPROC TRUE

PROC unsavedChangesWarning() OF frmPresetsEdit
DEF win
get(self.winMain,MUIA_Window_Window,{win})
IF EasyRequestArgs( win , [ 20 , 0 ,
'Unsaved changes' ,
'You have unsaved changes,\nif you continue you will lose them.',
'_OK|_CANCEL' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Unsaved changes',
'*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE
ENDPROC TRUE

PROC savePresetChanges() OF frmPresetsEdit
DEF tempStr[255]:STRING
DEF bbsPath[255]:STRING
DEF presetStr[20]:STRING
DEF win

MOVE.L (A1),self
GetA4()

get(self.winMain,MUIA_Window_Window,{win})

fullTrim(self.areaNames[self.strAreaName.getValueIndex()],tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( win , [ 20 , 0 ,
'Error' ,
'Area Name is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','Area Name is a mandatory field',0)
RETURN
ENDIF

fullTrim(self.intAccessLevel.getValue(),tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( win , [ 20 , 0 ,
'Error' ,
'Acces Level is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','Acces Level is a mandatory field',0)
RETURN
ENDIF

fullTrim(self.intConfrJoin.getValue(),tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( win , [ 20 , 0 ,
'Error' ,
'Initial Conf is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','Initial Conf is a mandatory field',0)
RETURN
ENDIF

Expand Down
35 changes: 7 additions & 28 deletions axSetupTool/frmSettingsEdit.e
Original file line number Diff line number Diff line change
Expand Up @@ -583,47 +583,31 @@ PROC canClose() OF frmSettingsEdit
ENDPROC TRUE

PROC unsavedChangesWarning() OF frmSettingsEdit
DEF win
get(self.winMain,MUIA_Window_Window,{win})
IF EasyRequestArgs( win , [ 20 , 0 ,
'Unsaved changes' ,
'You have unsaved changes,\nif you continue you will lose them.',
'_OK|_CANCEL' ] , NIL , NIL )=0 THEN RETURN FALSE
IF Mui_RequestA(0,self.winMain,0,'Unsaved changes',
'*OK|CANCEL','You have unsaved changes,\nif you continue you will lose them.',0)=0 THEN RETURN FALSE
ENDPROC TRUE

PROC saveSystemChanges() OF frmSettingsEdit
DEF tempStr[255]:STRING
DEF win

MOVE.L (A1),self
GetA4()

get(self.winMain,MUIA_Window_Window,{win})

fullTrim(self.strBBSName.getValue(),tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( win , [ 20 , 0 ,
'Error' ,
'BBS Name is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','BBS Name is a mandatory field',0)
RETURN
ENDIF

fullTrim(self.strBBSLocation.getValue(),tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( win , [ 20 , 0 ,
'Error' ,
'BBS Location is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','BBS Location is a mandatory field',0)
RETURN
ENDIF

fullTrim(self.strSysopName.getValue(),tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( win , [ 20 , 0 ,
'Error' ,
'Sysop Name is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','Sysop Name is a mandatory field',0)
RETURN
ENDIF

Expand Down Expand Up @@ -697,21 +681,16 @@ ENDPROC

PROC saveServerChanges() OF frmSettingsEdit
DEF tempStr[255]:STRING
DEF win,i
DEF i
DEF control:PTR TO control
DEF toolName[255]:STRING

MOVE.L (A1),self
GetA4()

get(self.winMain,MUIA_Window_Window,{win})

fullTrim(self.paBBSPath.getValue(),tempStr)
IF EstrLen(tempStr)=0
EasyRequestArgs( win , [ 20 , 0 ,
'Error' ,
'BBS Path is a mandatory field',
'_OK' ] , NIL , NIL )
Mui_RequestA(0,self.winMain,0,'Error','*OK','BBS Path is a mandatory field',0)
RETURN
ENDIF

Expand Down

0 comments on commit cabb8b8

Please sign in to comment.