aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage-set-view.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-05-21 02:05:55 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-05-21 02:05:55 +0800
commit97d578613baab00205b157c2cd87baed41dbcf5f (patch)
tree51e420dd62e91ac6162a0ba0dcdd0e9d3f0c42d6 /shell/e-storage-set-view.c
parentde5b0738fd523214973cbc12287a599164baad5c (diff)
downloadgsoc2013-evolution-97d578613baab00205b157c2cd87baed41dbcf5f.tar
gsoc2013-evolution-97d578613baab00205b157c2cd87baed41dbcf5f.tar.gz
gsoc2013-evolution-97d578613baab00205b157c2cd87baed41dbcf5f.tar.bz2
gsoc2013-evolution-97d578613baab00205b157c2cd87baed41dbcf5f.tar.lz
gsoc2013-evolution-97d578613baab00205b157c2cd87baed41dbcf5f.tar.xz
gsoc2013-evolution-97d578613baab00205b157c2cd87baed41dbcf5f.tar.zst
gsoc2013-evolution-97d578613baab00205b157c2cd87baed41dbcf5f.zip
Pass NULL for @has_checkbox_func and @has_checkbox_func_data.
* e-shell-config-offline.c (e_shell_config_offline_create_control): Pass NULL for @has_checkbox_func and @has_checkbox_func_data. * evolution-storage-set-view.c (impl_StorageSetView__set_showCheckboxes): Pass NULL for @has_checkbox_func and @has_checkbox_func_data. * e-storage-set-view.c: New member has_checkbox_func and has_checkbox_func_data in EStorageSetViewPrivate. (init): Init to NULL. (e_storage_set_view_set_show_checkboxes): New args @has_checkbox_func and @func_data. (has_checkbox): Always return FALSE for the toplevels. For the other ones return TRUE unless ->has_checkbox_func is not-NULL; in which case, we use that function to determine whether the folder is actually checkable. * Evolution-ShellComponent.idl (requestQuit): Remove exception. svn path=/trunk/; revision=16945
Diffstat (limited to 'shell/e-storage-set-view.c')
-rw-r--r--shell/e-storage-set-view.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index d7ec5be1c6..f059e06493 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -107,6 +107,11 @@ struct _EStorageSetViewPrivate {
GNOME_Evolution_ShellComponentDnd_Data *drag_corba_data;
GHashTable *checkboxes;
+
+ /* Callback to determine whether the row should have a checkbox or
+ not, when show_checkboxes is TRUE. */
+ EStorageSetViewHasCheckBoxFunc has_checkbox_func;
+ void *has_checkbox_func_data;
};
@@ -1155,6 +1160,25 @@ etree_get_node_by_id (ETreeModel *etm,
static gboolean
has_checkbox (EStorageSetView *storage_set_view, ETreePath tree_path)
{
+ EStorageSetViewPrivate *priv;
+ const char *folder_path;
+
+ priv = storage_set_view->priv;
+
+ folder_path = e_tree_memory_node_get_data (E_TREE_MEMORY(storage_set_view->priv->etree_model),
+ tree_path);
+ g_assert (folder_path != NULL);
+
+ if (strchr (folder_path + 1, '/') == NULL) {
+ /* If it's a toplevel, never allow checking it. */
+ return FALSE;
+ }
+
+ if (priv->has_checkbox_func)
+ return (* priv->has_checkbox_func) (priv->storage_set,
+ folder_path,
+ priv->has_checkbox_func_data);
+
return TRUE;
}
@@ -1636,6 +1660,9 @@ init (EStorageSetView *storage_set_view)
priv->checkboxes = NULL;
+ priv->has_checkbox_func = NULL;
+ priv->has_checkbox_func_data = NULL;
+
storage_set_view->priv = priv;
}
@@ -1990,7 +2017,9 @@ e_storage_set_view_get_show_folders (EStorageSetView *storage_set_view)
void
e_storage_set_view_set_show_checkboxes (EStorageSetView *storage_set_view,
- gboolean show)
+ gboolean show,
+ EStorageSetViewHasCheckBoxFunc has_checkbox_func,
+ void *func_data)
{
EStorageSetViewPrivate *priv;
@@ -2010,6 +2039,9 @@ e_storage_set_view_set_show_checkboxes (EStorageSetView *storage_set_view,
e_tree_load_state (E_TREE (storage_set_view), EVOLUTION_ETSPECDIR "/e-storage-set-view-checkboxes.etstate");
else
e_tree_load_state (E_TREE (storage_set_view), EVOLUTION_ETSPECDIR "/e-storage-set-view-no-checkboxes.etstate");
+
+ priv->has_checkbox_func = has_checkbox_func;
+ priv->has_checkbox_func_data = func_data;
}
gboolean