Svuota il cestino dice quanti ne ha tolti (0.7.0)

This commit is contained in:
Carlo Baratto committed 2026-11-11 16:49:31 +01:00
1 parent c23a9ee5b3
commit 800bcf81e6
4 files changed
+28 -5

No files matched your search

+20 -1
View File
@@ -174,8 +174,27 @@ Page {
function chiediSvuota() {
remorse.execute(qsTr("Svuoto il cestino"), function() {
engine.emptyTrash(page.cartella);
var tolti = engine.emptyTrash(page.cartella);
page.carica();
// Dire quanti ne sono spariti: se resta tutto, il numero lo dice.
avviso.text = tolti > 0 ? qsTr("%1 messaggi rimossi").arg(tolti)
: tolti === 0 ? qsTr("Nessun messaggio rimosso")
: qsTr("Nessun cestino da svuotare");
avvisoTimer.restart();
});
}
Label {
id: avviso
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.paddingLarge
font.pixelSize: Theme.fontSizeSmall
color: Theme.highlightColor
}
Timer {
id: avvisoTimer
interval: 3000
onTriggered: avviso.text = ""
}
}