Skip to content
Permalink
Browse files

remove cancel session notification

matches Loconet throttle steal
  • Loading branch information...
icklesteve committed May 17, 2019
1 parent dddd005 commit 1bcaff07bc94c6f2725e1a53fbcd900f99371b54
Showing with 3 additions and 16 deletions.
  1. +3 −16 java/src/jmri/jmrix/can/cbus/CbusThrottleManager.java
@@ -34,7 +34,6 @@
private int _intAddr;
private DccLocoAddress _dccAddr;
private CanSystemConnectionMemo _memo;
private boolean _hideStealNotifications;

private HashMap<Integer, CbusThrottle> softThrottles = new HashMap<Integer, CbusThrottle>(CbusConstants.CBUS_MAX_SLOTS);

@@ -380,23 +379,11 @@ else if ( share ){
while (itr.hasNext()) {
CbusThrottle throttle = softThrottles.get(itr.next());
if (throttle.getHandle() == handle) {
log.info("JMRI Throttle Session {} Cancelled for loco {}",
handle, throttle.getLocoAddress() );

log.warn("CBUS Throttle Steal / Cancel for loco {} Session {} ",
throttle.getLocoAddress(), handle );
throttle.throttleDispose();
forceDisposeThrottle( throttle.getLocoAddress() );

if (!java.awt.GraphicsEnvironment.isHeadless() && !_hideStealNotifications ){
jmri.util.ThreadingUtil.runOnGUI(() -> {
javax.swing.JCheckBox checkbox = new javax.swing.JCheckBox(
Bundle.getMessage("PopupSessionConfirm"));
Object[] params = {Bundle.getMessage("ERR_SESSION_CANCELLED",handle), checkbox};
JOptionPane.showMessageDialog(
null, params,
Bundle.getMessage("SessionCancelled", throttle.getLocoAddress()),
JOptionPane.WARNING_MESSAGE);
_hideStealNotifications = checkbox.isSelected();
});
}
break;
}
}

0 comments on commit 1bcaff0

Please sign in to comment.
You can’t perform that action at this time.