[gnome-shell] Revert "location: Allow user to disable GPS"



commit bec57a6cee8d36cc8fe534361ffb80da83196e3c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Feb 17 15:42:48 2014 +0000

    Revert "location: Allow user to disable GPS"
    
    This reverts commit 5d05b669024b7115fc9b6e128961655c5d105d34.
    
    Had a long discussion with Bastien Nocera and Allan Day on IRC about
    this and in the end we decided to go with the simple on/off controls for
    now.
    
    Conflicts:
        js/ui/status/location.js
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723684

 js/ui/status/location.js |   80 +++------------------------------------------
 1 files changed, 6 insertions(+), 74 deletions(-)
---
diff --git a/js/ui/status/location.js b/js/ui/status/location.js
index fa0f4c7..a202add 100644
--- a/js/ui/status/location.js
+++ b/js/ui/status/location.js
@@ -35,14 +35,6 @@ var AgentIface = '<node> \
   </interface> \
 </node>';
 
-const AccuracyLevel = {
-    NONE: 0,
-    COUNTRY: 1,
-    CITY: 4,
-    STREET: 6,
-    EXACT: 8,
-};
-
 const Indicator = new Lang.Class({
     Name: 'LocationIndicator',
     Extends: PanelMenu.SystemIndicator,
@@ -69,18 +61,6 @@ const Indicator = new Lang.Class({
         this._item.status.text = _("On");
         this._onOffAction = this._item.menu.addAction(_("Turn Off"), Lang.bind(this, this._onOnOffAction));
 
-        this._accurateItem = new PopupMenu.PopupMenuItem(_("Accurate (GPS + Network)"), false);
-        this._accurateItem.connect('activate', Lang.bind(this, this._onAccurateItemActivated));
-        this._item.menu.addMenuItem(this._accurateItem);
-
-        this._powerSavingItem = new PopupMenu.PopupMenuItem(_("Power Saving (Network Only)"), false);
-        this._powerSavingItem.connect('activate', Lang.bind(this, this._onPowerSavingItemActivated));
-        this._item.menu.addMenuItem(this._powerSavingItem);
-
-        this._offItem = new PopupMenu.PopupMenuItem(_("Off"), false);
-        this._offItem.connect('activate', Lang.bind(this, this._onOffItemActivated));
-        this._item.menu.addMenuItem(this._offItem);
-
         this.menu.addMenuItem(this._item);
 
         this._watchId = Gio.bus_watch_name(Gio.BusType.SYSTEM,
@@ -170,48 +150,16 @@ const Indicator = new Lang.Class({
         if (this._getMaxAccuracyLevel() == 0)
             this._settings.set_enum(MAX_ACCURACY_LEVEL, this._availableAccuracyLevel);
         else
-            this._settings.set_enum(MAX_ACCURACY_LEVEL, AccuracyLevel.NONE);
-    },
-
-    _onAccurateItemActivated: function() {
-        this._settings.set_enum(MAX_ACCURACY_LEVEL, AccuracyLevel.EXACT);
-    },
-
-    _onPowerSavingItemActivated: function() {
-        this._settings.set_enum(MAX_ACCURACY_LEVEL, AccuracyLevel.STREET);
-    },
-
-    _onOffItemActivated: function() {
-        this._settings.set_enum(MAX_ACCURACY_LEVEL, AccuracyLevel.NONE);
+            this._settings.set_enum(MAX_ACCURACY_LEVEL, 0);
     },
 
     _onMaxAccuracyLevelChanged: function() {
-        let maxAccuracyLevel = this._getMaxAccuracyLevel();
-        if (this._availableAccuracyLevel < AccuracyLevel.EXACT) {
-            if (maxAccuracyLevel == 0) {
-                this._item.status.text = _("Off");
-                this._onOffAction.label.text = _("Turn On");
-            } else {
-                this._item.status.text = _("On");
-                this._onOffAction.label.text = _("Turn Off");
-            }
+        if (this._getMaxAccuracyLevel() == 0) {
+            this._item.status.text = _("Off");
+            this._onOffAction.label.text = _("Turn On");
         } else {
-            if (maxAccuracyLevel == 0) {
-                this._item.status.text = _("Off");
-                this._offItem.setOrnament(PopupMenu.Ornament.DOT);
-                this._accurateItem.setOrnament(PopupMenu.Ornament.NONE);
-                this._powerSavingItem.setOrnament(PopupMenu.Ornament.NONE);
-            } else if (maxAccuracyLevel < AccuracyLevel.EXACT) {
-                this._item.status.text = _("Power Saving");
-                this._powerSavingItem.setOrnament(PopupMenu.Ornament.DOT);
-                this._accurateItem.setOrnament(PopupMenu.Ornament.NONE);
-                this._offItem.setOrnament(PopupMenu.Ornament.NONE);
-            } else {
-                this._item.status.text = _("Accurate");
-                this._accurateItem.setOrnament(PopupMenu.Ornament.DOT);
-                this._offItem.setOrnament(PopupMenu.Ornament.NONE);
-                this._powerSavingItem.setOrnament(PopupMenu.Ornament.NONE);
-            }
+            this._item.status.text = _("On");
+            this._onOffAction.label.text = _("Turn Off");
         }
 
         // Gotta ensure geoclue is up and we are registered as agent to it
@@ -232,22 +180,6 @@ const Indicator = new Lang.Class({
     _updateMenu: function() {
         this._availableAccuracyLevel = this._proxy.AvailableAccuracyLevel;
         this.menu.actor.visible = (this._availableAccuracyLevel != 0);
-        if (this._availableAccuracyLevel == 0)
-            return;
-
-        if (this._availableAccuracyLevel < AccuracyLevel.EXACT) {
-            this._onOffAction.actor.show();
-            this._accurateItem.actor.hide();
-            this._powerSavingItem.actor.hide();
-            this._offItem.actor.hide();
-        } else {
-            this._onOffAction.actor.hide();
-            this._accurateItem.actor.show();
-            this._powerSavingItem.actor.show();
-            this._offItem.actor.show();
-        }
-
-        this._onMaxAccuracyLevelChanged();
     },
 
     _onGeocluePropsChanged: function(proxy, properties) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]