Removed old, commented out, fso-based code
authorEnrico Zini <enrico@enricozini.org>
Wed, 30 Sep 2009 22:16:36 +0000 (23:16 +0100)
committerEnrico Zini <enrico@enricozini.org>
Wed, 30 Sep 2009 22:16:36 +0000 (23:16 +0100)
src/app_power.vala

index 0096c129d9930deac283ebd2d26f47bd85266834..740c3803946201a8b7fe25ad7c5d83e1bc01afea 100644 (file)
@@ -232,7 +232,6 @@ public class Power : zavai.Resource, Object
 
 public class BatteryIcon : Gtk.StatusIcon
 {
-       //public dynamic DBus.Object battery;
        public Dkp.Device battery;
 
        public BatteryIcon(Dkp.Device dev)
@@ -242,23 +241,6 @@ public class BatteryIcon : Gtk.StatusIcon
 
                stderr.printf("New battery icon for %s online %s perc %f isrec %s tte %lld ttf %lld\n", dev.native_path, dev.online ? "yes" : "no", dev.percentage, dev.is_rechargeable ? "yes" : "no", dev.time_to_empty, dev.time_to_full);
 
-               /*
-               battery = zavai.registry.sbus.get_object(
-                       "org.freesmartphone.odeviced",
-                       "/org/freesmartphone/Device/PowerSupply/battery",
-                       "org.freesmartphone.Device.PowerSupply");
-               */
-
-               // activate += on_activate;
-
-               /*
-               battery.PowerStatus += on_power_status;
-               battery.Capacity += on_capacity;
-
-               last_status = battery.GetPowerStatus();
-               last_capacity = battery.GetCapacity();
-               */
-               
                update_icon();
        }
 
@@ -267,28 +249,6 @@ public class BatteryIcon : Gtk.StatusIcon
                update_icon();
        }
 
-       /*
-       private void on_power_status(dynamic DBus.Object bat, string status)
-       {
-               zavai.log.info("New battery status: " + status);
-               last_status = status;
-               update_icon();
-       }
-
-       private void on_capacity(dynamic DBus.Object bat, int val)
-       {
-stderr.printf("NEW CAPACITY: %d\n", val);
-               last_capacity = val;
-               update_icon();
-       }
-       */
-
-       /*
-       private void on_activate()
-       {
-       }
-       */
-
        protected void update_icon()
        {
                string name = zavai.config.icondir + "/battery/";
@@ -392,27 +352,16 @@ public class RebootButton : Gtk.Button
 // For a list of dbus services, look in /etc/dbus-1/system.d/
 public class Backlight: zavai.Service
 {
-       public dynamic DBus.Object usage;
-
        public Backlight()
        {
                name = "backlight";
-
-               usage = zavai.registry.sbus.get_object(
-                       "org.freesmartphone.ousaged",
-                       "/org/freesmartphone/Usage",
-                       "org.freesmartphone.Usage");
        }
 
-       // Turn the backlight and then let it fade off
+       // Turn the backlight on and then let it fade off
        public void wiggle()
        {
                // There must be a better method
                try {
-                       //display.SetBacklightPower(true);
-                       //usage.SetResourcePolicy("Display", "auto");
-                       //usage.RequestResource("Display");
-                       //usage.ReleaseResource("Display");
                        zavai.app.run_script(zavai.config.homedir + "/display wiggle");
                } catch (Error e) {
                        zavai.log.error("Requesting/releasing resource Display: " + e.message);
@@ -424,15 +373,7 @@ public class Backlight: zavai.Service
                if (!started)
                {
                        try {
-                               //display.SetBacklightPower(false);
                                zavai.app.run_script(zavai.config.homedir + "/display lock_off");
-                               /*
-                               string policy = usage.GetResourcePolicy("Display");
-                               if (policy == "auto")
-                               {
-                                       usage.SetResourcePolicy("Display", "disabled");
-                               }
-                               */
                        } catch (GLib.Error e) {
                                zavai.log.error(e.message);
                        }
@@ -442,21 +383,16 @@ public class Backlight: zavai.Service
        public void unlock_screen()
        {
                try {
-                       //display.SetBacklightPower(true);
                        zavai.app.run_script(zavai.config.homedir + "/display defaults");
-                       //usage.SetResourcePolicy("Display", "auto");
                } catch (GLib.Error e) {
                        zavai.log.error(e.message);
                }
        }
 
-
-       /// Request GPS resource
        public override void start()
        {
                if (started) return;
                try {
-                       //usage.RequestResource("Display");
                        zavai.app.run_script(zavai.config.homedir + "/display lock_on");
                        zavai.log.info("Acquired display");
                        base.start();
@@ -466,12 +402,10 @@ public class Backlight: zavai.Service
                base.start();
        }
 
-       // Release usage of GPS
        public override void stop()
        {
                if (!started) return;
                try {
-                       //usage.ReleaseResource("Display");
                        zavai.app.run_script(zavai.config.homedir + "/display defaults");
                        zavai.log.info("Released display");
                        base.stop();