mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 08:45:44 +02:00
[179937] Add the encoding to the Get from remote system string in the property page to show the encoding that was obtained.
This commit is contained in:
parent
6dce90afc5
commit
9cacea7c6d
3 changed files with 41 additions and 10 deletions
|
@ -1229,6 +1229,7 @@ public class SystemResources extends NLS
|
||||||
public static String RESID_HOST_ENCODING_SETTING_NOTE;
|
public static String RESID_HOST_ENCODING_SETTING_NOTE;
|
||||||
public static String RESID_HOST_ENCODING_SETTING_MSG;
|
public static String RESID_HOST_ENCODING_SETTING_MSG;
|
||||||
public static String RESID_HOST_ENCODING_REMOTE_LABEL;
|
public static String RESID_HOST_ENCODING_REMOTE_LABEL;
|
||||||
|
public static String RESID_HOST_ENCODING_REMOTE_ENCODING_LABEL;
|
||||||
public static String RESID_HOST_ENCODING_REMOTE_TOOLTIP;
|
public static String RESID_HOST_ENCODING_REMOTE_TOOLTIP;
|
||||||
public static String RESID_HOST_ENCODING_OTHER_LABEL;
|
public static String RESID_HOST_ENCODING_OTHER_LABEL;
|
||||||
public static String RESID_HOST_ENCODING_OTHER_TOOLTIP;
|
public static String RESID_HOST_ENCODING_OTHER_TOOLTIP;
|
||||||
|
|
|
@ -1425,6 +1425,7 @@ RESID_HOST_ENCODING_GROUP_LABEL=Default encoding
|
||||||
RESID_HOST_ENCODING_SETTING_NOTE=Note:
|
RESID_HOST_ENCODING_SETTING_NOTE=Note:
|
||||||
RESID_HOST_ENCODING_SETTING_MSG=This setting can only be changed when no subsystem is connected
|
RESID_HOST_ENCODING_SETTING_MSG=This setting can only be changed when no subsystem is connected
|
||||||
RESID_HOST_ENCODING_REMOTE_LABEL=Default from remote system
|
RESID_HOST_ENCODING_REMOTE_LABEL=Default from remote system
|
||||||
|
RESID_HOST_ENCODING_REMOTE_ENCODING_LABEL=Default from remote system (%1)
|
||||||
RESID_HOST_ENCODING_REMOTE_TOOLTIP=The default encoding of the platform obtained from the remote system
|
RESID_HOST_ENCODING_REMOTE_TOOLTIP=The default encoding of the platform obtained from the remote system
|
||||||
RESID_HOST_ENCODING_OTHER_LABEL=Other:
|
RESID_HOST_ENCODING_OTHER_LABEL=Other:
|
||||||
RESID_HOST_ENCODING_OTHER_TOOLTIP=Specify a different encoding
|
RESID_HOST_ENCODING_OTHER_TOOLTIP=Specify a different encoding
|
||||||
|
|
|
@ -827,13 +827,6 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
|
||||||
data.grabExcessVerticalSpace = false;
|
data.grabExcessVerticalSpace = false;
|
||||||
encodingGroup.setLayoutData(data);
|
encodingGroup.setLayoutData(data);
|
||||||
|
|
||||||
SelectionAdapter buttonSelectionListener = new SelectionAdapter() {
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
|
||||||
updateEncodingGroupState(remoteEncodingButton.getSelection());
|
|
||||||
validateEncoding();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Composite messageComposite = new Composite(encodingGroup, SWT.NONE);
|
Composite messageComposite = new Composite(encodingGroup, SWT.NONE);
|
||||||
GridLayout messageLayout = new GridLayout();
|
GridLayout messageLayout = new GridLayout();
|
||||||
messageLayout.numColumns = 2;
|
messageLayout.numColumns = 2;
|
||||||
|
@ -862,12 +855,38 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
|
||||||
// remote encoding field
|
// remote encoding field
|
||||||
String defaultEncodingLabel = SystemResources.RESID_HOST_ENCODING_REMOTE_LABEL;
|
String defaultEncodingLabel = SystemResources.RESID_HOST_ENCODING_REMOTE_LABEL;
|
||||||
|
|
||||||
|
// check if user set encoding
|
||||||
|
// if so, we leave default encoding label as is
|
||||||
|
// if not, we check if remote encoding is set, and if it is, include the encoding in the label
|
||||||
|
if (conn.getDefaultEncoding(false) == null) {
|
||||||
|
|
||||||
|
String remoteEncoding = conn.getDefaultEncoding(true);
|
||||||
|
|
||||||
|
if (remoteEncoding != null) {
|
||||||
|
defaultEncodingLabel = SystemResources.RESID_HOST_ENCODING_REMOTE_ENCODING_LABEL;
|
||||||
|
|
||||||
|
int idx = defaultEncodingLabel.indexOf('%');
|
||||||
|
|
||||||
|
if (idx != -1) {
|
||||||
|
defaultEncodingLabel = defaultEncodingLabel.substring(0, idx) + remoteEncoding + defaultEncodingLabel.substring(idx+2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
remoteEncodingButton = SystemWidgetHelpers.createRadioButton(encodingGroup, null, defaultEncodingLabel, SystemResources.RESID_HOST_ENCODING_REMOTE_TOOLTIP);
|
remoteEncodingButton = SystemWidgetHelpers.createRadioButton(encodingGroup, null, defaultEncodingLabel, SystemResources.RESID_HOST_ENCODING_REMOTE_TOOLTIP);
|
||||||
data = new GridData();
|
data = new GridData();
|
||||||
data.horizontalSpan = 2;
|
data.horizontalSpan = 2;
|
||||||
data.grabExcessHorizontalSpace = true;
|
data.grabExcessHorizontalSpace = true;
|
||||||
remoteEncodingButton.setLayoutData(data);
|
remoteEncodingButton.setLayoutData(data);
|
||||||
remoteEncodingButton.addSelectionListener(buttonSelectionListener);
|
|
||||||
|
SelectionAdapter remoteButtonSelectionListener = new SelectionAdapter() {
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
updateEncodingGroupState(remoteEncodingButton.getSelection());
|
||||||
|
validateEncoding();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
remoteEncodingButton.addSelectionListener(remoteButtonSelectionListener);
|
||||||
|
|
||||||
Composite otherComposite = new Composite(encodingGroup, SWT.NONE);
|
Composite otherComposite = new Composite(encodingGroup, SWT.NONE);
|
||||||
GridLayout otherLayout = new GridLayout();
|
GridLayout otherLayout = new GridLayout();
|
||||||
|
@ -882,7 +901,15 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
|
||||||
data = new GridData();
|
data = new GridData();
|
||||||
data.grabExcessHorizontalSpace = false;
|
data.grabExcessHorizontalSpace = false;
|
||||||
otherEncodingButton.setLayoutData(data);
|
otherEncodingButton.setLayoutData(data);
|
||||||
otherEncodingButton.addSelectionListener(buttonSelectionListener);
|
|
||||||
|
SelectionAdapter otherButtonSelectionListener = new SelectionAdapter() {
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
updateEncodingGroupState(!otherEncodingButton.getSelection());
|
||||||
|
validateEncoding();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
otherEncodingButton.addSelectionListener(otherButtonSelectionListener);
|
||||||
|
|
||||||
// other encoding combo
|
// other encoding combo
|
||||||
otherEncodingCombo = SystemWidgetHelpers.createCombo(otherComposite, null, SystemResources.RESID_HOST_ENCODING_ENTER_TOOLTIP);
|
otherEncodingCombo = SystemWidgetHelpers.createCombo(otherComposite, null, SystemResources.RESID_HOST_ENCODING_ENTER_TOOLTIP);
|
||||||
|
@ -935,7 +962,6 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
otherEncodingCombo.setEnabled(!useDefault);
|
|
||||||
validateEncoding();
|
validateEncoding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1217,6 +1243,9 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
|
||||||
// disable if any subsystem is connected
|
// disable if any subsystem is connected
|
||||||
if (!conn.getSystemType().getId().equalsIgnoreCase(IRSESystemType.SYSTEMTYPE_LOCAL_ID) && sr.isAnySubSystemConnected(conn)) {
|
if (!conn.getSystemType().getId().equalsIgnoreCase(IRSESystemType.SYSTEMTYPE_LOCAL_ID) && sr.isAnySubSystemConnected(conn)) {
|
||||||
encodingGroup.setEnabled(false);
|
encodingGroup.setEnabled(false);
|
||||||
|
remoteEncodingButton.setEnabled(false);
|
||||||
|
otherEncodingButton.setEnabled(false);
|
||||||
|
otherEncodingCombo.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue