Auto save session periodically

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Auto save session periodically

Post by *HAL 9000 »

Hello.

I've got a feature request. The current situation with TC is that you cannot foresee a crash, but once it happens - you have to use old session, as the latest one will be lost.
I have an idea with a good solution of this problem:
Add an automatic save of session periodically.

Periods should be also configurable (how often do a session store?) and they maybe "clever" (i.e. store the session only if there are difference with old one and don't store sessions more often then once in 5 sec).

The automatism of this feature should be made with a checkbox, so the ones who doesn't need it - they can turn it off.

If you won't add this feature as an automated process, then you could at least set command-line keys for all kinds of settings that are being saved when a session save is initialized and tell us what are they, so we could manually initiate a session store process by creating buttons, and we need specifics then: what is a command that should be run and what are the command-line keys for each of 4* different types of settings.

* these 4 types are: directories, panels, old command lines and directory history.
And they are listed here: Configuration > Options > Operation > Save on exit.

Example of the code of such a button:
cm_ConfigSaveSettings /dir /pan /dirHistory - this is meant to save directory, it's history and the panels.

But it would be way better if you'd add it as a periodic and automatic function.
Last edited by HAL 9000 on 2010-01-26, 21:30 UTC, edited 1 time in total.
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

There are many utilities capable of working with windows and their handles, and having scheduling capabilities. I would use PowerPro in this case.
1. Detect the TC handle (that of window with the TTOTAL_CMD class);
2. Create an event (event.dll plugin) that operates every N seconds;
3. Each time it sends the cm_ConfigSaveSettings (580) command to the window with known handle.

If there is a need, I can easily write a PowerPro script.
Single user license #329241
PowerPro scripts for Total Commander
HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

This feature should be a part of the program, it's good that you can emulate it using some scripts, but this is not a good solution.

2 Vochomurka
Вот нахера ты предлагаешь такие костыли?Благодаря тебе этот реквест теперь наверняка проигнорируют.
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

It was really one of my goals to NOT support this proposal (Я того и добивался ;) )
Single user license #329241
PowerPro scripts for Total Commander
HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

Well, you didn't argument your point. You just said that you know how to get this feature using incorrect method.
I want developer to comment this feature request.
All other commentaries with arguments pro/cons would be also appreciated.

+ I'd like to say that
1. cm_ConfigSaveSettings is slow
2. There is no simple way to detect state changing => stupid fixed delay between saves => too slow
3. Realization of this feature in the way you suggested means that my portable TC wouldn't not be portable anymore:
a). it'd require additional software (file weight increases)
b). I'm not sure there is a portable version of this scripting software
c). + load time, cause it'd require two programs to be run, not just one.
4. What would happen with your script if I decide to run 2 TC windows?
5. There is a global rule: more soft = more bugs. Why not just add a really small, but useful feature to the good software, that really lacks it?
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3862
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

2HAL 9000: Your are pointing out the problems of autosave yourself:
3. Realization of this feature in the way you suggested means that my portable TC wouldn't not be portable anymore:
Yes, periodically autosave will kill your USB-Stick after a short while.
4. What would happen with your script if I decide to run 2 TC windows?
Well, which configuration should be autosaved (both windows are using the same ini file ...) ?
#5767 Personal license
HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

sqa_wizard wrote:Yes, periodically autosave will kill your USB-Stick after a short while.
That's why I also requested a checkbox to turn off this feature, but I need it turned on when I'm using it on a PC.
sqa_wizard wrote:Well, which configuration should be autosaved (both windows are using the same ini file ...) ?
Both should be autosaved, but I meant that I'm not sure, that a script can do the same.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

HAL 9000 wrote:Both should be autosaved, but I meant that I'm not sure, that a script can do the same.
It is quite easy to write algo that will periodically enum existing TC windows and pass them cm_ConfigSaveSettings command, so it's not a problem at all (if you don't like scripts I can make separate 3-KB .exe that will do this with passed delay). But USB stick trouble is important, and here simple algo won't work good. BTW if you use TC from stick, it is better to redirect temporary parameters like history, tabs etc to some INI in temporary folder. Although, I think cm_ConfigSaveSettings will overwrite wincmd.ini also, so this will kill stick anyway, but you may try to make it read-only so cm_ConfigSaveSettings won't corrupt your stick.
HAL 9000 wrote:1. cm_ConfigSaveSettings is slow
Why? And why do you think that TC will save same settings much faster with new command?
HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

MVV wrote:
HAL 9000 wrote:1. cm_ConfigSaveSettings is slow
Why? And why do you think that TC will save same settings much faster with new command?
The part of my request was to add different cmd-keys for each type of the settings, so I could specify only the ones that I need most and that will fasten the process.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

HAL 9000 wrote:The part of my request was to add different cmd-keys for each type of the settings, so I could specify only the ones that I need most and that will fasten the process.
I understand your wish but it won't speed saving process up significantly.
HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

it's a pity that the Author ignores such feature requests.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3862
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

it's a pity that the Author ignores such feature requests.
AFAIK no request is ignored, but there are thousands of other requests on the wishlist that are requested over the years by a lot of users.
#5767 Personal license
HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

sqa_wizard wrote:AFAIK no request is ignored
It's just your guess. I didn't get a respond from him. For the second time (the previous topic was about adding scrolling to tab bar).
sqa_wizard wrote:but there are thousands of other requests on the wishlist that are requested over the years by a lot of users.
You mean thousands of requests were also ignored?
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

HAL 9000,
You mean thousands of requests were also ignored?
Thousands of request are on the wishlist, but Christian only has two hands and there are only 24 hours in a day.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
HAL 9000
Senior Member
Senior Member
Posts: 384
Joined: 2007-09-10, 13:05 UTC

Post by *HAL 9000 »

up
Locked