diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-06-11 01:56:46 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-06-11 01:56:46 +0800 |
commit | bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2 (patch) | |
tree | edcd34154f3281bd860ce40f67d7fc736d340e75 /shell/e-storage.c | |
parent | e8e0d04d0c8a5eb18a62d98e5a62d126756fa79f (diff) | |
download | gsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.tar gsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.tar.gz gsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.tar.bz2 gsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.tar.lz gsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.tar.xz gsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.tar.zst gsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.zip |
Implemented folder creation dialog (File -> New -> Folder). To make
it really work though, the components should implement creation
functionality by passing an appropriate function pointer in
`e_shell_component_new()' for @create_folder_fn.
svn path=/trunk/; revision=3504
Diffstat (limited to 'shell/e-storage.c')
-rw-r--r-- | shell/e-storage.c | 88 |
1 files changed, 61 insertions, 27 deletions
diff --git a/shell/e-storage.c b/shell/e-storage.c index b50a080fc4..30c0c6d667 100644 --- a/shell/e-storage.c +++ b/shell/e-storage.c @@ -218,21 +218,21 @@ impl_get_name (EStorage *storage) } static void -impl_create_folder (EStorage *storage, - const char *path, - const char *type, - const char *description, - EStorageResultCallback callback, - void *data) +impl_async_create_folder (EStorage *storage, + const char *path, + const char *type, + const char *description, + EStorageResultCallback callback, + void *data) { (* callback) (storage, E_STORAGE_NOTIMPLEMENTED, data); } static void -impl_remove_folder (EStorage *storage, - const char *path, - EStorageResultCallback callback, - void *data) +impl_async_remove_folder (EStorage *storage, + const char *path, + EStorageResultCallback callback, + void *data) { (* callback) (storage, E_STORAGE_NOTIMPLEMENTED, data); } @@ -250,11 +250,11 @@ class_init (EStorageClass *class) object_class->destroy = destroy; - class->list_folders = impl_list_folders; - class->get_folder = impl_get_folder; - class->get_name = impl_get_name; - class->create_folder = impl_create_folder; - class->remove_folder = impl_remove_folder; + class->list_folders = impl_list_folders; + class->get_folder = impl_get_folder; + class->get_name = impl_get_name; + class->async_create_folder = impl_async_create_folder; + class->async_remove_folder = impl_async_remove_folder; signals[NEW_FOLDER] = gtk_signal_new ("new_folder", @@ -371,34 +371,68 @@ e_storage_get_name (EStorage *storage) /* Folder operations. */ void -e_storage_create_folder (EStorage *storage, - const char *path, - const char *type, - const char *description, - EStorageResultCallback callback, - void *data) +e_storage_async_create_folder (EStorage *storage, + const char *path, + const char *type, + const char *description, + EStorageResultCallback callback, + void *data) { g_return_if_fail (storage != NULL); g_return_if_fail (E_IS_STORAGE (storage)); g_return_if_fail (path != NULL); + g_return_if_fail (g_path_is_absolute (path)); g_return_if_fail (type != NULL); g_return_if_fail (callback != NULL); - (* ES_CLASS (storage)->create_folder) (storage, path, type, description, callback, data); + (* ES_CLASS (storage)->async_create_folder) (storage, path, type, description, callback, data); } void -e_storage_remove_folder (EStorage *storage, - const char *path, - EStorageResultCallback callback, - void *data) +e_storage_async_remove_folder (EStorage *storage, + const char *path, + EStorageResultCallback callback, + void *data) { g_return_if_fail (storage != NULL); g_return_if_fail (E_IS_STORAGE (storage)); g_return_if_fail (path != NULL); + g_return_if_fail (g_path_is_absolute (path)); g_return_if_fail (callback != NULL); - (* ES_CLASS (storage)->remove_folder) (storage, path, callback, data); + (* ES_CLASS (storage)->async_remove_folder) (storage, path, callback, data); +} + + +const char * +e_storage_result_to_string (EStorageResult result) +{ + switch (result) { + case E_STORAGE_OK: + return _("No error"); + case E_STORAGE_GENERICERROR: + return _("Generic error"); + case E_STORAGE_EXISTS: + return _("A folder with the same name already exists"); + case E_STORAGE_INVALIDTYPE: + return _("The specified folder type is not valid"); + case E_STORAGE_IOERROR: + return _("I/O error"); + case E_STORAGE_NOSPACE: + return _("Not enough space to create the folder"); + case E_STORAGE_NOTFOUND: + return _("The specified folder was not found"); + case E_STORAGE_NOTIMPLEMENTED: + return _("Function not implemented in this storage"); + case E_STORAGE_PERMISSIONDENIED: + return _("Permission denied"); + case E_STORAGE_UNSUPPORTEDOPERATION: + return _("Operation not supported"); + case E_STORAGE_UNSUPPORTEDTYPE: + return _("The specified type is not supported in this storage"); + default: + return _("Unknown error"); + } } |