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")
@ -164,9 +168,10 @@ Page {
MenuItem {
text: qsTr("Remove printer")
visible: db.isFavourite(wifi.ssid, model.display)
onClicked: {
db.removeFavourite(wifi.ssid, model.display)
discovery.favourites = db.getFavourites()
onClicked: {
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>