Page 16 of 35

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 00:02
by oblivion
Not that you need my confirmation, but it's similarly broken here. :(

It's embedded itself so far into my workflow that I'm having to catch myself every time I try to use it.

I may have to try actual bribery. ;)

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 00:18
by klownboy
oblivion wrote:I may have to try actual bribery.
I'll contribute to the bribe! :ninja:

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 09:45
by bdeshi
It's been broken since 15.00.301 when interpretation of ternary conditionals was slightly tweaked bugged (fixed in 15.00.403). Try this in pre-..0301 and ..301. Will return 'y' and 'n' resp.

Code: Select all

::echo ('a')?'y':'n';
And the script has a couple ternary statements where the condition only has the lefthand side, it's assumed that any value will return true. Now those statements need a full condition.

So here's a "patch".
Select pristine or not-extensively-modified sessionmanager.xys v3.0RC2 and run this patcher.[code] end !confirm("Warning: this is a blind patcher and does not check if selected file is supported" . <crlf 2><curitem><crlf 2> .
"Are you 100% sure this is a session manager v3.0RC2 script?");
//end (regexmatches(readfile(<curitem>),'\$GEN_SM_Version[^=;]*=[^"]*\"3\.0\sRC2\"') == ''),'Not correct SessionManager version';
$in = readfile(<curitem>);
$out = replace(
replace(
$in,
'$DYN_b_InpSessLay = (getkey("", "Layout ".$DYN_InpSessMaster, $GEN_Ini))? 1 : 0;',
'$DYN_b_InpSessLay = (getkey("", "Layout ".$DYN_InpSessMaster, $GEN_Ini) != "")? 1 : 0;',
),
'$PRE_CurSessLay = (getkey("", "Layout ".replace($PRE_CurSess, $GEN_AutoSaveSuffix), $GEN_Ini))? replace($PRE_CurSess, $GEN_AutoSaveSuffix) : "";',
'$PRE_CurSessLay = (getkey("", "Layout ".replace($PRE_CurSess, $GEN_AutoSaveSuffix), $GEN_Ini) != "")? replace($PRE_CurSess, $GEN_AutoSaveSuffix) : "";'
);
if ($in == $out) { end 1, "Sorry can't patch". <crlf> . "(string not found/nothing replaced)"; }
$out = replace($out,
'/* version 3.0 RC2 - 2014-10-19 */',
'/* version 3.0 RC2 patch 1 - 2015-04-17 */'. <crlf> . '/* patch 1: fix ternary conditionl bug' . <crlf> .
' http://www.xyplorer.com/xyfc/viewtopic. ... 82#p121882 */');
writefile(<curitem>, $out, 'o');[/code][/size]


or here's a boring patched xys: [unnecessary now]

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 12:46
by calude
hi Sammay
I copied your "boring patched xys" to the script folder and now none of my sessions appear in the menu...
the ini still seems to contain my sessions but how do I "reload" my lost sessions?

Calude

edit: I used the patcher and everything is smooth and fine again

:appl: :appl: :tup: :tup:

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 13:12
by klownboy
I used the patch instead. No issues and it seems to be back to its normal working state. Thanks once again Sammay. :appl:

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 14:09
by PeterH
Hey - did I miss something? Is there a reason for it?

Now 'A'?... is not true,
while If('A') is true.
So 'A' only sometimes is true :shock:

Seems wrong?

I think definition says 0 is false, else it's true. 'A' isn't 0. (See the "if"!)
Again: did I miss something? Or :bug: :?:

(To say: I rarely use ternary :P )

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 14:47
by bdeshi
Thanks! glad to help. :D
calude wrote:I copied your "boring patched xys" to the script folder and now none of my sessions appear in the menu...
hmm, that uploaded xys had wrong encoding. My text editor didn't/couldn't show some missing special characters. :oops: :oops:
Re-uploaded a fixed version.
PeterH wrote:Hey - did I miss something? Is there a reason for it?
Regardless of what's true and what's false, that snippet, ::echo ('a')?'y':'n'; , simply returns different echos when run in different XY versions, say 15.00.300 and 15.00.301

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 15:25
by admin
PeterH wrote:Hey - did I miss something? Is there a reason for it?

