Page 1 of 3

User.ini - Desperately need this!

Posted: 08 Mar 2014 11:14
by binocular222
I posted this request before but maybe Don forgot it due to being too busy with Breadcrum.
But now I'm too tired of so many mysterious bugs that caused by my settings/tweak (not happended in ::fresh).
So, I'm strongly request a better way to store .ini settings:
- xyplorer.ini must be leave intact
- User's settings are saved in separate user.ini
- settings in user.ini will override xyplorer.ini
- every xyplorer version upgrade will overwrite xyplorer.ini to factory default but user.ini will be leaved intact
=> Benefit:
+ user settings are isolated and easily debugged
+ version upgrade of xyplorer.ini would be very easy: just overwrite it, no worry about losing user settings

@Don: please approve this request

Re: User.ini - Desperately need this!

Posted: 08 Mar 2014 11:17
by highend
+1 :)

Re: User.ini - Desperately need this!

Posted: 08 Mar 2014 11:33
by Filehero
+2


Cheers,
Filehero

PS: springtime is here :D

Re: User.ini - Desperately need this!

Posted: 08 Mar 2014 13:18
by SkyFrontier
+3
(I'd bet I wished same thing, but currently no way to confirm)

Re: User.ini - Desperately need this!

Posted: 08 Mar 2014 14:24
by klownboy
+4 makes sense provided it can be accomplished without hindering load time.

Re: User.ini - Desperately need this!

Posted: 16 Mar 2014 01:41
by Inkipaw
Hello!

I'm new to both the forum and XYplorer. Inexplicably, I only discovered XYplorer about 2 weeks ago and after a week of stress-testing, I purchased my lifetime license. This software ROCKS! (but I'm probably preaching to the choir here)

I've been scripting myself silly. since it's so easy to prototype with XY. Maybe this a noob suggestion :whistle: , but as an interim solution, how about preserving all your tweaks in a script, something like:

Code: Select all

// Back up the ini
 $o_ini = "<xydata>\<xyini>" ;
 $obak_file = replace("$o_ini", ".", "_")."_<date yymmdd_hhnnss>.bak" ;

 copyitem( "$o_ini", "$obak_file" ) ;

// Set your saved/documented tweaks
 setkey("5"   ,"ToolbarSepFac"  , "General" , "$o_ini") ;
 setkey("500" ,"ToolbarKeepOff" , "General" , "$o_ini") ;
 setkey("1"   ,"FlatPlusMinus"  , "Settings", "$o_ini") ;
 setkey("1"   ,"NoThumb"        , "Thumbs"  , "$o_ini") ;

 #190 ;
Or even fancier, create your own "User.ini" and preserve, read/set your preferences from there...
(e.g.) filename XYuser.ixi (to differentiate from a regular ini)

each line in the file being a user tweak/setting in a delimited format such as
Section | Tweak parameter/key | Value

So, e.g. the file content would be:
General|ToolbarSepFac|5
General|ToolbarKeepOff|500
General|TSBTransparency|50
Settings|FlatPlusMinus|1
Thumbs|NoThumb|1

Then, set/reset your tweaks by running:

Code: Select all

// Back up the ini
 $o_ini = "<xydata>\<xyini>" ;
 $obak_file = replace("$o_ini", ".", "_")."_<date yymmdd_hhnnss>.bak" ;

 copyitem( "$o_ini", "$obak_file" ) ;

// Update your tweaks
 $in_ixi = "<xydata>\XYuser.ixi" ; //Presuming your user tweak file is in the <xydata> path
 $in_xyu_settings = replace(readfile("$in_ixi"), "<crlf>", "<tab>") ;

 foreach( $in_params, "$in_xyu_settings", "<tab>") {
  $v_xyu_sec = gettoken("$in_params", 1, "|") ;
  $v_xyu_key = gettoken("$in_params", 2, "|") ;
  $v_xyu_val = gettoken("$in_params", 3, "|") ;

  if( $v_xyu_key AND $v_xyu_val ) { setkey("$v_xyu_val", "$v_xyu_key", "$v_xyu_sec", "$o_ini") ;}
 }

  #190 ;
Being new to XY, I'm sure there's a fair chance I'm missing something obvious, but maybe this approach gives someone an even better alternative idea.

Cheers!

Re: User.ini - Desperately need this!

Posted: 16 Mar 2014 01:59
by SkyFrontier
Hello and welcome, Inkipaw!
Yes, we already have something in the likes of what you said...

http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=11190

or even a remote management of licensing, like mentioned in

http://www.xyplorer.com/xyfc/viewtopic.php?f=5&t=5959

In my point of view, it's about making it easier to manage custom settings than properly dealing with settings.
Easy to implement, I'd guest, but a nightmare to decide which settings go to one .ini, which goes to the other.
Essentially, as it wouldn't aggregate a single line in terms of functionality, it's good to stay in the future.

Glad to know we have another scripter in the team...
;)

Best regards and warm wishes you like your stay,

SkyFy

Re: User.ini - Desperately need this!

Posted: 16 Mar 2014 02:52
by Inkipaw
Hi SkyFy,

Thanks for the welcome and the info. I see now (and kind of figured) that my perspective on the problem was somewhat simplistic, but hey, how else to learn then to question? So, something to keep mulling... :)

Kind regards,
Inkipaw

Re: User.ini - Desperately need this!

Posted: 16 Mar 2014 04:46
by SkyFrontier
Yeah, yeah! That's the spirit.
Feel free to ask for help, be it on forums or via pm.

*as you can see, there's an opportunity for learning lots, in this case*, so if you're up to the task, start scripting your envisioned solution. It's the next step as I've mentioned on one of those posts but I won't play this for now - many stuff to learn and prepare, here.

Re: User.ini - Desperately need this!

Posted: 16 Mar 2014 10:44
by Enternal
+5

Wow this sounds really good! This would make it very nice for testing purposes and bug hunting! I agree!

Re: User.ini - Desperately need this!

Posted: 04 Apr 2014 19:57
by Stef123
+6
klownboy wrote:...provided it can be accomplished without hindering load time.

Re: User.ini - Desperately need this!

Posted: 04 Apr 2014 20:21
by admin
Define "User's settings" as opposed other settings.

Re: User.ini - Desperately need this!

Posted: 05 Apr 2014 10:02
by Stef123
My definition of user: every setting that deviates from factory defaults.

All else been said above, in essence (if I understood correctly):
User.ini is not a replicate of xyplorer.ini anymore, which never holds true anyway, because user.ini contains options that xyplorer does not have and vice versa. Both versions are bound to diverge more and more as new features are added and default settings get changed.

New handling:
User.ini contains overrides only. Both ini-files are taken into account, but user.ini takes precedence.
No need to figure out anymore if a user (inadvertently) changed a setting or whether it came with an XY-version that had this default. If it's not in user.ini, it must have come with an upgrade and can be changed again, simply by replacing xyplorer.ini

Re: User.ini - Desperately need this!

Posted: 05 Apr 2014 10:07
by highend
Good explanation Stef123!

I see it the same way.

Re: User.ini - Desperately need this!

Posted: 05 Apr 2014 15:30
by admin
Sorry, but I fail to understand the use of this.

(But, just to make sure, it would be so much work that it will never happen anyway.)