Merge lp:~kaijanmaki/unity8/indicator-root-state-icons-fix into lp:unity8
Status: | Merged |
---|---|
Approved by: | Antti Kaijanmäki |
Approved revision: | 800 |
Merged at revision: | 893 |
Proposed branch: | lp:~kaijanmaki/unity8/indicator-root-state-icons-fix |
Merge into: | lp:unity8 |
Diff against target: |
85 lines (+44/-8) 2 files modified
plugins/Unity/Indicators/rootactionstate.cpp (+7/-8) tests/plugins/Unity/Indicators/rootactionstatetest.cpp (+37/-0) |
To merge this branch: | bzr merge lp:~kaijanmaki/unity8/indicator-root-state-icons-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Nick Dedekind (community) | Approve | ||
Michał Sawicz | Abstain | ||
Ted Gould (community) | Approve | ||
Antti Kaijanmäki (community) | Approve | ||
Review via email: mp+213727@code.launchpad.net |
Commit message
Indicators/
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
https:/
indicator-network is the only indicator that currently uses the "icons"
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes.
* Did you make sure that your branch does not contain spurious tags?
Yes.
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
No.
* If you changed the UI, has there been a design review?
Ui didn't change.
silo:
https:/
Testing instructions:
* install the silo, apt-get update, apt-get dist-upgrade
* reboot
* after startup on n4, you should see indicator-network showing pre-label (SIM Locked) and one icon
* unlock the sim
* now you should see two icons, one for the cellular strength and one for the networking (either wifi disconenected icon or a mobile broadband tech icon 2G, 3G, etc..)
* if you can see multiple icons coming from indicator-network, the MP is working.
* actually if you can even see one, it's working as even the single icon is passed through the 'icons' property, but I wanted to use the opportunity to get you to test the pin unlocking as well ;)
Proposing this change as I noticed I was unable to get multiple icons working with my new indicator-network code base. Although the "icons" element in the root state is not documented in the "Indicators and Settings Protocol" document I figured it out that the variant in the VARDICT should contain an array of GVariants coming from g_icon_serialize(). Now, when my code did exactly that (see the dump below), the icon loading failed. For some reason the g_variant_ get_child_ value() returned a variant which contained another variant (the one coming from _serialize).
So the old code would have required an additional call: get_variant( child);
child = g_variant_
Using iter_loop() gets the correct results and is also the way "GVariant Format Strings" manual shows as an example how to unpack arrays.
===
$ dbus-send --print-reply --session --dest= com.canonical. indicator. network /com/canonical/ indicator/ network org.gtk. Actions. Describe string: phone.network- status
method return sender=:1.430 -> dest=:1.468 reply_serial=2
string "icon"
variant struct {
string "themed"
variant array [
string "nm-signal- 50-secure"
]
string "icons"
variant array [
variant struct {
string "themed"
variant array [
string "nm-signal-75"
]
}
variant struct {
string "themed"
variant array [
string "nm-signal-25"
]
}
string "title"
variant string "Network"
string "visible"
variant boolean true
struct {
boolean true
signature ""
array [
variant array [
dict entry(
}
)
dict entry(
]
)
dict entry(
)
dict entry(
)
]
]
}