Skip to content

Commit

Permalink
Improve drivers notifications management
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed Jan 11, 2018
1 parent 608b5bc commit 4f138af
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/scripts/services/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ angular.module('icestudio')
}

this.showToolchain = function () {
return (this.selectedBoard && this.selectedBoard.info.interface !== 'GPIO') || true;
return (this.selectedBoard && this.selectedBoard.info.interface !== 'GPIO') || false;
};

this.showDrivers = function () {
return (this.selectedBoard && (this.selectedBoard.info.interface === 'FTDI' || this.selectedBoard.info.interface === 'Serial')) || true;
return (this.selectedBoard && (this.selectedBoard.info.interface === 'FTDI' || this.selectedBoard.info.interface === 'Serial')) || false;
};

});
30 changes: 16 additions & 14 deletions app/scripts/services/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ angular.module('icestudio')

function apioInstallDrivers(callback) {
if (common.WIN32) {
updateProgress('apio install drivers', 80);
updateProgress('apio install drivers', 90);
utils.apioInstall('drivers', callback);
}
else {
Expand All @@ -855,20 +855,22 @@ angular.module('icestudio')
}

function setupDriversAlert() {
var message = gettextCatalog.getString('Click here to <b>setup the drivers</b>');
if (!infoAlert) {
setTimeout(function() {
infoAlert = alertify.message(message, 30);
infoAlert.callback = function(isClicked) {
infoAlert = null;
if (isClicked) {
if (resultAlert) {
resultAlert.dismiss(false);
if (common.showDrivers()) {
var message = gettextCatalog.getString('Click here to <b>setup the drivers</b>');
if (!infoAlert) {
setTimeout(function() {
infoAlert = alertify.message(message, 30);
infoAlert.callback = function(isClicked) {
infoAlert = null;
if (isClicked) {
if (resultAlert) {
resultAlert.dismiss(false);
}
$rootScope.$broadcast('enableDrivers');
}
$rootScope.$broadcast('enableDrivers');
}
};
}, 1000);
};
}, 1000);
}
}
}

Expand Down

0 comments on commit 4f138af

Please sign in to comment.