Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve confirmation dialog visuals #508

Merged
merged 3 commits into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/TheTopCornerMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</v-card>
</v-dialog>
<v-dialog v-model="dialogConfirmation.show" width="400" :fullscreen="isMobile">
<panel card-class="confirm-top-corner-menu-dialog" icon="mdi-help-circle" :title="dialogConfirmation.title" :margin-bottom="false">
<panel card-class="confirm-top-corner-menu-dialog" icon="mdi-alert" :title="dialogConfirmation.title" :margin-bottom="false">
<template v-slot:buttons>
<v-btn icon tile @click="dialogConfirmation.show = false"><v-icon>mdi-close-thick</v-icon></v-btn>
</template>
Expand All @@ -101,7 +101,7 @@
<v-btn text @click="dialogConfirmation.show = false">
{{ $t('App.TopCornerMenu.Cancel') }}
</v-btn>
<v-btn text color="primary" @click="executeDialog">
<v-btn text color="error" @click="executeDialog">
{{ dialogConfirmation.actionButtonText }}
</v-btn>
</v-card-actions>
Expand Down Expand Up @@ -197,6 +197,7 @@ export default class TheTopCornerMenu extends Mixins(BaseMixin) {
this.dialogConfirmation.title = this.$t('App.TopCornerMenu.ConfirmationDialog.Title.' + functionNameUppercase)+''

if (serviceName === 'klipper' && action === 'Stop') this.dialogConfirmation.description = this.$t('App.TopCornerMenu.ConfirmationDialog.Description.KlipperStop')+''
else if (serviceName === 'klipper' && action === 'Restart') this.dialogConfirmation.description = this.$t('App.TopCornerMenu.ConfirmationDialog.Description.KlipperRestart')+''
else this.dialogConfirmation.description = this.$t('App.TopCornerMenu.ConfirmationDialog.Description.' + functionNameUppercase)+''

this.dialogConfirmation.actionButtonText = this.$t('App.TopCornerMenu.' + action.charAt(0).toUpperCase() + action.slice(1))+''
Expand Down
22 changes: 11 additions & 11 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@
"Title": {
"KlipperRestart": "Klipper Neustart",
"KlipperFirmwareRestart": "Klipper Firmware Neustart",
"ServiceStart": "Service Start",
"ServiceRestart": "Service Neustart",
"ServiceStop": "Service Stop",
"ServiceStart": "Dienst Start",
"ServiceRestart": "Dienst Neustart",
"ServiceStop": "Dienst Stop",
"HostReboot": "Host Neustart",
"HostShutdown": "Host Herunterfahren"
},
"Description": {
"KlipperStop": "Wenn du Klipper jetzt stoppst, wird der momentane Druck fehlschlagen.",
"KlipperRestart": "Wenn du Klipper jetzt neustartest, wird der momentane Druck fehlschlagen.",
"KlipperFirmwareRestart": "Wenn du die Klipper Firmware jetzt neustartest, wird der momentane Druck fehlschlagen.",
"ServiceStart": "Wenn du diesen Service jetzt startest, riskierst du höchstwahrscheinlich einen Fehlschlag des momentanen Druckauftrags.",
"ServiceRestart": "Wenn du diesen Service jetzt neustartest, riskierst du höchstwahrscheinlich einen Fehlschlag des momentanen Druckauftrags.",
"ServiceStop": "Wenn du diesen Service jetzt stoppst, riskierst du höchstwahrscheinlich einen Fehlschlag des momentanen Druckauftrags.",
"HostReboot": "Wenn du den Host jetzt neustartest, wird der momentane Druck fehlschlagen.",
"HostShutdown": "Wenn du den Host jetzt herunterfährst, wird der momentane Druck fehlschlagen."
"KlipperStop": "Ein Stopp von Klipper wird zum Abbruch des aktuellen Druckauftrags führen!",
"KlipperRestart": "Ein Neustart von Klipper wird zum Abbruch des aktuellen Druckauftrags führen!",
"KlipperFirmwareRestart": "Ein Neustart der Klipper Firmware wird zum Abbruch des aktuellen Druckauftrags führen!",
"ServiceStart": "Ein Start dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",
"ServiceRestart": "Ein Neustart dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",
"ServiceStop": "Ein Stopp dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",
"HostReboot": "Ein Neustart des Hosts wird zum Abbruch des aktuellen Druckauftrags führen!",
"HostShutdown": "Ein Herunterfahren des Hosts wird zum Abbruch des aktuellen Druckauftrags führen!"
}
}
},
Expand Down
30 changes: 15 additions & 15 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
"Cancel": "Cancel",
"ConfirmationDialog": {
"Title": {
"KlipperRestart": "Klipper restart",
"KlipperFirmwareRestart": "Klipper firmware restart",
"ServiceStart": "Service start",
"ServiceRestart": "Service restart",
"ServiceStop": "Service stop",
"HostReboot": "Host reboot",
"HostShutdown": "Host shutdown"
"KlipperRestart": "Klipper Restart",
"KlipperFirmwareRestart": "Klipper Firmware Restart",
"ServiceStart": "Service Start",
"ServiceRestart": "Service Restart",
"ServiceStop": "Service Stop",
"HostReboot": "Host Reboot",
"HostShutdown": "Host Shutdown"
},
"Description": {
"KlipperStop": "If you stop Klipper now, the current print will fail.",
"KlipperRestart": "If you restart Klipper now, the current print will fail.",
"KlipperFirmwareRestart": "If you restart the Klipper firmware now, the current print will fail.",
"ServiceStart": "If you start this service now, you are very likely risking a failure of your ongoing print job.",
"ServiceRestart": "If you restart this service now, you are very likely risking a failure of your ongoing print job.",
"ServiceStop": "If you stop this service now, you are very likely risking a failure of your ongoing print job.",
"HostReboot": "If you reboot the host now, the current print will fail.",
"HostShutdown": "If you shutdown the host now, the current print will fail."
"KlipperStop": "Stopping Klipper will cause the current print to fail!",
"KlipperRestart": "Restarting Klipper will cause the current print to fail!",
"KlipperFirmwareRestart": "Restarting the Klipper Firmware will cause the current print to fail!",
"ServiceStart": "Starting this service may cause the current print to fail!",
"ServiceRestart": "Restarting this service may cause the current print to fail!",
"ServiceStop": "Stopping this service may cause the current print to fail!",
"HostReboot": "Rebooting the Host will cause the current print to fail!",
"HostShutdown": "Shutting down the Host will cause the current print to fail!"
}
}
},
Expand Down