Added app restart confirmation modal
This commit is contained in:
parent
979fea1cee
commit
6b3ba88556
|
@ -183,23 +183,39 @@ ScrollView {
|
||||||
|
|
||||||
StatusSlider {
|
StatusSlider {
|
||||||
id: zoomSlider
|
id: zoomSlider
|
||||||
|
readonly property int initialValue: {
|
||||||
|
let scaleFactorStr = utilsModel.readTextFile(uiScaleFilePath)
|
||||||
|
if (scaleFactorStr === "") {
|
||||||
|
return 100
|
||||||
|
}
|
||||||
|
let scaleFactor = parseFloat(scaleFactorStr)
|
||||||
|
if (isNaN(scaleFactor)) {
|
||||||
|
return 100
|
||||||
|
}
|
||||||
|
return scaleFactor * 100
|
||||||
|
}
|
||||||
anchors.top: labelZoom.bottom
|
anchors.top: labelZoom.bottom
|
||||||
anchors.topMargin: Style.current.padding
|
anchors.topMargin: Style.current.padding
|
||||||
width: parent.width
|
width: parent.width
|
||||||
minimumValue: 50
|
minimumValue: 50
|
||||||
maximumValue: 200
|
maximumValue: 200
|
||||||
stepSize: 50
|
stepSize: 50
|
||||||
value: {
|
value: initialValue
|
||||||
let scaleFactorStr = utilsModel.readTextFile(uiScaleFilePath)
|
|
||||||
if (scaleFactorStr === "") {
|
|
||||||
return 100
|
|
||||||
}
|
|
||||||
return parseFloat(scaleFactorStr) * 100
|
|
||||||
}
|
|
||||||
onValueChanged: {
|
onValueChanged: {
|
||||||
|
if (value !== initialValue) {
|
||||||
utilsModel.writeTextFile(uiScaleFilePath, value / 100.0)
|
utilsModel.writeTextFile(uiScaleFilePath, value / 100.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
onPressedChanged: {
|
||||||
|
if (!pressed && value !== initialValue) {
|
||||||
|
confirmAppRestartModal.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfirmAppRestartModal {
|
||||||
|
id: confirmAppRestartModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: zoomSliderLegend
|
id: zoomSliderLegend
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
import QtQuick 2.13
|
||||||
|
import QtQuick.Controls 2.13
|
||||||
|
import QtQuick.Layouts 1.13
|
||||||
|
import "../../../../imports"
|
||||||
|
import "../../../../shared"
|
||||||
|
import "../../../../shared/status"
|
||||||
|
|
||||||
|
ModalPopup {
|
||||||
|
height: 237
|
||||||
|
width: 400
|
||||||
|
|
||||||
|
property Popup parentPopup
|
||||||
|
|
||||||
|
title: qsTr("Application Restart")
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: qsTr("Status app will be closed. Please restart it for the changes to take into effect.")
|
||||||
|
font.pixelSize: 15
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
}
|
||||||
|
|
||||||
|
footer: Item {
|
||||||
|
id: footerContainer
|
||||||
|
width: parent.width
|
||||||
|
height: children[0].height
|
||||||
|
|
||||||
|
StatusButton {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Style.current.smallPadding
|
||||||
|
type: "warn"
|
||||||
|
text: qsTr("Proceed")
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
onClicked: Qt.quit()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,3 +10,4 @@ HelpContainer 1.0 HelpContainer.qml
|
||||||
AboutContainer 1.0 AboutContainer.qml
|
AboutContainer 1.0 AboutContainer.qml
|
||||||
BackupSeedModal 1.0 BackupSeedModal.qml
|
BackupSeedModal 1.0 BackupSeedModal.qml
|
||||||
LanguageModal 1.0 LanguageModal.qml
|
LanguageModal 1.0 LanguageModal.qml
|
||||||
|
ConfirmAppRestartModal 1.0 ConfirmAppRestartModal.qml
|
||||||
|
|
Loading…
Reference in New Issue