aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage-set-view.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-09-14 05:11:22 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-09-14 05:11:22 +0800
commitc788ba0fafe0143c06efb32a633aef139d21e142 (patch)
tree2c593a485ad3d35f6f453f1f46b7a1394d828337 /shell/e-storage-set-view.c
parent080576bf0dc05633d2e0d4ed7fef8db98a853fc9 (diff)
downloadgsoc2013-evolution-c788ba0fafe0143c06efb32a633aef139d21e142.tar
gsoc2013-evolution-c788ba0fafe0143c06efb32a633aef139d21e142.tar.gz
gsoc2013-evolution-c788ba0fafe0143c06efb32a633aef139d21e142.tar.bz2
gsoc2013-evolution-c788ba0fafe0143c06efb32a633aef139d21e142.tar.lz
gsoc2013-evolution-c788ba0fafe0143c06efb32a633aef139d21e142.tar.xz
gsoc2013-evolution-c788ba0fafe0143c06efb32a633aef139d21e142.tar.zst
gsoc2013-evolution-c788ba0fafe0143c06efb32a633aef139d21e142.zip
Disable DnD on the EStorageSetView to avoid strange behaviors.
* e-shell-view.c (pop_up_folder_bar): Disable DnD on the EStorageSetView to avoid strange behaviors. (reparent_storage_set_view_box_and_destroy_popup): Re-enable DnD here. (popdown_transient_folder_bar): And here as well. * evolution-storage-set-view-factory.c (evolution_storage_set_view_factory_new_view): Disable DnD on the EStorageSetView. * e-shell-folder-selection-dialog.c (e_shell_folder_selection_dialog_construct): Disable DnD on the EStorageSetView. * e-shell-folder-creation-dialog.c (add_storage_set_view): Disable DnD on the EStorageSetView. * e-storage-set-view.c: New member `allow_dnd' in `EStorageSetViewPrivate'. (init): Init to `allow_dnd' %TRUE. (tree_start_drag): If `allow_dnd' is false, don't start the drag and return %FALSE. (tree_drag_motion): If `allow_dnd' is false, return %FALSE. (e_storage_set_view_get_allow_dnd): New. (e_storage_set_view_set_allow_dnd): New. svn path=/trunk/; revision=12810
Diffstat (limited to 'shell/e-storage-set-view.c')
-rw-r--r--shell/e-storage-set-view.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index 2828ab499a..835cef4301 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -82,7 +82,8 @@ struct _EStorageSetViewPrivate {
/* Path of the row selected by the latest "cursor_activated" signal. */
char *selected_row_path;
- gboolean show_folders;
+ unsigned int show_folders : 1;
+ unsigned int allow_dnd : 1;
/* The `Evolution::ShellComponentDnd::SourceFolder' interface for the
folder we are dragging from, or CORBA_OBJECT_NIL if no dragging is
@@ -777,7 +778,6 @@ destroy (GtkObject *object)
}
-
static gint
tree_start_drag (ETree *tree, int row, ETreePath path, int col, GdkEvent *event)
{
@@ -788,6 +788,9 @@ tree_start_drag (ETree *tree, int row, ETreePath path, int col, GdkEvent *event)
storage_set_view = E_STORAGE_SET_VIEW (tree);
+ if (! storage_set_view->priv->allow_dnd)
+ return FALSE;
+
target_list = create_target_list_for_node (storage_set_view, path);
if (target_list == NULL)
return FALSE;
@@ -1051,6 +1054,9 @@ tree_drag_motion (ETree *tree,
storage_set_view = E_STORAGE_SET_VIEW (tree);
priv = storage_set_view->priv;
+ if (! priv->allow_dnd)
+ return FALSE;
+
path = e_tree_node_at_row (E_TREE (storage_set_view), row);
component_client = get_component_at_node (storage_set_view, path);
@@ -1694,6 +1700,7 @@ init (EStorageSetView *storage_set_view)
priv->type_name_to_pixbuf = g_hash_table_new (g_str_hash, g_str_equal);
priv->selected_row_path = NULL;
priv->show_folders = TRUE;
+ priv->allow_dnd = TRUE;
priv->drag_corba_source_interface = CORBA_OBJECT_NIL;
@@ -2028,4 +2035,24 @@ e_storage_set_view_get_show_folders (EStorageSetView *storage_set_view)
}
+void
+e_storage_set_view_set_allow_dnd (EStorageSetView *storage_set_view,
+ gboolean allow_dnd)
+{
+ g_return_if_fail (storage_set_view != NULL);
+ g_return_if_fail (E_IS_STORAGE_SET_VIEW (storage_set_view));
+
+ storage_set_view->priv->allow_dnd = !! allow_dnd;
+}
+
+gboolean
+e_storage_set_view_get_allow_dnd (EStorageSetView *storage_set_view)
+{
+ g_return_val_if_fail (storage_set_view != NULL, FALSE);
+ g_return_val_if_fail (E_IS_STORAGE_SET_VIEW (storage_set_view), FALSE);
+
+ return storage_set_view->priv->allow_dnd;
+}
+
+
E_MAKE_TYPE (e_storage_set_view, "EStorageSetView", EStorageSetView, class_init, init, PARENT_TYPE)