On Sep 23, 2009, at 3:34 PM, Jack wrote:
On 2009.09.23 15:20, Peter Bloomfield wrote:On Sep 23, 2009, at 1:58 PM, Jack wrote:[snipped even more]Yes. Is it worth figuring out what the difference is either in actual behavior or in the cause, or is it probably too convoluted and not worth the effort?Terminal shows: bw_notebook_switch_page_cb from to file:///var/mail/jack balsa_window_real_close_mbnode from file:///var/mail/jack to NULL config_save saving CurrentMailboxURL = (null)which shows opening the inbox and then it seems something is forgetting the current mailbox before saving it when I exit (either with File/Quit or just closing the window).So the last two lines appear when you exit? Somehow the processes involved in exiting seem to be carried out in a different order on your box from mine.
:) I'll take a quick look, and if any obvious leads jump out I'll follow them. But time isn't unlimited...
A simple fix would be to remove the code that clears balsa_app.current_mailbox_url in balsa_window_real_close_mbnode, although that would mean a small change in behavior: on restart, Balsa would show the last mailbox used, even if the user had closed them all before exiting--but that could always be documented as a design decision!Wouldn't balsa_app.current_mailbox_url get cleared anyway when the user explicitly closes the last mailbox?
No--the main place where balsa_app.current_mailbox_url gets updated is when the user *switches* notebook tabs (= mailboxes). If a mailbox is closed when others are open, it results in a switch to one of them, so the change is noted. But when the last mailbox is closed, there's no switch, so balsa_app.current_mailbox_url stays pointing to that last mailbox. The code in balsa_window_real_close_mbnode was put in specifically to catch that event.
Can balsa tell whether it's trying to close the window due to explicit user action or program exit?
I'm not sure how reliably it can tell the difference :(
Anyway, that's probably a reasonable approach - and how often would someone close all mailboxes before exiting, but having "open inbox on startup" set so the inbox would be displayed anyway?
:)
Actually, in that case, would the last viewed mailbox also get opened? That might seem a bit stranger than simply not having Balsa ever start up without opening at least one mailbox.
I guess the philosophy should be that CurrentMailboxURL has an effect only when "remember open mailboxes" is set (or the -o | --open-mailbox= command line option is used). So no, if "open inbox on startup" is set but "remember open mailboxes" isn't, then only the inbox is opened (or should be--I haven't checked the patch to see if that's how it currently works!).
But your last point is a good one. If *neither* is set, should Balsa open anything, and if so, which? Inbox or last viewed? Currently (w/o the patch, that is), it's nothing.
Best, Peter
Attachment:
pgp4bUXkcnx4u.pgp
Description: PGP signature