#include <tny-camel-folder.h>
#include <tny-simple-list.h>
#include <tny-camel-account.h>
+#include <modest-defs.h>
#include <modest-tny-account.h>
#include <modest-tny-folder.h>
#include <modest-tny-local-folders-account.h>
FOLDER_SELECTION_CHANGED_SIGNAL,
FOLDER_DISPLAY_NAME_CHANGED_SIGNAL,
FOLDER_ACTIVATED_SIGNAL,
+ VISIBLE_ACCOUNT_CHANGED_SIGNAL,
LAST_SIGNAL
};
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
+ /*
+ * Emitted whenever the visible account changes
+ */
+ signals[VISIBLE_ACCOUNT_CHANGED_SIGNAL] =
+ g_signal_new ("visible-account-changed",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (ModestFolderViewClass,
+ visible_account_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1, G_TYPE_STRING);
+
treeview_class->select_cursor_parent = NULL;
#ifdef MODEST_TOOLKIT_HILDON2
/* If this is a move to dialog, hide Sent, Outbox and Drafts
folder as no message can be move there according to UI specs */
- if (!priv->show_non_move) {
+ if (retval && !priv->show_non_move) {
if (priv->list_to_move &&
tny_list_get_length (priv->list_to_move) > 0 &&
TNY_IS_FOLDER (instance)) {
return FALSE;
}
+ if (retval && (priv->filter & MODEST_FOLDER_VIEW_FILTER_HIDE_FOLDERS)) {
+ if (TNY_IS_FOLDER (instance))
+ return FALSE;
+ }
+
+ if (retval && (priv->filter & MODEST_FOLDER_VIEW_FILTER_HIDE_LOCAL_FOLDERS)) {
+ if (!modest_tny_folder_store_is_remote (TNY_FOLDER_STORE (instance))) {
+ return FALSE;
+ }
+ }
+
if (retval && (priv->filter & MODEST_FOLDER_VIEW_FILTER_CAN_HAVE_FOLDERS)) {
if (TNY_IS_FOLDER (instance)) {
/* Check folder rules */
/* Save settings to gconf */
modest_widget_memory_save (modest_runtime_get_conf (), G_OBJECT(self),
MODEST_CONF_FOLDER_VIEW_KEY);
+
+ /* Notify observers */
+ g_signal_emit (G_OBJECT(self),
+ signals[VISIBLE_ACCOUNT_CHANGED_SIGNAL], 0,
+ account_id);
}
const gchar *