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 {
MenuItem {
text: qsTr("View jobs")
@ -165,8 +169,9 @@ Page {
text: qsTr("Remove printer")
visible: db.isFavourite(wifi.ssid, model.display)
onClicked: {
db.removeFavourite(wifi.ssid, model.display)
discovery.favourites = db.getFavourites()
removeRemorse.execute(delegate, qsTr("Removing printer"),
function() {db.removeFavourite(wifi.ssid, model.display);
discovery.favourites = db.getFavourites()})
}
}
}

View file

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

View file

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