After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 59105 - Cannot move objects to new layers
Cannot move objects to new layers
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: general
unspecified
Other other
: Normal enhancement
: 0.97
Assigned To: Dia maintainers
Dia maintainers
: 395405 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2001-08-16 13:40 UTC by Rob Campbell
Modified: 2009-01-20 23:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Rob Campbell 2001-08-16 13:40:14 UTC
The only way that I have found to move an object from one layer to another 
is to cut the object, change to the destination layer, and paste the 
object.  Unfortunately, the position of and connections to the object are 
lost.  It should be possible to move one or more objects to a different 
layer, without changing anything else.

One interface I would suggest is via the property dialog of the object. I 
envision a general "graphical" page that allows layer, line type, and 
other generic properties to be changed.  A separate command for operating 
on multiple objects may also be required.
Comment 1 Cyrille Chépélov 2001-08-17 09:42:30 UTC
This makes sense, but is a bit tough to implement. Hmmm. 
An idea would be a PROP_TYPE_LAYER property ; problem is, an object
does not know what layer it's in or even the concept of a diagram.

Random thoughts on how to bail out of this:
<semi-kludge>
* have a "gpointer temp_diagram_extra_data" in Object
* before editing the properties, the right Expert in app/ sets
obj->diagram_extra_data to point to a structure which holds the list
of layers and the layer this object is in (or NULL if we edit a group
of objects on several layer, if such thing is possible).
* PROP_TYPE_LAYER's implementation knows how to display the current
layer in a sensible way, and how to modify the structure pointed to by
obj->diagram_extra_data.
* after editing the properties, obj->temp_diagram_extra_data is
inspected for changes, and if that happened, the object is changed
from layer.
* finally, obj->diagram_extra_data is reset to NULL.

* the object *never* touches or never cares about
obj->temp_diagram_extra_data, except through StdProp. Exception for
perhaps for UrShapes if they gain momentum. Classic objects must die
and will lack the "layer" control.

* PROP_TYPE_LAYER is only used through PROP_STD_LAYER and
PROP_STD_OFS_LAYER (actually, built into OBJECT_COMMON_PROPERTIES and
_OFFSETS). PROP_STD_LAYER is of course
PROP_FLAG_DONT_SAVE|PROP_FLAG_NO_DEFAULT (the latter is new, but
necessary for props you don't want to set as defaults but want to
merge between live objects. I'll commit that detail right now).
</semi-kludge>
Actually, there is no need to actually define PROP_TYPE_LAYER ; let's
just use the "layer" string, so that people don't get tempted to put
other "nifty layer" controls.

James, what do you think of this ?
Comment 2 Cyrille Chépélov 2002-01-26 19:31:10 UTC
Lars' recent changes (committed or about to be committed) add a link
to the layer to each object, and a link from each layer to its
diagram. This should enable the implementation of this feature request
without my overboard PROP_* kludges.

Comment 3 James Henstridge 2002-05-02 01:27:34 UTC
Mass reassign of bugs to dia-maint@bugzilla.gnome.org.
Comment 4 Lars Clausen 2002-08-05 14:47:12 UTC
Note that you can select everything connected to an object with Select->Transitive.
Thus, moving a cluster of objects without losing their connection points is possible.
Comment 5 Kjartan Maraas 2002-08-05 19:03:39 UTC
Just letting you know that the reporter's mail is bouncing.
Comment 6 Fredrik Ståhl 2006-10-11 11:38:26 UTC
What is the status of this feature request? I'm using dia 0.94 and I find that I often need to move objects between layers. To do this with the current version I have to cut and paste, reposition, and then reconnect the moved objects.

The problem with repositioning could have been avoided if there were a "clone" command which preserved positions.

The connection problem is worse. Note that the problem is not the transfer of internal connections within the moved group of objects. It is the connections between the moved objects and other objects in the original layer that have to be reconnected by hand. This can be quite a lot of work for large diagrams.
Comment 7 Hans Breuer 2006-10-11 20:28:17 UTC
0.95 was released some month ago, 0.96 - whenever it is ready - will have the following feature

2006-07-16  Hans Breuer  <hans@breuer.org>

	* app/cut_n_paste.[hc] : maintain a generation counter to count
	how many times the stored object list is used
	* app/commands.c : use the generation for paste placement. The
	first one after cut is not moved at all: a nice way to move objects
	between layers without changing their lateral position.
	Also sprinkled some diagram_update_extents()
Comment 8 Fredrik Ståhl 2006-10-11 20:55:57 UTC
Great, that takes care of one of the problems. But isn't it still necessary to reconnect all connections from the moved group to other objects? Should I open a new bug for that problem?
Comment 9 Hans Breuer 2006-10-11 21:35:31 UTC
I dont understand. If the objects moved are connected before the cut they still will be connected after the paste. What more do you expect?
Comment 10 Fredrik Ståhl 2006-10-12 06:15:30 UTC
Sorry if I'm confusing this issue. Let me describe it like this. Start with object1 and object2 and a connection between them, all in layer1. I want to move object2 to layer2 without losing the connection to object1 which remains in layer1. Maybe I'm missing something but in 0.95 the objects have to be reconnected by hand. If the connection is included when cutting and pasting, it will be connected to object2 but not object1. If the connection is not included when cutting and pasting, it will be connected to object1 but not object2.

Will these connections be preserved between layers in 0.96? Maybe that's not what is wanted when pasting in other situations?
Comment 11 Lars Clausen 2007-09-23 13:08:32 UTC
Fredrik, your explanation makes sense, and it did not make it into 0.96.  The beginnings of the functionality is there in app/commands.c (move_objects_up_layer and move_objects_down_layer), but some more work on undo is needed for it to work.
Comment 12 Hans Breuer 2009-01-13 08:35:31 UTC
*** Bug 395405 has been marked as a duplicate of this bug. ***
Comment 13 Hans Breuer 2009-01-20 23:24:00 UTC
will be part of 0.97:

2009-01-20  Hans Breuer  <hans@breuer.org>

	* app/undo.[ch] app/commands.[ch] app/menus.c app/diagram.c 
	  data/*-ui. : implement "Objects/Move to layer above/below" 
	(maintaining connections between layers). Fixes bug #59105.
	* samples/undo-check.dia a diagram to play with the above