Commit Graph

69 Commits

Author SHA1 Message Date
35ecbe2de5 Due to the introduction of mail_folder_cache_remove(), we can no longer
2001-08-30  Peter Williams  <peterw@ximian.com>

	Due to the introduction of mail_folder_cache_remove(), we can no
	longer assume that mail_folder_info's always exist, so we need
	to robustify a lot of this.

	* mail-folder-cache.c (folder_browser_destroyed): New
	function. Called when the folder browser is destroyed -- analogous
	to camel_folder_finalized.
	(mail_folder_cache_note_fb): Hook it up here.
	(struct _mail_folder_info): Add a member, mail_info_id, that
	records the get_mail operation's id, so that we can cancel it if
	we need to.
	(get_folder_info): Initialize it here.
	(get_mail_info_reply): Clear it here.
	(mail_folder_cache_remove_folder): If necessary, cancel it here.
	(mail_folder_cache_note_folder): Check it here before starting a
	new operation, just in case.
	(update_message_counts_main): Take a URI instead of a
	mail_folder_info *, in case the MFI has gotten destroyed.
	(update_message_counts): Take a quark of the URI instead of a
	mail_folder_info *, for the same reason. We use a quark instead of
	an allocated gchar * because figuring out when to free the string
	gets tricky. Then go from quark -> URI string -> MFI. Return if
	the folder is no longer valid, because this indicates that the MFI
	was removed before this signal got called. Pass a string to
	update_message_counts_main instead of an MFI.
	(camel_folder_finalized): Don't bother unhooking the signals here.
	Same change as above, but don't bother checking for a valid folder
	because we're about to make it invalid anyway.
	(message_list_built): Analogous to the above, except with the
	FolderBrowser instead of the CamelFolder.
	(selection_changed): As above.
	(folder_browser_destroyed): As above.
	(struct get_mail_info_msg): Instead of taking a mail_folder_info
	*, take a URI, for reasons explained above.
	(get_mail_info_receive): Go from URI -> MFI before doing anything.
	(get_mail_info_reply): Same.
	(get_mail_info_destroy): Free the URI.
	(get_mail_info): Take a URI and return the message id so that it
	can be cancelled if necessary.
	(mail_folder_cache_remove_folder): Disconnect from signals and
	events before removing.
	(mail_folder_cache_note_folder): Use a GQuark instead of the
	mail_folder_info * as the user_data.
	(mail_folder_cache_note_fb): Same.
	(mail_folder_cache_note_folderinfo): Little formatting change.

svn path=/trunk/; revision=12532
2001-08-30 19:34:32 +00:00
17a89d643a Record the timeout_id so we can cancel it if the mail_folder_info is later
2001-08-23  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (maybe_update): Record the timeout_id so we
	can cancel it if the mail_folder_info is later freed. Also obviates
	the use of the _UPDATE_QUEUED flag.
	(mail_folder_cache_remove_folder): Cancel the timeout if we need to.
	Lock around the hash table operations. Free mfi itself. Add debugging
	spew.
	(get_folder_info): Initialiae the timeout_id to 0.

