mirror of https://github.com/GNOME/gimp.git
widgets: Prevent reordering actively edited layer effects
Layer effects that have not yet been committed are not attached to the drawable. Trying to reorder them causes a crash since they're required to be attached for undo/redo purposes. This patch checks if they're committed beforehand, and informs the user with a warning if it's not possible.
This commit is contained in:
parent
5ce128a9fa
commit
5fcee54d49
|
@ -2619,13 +2619,21 @@ static void
|
||||||
gimp_item_tree_view_effects_raised_clicked (GtkWidget *widget,
|
gimp_item_tree_view_effects_raised_clicked (GtkWidget *widget,
|
||||||
GimpItemTreeView *view)
|
GimpItemTreeView *view)
|
||||||
{
|
{
|
||||||
|
GimpImage *image = view->priv->image;
|
||||||
|
|
||||||
if (! view->priv->effects_filter ||
|
if (! view->priv->effects_filter ||
|
||||||
! GIMP_IS_DRAWABLE_FILTER (view->priv->effects_filter))
|
! GIMP_IS_DRAWABLE_FILTER (view->priv->effects_filter))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (gimp_drawable_filter_get_mask (view->priv->effects_filter) == NULL)
|
||||||
|
{
|
||||||
|
gimp_message_literal (image->gimp, G_OBJECT (view), GIMP_MESSAGE_ERROR,
|
||||||
|
_("Cannot reorder a filter that is being edited."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (view->priv->effects_drawable)
|
if (view->priv->effects_drawable)
|
||||||
{
|
{
|
||||||
GimpImage *image = view->priv->image;
|
|
||||||
GimpContainer *filters;
|
GimpContainer *filters;
|
||||||
gint index;
|
gint index;
|
||||||
|
|
||||||
|
@ -2664,13 +2672,21 @@ static void
|
||||||
gimp_item_tree_view_effects_lowered_clicked (GtkWidget *widget,
|
gimp_item_tree_view_effects_lowered_clicked (GtkWidget *widget,
|
||||||
GimpItemTreeView *view)
|
GimpItemTreeView *view)
|
||||||
{
|
{
|
||||||
|
GimpImage *image = view->priv->image;
|
||||||
|
|
||||||
if (! view->priv->effects_filter ||
|
if (! view->priv->effects_filter ||
|
||||||
! GIMP_IS_DRAWABLE_FILTER (view->priv->effects_filter))
|
! GIMP_IS_DRAWABLE_FILTER (view->priv->effects_filter))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (gimp_drawable_filter_get_mask (view->priv->effects_filter) == NULL)
|
||||||
|
{
|
||||||
|
gimp_message_literal (image->gimp, G_OBJECT (view), GIMP_MESSAGE_ERROR,
|
||||||
|
_("Cannot reorder a filter that is being edited."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (view->priv->effects_drawable)
|
if (view->priv->effects_drawable)
|
||||||
{
|
{
|
||||||
GimpImage *image = view->priv->image;
|
|
||||||
GimpContainer *filters;
|
GimpContainer *filters;
|
||||||
gint index;
|
gint index;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue