Skip to content
Snippets Groups Projects
Commit 9e212893 authored by ics's avatar ics
Browse files

On close, save view state of launch pad only for main client.

parent abb2707c
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@
* Method getInstruments moved from UserConnection to Nomad class, since remote access inmplemented: in remote access, instruments list is needed earlier and user connection is not ready yet.
* Post area in chat: now "multilined". Remove placeholder "Send message".
* For remote clients, if remote control is disabled, display info in window title and nothing about token state.
* New login button for remote access login screen.
* On close, save view state of launch pad only for main client.
4.0.18 29/05/2020
------
......
......@@ -140,7 +140,7 @@
<dependency>
<groupId>fr.ill.ics</groupId>
<artifactId>nomadcommandsystem</artifactId>
<version>4.0.12</version>
<version>4.0.12-SNAPSHOT</version>
</dependency>
<!-- **************************************************************** JFACE ****************************************************************
......
......@@ -131,7 +131,7 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
System.out.println("================> " + VIRTUAL_HOME + " = " + System.getProperty(VIRTUAL_HOME));
virtualHomeValue = System.getProperty(VIRTUAL_HOME);
int exitCode = 0;
try {
......@@ -203,7 +203,7 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyManager.getInstance().closePlots();
}
ServerConnection.getInstance(CommandZoneWrapper.SERVER_ID).reset();
System.out.println("Resetting Cameo application");
......@@ -237,9 +237,9 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
public void init() {
ConfigManager.initInstance(virtualHomeValue);
// Create logs directory if it doesn't exist
File logsDirectory = new File(ConfigManager.getInstance().getString("logsDirectory"));
if (!logsDirectory.exists()) {
......@@ -427,9 +427,9 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
public void close() {
stopNomadLogs();
SpyManager.getInstance().saveUserSpies();
CommandLine.getInstance(CommandZoneWrapper.SERVER_ID).saveCommandHistory();
......@@ -438,13 +438,13 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
SpyManager.getInstance().hideCommandLineSpy();
SpyManager.getInstance().savePreferences();
String property = ConfigManager.LAUNCH_PAD_TEXT_MODE + "=" + String.valueOf(CommandWindow.getInstance().getServerTabButton().getCommandWorkspace().isInTextMode());
ResourceManager.getInstance().saveFile(ConfigManager.GLOBAL_PREFERENCES_FILE, property, ResourceManager.PROPERTIES_FILE, true);
ConfigManager.getInstance().savePreference(ConfigManager.MAGNIFY_FACTOR_INDEX, Magnifier.getScaleIndex() + "");
if (ConfigManager.getInstance().isRemoteClient()) {
if (ConfigManager.getInstance().isMainClient()) {
String property = ConfigManager.LAUNCH_PAD_TEXT_MODE + "=" + String.valueOf(CommandWindow.getInstance().getServerTabButton().getCommandWorkspace().isInTextMode());
ResourceManager.getInstance().saveFile(ConfigManager.GLOBAL_PREFERENCES_FILE, property, ResourceManager.PROPERTIES_FILE, true);
} else {
ConfigManager.getInstance().savePreference(ConfigManager.REMOTE_USER_NAME, UserConnection.getInstance().getUserName());
ConfigManager.getInstance().savePreference(ConfigManager.REMOTE_INSTRUMENT, RemoteControlManager.getInstance().getInstrumentName());
}
......@@ -735,12 +735,12 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
public void startNomadLogs() {
if (UserConnection.getInstance().getCredentials() == null) {
DialogManager.getInstance().nomadMessageDialog("mustLogInToViewLogsMessage", "viewLogsTitle");
return;
}
System.out.println("Starting NomadLogs with Cameo");
if (cameoServer == null) {
String serverLocation = ConfigManager.getInstance().getServerEndpoint();
......@@ -754,7 +754,7 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
long proposNo = ExperimentData.getInstance().getProposalId();
// npm start -- -proposal 94/2018/0 -width 231 -height 987
String prodArgument = "";
int mode = UserConnection.MODE_FULL_TEST;
try {
......@@ -762,17 +762,17 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
} catch (Exception e) {
mode = UserConnection.MODE_FULL_TEST;
}
if (mode == UserConnection.MODE_REAL) {
prodArgument = "-prod";
}
// String authentication = Nomad.base64Encode("ics" + ":" + "icsics");
// String authentication = Nomad.base64Encode("ics" + ":" + "icsics");
String authentication = UserConnection.getInstance().getCredentials();
String[] args = new String[] {prodArgument, "-auth", authentication, "-proposal", instrumentId + "/" + year+ "/" + proposNo, "-width " + MainWindowPeer.getInstance().getWidth(), "-height " + MainWindowPeer.getInstance().getHeight()};
for (String arg: args) {
System.out.println("arg " + arg);
}
......@@ -852,7 +852,7 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
}
@Override
public void serverEnded(ServerEndedEvent event) {
MainWindowPeer.getInstance().addAsyncRunnable(new Runnable() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment