Session Manager [v6.20]

Discuss and share scripts and script files...
klownboy
Posts: 2691
Joined: 28 Feb 2012 19:27

Re: Session Manager [v5.73]

Post by klownboy » 27 Sep 2018 16:47

Hi Flux, congratulations on another great update with some nice new features. :tup: :appl:
For info: I had an issue initially with SM not returning my "Normal" session to a "restored" window state (i.e., not maximized or minimized state). Coming from a photo viewing session which was maximized, it would insist on staying maximized when returning to my "Normal" session. I saved the session with layout numerous times in the restored state but it wouldn't stick. I had saved all my sessions with layout after initially running the updated version as you recommended. I opened SessionManager.ini and changed the Maximized setting to "0" on both my "Normal" and "Default" layouts. If I remember correctly at least one of those was on "1". After cycling back and forth between maximized sessions and restored sessions all is working fine now with no issues. Thanks once again.

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

Re: Session Manager [v5.73]

Post by FluxTorpedoe » 27 Sep 2018 20:13

Hi Ken,

   Not sure I understand correctly… But the only thing I can think of is that while using a regular (non-layout) session, you maximized it (e.g. before switching to a Photo layout session), and any change of layout in a regular session is automatically considered as the new global layout for all regular sessions.

   In any case, just clicking on XY’s "Restore" button —while using a regular session— should have sufficed.
   Or loading your default layout.

   But I may miss something, so don’t hesitate if you still encounter some weirdness (or bug), any feedback is really welcome!
   And on second thought, I’ll add an new entry to the missing manual…

 ———————————————————————————


      •••   Session Manager Missing Manual – Layout behavior with regular sessions…   •••

 
 — When using a regular session, any change of layout will remain in effect for all regular sessions; this change will be considered a "last regular layout", not specific to this session (because that’s what layout sessions are for!). So,
   – loading another regular session won’t have any effect on the layout, and
   – loading a layout session then a regular session will still revert to this "last regular layout" ⁽¹⁾.

 — Conversely, when using a layout session, any change of layout is discarded as soon as the session is left; unless the session (and/or layout only) has been updated, obviously.

—————————
⁽¹⁾ Technically, when leaving a regular session to enter a layout session, a "Last" layout is automatically saved. Thus, the next time a layout session is left for a regular session, it’s this "Last" layout that is restored.
   Unless "Options" > "Layouts: Always Load Default Layout…" is checked, then the "Default" layout is loaded instead of the "Last".

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

Re: Session Manager [v5.73]

Post by klownboy » 27 Sep 2018 21:07

Hi Flux, as I mentioned it's all working fine now. Sorry I was not clear. I should have stated this up front that all my sessions are saved with layouts. I have no non-layout sessions and all were saved (with layout) up front immediately after installing the new version. Unfortunately, I have no idea why it wouldn't initially save my "Normal" session (with layout) in the restored state. I never purposely maximized in my so-called "Normal" session. When I returned to that "Normal" session from other sessions that were maximized it stayed maximized. I will keep an eye on the behavior and report back if I notice anything, but honestly I wouldn't worry about it unless someone else might report an issue along the same lines. Thanks again.

GUIguy
Posts: 53
Joined: 03 Jan 2016 02:11
Location: Oregon, USA Win Pro 7-64 & 10-64
Contact:

Re: Session Manager [v5.73]

Post by GUIguy » 27 Sep 2018 23:21

Before copying the new version to the scripts folder, I renamed the old version to "SessionManager (5.2).xys-old" Then I moved the new version to the folder.

Was I supposed to do something else? Perhaps with the .ini file?

The menu still shows Reset above Update. (BTW, what does RESET do and what does UPDATE do?)
GUIguy
I measure a good day by how little I fell behind
Help make Alzheimer's Disease a distant memory: http://www.bitly.com/LaytonCenter

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

Re: Session Manager [v5.73]

Post by FluxTorpedoe » 28 Sep 2018 00:03

@Ken
> all my sessions are saved with layouts.
Wow… Cool!!! :biggrin:
Ok, so now I understand better (but have no idea, I’ll make some further tests with layout sessions only). Maybe it was just a :ghost:

@GUIguy
Renaming is a good move and seems OK!
So the only culprit left is the file "SessionManager.xys" that you’re using, which is still the old version.
Hum, maybe the old version with the default name is still in your download folder, and the new one gets suffixed automatically with (1) or (2), etc.
Try deleting the file "SessionManager.xys" in your download folder, and download the new file again —and let us know if it works. :)

———————————————————————————

Reseting and Updating

• The basic purpose of a session is to remember the location of each tab in each pane (to keep things simple).
   So when a session is opened, it will restore all the same tabs, at the same place, with their location, etc.

