Commit c1cf8cb4 authored by helene ortiz's avatar helene ortiz
Browse files

Fix bug: delete of an unknown command box in the launch pad did not

delete it on server side.
parent 5a08aa5c
......@@ -4,6 +4,7 @@
* Add 2 preference values to restore main window x and y.
* Fix bug: PAL and XBU files were not read properly.
* Fix bug: when synchronizing view state of launchpad (among box view or text view), also synchronize swithview button icon.
* Fix bug: delete of an unknown command box in the launch pad did not delete it on server side.
4.0.60 26/08/2020
------
......
......@@ -456,24 +456,18 @@ public class ServerCommandZone extends CommandZone implements ServerCommandState
*/
public void delete(CommandBox commandBox) {
if (commandBox instanceof UnknownCommandBox) {
// H.ORTIZ 22 AUG 2016: No need to delete stuff from an unknown command box in the server part, code from super class is sufficient
super.delete(commandBox);
} else {
IServerCommand serverCommandToDelete = ((IServerCommandBox)commandBox).getServerCommand();
IServerCommand serverCommandToDelete = ((IServerCommandBox)commandBox).getServerCommand();
// detach from command in server before delete
((IServerCommandBox)commandBox).detach();
// detach from command in server before delete
((IServerCommandBox)commandBox).detach();
if (CommandZoneWrapper.getInstance(serverId).deleteCommand(serverCommandToDelete)) {
super.delete(commandBox);
if (CommandZoneWrapper.getInstance(serverId).deleteCommand(serverCommandToDelete)) {
super.delete(commandBox);
} else {
// re-attach if delete failed
((IServerCommandBox)commandBox).attach();
MainWindowPeer.getInstance().displayAccessDeniedDialog();
}
} else {
// re-attach if delete failed
((IServerCommandBox)commandBox).attach();
MainWindowPeer.getInstance().displayAccessDeniedDialog();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment