Hi
Just some thoughts and questions...
* why do you send visual controls along into the presenter & model?
in your reason-handler, you know which edit it pertains...
they've got no business in there, except maybe as a source for errors.
* Use PathDelim from sysutils instead of hardcoded '\'.
function TModel.ProjectNameInRootDir(aData: TDirectoriesRec): TDirectoriesRec;
var
ls: string; // (l)ocal(s)tring => avoids name-clash
begin
if aData.dirPrjNameInDir then
ls:= aData.dirRoot + PathDelim + aData.dirProjectName
else ///// this ^ instead of '\' or '/'
ls:= StringReplace(aData.dirRoot, PathDelim + aData.dirProjectName, '', []);
///// this ^ instead of '\' or '/'
Result.dirRoot:= s;
end;
* Add '/' to check in location path for *nix.
function TValidateEntry.CheckFolderName(const aString: String): Boolean;
const
Chars = ['0'..'9', 'a'..'z', 'A'..'Z', '_', '-', ':', '\', '/'];
var ///// add this ^ for *nix
i: Integer;
s: String;
begin
Result:= True;
s := aString.Trim;
for i := 1 to Length(s) do
begin
if not (s[i] in Chars) then begin
result:= False;
break;
end;
end;
end;
* the 'chkAddProjectToRootChange' event-handler is not consistent (yet),
contemplating ...maybe 'ForceDirestories' could do the trick in model?!?
* the 'edtProjectLocationChange' event-handler gets called a *lot* and in a
round-about sort of way, contemplating...
* is there a reason for not letting the 'view' show a dialog, before requesting
the presenter to validate, instead of letting the model call back into the
'view' / dialog area for getting a path and then letting the 'view' request
validation from the presenter?
* would it perhaps make sense to have a 'TProjectProperties' or 'TMVPProps'
class to hold all the collected and calculated values and connections,
behind the scenes, instead of a record?
* you know, there's a clever way to get answers from the 'view' / user, in the
model & presenter, namely:
notify the observer -> let the reason-handler collect the info and
return it via call-stack-unwinding
* color feed-back is cool, but looks a bit funny with white edit-background on
a dark themed desktop
(the text-font is white)
*) contemplating means that I'm thinking about / 'sleeping on' input I can
provide you with...
Do you have any specific needs, that I can help you with, it seems you have a good handle on things...
Regards Benny