Replace all occurrences of "burn" with "flash" (#300)

Technically, a removable drive is flashed, not burned.

Fixes: https://github.com/resin-io/etcher/issues/297
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-04-12 12:00:43 -04:00
parent 8417f94649
commit 3efea5b308
11 changed files with 76 additions and 76 deletions

View File

@ -1,7 +1,7 @@
Etcher
======
> A better way to burn OS images to SD cards
> A better way to flash OS images to SD cards
[![dependencies](https://david-dm.org/resin-io/etcher.svg)](https://david-dm.org/resin-io/etcher.svg)
[![Build Status](https://travis-ci.org/resin-io/etcher.svg?branch=master)](https://travis-ci.org/resin-io/etcher)

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -107,9 +107,9 @@ app.controller('AppController', function(
this.success = true;
// This catches the case where the user enters
// the settings screen when a burn finished
// the settings screen when a flash finished
// and goes back to the main screen with the back button.
if (!this.writer.isBurning()) {
if (!this.writer.isFlashing()) {
this.selection.clear({
@ -198,7 +198,7 @@ app.controller('AppController', function(
};
this.reselectImage = function() {
if (self.writer.isBurning()) {
if (self.writer.isFlashing()) {
return;
}
@ -212,7 +212,7 @@ app.controller('AppController', function(
};
this.reselectDrive = function() {
if (self.writer.isBurning()) {
if (self.writer.isFlashing()) {
return;
}
@ -230,30 +230,30 @@ app.controller('AppController', function(
AnalyticsService.logEvent('Restart after failure');
};
this.burn = function(image, drive) {
this.flash = function(image, drive) {
// Stop scanning drives when burning
// Stop scanning drives when flashing
// otherwise Windows throws EPERM
self.scanner.stop();
AnalyticsService.logEvent('Burn', {
AnalyticsService.logEvent('Flash', {
image: image,
device: drive.device
});
return self.writer.burn(image, drive).then(function(success) {
return self.writer.flash(image, drive).then(function(success) {
// TODO: Find a better way to manage burn/check
// TODO: Find a better way to manage flash/check
// success/error state than a global boolean flag.
self.success = success;
if (self.success) {
NotificationService.send('Success!', 'You burn is complete');
NotificationService.send('Success!', 'Your flash is complete');
AnalyticsService.logEvent('Done');
$state.go('success');
} else {
NotificationService.send('Oops!', 'Looks like your burn has failed');
AnalyticsService.logEvent('Burn error');
NotificationService.send('Oops!', 'Looks like your flash has failed');
AnalyticsService.logEvent('Flash error');
}
})
.catch(dialog.showError)

View File

@ -38,10 +38,10 @@ const imageWriter = angular.module('Etcher.image-writer', [
imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel, NotifierService) {
let self = this;
let burning = false;
let flashing = false;
/**
* @summary Reset burn state
* @summary Reset flash state
* @function
* @public
*
@ -56,7 +56,7 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
};
/**
* @summary Burn progress state
* @summary Flash progress state
* @type Object
* @public
*/
@ -64,36 +64,36 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
this.resetState();
/**
* @summary Check if currently burning
* @summary Check if currently flashing
* @function
* @private
*
* @returns {Boolean} whether is burning or not
* @returns {Boolean} whether is flashing or not
*
* @example
* if (ImageWriterService.isBurning()) {
* console.log('We\'re currently burning');
* if (ImageWriterService.isFlashing()) {
* console.log('We\'re currently flashing');
* }
*/
this.isBurning = function() {
return burning;
this.isFlashing = function() {
return flashing;
};
/**
* @summary Set the burning status
* @summary Set the flashing status
* @function
* @private
*
* @description
* This function is extracted for testing purposes.
*
* @param {Boolean} status - burning status
* @param {Boolean} status - flashing status
*
* @example
* ImageWriterService.setBurning(true);
* ImageWriterService.setFlashing(true);
*/
this.setBurning = function(status) {
burning = Boolean(status);
this.setFlashing = function(status) {
flashing = Boolean(status);
};
/**
@ -122,7 +122,7 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
};
/**
* @summary Burn an image to a drive
* @summary Flash an image to a drive
* @function
* @public
*
@ -135,18 +135,18 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
* @returns {Promise}
*
* @example
* ImageWriterService.burn('foo.img', {
* ImageWriterService.flash('foo.img', {
* device: '/dev/disk2'
* }).then(function() {
* console.log('Write completed!');
* });
*/
this.burn = function(image, drive) {
if (self.isBurning()) {
return $q.reject(new Error('There is already a burn in progress'));
this.flash = function(image, drive) {
if (self.isFlashing()) {
return $q.reject(new Error('There is already a flash in progress'));
}
self.setBurning(true);
self.setFlashing(true);
return self.performWrite(image, drive, function(state) {
@ -165,7 +165,7 @@ imageWriter.service('ImageWriterService', function($q, $timeout, SettingsModel,
});
}).finally(function() {
self.setBurning(false);
self.setFlashing(false);
});
};

View File

@ -26,7 +26,7 @@ module.exports = function($state, SelectionStateModel, ImageWriterService, Analy
this.settings = SettingsModel.data;
/**
* @summary Restart the burning process
* @summary Restart the flashing process
* @function
* @public
*

View File

@ -20,7 +20,7 @@
* @module Etcher.Pages.Finish
*
* The finish page represents the application state where
* the the burn/validation has completed.
* the the flash/validation has completed.
*
* Its purpose is to display success or failure information,
* as well as the "next steps".

View File

@ -1,13 +1,13 @@
<div class="row around-xs">
<div class="col-xs">
<div class="box text-center">
<h3><span class="tick tick--success" class="space-right-tiny"></span> Burn Complete!</h3>
<h3><span class="tick tick--success" class="space-right-tiny"></span> Flash Complete!</h3>
<p class="soft space-vertical-medium" ng-show="finish.settings.unmountOnSuccess">Safely ejected and ready for use</p>
<div class="row center-xs space-vertical-large">
<div class="col-xs-4 space-medium">
<div class="box">
<p class="soft button-label">Would you like to burn the same image?</p>
<p class="soft button-label">Would you like to flash the same image?</p>
<button class="btn btn-primary btn-brick" ng-click="finish.restart({ preserveImage: true })">
Use <b>same</b> image
@ -19,7 +19,7 @@
<div class="col-xs-4 space-medium">
<div class="box">
<p class="soft button-label">Would you like to burn a new image?</p>
<p class="soft button-label">Would you like to flash a new image?</p>
<button class="btn btn-primary btn-brick" ng-click="finish.restart()">
Use <b>new</b> image

View File

@ -46,20 +46,20 @@
<div class="col-xs">
<div class="box text-center">
<hero-icon path="../assets/images/burn.svg" ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()" label="BURN IMAGE"></hero-icon>
<hero-icon path="../assets/images/flash.svg" ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()" label="FLASH IMAGE"></hero-icon>
<span class="badge space-top-medium" ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()">3</span>
<div class="space-vertical-large">
<progress-button class="btn-brick"
percentage="app.writer.state.progress"
striped="{{ app.writer.state.type == 'check' }}"
ng-attr-active="{{ app.writer.isBurning() }}"
ng-attr-active="{{ app.writer.isFlashing() }}"
ng-show="app.success"
ng-click="app.burn(app.selection.getImage(), app.selection.getDrive())"
ng-click="app.flash(app.selection.getImage(), app.selection.getDrive())"
ng-disabled="!app.selection.hasImage() || !app.selection.hasDrive()">
<span ng-show="app.writer.state.progress == 100 && app.writer.isBurning()">Finishing...</span>
<span ng-show="app.writer.state.progress == 0 && !app.writer.isBurning()">Burn!</span>
<span ng-show="app.writer.state.progress == 0 && app.writer.isBurning() && !app.writer.state.speed">Starting...</span>
<span ng-show="app.writer.state.progress == 100 && app.writer.isFlashing()">Finishing...</span>
<span ng-show="app.writer.state.progress == 0 && !app.writer.isFlashing()">Flash!</span>
<span ng-show="app.writer.state.progress == 0 && app.writer.isFlashing() && !app.writer.state.speed">Starting...</span>
<span ng-show="app.writer.state.speed && app.writer.state.progress != 100 && app.writer.state.type != 'check'"
ng-bind="app.writer.state.progress + '% '"></span>
<span ng-show="app.writer.state.speed && app.writer.state.progress != 100 && app.writer.state.type == 'check'"

View File

@ -3,7 +3,7 @@
"displayName": "Etcher",
"version": "1.0.0-beta.2",
"main": "lib/etcher.js",
"description": "An image burner with support for Windows, OS X and GNU/Linux.",
"description": "An image flasher with support for Windows, OS X and GNU/Linux.",
"homepage": "https://github.com/resin-io/etcher",
"repository": {
"type": "git",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 120 KiB

View File

@ -52,42 +52,42 @@ describe('Browser: ImageWriter', function() {
});
describe('.isBurning()', function() {
describe('.isFlashing()', function() {
it('should return false by default', function() {
m.chai.expect(ImageWriterService.isBurning()).to.be.false;
m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
});
it('should return true if burning', function() {
ImageWriterService.setBurning(true);
m.chai.expect(ImageWriterService.isBurning()).to.be.true;
it('should return true if flashing', function() {
ImageWriterService.setFlashing(true);
m.chai.expect(ImageWriterService.isFlashing()).to.be.true;
});
});
describe('.setBurning()', function() {
describe('.setFlashing()', function() {
it('should be able to set burning to true', function() {
ImageWriterService.setBurning(true);
m.chai.expect(ImageWriterService.isBurning()).to.be.true;
it('should be able to set flashing to true', function() {
ImageWriterService.setFlashing(true);
m.chai.expect(ImageWriterService.isFlashing()).to.be.true;
});
it('should be able to set burning to false', function() {
ImageWriterService.setBurning(false);
m.chai.expect(ImageWriterService.isBurning()).to.be.false;
it('should be able to set flashing to false', function() {
ImageWriterService.setFlashing(false);
m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
});
it('should cast to boolean by default', function() {
ImageWriterService.setBurning('hello');
m.chai.expect(ImageWriterService.isBurning()).to.be.true;
ImageWriterService.setFlashing('hello');
m.chai.expect(ImageWriterService.isFlashing()).to.be.true;
ImageWriterService.setBurning('');
m.chai.expect(ImageWriterService.isBurning()).to.be.false;
ImageWriterService.setFlashing('');
m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
});
});
describe('.burn()', function() {
describe('.flash()', function() {
describe('given a succesful write', function() {
@ -100,31 +100,31 @@ describe('Browser: ImageWriter', function() {
this.performWriteStub.restore();
});
it('should set burning to false when done', function() {
ImageWriterService.burn('foo.img', '/dev/disk2');
it('should set flashing to false when done', function() {
ImageWriterService.flash('foo.img', '/dev/disk2');
$rootScope.$apply();
m.chai.expect(ImageWriterService.isBurning()).to.be.false;
m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
});
it('should prevent writing more than once', function() {
ImageWriterService.burn('foo.img', '/dev/disk2');
ImageWriterService.burn('foo.img', '/dev/disk2');
ImageWriterService.flash('foo.img', '/dev/disk2');
ImageWriterService.flash('foo.img', '/dev/disk2');
$rootScope.$apply();
m.chai.expect(this.performWriteStub).to.have.been.calledOnce;
});
it('should reject the second burn attempt', function() {
ImageWriterService.burn('foo.img', '/dev/disk2');
it('should reject the second flash attempt', function() {
ImageWriterService.flash('foo.img', '/dev/disk2');
let rejectError = null;
ImageWriterService.burn('foo.img', '/dev/disk2').catch(function(error) {
ImageWriterService.flash('foo.img', '/dev/disk2').catch(function(error) {
rejectError = error;
});
$rootScope.$apply();
m.chai.expect(rejectError).to.be.an.instanceof(Error);
m.chai.expect(rejectError.message).to.equal('There is already a burn in progress');
m.chai.expect(rejectError.message).to.equal('There is already a flash in progress');
});
});
@ -140,15 +140,15 @@ describe('Browser: ImageWriter', function() {
this.performWriteStub.restore();
});
it('should set burning to false when done', function() {
ImageWriterService.burn('foo.img', '/dev/disk2');
it('should set flashing to false when done', function() {
ImageWriterService.flash('foo.img', '/dev/disk2');
$rootScope.$apply();
m.chai.expect(ImageWriterService.isBurning()).to.be.false;
m.chai.expect(ImageWriterService.isFlashing()).to.be.false;
});
it('should be rejected with the error', function() {
let rejection;
ImageWriterService.burn('foo.img', '/dev/disk2').catch(function(error) {
ImageWriterService.flash('foo.img', '/dev/disk2').catch(function(error) {
rejection = error;
});