separate Download and Print buttons

This commit is contained in:
Rick Companje 2019-02-21 20:13:31 +01:00
parent 7df13f6db0
commit 49b4a2be59

View File

@ -235,7 +235,7 @@ class Interface extends React.Component {
return; return;
} }
if (action.target === 'WIFI_PRINT' && !settings.ip) { if (action.target === 'WIFI_PRINT' && !settings.ip) {
this.setState({ error: 'please connect to a WiFi enabled printer' }); this.setState({ error: 'no Doodle3D WiFi-Box selected' });
return; return;
} }
if (!mesh) { if (!mesh) {
@ -336,7 +336,7 @@ class Interface extends React.Component {
render() { render() {
const { classes, onCancel, selectedPrinter, actions } = this.props; const { classes, onCancel, selectedPrinter, actions } = this.props;
const { isSlicing, progress, showFullScreen, error, objectDimensions } = this.state; const { isSlicing, settings, progress, showFullScreen, error, objectDimensions } = this.state;
const style = { ...(showFullScreen ? {} : { maxWidth: 'inherit', width: '100%', height: '100%' }) }; const style = { ...(showFullScreen ? {} : { maxWidth: 'inherit', width: '100%', height: '100%' }) };
@ -369,27 +369,25 @@ class Interface extends React.Component {
/> />
) : ( ) : (
<span> <span>
<RaisedButton
label="Download GCODE"
ref="button"
primary
className={`${classes.button}`}
disabled={isSlicing}
onClick={() => this.slice({target: 'DOWNLOAD'})}
/>
<RaisedButton <RaisedButton
label="Print" label="Print"
ref="button" ref="button"
primary primary
className={`${classes.button}`} className={`${classes.button}`}
onClick={this.openPopover} disabled={settings && settings.ip==""}
disabled={isSlicing} onClick={() => this.slice({target:'WIFI_PRINT'})}
/> />
<Popover
open={this.state.popover.open}
anchorEl={this.state.popover.element}
anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }}
targetOrigin={{ horizontal: 'left', vertical: 'bottom' }}
onRequestClose={this.closePopover}
>
<Menu>
{actions.map((action) => (
<MenuItem key={action.target} primaryText={action.title} onClick={() => this.slice(action)} />
))}
</Menu>
</Popover>
</span> </span>
)} )}
</div> </div>