guint time,
gpointer user_data);
+static void expand_root_items (ModestFolderView *self);
+
static gint expand_row_timeout (gpointer data);
static void setup_drag_and_drop (GtkTreeView *self);
* added to the model, not when the account is
* changed later, so get the name from the account
* instance: */
- item_name = g_strdup (tny_account_get_name (
- TNY_ACCOUNT (instance)));
+ item_name = g_strdup (tny_account_get_name (TNY_ACCOUNT (instance)));
item_weight = 800;
} else {
item_name = g_strdup (fname);
on_account_changed (TnyAccountStore *account_store, TnyAccount *tny_account,
gpointer user_data)
{
- g_warning ("%s: account_id = %s", __FUNCTION__, tny_account_get_id(tny_account));
+ /* do nothing */
}
signals[FOLDER_DISPLAY_NAME_CHANGED_SIGNAL], 0,
NULL);
}
+
+ expand_root_items (self);
+
return FALSE;
}
g_object_unref (model);
g_object_unref (filter_model);
g_object_unref (sortable);
-
+
/* Force a reselection of the INBOX next time the widget is shown */
priv->reselect = TRUE;
return folder;
}
+static void
+show_banner_move_target_error ()
+{
+ ModestWindow *main_window;
+
+ main_window = modest_window_mgr_get_main_window(
+ modest_runtime_get_window_mgr());
+
+ modest_platform_information_banner(GTK_WIDGET(main_window),
+ NULL, _("mail_in_ui_folder_move_target_error"));
+}
+
/*
* This function is used by drag_data_received_cb to manage drag and
* drop of a header, i.e, and drag from the header view to the folder
TnyFolder *folder = NULL;
ModestMailOperation *mail_op = NULL;
GtkTreeIter source_iter;
+ ModestWindowMgr *mgr = NULL;
g_return_if_fail (GTK_IS_TREE_MODEL(source_model));
g_return_if_fail (GTK_IS_TREE_MODEL(dest_model));
goto cleanup;
}
+ /* Check if the selected message is in msg-view. If it is than
+ * do not enable drag&drop on that. */
+ mgr = modest_runtime_get_window_mgr ();
+ if (modest_window_mgr_find_registered_header(mgr, header, NULL))
+ goto cleanup;
+
/* Get Folder */
folder = tree_path_to_folder (dest_model, dest_row);
if (!TNY_IS_FOLDER(folder)) {
g_warning ("BUG: %s could not get a valid folder", __FUNCTION__);
+ show_banner_move_target_error();
goto cleanup;
}
if (modest_tny_folder_get_rules(folder) & MODEST_FOLDER_RULES_FOLDER_NON_WRITEABLE) {
/* Select the row and free */
gtk_tree_view_set_cursor (GTK_TREE_VIEW (self), path, NULL, FALSE);
gtk_tree_path_free (path);
+
+ /* set focus */
+ gtk_widget_grab_focus (GTK_WIDGET(self));
}