|
|
|
@ -3,7 +3,8 @@ import { Component, Vue } from 'vue-property-decorator'
|
|
|
|
import { PageModule } from '@/store/page'
|
|
|
|
import { PageModule } from '@/store/page'
|
|
|
|
import AppIcon from '@/components/app/AppIcon.vue'
|
|
|
|
import AppIcon from '@/components/app/AppIcon.vue'
|
|
|
|
import ShutdownMenu from '@/components/base/ShutdownMenu'
|
|
|
|
import ShutdownMenu from '@/components/base/ShutdownMenu'
|
|
|
|
import { appWindow } from '@/models/lightdm'
|
|
|
|
import Mousetrap from 'mousetrap'
|
|
|
|
|
|
|
|
import { modKey, systemActionsObject } from '@/utils/helper'
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
components: { AppIcon, ShutdownMenu }
|
|
|
|
components: { AppIcon, ShutdownMenu }
|
|
|
|
@ -13,32 +14,19 @@ export default class ShutdownBlock extends Vue {
|
|
|
|
return !!PageModule.activeBlock
|
|
|
|
return !!PageModule.activeBlock
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
shutdown(event: MouseEvent) {
|
|
|
|
mounted() {
|
|
|
|
event.stopPropagation()
|
|
|
|
Mousetrap.bind(`${modKey}+p`, systemActionsObject.shutdown)
|
|
|
|
this.openShutdownDialog()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
openShutdownDialog() {
|
|
|
|
shutdown(event: MouseEvent) {
|
|
|
|
PageModule.openDialog({
|
|
|
|
event.stopPropagation()
|
|
|
|
title: 'modals.shutdown.title',
|
|
|
|
systemActionsObject.shutdown()
|
|
|
|
text: 'modals.shutdown.text',
|
|
|
|
|
|
|
|
actions: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
title: 'text.yes',
|
|
|
|
|
|
|
|
callback: appWindow.lightdm.shutdown
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
title: 'text.no',
|
|
|
|
|
|
|
|
callback: PageModule.closeDialog
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const button = <div class="shutdown-block">
|
|
|
|
const button = <div class="shutdown-block">
|
|
|
|
<ShutdownMenu />
|
|
|
|
<ShutdownMenu />
|
|
|
|
<div class="shutdown-button" >
|
|
|
|
<div class="shutdown-button" onClick={ this.shutdown }>
|
|
|
|
<AppIcon name="shutdown" />
|
|
|
|
<AppIcon name="shutdown" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|