Page 30 of 31

Re: Session Manager [v6.60]

Posted: 04 Jun 2020 11:48
by FluxTorpedoe
 
######################
###  Session Manager v6.60  ###
######################



Hi everyone,

Here’s a new version. Some of its highlights:
 — Options > AutoUpdate All: every session can now be updated automatically on session change
      Note: To discard any changes made to the current session, just Reset it before loading a new one
      Note: This option cannot be used simultaneously with AutoUpdate Single (previously "Enable Autosave […]" which autosaves a temporary version of a specific session)
 — Performance improvements
 — A few fixes

See changelog below for more info.

Have a nice day! 8)
   Flux

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

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

› Script:
SessionManager.xys
(182.14 KiB) Downloaded 95 times
› Script in UTF-16 LE: (Special version for foreign languages who encounter "invalid character" issues)
SessionManager-UTF16.zip
(44.39 KiB) Downloaded 36 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 (untranslated strings will just be displayed in English).
 — Čeština by Hogatyv6.50
 — Dansk by Regmosv6.50
 — Italiano by Flora_RMCv6.60
 — Deutsche by Dean36v6.60
 
 — Português (Brasil) by SkyFrontier – v5.2
 — Français by pseudoz – v4.b1

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

• REQUIREMENTS:
 — XYplorer >= 19.90.0106

• 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)

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

• CHANGELOG – v6.60:
+++ Options > AutoUpdate All: every session can now be updated automatically on session change
      Note: To discard any changes made to the current session, just Reset it before loading a new one
      Note: Using this option disables the ability to Autosave temporary version of specific session
+ Performance improvements (even more noticeable when clicking on toolbar button)
* Options > AutoUpdate Single: Previously Enable Autosave/Reset of Temporary Version of session
      This option now uses an ON/OFF checkbox, and disabling it now opens a confirmation dialog
      Note: Using this option disables the ability to AutoUpdate all sessions
* Options > Save Temporary Session is now disabled if no session exists
! Toolbar icon was changed (then not reset) when saving Temporary Session if no other icon used
! Leading spaces now always removed when saving new session (even with layout)

v6.51 — 2019-10-08 (internal)
! Changing icon of current session would not refresh toolbar button

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

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

• 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

Re: Session Manager [v6.60]

Posted: 04 Jun 2020 20:27
by Filehero
Wow, the performance improvements are :shock:

:appl: :appl:

As always: Great job - best script for (my) daily usage.

Flux rules. :D

Re: Session Manager [v6.60]

Posted: 05 Jun 2020 16:10
by klownboy
Filehero wrote:
04 Jun 2020 20:27
As always: Great job - best script for (my) daily usage.
I second that motion. I had already made the SC listfolder changes you provided earlier so my times hadn't changed much. I un-commented the speed check again with the new version (6.60) and have start-ups running on average of 94 ms for either UDC or CTB which is obviously pretty fast. Thanks Flux. :tup: :appl:

Re: Session Manager [v6.60]

Posted: 12 Jun 2020 00:09
by autocart
Hi all,
Hi Flux,

I have an idea for a simple new feature:

Session name in window title bar.

Two steps:

Step 1)
I added the line goto "@SMSessionTitle=" . $DYN_InpSess; in this context:

Code: Select all

// ------------------------------------------------------------------------>>>   Loading

    goto "@SMSessionTitle=" . $DYN_InpSess;

    end ($DYN_InpSess == "");
Two thoughts about the placement in the code. It should be placed before the new session is loaded, because otherwise the titlebar will not be updated afterwards anymore. However, it should be placed after all auto-saving-stuff because otherwise it somehow still updates early and potentially causes a delay between the titlebar showing the new session name and the new session not getting loaded yet.

Step 2)
I added the variable <get alias SMSessionTitle> to the titlebar template in Configuration / Templates / Titlebar - at the place in the titlebar template whereever one wants it to be placed.

Works like a charm.
Flux, could you check, whether I overlooked a potential problem, please.
If you want to officially add it, of course, it will be a bit more complicated. If not, it is ok. It so simple that it can be done manually by each user. And the titlebar template will have to be updated manually by the user, anyway.

Regards, ac

Re: Session Manager [v6.60]

Posted: 17 Jun 2020 12:40
by autocart
Regarding my idea from the previous post:
I now realized that the XY's window titlebar does not get updated when just saving a session under a different name...
Maybe there are also other scenarios where this is not the case.
Wondering about a solution... so far, a manual change of the current session is required.

Re: Session Manager [v6.60]

