-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
** Copyright (C) 2025 Victron Energy B.V. | ||
** See LICENSE.txt for license information. | ||
*/ | ||
|
||
import QtQuick | ||
import QtQuick.Controls.impl as CP | ||
import Victron.VenusOS | ||
import QtQuick.Templates as T | ||
|
||
ListButton { | ||
id: root | ||
|
||
text: CommonWords.reboot | ||
//% "Reboot now" | ||
button.text: qsTrId("settings_reboot_now") | ||
writeAccessLevel: VenusOS.User_AccessType_User | ||
onClicked: Global.dialogLayer.open(confirmRebootDialogComponent) | ||
|
||
Component { | ||
id: confirmRebootDialogComponent | ||
|
||
ModalWarningDialog { | ||
//% "Press 'OK' to reboot" | ||
title: qsTrId("press_ok_to_reboot") | ||
dialogDoneOptions: VenusOS.ModalDialog_DoneOptions_OkAndCancel | ||
onClosed: { | ||
if (result === T.Dialog.Accepted) { | ||
Global.venusPlatform.reboot() | ||
Qt.callLater(Global.dialogLayer.open, rebootingDialogComponent) | ||
} | ||
} | ||
} | ||
} | ||
|
||
Component { | ||
id: rebootingDialogComponent | ||
|
||
ModalWarningDialog { | ||
title: BackendConnection.type === BackendConnection.DBusSource | ||
//% "Rebooting..." | ||
? qsTrId("dialoglayer_rebooting") | ||
//% "Device has been rebooted." | ||
: qsTrId("dialoglayer_rebooted") | ||
|
||
// On device, dialog cannot be dismissed; just wait until device is rebooted. | ||
dialogDoneOptions: VenusOS.ModalDialog_DoneOptions_OkOnly | ||
footer.enabled: BackendConnection.type !== BackendConnection.DBusSource | ||
footer.opacity: footer.enabled ? 1 : 0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters