GNOME Bugzilla – Bug 84220
Find mailbox by name
Last modified: 2009-08-15 18:40:50 UTC
See http://mail.gnome.org/archives/balsa-list/2002-June/msg00005.html and its followups. The following attachments are proposed patches for the HEAD and BALSA_2 cvs branches, respectively. They centalize Balsa's `find by ...' functions in src/balsa-app.c, and replace `find by name' with `find by url' where it was easy to do so. They also simplify the `most recently used' code by using the new search functions.
Created attachment 8994 [details] [review] Patch for the HEAD branch
Created attachment 8995 [details] [review] Patch for the BALSA_2 branch
Both patches in. Thanks!
Next step: the following patch (for the BALSA_2 cvs branch) consolidates the `most recently used folders' code from balsa-index.c and balsa-message.c into balsa-mblist.c (without changing the functionality). It also defines a new widget like that described at: http://mail.gnome.org/archives/balsa-list/2002-June/msg00018.html and replaces the GtkCombo widget used to select the fcc_box in sendmsg-window.c with an instance of it. This eliminates the potential failure of the current code when more than one mailbox has a given name, and provides a convenient UI for selecting an fcc_box anywhere in the mailbox tree. I'll back-port this to the HEAD cvs branch in a few days and post it here.
Created attachment 9037 [details] [review] Patch for BALSA_2 cvs branch
Oops--that should have been: Next step: the following patch (for the BALSA_2 cvs branch) consolidates the `most recently used folders' code from balsa-index.c and message-window.c into balsa-mblist.c (without changing the ^^^^^^^^^^^^^^^^ functionality).
My first impression is that GtkOption list is not easy to use with keyboard only. If others share this impression, this can be reported to gtk+ team. Other comments: 1. When I select "other" from the list, the new window does not get focus (parent improperly defined?). 2. When I cancel the selection and select "other" second time, balsa crashes.
+ Trace 23458
Can you reproduce this?
No, I can't reproduce the crash--looks like a gtk problem. However, the widget is left showing `Other...' each time I cancel, which isn't pretty--that needs fixing. The focus problem can presumably be fixed with gtk_widget_grab_focus. What was the keyboard problem with GtkOptionMenu? I can focus it with the tab key, drop down the list with space-bar, navigate the list with cursor up and down, and select an item with the space-bar. Was some part of that not working for you?
I could not figure the spacebar part.
You're right, the focus is a parent-window problem. I'm also bothered by the widget's memory--the initial fcc-box is the last one used. Perhaps it should be: if balsa_app.copy_to_sentbox, the first item should be Sentbox, the second should be null, and the history should follow; else the first item should be null, with the history following.
A better patch for BALSA_2 follows. It fixes the focus problem that Pawel pointed out, better respects GtkOptionMenu, and leaves the menu in a better state after cancelling a tree display (i.e., showing the current selection instead of "Folder..."). A backport for HEAD follows that patch. In the same way, it consolidates the `most recently used folders' code from balsa-index.c and message-window.c into balsa-mblist.c, establishes the option menu widget, and uses it in sendmsg-window.c in place of the combo box for fcc folder. The functionality of the BalsaIndex context menu is, afaict, preserved. I'm finding that having an option menu for the fcc-box is an amazing convenience--after an hour or two of testing, I'd hate to go back to just having Sentbox--I never used the Combo box because it was too much trouble to type in the name. There is one wrinkle in the HEAD code: if you drop down the menu, move the pointer over the "Folder" item to show the tree, then move the pointer away and click something else, the menu goes away as it should, but it shows "Folder" as the selected item. The fix is to invoke the setup callback as in bmbl_mru_transferred_cb, but I can't find a signal that tells us when that happens. The BALSA_2 code uses different mechanisms, and this wrinkle doesn't appear.
Created attachment 9130 [details] [review] Patch for BALSA_2 branch on cvs.
Created attachment 9131 [details] [review] Patch for HEAD branch of cvs.
Oops--tiny oversight in the BALSA_2 code: always check that a callback is there before calling it! Replacement patch follows.
Created attachment 9132 [details] [review] Replacement BALSA_2 patch.
The patches are still broken--more later.
Created attachment 9149 [details] [review] Bug-free patch for HEAD branch :-)
Created attachment 9150 [details] [review] Bug-free patch for BALSA_2 branch ;-)
Files: src/balsa-index.c, src/balsa-mblist.[ch], src/message-window.[ch]: - consolidate the mru code into balsa-mblist.c; - define a new GtkOptionMenu mru widget. libbalsa/message.[ch], src/print.c, src/balsa-message.c: - replace fcc_mailbox with fcc_url. libbalsa/send.c: - eliminate mqi->fcc. src/balsa-app.[ch], src/save-restore.c: - add and manage balsa_app.fcc_url. src/sendmsg-window.[ch]: - use the mru option menu for the fcc-box.
(bug-free is a bold statement! :-)) Patches commited to HEAD and BALSA_2 branches. Thanks!
The API for the option menu isn't a good fit with the filter code, which needs to manage the menu after it's been created. The following patch for the HEAD branch of cvs introduces a new API, and changes the fcc-box code to use it. src/balsa-mblist.[ch]: - new API for balsa_mblist_mru_option_menu. src/sendmsg-window.c: - use the new API for the fcc-box widget.
Created attachment 9323 [details] [review] Patch for the HEAD cvs branch
This was resolved long time ago!
Sorry for the delay!