Skip to content
Snippets Groups Projects
Commit f5275237 authored by helene ortiz's avatar helene ortiz
Browse files

Fix bug: users do not need to have the token to add/modify/delete

command boxes in simulation tabs.
parent edbf334c
No related branches found
No related tags found
No related merge requests found
4.0.57 14/08/2020
------
* Fix bug: users do not need to have the token to add/modify/delete command boxes in simulation tabs.
4.0.56 13/08/2020
------
* Fix bug: a dnd of a scan containing a settings command box makes other clients crash.
......
......@@ -188,6 +188,7 @@ public abstract class AbstractCommandZone {
}
// This method returns false for editors, and true for launch pad AND simulated tabs.
public boolean isServerCommandZone() {
return false;
}
......
......@@ -1343,8 +1343,7 @@ public abstract class ModifiableCommandZone extends AbstractCommandZone {
public boolean drop(SelectionTreeData selectionTreeData, boolean ctrlActive) {
boolean goOn = true;
if (CommandWindow.getInstance().getCurrentCommandZone().isServerCommandZone()) {
if (CommandWindow.getInstance().getCurrentCommandWorkspace().isServerTab()) {
if (!TokenManager.getInstance().tokenIsOwnedByMe()) {
DialogManager.getInstance().nomadMessageDialog("cannotModifyLaunchPadWithoutTokenMessage", "addToLaunchPadMessage");
goOn = false;
......
......@@ -32,7 +32,7 @@ public class CutCommandAction implements IMenuAction {
* Called when a click on the menu item "Cut command" occurs (or when CTRL X is pressed).
*/
public void execute(boolean checked, int x, int y) {
if (CommandWindow.getInstance().getCurrentCommandZone().isServerCommandZone() && !TokenManager.getInstance().tokenIsOwnedByMe()) {
if (CommandWindow.getInstance().getCurrentCommandWorkspace().isServerTab() && !TokenManager.getInstance().tokenIsOwnedByMe()) {
} else {
CommandWindow.getInstance().onCtrlX();
}
......
......@@ -33,7 +33,7 @@ public class EraseEditorAction implements IMenuAction {
* Called when a click on the menu item "Erase editor" occurs (or when CTRL E is pressed).
*/
public void execute(boolean checked, int x, int y) {
if (CommandWindow.getInstance().getCurrentCommandZone().isServerCommandZone() && !TokenManager.getInstance().tokenIsOwnedByMe()) {
if (CommandWindow.getInstance().getCurrentCommandWorkspace().isServerTab() && !TokenManager.getInstance().tokenIsOwnedByMe()) {
} else {
MainWindowPeer.getInstance().setCursorToWait();
MainWindowPeer.setRefresh(false);
......
......@@ -94,7 +94,7 @@ public abstract class SelectionTree {
boolean goOn = true;
if (CommandWindow.getInstance().getCurrentCommandZone().isServerCommandZone()) {
if (CommandWindow.getInstance().getCurrentCommandWorkspace().isServerTab()) {
if (!TokenManager.getInstance().tokenIsOwnedByMe()) {
DialogManager.getInstance().nomadMessageDialog("cannotModifyLaunchPadWithoutTokenMessage", "addToLaunchPadMessage");
goOn = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment