Page 1 of 1

Frankenstein or The Modern Prometheus

Posted: 04 Apr 2012 22:09
by aurumdigitus
Today feel Dr. Frankenstein after finding out his proud creation was in fact a monster. Once-apon-a-time (well September, 2010) requested that a sound be played after an operation had been completed. Don - bless his heart - added this feature as a tweak in v9.50.0110.

Delighted to have it, implemented it immediately. But didn't have the foresight to make a note. Today wanted to get rid of that now pesky trumpet but as incipient senescence has begin could not locate the source.

For those who may not know tweaks are mentioned neither the XYplorer.chm nor the pdf Help. Long story short after combing through the program's directory for the better part of an hour finally found it in an .ini. For those who may be curious: "BJSoundAllDone=<full or portable path to a WAV file>".

The moral: When making unorthodox changes to software DOCUMENT THEM or you too like Victor Frankenstein may come to regret what he had wrought. :oops:

Re: Frankenstein or The Modern Prometheus

Posted: 05 Apr 2012 09:59
by RalphM
There's a script available to list (all?) INI tweaks.
http://www.xyplorer.com/xyfc/viewtopic. ... lit=tweaks

Had a quick look at it and think it has to be updated manually to reflect newly added tweaks though...
Correct me if I'm wrong.

Re: Frankenstein or The Modern Prometheus

Posted: 05 Apr 2012 13:08
by aurumdigitus
Thank you RalphM for the reference to the script. It is always good to have more arrows in the quiver.

Reading over the thread smiled at the reference to Frankenstein.

With word-wrap off the last version weights in at almost 200 SLOC's. That is one heck of a lot of code!

Would a contemporary manual update require having to wade through History.txt or is there a central repository of tweaks?

Regardless, while it would be wonderful to have an update perhaps the work of a master should only be modified by a master.

Edit: Okay - forget the History.txt. Operator error. :oops:
Simple word search of XYplorer.ini yields Tweak appearing about 100 times. That makes project seem doable.

Re: Frankenstein or The Modern Prometheus

Posted: 05 Apr 2012 16:19
by j_c_hallgren

Re: Frankenstein or The Modern Prometheus

Posted: 05 Apr 2012 16:49
by Stefan
Would be nice if the tweak lines in the ini had an common syntax.
(if will should help collecting this info for you Don, just tell us)


Like e.g.:
; Tweak: [ListTimeFormats](2) edit the following as you need

; Tweak: [ID3toFilename](3) idem
instead of:
; Tweak: edit the following as you need

; Tweak: idem
(typo? btw...)

I imagine an syntax like
- String "; Tweak:"
- Option "[ bla ]"
- Lines count "(n)"
- Description " blub bla bla"

where
* String is always the same
* Option tells for what this tweak is good for
* the "lines count" tells how many relevant lines of this tweak will follow
* Description is for notes or advices


That would make an script like the following more useful:

Code: Select all

   $INI = readfile("<xydata>\<xyini>");
   set $OUT;

   foreach($LINE, $INI, "<crlf>"){

      if ($mark==1){
           $OUT = $OUT . "<tab 2>" .$LINE . "<crlf>";
      }

      if (substr($LINE, 0, 8) == "; Tweak:"){
           $OUT = $OUT . $LINE . "<crlf>";
           $mark=1;
      }else{
           $mark=0;
      }
   }

   text $OUT;

Example output (cropped):

Code: Select all

; Tweak: min width reserved for the element (e.g. addressbar) next to the toolbar
		ToolbarKeepOff=400
; Tweak: 1-255
		TSBTransparency=70
; Tweak: png (default), jpg, bmp, gif, or tif
		ImageFromClipFormat=
; Tweak: set label for unit byte
		UnitByte=" bytes"
; Tweak: set label for empty folders
		FolderEmpty="[Empty]"

Re: Frankenstein or The Modern Prometheus

Posted: 05 Apr 2012 16:52
by eil
that script is very useful! :D wish it continued to update.. :cry:

Re: Frankenstein or The Modern Prometheus

Posted: 05 Apr 2012 17:05
by Stefan
New idea: added [section headers]

Code: Select all

   $INI = readfile("<xydata>\<xyini>");
   set $OUT;

   foreach($LINE, $INI, "<crlf>")
   {

      if (substr($LINE, 0, 1) == "[")
      {
            $SECTION = $LINE;
      }

      if ($mark==1)
      {
           $OUT = $OUT . "<tab 2>" .$LINE . "<crlf>";
      }

      if (substr($LINE, 0, 8) == "; Tweak:")
      {
           $OUT = $OUT . $SECTION . "<crlf>" . $LINE . "<crlf>";
           $mark=1;
      }else{
           $mark=0;
      }
   }

   text $OUT;

Example result (cropped):

Code: Select all

[General]
; Tweak: min width reserved for the element (e.g. addressbar) next to the toolbar
		ToolbarKeepOff=400
[General]
; Tweak: png (default), jpg, bmp, gif, or tif
		ImageFromClipFormat=
[General]
; Tweak: set label for unit byte
		UnitByte=" bytes"
[Thumbs]
; Tweak: make no thumbs: ext.ext
		NoThumb=
[Undo]
; Tweak: 
		PromptUndoAfterMinutes=10
[NewTemplates]
; Tweak: 3 templates for New Folder default names
		Version=1