function restoreSystemSettings(this)
    % RESTORESYSTEMSETTINGS Retsores the DTO/MMO/Run name settings on the model
    % to what was captured at launch time.
    
    % Copyright 2016-2019 The MathWorks, Inc.
    
    % Initialize fast restart handler and check if fast restart state
    % is off. If yesm then restore settings, otherwise retain the
    % shortcut settings
    fastRestartHandler = fixed.internal.simulationmodehandler.FastRestartHandler(this.getModel);
    if ~fastRestartHandler.isFastRestartOn
        
        % Converter loads all systems before beginning to execute the
        % Callback therefore can used the cached model reference values
        refMdls = this.Converter.AllSystems;
        
        shortcutManager = this.getShortcutManager;
        
        origDirty(1:length(refMdls)) = {''};
        for i = 1:length(refMdls)
            origDirty{i} = get_param(refMdls{i}, 'dirty');
        end
        
        shortcutManager.applyCleanupShortcut;
        
        for i = 1:numel(refMdls)
            if strcmp(origDirty{i}, 'off')
                set_param(refMdls{i}, 'dirty','off')
            end
        end
        delete(this.RestoreSettingsListener);
        this.RestoreSettingsListener = [];
    end
end
