Skip to content
Snippets Groups Projects
Commit 071addd0 authored by helene ortiz's avatar helene ortiz
Browse files

Improvement: When "view logs" menu displays the message "you must log in

to view logs!", automatically open the login popup.
parent 38469f22
No related branches found
No related tags found
No related merge requests found
4.0.61 dd/mm/2020
------
* Improvement: When "view logs" menu displays the message "you must log in to view logs!", automatically open the login popup.
4.0.60 26/08/2020
------
* Prompt in command line was not hidden when another client starts a command.
......
......@@ -2,7 +2,7 @@ commandLineLabel=Command :
loginLabel=LOGIN
passwordLabel=PASSWORD
loadingLabel=LOADING
selectProposalLabel=Select proposal
loginButtonLabel=Login
exitButtonLabel=Exit
loginLabelKey=User
......
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.ill.ics</groupId>
<artifactId>nomadgui</artifactId>
<version>4.0.60</version>
<version>4.0.61-SNAPSHOT</version>
<name>NomadGUI</name>
<description>Graphical user interface for Nomad</description>
<scm>
......
......@@ -717,6 +717,7 @@ public class MainWindow implements ServerConfigurationChangeListener, ServerEnde
if (credentials == null) {
DialogManager.getInstance().nomadMessageDialog("mustLogInToViewLogsMessage", "viewLogsTitle");
MainWindowPeer.getInstance().getAuthenticationPeer().onLinkClick(0, 0);
return;
}
......
......@@ -66,9 +66,9 @@ public class SWTLoginPopup extends SWTAuthenticationPopup {
private GridData loginGridData;
private Label passwordLabel;
private GridData passwordGridData;
private Button selectProposalButton;
private Button loginButton;
private Button cancelButton;
private GridData selectProposalGridData;
private GridData loginButtonGridData;
private GridData cancelButtonGridData;
public SWTLoginPopup(AuthenticationPeer authenticationPeer, boolean addLogoutButton) {
......@@ -121,15 +121,15 @@ public class SWTLoginPopup extends SWTAuthenticationPopup {
passwordGridData.widthHint = LOGIN_WIDTH;
password.setLayoutData(gridData);
selectProposalButton = SWTWidgetFactory.getInstance().createPushButton(buttonsComposite, "selectProposalLabel");
selectProposalButton.addSelectionListener(new SelectionAdapter() {
loginButton = SWTWidgetFactory.getInstance().createPushButton(buttonsComposite, "loginButtonLabel");
loginButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
onCanvasClick(LOGIN_ID+"");
}
});
selectProposalGridData = SWTWidgetFactory.getInstance().getGridData();
selectProposalGridData.widthHint = Magnifier.getScaledValue(BUTTON_WIDTH);
selectProposalButton.setLayoutData(selectProposalGridData);
loginButtonGridData = SWTWidgetFactory.getInstance().getGridData();
loginButtonGridData.widthHint = Magnifier.getScaledValue(BUTTON_WIDTH);
loginButton.setLayoutData(loginButtonGridData);
cancelButton = SWTWidgetFactory.getInstance().createPushButton(buttonsComposite, "cancelButtonLabel");
cancelButton.addSelectionListener(new SelectionAdapter() {
......@@ -189,7 +189,7 @@ public class SWTLoginPopup extends SWTAuthenticationPopup {
}
protected int onSelectProposalClick(String user, String password) {
protected int onLoginButtonClick(String user, String password) {
if (user.trim().length() == 0) {
loginErrorDescriptor = new LoginErrorDescriptor("enterLoginMessageKey", USER_FIELD);
......@@ -235,19 +235,13 @@ public class SWTLoginPopup extends SWTAuthenticationPopup {
protected void onButtonClick(int buttonId) {
switch (buttonId) {
case LOGIN_ID:
int ok = onSelectProposalClick(getLoginText(), getPasswordText());
int ok = onLoginButtonClick(getLoginText(), getPasswordText());
if (ok == SUCCESS_CODE) {
onLoginOk();
} else {
onLoginError(ok);
}
break;
/*
case SELECT_ID:
authenticationPeer.setSelectedProposal(selectedProposalNumber);
close();
break;
*/
}
}
......@@ -334,11 +328,11 @@ public class SWTLoginPopup extends SWTAuthenticationPopup {
SWTMagnifier.getInstance().magnifyControl(login);
SWTMagnifier.getInstance().magnifyControl(passwordLabel);
SWTMagnifier.getInstance().magnifyControl(password);
SWTMagnifier.getInstance().magnifyControl(selectProposalButton);
SWTMagnifier.getInstance().magnifyControl(loginButton);
SWTMagnifier.getInstance().magnifyControl(cancelButton);
loginGridData.widthHint = Magnifier.getScaledValue(LOGIN_WIDTH);
passwordGridData.widthHint = Magnifier.getScaledValue(LOGIN_WIDTH);
selectProposalGridData.widthHint = Magnifier.getScaledValue(BUTTON_WIDTH);
loginButtonGridData.widthHint = Magnifier.getScaledValue(BUTTON_WIDTH);
cancelButtonGridData.widthHint = Magnifier.getScaledValue(BUTTON_WIDTH);
dialog.layout(true, true);
}
......
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