2007-07-10 Johannes Schmid <johannes.schmid@openismus.com>
+ * src/modest-ui-actions.c: (create_move_to_dialog),
+ (modest_ui_actions_on_main_window_move_to),
+ (modest_ui_actions_on_msg_view_window_move_to):
+ * src/widgets/modest-folder-view.c: (modest_folder_view_init),
+ (filter_row), (modest_folder_view_show_non_move_folders):
+ * src/widgets/modest-folder-view.h:
+
+ Hide Sent & Outbox folder in "move to"-dialog. Does not work for
+ the Sent folder yet as it does not report the correct folder type.
+
+2007-07-10 Johannes Schmid <johannes.schmid@openismus.com>
+
* src/maemo/modest-msg-edit-window.c: (init_window):
Fixed bora build
static GtkWidget*
-create_move_to_dialog (ModestWindow *win,
+create_move_to_dialog (GtkWindow *win,
GtkWidget *folder_view,
GtkWidget **tree_view)
{
modest_folder_view_update_model (MODEST_FOLDER_VIEW (*tree_view),
TNY_ACCOUNT_STORE (modest_runtime_get_account_store ()));
+ modest_folder_view_show_non_move_folders(MODEST_FOLDER_VIEW (*tree_view), FALSE);
+
gtk_container_add (GTK_CONTAINER (scroll), *tree_view);
/* Add scroll to dialog */
MODEST_WIDGET_TYPE_HEADER_VIEW);
/* Create and run the dialog */
- dialog = create_move_to_dialog (MODEST_WINDOW (win), folder_view, &tree_view);
+ dialog = create_move_to_dialog (GTK_WINDOW(win), folder_view, &tree_view);
modest_folder_view_select_first_inbox_or_local (MODEST_FOLDER_VIEW (tree_view));
result = gtk_dialog_run (GTK_DIALOG(dialog));
+ modest_folder_view_show_non_move_folders(MODEST_FOLDER_VIEW (tree_view), TRUE);
g_object_ref (tree_view);
/* We do this to save an indentation level ;-) */
folder_view = NULL;
/* Create and run the dialog */
- dialog = create_move_to_dialog (MODEST_WINDOW (win), folder_view, &tree_view);
+ dialog = create_move_to_dialog (GTK_WINDOW (win), folder_view, &tree_view);
result = gtk_dialog_run (GTK_DIALOG(dialog));
+ modest_folder_view_show_non_move_folders(MODEST_FOLDER_VIEW (tree_view), TRUE);
if (result == GTK_RESPONSE_ACCEPT) {
TnyFolderStore *folder_store;
ModestFolderViewStyle style;
gboolean reselect; /* we use this to force a reselection of the INBOX */
+ gboolean show_non_move;
};
#define MODEST_FOLDER_VIEW_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), \
priv->hidding_ids = NULL;
priv->n_selected = 0;
priv->reselect = FALSE;
+ priv->show_non_move = TRUE;
/* Build treeview */
add_columns (GTK_WIDGET (obj));
retval = !found;
}
-
+
+ if (!priv->show_non_move)
+ {
+ switch (type)
+ {
+ case TNY_FOLDER_TYPE_OUTBOX:
+ case TNY_FOLDER_TYPE_SENT:
+ retval = FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+
/* Free */
g_object_unref (instance);
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (model));
}
+void
+modest_folder_view_show_non_move_folders (ModestFolderView *folder_view,
+ gboolean show)
+{
+ ModestFolderViewPrivate* priv = MODEST_FOLDER_VIEW_GET_PRIVATE(folder_view);
+ priv->show_non_move = show;
+ modest_folder_view_update_model(folder_view,
+ TNY_ACCOUNT_STORE(modest_runtime_get_account_store()));
+}
+
/* Returns FALSE if it did not selected anything */
static gboolean
_clipboard_set_selected_data (ModestFolderView *folder_view,
TnyList **folders,
gboolean *delete);
+/*
+ * modest_folder_view_show_non_move_folders:
+ * @self: a #ModestFolderView
+ * @show: show or hide the folders
+ *
+ * Whether to show folders where no messages can be moved to
+ **/
+void
+modest_folder_view_show_non_move_folders (ModestFolderView *folder_view,
+ gboolean show);
+
G_END_DECLS
#endif /* __MODEST_FOLDER_VIEW_H__ */