• When you work, you usually change the location of several tabs, you may close some tabs, open new ones, etc.
At some point, if you want to get things "clean" again as they were before, you will Reset your session, which will get it back exactly as it were. (Note: it is the same as opening the same session again, which actually triggers a Reset —it’s just faster to click Reset… Or even better: Alt + Click on Session Manager button.)

• On the other hand, if you already have saved a session, it might come a time when you want to adjust it because you realize it’s not exactly the way you’d want it anymore.
For this you would open the session, adjust it the way you like, and Update it, which will save the new version of your session under the same name.

I hope it’s a bit more clear, don’t hesitate if not or if you have more questions.

GUIguy
Posts: 53
Joined: 03 Jan 2016 02:11
Location: Oregon, USA Win Pro 7-64 & 10-64
Contact:

Re: Session Manager [v5.73]

Post by GUIguy » 28 Sep 2018 03:23

Hey Flux...

Thanks for the clarification on update and reset. VERY helpful... :appl:

I opened the sessionmanager.xys in my scripts folder and it's indeed the latest version...
/* version 5.73 - 2018-09-25 */
/* initial 0.# ~ 2012-01-01 */
I've closed and restarted XY and even rebooted, but to no avail. Any other ideas?
GUIguy
I measure a good day by how little I fell behind
Help make Alzheimer's Disease a distant memory: http://www.bitly.com/LaytonCenter

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

Re: Session Manager [v5.73]

Post by FluxTorpedoe » 28 Sep 2018 10:50

Hmmm, so you’d have the correct file but it’s not loaded… Your button may reference the wrong file?
Let’s try each of the following steps and tell me which works and which doesn’t.

➊ On Session Manager button
Ctrl + Right-Click > Edit…
On the third input line, after "On left click:", check that there is (and replace with this if not)
load "SessionManager.xys";
Click on "OK", then on Session Manager button to see if it’s the right 5.73 version with Update then Reset.

—————————

Type <xyscripts> in the Address Bar (AB) and press Enter.
You should now be in XYplorer’s correct scripts folder.

➋ Click once on "SessionManager.xys" to select it.
In the AB, type the following and press Enter:
::load <curitem>;

The main menu of Session Manager 5.73 should open beneath the mouse cursor.

—————————

➌ In the AB, type the following and press Enter:
::load "SessionManager.xys";

The main menu should also open, etc.

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

Re: Session Manager [v5.73]

Post by klownboy » 28 Sep 2018 15:12

FluxTorpedoe wrote:> all my sessions are saved with layouts.
Wow… Cool!!!
Hi Flux, yes, I've been saving the layouts with the sessions. While on the topic of layouts...There are a couple of cases where I have essentially the same layout for a couple of sessions, but they are different from my Normal layout (which is essentially what I have as a default as well). One thing I had thought about recently is layout management for SessionManager. What if it would be possible to save a layout (e.g., a layout with sized dual panes and a preview window) and be able to utilize that same layout in some way for a 2 or 3 different sessions without the necessity for duplicating all that data in the ini file. You could have a second layout saved (e.g., dual pane one narrow pane in a list view on the left side and the other pane in thumbnail view) which could be used for another couple of sessions.

Does that make any sense? So a named layout would be saved in the ini file by name and that layout used by multiple sessions by referring to the named layout. You're already saving the layouts now separately in the ini file. In cases like I'm describing, the same layout could be used by multiple sessions without all the duplication by having the session section simply refer to the layout section without the need of having layout section for each session that has layout in the ini file. Along with that, possibly the script could recognize when you are changing from one session to another session which uses the same layout, the script wouldn't have to actually change the layout only the other attributes like tabs and folder locations etc. It might potentially speed thing up a little in those situations. Just a thought - maybe it's not worth the trouble. Thanks.

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

Re: Session Manager [v5.73]

Post by autocart » 28 Sep 2018 17:21

Hi,

As far as I saw, a session is "limited" to one instance / window of XY.
This is ok.
However, if I may file a wish: It would be nice, if Session Manager could also handle multiple open sessions / instances / XY windows.
Thus it would be even faster and more comfy to switch between them in the "usual" windows-way (Alt-Tab).
But on the other hand, I guess, this might be too much hassle and code-mess-around for such a little benefit.
customInlineRenameKeys ("OldStyle", "Mouse++" and "Ultimate"), clipboardHelper_and_XYEscToList

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

Re: Session Manager [v5.73]

Post by FluxTorpedoe » 29 Sep 2018 17:20

autocart wrote:It would be nice, if Session Manager could also handle multiple open sessions / instances / XY windows.
Well, it already works! (But don’t hesitate to tell me if you find something odd.)

I never mentioned it but Session Manager doesn’t work in the background. So,
 ☛ Session Manager can be used in several opened XYplorer windows, as many as you like, each one with the same or a different session (then you can Alt+Tab between sessions indeed).

Note: The only thing to know, quite logical, is that if you have several XYplorer with the same session with •• Autosave ••, it’s the last one of these that you close (or switch to another session) that will be autosaved (i.e. will overwrite the previous autosaves). Same for the layout you use with regular sessions. E.g. if you’ve displayed in single pane the last regular session you close, the next regular session you’ll open will be in single pane.

• You can even have different shortcuts to open XYplorer with specific sessions (just use 'single quotes' instead of "double quotes" when typing windows shortcut target). E.g.
— Launch XYplorer with the session Photos:
"YOURPATHTOXYPLORER\XYplorer.exe" /new /script="::global $DYN_InpSess = 'Photos'; load 'SessionManager.xys', '_Load';"
— Launch XYplorer with the session Work:
"YOURPATHTOXYPLORER\XYplorer.exe" /new /script="::global $DYN_InpSess = 'Work'; load 'SessionManager.xys', '_Load';"

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

Re: Session Manager [v5.73]

Post by FluxTorpedoe » 29 Sep 2018 18:12

klownboy wrote:a named layout would be saved in the ini file by name and that layout used by multiple sessions by referring to the named layout.
   Interesting idea! For the discussion, let’s call it Collective Layouts, that would be associated with sessions.
   But… I dwelt a bit on it, and I only saw one Pro for several Cons, unfortunately.

   So, to start with the Pro: the layout of several sessions could be updated at once if they shared a collective layout.
   Which can be interesting if e.g. you want to have a pixel perfect width of the preview, or tree, etc. And that’s pretty much it… (But wait, a solution may come!)

   Regarding the performance: when you enter a layout session, the new desired layout has to be compared against the current layout (even if we’d know that the two sessions have the same layout), simply because you might have changed the layout of the current session since the moment you opened it. Also, note that the new "full layout" is not loaded, only things that are different.
   So with a collective layout, there would be less entries in the INI file indeed (~1KB per layout…), but there would be absolutely no change in performance.
   Which is not a Con per se, ok. But the problem is that these sessions and the collective layouts would need different management and entries (update with or without the collective layout, saving/updating the CL independently, converting session with CL to session with standard layout, management of deletion, etc.)

   Now, as mentioned above, I understand it might be interesting at least to be able to "share" layouts more easily. Which can be done using the Default Layout (after it’s been backed up with a session), but it’s cumbersome… So, it’s not exactly the same as collective layouts, but what if I just added an "Alternate Layout" to the layout menu?

———————————————————————————

@all
•• (maybe) Upcoming Feature ••

 ☛ Alternate Layout: a secondary independent layout.
   Technically, it would just be two entries below the Default Layout and Toolbar entries: "Save/Update Alternate Layout" and "Load Alternate Layout", so no performance hit whatsoever.
   You could use it to easily share layouts between sessions; and/or simply to have a custom made layout that you’d want to use regularly, but not enough to associate it with sessions. So e.g. you would keep your Default Layout as your normal fall-back layout (e.g. restored XY in Dual Pane), and the Alternate Layout as an extra (e.g. maximized XY in single pane…).
   And, of course, the "Load Alternate Layout" would be accessible externally (keyboard shortcuts, catalog, etc.) 8)

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

Re: Session Manager [v5.73]

Post by klownboy » 29 Sep 2018 20:40

FluxTorpedoe wrote:Regarding the performance: when you enter a layout session, the new desired layout has to be compared against the current layout
Hi Flux, I think you hit the nail on the head with that statement for many or at least some users. For me though, I'm the type that will perfect and set a session with layout, save/update it, and use that session and other sessions with layout without changing them at all or very infrequently. If I do make a change that I like, It's immediately saved by "Updating the Session (with layout)". I say this because you can see why, if I was moving between already saved sessions (with layouts), there might be some logic and performance gain if the same layout is detected when changing from one session to another. So what I was suggesting only really makes sense if you could blindly go to another session (with layout) without having to load a new layout.

To be honest, I wasn't considering the user who is in some unsaved session/layout or has been messing with layouts without saving them. Therefore I was not taking into account the "current" layout being different from the session / layout that he originally entered. I assume then, if a user starts an already saved session (with layout) from the menu, that layout immediately becomes the current, but as you pointed out you would still have to compare layouts which seems like a waste of time.

I can see how having an Alternate Layout saved may help with the building of new sessions or simply using it as a true alternate layout for a session(s). Thanks again Flux for considering.

GUIguy
Posts: 53
Joined: 03 Jan 2016 02:11
Location: Oregon, USA Win Pro 7-64 & 10-64
Contact:

Re: Session Manager [v5.73]

Post by GUIguy » 29 Sep 2018 23:34

