/* toolbar */
#define MODEST_TOOLBAR_ICON_MAIL_SEND PIXMAP_PREFIX "qgn_list_messagin_sent.png"
#define MODEST_TOOLBAR_ICON_NEW_MAIL PIXMAP_PREFIX "mail-message-new.png"
-#define MODEST_TOOLBAR_ICON_SEND_RECEIVE PIXMAP_PREFIX "gtk-refresh.png"
+/* #define MODEST_TOOLBAR_ICON_SEND_RECEIVE PIXMAP_PREFIX "gtk-refresh.png" */
#define MODEST_TOOLBAR_ICON_REPLY PIXMAP_PREFIX "mail-reply-sender.png"
#define MODEST_TOOLBAR_ICON_REPLY_ALL PIXMAP_PREFIX "mail-reply-all.png"
#define MODEST_TOOLBAR_ICON_FORWARD PIXMAP_PREFIX "mail-forward.png"
{ "ActionsReplyAll", MODEST_STOCK_REPLY_ALL, N_("Reply to all"), NULL, N_("Reply to all"), G_CALLBACK (modest_ui_actions_on_reply_all) },
{ "ActionsForward", MODEST_STOCK_FORWARD, N_("_Forward"), NULL, N_("Forward a message"), G_CALLBACK (modest_ui_actions_on_forward) },
{ "ActionsBounce", NULL, N_("_Bounce"), NULL, N_("Bounce a message"), NULL },
- { "ActionsSendReceive", MODEST_STOCK_SEND_RECEIVE, N_("Send/Receive"), NULL, N_("Send and receive messages"), NULL },
+ { "ActionsSendReceive", GTK_STOCK_REFRESH, N_("Send/Receive"), NULL, N_("Send and receive messages"), NULL },
{ "ActionsDelete", MODEST_STOCK_DELETE, N_("Delete message"), NULL, N_("Delete messages"), G_CALLBACK (modest_ui_actions_on_delete) },
/* HELP */
{ "ToolbarMessageReply", MODEST_STOCK_REPLY, N_("Reply a message"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_reply) },
{ "ToolbarMessageReplyAll", MODEST_STOCK_REPLY_ALL, N_("Reply to all"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_reply_all) },
{ "ToolbarMessageForward", MODEST_STOCK_FORWARD, N_("Forward a message"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_forward) },
- { "ToolbarSendReceive", MODEST_STOCK_SEND_RECEIVE, N_("Send & receive"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_send_receive) },
+ { "ToolbarSendReceive", GTK_STOCK_REFRESH, N_("Send & receive"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_send_receive) },
{ "ToolbarToggleView", GTK_STOCK_CDROM, N_("Toggle view"), "<CTRL>t", NULL, G_CALLBACK (modest_ui_actions_toggle_view) },
{ "ToolbarDeleteMessage", GTK_STOCK_DELETE, N_("Delete message"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_delete) },
};
static GtkStockItem items[] = {
{ MODEST_STOCK_MAIL_SEND, "send mail", 0, 0, NULL },
{ MODEST_STOCK_NEW_MAIL, "new mail", 0, 0, NULL },
- { MODEST_STOCK_SEND_RECEIVE, "send receive", 0, 0, NULL },
+/* { MODEST_STOCK_SEND_RECEIVE, "send receive", 0, 0, NULL }, */
{ MODEST_STOCK_REPLY, "reply", 0, 0, NULL },
{ MODEST_STOCK_REPLY_ALL, "reply all", 0, 0, NULL },
{ MODEST_STOCK_FORWARD, "forward", 0, 0, NULL },
static gchar *items_names [] = {
MODEST_TOOLBAR_ICON_MAIL_SEND,
MODEST_TOOLBAR_ICON_NEW_MAIL,
- MODEST_TOOLBAR_ICON_SEND_RECEIVE,
+/* MODEST_TOOLBAR_ICON_SEND_RECEIVE, */
MODEST_TOOLBAR_ICON_REPLY,
MODEST_TOOLBAR_ICON_REPLY_ALL,
MODEST_TOOLBAR_ICON_FORWARD,
/* FIXME: unref this in the end? */
tny_session_camel_set_async_connecting (priv->session, TRUE);
-/* /\* force a cache fill... ugly *\/ */
+ /* force a cache fill... ugly */
list = TNY_LIST(tny_simple_list_new());
tny_account_store_get_accounts (TNY_ACCOUNT_STORE(obj), list,
TNY_ACCOUNT_STORE_BOTH);
tny_account_set_name (tny_account, account_data->display_name);
g_object_set_data_full (G_OBJECT(tny_account), "modest_account",
- (gpointer*)account_name, g_free);
+ (gpointer*) g_strdup (account_name), g_free);
modest_account_mgr_free_account_data (account_mgr, account_data);
return tny_account;
modest_mail_operation_queue_remove (queue, mail_op);
g_object_unref (G_OBJECT (mail_op));
- /* Save and clean */
- save_and_clean (helper, success);
+ /* Save and clean. HACK: Force success to FALSE in order not
+ to save data in the source widget */
+ gtk_tree_path_free (helper->source_row);
+ save_and_clean (helper, FALSE);
- /* Notify the drag source */
- gtk_drag_finish (helper->context, success, (success && helper->delete_source), helper->time);
+ /* Notify the drag source. Never call delete, the monitor will
+ do the job if needed */
+ gtk_drag_finish (helper->context, success, FALSE, helper->time);
/* Free the helper */
g_slice_free (DndHelper, helper);
typedef struct _ModestHeaderViewPrivate ModestHeaderViewPrivate;
struct _ModestHeaderViewPrivate {
TnyFolder *folder;
- TnyList *headers;
ModestHeaderViewStyle style;
TnyFolderMonitor *monitor;
priv = MODEST_HEADER_VIEW_GET_PRIVATE(obj);
priv->folder = NULL;
- priv->headers = NULL;
priv->monitor = NULL;
priv->monitor_lock = g_mutex_new ();
self = MODEST_HEADER_VIEW(obj);
priv = MODEST_HEADER_VIEW_GET_PRIVATE(self);
- if (priv->headers) {
- g_object_unref (G_OBJECT(priv->headers));
- priv->headers = NULL;
- }
-
g_mutex_lock (priv->monitor_lock);
if (priv->monitor) {
tny_folder_monitor_stop (priv->monitor);
return MODEST_HEADER_VIEW_GET_PRIVATE(self)->style;
}
-
static void
on_refresh_folder (TnyFolder *folder,
gboolean cancelled,
ModestHeaderView *self;
ModestHeaderViewPrivate *priv;
GList *cols, *cursor;
+ TnyList *headers;
if (cancelled) {
GtkTreeSelection *selection;
- g_warning ("Operation_cancelled %s\n", (*error) ? (*error)->message : "unknown");
+ g_warning ("Operation cancelled %s\n", (*error) ? (*error)->message : "unknown");
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (user_data));
gtk_tree_selection_unselect_all (selection);
self = MODEST_HEADER_VIEW(user_data);
priv = MODEST_HEADER_VIEW_GET_PRIVATE(self);
- if (priv->headers) {
- g_object_unref (priv->headers);
- modest_runtime_verify_object_death(priv->headers,"");
- }
+ headers = TNY_LIST(tny_gtk_header_list_model_new ());
- priv->headers = TNY_LIST(tny_gtk_header_list_model_new ());
-
- tny_gtk_header_list_model_set_folder (TNY_GTK_HEADER_LIST_MODEL(priv->headers),
+ tny_gtk_header_list_model_set_folder (TNY_GTK_HEADER_LIST_MODEL(headers),
folder, TRUE);
- sortable = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL(priv->headers));
+ sortable = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL(headers));
/* install our special sorting functions */
cursor = cols = gtk_tree_view_get_columns (GTK_TREE_VIEW(self));
/* Add a folder observer */
g_mutex_lock (priv->monitor_lock);
-
-/* if (priv->monitor) { */
-/* tny_folder_monitor_stop (priv->monitor); */
-/* g_object_unref (G_OBJECT (priv->monitor)); */
-/* } */
-/* priv->monitor = TNY_FOLDER_MONITOR (tny_folder_monitor_new (folder)); */
-/* tny_folder_monitor_add_list (priv->monitor, TNY_LIST (priv->headers)); */
-/* tny_folder_monitor_start (priv->monitor); */
+ if (priv->monitor) {
+ tny_folder_monitor_stop (priv->monitor);
+ g_object_unref (G_OBJECT (priv->monitor));
+ }
+ priv->monitor = TNY_FOLDER_MONITOR (tny_folder_monitor_new (folder));
+ tny_folder_monitor_add_list (priv->monitor, TNY_LIST (headers));
+ g_object_unref (G_OBJECT (headers));
+ tny_folder_monitor_start (priv->monitor);
g_mutex_unlock (priv->monitor_lock);
}
}
+/* Drag and drop stuff */
static void
drag_data_get_cb (GtkWidget *widget,
GdkDragContext *context,
gtk_tree_path_free (source_row);
}
-static void
-drag_data_delete_cb (GtkWidget *widget,
- GdkDragContext *context,
- gpointer user_data)
-{
- GtkTreeIter iter;
- GtkTreePath *source_row;
- GtkTreeModel *model_sort, *model;
- TnyHeader *header;
-
- model_sort = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
- model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (model_sort));
- source_row = g_object_steal_data (G_OBJECT (widget), ROW_REF_DATA_NAME);
-
- /* Delete the source row */
- gtk_tree_model_get_iter (model, &iter, source_row);
- gtk_tree_model_get (model, &iter,
- TNY_GTK_HEADER_LIST_MODEL_INSTANCE_COLUMN, &header,
- -1);
- tny_list_remove (TNY_LIST (model), G_OBJECT (header));
- g_object_unref (G_OBJECT (header));
-
- gtk_tree_path_free (source_row);
-}
-
/* Header view drag types */
const GtkTargetEntry header_view_drag_types[] =
{
"drag_data_get",
GTK_SIGNAL_FUNC(drag_data_get_cb),
NULL);
-
- gtk_signal_connect(GTK_OBJECT (self),
- "drag_data_delete",
- GTK_SIGNAL_FUNC(drag_data_delete_cb),
- NULL);
}