1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
6 | import static org.openstreetmap.josm.tools.I18n.trn;
|
---|
7 |
|
---|
8 | import java.awt.event.ActionEvent;
|
---|
9 | import java.awt.event.KeyEvent;
|
---|
10 | import java.util.ArrayList;
|
---|
11 | import java.util.Collection;
|
---|
12 | import java.util.Collections;
|
---|
13 | import java.util.HashMap;
|
---|
14 | import java.util.HashSet;
|
---|
15 | import java.util.LinkedList;
|
---|
16 | import java.util.List;
|
---|
17 | import java.util.Map;
|
---|
18 | import java.util.Set;
|
---|
19 |
|
---|
20 | import javax.swing.JOptionPane;
|
---|
21 | import javax.swing.JPanel;
|
---|
22 |
|
---|
23 | import org.openstreetmap.josm.Main;
|
---|
24 | import org.openstreetmap.josm.command.AddCommand;
|
---|
25 | import org.openstreetmap.josm.command.ChangeCommand;
|
---|
26 | import org.openstreetmap.josm.command.ChangeNodesCommand;
|
---|
27 | import org.openstreetmap.josm.command.Command;
|
---|
28 | import org.openstreetmap.josm.command.SequenceCommand;
|
---|
29 | import org.openstreetmap.josm.data.osm.Node;
|
---|
30 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
31 | import org.openstreetmap.josm.data.osm.Relation;
|
---|
32 | import org.openstreetmap.josm.data.osm.RelationMember;
|
---|
33 | import org.openstreetmap.josm.data.osm.Way;
|
---|
34 | import org.openstreetmap.josm.gui.MapView;
|
---|
35 | import org.openstreetmap.josm.gui.Notification;
|
---|
36 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Duplicate nodes that are used by multiple ways.
|
---|
40 | *
|
---|
41 | * Resulting nodes are identical, up to their position.
|
---|
42 | *
|
---|
43 | * This is the opposite of the MergeNodesAction.
|
---|
44 | *
|
---|
45 | * If a single node is selected, it will copy that node and remove all tags from the old one
|
---|
46 | */
|
---|
47 | public class UnGlueAction extends JosmAction {
|
---|
48 |
|
---|
49 | private transient Node selectedNode;
|
---|
50 | private transient Way selectedWay;
|
---|
51 | private transient Set<Node> selectedNodes;
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Create a new UnGlueAction.
|
---|
55 | */
|
---|
56 | public UnGlueAction() {
|
---|
57 | super(tr("UnGlue Ways"), "unglueways", tr("Duplicate nodes that are used by multiple ways."),
|
---|
58 | Shortcut.registerShortcut("tools:unglue", tr("Tool: {0}", tr("UnGlue Ways")), KeyEvent.VK_G, Shortcut.DIRECT), true);
|
---|
59 | putValue("help", ht("/Action/UnGlue"));
|
---|
60 | }
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * Called when the action is executed.
|
---|
64 | *
|
---|
65 | * This method does some checking on the selection and calls the matching unGlueWay method.
|
---|
66 | */
|
---|
67 | @Override
|
---|
68 | public void actionPerformed(ActionEvent e) {
|
---|
69 |
|
---|
70 | Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected();
|
---|
71 |
|
---|
72 | String errMsg = null;
|
---|
73 | int errorTime = Notification.TIME_DEFAULT;
|
---|
74 | if (checkSelection(selection)) {
|
---|
75 | if (!checkAndConfirmOutlyingUnglue()) {
|
---|
76 | // FIXME: Leaving action without clearing selectedNode, selectedWay, selectedNodes
|
---|
77 | return;
|
---|
78 | }
|
---|
79 | int count = 0;
|
---|
80 | for (Way w : OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) {
|
---|
81 | if (!w.isUsable() || w.getNodesCount() < 1) {
|
---|
82 | continue;
|
---|
83 | }
|
---|
84 | count++;
|
---|
85 | }
|
---|
86 | if (count < 2) {
|
---|
87 | boolean selfCrossing = false;
|
---|
88 | if (count == 1) {
|
---|
89 | // First try unglue self-crossing way
|
---|
90 | selfCrossing = unglueSelfCrossingWay();
|
---|
91 | }
|
---|
92 | // If there aren't enough ways, maybe the user wanted to unglue the nodes
|
---|
93 | // (= copy tags to a new node)
|
---|
94 | if (!selfCrossing)
|
---|
95 | if (checkForUnglueNode(selection)) {
|
---|
96 | unglueNode(e);
|
---|
97 | } else {
|
---|
98 | errorTime = Notification.TIME_SHORT;
|
---|
99 | errMsg = tr("This node is not glued to anything else.");
|
---|
100 | }
|
---|
101 | } else {
|
---|
102 | // and then do the work.
|
---|
103 | unglueWays();
|
---|
104 | }
|
---|
105 | } else if (checkSelection2(selection)) {
|
---|
106 | if (!checkAndConfirmOutlyingUnglue()) {
|
---|
107 | // FIXME: Leaving action without clearing selectedNode, selectedWay, selectedNodes
|
---|
108 | return;
|
---|
109 | }
|
---|
110 | Set<Node> tmpNodes = new HashSet<>();
|
---|
111 | for (Node n : selectedNodes) {
|
---|
112 | int count = 0;
|
---|
113 | for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) {
|
---|
114 | if (!w.isUsable()) {
|
---|
115 | continue;
|
---|
116 | }
|
---|
117 | count++;
|
---|
118 | }
|
---|
119 | if (count >= 2) {
|
---|
120 | tmpNodes.add(n);
|
---|
121 | }
|
---|
122 | }
|
---|
123 | if (tmpNodes.isEmpty()) {
|
---|
124 | if (selection.size() > 1) {
|
---|
125 | errMsg = tr("None of these nodes are glued to anything else.");
|
---|
126 | } else {
|
---|
127 | errMsg = tr("None of this way''s nodes are glued to anything else.");
|
---|
128 | }
|
---|
129 | } else {
|
---|
130 | // and then do the work.
|
---|
131 | selectedNodes = tmpNodes;
|
---|
132 | unglueWays2();
|
---|
133 | }
|
---|
134 | } else {
|
---|
135 | errorTime = Notification.TIME_VERY_LONG;
|
---|
136 | errMsg =
|
---|
137 | tr("The current selection cannot be used for unglueing.")+'\n'+
|
---|
138 | '\n'+
|
---|
139 | tr("Select either:")+'\n'+
|
---|
140 | tr("* One tagged node, or")+'\n'+
|
---|
141 | tr("* One node that is used by more than one way, or")+'\n'+
|
---|
142 | tr("* One node that is used by more than one way and one of those ways, or")+'\n'+
|
---|
143 | tr("* One way that has one or more nodes that are used by more than one way, or")+'\n'+
|
---|
144 | tr("* One way and one or more of its nodes that are used by more than one way.")+'\n'+
|
---|
145 | '\n'+
|
---|
146 | tr("Note: If a way is selected, this way will get fresh copies of the unglued\n"+
|
---|
147 | "nodes and the new nodes will be selected. Otherwise, all ways will get their\n"+
|
---|
148 | "own copy and all nodes will be selected.");
|
---|
149 | }
|
---|
150 |
|
---|
151 | if (errMsg != null) {
|
---|
152 | new Notification(
|
---|
153 | errMsg)
|
---|
154 | .setIcon(JOptionPane.ERROR_MESSAGE)
|
---|
155 | .setDuration(errorTime)
|
---|
156 | .show();
|
---|
157 | }
|
---|
158 |
|
---|
159 | selectedNode = null;
|
---|
160 | selectedWay = null;
|
---|
161 | selectedNodes = null;
|
---|
162 | }
|
---|
163 |
|
---|
164 | /**
|
---|
165 | * Assumes there is one tagged Node stored in selectedNode that it will try to unglue.
|
---|
166 | * (i.e. copy node and remove all tags from the old one. Relations will not be removed)
|
---|
167 | */
|
---|
168 | private void unglueNode(ActionEvent e) {
|
---|
169 | List<Command> cmds = new LinkedList<>();
|
---|
170 |
|
---|
171 | Node c = new Node(selectedNode);
|
---|
172 | c.removeAll();
|
---|
173 | getCurrentDataSet().clearSelection(c);
|
---|
174 | cmds.add(new ChangeCommand(selectedNode, c));
|
---|
175 |
|
---|
176 | Node n = new Node(selectedNode, true);
|
---|
177 |
|
---|
178 | // If this wasn't called from menu, place it where the cursor is/was
|
---|
179 | if (e.getSource() instanceof JPanel) {
|
---|
180 | MapView mv = Main.map.mapView;
|
---|
181 | n.setCoor(mv.getLatLon(mv.lastMEvent.getX(), mv.lastMEvent.getY()));
|
---|
182 | }
|
---|
183 |
|
---|
184 | cmds.add(new AddCommand(n));
|
---|
185 |
|
---|
186 | fixRelations(selectedNode, cmds, Collections.singletonList(n));
|
---|
187 |
|
---|
188 | Main.main.undoRedo.add(new SequenceCommand(tr("Unglued Node"), cmds));
|
---|
189 | getCurrentDataSet().setSelected(n);
|
---|
190 | Main.map.mapView.repaint();
|
---|
191 | }
|
---|
192 |
|
---|
193 | /**
|
---|
194 | * Checks if selection is suitable for ungluing. This is the case when there's a single,
|
---|
195 | * tagged node selected that's part of at least one way (ungluing an unconnected node does
|
---|
196 | * not make sense. Due to the call order in actionPerformed, this is only called when the
|
---|
197 | * node is only part of one or less ways.
|
---|
198 | *
|
---|
199 | * @param selection The selection to check against
|
---|
200 | * @return {@code true} if selection is suitable
|
---|
201 | */
|
---|
202 | private boolean checkForUnglueNode(Collection<? extends OsmPrimitive> selection) {
|
---|
203 | if (selection.size() != 1)
|
---|
204 | return false;
|
---|
205 | OsmPrimitive n = (OsmPrimitive) selection.toArray()[0];
|
---|
206 | if (!(n instanceof Node))
|
---|
207 | return false;
|
---|
208 | if (OsmPrimitive.getFilteredList(n.getReferrers(), Way.class).isEmpty())
|
---|
209 | return false;
|
---|
210 |
|
---|
211 | selectedNode = (Node) n;
|
---|
212 | return selectedNode.isTagged();
|
---|
213 | }
|
---|
214 |
|
---|
215 | /**
|
---|
216 | * Checks if the selection consists of something we can work with.
|
---|
217 | * Checks only if the number and type of items selected looks good.
|
---|
218 | *
|
---|
219 | * If this method returns "true", selectedNode and selectedWay will
|
---|
220 | * be set.
|
---|
221 | *
|
---|
222 | * Returns true if either one node is selected or one node and one
|
---|
223 | * way are selected and the node is part of the way.
|
---|
224 | *
|
---|
225 | * The way will be put into the object variable "selectedWay", the
|
---|
226 | * node into "selectedNode".
|
---|
227 | */
|
---|
228 | private boolean checkSelection(Collection<? extends OsmPrimitive> selection) {
|
---|
229 |
|
---|
230 | int size = selection.size();
|
---|
231 | if (size < 1 || size > 2)
|
---|
232 | return false;
|
---|
233 |
|
---|
234 | selectedNode = null;
|
---|
235 | selectedWay = null;
|
---|
236 |
|
---|
237 | for (OsmPrimitive p : selection) {
|
---|
238 | if (p instanceof Node) {
|
---|
239 | selectedNode = (Node) p;
|
---|
240 | if (size == 1 || selectedWay != null)
|
---|
241 | return size == 1 || selectedWay.containsNode(selectedNode);
|
---|
242 | } else if (p instanceof Way) {
|
---|
243 | selectedWay = (Way) p;
|
---|
244 | if (size == 2 && selectedNode != null)
|
---|
245 | return selectedWay.containsNode(selectedNode);
|
---|
246 | }
|
---|
247 | }
|
---|
248 |
|
---|
249 | return false;
|
---|
250 | }
|
---|
251 |
|
---|
252 | /**
|
---|
253 | * Checks if the selection consists of something we can work with.
|
---|
254 | * Checks only if the number and type of items selected looks good.
|
---|
255 | *
|
---|
256 | * Returns true if one way and any number of nodes that are part of
|
---|
257 | * that way are selected. Note: "any" can be none, then all nodes of
|
---|
258 | * the way are used.
|
---|
259 | *
|
---|
260 | * The way will be put into the object variable "selectedWay", the
|
---|
261 | * nodes into "selectedNodes".
|
---|
262 | */
|
---|
263 | private boolean checkSelection2(Collection<? extends OsmPrimitive> selection) {
|
---|
264 | if (selection.isEmpty())
|
---|
265 | return false;
|
---|
266 |
|
---|
267 | selectedWay = null;
|
---|
268 | for (OsmPrimitive p : selection) {
|
---|
269 | if (p instanceof Way) {
|
---|
270 | if (selectedWay != null)
|
---|
271 | return false;
|
---|
272 | selectedWay = (Way) p;
|
---|
273 | }
|
---|
274 | }
|
---|
275 | if (selectedWay == null)
|
---|
276 | return false;
|
---|
277 |
|
---|
278 | selectedNodes = new HashSet<>();
|
---|
279 | for (OsmPrimitive p : selection) {
|
---|
280 | if (p instanceof Node) {
|
---|
281 | Node n = (Node) p;
|
---|
282 | if (!selectedWay.containsNode(n))
|
---|
283 | return false;
|
---|
284 | selectedNodes.add(n);
|
---|
285 | }
|
---|
286 | }
|
---|
287 |
|
---|
288 | if (selectedNodes.isEmpty()) {
|
---|
289 | selectedNodes.addAll(selectedWay.getNodes());
|
---|
290 | }
|
---|
291 |
|
---|
292 | return true;
|
---|
293 | }
|
---|
294 |
|
---|
295 | /**
|
---|
296 | * dupe the given node of the given way
|
---|
297 | *
|
---|
298 | * assume that OrginalNode is in the way
|
---|
299 | * <ul>
|
---|
300 | * <li>the new node will be put into the parameter newNodes.</li>
|
---|
301 | * <li>the add-node command will be put into the parameter cmds.</li>
|
---|
302 | * <li>the changed way will be returned and must be put into cmds by the caller!</li>
|
---|
303 | * </ul>
|
---|
304 | */
|
---|
305 | private static Way modifyWay(Node originalNode, Way w, List<Command> cmds, List<Node> newNodes) {
|
---|
306 | // clone the node for the way
|
---|
307 | Node newNode = new Node(originalNode, true /* clear OSM ID */);
|
---|
308 | newNodes.add(newNode);
|
---|
309 | cmds.add(new AddCommand(newNode));
|
---|
310 |
|
---|
311 | List<Node> nn = new ArrayList<>();
|
---|
312 | for (Node pushNode : w.getNodes()) {
|
---|
313 | if (originalNode == pushNode) {
|
---|
314 | pushNode = newNode;
|
---|
315 | }
|
---|
316 | nn.add(pushNode);
|
---|
317 | }
|
---|
318 | Way newWay = new Way(w);
|
---|
319 | newWay.setNodes(nn);
|
---|
320 |
|
---|
321 | return newWay;
|
---|
322 | }
|
---|
323 |
|
---|
324 | /**
|
---|
325 | * put all newNodes into the same relation(s) that originalNode is in
|
---|
326 | */
|
---|
327 | private void fixRelations(Node originalNode, List<Command> cmds, List<Node> newNodes) {
|
---|
328 | // modify all relations containing the node
|
---|
329 | for (Relation r : OsmPrimitive.getFilteredList(originalNode.getReferrers(), Relation.class)) {
|
---|
330 | if (r.isDeleted()) {
|
---|
331 | continue;
|
---|
332 | }
|
---|
333 | Relation newRel = null;
|
---|
334 | Map<String, Integer> rolesToReAdd = null; // <role name, index>
|
---|
335 | int i = 0;
|
---|
336 | for (RelationMember rm : r.getMembers()) {
|
---|
337 | if (rm.isNode() && rm.getMember() == originalNode) {
|
---|
338 | if (newRel == null) {
|
---|
339 | newRel = new Relation(r);
|
---|
340 | rolesToReAdd = new HashMap<>();
|
---|
341 | }
|
---|
342 | rolesToReAdd.put(rm.getRole(), i);
|
---|
343 | }
|
---|
344 | i++;
|
---|
345 | }
|
---|
346 | if (newRel != null) {
|
---|
347 | for (Node n : newNodes) {
|
---|
348 | for (Map.Entry<String, Integer> role : rolesToReAdd.entrySet()) {
|
---|
349 | newRel.addMember(role.getValue() + 1, new RelationMember(role.getKey(), n));
|
---|
350 | }
|
---|
351 | }
|
---|
352 | cmds.add(new ChangeCommand(r, newRel));
|
---|
353 | }
|
---|
354 | }
|
---|
355 | }
|
---|
356 |
|
---|
357 | /**
|
---|
358 | * dupe a single node into as many nodes as there are ways using it, OR
|
---|
359 | *
|
---|
360 | * dupe a single node once, and put the copy on the selected way
|
---|
361 | */
|
---|
362 | private void unglueWays() {
|
---|
363 | List<Command> cmds = new LinkedList<>();
|
---|
364 | List<Node> newNodes = new LinkedList<>();
|
---|
365 |
|
---|
366 | if (selectedWay == null) {
|
---|
367 | Way wayWithSelectedNode = null;
|
---|
368 | LinkedList<Way> parentWays = new LinkedList<>();
|
---|
369 | for (OsmPrimitive osm : selectedNode.getReferrers()) {
|
---|
370 | if (osm.isUsable() && osm instanceof Way) {
|
---|
371 | Way w = (Way) osm;
|
---|
372 | if (wayWithSelectedNode == null && !w.isFirstLastNode(selectedNode)) {
|
---|
373 | wayWithSelectedNode = w;
|
---|
374 | } else {
|
---|
375 | parentWays.add(w);
|
---|
376 | }
|
---|
377 | }
|
---|
378 | }
|
---|
379 | if (wayWithSelectedNode == null) {
|
---|
380 | parentWays.removeFirst();
|
---|
381 | }
|
---|
382 | for (Way w : parentWays) {
|
---|
383 | cmds.add(new ChangeCommand(w, modifyWay(selectedNode, w, cmds, newNodes)));
|
---|
384 | }
|
---|
385 | } else {
|
---|
386 | cmds.add(new ChangeCommand(selectedWay, modifyWay(selectedNode, selectedWay, cmds, newNodes)));
|
---|
387 | }
|
---|
388 |
|
---|
389 | fixRelations(selectedNode, cmds, newNodes);
|
---|
390 | execCommands(cmds, newNodes);
|
---|
391 | }
|
---|
392 |
|
---|
393 | /**
|
---|
394 | * Add commands to undo-redo system.
|
---|
395 | * @param cmds Commands to execute
|
---|
396 | * @param newNodes New created nodes by this set of command
|
---|
397 | */
|
---|
398 | private static void execCommands(List<Command> cmds, List<Node> newNodes) {
|
---|
399 | Main.main.undoRedo.add(new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
|
---|
400 | trn("Dupe into {0} node", "Dupe into {0} nodes", newNodes.size() + 1, newNodes.size() + 1), cmds));
|
---|
401 | // select one of the new nodes
|
---|
402 | getCurrentDataSet().setSelected(newNodes.get(0));
|
---|
403 | }
|
---|
404 |
|
---|
405 | /**
|
---|
406 | * Duplicates a node used several times by the same way. See #9896.
|
---|
407 | * @return true if action is OK false if there is nothing to do
|
---|
408 | */
|
---|
409 | private boolean unglueSelfCrossingWay() {
|
---|
410 | // According to previous check, only one valid way through that node
|
---|
411 | List<Command> cmds = new LinkedList<>();
|
---|
412 | Way way = null;
|
---|
413 | for (Way w: OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) {
|
---|
414 | if (w.isUsable() && w.getNodesCount() >= 1) {
|
---|
415 | way = w;
|
---|
416 | }
|
---|
417 | }
|
---|
418 | List<Node> oldNodes = way.getNodes();
|
---|
419 | List<Node> newNodes = new ArrayList<>(oldNodes.size());
|
---|
420 | List<Node> addNodes = new ArrayList<>();
|
---|
421 | boolean seen = false;
|
---|
422 | for (Node n: oldNodes) {
|
---|
423 | if (n == selectedNode) {
|
---|
424 | if (seen) {
|
---|
425 | Node newNode = new Node(n, true /* clear OSM ID */);
|
---|
426 | newNodes.add(newNode);
|
---|
427 | cmds.add(new AddCommand(newNode));
|
---|
428 | newNodes.add(newNode);
|
---|
429 | addNodes.add(newNode);
|
---|
430 | } else {
|
---|
431 | newNodes.add(n);
|
---|
432 | seen = true;
|
---|
433 | }
|
---|
434 | } else {
|
---|
435 | newNodes.add(n);
|
---|
436 | }
|
---|
437 | }
|
---|
438 | if (addNodes.isEmpty()) {
|
---|
439 | // selectedNode doesn't need unglue
|
---|
440 | return false;
|
---|
441 | }
|
---|
442 | cmds.add(new ChangeNodesCommand(way, newNodes));
|
---|
443 | // Update relation
|
---|
444 | fixRelations(selectedNode, cmds, addNodes);
|
---|
445 | execCommands(cmds, addNodes);
|
---|
446 | return true;
|
---|
447 | }
|
---|
448 |
|
---|
449 | /**
|
---|
450 | * dupe all nodes that are selected, and put the copies on the selected way
|
---|
451 | *
|
---|
452 | */
|
---|
453 | private void unglueWays2() {
|
---|
454 | List<Command> cmds = new LinkedList<>();
|
---|
455 | List<Node> allNewNodes = new LinkedList<>();
|
---|
456 | Way tmpWay = selectedWay;
|
---|
457 |
|
---|
458 | for (Node n : selectedNodes) {
|
---|
459 | List<Node> newNodes = new LinkedList<>();
|
---|
460 | tmpWay = modifyWay(n, tmpWay, cmds, newNodes);
|
---|
461 | fixRelations(n, cmds, newNodes);
|
---|
462 | allNewNodes.addAll(newNodes);
|
---|
463 | }
|
---|
464 | cmds.add(new ChangeCommand(selectedWay, tmpWay)); // only one changeCommand for a way, else garbage will happen
|
---|
465 |
|
---|
466 | Main.main.undoRedo.add(new SequenceCommand(
|
---|
467 | trn("Dupe {0} node into {1} nodes", "Dupe {0} nodes into {1} nodes",
|
---|
468 | selectedNodes.size(), selectedNodes.size(), selectedNodes.size()+allNewNodes.size()), cmds));
|
---|
469 | getCurrentDataSet().setSelected(allNewNodes);
|
---|
470 | }
|
---|
471 |
|
---|
472 | @Override
|
---|
473 | protected void updateEnabledState() {
|
---|
474 | if (getCurrentDataSet() == null) {
|
---|
475 | setEnabled(false);
|
---|
476 | } else {
|
---|
477 | updateEnabledState(getCurrentDataSet().getSelected());
|
---|
478 | }
|
---|
479 | }
|
---|
480 |
|
---|
481 | @Override
|
---|
482 | protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
|
---|
483 | setEnabled(selection != null && !selection.isEmpty());
|
---|
484 | }
|
---|
485 |
|
---|
486 | protected boolean checkAndConfirmOutlyingUnglue() {
|
---|
487 | List<OsmPrimitive> primitives = new ArrayList<>(2 + (selectedNodes == null ? 0 : selectedNodes.size()));
|
---|
488 | if (selectedNodes != null)
|
---|
489 | primitives.addAll(selectedNodes);
|
---|
490 | if (selectedNode != null)
|
---|
491 | primitives.add(selectedNode);
|
---|
492 | return Command.checkAndConfirmOutlyingOperation("unglue",
|
---|
493 | tr("Unglue confirmation"),
|
---|
494 | tr("You are about to unglue nodes outside of the area you have downloaded."
|
---|
495 | + "<br>"
|
---|
496 | + "This can cause problems because other objects (that you do not see) might use them."
|
---|
497 | + "<br>"
|
---|
498 | + "Do you really want to unglue?"),
|
---|
499 | tr("You are about to unglue incomplete objects."
|
---|
500 | + "<br>"
|
---|
501 | + "This will cause problems because you don''t see the real object."
|
---|
502 | + "<br>" + "Do you really want to unglue?"),
|
---|
503 | primitives, null);
|
---|
504 | }
|
---|
505 | }
|
---|