Frankenstein or The Modern Prometheus

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Frankenstein or The Modern Prometheus

Post 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:

RalphM
Posts: 2090
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Frankenstein or The Modern Prometheus

Post 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.
Ralph :)
(OS: W11 25H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Frankenstein or The Modern Prometheus

Post 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.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Frankenstein or The Modern Prometheus

Post by j_c_hallgren »

Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Frankenstein or The Modern Prometheus

Post 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]"

eil
Posts: 1875
Joined: 13 Jan 2011 19:44

Re: Frankenstein or The Modern Prometheus

Post by eil »

that script is very useful! :D wish it continued to update.. :cry:
Win 7 SP1 x64 100% 1366x768|1900x1080

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Frankenstein or The Modern Prometheus

Post 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

Post Reply