build 1457 - state persistence

Alpha/Beta versions for early access to new half-cooked features
User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

build 1457 - state persistence

Post by mike » Wed Jan 20, 2016 7:34 am

Greetings,

It was frequently-asked to have an ability to save and load tabs/windows et cetera.
So I worked on that area and here're results in new build:
- opened windows and tabs within them are stored and restored upon restarting/window creating.
* actually two different mechanics were used there - OSX's Resume (introduced in Lion) and hand-made one for last opened window restoration.
* what is saved and restored per panel:
- vfs and path within it, including network connections, archives, xattr or whatever.
- sorting options (excluding quick search filtering)
- view mode
* a lot of state details are not restored currently, like selected tab No, selected filename within panel, left/right pane proportions and so on. Perhaps I'll add handling of this info in some time, but not sure if it worth efforts.
- most of app state moved into json file in ~/Library/Application Support/Files/State/
- network connections are now stored in ~/Library/Application Support/Files/Config/NetworkConnections.json, editable on-the-fly like Config.json
- fixed an issue with batch rename: http://filesmanager.info/forum/viewtopic.php?f=5&t=65
- fixed an issue with extension-based sorting: http://filesmanager.info/forum/viewtopic.php?f=5&t=67
- added more font sizes for modern presentation

The build itself: http://filesmanager.info/downloads/prev ... (1457).zip

Mike.

User avatar
darek
Posts: 179
Joined: Thu Jul 16, 2015 4:50 pm
Location: Warsaw, Poland
Contact:

Re: build 1457 - state persistence

Post by darek » Wed Jan 20, 2016 9:50 am

Mike,

State saving doesn't work for me on build 1457 (that's what the about window says, double checked). I open tabs on left and right, CMD+Q, start again and both panels have single tabs set to my home dir.

Also, you've said "~/Library/Application State/Files/State/" but there's no such dir. Did you mean "~/Library/Application Support/Files/State/"? It's probably a typo, but I'm mentioning, just in case it's a source for this issue.

And thanks for the batch rename and sorting fix - checked both and they work well :) Cheers!

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: build 1457 - state persistence

Post by mike » Wed Jan 20, 2016 10:12 am

Darek, yep, surely it was a typo - all config/state is stored in .../Applications Support/Files/...

Can you please check the following file: ~/Library/Application Support/Files/State/State.json after opening some tabs and closing the window with X button (not the whole app with cmd+Q)?
Resume feature (which saves windows info and which is used between app runs) stores that info in user defaults, while last opened window info is written in State.json.

User avatar
darek
Posts: 179
Joined: Thu Jul 16, 2015 4:50 pm
Location: Warsaw, Poland
Contact:

Re: build 1457 - state persistence

Post by darek » Wed Jan 20, 2016 10:19 am

Ah, yeah.
* When I close the window first and then CMD+Q then it works. State.json is created and state is saved/restored.
* When I do CMD+Q directly, state is not saved.

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: build 1457 - state persistence

Post by mike » Wed Jan 20, 2016 10:26 am

Ok, need to investigate Resume behaviour, I just got the same on a second machine with OSX10.10.
BTW, which OSX do you use?

EDIT: was not precise, Resume information is stored not in Defaults, but in ~/Library/Saved Application State/...

User avatar
darek
Posts: 179
Joined: Thu Jul 16, 2015 4:50 pm
Location: Warsaw, Poland
Contact:

Re: build 1457 - state persistence

Post by darek » Wed Jan 20, 2016 10:28 am

10.11.2, like a boss! ;)

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: build 1457 - state persistence

Post by mike » Wed Jan 20, 2016 10:50 am

Well, that's quite weird.
On my second machine I clearly can see created /Users/???/Library/Saved Application State/info.filesmanager.Files.savedState/.. files, which contains an encoded app state, and after quitting Files... it disappears.
Seems that OSX thinks that this state should not be stored for some reason.

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: build 1457 - state persistence

Post by mike » Wed Jan 20, 2016 11:47 am

Ahhaha, made my day!
That's the most hard to solve kind of bugs - a bug which is not:)
An option in System Preferences > General > "Close windows when quitting an app" should be obviously OFF, and it seem to be ON by default (?).
So everything works as expected.

User avatar
darek
Posts: 179
Joined: Thu Jul 16, 2015 4:50 pm
Location: Warsaw, Poland
Contact:

Re: build 1457 - state persistence

Post by darek » Wed Jan 20, 2016 12:00 pm

Well, well :) Looks like I had this enabled too, but I don't remember changing it myself. And it's disabled on my other machine. So perhaps some bug after one of the system updates? Hard to say. Anyway, once I switched it off, Files work as expected. All is good now! :)

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: build 1457 - state persistence

Post by mike » Wed Jan 20, 2016 12:04 pm

This options confuses a lot of people actually: http://stackoverflow.com/questions/2119 ... -app-termi.
Such a bad move by Apple...

Post Reply