svn path=/trunk/; revision=12417
2001-08-23 15:12:28 +00:00
866a960fd9 Fix bug #215... desensitize menu items based on the number of selected
2001-08-09  Peter Williams  <peterw@ximian.com>

	Fix bug #215... desensitize menu items based on the number of
	selected messages (and whether there's a message in the pane)

	* folder-browser-ui.c (folder_browser_ui_add_message): Sensitize
	the menu items appropriately based on the old state.
	(fbui_sensitize_items): New function. Set the sensitivity of a
	list of commands.
	(folder_browser_ui_set_selection_state): New function. Move the FB
	to a new state of selected-ness, and sensitize menu items
	appropriately.
	(folder_browser_ui_message_loaded): New function. When notified
	that a message has been loaded, sensitize some menu items.

	* folder-browser-ui.h: Prototype new functions.

	* folder-browser.h: New enumeration,
	FolderBrowserSelectionState, that records the previous state
	of the selection (_NONE, _SINGLE, _MULTIPLE).

	* folder-browser.c (got_folder): If the component is set,
	set our selection state to _NONE, because that's the default
	state of the ETree.
	(on_selection_changed): When the number of selected messages
	is updated, notify the FBUI code of our new state.
	(folder_browser_gui_init): Hook up to the selection_changed
	signal and default to the _NONE selection state.
	(done_message_selected): Notify when a message is loaded.

2001-08-08  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c: Display how many messages are selected,
	too.
	(make_folder_status): If multiple messages are selected, add that
	to the string (the 0 and 1 cases are boring)
	(selection_changed): New function, update the selected count.
	(mail_folder_cache_note_fb): Connect to the selection_changed
	signal.

svn path=/trunk/; revision=12012
2001-08-14 15:26:00 +00:00
854fb9e9b0 Remove all the messages from a folder that's being deleted before actually
2001-08-10  Jason Leach  <jleach@ximian.com>

	* mail-ops.c (remove_folder_get): Remove all the messages from a
	folder that's being deleted before actually doing the
	camel_store_delete_folder, so it won't leave behind an mbox file
	that's going to prevent the actual directory from being deleted,
	and strange effects like new folders with the same name being made
	in it's place.  Bug #5618.

	* mail-folder-cache.c (mail_folder_cache_remove_folder): New
	function, a way to get something out of the folder cache, like
	folders being deleted.  Bug #6878.

svn path=/trunk/; revision=11887
2001-08-10 18:25:31 +00:00
c4ea7875dc Removed this function, it's not needed anymore.
2001-08-06  Jason Leach  <jleach@ximian.com>

	* mail-folder-cache.c (make_folder_name): Removed this function,
	it's not needed anymore.
	(mail_folder_cache_note_folderinfo): Initialize mfi->unread to 0
	always, so the shell won't get sent a random int for vtrash or
	potentially other folders.

svn path=/trunk/; revision=11699
2001-08-06 16:39:15 +00:00
3732e11baf Updates for EvolutionStorage API changes.
2001-08-03  Jason Leach  <jleach@ximian.com>

	* mail-folder-cache.c (update_idle): Updates for EvolutionStorage
	API changes.

	* mail-importer.c (mail_importer_create_folder): Ditto.

	* mail-local.c: Same here.

svn path=/trunk/; revision=11636
2001-08-03 23:12:14 +00:00
a167730678 Don't display "0 hidden".
2001-07-26  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (make_folder_status): Don't display
	"0 hidden".

svn path=/trunk/; revision=11427
2001-07-26 16:15:40 +00:00
488f755ce8 Don't display "(0 unsent)" if the outbox is empty.
2001-07-24  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (make_folder_name): Don't display "(0 unsent)" if
	the outbox is empty.

svn path=/trunk/; revision=11347
2001-07-24 18:29:23 +00:00
57d3c094da Make the error reporting a little but more descriptive.
2001-07-24  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (update_idle): Make the error reporting a little
	but more descriptive.

svn path=/trunk/; revision=11341
2001-07-24 15:41:31 +00:00
79d07ca8ca prototype outbox_folder so we can check if a folder is it.
2001-07-16  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (outbox_folder): prototype outbox_folder so we
	can check if a folder is it.
	(make_folder_name): If the folder is the outbox, display the count of
	total messages as "unsent".
	(make_folder_status): If the folder is the outbox, display "unsent"
	instead of "total"

svn path=/trunk/; revision=11132
2001-07-16 19:06:55 +00:00
e215bcef02 DUH. No need to update every folder if we set the folder browser to NULL.
2001-07-16  Peter Williams  <peterw@ximian.com>

       * mail-folder-cache.c (mail_folder_cache_set_folder_browser): DUH.
       No need to update every folder if we set the folder browser to
       NULL.

svn path=/trunk/; revision=11128
2001-07-16 14:55:19 +00:00
b9578e4858 Gave up and got rid of dm. Just replaced it with d(g_message()) and set
2001-07-09  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (dm): Gave up and got rid of dm. Just replaced it
	with d(g_message()) and set G_LOG_DOMAIN.

svn path=/trunk/; revision=10911
2001-07-09 15:17:23 +00:00
b66a80f71b Deleted (as opposed to #if 0) (get_folder_info): Changed to assume it has
2001-07-09  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (mail_folder_cache_set_update_shellview): Deleted
	(as opposed to #if 0)
	(get_folder_info): Changed to assume it has the folder lock.
	(make_folder_name): Same.
	(make_folder_status): Same.
	(update_idle): Don't unlock around the make_folder_ functions.
	(*): Changed behavior wrt. get_folder_info. Lock before calling, but
	also move preconditions before -- get_folder_info can only return NULL
	if uri is NULL. Also add preconditions for other arguments where
	necessary.

svn path=/trunk/; revision=10910
2001-07-09 14:56:13 +00:00
068ae263a0 Don't free the psd here -- it will be freed on the "destroy" signal.
2001-07-06  Peter Williams  <peterw@ximian.com>

	* mail-callbacks.c (composer_postpone_cb): Don't free the psd here --
	it will be freed on the "destroy" signal.

	* mail-folder-cache.c (maybe_update): Instead of an idle, use a very
	short timeout in hopes of reducing the number of redundant updates.

	* mail-tools.c (mail_tool_uri_to_folder): Only note the folder in the
	cache if we successfully got it.

svn path=/trunk/; revision=10852
2001-07-06 18:58:48 +00:00
40c22b25f1 Fix obvious bug in previous bugfix: Pass "fb" to check_for_fb_match() so
* mail-folder-cache.c (mail_folder_cache_set_folder_browser): Fix
	obvious bug in previous bugfix: Pass "fb" to check_for_fb_match()
	so only the selected folder gets updated, instead of "all folders
	that haven't yet been selected".

svn path=/trunk/; revision=10846
2001-07-06 16:48:47 +00:00
5438b27589 Clear the shell view label if mailer loses focus.
2001-07-05  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (mail_folder_cache_set_folder_browser): Clear the
	shell view label if mailer loses focus.

	* mail-ops.c (do_update_subfolders_rec): Check for NULL url before
	calling folder cache functions.

svn path=/trunk/; revision=10804
2001-07-05 14:37:54 +00:00
b9df218b34 Split make_string into these. (update_idle): Use (name and status) instead
2001-07-03  Peter Williams  <peterw@ximian.com>

	* mail-folder-cache.c (make_folder_name, make_folder_status): Split
	make_string into these.
	(update_idle): Use (name and status) instead of (wide and thin) for
	the text.

svn path=/trunk/; revision=10766
2001-07-03 21:02:50 +00:00
0e893f8bc4 Prevent folders from appearing to have -1 new messages. Prevent nonactive
2001-07-03  Peter Williams  <peterw@ximian.com>

	Prevent folders from appearing to have -1 new messages. Prevent
	nonactive folders from updating the title bar. Make the title
	bar update when switching to an already-opened folder.

	* mail-folder-cache.c (update_message_counts): Ignore the value for
	'unread' if it is -1.
	(get_mail_info_receive): Same
	(mail_folder_cache_note_folderinfo): Same.
	(get_folder_info): Initialize 'fb' to NULL.
	(mail_folder_info): Add 'fb' member.
	(mail_folder_cache_note_fb): Change note_message_list to this.
	(update_idle): Only update the ShellView if the active folder browser
	is the same as the one that the MFI references.
	(mail_folder_cache_set_folder_browser): New function. Use it to set
	the active folder browser. NULL is okay.
	(check_for_fb_match): Called from the above. If the MFI has the
	new folder browser as its view, queue an update.

	* mail-folder-cache.h: Fix prototypes.

	* mail-callbacks.c (create_folders): Check if fi->url is nonnull.

	* folder-browser.c (got_folder): Change to use note_fb instead of
	note_messge_list.

	* folder-browser-factory.c (control_activate): Set the folder browser
	(control_deactivate): Clear it here.
	(fb_get_svi): Kill some inappropriately cut-n-pasted code.

svn path=/trunk/; revision=10755
2001-07-03 17:15:26 +00:00
26b8fe817e New file. Protoypes for the Mail Folder Cache, which provides a place for
2001-07-02  Peter Williams  <peterw@ximian.com>

        * mail-folder-cache.h: New file. Protoypes for the Mail Folder Cache, which
        provides a place for all the disparate pieces of the mailer to save bits of
        information about a folder. Centralizes the information display code.

        * mail-folder-cache.c: New file. Implements the Mail Folder Cache.

        * Makefile.am (evolution_mail_SOURCES): Add the mail-folder-cache.{c,h}

        * folder-browser-factory.c (fb_get_svi): Copy of that absurdly long-named
        function in mail-display.c that gets the GNOME_Evolution_ShellView.
        (control_activate): Set the ShellView for the folder cache.

        * folder-browser.c (got_folder): Tell the folder browser about this folder.

        * mail-callbacks.c (create_folders): Tell the folder cache about the new
        folders.

        * mail-local.c (reconfigure_folder_reconfigure): Don't unhook our
        events as we no longer hook them up.
        (register_folder_registered): Tell the folder cache about this
        folder's place in the local storage.
        (register_folder_register): No longer hook events; the Folder Cache
        will do this.
        (local_folder_changed, local_folder_changed_proxy): Move to mail-folder-cache.c
        (free_local_folder): No longer unhook events.

        * mail-ops.c (do_update_subfolders_rec): Instead of setting the
        folder status ourselves, inform the Folder Cache about the changes.

        * mail-tools.c (mail_tool_uri_to_folder): Replace danw's cache
        with the new Mail Folder Cache.
        (cache_folder, etc): removed.

svn path=/trunk/; revision=10694
2001-07-02 18:42:18 +00:00