mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Merge remote-tracking branch 'origin/GP-3547_ghidra1_DefaultSettingsFix'
This commit is contained in:
commit
48b8bc0fcc
9 changed files with 88 additions and 55 deletions
|
@ -460,6 +460,11 @@ class DataTypeComponentDB implements InternalDataTypeComponent {
|
|||
dataMgr.dataTypeChanged(getParent(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isImmutableSettings() {
|
||||
return false; // NOTE: We could check to see if any editable Settings are defined
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChangeAllowed(SettingsDefinition settingsDefinition) {
|
||||
if (settingsDefinition instanceof TypeDefSettingsDefinition) {
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -77,6 +77,11 @@ class DataTypeSettingsDB implements Settings {
|
|||
return wasLocked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isImmutableSettings() {
|
||||
return locked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChangeAllowed(SettingsDefinition settingsDefinition) {
|
||||
if (locked) {
|
||||
|
@ -137,9 +142,8 @@ class DataTypeSettingsDB implements Settings {
|
|||
if (name == null) {
|
||||
nameStr = "s";
|
||||
}
|
||||
Msg.warn(SettingsImpl.class,
|
||||
"Ignored invalid attempt to modify immutable " + typeStr + "component setting" +
|
||||
nameStr);
|
||||
Msg.warn(SettingsImpl.class, "Ignored invalid attempt to modify immutable " + typeStr +
|
||||
"component setting" + nameStr);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -46,6 +46,11 @@ public interface Data extends CodeUnit, Settings {
|
|||
*/
|
||||
public Class<?> getValueClass();
|
||||
|
||||
@Override
|
||||
default boolean isImmutableSettings() {
|
||||
return true; // NOTE: We could check to see if any editable Settings are defined
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this data corresponds to string data. This is determined
|
||||
* by the corresponding data type producing a String value.
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -35,6 +35,11 @@ public class SettingsBuilder implements Settings {
|
|||
// nada
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isImmutableSettings() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChangeAllowed(SettingsDefinition settingsDefinition) {
|
||||
return settings.isChangeAllowed(settingsDefinition);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue