Commit 77fa3826 authored by Michael Schwarz's avatar Michael Schwarz 🤔
Browse files

fixed several freak bugs

parent 9b0f2d85
...@@ -536,8 +536,20 @@ class ConflictPanel extends Composite { ...@@ -536,8 +536,20 @@ class ConflictPanel extends Composite {
else { else {
// Checking this is sufficient since the terminals are identical // Checking this is sufficient since the terminals are identical
if(srdetails.shiftAffectsOthers){ if(srdetails.shiftAffectsOthers){
cupConflictsView.beginConnectedResolution();
forceEnableDropdown = true; forceEnableDropdown = true;
cupConflictsView.beginConnectedResolution();
if(resolutionOptions.getSelectionIndex() == 1) { // Shift
cupConflictsView.setTerminalAssoc(srdetails.shift,Precedence.Type.Right);
}
else if (resolutionOptions.getSelectionIndex() == 2) { // Reduce
cupConflictsView.setTerminalAssoc(srdetails.shift,Precedence.Type.Left);
}
else if (resolutionOptions.getSelectionIndex() == 3) { // Non-Assoc
cupConflictsView.setTerminalAssoc(srdetails.shift,Precedence.Type.NonAssoc);
}
return;
} }
if(resolutionOptions.getSelectionIndex() == 1) { // Shift if(resolutionOptions.getSelectionIndex() == 1) { // Shift
...@@ -547,7 +559,7 @@ class ConflictPanel extends Composite { ...@@ -547,7 +559,7 @@ class ConflictPanel extends Composite {
cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.Left); cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.Left);
} }
else if (resolutionOptions.getSelectionIndex() == 3) { // Non-Assoc else if (resolutionOptions.getSelectionIndex() == 3) { // Non-Assoc
cupConflictsView.setTerminalAssoc(srdetails.shift,Precedence.Type.NonAssoc); cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.NonAssoc);
} }
} }
} }
......
...@@ -162,7 +162,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -162,7 +162,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
abortConnectedResolution(); abortConnectedResolution(true);
} }
@Override @Override
...@@ -208,6 +208,11 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -208,6 +208,11 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
ConflictPanel panel = conflictPanels.get(i); ConflictPanel panel = conflictPanels.get(i);
panel.update(crm, conflict); panel.update(crm, conflict);
} }
if(this.connectedResolutionAbort.getVisible()) {
markAllAffected();
}
scrolled.setLayoutDeferred(false); scrolled.setLayoutDeferred(false);
refreshScrolledLayout(); refreshScrolledLayout();
} }
...@@ -330,14 +335,15 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -330,14 +335,15 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
@Override @Override
public void modelChanged(Model model) { public void modelChanged(Model model) {
// TODO: only update if visible? if(this.connectedResolutionAbort.getVisible()) {
// Connected resolution does no longer make sense
abortConnectedResolution(false);
}
handleModelUpdate(model); handleModelUpdate(model);
} }
@Override @Override
public void becameHidden() { public void becameHidden() {
//TODO: This is too drastic, if nothing changed we can allow the user to switch back and forth
abortConnectedResolution();
this.isVisible = false; this.isVisible = false;
} }
...@@ -401,7 +407,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -401,7 +407,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
refreshScrolledLayout(); refreshScrolledLayout();
} }
private void abortConnectedResolution(){ private void abortConnectedResolution(boolean refresh){
currentPrecs = new PrecedenceToInsert(); currentPrecs = new PrecedenceToInsert();
this.connectedResolutionLabel.setVisible(false); this.connectedResolutionLabel.setVisible(false);
this.connectedResolutionAbort.setVisible(false); this.connectedResolutionAbort.setVisible(false);
...@@ -411,7 +417,9 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -411,7 +417,9 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
c.connectedEditAborted(); c.connectedEditAborted();
} }
refreshScrolledLayout(); if(refresh){
refreshScrolledLayout();
}
} }
private void applyConnectedResolution(){ private void applyConnectedResolution(){
...@@ -453,7 +461,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi ...@@ -453,7 +461,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
e.printStackTrace(); e.printStackTrace();
} }
finally{ finally{
abortConnectedResolution(); abortConnectedResolution(true);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment