diff options
-rw-r--r-- | shell/ChangeLog | 19 | ||||
-rw-r--r-- | shell/Makefile.am | 2 | ||||
-rw-r--r-- | shell/e-storage-set-view-checkboxes.etstate | 5 | ||||
-rw-r--r-- | shell/e-storage-set-view-no-checkboxes.etstate | 4 | ||||
-rw-r--r-- | shell/e-storage-set-view.c | 72 | ||||
-rw-r--r-- | shell/e-storage-set-view.etspec | 1 | ||||
-rw-r--r-- | shell/e-storage-set-view.h | 4 |
7 files changed, 91 insertions, 16 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index ced37c0b2d..017a03ba4a 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,22 @@ +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. + 2002-03-29 Ettore Perazzoli <ettore@ximian.com> * e-shell-settings-dialog.c: Add type "Page". diff --git a/shell/Makefile.am b/shell/Makefile.am index b403bbec3e..bb5171d5c7 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -215,7 +215,7 @@ oaf_in_files = GNOME_Evolution_Shell.oaf.in oaf_DATA = $(oaf_in_files:.oaf.in=.oaf) etspecdir = $(datadir)/evolution/etspec/ -etspec_DATA = e-storage-set-view.etspec +etspec_DATA = e-storage-set-view.etspec e-storage-set-view-checkboxes.etstate e-storage-set-view-no-checkboxes.etstate @XML_I18N_MERGE_OAF_RULE@ diff --git a/shell/e-storage-set-view-checkboxes.etstate b/shell/e-storage-set-view-checkboxes.etstate new file mode 100644 index 0000000000..302fb15321 --- /dev/null +++ b/shell/e-storage-set-view-checkboxes.etstate @@ -0,0 +1,5 @@ +<ETableState> + <column source="1"/> + <column source="0"/> + <grouping></grouping> +</ETableState> diff --git a/shell/e-storage-set-view-no-checkboxes.etstate b/shell/e-storage-set-view-no-checkboxes.etstate new file mode 100644 index 0000000000..f3df4f8991 --- /dev/null +++ b/shell/e-storage-set-view-no-checkboxes.etstate @@ -0,0 +1,4 @@ +<ETableState> + <column source="0"/> + <grouping></grouping> +</ETableState> 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) diff --git a/shell/e-storage-set-view.etspec b/shell/e-storage-set-view.etspec index 9cc3418d0e..fdbf782dad 100644 --- a/shell/e-storage-set-view.etspec +++ b/shell/e-storage-set-view.etspec @@ -1,5 +1,6 @@ <ETableSpecification no-headers="true" selection-mode="single" cursor-mode="line" draw-grid="false" horizontal-scrolling="true"> <ETableColumn model_col="0" _title="Folder" expansion="1.0" minimum_width="20" resizable="true" cell="render_tree" compare="string" search="string"/> + <ETableColumn model_col="2" _title="Checkbox" expansion="0.0" minimum_width="18" resizable="false" cell="checkbox" compare="integer"/> <ETableState> <column source="0"/> <grouping></grouping> diff --git a/shell/e-storage-set-view.h b/shell/e-storage-set-view.h index f0913a9558..ff074ce30b 100644 --- a/shell/e-storage-set-view.h +++ b/shell/e-storage-set-view.h @@ -88,6 +88,10 @@ void e_storage_set_view_set_show_folders (EStorageSetView *storage_set gboolean show); gboolean 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 e_storage_set_view_get_show_checkboxes (EStorageSetView *storage_set_view); + void e_storage_set_view_set_allow_dnd (EStorageSetView *storage_set_view, gboolean allow_dnd); gboolean e_storage_set_view_get_allow_dnd (EStorageSetView *storage_set_view); |