location: Don't hide location menu
If geoclue reports that we can't aquire location, we hide the menu. This will typically happen when user is offline (and doesn't have a 3G modem). This is likely not what we want since this like a temporary situation and user would want the ability to toggle geolocation still even if its currently not possible any applications to query the location. https://bugzilla.gnome.org/show_bug.cgi?id=727398
This commit is contained in:
parent
79bebe849d
commit
0117fcb0e7
@ -123,7 +123,7 @@ const Indicator = new Lang.Class({
|
|||||||
this._propertiesChangedId = this._proxy.connect('g-properties-changed',
|
this._propertiesChangedId = this._proxy.connect('g-properties-changed',
|
||||||
Lang.bind(this, this._onGeocluePropsChanged));
|
Lang.bind(this, this._onGeocluePropsChanged));
|
||||||
|
|
||||||
this._updateMenu();
|
this._availableAccuracyLevel = this._proxy.AvailableAccuracyLevel;
|
||||||
this._syncIndicator();
|
this._syncIndicator();
|
||||||
|
|
||||||
this._proxy.AddAgentRemote('gnome-shell', Lang.bind(this, this._onAgentRegistered));
|
this._proxy.AddAgentRemote('gnome-shell', Lang.bind(this, this._onAgentRegistered));
|
||||||
@ -187,17 +187,12 @@ const Indicator = new Lang.Class({
|
|||||||
this._agent.emit_property_changed('MaxAccuracyLevel', variant);
|
this._agent.emit_property_changed('MaxAccuracyLevel', variant);
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateMenu: function() {
|
|
||||||
this._availableAccuracyLevel = this._proxy.AvailableAccuracyLevel;
|
|
||||||
this.menu.actor.visible = (this._availableAccuracyLevel != 0);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onGeocluePropsChanged: function(proxy, properties) {
|
_onGeocluePropsChanged: function(proxy, properties) {
|
||||||
let unpacked = properties.deep_unpack();
|
let unpacked = properties.deep_unpack();
|
||||||
if ("InUse" in unpacked)
|
if ("InUse" in unpacked)
|
||||||
this._syncIndicator();
|
this._syncIndicator();
|
||||||
if ("AvailableAccuracyLevel" in unpacked)
|
if ("AvailableAccuracyLevel" in unpacked)
|
||||||
this._updateMenu();
|
this._availableAccuracyLevel = this._proxy.AvailableAccuracyLevel;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user