rejetto forum

Testing build #224

rejetto · 22 · 15607

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
The bug told by silentpliz comes since this post
Quote
BUILD 223
Rejetto. This method checks if the external template file has changed? Am I right? So, why dont to check in that time when a request arrives to the server from a user?

you are right. i decided to give up with it, and just make the check once per second. ;)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
i'll try to publish 225 before i go bed, but not sure.
i have to finish the archive selection.
i will now watch a film with my girlfriend now.
;)


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
i make a come back to this bug

hfs.ini in sources

Quote
tpl-file=hfs.tpl
tpl-editor=C:\Programmi\PSPad editor\pspad.exe
delete-dont-ask=no
To by-pass this type of probleme, it is enough to modify the following procedure
Quote
function getTplEditor():string;
begin
result:=or_([
  if_(fileExists(tplEditor),nonEmptyConcat('"', tplEditor, '"'),''),
//  nonEmptyConcat('"', tplEditor, '"'),
  loadregistry('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe', '', HKEY_LOCAL_MACHINE),
  'notepad.exe'
])
end;

This other version obliges to correct therecorded but not found editor.

Quote
function getTplEditor():string;
begin
  if (tplEditor>'') and not fileExists(tplEditor) then
  begin
  msgdlg('TPL Editor not found, select another one or correct the path of '+CRLF+tpleditor, MB_ICONWARNING,'EDITOR NOT FOUND');
  mainfrm.ChangeEditor1Click(NIL);
  end;
  result:=or_([
    nonEmptyConcat('"', tplEditor, '"'),
    loadregistry('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe', '', HKEY_LOCAL_MACHINE),
    'notepad.exe'
  ])
end;

My preference goes for this second version, because it facilitates those who have neither notepad ++, nor notepad
 ;)
« Last Edit: February 22, 2009, 12:37:53 AM by mars »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
Quote
you are right. i decided to give up with it, and just make the check once per second.

Having made some small searches, a reffreh all the seconds does not seem necessary, the additions in two macro following ones give satisfaction

Quote
procedure TmainFrm.Changefile1Click(Sender: TObject);
begin
if selectFile(tplFilename, 'Change template file', 'Template file|*.tpl', [ofPathMustExist, ofCreatePrompt]) then
  setNewTplFile(tplFilename);
keepTplUpdated();  //mars
end;
--------------
procedure TmainFrm.Restoredefault1Click(Sender: TObject);
begin
if msgDlg('Continue?', MB_ICONQUESTION+MB_YESNO) = MRNO then exit;
tplFilename:='';
tplLast:=-1;
setStatusBarText('The template has been reset');
keepTplUpdated();  //mars
end;

Rejetto, by pity, say I that for once I am 100 % in the truth ;)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
  if_(fileExists(tplEditor),nonEmptyConcat('"', tplEditor, '"'),'')

i like it, but this version.
i don't think it's worth to warn the user, his attention will be catched anyway when he sees a different editor than the expected one, but the functionality will remain (an editor is running and he can edit).


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
Quote
you are right. i decided to give up with it, and just make the check once per second.

Having made some small searches, a reffreh all the seconds does not seem necessary, the additions in two macro following ones give satisfaction

that's exactly what i did at first. my decision came later.
i disliked it: the call must be in so many places, it's against a good design principle, it makes the code harder to maintain.
if you must, you do, but if you can avoid is better.
so i decided that a call every second is not hurting anyone, and i prefer it.
There are many truths, and some are more convenient than others. :)
« Last Edit: February 22, 2009, 02:59:19 AM by rejetto »


Offline chthonic

  • Tireless poster
  • ****
    • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
just caught up with all the posts on this... and I never had any trouble withe  RAWR template.. of course.. I am still using TOG 3.0 ...... the newer ones don't have the login option


so there might bea specific dif in how HFS handles the code between teh two