Skip to content

Commit

Permalink
everyone gets a copy?
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Sep 9, 2023
1 parent e64bf7c commit 3754ad6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ public class ExternalEditorController {
boolean hasEditor = false;
private Button advanced = new Button();
private ImageView image=new ImageView();
private static ArrayList<IExternalEditor> editors=new ArrayList<IExternalEditor>();
static {
private ArrayList<IExternalEditor> editors=new ArrayList<IExternalEditor>();

private void loadEditors() {
editors.add(new SVGExternalEditor());
editors.add(new GroovyEclipseExternalEditor());
editors.add(new ArduinoExternalEditor());
}
private IExternalEditor myEditor=null;
public ExternalEditorController(File f, CheckBox autoRun){
loadEditors();
this.currentFile = f;
for(IExternalEditor e:editors) {
if(e.isSupportedByExtention(f)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,9 @@ public class ScriptingFileWidget extends BorderPane implements IFileChangeListen
private Button printbed;
private FileChangeWatcher watch;;
public ScriptingFileWidget(File currentFile) throws IOException {
this(ScriptingWidgetType.FILE, currentFile);
load(ScriptingWidgetType.FILE, currentFile);

loadCodeFromFile(currentFile);
// publish.setDisable(!isOwnedByLoggedInUser);
runfx.setGraphic(AssetFactory.loadIcon("Run.png"));
if (isOwnedByLoggedInUser)
publish.setGraphic(AssetFactory.loadIcon("Publish.png"));
else
publish.setGraphic(AssetFactory.loadIcon("Fork.png"));
arrange.setGraphic(AssetFactory.loadIcon("Edit-CAD-Engine.png"));
arrange.setDisable(true);

}

private void startStopAction() {
Expand All @@ -116,7 +108,7 @@ private void startStopAction() {
}).start();
}

private ScriptingFileWidget(ScriptingWidgetType type, File currentFile) {
private void load(ScriptingWidgetType type, File currentFile) {
isOwnedByLoggedInUser = ScriptingEngine.checkOwner(currentFile);
this.type = type;
this.currentFile = currentFile;
Expand Down Expand Up @@ -237,6 +229,21 @@ private ScriptingFileWidget(ScriptingWidgetType type, File currentFile) {
setTop(controlPane);

addIScriptEventListener(BowlerStudioController.getBowlerStudio());

try {
loadCodeFromFile(currentFile);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
// publish.setDisable(!isOwnedByLoggedInUser);
runfx.setGraphic(AssetFactory.loadIcon("Run.png"));
if (isOwnedByLoggedInUser)
publish.setGraphic(AssetFactory.loadIcon("Publish.png"));
else
publish.setGraphic(AssetFactory.loadIcon("Fork.png"));
arrange.setGraphic(AssetFactory.loadIcon("Edit-CAD-Engine.png"));
arrange.setDisable(true);
reset();
}
private void exportAll(boolean makePrintBed) {
Expand Down

0 comments on commit 3754ad6

Please sign in to comment.