Session Manager [v6.60]

Discuss and share scripts and script files...
FluxTorpedoe
Posts: 762
Joined: 05 Oct 2011 13:15

Re: Session Manager [v2.71]

Post by FluxTorpedoe » 08 Sep 2014 17:15

@SammaySarkar
Thanks for finding the (outsider) :bug: ! :)

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

And now here comes the baby, with layout management rewrote to use all the new bells and whistles, plus legacy XY compatibility code removed, so everything should be a little bit snappier!
Since it introduces XYplorer version requirements, I'll push Session Manager version number to the next digit: v3.0 (still branding it beta to remain on the safe side.)

As usual, don't hesitate to voice your feedback!

Hope you enjoy it, 8)
Flux


##############################
### Session Manager v3.0 beta 1 ###
##############################


• REQUIREMENTS: XYplorer >= v14.10.0104 :!:

• INSTALLATION: refer to first post of thread

• UPDATE:
» from v3.x, or for those who don't use layouts:
— Overwrite your existing SessionManager.xys with latest version

» from v2.x to v3.x, for layout users:
Before updating, it's advised (though not mandatory) to:
— Backup your SessionManager.ini
— Reset XYplorer to your favorite layout or default layout if you have one (Session Manager > Layout Tools > Load Default Layout)
Then (no need to exit XYplorer):
— Overwrite your existing SessionManager.xys with latest version
— Update your default layout (Session Manager > Layout Tools > Update Default Layout)
— For each of your layout sessions, load them, manually rearrange their layout, then update them (*)

(*) Creating code only for such a one-time update wouldn't have been efficient, sorry... If you have many layout sessions, the easiest is to temporarily backup your whole XYplorer folder before updating, then run the two XYplorers alongside so you have a reference to recreate your layouts.

Session Manager v3.0 beta 1 - Changelog
*/+ Rewrote layout management, which now recalls position of separator of Panes, InfoPanel, Catalog, etc...
Note: status of "Show sort headers in all view" is still saved with layout (not included in XY default layouts)
* Removed code that managed compatibility with old versions of XYplorer
* Cleaned code
Attachments
SessionManager.xys
(76.51 KiB) Downloaded 96 times

klownboy
Posts: 2954
Joined: 28 Feb 2012 19:27

Re: Session Manager [v3.0 beta 1]

Post by klownboy » 08 Sep 2014 17:59

So far, so good Flux, and I emphasize good! I followed your instructions to the tee and no issues. Question though, I ask not because of a problem, but it is it at all necessary to do an XY save before we "Update session [and layout]"? I ask only because others may be wondering and it doesn't appear to be necessary. :appl:

Edit: Though it is using the existing layouts to initially setup the session, it's creating it's own layout data within SessionManager.ini. So if/when you change a layout and "update session with layout", if the user wants to also save the "XY" layout (txt file) in the Layouts folder they must do that separately...is that a correct statement? No problem either way, it's good to know that after changing the session and saving it with layout, it's totally independent. I may have to remember to change the XY layout files as well periodically.

Only a suggestion... that's one ugly blue star. :) Why not go with this nice blue arrow to indicate the current session.
SessionManager_Capture.PNG
SessionManager_Capture.PNG (6.3 KiB) Viewed 1520 times
Of course you wanted to use something built-in to XY.

Thanks again and great job (and now we have pane size!),
Ken
Last edited by klownboy on 08 Sep 2014 21:11, edited 1 time in total.

Filehero
Posts: 2355
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Session Manager [v3.0 beta 1]

Post by Filehero » 08 Sep 2014 19:05

Hi Flux,

basically, Ken has said all, but: update to 3.01 was without any apparent problems over here, every existing layout survived. :D

Again, thanks for making this great add-on and keeping it alive. :appl: :appl: :beer:


Cheers,
Filehero

FluxTorpedoe
Posts: 762
Joined: 05 Oct 2011 13:15

Re: Session Manager [v3.0 beta 1]

Post by FluxTorpedoe » 08 Sep 2014 20:53

Hi'
Glad it's working! :)

@Ken
klownboy wrote:is it at all necessary to do an XY save before we "Update session [and layout]"? I ask only because others may be wondering and it doesn't appear to be necessary.
Though it is using the existing layouts to setup the session, it's creating it's own within SessionManager.ini so the XY's layouts are not changed if you save a session layout. No problem, it's good to know that after creating the session and saving it, it's totally independent. I may have to remember to change the XY layout files as well periodically.
• Hmmm, I fear I do not understand the whole XY saving stuff... :oops:
You're right in saying that Session Manager stores layout info only in its own SessionManager.ini file, and nowhere else (no layout.txt, no saving of XY settings either).
Now what do you mean about XY's layouts...? AFAIK, XY only stores one Browse and one Find layout info in its own ini, so there shouldn't be anything else — unless you save them manually with writelayout(). So I'm even more lost when you say "I may have to remember to change the XY layout files as well periodically." :shock:
Please, enlighten me... :D

