Skip to content

Commit

Permalink
feat: Add quit button in main menu (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
skarab42 authored Mar 4, 2021
1 parent fc2cadb commit 4b00069
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/static/locales/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"ask-remove-asset": "Remove \"{{filename}}\" from the timeline?",
"global-shortcut-reserved": "This shortcut is reserved by the system!",
"type-shortcut-here": "Type shortcut here...",
"add-event": "Add event"
"add-event": "Add event",
"confirm-quit": "Do you really want to leave Marv?"
},
"words": {
"settings": "settings",
Expand Down
3 changes: 2 additions & 1 deletion app/static/locales/es/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"ask-remove-asset": "¿Eliminar \"{{filename}}\" de la línea de tiempo?",
"global-shortcut-reserved": "Este acceso directo está reservado por el sistema!",
"type-shortcut-here": "Escriba el acceso directo aquí...",
"add-event": "Añadir evento"
"add-event": "Añadir evento",
"confirm-quit": "¿De verdad quieres dejar Marv?"
},
"words": {
"settings": "opciones",
Expand Down
3 changes: 2 additions & 1 deletion app/static/locales/fr/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"ask-remove-asset": "Supprimer \"{{filename}}\" de la timeline ?",
"global-shortcut-reserved": "Ce raccourci est réservé par le système!",
"type-shortcut-here": "Tapez le raccourci ici...",
"add-event": "Ajouter un évènement"
"add-event": "Ajouter un évènement",
"confirm-quit": "Voulez vous vraiment quitter Marv ?"
},
"words": {
"settings": "options",
Expand Down
4 changes: 2 additions & 2 deletions front-src/client/components/Dashboard/Drawer.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script>
import { electron } from "@/stores/app";
import Donate from "../App/Donate.svelte";
import QuitButton from "./QuitButton.svelte";
import { drawer, hide } from "@/stores/drawer";
// import OpenEditMode from "./Drawer/OpenEditMode.svelte";
import clickoutside from "@/libs/svelte/click-outside";
import HelpLinks from "@/components/App/HelpLinks.svelte";
import OpenOnStartup from "@/components/App/OpenOnStartup.svelte";
Expand All @@ -21,14 +21,14 @@
style="top:{top}px; max-width:300px;"
class="absolute z-50 right-0 bottom-0 flex flex-col bg-dark shadow overflow-y-auto"
>
<!-- <OpenEditMode on:click="{hide}" /> -->
<LanguageSelect />
<div class="flex flex-col divide-y divide-gray-800 divide-opacity-50">
<OpenOnStartup />
<OBSConnectAtStartup />
<TwitchConnectAtStartup />
<CheckUpdateCheckbox />
</div>
<QuitButton />
<HelpLinks />
<div class="flex-auto"></div>
<Donate />
Expand Down
24 changes: 24 additions & 0 deletions front-src/client/components/Dashboard/QuitButton.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script>
import app from "@/api/app";
import { _ } from "@/libs/i18next";
import Button from "@/components/UI/Button.svelte";
import ConfirmModal from "@/components/UI/ConfirmModal.svelte";
let confirmModal = false;
function quit() {
confirmModal = true;
}
function onConfirm({ detail }) {
detail && app.quit();
confirmModal = false;
}
</script>

<Button class="bg-red-600" on:click="{quit}">{_('words.quit')}</Button>
<ConfirmModal
opened="{confirmModal}"
on:confirm="{onConfirm}"
question="{_('sentences.confirm-quit')}"
/>

0 comments on commit 4b00069

Please sign in to comment.