Commit d1a8a018 authored by Andrey Filippov's avatar Andrey Filippov

fixing working with multiple HDL projects open simultaneously

parent 42184c25
...@@ -362,8 +362,10 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe ...@@ -362,8 +362,10 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
if (rslt==null) return null; if (rslt==null) return null;
if (project.getFullPath().toPortableString().equals(rslt.getProject().getFullPath().toPortableString())){ if (project.getFullPath().toPortableString().equals(rslt.getProject().getFullPath().toPortableString())){
return (fChosenVerilogFile!=null)?fChosenVerilogFile:fSelectedVerilogFile; return (fChosenVerilogFile!=null)?fChosenVerilogFile:fSelectedVerilogFile;
} else { } else {
System.out.println("Wrong getChosenVerilogFile="+rslt+" for project "+project); if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
System.out.println("Wrong getChosenVerilogFile="+rslt+" for project "+project);
}
fChosenVerilogFile = null; // invalidate fChosenVerilogFile = null; // invalidate
if (fSelectedVerilogFile==null) return null; if (fSelectedVerilogFile==null) return null;
if (project.getFullPath().toPortableString().equals(fSelectedVerilogFile.getProject().getFullPath().toPortableString())){ if (project.getFullPath().toPortableString().equals(fSelectedVerilogFile.getProject().getFullPath().toPortableString())){
......
...@@ -581,7 +581,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -581,7 +581,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
selectDesignMenuAction = new Action() { selectDesignMenuAction = new Action() {
public void run() { public void run() {
if (selectedResource == null){ if (selectedResource == null){
HdlEditor editor = HdlEditor.current(); HdlEditor editor = HdlEditor.getCurrentEditor();
if ((editor != null) && (editor.getDocument() != null) && (editor.getDocument() instanceof HdlDocument) ){ if ((editor != null) && (editor.getDocument() != null) && (editor.getDocument() instanceof HdlDocument) ){
selectedResource = ((HdlDocument)editor.getDocument()).getFile(); selectedResource = ((HdlDocument)editor.getDocument()).getFile();
} else { } else {
...@@ -1358,7 +1358,9 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -1358,7 +1358,9 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER))
System.out.println("Setting HDL file to "+HDLFile.toString()); System.out.println("Setting HDL file to "+HDLFile.toString());
} else { } else {
System.out.println("*** Wrong HDLFile "+HDLLocation+" for project "+project.getFullPath().toPortableString()); if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
System.out.println("**** Wrong HDLFile "+HDLLocation+" for project "+project.getFullPath().toPortableString());
}
} }
} }
} }
...@@ -1460,7 +1462,9 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -1460,7 +1462,9 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER))
System.out.println("project.setPersistentProperty("+qn.toString()+","+HDLFile.getFullPath().toPortableString()+")"); System.out.println("project.setPersistentProperty("+qn.toString()+","+HDLFile.getFullPath().toPortableString()+")");
} else { } else {
System.out.println("*** Wrong HDLFile "+HDLFile+" for project "+project); if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
System.out.println("*** Wrong HDLFile "+HDLFile+" for project "+project);
}
return; return;
} }
} }
......
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