Posted: 17 Jun 2020 22:22
by FluxTorpedoe
@all
Thanks a lot for the feedback! :D

@autocart
Current session name in the titlebar: I like the idea!
So much that I already coded the option (so no manual tweaking will be necessary). Enabling it will add the session name at the start of the existing title template —I find this especially useful because it’s now what appears in Windows taskbar! (Even more valuable for those who use several XYplorer windows).

That being said, I also overlooked the problem you just mentioned: the titlebar isn’t updated when saving —or renaming— a session.

• Regarding the use of an alias: I had spent some time trying to use a permanent variable, because I was reluctant to use aliases for this purpose, but you had found a neat trick with that one! It seems that no other custom variable type can be read by the titlebar template. And Don obviously has other things on his (tem-)plate… :lol:

• Now, back to the titlebar and/or alias problem:
— XYplorer updates and recognizes new aliases correctly, e.g.
   ::goto "@SM_SessionTitle=".<date>; text get("alias", "SM_SessionTitle");
   outputs the correct date
— but this info is not "dispatched" internally, at least not to the titlebar, e.g. with <get alias SM_SessionTitle> in its template
— that is, unless the active tab changes: browsing to a different location, opening a new tab —in a different location—(or closing it), activating the other pane…

It tried pretty much everything I could think of, and all the solutions I found are too invasive/intrusive to my taste.
Right now the fastest I found (yet ugly) is the pane switching: #802;#802;

:?: So the question remains:
— What is the best way to force the titlebar to use an updated alias?
   (or even better but less probable: Is there a way to use another type of assignable variable in the titlebar template?)

Re: Session Manager [v6.60]

Posted: 17 Jun 2020 23:27
by autocart
I am glad that I could contribute. :kidding:

In Step 1 of my post above, I noted that placing the line goto "@SMSessionTitle=" . $DYN_InpSess; before the auto-saving stuff updates the titlebar before any tab/folder changing/loading happens - at least visually - so much so, that there would be delay between titlebar update and loading of the chosen session.

Question: Do you know what is updating the titlebar there? I did not bother to look into it because placing the line of code after the auto-saving stuff seemed the easier solution. But if there is something going on, which would update the titlebar before (i.e. without) changing/loading any tabs/folders, then this could maybe be used as a means to update the titlebar in a nice way?

Re: Session Manager [v6.60]

Posted: 17 Jun 2020 23:40
by autocart
P.S.: It seems that for some reason the sub "_Update"; does also update the window title bar nicely without folder/tab/pane change. I don't know why and also don't understand what the sub is supposed to be doing. But could you not use it for the titlebar as well, in cases like save as or rename?

Re: Session Manager [v6.60]

Posted: 18 Jun 2020 12:03
by FluxTorpedoe
In the case you mention, the titlebar was updated by the tabset() command.
I had tried this path before with all variants of tabset(*) but was reluctant because I didn’t want to had an extra burden…

But after digging a bit, I realized that both the Rename and the Save (obviously) already use the tabset()!
So I just placed the alias/titlebar update before and Voilà! 8)

I’ll let it rest a little to see if i find other bugs, but the titlebar feature seems to work nicely now —without any performance or visual penalty.

Re: Session Manager [v6.60]

Posted: 18 Jun 2020 13:58
by autocart
awesome, glad that we teamworked.
I also have it set up to display at the beginning of the titlebar text. am thinking that this is the best way.

It is such a big improvement for me to be able to quickly check/see which session I am in... am also happy you adopted it into the official code. The other users are having a treat coming their way, but I agree that it makes sense to wait a bit for potential (other) issues to be fixed/improved with the next release as well.

Question:
How do you update the titlebar template automatically?

Also:
You wrote that this function can be "enabled" (in the future version). I don't know how you have it set up, so maybe you thought of that already, but it would be nice if the code searched for the <get alias ...> string in the titlebar template first. This way, the user can also place it at a different location than at the beginning of the template without it being added twice.

Also, I am not sure what the best UX/UI is here but in case you are thinking like me - at first I was thinking about an on/off "switch" (or toogle-checkmark or similar) for enabling/disabling the function, ... on a second thought I am wondering what if the function is disabled and the user adds the alias string to the title bar manually (or vice versa). Does the script check the content of the titlebar (often) to see if it contains the alias string and adapts the status of the "switch" accordingly? Otherwise the "switch" in the scripts UI might indicate a wrong status.
So, maybe it might make more sense not to add an enable/disable "switch" to the UI but instead two separate functions: (1) Add alias string to titlebar template if it is not already part of the template. (2) Remove alias string from titlebar template if it is part of it.

But, again, maybe you thought of all of that already. I am just brainstorming. No harm meant.

Kind regards, ac

Re: Session Manager [v6.60]

Posted: 18 Jun 2020 15:48
by FluxTorpedoe
autocart wrote:
18 Jun 2020 13:58
awesome, glad that we teamworked.
Your input was very valuable indeed! :)

• How do you update the titlebar template automatically?
As mentioned before, the only way I’ve found is to change something to the tabs. My latest approach is just to let the existing tabset("save"…) do the work for me, by placing any alias update before them.

• You wrote that this function can be "enabled"
Indeed. There will be a new On/Off option named Options > General: Display Session Name in Titlebar…
(A confirmation dialog opens mentioning that the config will be saved and XYplorer restarted —it’s the only way to force XYplorer to acknowledge the changes made with setkey() to its config file.)
I had figured a single toggle was the best approach since, in general, the less entries, the better, and Session Manager has already a lot of them… ;-)

As mentioned, the session name will be added at the start of the titlebar, followed by a separator "   •   " (I found this to be the most readable). And since the probability that an existing <get alias … > followed by such a separator is close to zero, there’s no reason to check anything before enabling the option. And yes, disabling the option will only remove the "<get alias…>$separator" at the start.
So if anyone wants to tweak the separator, it will still work, and if anyone wants to manually place the title somewhere else, there’s no risk that enabling or disabling the option might "damage" the main title template.

Re: Session Manager [v6.60]

Posted: 18 Jun 2020 16:36
by autocart
FluxTorpedoe wrote:
18 Jun 2020 15:48
• How do you update the titlebar template automatically?
As mentioned before, the only way I’ve found is to change something to the tabs. My latest approach is just to let the existing tabset("save"…) do the work for me, by placing any alias update before them.
You misunderstood. I meant how to do you update the titlebar template (i.e. without opeing the config dialog). But your other reply answered that already.
FluxTorpedoe wrote:
18 Jun 2020 15:48
I had figured a single toggle was the best approach since, in general, the less entries, the better, and Session Manager has already a lot of them… ;-)
That makes sense. I also was afraid that 2 entries for one function could clutter the UI.
FluxTorpedoe wrote:
18 Jun 2020 15:48
And since the probability that an existing <get alias … > followed by such a separator is close to zero, there’s no reason to check anything before enabling the option. And yes, disabling the option will only remove the "<get alias…>$separator" at the start.
So if anyone wants to tweak the separator, it will still work, and if anyone wants to manually place the title somewhere else, there’s no risk that enabling or disabling the option might "damage" the main title template.
I see, well, here I do have slight doubts about the "close to zero" part. Because once the option is enabled and users know how the string must look like... it is easy to remember where the titlebar template in the config is and to forget about disabling the toggle in the script's setting. So, I know it will happen that the toggle will sometimes display a wrong status when people just delete it from the template. Also, once one is familiar with the string, it can be added manually without "enabling" the toggle. Besides, if it is moved to a different place in the template - even if it is not damaged there - the display of the session name in the titlebar can actually be "active" and the toggle off - again displaying a wrong status.

I'm just saying maybe it is better not to show a on/off "status" in the UI at all. To keep it to one entry, maybe it is best to just add a command which will add the alias string at the beginning of the template and to inform the user that it must be removed manually, if not desired anymore. But you should be happy with the solution and it is your work. I will now shut up about this thought. Thank you for implementing it at all. That is the best part!! :tup: :biggrin:

Re: Session Manager [v6.60]

Posted: 11 Jul 2020 12:00
by FluxTorpedoe
A quick update to inform you that Session Manager is now available in a brand new language, courtesy of Dean36 :appl: :

Willkommen bei Session Manager auf Deutsch! :party:

Language file can be downloaded here (or, as with any language file, via the main Session Manager v6.60 post).

Re: Session Manager [v6.60]

Posted: 24 Jul 2020 16:36
by FluxTorpedoe
Hi everyone,

A quick note to say that I’ll be offline for a couple+ of months, so I won’t be able to reply or publish the next update —but I definitely will when I’m back!

Have a nice summer or winter (depending on your hemisphere), 8)
and take care :masked:

Flux

Re: Session Manager [v6.60]

Posted: 24 Jul 2020 17:33
by admin
Hey Flux,

so the Torpedoe takes a dive. Have a good trip, take care, and see you back! :tup:

Don