gnome-power-manager r2812 - in trunk: . src



Author: rhughes
Date: Mon Jun  2 10:10:46 2008
New Revision: 2812
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=2812&view=rev

Log:
2008-06-02  Richard Hughes  <richard hughsie com>

* src/gpm-info.c: (gpm_statistics_add_events_typical),
(gpm_statistics_get_parameters):
* src/gpm-profile.c: (gpm_profile_get_data_time_percent),
(gpm_profile_get_data_accuracy_percent):
Fix the colour mess once and for all.


Modified:
   trunk/ChangeLog
   trunk/src/gpm-info.c
   trunk/src/gpm-profile.c

Modified: trunk/src/gpm-info.c
==============================================================================
--- trunk/src/gpm-info.c	(original)
+++ trunk/src/gpm-info.c	Mon Jun  2 10:10:46 2008
@@ -201,7 +201,7 @@
 				       GPM_GRAPH_WIDGET_SHAPE_CIRCLE,
 				       _("On AC"));
 	gpm_statistics_add_event_type (array, GPM_EVENT_ON_BATTERY,
-				       GPM_COLOUR_DARK_BLUE,
+				       GPM_COLOUR_RED,
 				       GPM_GRAPH_WIDGET_SHAPE_CIRCLE,
 				       _("On battery"));
 	gpm_statistics_add_event_type (array, GPM_EVENT_SESSION_POWERSAVE,
@@ -295,7 +295,7 @@
 		*axis_type_y = g_strdup ("power");
 		*axis_desc_x = g_strdup (_("Time since startup"));
 		*axis_desc_y = g_strdup (_("Power"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_RED, _("Power"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Power"));
 		gpm_statistics_add_events_typical (*key_event);
 		return TRUE;
 	}
@@ -304,7 +304,7 @@
 		*axis_type_y = g_strdup ("time");
 		*axis_desc_x = g_strdup (_("Time since startup"));
 		*axis_desc_y = g_strdup (_("Estimated time"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_RED, _("Time"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Time"));
 		gpm_statistics_add_events_typical (*key_event);
 		return TRUE;
 	}
@@ -313,7 +313,7 @@
 		*axis_type_y = g_strdup ("percentage");
 		*axis_desc_x = g_strdup (_("Time since startup"));
 		*axis_desc_y = g_strdup (_("Battery percentage"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_RED, _("Percentage"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Percentage"));
 		gpm_statistics_add_events_typical (*key_event);
 		return TRUE;
 	}
@@ -331,43 +331,27 @@
 		*axis_type_y = g_strdup ("percentage");
 		*axis_desc_x = g_strdup (_("Battery percentage"));
 		*axis_desc_y = g_strdup (_("Accuracy of reading"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Valid data"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_RED, _("No data"));
-		gpm_statistics_add_event_type (*key_event, GPM_EVENT_HIBERNATE,
-					       GPM_COLOUR_CYAN,
-					       GPM_GRAPH_WIDGET_SHAPE_SQUARE,
-				 	      _("Start point"));
-		gpm_statistics_add_event_type (*key_event, GPM_EVENT_SUSPEND,
-					       GPM_COLOUR_YELLOW,
-					       GPM_GRAPH_WIDGET_SHAPE_TRIANGLE,
-				 	      _("Stop point"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_RED, _("Trusted"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_RED, _("Untrusted"));
 		return TRUE;
 	}
-	if (strcmp (type, "profile-charge-time") == 0) {
+	if (strcmp (type, "profile-discharge-accuracy") == 0) {
 		*axis_type_x = g_strdup ("percentage");
-		*axis_type_y = g_strdup ("time");
+		*axis_type_y = g_strdup ("percentage");
 		*axis_desc_x = g_strdup (_("Battery percentage"));
-		*axis_desc_y = g_strdup (_("Average time elapsed"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Valid data"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_RED, _("No data"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_BLUE, _("Extrapolated data"));
-		gpm_statistics_add_event_type (*key_event, GPM_EVENT_HIBERNATE,
-					       GPM_COLOUR_CYAN,
-					       GPM_GRAPH_WIDGET_SHAPE_SQUARE,
-				 	      _("Start point"));
-		gpm_statistics_add_event_type (*key_event, GPM_EVENT_SUSPEND,
-					       GPM_COLOUR_YELLOW,
-					       GPM_GRAPH_WIDGET_SHAPE_TRIANGLE,
-				 	      _("Stop point"));
+		*axis_desc_y = g_strdup (_("Accuracy of reading"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_BLUE, _("Trusted"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_BLUE, _("Untrusted"));
 		return TRUE;
 	}
-	if (strcmp (type, "profile-discharge-accuracy") == 0) {
+	if (strcmp (type, "profile-charge-time") == 0) {
 		*axis_type_x = g_strdup ("percentage");
-		*axis_type_y = g_strdup ("percentage");
+		*axis_type_y = g_strdup ("time");
 		*axis_desc_x = g_strdup (_("Battery percentage"));
-		*axis_desc_y = g_strdup (_("Accuracy of reading"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Valid data"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_RED, _("No data"));
+		*axis_desc_y = g_strdup (_("Average time elapsed"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_RED, _("Valid data"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_GREY, _("Extrapolated data"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_BLUE, _("No data"));
 		gpm_statistics_add_event_type (*key_event, GPM_EVENT_HIBERNATE,
 					       GPM_COLOUR_CYAN,
 					       GPM_GRAPH_WIDGET_SHAPE_SQUARE,
@@ -383,9 +367,9 @@
 		*axis_type_y = g_strdup ("time");
 		*axis_desc_x = g_strdup (_("Battery percentage"));
 		*axis_desc_y = g_strdup (_("Average time elapsed"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_GREEN, _("Valid data"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_RED, _("No data"));
-		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_BLUE, _("Extrapolated data"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_RED, _("Valid data"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_DARK_GREY, _("Extrapolated data"));
+		gpm_statistics_add_data_type (*key_data, GPM_COLOUR_BLUE, _("No data"));
 		gpm_statistics_add_event_type (*key_event, GPM_EVENT_HIBERNATE,
 					       GPM_COLOUR_CYAN,
 					       GPM_GRAPH_WIDGET_SHAPE_SQUARE,

Modified: trunk/src/gpm-profile.c
==============================================================================
--- trunk/src/gpm-profile.c	(original)
+++ trunk/src/gpm-profile.c	Mon Jun  2 10:10:46 2008
@@ -198,9 +198,9 @@
 		value_accuracy = gpm_array_float_get (array_accuracy, i);
 		/* only set points that are not zero */
 		if (value_data == 0) {
-			gpm_array_set (profile->priv->present_array_data, i, i, value_data, GPM_COLOUR_BLUE);
-		} else if (value_accuracy == 0) {
 			gpm_array_set (profile->priv->present_array_data, i, i, value_data, GPM_COLOUR_DARK_GREY);
+		} else if (value_accuracy == 0) {
+			gpm_array_set (profile->priv->present_array_data, i, i, value_data, GPM_COLOUR_BLUE);
 		} else if (value_data > 0) {
 			gpm_array_set (profile->priv->present_array_data, i, i, value_data, GPM_COLOUR_RED);
 		}
@@ -254,12 +254,12 @@
 	g_return_val_if_fail (profile != NULL, NULL);
 	g_return_val_if_fail (GPM_IS_PROFILE (profile), NULL);
 
-	if (discharge == TRUE) {
-		colour_active = GPM_COLOUR_RED;
-		colour_nonactive = GPM_COLOUR_DARK_RED;
-	} else {
+	if (discharge) {
 		colour_active = GPM_COLOUR_BLUE;
 		colour_nonactive = GPM_COLOUR_DARK_BLUE;
+	} else {
+		colour_active = GPM_COLOUR_RED;
+		colour_nonactive = GPM_COLOUR_DARK_RED;
 	}
 
 	/* get the correct data */



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