[Proposal] Improve IMAP folder parent selection, subscription management



Hi all,

attached is a *proposal* addressing two inconveniences in IMAP folder management:

1. Selecting the parent folder using the “Browse” button
a. The button opens a new window, containing /all/ folders Balsa knows about.  In my case, I have ~50 local 
folders, plus two different IMAP (ISP) servers with ~10 folders each.  IOW, only a fraction of the folders 
displayed can actually be used as new parent of the IMAP folder, which is confusing and tedious.
b. If only subscribed folders are displayed, it is not possible to define a currently unsubscribed folder as 
new parent (which is perfectly legal) simply as it is not visible.  The workaround is to disable “Subscribed 
folders only”, then shift the folder, and switch to subscribed only again, i.e. three operations have to be 
performed in two places.

2. Subscription management
a. Currently, folders can be (un-) subscribed only by using the context menu item in the folder tree view.  
There is no indication if the folder is currently subscribed or not (it is hidden if “Subscribed folders 
only” is enabled, though).
b. Related to #1b. above, it is not possible to directly subscribe to an unsubscribed folder if “Subscribed 
folders only” is activated, with the same workaround as outlined above.

Thus, I would like to propose a different approach.  It basically scans the IMAP server's folder structure, 
instead of relying on the cached data in Balsa, every time the two aforementioned management operations above 
shall be performed.

For issue 1, a new dialogue is displayed, containing the tree view of /all/ (subscribed and unsubscribed) 
folders on the IMAP server.  The user can either double-click the requested new parent, or select the entry 
and click OK.  The tree store of folders is kept as long as the parent dialogue (IMAP subfolder 
configuration) is open, i.e. the scan is performed only /once/ when the “Browse” is clicked.

For issue 2, instead of managing the state for each folder individually, a button “Manage subscriptions” is 
placed next to the “Subscribed folders only” check box in the IMAP server configuration dialogue.  Clicking 
this button scans the folder structure on the IMAP server, plus the subscription state of all folders.  The 
dialogue is similar to case #1 above, with an additional column of check boxes indicating the subscription 
state.  If the user has changed the subscription state, the folder is printed in /italics/.  As above, the 
store of folders, old and new subscription states is kept until the server configuration dialogue is closed.  
If requested, all changed subscriptions are applied.  Note that the “Manage subscriptions” button is 
sensitive only if “Subscribed folders only” is activated.  If there are use cases where subscription 
management should always be available, this limitation can easily be removed.

There has recently been a discussion regarding the traffic required for scanning the server for /very/ slow 
or low-bandwidth connections.  IMO, the proposed approach will actually improve (apart from the usability) 
the situation in this scenario: a typical approach for such connections will be accessing subscribed folders 
only.  In this case, it is (as via the workaround outlined above) actually required to scan the server 
/twice/ after toggling “Subscribed folders only”.  And for a connection with a typical bandwidth *and* 
“Subscribed folders only” not being activated, I assume that the extra overhead will be negligible.

As always, any comment will be highly appreciated!

Cheers,
Albrecht.

---
Patch details:
* libbalsa/folder-scanners.[ch]: implement new function libbalsa_scanner_imap_tree() for scanning an IMAP 
server's folder structure and subscription state into a GtkTreeStore, requires a bunch of helper functions
* libbalsa/imap-server.[ch]: implement new function libbalsa_imap_server_subscriptions() for subscribing to 
and unsubscribing from arrays of folders using a single IMAP connection
* libbalsa/mailbox_imap.[ch]: remove unused function libbalsa_mailbox_imap_subscribe() (obsoleted by 
libbalsa_imap_server_subscriptions())
* src/folder-conf.c: implement new style subscription and parent folder selection:
  * imap_apply_subscriptions() collects folders with modified subscription states from the GtkTreeView;
  * imap_update_subscriptions() applies changed subscription states, called from folder_conf_clicked_ok();
  * on_subscription_toggled() callback for subscription state checkbox;
  * create_imap_folder_dialog() create the dialogue for parent folder selection and subscription management;
  * folder_conf_imap_subscriptions() runs the subscription management dialogue;
  * fcw_subscribed_toggled() callback for activating the subscription management button;
  * folder_conf_imap_node() add button for subscription management;
  * select_parent_folder() find parent of a folder in the GtkTreeModel;
  * on_parent_double_click() callback for double-click folder selection;
  * browse_button_cb() modified, runs the parent selection dialogue;
  * remove obsolete functions browse_button_select_row_cb(), browse_button_row_activated(), 
browse_button_response(), folder_selection_func(), browse_button_data_free()
* src/mailbox-node.c: remove obsolete mailbox tree view entries for (un)subscribing
* src/save-restore.c: add the two new dialogues to the geometry manager

Attachment: imap-management-proposal.diff.bz2
Description: application/bzip

Attachment: pgprqOIwSMReg.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]