Skip to content
Permalink
Browse files

Merge branch 'change/60-save-apply-cancel' into 'master'

Save/Apply/Cancel buttons for settings editor

Closes #60

See merge request zwieback/splitterino!48
  • Loading branch information...
prefixaut committed Sep 7, 2019
2 parents b06cc6c + 7c6c9d0 commit b397b03e22c94048c276b8e513661afbbfa6a237
Showing with 22 additions and 2 deletions.
  1. +22 −2 src/components/settings-editor.vue
@@ -23,8 +23,19 @@
v-if="(activeSettingsConfig != null && activeSettingsConfig.length > 0) || haveSettingsChanged"
outline
theme="primary"
@click="applySettings"
@click="saveSettings"
>Save Settings</spl-button>
<spl-button
v-if="(activeSettingsConfig != null && activeSettingsConfig.length > 0) || haveSettingsChanged"
outline
theme="primary"
@click="applySettings"
>Apply Settings</spl-button>
<spl-button
outline
theme="primary"
@click="close"
>Cancel</spl-button>
</div>
</div>
</template>
@@ -36,7 +47,7 @@ import { set, isEqual, merge } from 'lodash';
import { SettingsConfigurationValue, Settings } from '../store/states/settings.state';
import { GETTER_VALUE_BY_PATH, GETTER_CONFIGURATIONS_BY_PATH, ACTION_BULK_SET_SETTINGS } from '../store/modules/settings.module';
import { IO_SERVICE_TOKEN } from '../services/io.service';
import { createHash } from 'crypto';
import { ELECTRON_INTERFACE_TOKEN } from '../common/interfaces/electron';
@Component({ name: 'spl-settings-editor' })
export default class SettingsEditorComponent extends Vue {
@@ -79,6 +90,15 @@ export default class SettingsEditorComponent extends Vue {
public applySettings() {
this.$store.dispatch(ACTION_BULK_SET_SETTINGS, { values: this.changesValues });
}
public saveSettings() {
this.applySettings();
this.close();
}
public close() {
this.$services.get(ELECTRON_INTERFACE_TOKEN).getCurrentWindow().close();
}
}
</script>

0 comments on commit b397b03

Please sign in to comment.
You can’t perform that action at this time.