actions, file: Don't require selected layers for export
As of 443947c6, we no longer require passing
the selected drawables to the export plug-ins
(as each plug-in now grabs those from the
image itself).
Therefore, we can remove the restriction that
there must be a selected layer before you
can export or save an image.
This commit is contained in:
parent
3162dd6428
commit
6a37900610
3 changed files with 6 additions and 30 deletions
|
|
@ -261,7 +261,6 @@ file_actions_update (GimpActionGroup *group,
|
|||
{
|
||||
Gimp *gimp = action_data_get_gimp (data);
|
||||
GimpImage *image = action_data_get_image (data);
|
||||
GList *drawables = NULL;
|
||||
GFile *file = NULL;
|
||||
GFile *source = NULL;
|
||||
GFile *export = NULL;
|
||||
|
|
@ -269,8 +268,6 @@ file_actions_update (GimpActionGroup *group,
|
|||
|
||||
if (image)
|
||||
{
|
||||
drawables = gimp_image_get_selected_drawables (image);
|
||||
|
||||
file = gimp_image_get_file (image);
|
||||
source = gimp_image_get_imported_file (image);
|
||||
export = gimp_image_get_exported_file (image);
|
||||
|
|
@ -287,16 +284,16 @@ file_actions_update (GimpActionGroup *group,
|
|||
#define SET_SENSITIVE(action,condition) \
|
||||
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
|
||||
|
||||
SET_SENSITIVE ("file-save", drawables);
|
||||
SET_SENSITIVE ("file-save-as", drawables);
|
||||
SET_SENSITIVE ("file-save-a-copy", drawables);
|
||||
SET_SENSITIVE ("file-save-and-close", drawables);
|
||||
SET_SENSITIVE ("file-save", image);
|
||||
SET_SENSITIVE ("file-save-as", image);
|
||||
SET_SENSITIVE ("file-save-a-copy", image);
|
||||
SET_SENSITIVE ("file-save-and-close", image);
|
||||
SET_SENSITIVE ("file-revert", file || source);
|
||||
SET_SENSITIVE ("file-export", drawables);
|
||||
SET_SENSITIVE ("file-export", image);
|
||||
SET_VISIBLE ("file-export", ! show_overwrite);
|
||||
SET_SENSITIVE ("file-overwrite", show_overwrite);
|
||||
SET_VISIBLE ("file-overwrite", show_overwrite);
|
||||
SET_SENSITIVE ("file-export-as", drawables);
|
||||
SET_SENSITIVE ("file-export-as", image);
|
||||
SET_SENSITIVE ("file-create-template", image);
|
||||
SET_SENSITIVE ("file-copy-location", file || source || export);
|
||||
SET_SENSITIVE ("file-show-in-file-manager", file || source || export);
|
||||
|
|
@ -357,8 +354,6 @@ file_actions_update (GimpActionGroup *group,
|
|||
SET_SENSITIVE ("file-close-all", image);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
|
||||
g_list_free (drawables);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -249,7 +249,6 @@ file_save_cmd_callback (GimpAction *action,
|
|||
Gimp *gimp;
|
||||
GimpDisplay *display;
|
||||
GimpImage *image;
|
||||
GList *drawables;
|
||||
GtkWidget *widget;
|
||||
GimpSaveMode save_mode;
|
||||
GFile *file = NULL;
|
||||
|
|
@ -262,14 +261,6 @@ file_save_cmd_callback (GimpAction *action,
|
|||
|
||||
save_mode = (GimpSaveMode) g_variant_get_int32 (value);
|
||||
|
||||
drawables = gimp_image_get_selected_drawables (image);
|
||||
if (! drawables)
|
||||
{
|
||||
g_list_free (drawables);
|
||||
return;
|
||||
}
|
||||
g_list_free (drawables);
|
||||
|
||||
file = gimp_image_get_file (image);
|
||||
|
||||
switch (save_mode)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ file_save (Gimp *gimp,
|
|||
GFile *local_file = NULL;
|
||||
gboolean mounted = TRUE;
|
||||
GError *my_error = NULL;
|
||||
GList *drawables_list;
|
||||
GimpExportOptions *options = NULL;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), GIMP_PDB_CALLING_ERROR);
|
||||
|
|
@ -97,15 +96,6 @@ file_save (Gimp *gimp,
|
|||
*/
|
||||
options = g_object_new (GIMP_TYPE_EXPORT_OPTIONS, NULL);
|
||||
|
||||
drawables_list = gimp_image_get_selected_drawables (image);
|
||||
|
||||
if (! drawables_list)
|
||||
{
|
||||
g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||
_("There is no active layer to save"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* FIXME enable these tests for remote files again, needs testing */
|
||||
if (g_file_is_native (file) &&
|
||||
g_file_query_exists (file, NULL))
|
||||
|
|
|
|||
Loading…
Reference in a new issue