X-Git-Url: http://wpitchoune.net/gitweb/?p=psensor-pkg-debian.git;a=blobdiff_plain;f=src%2Fui_unity.c;h=adeacc0f49b55c11ad08b03c277d1acf53feb3f7;hp=9e740023e1c17962d8680565090815fc0c0e8176;hb=bb3567b1b6ca6b747693cdf5d7bdf3e49b27d7da;hpb=f055e7507526592d3a74c652f5f053701614c9c0 diff --git a/src/ui_unity.c b/src/ui_unity.c index 9e74002..adeacc0 100644 --- a/src/ui_unity.c +++ b/src/ui_unity.c @@ -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 @@ -25,8 +25,12 @@ 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_celcius) { + double v; + + if (!initialized) { psensor_entry = unity_launcher_entry_get_for_desktop_file ("psensor.desktop"); @@ -46,10 +50,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_celcius) + v = celcius_to_fahrenheit(v); + unity_launcher_entry_set_count(psensor_entry, v); } }