Commit f7f05a56 authored by Hélène Ortiz's avatar Hélène Ortiz

Move save of file /tmp/nomad/session.properties from MainWindow to

Startup (in MainWindow it is too early...)
parent c46abcad
4.0.44 07/07/2020
------
* Fix bug: when switching to commandline at start (if previous state was commandline), buttons from commandbar were not updated.
* Move save of file /tmp/nomad/session.properties from MainWindow to Startup (in MainWindow it is too early...)
4.0.43 06/07/2020
------
......
......@@ -63,8 +63,6 @@ import fr.ill.ics.client.view.util.listener.INewCountRepeaterFileListener;
import fr.ill.ics.client.view.util.listener.INewSlicesFileListener;
import fr.ill.ics.common.Nomad;
import fr.ill.ics.nscclient.serverconnection.ServerConnection;
import fr.ill.ics.nscclient.serverconnection.ServerInstance;
import fr.ill.ics.nscclient.sessionmanagement.SessionManager;
import fr.ill.ics.util.ConfigManager;
import fr.ill.ics.util.ServerException;
import fr.ill.ics.util.exception.CommandNotFoundException;
......@@ -237,18 +235,6 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
ConfigManager.initInstance(virtualHomeValue);
if (ConfigManager.getInstance().isRemoteClient()) {
try {
File file = new File(ConfigManager.NOMADENDPOINT_DIRECTORY);
file.mkdir();
BufferedWriter writer = Nomad.initFile(ConfigManager.NOMADENDPOINT_DIRECTORY + ConfigManager.FILE_SEPARATOR + ConfigManager.NOMADENDPOINT_FILE);
Nomad.printToFile(writer, "nomadServerEndpoint=" + ServerInstance.getInstance().getNomadServerEndpoint());
Nomad.closeFile(writer);
} catch (IOException e) {
e.printStackTrace();
}
}
// Create logs directory if it doesn't exist
File logsDirectory = new File(ConfigManager.getInstance().getString("logsDirectory"));
if (!logsDirectory.exists()) {
......
......@@ -18,6 +18,10 @@
package fr.ill.ics.client.control.startup;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import fr.ill.ics.bridge.LoginManager;
import fr.ill.ics.bridge.command.CommandZoneWrapper;
import fr.ill.ics.cameo.Application;
......@@ -34,6 +38,7 @@ import fr.ill.ics.client.view.MainWindowPeer;
import fr.ill.ics.client.view.factory.WidgetFactory;
import fr.ill.ics.client.view.startup.StartupSplashDialog;
import fr.ill.ics.client.view.util.dialog.DialogManager;
import fr.ill.ics.common.Nomad;
import fr.ill.ics.core.property.PropertyManager;
import fr.ill.ics.nscclient.serverconnection.ServerInstance;
import fr.ill.ics.nscclient.sessionmanagement.SessionManager;
......@@ -78,6 +83,20 @@ public class Startup {
String[] cameoArgs = {ConfigManager.getInstance().getServerEndpoint() + ":nomadgui"};
Application.This.init(cameoArgs);
ServerInstance.getInstance().init();
if (ConfigManager.getInstance().isRemoteClient()) {
// Save nomadendpoint in local file (for NomadMail)
try {
File file = new File(ConfigManager.NOMADENDPOINT_DIRECTORY);
file.mkdir();
BufferedWriter writer = Nomad.initFile(ConfigManager.NOMADENDPOINT_DIRECTORY + ConfigManager.FILE_SEPARATOR + ConfigManager.NOMADENDPOINT_FILE);
Nomad.printToFile(writer, "nomadServerEndpoint=" + ServerInstance.getInstance().getNomadServerEndpoint());
Nomad.closeFile(writer);
} catch (IOException e) {
e.printStackTrace();
}
}
// Initialise the information message
informationKey = "clientConnectedToServerMessage";
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment