var React = require('react/addons'); var Router = require('react-router'); var Radial = require('./Radial.react.js'); var SetupStore = require('./SetupStore'); var RetinaImage = require('react-retina-image'); var Header = require('./Header.react'); var Util = require('./Util'); var Setup = React.createClass({ mixins: [ Router.Navigation ], getInitialState: function () { return { progress: 0, name: '' }; }, componentWillMount: function () { SetupStore.on(SetupStore.PROGRESS_EVENT, this.update); SetupStore.on(SetupStore.STEP_EVENT, this.update); SetupStore.on(SetupStore.ERROR_EVENT, this.update); }, componentDidMount: function () { this.update(); }, componentDidUnmount: function () { SetupStore.removeListener(SetupStore.PROGRESS_EVENT, this.update); SetupStore.removeListener(SetupStore.STEP_EVENT, this.update); SetupStore.removeListener(SetupStore.ERROR_EVENT, this.update); }, handleRetry: function () { SetupStore.retry(); }, handleOpenWebsite: function () { Util.exec(['open', 'https://www.virtualbox.org/wiki/Downloads']); }, update: function () { this.setState({ progress: SetupStore.percent(), step: SetupStore.step(), error: SetupStore.error(), cancelled: SetupStore.cancelled() }); }, renderContents: function () { var img = 'virtualbox.png'; if (SetupStore.step().name.indexOf('Boot2Docker') !== -1) { img = 'boot2docker.png'; } return (
); }, renderStep: function () { return (
{this.renderContents()}

Step {SetupStore.number()} out of {SetupStore.stepCount()}

{SetupStore.step().title}

{SetupStore.step().message}

); }, renderCancelled: function () { return (
{this.renderContents()}

Installation Cancelled

Couldn't Install VirtualBox

Kitematic did not receive the administrative privileges required to install VirtualBox.

Please retry or download & install VirutalBox manually from the official Oracle website.

); }, renderError: function () { return (

Installation Error

We're Sorry!

There seems to have been an unexpected error with Kitematic:

{this.state.error.message}

); }, render: function () { if (!SetupStore.step()) { return false; } if (this.state.cancelled) { return this.renderCancelled(); } else if (this.state.error) { return this.renderError(); } else { return this.renderStep(); } } }); module.exports = Setup;