Add a confirmation question when removing a thing
This commit is contained in:
parent
f641e79c69
commit
21ab0b2c30
@ -683,6 +683,14 @@
|
||||
<source>ID</source>
|
||||
<translation>ID</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation>"Thing" entfernen?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation>Bist Du sicher, dass %1 und alle zugehörigen Einstellungen entfernt werden sollen?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConnectingPage</name>
|
||||
@ -1726,6 +1734,14 @@
|
||||
<source>In order for your %1 system to be useful, go ahead and add some things.</source>
|
||||
<translation>Damit Dein %1 System sich nützlich machen kann, füge einige "Things" hinzu.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation>"Thing" entfernen?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation>Bist Du sicher, dass %1 und alle zugehörigen Einstellungen entfernt werden sollen?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditTimeEventItemPage</name>
|
||||
|
||||
@ -683,6 +683,14 @@
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConnectingPage</name>
|
||||
@ -1720,6 +1728,14 @@
|
||||
<source>In order for your %1 system to be useful, go ahead and add some things.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditTimeEventItemPage</name>
|
||||
|
||||
@ -683,6 +683,14 @@
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConnectingPage</name>
|
||||
@ -1720,6 +1728,14 @@
|
||||
<source>In order for your %1 system to be useful, go ahead and add some things.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditTimeEventItemPage</name>
|
||||
|
||||
@ -683,6 +683,14 @@
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConnectingPage</name>
|
||||
@ -1720,6 +1728,14 @@
|
||||
<source>In order for your %1 system to be useful, go ahead and add some things.</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditTimeEventItemPage</name>
|
||||
|
||||
@ -682,6 +682,14 @@
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConnectingPage</name>
|
||||
@ -1722,6 +1730,14 @@
|
||||
<source>In order for your %1 system to be useful, go ahead and add some things.</source>
|
||||
<translation>%1 시스템이 유용하려면 먼저 몇 가지를 추가하십시오.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditTimeEventItemPage</name>
|
||||
|
||||
@ -683,6 +683,14 @@
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConnectingPage</name>
|
||||
@ -1720,6 +1728,14 @@
|
||||
<source>In order for your %1 system to be useful, go ahead and add some things.</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditTimeEventItemPage</name>
|
||||
|
||||
@ -682,6 +682,14 @@
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConnectingPage</name>
|
||||
@ -1722,6 +1730,14 @@
|
||||
<source>In order for your %1 system to be useful, go ahead and add some things.</source>
|
||||
<translation>%1 sisteminizin kullanışlı olması için devam edin ve bazı şeyler ekleyin.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditTimeEventItemPage</name>
|
||||
|
||||
@ -682,6 +682,14 @@
|
||||
<source>ID</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ConnectingPage</name>
|
||||
@ -1719,6 +1727,14 @@
|
||||
<source>In order for your %1 system to be useful, go ahead and add some things.</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove thing?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure you want to remove %1 and all associated settings?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditTimeEventItemPage</name>
|
||||
|
||||
@ -38,6 +38,7 @@ import "../delegates"
|
||||
SettingsPageBase {
|
||||
id: root
|
||||
property Thing thing: null
|
||||
busy: d.pendingCommand != -1
|
||||
|
||||
header: NymeaHeader {
|
||||
text: root.thing.name
|
||||
@ -80,7 +81,8 @@ SettingsPageBase {
|
||||
}
|
||||
|
||||
function deleteThing() {
|
||||
engine.thingManager.removeThing(root.thing.id)
|
||||
var popup = removeDialogComponent.createObject(root)
|
||||
popup.open()
|
||||
}
|
||||
|
||||
function reconfigureThing() {
|
||||
@ -101,15 +103,16 @@ SettingsPageBase {
|
||||
Connections {
|
||||
target: engine.thingManager
|
||||
onRemoveThingReply: {
|
||||
if (d.pendingCommand != commandId) {
|
||||
return;
|
||||
}
|
||||
|
||||
d.pendingCommand = -1
|
||||
|
||||
switch (thingError) {
|
||||
case Thing.ThingErrorNoError:
|
||||
pageStack.pop();
|
||||
return;
|
||||
case Thing.ThingErrorThingInRule:
|
||||
var removeMethodComponent = Qt.createComponent(Qt.resolvedUrl("../components/RemoveThingMethodDialog.qml"))
|
||||
var popup = removeMethodComponent.createObject(root, {thing: root.thing, rulesList: ruleIds});
|
||||
popup.open();
|
||||
return;
|
||||
default:
|
||||
var popup = errorDialog.createObject(root, {error: thingError})
|
||||
popup.open();
|
||||
@ -117,6 +120,11 @@ SettingsPageBase {
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: d
|
||||
property int pendingCommand: -1
|
||||
}
|
||||
|
||||
SettingsPageSectionHeader {
|
||||
text: qsTr("Information")
|
||||
}
|
||||
@ -289,6 +297,20 @@ SettingsPageBase {
|
||||
ErrorDialog { }
|
||||
}
|
||||
|
||||
Component {
|
||||
id: removeDialogComponent
|
||||
NymeaDialog {
|
||||
id: removeDialog
|
||||
title: qsTr("Remove thing?")
|
||||
text: qsTr("Are you sure you want to remove %1 and all associated settings?").arg(root.thing.name)
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
|
||||
onAccepted: {
|
||||
d.pendingCommand = engine.thingManager.removeThing(root.thing.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: renameDialog
|
||||
Dialog {
|
||||
|
||||
@ -56,24 +56,20 @@ Page {
|
||||
|
||||
QtObject {
|
||||
id: d
|
||||
property var thingToRemove: null
|
||||
property int pendingCommandId: -1
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: engine.thingManager
|
||||
onRemoveThingReply: {
|
||||
if (!d.thingToRemove) {
|
||||
if (commandId != d.pendingCommandId) {
|
||||
return;
|
||||
}
|
||||
|
||||
d.pendingCommandId = -1
|
||||
|
||||
switch (thingError) {
|
||||
case Thing.ThingErrorNoError:
|
||||
d.thingToRemove = null;
|
||||
return;
|
||||
case Thing.ThingErrorThingInRule:
|
||||
var removeMethodComponent = Qt.createComponent(Qt.resolvedUrl("../components/RemoveThingMethodDialog.qml"))
|
||||
var popup = removeMethodComponent.createObject(root, {thing: d.thingToRemove, rulesList: ruleIds});
|
||||
popup.open();
|
||||
return;
|
||||
default:
|
||||
var errorDialog = Qt.createComponent(Qt.resolvedUrl("../components/ErrorDialog.qml"))
|
||||
@ -112,13 +108,28 @@ Page {
|
||||
pageStack.push(Qt.resolvedUrl("ConfigureThingPage.qml"), {thing: thing})
|
||||
}
|
||||
onDeleteClicked: {
|
||||
d.thingToRemove = thing;
|
||||
engine.thingManager.removeThing(d.thingToRemove.id)
|
||||
var popup = removeDialogComponent.createObject(root, {thing: thing})
|
||||
popup.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: removeDialogComponent
|
||||
NymeaDialog {
|
||||
id: removeDialog
|
||||
title: qsTr("Remove thing?")
|
||||
text: qsTr("Are you sure you want to remove %1 and all associated settings?").arg(thing.name)
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
|
||||
property Thing thing: null
|
||||
|
||||
onAccepted: {
|
||||
d.pendingCommand = engine.thingManager.removeThing(thing.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EmptyViewPlaceholder {
|
||||
anchors { left: parent.left; right: parent.right; margins: app.margins }
|
||||
|
||||
Reference in New Issue
Block a user