aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage-set-view.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-04-03 05:24:33 +0800
committerChris Lahey <clahey@src.gnome.org>2002-04-03 05:24:33 +0800
commit4431711f558959af523b5b8c0e3a127f56a43688 (patch)
tree87baa90ba7eb8142aea3266da553e51ada61cc80 /shell/e-storage-set-view.c
parent0b20695032bc1b074f7f8287df527a01fb3bf6a2 (diff)
downloadgsoc2013-evolution-4431711f558959af523b5b8c0e3a127f56a43688.tar
gsoc2013-evolution-4431711f558959af523b5b8c0e3a127f56a43688.tar.gz
gsoc2013-evolution-4431711f558959af523b5b8c0e3a127f56a43688.tar.bz2
gsoc2013-evolution-4431711f558959af523b5b8c0e3a127f56a43688.tar.lz
gsoc2013-evolution-4431711f558959af523b5b8c0e3a127f56a43688.tar.xz
gsoc2013-evolution-4431711f558959af523b5b8c0e3a127f56a43688.tar.zst
gsoc2013-evolution-4431711f558959af523b5b8c0e3a127f56a43688.zip
Added e-storage-set-view-checkboxes.etstate and
2002-04-02 Christopher James Lahey <clahey@ximian.com> * Makefile.am (etspec_DATA): Added e-storage-set-view-checkboxes.etstate and e-storage-set-view-no-checkboxes.etstate here. * e-storage-set-view-checkboxes.etstate, e-storage-set-view-no-checkboxes.etstate: The two possible states of the EStorageSetView. * e-storage-set-view.c, e-storage-set-view.h (e_storage_set_view_set_show_checkboxes, e_storage_set_view_get_show_checkboxes): Added this functionality. Added a model column to the underlying table for the checkbox data. * e-storage-set-view.etspec: Added a view column for the checkboxes. svn path=/trunk/; revision=16324
Diffstat (limited to 'shell/e-storage-set-view.c')
-rw-r--r--shell/e-storage-set-view.c72
1 files changed, 57 insertions, 15 deletions
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index 7d88ff2897..0cd18f0102 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -84,6 +84,7 @@ struct _EStorageSetViewPrivate {
char *right_click_row_path;
unsigned int show_folders : 1;
+ unsigned int show_checkboxes : 1;
unsigned int allow_dnd : 1;
/* The `Evolution::ShellComponentDnd::SourceFolder' interface for the
@@ -1392,7 +1393,7 @@ static int
etree_column_count (ETreeModel *etc,
void *data)
{
- return 2;
+ return 3;
}
static gboolean
@@ -1454,24 +1455,31 @@ etree_value_at (ETreeModel *etree,
if (folder == NULL)
return (void *) "?";
- if (col == 1)
- return (void *) e_folder_get_highlighted (folder);
+ switch (col) {
+ case 0: /* Title */
+ folder_name = e_folder_get_name (folder);
+ unread_count = e_folder_get_unread_count (folder);
- folder_name = e_folder_get_name (folder);
- unread_count = e_folder_get_unread_count (folder);
+ if (unread_count > 0) {
+ char *name_with_unread;
- if (unread_count > 0) {
- char *name_with_unread;
+ name_with_unread = g_strdup_printf ("%s (%d)", folder_name,
+ unread_count);
+ gtk_object_set_data_full (GTK_OBJECT (folder),
+ "name_with_unread",
+ name_with_unread, g_free);
- name_with_unread = g_strdup_printf ("%s (%d)", folder_name,
- unread_count);
- gtk_object_set_data_full (GTK_OBJECT (folder),
- "name_with_unread",
- name_with_unread, g_free);
+ return (void *) name_with_unread;
+ } else
+ return (void *) folder_name;
+ case 1: /* bold */
+ return (void *) e_folder_get_highlighted (folder);
+ case 2: /* checkbox */
+ return (void *) FALSE; /* FIXME: Yo danw, here's the whatnot, ya know. */
+ default:
+ return NULL;
+ }
- return (void *) name_with_unread;
- } else
- return (void *) folder_name;
}
static void
@@ -1829,6 +1837,7 @@ init (EStorageSetView *storage_set_view)
priv->right_click_row_path = NULL;
priv->show_folders = TRUE;
+ priv->show_checkboxes = FALSE;
priv->allow_dnd = TRUE;
priv->drag_corba_source_interface = CORBA_OBJECT_NIL;
@@ -2173,6 +2182,39 @@ 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)
+{
+ EStorageSetViewPrivate *priv;
+
+ g_return_if_fail (storage_set_view != NULL);
+ g_return_if_fail (E_IS_STORAGE_SET_VIEW (storage_set_view));
+
+ priv = storage_set_view->priv;
+
+ if (show == priv->show_folders)
+ return;
+
+ priv->show_folders = show;
+
+ if (show)
+ 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");
+}
+
+gboolean
+e_storage_set_view_get_show_checkboxes (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->show_checkboxes;
+}
+
+
void
e_storage_set_view_set_allow_dnd (EStorageSetView *storage_set_view,
gboolean allow_dnd)