KawAnime/components/settings.vue

181 lines
5.4 KiB
Vue
Raw Normal View History

<template lang="pug">
v-dialog(v-model='configModal', fullscreen, transition='config', :overlay='false')
v-btn(icon, slot='activator')
v-icon settings
v-card.white--text.main
2017-08-14 20:49:23 +00:00
v-toolbar.mablue.tb(fixed dark)
v-btn(icon, @click='configModal = false', dark)
v-icon close
v-toolbar-title.headline Settings
v-spacer
v-toolbar-items
v-btn(dark, flat, v-on:click.native='save()')
| Save
2017-08-14 20:49:23 +00:00
v-container.container(fluid)
v-layout(row, wrap, justify-center)
2017-08-16 17:47:29 +00:00
v-flex.pb-4(xs11)
v-card
v-card-title#download.headline
| Download
v-divider
v-layout(row, wrap, justify-center)
v-flex.section-title(xs6) Preferred fansub
v-flex.section-title(xs6) Quality
v-flex(xs5)
v-select(
v-bind:items='fansubChoices',
v-model='config.fansub',
hint='The fansub you want to check first!',
persistent-hint,
dark,
item-value='text'
)
v-flex(xs1)
v-flex(xs5)
v-radio-group(:isMantatory="true", row, v-model="config.quality")
template(v-for='radio in radios')
v-radio.primary--text(
:label='radio',
:value='radio'
)
v-flex.section-title(offset-xs1, xs3) Magnets
v-flex(xs8)
v-switch(
2017-09-26 08:12:20 +00:00
label='Activate (Recommended)',
color='primary',
v-model='config.magnets',
dark,
persistent-hint,
hint='Activate to get a list of magnets in the downloader'
)
v-card.section
v-card-title#local.headline Local
v-divider
v-layout(row, wrap, justify-center)
v-flex.section-title(xs4) Preferred local path
v-flex.local-path(xs6) {{ config.localPath }}
v-flex(xs2)
2017-09-17 18:55:24 +00:00
v-btn(accent, @click="changePath()") Choose
v-flex.section-title(xs3) News
v-flex(xs9)
v-switch(
:label="config.inside ? 'Inside' : 'Outside'",
color='primary',
v-model='config.inside',
dark,
persistent-hint,
hint='Deactivate to open the news in your browser.'
)
2017-08-14 20:49:23 +00:00
v-card.section
v-card-title#local.headline Notification
v-divider
v-layout(row, wrap, justify-center)
v-flex.section-title(xs12) Sound
v-flex(xs4)
v-select(
v-bind:items='soundChoices',
v-model='config.sound',
hint='The sound you want KawAnime to use when notifying you!',
persistent-hint,
dark,
item-value='text'
)
v-flex(xs5)
v-btn(icon large @click="play()")
v-icon(large) play_circle_outline
2017-09-06 16:07:45 +00:00
v-card.section
v-card-title#system.headline System
v-divider
v-layout(row, wrap, justify-center)
v-flex.section-title(xs3) Auto-start
v-flex(xs3)
v-switch(
label='Enable',
color='primary',
dark,
2017-09-17 18:55:24 +00:00
v-model='config.system.autoStart',
2017-09-06 16:07:45 +00:00
persistent-hint,
2017-09-06 22:31:39 +00:00
hint='Launch KawAnime on system start?'
2017-09-06 16:07:45 +00:00
)
v-flex.section-title(xs3) Tray icon
v-flex(xs3)
v-switch(
label='Enable',
color='primary',
dark,
2017-09-17 18:55:24 +00:00
v-model='config.system.toTray',
2017-09-06 16:07:45 +00:00
persistent-hint,
hint='Launch KawAnime with tray icon'
)
2017-04-26 19:16:31 +00:00
</template>
<script>
export default {
2017-05-13 14:38:17 +00:00
data () {
2017-04-26 19:16:31 +00:00
return {
configModal: false,
2017-09-17 18:55:24 +00:00
radios: ['480p', '720p', '1080p']
2017-04-26 19:16:31 +00:00
}
},
computed: {
2017-08-16 17:47:29 +00:00
config () {
2017-09-17 18:55:24 +00:00
return this.$store.state.config.config
},
fansubChoices () {
2017-09-17 18:55:24 +00:00
return this.$store.state.config.fansubs
2017-08-14 20:49:23 +00:00
},
soundChoices () {
2017-09-17 18:55:24 +00:00
return this.$store.state.config.sounds
2017-04-26 19:16:31 +00:00
}
},
methods: {
2017-09-17 18:55:24 +00:00
changePath () {
this.$store.dispatch('config/changeDir')
2017-04-26 19:16:31 +00:00
},
2017-05-13 14:38:17 +00:00
save () {
2017-09-17 18:55:24 +00:00
this.$store.commit('config/set', this.config)
this.$store.dispatch('config/save')
2017-04-26 19:16:31 +00:00
this.configModal = false
2017-08-14 20:49:23 +00:00
},
play () {
2017-09-19 09:47:04 +00:00
this.$store.dispatch('player/setUp')
this.$store.dispatch('player/play')
2017-04-26 19:16:31 +00:00
}
}
}
</script>
<style scoped>
2017-08-14 20:49:23 +00:00
.tb
2017-05-13 14:38:17 +00:00
{
2017-08-14 20:49:23 +00:00
top: 24px;
2017-05-13 14:38:17 +00:00
}
2017-04-26 19:16:31 +00:00
.container
2017-05-13 14:38:17 +00:00
{
2017-08-14 20:49:23 +00:00
padding-top: calc(24px + 48px);
2017-05-13 14:38:17 +00:00
}
2017-04-26 19:16:31 +00:00
.section
2017-05-13 14:38:17 +00:00
{
margin-top: 20px;
2017-05-13 14:38:17 +00:00
}
2017-04-26 19:16:31 +00:00
.section-title
2017-05-13 14:38:17 +00:00
{
padding-left: 20px;
margin-top: 15px;
font-size: 22px;
font-weight: 300;
2017-05-13 14:38:17 +00:00
}
2017-04-26 19:16:31 +00:00
.local-path
2017-05-13 14:38:17 +00:00
{
margin-top: 15px;
font-size: 18px;
font-weight: 200;
text-align: center;
2017-05-13 14:38:17 +00:00
}
</style>