on xenial help sign in
add volume control resync action
280b62fNick Dedekind
qml/Panel/Indicators/MenuItemFactory.qml+22
@@ -129,6 +129,7 @@ Item {
129 }
129 }
130
130
131 ServerPropertySynchroniser {
131 ServerPropertySynchroniser {
132+ id: sliderPropertySync
132 objectName: "sync"
133 objectName: "sync"
133 syncTimeout: Utils.Constants.indicatorValueTimeout
134 syncTimeout: Utils.Constants.indicatorValueTimeout
134 bufferedSyncTimeout: true
135 bufferedSyncTimeout: true
@@ -141,6 +142,27 @@ Item {
141
142
142 onSyncTriggered: menuModel.changeState(menuIndex, value)
143 onSyncTriggered: menuModel.changeState(menuIndex, value)
143 }
144 }
145+
146+ // For volume resync.
147+ Loader {
148+ active: sliderItem.menuData ? sliderItem.menuData.action == "indicator.volume" : false
149+ sourceComponent: QDBusActionGroup {
150+ busType: 1
151+ busName: rootModel.busName
152+ objectPath: rootModel.actions["indicator"]
153+ Component.onCompleted: start()
154+
155+ property var syncAction: action("volume-sync")
156+ property int resync: {
157+ if (syncAction === null) return 0;
158+ return syncAction.valid ? syncAction.state : 0
159+ }
160+ onResyncChanged: {
161+ sliderPropertySync.reset();
162+ sliderPropertySync.updateUserValue();
163+ }
164+ }
165+ }
144 }
166 }
145 }
167 }
146
168