Add remorse timer for removing favourites

This commit is contained in:
Anton Thomasson 2019-12-15 11:29:07 +01:00
parent f56507c7ad
commit c7620bfab7
3 changed files with 16 additions and 3 deletions

View file

@ -156,6 +156,10 @@ Page {
} }
} }
RemorseItem {
id: removeRemorse
}
menu: ContextMenu { menu: ContextMenu {
MenuItem { MenuItem {
text: qsTr("View jobs") text: qsTr("View jobs")
@ -165,8 +169,9 @@ Page {
text: qsTr("Remove printer") text: qsTr("Remove printer")
visible: db.isFavourite(wifi.ssid, model.display) visible: db.isFavourite(wifi.ssid, model.display)
onClicked: { onClicked: {
db.removeFavourite(wifi.ssid, model.display) removeRemorse.execute(delegate, qsTr("Removing printer"),
discovery.favourites = db.getFavourites() function() {db.removeFavourite(wifi.ssid, model.display);
discovery.favourites = db.getFavourites()})
} }
} }
} }

View file

@ -112,6 +112,10 @@
<source>Unknown</source> <source>Unknown</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Removing printer</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>JobsPage</name> <name>JobsPage</name>

View file

@ -112,6 +112,10 @@
<source>Unknown</source> <source>Unknown</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Removing printer</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>JobsPage</name> <name>JobsPage</name>