Skip to content

Commit

Permalink
Make SPROG Slot monitor action connection dependent
Browse files Browse the repository at this point in the history
  • Loading branch information
crosland committed Apr 8, 2021
1 parent a445c30 commit fcf0b5b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 81 deletions.
6 changes: 6 additions & 0 deletions java/src/jmri/jmrix/sprog/SprogActionListBundle.properties
@@ -0,0 +1,6 @@
# SprogActionListBundle.properties
#
# Properties listing names for "Action" classes that can appear
# in various forms in advanced SPROG preferences

jmri.jmrix.sprog.sprogslotmon.SprogSlotMonAction = Open SPROG Slot Monitor
3 changes: 0 additions & 3 deletions java/src/jmri/jmrix/sprog/SprogBundle.properties
Expand Up @@ -106,6 +106,3 @@ SprogSimOption = Operate as

# SprogTurnout (Add to table pane) item (no inputs)
AddOutputEntryToolTip = enter a number from 1 to 2044 (inclusive).

# Startup actions
StartSlotMonAction = Start SPROG Slot Monitor
3 changes: 1 addition & 2 deletions java/src/jmri/jmrix/sprog/SprogSystemConnectionMemo.java
Expand Up @@ -267,8 +267,7 @@ public TurnoutManager getTurnoutManager() {

@Override
protected ResourceBundle getActionModelResourceBundle() {
//No actions that can be loaded at startup
return null;
return ResourceBundle.getBundle("jmri.jmrix.sprog.SprogActionListBundle");
}

@Override
Expand Down
12 changes: 1 addition & 11 deletions java/src/jmri/jmrix/sprog/sprogslotmon/SprogSlotMonAction.java
Expand Up @@ -7,9 +7,6 @@
import jmri.InstanceManager;
import jmri.jmrix.sprog.SprogSystemConnectionMemo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Swing action to create and register a SprogSlotMonFrame object.
*
Expand Down Expand Up @@ -37,20 +34,13 @@ public SprogSlotMonAction() {
@Override
public void actionPerformed(ActionEvent e) {

if (_memo != null) {
if (_memo.getCommandStation() == null) {
if(_memo.getCommandStation() == null) {
// create SlotManager if it doesn't exist
_memo.configureCommandStation(_memo.getNumSlots());
}

SprogSlotMonFrame f = new SprogSlotMonFrame(_memo);
f.setVisible(true);
} else {
log.warn("Trying to start SPROG Slot monitor for incompatible connection type");
}
}

// initialize logging
private final static Logger log = LoggerFactory.getLogger(SprogSlotMonAction.class);

}

This file was deleted.

This file was deleted.

0 comments on commit fcf0b5b

Please sign in to comment.