• Now, regarding the active session icon, that I understand... and quite agree! As a matter of fact, the arrow one is much more sensible indeed! I think I like it, there might be a change in SM pretty soon... ;)

@Filehero
I must be really tired because I'm really glad... but I don't understand either how —except the active one— the layouts could have survived without you rearranging them... (the code to read the original layout info having been removed!) :veryconfused:

Last minute thought: Or are you both talking about tabsets (content) instead of layouts (visual arrangement)?

Anyway thanks for the feedback, I'll probably see things more clearly tomorrow! 8)
Flux

klownboy
Posts: 2954
Joined: 28 Feb 2012 19:27

Re: Session Manager [v3.0 beta 1]

Post by klownboy » 08 Sep 2014 22:01

Hey Flux,
Relatively new as of a few months ago, remember there's a folder under <xydata> now that's called "Layouts". It contains any "layouts" (each layout is contained within a separate layout txt file) and is loaded/saved not only via scripting with loadlayout and setlayout, but we also have the capability to both load and save layouts in the menu. Look under Window | Load layout and also Save layout. It will take you to the "Layout" folder to either load or save a XY layout in a layout text file. You can have as many as you like and name them whatever you want. I suppose you could have utilized those or made more layout text files in the Layouts folder instead of placing that information in SessionManager.ini file if you elected to do so. Check this out. http://www.xyplorer.com/xyfc/viewtopic. ... at#p107403
Thanks.

Filehero
Posts: 2355
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Session Manager [v3.0 beta 1]

Post by Filehero » 09 Sep 2014 06:32

FluxTorpedoe wrote: @Filehero
I must be really tired because I'm really glad... but I don't understand either how —except the active one— the layouts could have survived without you rearranging them... (the code to read the original layout info having been removed!) :veryconfused:
First of all, with your script I'm just a consumer enjoying usage without any under-the-hood-knowledge. :)

For the current beta I did follow your instructions, where I considered the last one to be at least sort of crititical.

Code: Select all

— For each of your layout sessions, load them, manually rearrange their layout, then update them (*)
So, I did load them - and found "them" unchanged so that I could skip the update step. "Them being unchanged" means XY looked the same as before the beta update.
Wether this is due to your beta changes or the fact, that XY's support for layouts introduced recently is uncoupled from this logic (as Ken indicated) wasn't obvious to me.


Cheers,
Filehero

FluxTorpedoe
Posts: 762
Joined: 05 Oct 2011 13:15

Re: Session Manager [v3.0 beta 1]

Post by FluxTorpedoe » 09 Sep 2014 09:22

Thanks a lot for your feedback guys!
Looks like the script update was as surprisingly easy as it was to update the code then, cool... :kidding:

About the confusion, my bad, I knew about the loadlayout(load|save) but never used it, so I didn't even have the Layouts folder in my XYplorers (personal or fresh test versions). I'd missed the Menu entry though (only quickly searched in Help's "Index") — and Argh!!! As I reread my previous post, I just saw my typo: why on earth did I write writelayout()
??? :roll: :oops:
But more importantly, I didn't explain how layouts are managed by Session Manager indeed. I'd made the choice to keep it "internal" which leaves them faster to use and maintain, and more open (e.g. ability to still use other non-official layout parameters like "Show Sort Header").

So to sum things up, here's the missing manual entry (in hope of a future compilation):

:arrow: Info about Session Manager layouts:
There's no link whatsoever between Session Manager layouts (their data is stored in SessionManager.ini) and XYplorer layouts (separate files stored in Data\Layouts). So there's no maintenance needed and no risk of interference between the two.


Well, thanks again for your feedback...
And don't hesitate to keep it going — I'll wait to be fully "aware" to process it. :mrgreen:

Have a nice day, 8)
Flux

autocart
Posts: 833
Joined: 26 Sep 2013 15:22

Re: Session Manager [v2.6b7]

Post by autocart » 19 Sep 2014 19:44

FluxTorpedoe wrote:Hi'

Been so busy that I forgot to post the latest version from April... :oops: which makes your wish possible !

:arrow: To startup XYplorer with a particular session loaded
— Create a shortcut to XYplorer, edit its properties, and append the following to the "Target" field:

Code: Select all

 /new /script="::global $DYN_InpSess; $DYN_InpSess='Name Of Session'; load 'SessionManager.xys', '_Load';"
(Obviously, replace 'Name Of Session' with the name of the session you want to load on startup.)
AW..E..SOME!!!!!!!!!!!!
Thanks, Flux, you rock! :!: :beer:

FluxTorpedoe
Posts: 762
Joined: 05 Oct 2011 13:15

Re: Session Manager [v3.0 beta 1]

Post by FluxTorpedoe » 20 Sep 2014 10:46

:whistle: :kidding:
Thanks.

By the way, I found yet another kinda :bug: when reordering already ordered sessions with tricky names, so this needs a YAF (YetAnotherFix)!

So if one of you find something suspicious — or have an interesting idea, please, feel free to talk about it so we can have a nice and clean v3.0 Final! :)

Have a nice day, 8)
Flux

autocart
Posts: 833
Joined: 26 Sep 2013 15:22

Re: Session Manager [v3.0 beta 1]

Post by autocart » 22 Sep 2014 13:37

when changing/loading sessions the (mini)tree always gets collapsed as much as possible.
is this by design?

EDIT:
found and fixed it:
line 484: // #1040; // Optimize Tree
line 485: // #1010; // Fully Collapse

FluxTorpedoe
Posts: 762
Joined: 05 Oct 2011 13:15

Re: Session Manager [v3.0 beta 1]

Post by FluxTorpedoe » 07 Oct 2014 15:43

autocart wrote:when changing/loading sessions the (mini)tree always gets collapsed as much as possible.
Yep, as you found out, it was done on purpose !
When I used the minitree (a few years ago), it seemed sensible so as to avoid unnecessary clutter (which seemed to be its very purpose). But I stopped using the minitree so I'm open to suggestions... Do you prefer to manually optimize your minitree in general?
klownboy wrote:Why not go with this nice blue arrow to indicate the current session.
Hmm, I still confirm I'm not fond of the blue star icon… but I have a hard time finding a pair of icons for the active sessions: one if the active session has a layout, and one if the active session has no layout—or maybe only one could be enough? Plus, they have to be readily accessible (i.e. part of XY or regular Windows DLLs).
Well, in the meantime, I grouped and clarified the relevant entries in the script, so it will be easily tweakable anyway.

@all
Now, I fixed the reordering bug, plus the newly-broken "Activate Preview When Loading..." option. BTW, for fresh installs, I'll now set this option to ON by default (until layouts can recall the InfoPanel tab status), and "Enable Confirmation Dialog..." to OFF by default.
So I just have to figure out if there's still some facelift and tweaking to do before releasing the final v3!

Feel free to jump in !

Have a nice day, 8)
Flux

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: Session Manager [v3.0 beta 1]

Post by Enternal » 07 Oct 2014 21:16

About the minitree, perhaps it could be an option in the script at the top of the script? That might help solved the problem. I have been manually commenting out the tree optimization code because of that as well. My reason is I have a favorite tree that I had setup and locked.

Other than that, it works great!

FluxTorpedoe
Posts: 762
Joined: 05 Oct 2011 13:15

Re: Session Manager [v3.0 beta 1]

Post by FluxTorpedoe » 08 Oct 2014 04:53

Enternal wrote:I have been manually commenting out the tree optimization code because of that as well. My reason is I have a favorite tree that I had setup and locked.
Oh ok, I get it! Though out of curiosity, how do you do that? (*)

OTOH, when switching sessions with optimization OFF (in-script or manual/favorite), the tree becomes a mess pretty fast...
:arrow: So I thought it worth enough to officially add it to the Options menu: "Auto-Optimize Tree on Session Change" (see next beta).

(*) BTW, I just thought of another use of the feature "Associate Script with Current Session":
Associate a specific ::loadtree command to a session, so that when it's loaded it arranges the tree in a desired state!

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: Session Manager [v3.0 beta 1]

Post by Enternal » 08 Oct 2014 20:55

FluxTorpedoe wrote:
Enternal wrote:I have been manually commenting out the tree optimization code because of that as well. My reason is I have a favorite tree that I had setup and locked.
Oh ok, I get it! Though out of curiosity, how do you do that? (*)

OTOH, when switching sessions with optimization OFF (in-script or manual/favorite), the tree becomes a mess pretty fast...
:arrow: So I thought it worth enough to officially add it to the Options menu: "Auto-Optimize Tree on Session Change" (see next beta).

(*) BTW, I just thought of another use of the feature "Associate Script with Current Session":
Associate a specific ::loadtree command to a session, so that when it's loaded it arranges the tree in a desired state!
I'm assuming that it's a rhetorical question since you already added a way to deal with that? :lol:

But yes, that sounds good! Also sounds like there's a good chunk more code too so more time to debug right? Haha

FluxTorpedoe
Posts: 762
Joined: 05 Oct 2011 13:15

Re: Session Manager [v3.0 beta 1]

Post by FluxTorpedoe » 10 Oct 2014 17:34

Enternal wrote:I'm assuming that it's a rhetorical question since you already added a way to deal with that?
Hehe, but no, it was a practical question! They're so many ways to do so many things in XY that it's hard to think or know of them all…

About debugging, that shouldn't have taken too long since there wasn't much code addition — except that I discovered that the aforementioned “script association” had been broken too in some cases! Fixed... Along with another bug with toolbar support in layouts, plus some reorganizing/rephrasing of the options.

@all
So I could roll out a v3.0 RC…
I'm just still pondering about the “active session” icon though. I tried a lot but none pop up as clearly as the current yellow star. Maybe I could use only this one whether or not the session has a layout, what do you think?
(Granted, that's a deceptively trivial issue, but I like things nice as much as I like them logical... :mrgreen: )

Have a nice day, 8)
Flux

Post Reply