This commit is contained in:
Valeria Fadeeva 2023-05-24 12:47:45 +05:00
parent 284748ebf0
commit 3c1f22c73c
3 changed files with 16 additions and 10 deletions

View File

@ -13,12 +13,12 @@ Item {
function upgrade() {
if (root.total == 0 || isNaN(root.total)){
root.createNotification("Обновлений нет")
root.listOfPackages = ""
// root.listOfPackages = ""
return
}
else {
root.upgradeStatus = root.installingStatus
updateUi()
root.updateUi()
cmd.exec(Plasmoid.configuration.commandForUpgrade)
}
}
@ -34,7 +34,7 @@ Item {
Timer {
id: startUpTimer
interval: 20000 // 20 seconds
interval: 10000
running: true
repeat: false
triggeredOnStart: false

View File

@ -38,7 +38,7 @@ Item {
}
Text {
text: (root.total < 99 || isNaN(root.total)) ? root.total : "99+"
text: root.badgeText
font.pointSize: 6
color: "White"
anchors.centerIn: circle

View File

@ -22,7 +22,8 @@ Item {
property string mainIcon: iconDefault
property string total: "0"
property int total: 0
property string badgeText: ""
property bool badgeVisible: false
@ -84,12 +85,12 @@ Item {
break
case checkingUpdatesStatus:
mainIcon = iconRefresh
//total = 0
// badgeText = ""
badgeVisible = false
//total = ""
break
case readyStatus:
mainIcon = iconReadyToUpgrade
badgeText = (total < 99 || isNaN(total)) ? total : "99+"
badgeVisible = true
break
case installingStatus:
@ -98,12 +99,10 @@ Item {
break
case errorStatus:
mainIcon = iconError
total = 0
badgeVisible = false
break
default:
mainIcon = iconDefault
total = 0
badgeVisible = false
}
}
@ -238,8 +237,15 @@ Item {
}
function onConnected(source) {
// Если запущена проверка обновлений
if (source == Plasmoid.configuration.commandForCheckingUpdates) {
upgradeStatus = checkingUpdatesStatus
updateUi()
return
}
upgradeStatus = installingStatus
updateUi()
}
}
}