This is an automated email from the git hooks/post-receive script. New commit to branch feature/7592_menu_contextuel_reouvrir_tjs_actif in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit cf623ca76f2c57fc0d9927102e4b1ed2a365d709 Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Fri Aug 5 16:07:34 2016 +0200 Fix re-open option state for routes and activities nodes when a trip is closed, the reopen optio for routes and activities should be disabled refs #7592 --- .../ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java index fa365b3..4f23247 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/tree/ObserveNavigationTreeShowPopupAction.java @@ -24,6 +24,7 @@ package fr.ird.observe.ui.tree; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; +import fr.ird.observe.ObserveOpenDataManager; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.db.DataContext; import fr.ird.observe.db.ObserveSwingDataSource; @@ -253,6 +254,7 @@ public class ObserveNavigationTreeShowPopupAction { ObserveSwingApplicationContext applicationContext = ObserveSwingApplicationContext.get(); DataContext dataContext = applicationContext.getDataContext(); ContentUI<?> selectedContentUI = applicationContext.getSelectedContentUI(); + ObserveOpenDataManager openDataManager = applicationContext.getOpenDataManager(); boolean closeActionEnabled = false; @@ -272,21 +274,21 @@ public class ObserveNavigationTreeShowPopupAction { beforeOpenMenu(selectedNode, ROUTE_MENU_ITEMS); - openAction.setEnabled(!dataContext.isOpenRoute()); + openAction.setEnabled(openDataManager.canOpenRoute(dataContext.getSelectedTripSeineId())); closeAction.setEnabled(closeActionEnabled); } else if (selectedNode.isActivitySeineNode()) { beforeOpenMenu(selectedNode, ACTIVITY_SEINE_MENU_ITEMS); - openAction.setEnabled(!dataContext.isOpenActivitySeine()); + openAction.setEnabled(openDataManager.canOpenActivitySeine(dataContext.getSelectedRouteId())); closeAction.setEnabled(closeActionEnabled); } else if (selectedNode.isActivityLonglineNode()) { beforeOpenMenu(selectedNode, ACTIVITY_LONGLINE_MENU_ITEMS); - openAction.setEnabled(!dataContext.isOpenActivityLongline()); + openAction.setEnabled(openDataManager.canOpenActivityLongline(dataContext.getSelectedTripLonglineId())); closeAction.setEnabled(closeActionEnabled); } else { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.