diff options
author | Milan Crha <mcrha@redhat.com> | 2010-05-19 04:47:29 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-05-19 04:47:29 +0800 |
commit | ef7690c3845e3c1cebcf3caba7f7667a10e7123d (patch) | |
tree | ab4a5bfa25bc5e25e0fed851c25226ce1930ec52 /e-util | |
parent | 0f92771be57383e5d6e7d0f3e05743d192066eb3 (diff) | |
download | gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.tar gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.tar.gz gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.tar.bz2 gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.tar.lz gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.tar.xz gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.tar.zst gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.zip |
Bug #499320 - Preview before import from command line
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-import.c | 26 | ||||
-rw-r--r-- | e-util/e-import.h | 6 |
2 files changed, 32 insertions, 0 deletions
diff --git a/e-util/e-import.c b/e-util/e-import.c index 4475344018..14485633c1 100644 --- a/e-util/e-import.c +++ b/e-util/e-import.c @@ -216,6 +216,32 @@ e_import_get_widget (EImport *import, } /** + * e_import_get_preview_widget: + * @import: an #EImport + * @target: Target of interest + * @im: Importer to get a preview widget of + * + * Gets a widget that the importer uses to preview data to be + * imported. This widget should be packed into a container + * widget. It should not be shown_all. + * + * Return value: NULL if the importer doesn't support preview. + **/ +GtkWidget * +e_import_get_preview_widget (EImport *import, + EImportTarget *target, + EImportImporter *im) +{ + g_return_val_if_fail (im != NULL, NULL); + g_return_val_if_fail (target != NULL, NULL); + + if (!im->get_preview) + return NULL; + + return im->get_preview (import, target, im); +} + +/** * e_import_complete: * @import: an #EImport * @target: Target just completed (unused currently) diff --git a/e-util/e-import.h b/e-util/e-import.h index affc364a4b..57bb79450d 100644 --- a/e-util/e-import.h +++ b/e-util/e-import.h @@ -78,6 +78,8 @@ enum _e_import_target_t { * @supported: Callback to see if this target is supported by the importer. * @get_widget: A widget factory for this importer, if it needs any extra information in the assistant. It will update the target. * @import: Run the import. + * @cancel: Cancel the import. + * @get_preview: Callback to create a preview widget for just importing data. * @user_data: User data for the callbacks; * * Base importer description. @@ -91,6 +93,7 @@ struct _EImportImporter { EImportWidgetFunc get_widget; EImportImportFunc import; EImportImportFunc cancel; + EImportWidgetFunc get_preview; gpointer user_data; @@ -199,6 +202,9 @@ void e_import_cancel (EImport *import, GtkWidget * e_import_get_widget (EImport *import, EImportTarget *target, EImportImporter *importer); +GtkWidget * e_import_get_preview_widget (EImport *import, + EImportTarget *target, + EImportImporter *im); void e_import_status (EImport *import, EImportTarget *target, const gchar *what, |