git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2361 make a modified saved scheme the backout checkpoint for Cancel
[jalview.git]
/
src
/
jalview
/
gui
/
UserDefinedColours.java
diff --git
a/src/jalview/gui/UserDefinedColours.java
b/src/jalview/gui/UserDefinedColours.java
index
369dde6
..
0187aa3
100755
(executable)
--- a/
src/jalview/gui/UserDefinedColours.java
+++ b/
src/jalview/gui/UserDefinedColours.java
@@
-685,16
+685,18
@@
public class UserDefinedColours extends GUserDefinedColours implements
if (value == JalviewFileChooser.APPROVE_OPTION)
{
File file = chooser.getSelectedFile();
if (value == JalviewFileChooser.APPROVE_OPTION)
{
File file = chooser.getSelectedFile();
- addNewColourScheme(file.getPath());
+ UserColourScheme updatedScheme = addNewColourScheme(file.getPath());
saveToFile(file);
/*
* changes saved - apply to alignment if we are changing
saveToFile(file);
/*
* changes saved - apply to alignment if we are changing
- * the currently selected colour scheme
+ * the currently selected colour scheme; also make the updated
+ * colours the 'backout' scheme on Cancel
*/
if (oldColourScheme != null
&& name.equals(oldColourScheme.getSchemeName()))
{
*/
if (oldColourScheme != null
&& name.equals(oldColourScheme.getSchemeName()))
{
+ oldColourScheme = updatedScheme;
applyButton_actionPerformed();
}
}
applyButton_actionPerformed();
}
}
@@
-707,8
+709,9
@@
public class UserDefinedColours extends GUserDefinedColours implements
* the colour scheme.
*
* @param filePath
* the colour scheme.
*
* @param filePath
+ * @return
*/
*/
- protected void addNewColourScheme(String filePath)
+ protected UserColourScheme addNewColourScheme(String filePath)
{
/*
* update the delimited list of user defined colour files in
{
/*
* update the delimited list of user defined colour files in
@@
-739,6
+742,8
@@
public class UserDefinedColours extends GUserDefinedColours implements
{
ap.alignFrame.buildColourMenu();
}
{
ap.alignFrame.buildColourMenu();
}
+
+ return ucs;
}
/**
}
/**