FluxTorpedoe wrote:Hmmm, so you’d have the correct file but it’s not loaded… Your button may reference the wrong file?
Let’s try each of the following steps and tell me which works and which doesn’t.
SOLVED! Pilot error. :oops:

I had an older set of folders for AppData from an earlier installation of Windows 10. I had placed the new version of SM there, so it was not working since XY was not looking there. Thanks to this troubleshooting, I've cleaned up the mess.

Humble apologies for the wasted bandwidth and CPU (cerebral processing unit) cycles...
GUIguy
I measure a good day by how little I fell behind
Help make Alzheimer's Disease a distant memory: http://www.bitly.com/LaytonCenter

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

Re: Session Manager [v5.73]

Post by FluxTorpedoe » 06 Oct 2018 17:08

@Ken
Ok, I understand better the way you work with sessions. Out of curiosity, I timed the difference between switching sessions with different content but similar layout, and switching the same sessions without checking the layout, and it’s only around 50 ms faster (on my system) which, compared to the time it took to refresh the content (cached thumbs), was utterly negligible. So not worth the trouble to risk bloating the code…
Well, the Alternate Layout should facilitate your workflow (at least on the management side)! BTW, like all main functions of Session Manager, it can be run externally from a script, button, keyboard shortcut, etc.
I also implemented a way to switch between Default Layout and Alternate Layout —not visible in interface, only available as external command (see Cheat Sheet).

And interestingly, the speed tests led me to try and optimize even more the code to display Session Manager main menu… and it was worth it: when clicking on Session Manager button, the menu of the new version 5.80 loads 25% faster than that of v5.73 (on my machine, less than 200 ms against ~ 250 ms)! And in this case the ~ 50 ms difference can indeed be felt…  8)

@GUIguy
Glad to know it works. No worries, happy I could help. :)

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

Re: Session Manager [v5.80]

Post by FluxTorpedoe » 06 Oct 2018 17:57

 
###########################
###  Session Manager v5.80  ###
###########################



Hi everyone,
Here’s a new version, with an extra and even more fine tuning.
One remorse-regression though: I switched back Reset and Update as they were before, with Reset being the first entry —in the end, practicality won back over abstract logic… My apologies for this. But there’s a speed gain, though unrelated, to make up for it!

BTW, (since v5.73) Session Manager’s code has now reached over 3 000 lines… :mrgreen:

Have a nice day! 8)
Flux

———————————————————————————

• HIGHLIGHTS:
++ Layouts - Alternate layout available (independent of sessions) — Read more at bottom of this post
   And easily switch between Default and Alternate layouts via keyboard shortcut... (cf Options > Help: Cheat Sheet)
++ Noticeably optimized code to display main menu ~ 25% faster (by delaying Cheat Sheet language computation!)
* Menu - Main menu order: reverted to Reset before Update
And there’s more! See just below…

• CHANGELOG:
Don’t hesitate to browse the exhaustive changelog (with download links to previous versions) here: • Session Manager Changelog •

———————————————————————————

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

• UPDATE » for all users:
 — Overwrite your existing "SessionManager.xys" file with latest version
 — Recommended (if updating from < 5.73): Update your layout sessions and default layout (and default toolbar if applicable)
   ☛ Session Manager > "Layout tools" > "Update Default Layout" / "Update Default Toolbar"
   ☛ For each layout session > "Update Session (and Layout)"

• UPDATE » for non-english users:
 — Also download one of the language files and extract it into the same folder as SessionManager.xys (language detection is automatic)
Note (if applicable): "Temporary" and "Autosave" sessions might appear as regular sessions after update, depending on how this strings are translated. Just save again the affected session(s) and delete the obsolete one(s).

———————————————————————————

• DOWNLOADS:   Require XYplorer ≥ 17.50.0211 (previous versions available in Changelog)

› Script:
SessionManager.xys
(160.53 KiB) Downloaded 82 times
› Script in UTF-16 LE: (Special version for foreign languages who encounter "invalid character" issues)
SessionManager-UTF16.zip.zip
(38.07 KiB) Downloaded 26 times
› Languages:
Don’t forget to come back here to check when language files are updated…
Note: All the following files work with Session Manager latest version (non-updated files will just be displayed with a few lines in english).
 — Čeština by Hogatyv5.80
 — Dansk by Regmosv5.80
 — Italiano by Flora_RMCv5.80
 — Português (Brasil) by SkyFrontierv5.2
 — Français by pseudozv4.b1
   

———————————————————————————

• TRANSLATORS:
 — New contributions are more than welcome!
 — please head to the dedicated post on the ML forum for the changelog and latest english language file
Last edited by FluxTorpedoe on 12 Oct 2018 14:19, edited 3 times in total.

Post Reply