diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2002-05-21 02:05:55 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2002-05-21 02:05:55 +0800 |
commit | 97d578613baab00205b157c2cd87baed41dbcf5f (patch) | |
tree | 51e420dd62e91ac6162a0ba0dcdd0e9d3f0c42d6 | |
parent | de5b0738fd523214973cbc12287a599164baad5c (diff) | |
download | gsoc2013-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
-rw-r--r-- | shell/ChangeLog | 22 | ||||
-rw-r--r-- | shell/Evolution-ShellComponent.idl | 3 | ||||
-rw-r--r-- | shell/e-shell-config-offline.c | 3 | ||||
-rw-r--r-- | shell/e-storage-set-view.c | 34 | ||||
-rw-r--r-- | shell/e-storage-set-view.h | 26 | ||||
-rw-r--r-- | shell/evolution-storage-set-view.c | 3 |
6 files changed, 76 insertions, 15 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index ed436547f3..45ac7e6240 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,25 @@ +2002-05-20 Ettore Perazzoli <ettore@ximian.com> + + * 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. + 2002-05-16 Ettore Perazzoli <ettore@ximian.com> * e-shell.c (view_delete_event_cb): Ask e_shell_prepare_for_quit() diff --git a/shell/Evolution-ShellComponent.idl b/shell/Evolution-ShellComponent.idl index e450aa719f..dabfbf178d 100644 --- a/shell/Evolution-ShellComponent.idl +++ b/shell/Evolution-ShellComponent.idl @@ -142,8 +142,7 @@ module Evolution { through the listener (through OK or CANCEL) whether the shell can quit safely. (This is meant to be used for confirmations before quitting.) */ - oneway void requestQuit (in ShellComponentListener listener) - raises (Busy); + oneway void requestQuit (in ShellComponentListener listener); }; interface ShellComponentListener { diff --git a/shell/e-shell-config-offline.c b/shell/e-shell-config-offline.c index ec825b9445..2776d32cdd 100644 --- a/shell/e-shell-config-offline.c +++ b/shell/e-shell-config-offline.c @@ -167,7 +167,8 @@ e_shell_config_offline_create_control (EShell *shell) page_data->shell = shell; page_data->storage_set_view = e_storage_set_new_view (e_shell_get_storage_set (shell), NULL); - e_storage_set_view_set_show_checkboxes (E_STORAGE_SET_VIEW (page_data->storage_set_view), TRUE); + e_storage_set_view_set_show_checkboxes (E_STORAGE_SET_VIEW (page_data->storage_set_view), TRUE, + NULL, NULL); gtk_widget_show (page_data->storage_set_view); init_storage_set_view_status_from_config (E_STORAGE_SET_VIEW (page_data->storage_set_view), shell); 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 diff --git a/shell/e-storage-set-view.h b/shell/e-storage-set-view.h index 553db79f9e..7d615cecaf 100644 --- a/shell/e-storage-set-view.h +++ b/shell/e-storage-set-view.h @@ -39,6 +39,10 @@ extern "C" { #define E_IS_STORAGE_SET_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_STORAGE_SET_VIEW)) +typedef gboolean (* EStorageSetViewHasCheckBoxFunc) (EStorageSet *storage_set, + const char *path, + void *data); + typedef struct _EStorageSetView EStorageSetView; typedef struct _EStorageSetViewPrivate EStorageSetViewPrivate; typedef struct _EStorageSetViewClass EStorageSetViewClass; @@ -91,19 +95,21 @@ 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_show_checkboxes (EStorageSetView *storage_set_view, + gboolean show, + EStorageSetViewHasCheckBoxFunc has_checkbox_func, + void *func_data); +gboolean e_storage_set_view_get_show_checkboxes (EStorageSetView *storage_set_view); -void e_storage_set_view_set_checkboxes_list (EStorageSetView *storage_set_view, - GList *checkboxes); -GList *e_storage_set_view_get_checkboxes_list (EStorageSetView *storage_set_view); +void e_storage_set_view_set_checkboxes_list (EStorageSetView *storage_set_view, + GList *checkboxes); +GList *e_storage_set_view_get_checkboxes_list (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); +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); -const char *e_storage_set_view_get_right_click_path (EStorageSetView *storage_set_view); +const char *e_storage_set_view_get_right_click_path (EStorageSetView *storage_set_view); #ifdef __cplusplus } diff --git a/shell/evolution-storage-set-view.c b/shell/evolution-storage-set-view.c index 242897c3e8..171b06b282 100644 --- a/shell/evolution-storage-set-view.c +++ b/shell/evolution-storage-set-view.c @@ -252,7 +252,8 @@ impl_StorageSetView__set_showCheckboxes (PortableServer_Servant servant, storage_set_view = EVOLUTION_STORAGE_SET_VIEW (bonobo_object); priv = storage_set_view->priv; - e_storage_set_view_set_show_checkboxes (E_STORAGE_SET_VIEW (priv->storage_set_view_widget), value); + e_storage_set_view_set_show_checkboxes (E_STORAGE_SET_VIEW (priv->storage_set_view_widget), + value, NULL, NULL); } static CORBA_boolean |