Runtime/Behavior Changes

class ProjectInformationDialog

Due to an issue where Project Information fields were saving in cases where the user did not click "OK" (dialog close, field editing, etc), the following changes have been made in ProjectInformationDialog.

Changed: private bool saveInfo;

  • The default value has changed to false for the saveInfo field

Added: extend public void updateDependent(str key, str depKey, Object value, bool update=true) {}

  • New bool update (default: true) parameter
  • Allows control over updating project information through dependent controls
  • Solves issue where dependent controls are updating project information by default even if top level control is not updated

Changed: extend public void textContentChanged(Control c, bool update=true) {}

  • Now calls new updateDependent function, passing in the update parameter
/**
 * Text content changed.
 */
extend public void textContentChanged(Control c, bool update=true) {
	...
	
Old:	for (depKey in dependentKeys(key)) updateDependent(key, depKey, val);
New:	for (depKey in dependentKeys(key)) updateDependent(key, depKey, val, update=update);
}

Changed: extend public void enableSelected(Control control, bool update=true) {}

  • Now calls new updateDependent function, passing in the update parameter
/**
 * Check box changed.
 * To be done in child class.
 */
extend public void enableSelected(Control control, bool update=true) {
	if (!world or !control.visible) return;
	if (control as CheckBox) {
		...
		
Old:	for (depKey in dependentKeys(key)) updateDependent(key, depKey, val);
New:	for (depKey in dependentKeys(key)) updateDependent(key, depKey, val, update);
	} else {
		...
	}
}

Changed: extend public void applyAndClose() {}

  • Now sets saveInfo back to default false value after close

Added: public bool keyEsc() {}

  • Overridden to handle saving on escape-click
  • Sets saveInfo to false before calling super()

Changed: extend public FormattedTextField appendFieldCombo(..) {}

Text fields created in this function (FormattedTextField) now set the enterKeyCallback parameter to contentChangedCB rather than applyCB

Old → New behavior

Old:

  • FormattedTextFields used applyCB as their enter-key callback
  • applyCB called window.apply(), automatically applying changes to the world cached project information object

New

  • FormattedTextFields now use contentChangedCB as their enter-key callback
  • Applies changes visually without applying them to the world cached project information object
Impact
  • The ProjectInformationDialog should now only update the world cached ProjectInformation when the user selects "OK" in the dialog

Changed: extend public DateField appendDateFieldCombo(..) {}

Date fields created in this function (DateField) now set the callback parameter to contentChangedCB rather than applyCB

Old → New behavior

Old:

  • DateFields used applyCB as their callback
  • applyCB called window.apply(), automatically applying changes to the world cached project information object

New

  • DateFields now use contentChangedCB as their callback
  • Applies changes visually without applying them to the world cached project information object
Impact
  • The ProjectInformationDialog should now only update the world cached ProjectInformation when the user selects "OK" in the dialog

Changed: private void contentChangedCB(Control control) {}

  • Now calls window.textContentChanged() with update parameter set to false
Old → New behavior

Old:

  • Called window.textContentChanged with update parameter set to default (true)
  • Dialog controls using the contentChangedCB callback would automatically update the world cached project information

New:

  • Calls window.textContentChanged with update parameter set to false
  • Dialog controls using the contentChangedCB callback do not update world project information automatically
Impact
  • The ProjectInformationDialog should now only update the world cached ProjectInformation when the user selects "OK" in the dialog
/**
 * Text area content changed callback
 */
private void contentChangedCB(Control control) {
    Window window = control.parentFrame;
    if (window as ProjectInformationDialog and control.visible) {
Old:		window.textContentChanged(control);
New:		window.textContentChanged(control, update=false);

    }
}

Changed: private void checkBoxContentChangedCB(Control control) {}

Now calls window.enableSelected() with update parameter set to false

Old → New behavior

Old:

  • Called window.enableSelected with update parameter set to default (true)
  • Dialog controls using the checkBoxContentChangedCB callback would automatically update the world cached project information

New:

  • Calls window.enableSelected with update parameter set to false
  • Dialog controls using the checkBoxContentChangedCB callback do not update world project information automatically
Impact
  • The ProjectInformationDialog should now only update the world cached ProjectInformation when the user selects "OK" in the dialog
/**
 * Check Box content changed callback.
 */
private void checkBoxContentChangedCB(Control c) {
    Window window = c.parentFrame;
    if (window as ProjectInformationDialog and c.validAndVisible) {
Old:		window.enableSelected(c);
New:		window.enableSelected(c, update=false);
    }
}