Skip to content

Commit

Permalink
LVD: Added Output messages for undo/redo actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arrowstar committed Nov 3, 2018
1 parent 4fb6f8b commit 3f1badb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions kspTOT_MissionArchitect/LaunchVehicleDesigner/ma_LvdMainGUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,11 @@ function undoMenu_Callback(hObject, eventdata, handles)
% handles structure with handles and user data (see GUIDATA)
lvdData = getappdata(handles.ma_LvdMainGUI,'lvdData');
undoRedo = getappdata(handles.ma_LvdMainGUI,'undoRedo');
writeOutput = getappdata(handles.ma_LvdMainGUI,'write_to_output_func');

[~, undoActionName] = undoRedo.shouldUndoMenuBeEnabled();

writeOutput(sprintf('Undoing %s...',undoActionName),'append');
lvdData = undoRedo.undo(lvdData);

setappdata(handles.ma_LvdMainGUI,'lvdData',lvdData);
Expand All @@ -815,7 +820,7 @@ function undoMenu_Callback(hObject, eventdata, handles)

curName = get(handles.ma_LvdMainGUI,'Name');
if(~strcmpi(curName(end),'*'))
set(handles.ma_MainGUI,'Name',[curName,'*']);
set(handles.ma_LvdMainGUI,'Name',[curName,'*']);
end

editMenu_Callback([], [], handles);
Expand All @@ -826,6 +831,11 @@ function redoMenu_Callback(hObject, eventdata, handles)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
undoRedo = getappdata(handles.ma_LvdMainGUI,'undoRedo');
writeOutput = getappdata(handles.ma_LvdMainGUI,'write_to_output_func');

[~, undoActionName] = undoRedo.shouldUndoMenuBeEnabled();

writeOutput(sprintf('Redoing %s...',undoActionName),'append');
lvdData = undoRedo.redo();

if(not(isempty(lvdData)))
Expand All @@ -837,7 +847,7 @@ function redoMenu_Callback(hObject, eventdata, handles)

curName = get(handles.ma_LvdMainGUI,'Name');
if(~strcmpi(curName(end),'*'))
set(handles.ma_MainGUI,'Name',[curName,'*']);
set(handles.ma_LvdMainGUI,'Name',[curName,'*']);
end

editMenu_Callback([], [], handles);
Expand Down

0 comments on commit 3f1badb

Please sign in to comment.