Commit 69422157 authored by Jerome Locatelli's avatar Jerome Locatelli
Browse files
parents e960a6e7 56eb6efa
......@@ -2,7 +2,10 @@
------
* Migration to cameo v2
* Re-structurated configuration files of nomad
* Add a method isProd() in Nomad class.
* Move method writeToClipboard() in Nomad class.
* Improve dynamic interface motor for checkbox widget: take font size and style into account.
* Add properties and icon for 3d parameters.
4.0.135 04/03/2022
-------
......
......@@ -351,7 +351,9 @@ noMeetingURLFoundMessage=Unable to find any meeting for current proposal!
meetingURLCopiedInClipboardMessage=URL to join proposal's meeting is ready to be pasted in VISA clipboard.
noMeetingForInternalUseMessage=Meeting not available for internal use.
errorWhileOpeningMeetingURLMessage=Nomad failed opening web browser.\nHowever URL to join proposal's meeting has been copied to the clipboard,\nopen a web browser and paste it.
errorWhileOpeningNomad3dURLMessage=Nomad failed opening web browser.\nHowever Nomad3d viewer's URL has been copied to the clipboard,\nopen a web browser and paste it.
mustLogInToJoinMeetingMessage=You must log in to join meeting room.
nomad3dToolTip=Open Nomad3D viewer
serverEndedOnErrorMessage=An error occurred, the server is no longer running.\nThe client is going to be shutdown.
......
......@@ -37,6 +37,7 @@ menu.view.multiplot=&Multiplot window
menu.view.imageViewer=Image &viewer
menu.view.configurationErrors=Configuration errors
menu.view.logger=Logger tool
menu.view.nomad3d=3D viewer
menu.command.newEditor=&New Editor
menu.command.saveEditor=&Save Editor
......
3D=3d
ACQUISITION=count
ACQUISITION_SETUP=deltaE
ALARM_CTRL=alarm
......@@ -99,4 +100,4 @@ VOLTAGE=meter
WAIT=wait
WARNING_CTRL=warning
WAVELENGTH=lambda
WEATHER=weather
\ No newline at end of file
WEATHER=weather
......@@ -50,7 +50,6 @@ import fr.ill.ics.client.control.command.commandline.CommandLine;
import fr.ill.ics.client.control.command.navigation.button.TabButton;
import fr.ill.ics.client.control.experiment.ExperimentData;
import fr.ill.ics.client.control.login.Authentication;
import fr.ill.ics.client.control.login.UserConnection;
import fr.ill.ics.client.control.plot.PlotyManager;
import fr.ill.ics.client.control.plugin.selection.CommandsSelectionPlugin;
import fr.ill.ics.client.control.plugin.selection.HardwareSelectionPlugin;
......@@ -704,14 +703,7 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
// npm start -- -proposal 94/2018/0 -width 231 -height 987
String prodArgument = "";
int mode = UserConnection.MODE_FULL_TEST;
try {
mode = Integer.valueOf(ConfigManager.getInstance().getStringOrNothingAtAll(UserConnection.NOMAD_SENDDATA));
} catch (Exception e) {
mode = UserConnection.MODE_FULL_TEST;
}
if (mode == UserConnection.MODE_REAL) {
if (Nomad.isProd()) {
prodArgument = "-prod";
}
......@@ -867,14 +859,7 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
if (cameoServer != null) {
long instrumentId = ExperimentData.getInstance().getInstrumentId();
String prodArgument = "";
int mode = UserConnection.MODE_FULL_TEST;
try {
mode = Integer.valueOf(ConfigManager.getInstance().getStringOrNothingAtAll(UserConnection.NOMAD_SENDDATA));
} catch (Exception e) {
mode = UserConnection.MODE_FULL_TEST;
}
if (mode == UserConnection.MODE_REAL) {
if (Nomad.isProd()) {
prodArgument = "-prod";
}
......
......@@ -637,7 +637,7 @@ public class SWTPWidgetFactory extends PWidgetFactory {
}
Composite composite = getParentComposite(parent, nElements, widgetDescriptor.isInTableComposite());
Button check = SWTWidgetFactory.getInstance().createCheck(composite, ConfigManager.getInstance().getString(widgetDescriptor.getPrefix()));
Button check = SWTWidgetFactory.getInstance().createCheck(composite, widgetDescriptor);
if (widgetDescriptor.isInTableComposite()) {
composite.setLayoutData(SWTWidgetFactory.getInstance().getHorizontallyAlignedGridData((GridData) composite.getLayoutData(), widgetDescriptor.getHorizontalAlignment()));
......
......@@ -1182,6 +1182,18 @@ public class SWTWidgetFactory extends WidgetFactory {
}
/**
* Creates a check button widget from a WidgetDescriptor instance (Caution ! Initialization must be done outside)
*
* @param parentComposite parent composite
* @param initialValue initial value for the text associated with the check button widget
* @return a check button widget
*/
public Button createCheck(Composite parentComposite, WidgetDescriptor widgetDescriptor) {
return createButton(parentComposite, ConfigManager.getInstance().getString(widgetDescriptor.getPrefix()), SWT.CHECK, widgetDescriptor.getFontSize(), widgetDescriptor.getFontStyle());
}
/**
* Creates a radio button widget
*
......
......@@ -17,10 +17,6 @@
*/
package fr.ill.ics.client.view.token;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.io.IOException;
import fr.ill.ics.bridge.events.ChatEvent;
......@@ -37,6 +33,7 @@ import fr.ill.ics.client.view.chat.Chat;
import fr.ill.ics.client.view.factory.ImageFactory;
import fr.ill.ics.client.view.users.ConnectedUsers;
import fr.ill.ics.client.view.util.dialog.DialogManager;
import fr.ill.ics.common.Nomad;
import fr.ill.ics.nscclient.notification.DataNotificationClient;
import fr.ill.ics.util.ConfigManager;
......@@ -187,14 +184,14 @@ public abstract class TokenWidget implements ChatEventListener {
if (MainWindow.getInstance().visa()) {
meetingURL = meetingURL.replaceFirst("https", "visa");
writeToClipboard(meetingURL);
Nomad.writeToClipboard(meetingURL);
} else {
try {
Runtime.getRuntime().exec("/usr/bin/chromium --profile-directory=Default --app-id=ibiognfelmneebngbnbeonnllapmffmb --app=" + meetingURL);
} catch (IOException e) {
DialogManager.getInstance().nomadMessageDialog("errorWhileOpeningMeetingURLMessage", "videoImageToolTip");
e.printStackTrace();
writeToClipboard(meetingURL);
Nomad.writeToClipboard(meetingURL);
}
}
} else {
......@@ -202,13 +199,6 @@ public abstract class TokenWidget implements ChatEventListener {
}
}
}
private void writeToClipboard(String string) {
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable transferable = new StringSelection(string);
clipboard.setContents(transferable, null);
}
public abstract void onChatClick();
......
......@@ -18,6 +18,10 @@
package fr.ill.ics.common;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
......@@ -1340,5 +1344,21 @@ public abstract class Nomad {
String controllerType = Nomad.getControllerType(controllerName);
return ScannableProperties.getInstance().getShortPropertyName(controllerType, setPoint);
}
public static void writeToClipboard(String string) {
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable transferable = new StringSelection(string);
clipboard.setContents(transferable, null);
}
public static boolean isProd() {
int mode = UserConnection.MODE_FULL_TEST;
try {
mode = Integer.valueOf(ConfigManager.getInstance().getStringOrNothingAtAll(UserConnection.NOMAD_SENDDATA));
} catch (Exception e) {
mode = UserConnection.MODE_FULL_TEST;
}
return (mode == UserConnection.MODE_REAL);
}
}
\ No newline at end of file
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