var settingsRadioOptionStyles = { display: 'block', marginLeft: '13px' }, settingsCheckBoxOptionStyles = { display: 'block', marginLeft: '13px' }, settingsNumberFieldStyles = { width: '40px' }, downloadDirectoryLabelStyles = { fontSize: '.9em', marginLeft: '13px' }, downloadDirectoryFieldStyles= { width: '300px' }; var SettingsPage = React.createClass({ storeSetting: function(setting, val) { var settings = Object.assign({}, this.state.settings); settings[setting] = val; this.setState({ 'settings': settings }); lbry.setSettings(settings); }, onRunOnStartChange: function (event) { this.storeSetting('run_on_startup', event.target.checked); }, onShareDataChange: function (event) { this.storeSetting('upload_log', event.target.checked); }, onDownloadDirChange: function(event) { this.storeSetting('default_download_directory', event.target.value); }, onMaxUploadPrefChange: function(isLimited) { if (!isLimited) { this.storeSetting('max_upload', 0.0); } this.setState({ isMaxUpload: isLimited }); }, onMaxUploadFieldChange: function(event) { this.storeSetting('max_upload', Number(event.target.value)); }, onMaxDownloadPrefChange: function(isLimited) { if (!isLimited) { this.storeSetting('max_download', 0.0); } this.setState({ isMaxDownload: isLimited }); }, onMaxDownloadFieldChange: function(event) { this.storeSetting('max_download', Number(event.target.value)); }, getInitialState: function() { return { settings: null } }, componentWillMount: function() { lbry.getSettings(function(settings) { this.setState({ settings: settings, isMaxUpload: settings.max_upload != 0, isMaxDownload: settings.max_download != 0 }); }.bind(this)); }, render: function() { if (!this.state.settings) { // If the settings aren't loaded yet, don't render anything. return null; } return (

Settings

Run on startup

Download directory

Where would you like the files you download from LBRY to be saved?

Max Upload

Max Download

Share diagnostic data

); } });