Skip to content

Commit

Permalink
show config dialog when no runtime found
Browse files Browse the repository at this point in the history
  • Loading branch information
apla committed Jan 1, 2015
1 parent 23cf556 commit f12a92b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 24 deletions.
5 changes: 3 additions & 2 deletions assets/templates/runtime-select.mst
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{#noRuntimes}}
<p>No runtimes found! Please install <a href="http://arduino.cc/en/Main/Software">Arduino 1.5.x</a>, then relaunch Brackets</p>
<h4>No runtimes found! Please install <a href="http://arduino.cc/en/Main/Software">Arduino 1.5.x</a>,
then relaunch Brackets</h4>
{{/noRuntimes}}

{{#manyRuntimes}}
<p>We found multiple runtimes. Please select one:</p>
<h4>We found multiple runtimes. Please select one:</h4>
{{/manyRuntimes}}

{{^noRuntimes}}
Expand Down
15 changes: 8 additions & 7 deletions assets/templates/settings.mst
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<div id="cuwire-settings-panel">
<form>
<div>
<label for="cuwire-pref-arduinoIDE">Arduino IDE location</label>
<input id="cuwire-pref-arduinoIDE" name="arduinoIDE" value="{{arduinoIDE}}"/>
</div><div>
<label for="cuwire-pref-energiaIDE">Energia IDE location</label>
<input id="cuwire-pref-energiaIDE" name="energiaIDE" value="{{energiaIDE}}"/>
</div>
<div class="control-group">
<label class="control-label" for="cuwire-pref-arduinoIDE">Arduino IDE location</label>
<input id="cuwire-pref-arduinoIDE" name="arduinoIDE" value="{{arduinoIDE}}"/>
</div>
<div class="control-group">
<label class="control-label" for="cuwire-pref-energiaIDE">Energia IDE location</label>
<input id="cuwire-pref-energiaIDE" name="energiaIDE" value="{{energiaIDE}}"/>
</div>
</form>
</div>
29 changes: 17 additions & 12 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,21 +313,26 @@ define(function (require, exports, module) {
});

Dialogs.showModalDialog (
"cuwire-sketch-select",
"Runtime:",
message
).done(function (buttonId) {
var buttonMatch = buttonId.match (/cuwire-sketch-(\d+)/);
if (!buttonMatch) {
// don't care about another buttons
"cuwire-runtime-select",
"Runtime issue:",
message,
[{
className: Dialogs.DIALOG_BTN_CLASS_PRIMARY,
id: "select",
text: "Select runtime location"
}, {
className: Dialogs.DIALOG_BTN_CANCEL,
id: "cancel",
text: "Cancel"
}]
).done((function (buttonId) {
// var buttonMatch = buttonId.match (/cuwire-sketch-(\d+)/);
if (buttonId === "select") {
this.showSettings ();
return;
}

var sketchIdx = parseInt (buttonMatch[1]);

cb (null, fileList[sketchIdx].parentPath);

});
}).bind (this));

}

Expand Down
1 change: 0 additions & 1 deletion node/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ var ArduinoCli = function (args) {
return;
}

// TODO: use --arduino option to pass arduino app path
this.arduino = new ArduinoData ([options.arduino || "/Applications/devel/Arduino.app"]);

this.arduino.on ('done', (function () {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cuwire",
"version": "0.3.2",
"version": "0.3.3",
"title": "cuwire: IDE for microcontrollers",
"homepage": "https://github.com/apla/brackets-cuwire",
"description": "Now Brackets can be used to develop software for MCUs. Throw away you Arduino, Energia and others.",
Expand All @@ -12,7 +12,7 @@
"brackets": ">=0.36.0"
},
"scripts": {
"archive": "git archive --format zip -o cuwire-0.3.2.zip master",
"archive": "git archive --format zip -o cuwire-0.3.3.zip master",
"prepare-binaries": ""
}
}

0 comments on commit f12a92b

Please sign in to comment.