Opened 4 years ago

Closed 4 years ago

#11977 closed enhancement (fixed)

Cause SoundRecorder to remember last-saved location (easy)

Reported by: dsuden Owned by: waddlesplash
Priority: low Milestone: Unscheduled
Component: Applications/SoundRecorder Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All


This is probably a pretty small feature addition, but it'd would be a big help!

Right now, SoundRecorder repeatedly defaults to /home as its Save-as location, and doesn't store or remember the previously used Save-as location. So that requires the user to have to browse to the desired location over and over (or drill down through folders in Tracker, and drag the newly-recorded item to the desired destination). If SoundRecorder could just remember the user's last Save-as location, it'd be a huge time-saver to people who use the program regularly.

Attachments (2)

screenshot2.png (119.8 KB) - added by dsuden 4 years ago.
(shows the problem)
0001-SoundRecorder-Remember-last-save-directory-used.patch (766 bytes) - added by Barrett 4 years ago.

Download all attachments as: .zip

Change History (20)

Changed 4 years ago by dsuden

Attachment: screenshot2.png added

(shows the problem)

comment:1 Changed 4 years ago by pulkomandy

Summary: Cause SoundRecorder to remember last-saved locationCause SoundRecorder to remember last-saved location (easy)

comment:2 Changed 4 years ago by anevilyak

Component: - GeneralApplications/SoundRecorder
Owner: changed from nobody to korli

comment:3 Changed 4 years ago by waddlesplash

Owner: changed from korli to waddlesplash
Priority: normallow
Status: newassigned

That patch looks OK, however it doesn't save the setting across launches -- unless I'm misreading something...

comment:4 Changed 4 years ago by Barrett

I don't think the setting should be saved across sessions, this isn't the usual behaviour.

comment:5 Changed 4 years ago by anevilyak

For the latter behavior, it'd probably make more sense to add a pref option to set a default starting location if desired.

comment:6 Changed 4 years ago by pulkomandy

Since the file panel is reused, it would be simpler to set its directory directly when a file is saved, instead of storing that in a separate variable. But I think BFilePanel should already be doing that itself?

comment:7 Changed 4 years ago by Barrett

Looking it seems that the best way is to set it directly in the panel, i can't see side effects. But i'm not sure it should be done automatically by the panel as it may interfere with other behavior unless it's specified in the bebook (but i can't find it).

comment:8 Changed 4 years ago by Barrett

Has a Patch: set

comment:9 Changed 4 years ago by Janus

There are other applications with persistent save location: Screenshot, ShowImage (#6766), Wonderbrush...

Last edited 4 years ago by Janus (previous) (diff)

comment:10 Changed 4 years ago by pulkomandy

The Be Book overview of BFilePanel says this:

Delete the BFilePanel object…or don't. When the user closes a file panel, the object is not automatically deleted; you have to do it yourself. But you may not want to. If you don't delete the panel, you can simply call Show() the next time you want to display it; the state from the previous invocation (the panel's size and location, the directory it points to) is remembered.

So "the directory it points to is remembered". I'm not sure if this means the initially set directory, or the directory the user last navigated to, but I think the latter makes more sense.

comment:11 Changed 4 years ago by Barrett

I have looked at it, and just not found anything that explain why it's not working in SoundRecorder. You are right the directory is remembered usually.

comment:12 Changed 4 years ago by dsuden

Barrett, any further luck on this? I'd sure love to find a solution! Specifically, that SoundRecorder will remember the last-saved-to directory, and default to there until a different saved-to directory is chosen by the user.

Last edited 4 years ago by dsuden (previous) (diff)

comment:13 Changed 4 years ago by Barrett

Apparently, it's right that the FilePanel should do it automatically. There's something in the SoundRecorder code which is forbidding it. I've been a bit lazy on this issue, and since i have a WIP rewrite/refactor of this app, i thought i could postpone it. But if you want to fix this, please do it :-)

Last edited 4 years ago by Barrett (previous) (diff)

comment:14 Changed 4 years ago by ttcoder

I ought to give dsuden feedback on this as well, since I blindly encouraged him to "ping" this ticket some time back... The problem is not what everybody expected, indeed.. This should be turned from "enhancement" to "bug", and the "easy" tag removed possibly too..

Reviewed the code in RecorderWindow.cpp and indeed it does everything as it should to remember its state! Same I do in my apps, same as StyledEdit does and others. Yet (just tried to be sure) StyledEdit does remember the last state of the file panel, but SR does not. The only 'extras' that SR calls between panel invokations are SetMessage and SetSaveText, neither of which change the working directory. Weird.

Is the working directory the only thing that is "forgotten", or does the panel also forget its size and position, if you change it between invokations?

Anyway seems this is definitely a bug hunt, not an enhancement. Somebody will need to do the dirty work of tracing/debugging *g*

(edit: would tag myself to this ticket, but was broken last year by #11738 so I'll have to send myself an old fashioned self-adressed email or do another trick to remember to work on this *g*)

(edit2: should look into the below, SkipButtonKeypressFilter::Filter() seems to cast a wide net indeed; though it is AddCommonFilter()ed to the main window, not to the BFilePanel à priori)

Last edited 4 years ago by ttcoder (previous) (diff)

comment:15 Changed 4 years ago by Barrett

I looked fastly at the code. I am not 100% sure however, but I think i have found the problem. TransportButton is filtering keys with a BMessageFilter but also BFilePanel is using a similar technique. In particular the B_KEY_DOWN_MESSAGE looks like the source of problems, look in kits/tracker/FilePanelPriv.cpp and TransportButton.cpp of SoundRecorder.

comment:16 Changed 4 years ago by Barrett

I just tried to disable the filter, but at next build i realized that it seems to work OK now. When i save a clip, the next time the panel open at the correct directory.

Except you meant that it should remember the location also the next time you open the app, but as said before i don't think dsduden meant that.

comment:17 Changed 4 years ago by ttcoder

Well duh, it works indeed! :-b Maybe it was fixed somewhat by the recent merge of the "tracker layout" branch or something

Dane, do you want to try with a recent hrev? Just tried 3 different use-cases here, and in all cases the file panel remembers its latest directory.

comment:18 Changed 4 years ago by pulkomandy

Resolution: fixed
Status: assignedclosed

Closing for now, then. Reopen if you find a way to trigger this again.

Note: See TracTickets for help on using tickets.