Merge tag 'upstream/1.0.1'
[psensor-pkg-debian.git] / src / ui_unity.c
index 9e74002..17ee29d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2012 jeanfi@gmail.com
+ * Copyright (C) 2010-2014 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  */
 #include <unity.h>
 
-#include "psensor.h"
+#include <ui_unity.h>
 
 static int initialized;
 static UnityLauncherEntry *psensor_entry;
 static unsigned int last_visible = -1;
 
 void ui_unity_launcher_entry_update(struct psensor **sensors,
-                                   unsigned int show)
+                                   unsigned int show,
+                                   int use_celsius)
 {
+       double v;
+
        if (!initialized) {
                psensor_entry = unity_launcher_entry_get_for_desktop_file
                        ("psensor.desktop");
@@ -46,10 +49,11 @@ void ui_unity_launcher_entry_update(struct psensor **sensors,
        }
 
        if (sensors && *sensors) {
-               double v;
-
                v = psensor_get_max_current_value(sensors, SENSOR_TYPE_TEMP);
 
+               if (!use_celsius)
+                       v = celsius_to_fahrenheit(v);
+
                unity_launcher_entry_set_count(psensor_entry, v);
        }
 }