Now 'A'?... is not true,
while If('A') is true.
So 'A' only sometimes is true :shock:

Seems wrong?

I think definition says 0 is false, else it's true. 'A' isn't 0. (See the "if"!)
Again: did I miss something? Or :bug: :?:

(To say: I rarely use ternary :P )
Yes, you are right, I created a bug there. Fix comes.

Actually there are 2 values that count as False: "" and 0.

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 16:57
by oblivion
SammaySarkar wrote: Re-uploaded a fixed version.
Works perfectly here. Thanks! You have saved my sanity! :D

Now then: how do I get :beer: in an envelope? ;)

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 20:32
by klownboy
SessionManager is back to working like a champ with XYplorer version beta version 15.00.0403 without the need for Sammay fix...for info only. Thanks Don, Sammay, Filehero and PeterH.

Re: Session Manager [v3.0 RC 2]

Posted: 17 Apr 2015 23:27
by PeterH
admin wrote:Actually there are 2 values that count as False: "" and 0.
Perfect! :appl:

Thanks :beer:

Re: Session Manager [v3.0 RC 2]

Posted: 18 Apr 2015 00:06
by Stef123
Icons are only visible when I choose the default order that lists sessions at the bottom. With Options > list sessions on top, the icons disappear.

Re: Session Manager [v3.0 RC 2]

Posted: 18 Apr 2015 10:33
by Filehero
Stef123 wrote:Icons are only visible when I choose the default order that lists sessions at the bottom. With Options > list sessions on top, the icons disappear.
I had one session that reproducibly generated duplicated menu entries (and triggered some other strange behaviours). After deleting it everything seems ok now. However, the icons have been ok ever since the yesterday's update to 15.00.0404.

@Sammay, Don: thank for the fixes :D
@Ken: I contributed the "ticket" only. :mrgreen:


FH

Re: Session Manager [v3.0 RC 2]

Posted: 18 Apr 2015 11:03
by Stef123
Filehero wrote: However, the icons have been ok ever since the yesterday's update to 15.00.0404.
Ha, you're right. Gave it another try and it's ok with 15.00.0404
Thanks.

Re: Session Manager [v3.1]

Posted: 14 Jun 2015 08:32
by FluxTorpedoe
Hi Everyone !

Ffff, back online (though sporadically) after half a year… 8)
& XYplorer has kept on evolving (as usual)!

Well, first of all, my warmest thanks to everyone who provided support while I wasn't there. :beer:

And now, I haven't much to produce but here's a tiny, mostly cosmetic update:
— I added a "Hide/Unhide XYplorer Main Menu" entry in the options menu —in case you mess things up with your layouts… ;)
— I found myself using the Autosave feature on and off quite regularly, pretty useful!… But the menu entries (notably the "reset") were confusing so I renamed and reordered them, hope it's better now.
— Idem for the options menu for the autosave entry which is nearly as much a function as an option, considering that it's something you might want to turn on and off regularly (and not only once like the other options).

Note: Please disable AutoSave before updating (because of a suffix change). Not a big deal but else you'll have a useless AutoSave session in your panes folder.


As usual, please comment if you feel something needs more polishing/enhancement!

Have a nice day, 8)
Flux


########################
### Session Manager v3.1 ###
########################


• REQUIREMENTS: XYplorer >= v14.10.0104 :!:
Previous version v2.71 available here

• INSTALLATION » for first-time users:
— Please refer to first post of thread

• UPDATE » from v3.x (or not using layouts):
— Overwrite your existing SessionManager.xys with latest version

---------------------------

Session Manager v3.1 - Changelog
+ Added a "(Un)Hide XYplorer Main Menu" entry in options menu
* Renamed/reordered Autosave entries in main and options menus
* Re-introduced saving of active/inactive state of panes with layouts (had disappeared when switching to XY layout system)
* added more spaces before "—AutoSave—" session suffix for clarity