summaryrefslogtreecommitdiff
path: root/battstat/battstat_applet.c
diff options
context:
space:
mode:
Diffstat (limited to 'battstat/battstat_applet.c')
-rw-r--r--battstat/battstat_applet.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/battstat/battstat_applet.c b/battstat/battstat_applet.c
index ce1598dc..07203996 100644
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -648,7 +648,6 @@ check_for_updates (gpointer data)
}
}
-
possibly_update_status_icon (battstat, &info);
if (!info.on_ac_power &&
@@ -676,8 +675,7 @@ check_for_updates (gpointer data)
}
if (battstat->last_charging &&
- battstat->last_acline_status &&
- battstat->last_acline_status!=1000 &&
+ battstat->last_acline_status == POWER_STATUS_ON &&
!info.charging &&
info.on_ac_power &&
info.present &&
@@ -798,7 +796,6 @@ battstat_show_help (ProgressData *battstat,
}
}
-
/* Called when the user selects the 'help' menu item.
*/
static void
@@ -927,6 +924,7 @@ static void
load_preferences (ProgressData *battstat)
{
GSettings *settings = battstat->settings;
+ gdouble red_val;
if (DEBUG) g_print ("load_preferences ()\n");
@@ -935,10 +933,12 @@ load_preferences (ProgressData *battstat)
battstat->red_value_is_time = g_settings_get_boolean (settings, "red-value-is-time");
/* automatically calculate orangle and yellow values from the red value */
- battstat->orange_val = battstat->red_val * ORANGE_MULTIPLIER;
+ red_val = (gdouble) battstat->red_val;
+
+ battstat->orange_val = (guint) (ORANGE_MULTIPLIER * red_val);
battstat->orange_val = MIN (battstat->orange_val, 100);
- battstat->yellow_val = battstat->red_val * YELLOW_MULTIPLIER;
+ battstat->yellow_val = (guint) (YELLOW_MULTIPLIER * red_val);
battstat->yellow_val = MIN (battstat->yellow_val, 100);
battstat->lowbattnotification = g_settings_get_boolean (settings, "low-battery-notification");
@@ -1093,11 +1093,11 @@ create_layout (ProgressData *battstat)
G_CALLBACK (destroy_applet),
battstat);
- g_signal_connect (battstat->applet, "change_orient",
+ g_signal_connect (battstat->applet, "change-orient",
G_CALLBACK (change_orient),
battstat);
- g_signal_connect (battstat->applet, "size_allocate",
+ g_signal_connect (battstat->applet, "size-allocate",
G_CALLBACK (size_allocate),
battstat);
@@ -1130,7 +1130,9 @@ battstat_applet_fill (MatePanelApplet *applet)
if (DEBUG) g_print ("main ()\n");
+#ifndef ENABLE_IN_PROCESS
g_set_application_name (_("Battery Charge Monitor"));
+#endif
gtk_window_set_default_icon_name ("battery");
@@ -1145,8 +1147,8 @@ battstat_applet_fill (MatePanelApplet *applet)
battstat->applet = GTK_WIDGET (applet);
battstat->refresh_label = TRUE;
battstat->last_batt_life = 1000;
- battstat->last_acline_status = 1000;
- battstat->last_charging = 1000;
+ battstat->last_acline_status = POWER_STATUS_UNKNOWN;
+ battstat->last_charging = POWER_STATUS_UNKNOWN;
battstat->orienttype = mate_panel_applet_get_orient (applet);
battstat->battery_low_dialog = NULL;
battstat->battery_low_label = NULL;
@@ -1210,10 +1212,8 @@ battstat_applet_factory (MatePanelApplet *applet,
return retval;
}
-
-MATE_PANEL_APPLET_OUT_PROCESS_FACTORY ("BattstatAppletFactory",
- PANEL_TYPE_APPLET,
- "battstat",
- battstat_applet_factory,
- NULL)
-
+PANEL_APPLET_FACTORY ("BattstatAppletFactory",
+ PANEL_TYPE_APPLET,
+ "battstat",
+ battstat_applet_factory,
+ NULL)