Hide connect button while connecting in plasmoid like in widgets-based app
This commit is contained in:
parent
a695afaed1
commit
14ddb6d035
|
@ -187,6 +187,14 @@ ColumnLayout {
|
||||||
target: connectButton
|
target: connectButton
|
||||||
text: qsTr("Connect")
|
text: qsTr("Connect")
|
||||||
icon: "view-refresh"
|
icon: "view-refresh"
|
||||||
|
visible: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "connecting"
|
||||||
|
PropertyChanges {
|
||||||
|
target: connectButton
|
||||||
|
visible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
|
@ -195,6 +203,7 @@ ColumnLayout {
|
||||||
target: connectButton
|
target: connectButton
|
||||||
text: qsTr("Resume")
|
text: qsTr("Resume")
|
||||||
icon: "media-playback-start"
|
icon: "media-playback-start"
|
||||||
|
visible: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
|
@ -203,14 +212,16 @@ ColumnLayout {
|
||||||
target: connectButton
|
target: connectButton
|
||||||
text: qsTr("Pause")
|
text: qsTr("Pause")
|
||||||
icon: "media-playback-pause"
|
icon: "media-playback-pause"
|
||||||
|
visible: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
state: {
|
state: {
|
||||||
switch (plasmoid.nativeInterface.connection.status) {
|
switch (plasmoid.nativeInterface.connection.status) {
|
||||||
case SyncthingPlasmoid.Data.Disconnected:
|
case SyncthingPlasmoid.Data.Disconnected:
|
||||||
case SyncthingPlasmoid.Data.Reconnecting:
|
|
||||||
return "disconnected"
|
return "disconnected"
|
||||||
|
case SyncthingPlasmoid.Data.Reconnecting:
|
||||||
|
return "connecting";
|
||||||
case SyncthingPlasmoid.Data.Paused:
|
case SyncthingPlasmoid.Data.Paused:
|
||||||
return "paused"
|
return "paused"
|
||||||
default:
|
default:
|
||||||
|
@ -221,9 +232,10 @@ ColumnLayout {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
switch (plasmoid.nativeInterface.connection.status) {
|
switch (plasmoid.nativeInterface.connection.status) {
|
||||||
case SyncthingPlasmoid.Data.Disconnected:
|
case SyncthingPlasmoid.Data.Disconnected:
|
||||||
case SyncthingPlasmoid.Data.Reconnecting:
|
|
||||||
plasmoid.nativeInterface.connection.connect()
|
plasmoid.nativeInterface.connection.connect()
|
||||||
break
|
break
|
||||||
|
case SyncthingPlasmoid.Data.Reconnecting:
|
||||||
|
break
|
||||||
case SyncthingPlasmoid.Data.Paused:
|
case SyncthingPlasmoid.Data.Paused:
|
||||||
plasmoid.nativeInterface.connection.resumeAllDevs()
|
plasmoid.nativeInterface.connection.resumeAllDevs()
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue