Skip to content

Commit

Permalink
Make key name changes revertable
Browse files Browse the repository at this point in the history
  • Loading branch information
RoanH committed Feb 5, 2019
1 parent 3877230 commit 9acd59a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions KeysPerSecond/src/me/roan/kps/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -1472,8 +1472,10 @@ private static final void createListItem(Positionable info, JPanel fields, JPane
protected static final void configureKeys(){
List<KeyInformation> copy = new ArrayList<KeyInformation>(config.keyinfo);
boolean[] visibleState = new boolean[copy.size()];
String[] nameState = new String[copy.size()];
for(int i = 0; i < copy.size(); i++){
visibleState[i] = copy.get(i).visible;
nameState[i] = copy.get(i).name;
}

JPanel keyform = new JPanel(new BorderLayout());
Expand Down Expand Up @@ -1644,6 +1646,7 @@ public void setValueAt(Object value, int row, int col){
if(!showOptionDialog(keyform, true)){
for(int i = 0; i < copy.size(); i++){
copy.get(i).visible = visibleState[i];
copy.get(i).setName(nameState[i]);
}
config.keyinfo = copy;
}
Expand Down

0 comments on commit 9acd59a

Please sign in to comment.