[SF#673]'thermal': ignore system critical setting if manual levels are active.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 16 Nov 2014 19:29:35 +0000 (21:29 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 16 Nov 2014 19:29:35 +0000 (21:29 +0200)
ChangeLog
plugins/thermal/thermal.c

index df50fa5..d555009 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,8 @@
     configuration change.
 * Correctly open 'netstat' plugin own menu on leftclick since rightclick
     should open panel context menu instead.
+* System critical temperature level in 'thermal' plugin now is properly
+    ignored if manual levels are active.
 
 0.7.2
 -------------------------------------------------------------------------
index 905ea9f..e566a59 100644 (file)
@@ -220,13 +220,15 @@ static gint get_temperature(thermal *th, gint *warn)
     for(i = 0; i < th->numsensors; i++){
         cur = th->get_temperature[i](th->sensor_array[i]);
         if (w == 2) ; /* already warning2 */
-        else if (th->critical[i] > 0 && cur >= th->critical[i] - 5)
+        else if (th->not_custom_levels &&
+                 th->critical[i] > 0 && cur >= th->critical[i] - 5)
             w = 2;
         else if ((!th->not_custom_levels || th->critical[i] < 0) &&
                  cur >= th->warning2)
             w = 2;
         else if (w == 1) ; /* already warning1 */
-        else if (th->critical[i] > 0 && cur >= th->critical[i] - 10)
+        else if (th->not_custom_levels &&
+                 th->critical[i] > 0 && cur >= th->critical[i] - 10)
             w = 1;
         else if ((!th->not_custom_levels || th->critical[i] < 0) &&
                  cur >= th->warning1)