diff options
-rw-r--r-- | TODO | 7 | ||||
-rw-r--r-- | src/xfpm-battery.c | 44 | ||||
-rw-r--r-- | src/xfpm-battery.h | 3 | ||||
-rw-r--r-- | src/xfpm-hal.c | 11 | ||||
-rw-r--r-- | src/xfpm-settings.c | 28 |
5 files changed, 7 insertions, 86 deletions
@@ -1,5 +1,4 @@ -1)-better notification support. -2)-Find or draw icons for XFPM. -3)-Translation +1)-Find or draw icons for XFPM. +2)-Translation -4)- Release
\ No newline at end of file +3)- Release
\ No newline at end of file diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c index 013831eb..501c270f 100644 --- a/src/xfpm-battery.c +++ b/src/xfpm-battery.c @@ -80,8 +80,6 @@ static void xfpm_battery_refresh_notification(XfpmBattery *batt); static void xfpm_battery_refresh_critical_charge(XfpmBattery *batt); static void xfpm_battery_refresh(XfpmBattery *batt); -static void xfpm_battery_set_power_save(XfpmBattery *batt); - static void xfpm_battery_notify_cb (GObject *object, GParamSpec *arg1, gpointer data); @@ -145,7 +143,6 @@ enum PROP_AC_ADAPTER, PROP_CRITICAL_CHARGE, PROP_CRITICAL_ACTION, - PROP_POWER_SAVE, #ifdef HAVE_LIBNOTIFY PROP_ENABLE_NOTIFICATION, #endif @@ -224,13 +221,6 @@ xfpm_battery_class_init(XfpmBatteryClass *klass) XFPM_TYPE_SHOW_ICON, 0, G_PARAM_READWRITE)); - g_object_class_install_property(gobject_class, - PROP_POWER_SAVE, - g_param_spec_boolean("enable-powersave", - "Enable power save", - "power save", - TRUE, - G_PARAM_READWRITE)); g_type_class_add_private(klass,sizeof(XfpmBatteryPrivate)); } @@ -317,9 +307,6 @@ static void xfpm_battery_set_property(GObject *object, case PROP_SHOW_TRAY_ICON: battery->show_tray = g_value_get_enum(value); break; - case PROP_POWER_SAVE: - battery->power_save = g_value_get_boolean(value); - break; #ifdef HAVE_LIBNOTIFY case PROP_ENABLE_NOTIFICATION: battery->notify_enabled = g_value_get_boolean(value); @@ -353,9 +340,6 @@ static void xfpm_battery_get_property(GObject *object, case PROP_SHOW_TRAY_ICON: g_value_set_enum(value, battery->show_tray); break; - case PROP_POWER_SAVE: - g_value_set_boolean(value,battery->power_save); - break; #ifdef HAVE_LIBNOTIFY case PROP_ENABLE_NOTIFICATION: g_value_set_boolean(value, battery->notify_enabled); @@ -518,23 +502,6 @@ xfpm_battery_refresh(XfpmBattery *batt) xfpm_battery_refresh_tray_icon(batt); } -static void -xfpm_battery_set_power_save(XfpmBattery *batt) -{ - XfpmBatteryPrivate *priv; - priv = XFPM_BATTERY_GET_PRIVATE(batt); - GError *error = NULL; - - xfpm_hal_set_power_save(priv->hal,batt->power_save,&error); - - if ( error ) - { - XFPM_DEBUG("%s : \n",error->message); - g_error_free(error); - } - -} - static void xfpm_battery_notify_cb (GObject *object, GParamSpec *arg1, @@ -556,15 +523,6 @@ xfpm_battery_notify_cb (GObject *object, xfpm_battery_refresh_notification(XFPM_BATTERY(object)); } #endif - else if ( !strcmp(arg1->name,"enable-powersave") ) - { - xfpm_battery_set_power_save(XFPM_BATTERY(object)); - } - else if ( !strcmp(arg1->name,"on-ac-adapter") ) - { - if ( XFPM_BATTERY(object)->power_save ) - xfpm_battery_set_power_save(XFPM_BATTERY(object)); - } } static void @@ -582,7 +540,6 @@ xfpm_battery_load_config(XfpmBattery *batt) #ifdef HAVE_LIBNOTIFY batt->notify_enabled = TRUE; #endif - batt->power_save = FALSE; batt->show_tray = ALWAYS; return; } @@ -593,7 +550,6 @@ xfpm_battery_load_config(XfpmBattery *batt) batt->critical_level = xfconf_channel_get_uint(channel,CRITICAL_BATT_CFG,10); batt->critical_action = xfconf_channel_get_uint(channel,CRITICAL_BATT_ACTION_CFG,XFPM_DO_NOTHING); batt->show_tray = xfconf_channel_get_uint(channel,SHOW_TRAY_ICON_CFG,ALWAYS); - batt->power_save = xfconf_channel_get_bool(channel,POWER_SAVE_CFG,FALSE); #ifdef HAVE_LIBNOTIFY batt->notify_enabled = xfconf_channel_get_bool(channel,BATT_STATE_NOTIFICATION_CFG,TRUE); #endif diff --git a/src/xfpm-battery.h b/src/xfpm-battery.h index a62e2fa3..16804a1c 100644 --- a/src/xfpm-battery.h +++ b/src/xfpm-battery.h @@ -50,8 +50,7 @@ typedef struct gboolean can_hibernate; gboolean can_suspend; - gboolean power_save; - + #ifdef HAVE_LIBNOTIFY gboolean notify_enabled; #endif diff --git a/src/xfpm-hal.c b/src/xfpm-hal.c index 41436fd2..de06ceab 100644 --- a/src/xfpm-hal.c +++ b/src/xfpm-hal.c @@ -51,15 +51,6 @@ static void xfpm_hal_device_property_modified (LibHalContext *ctx, const gchar *key, dbus_bool_t is_removed, dbus_bool_t is_added); -/* -static void xfpm_hal_device_new_capability (LibHalContext *ctx, - const gchar *udi, - const gchar *capability); - -static void xfpm_hal_device_lost_capability (LibHalContext *ctx, - const gchar *udi, - const gchar *capability); -*/ static void xfpm_hal_device_condition (LibHalContext *ctx, const gchar *udi, const gchar *condition_name, @@ -302,7 +293,7 @@ gboolean xfpm_hal_connect_to_signals(XfpmHal *hal, gchar ** xfpm_hal_get_device_udi_by_capability(XfpmHal *xfpm_hal,const gchar *capability, gint *num,GError **gerror) { - + g_return_val_if_fail(XFPM_IS_HAL(xfpm_hal),NULL); XfpmHalPrivate *priv = XFPM_HAL_GET_PRIVATE(xfpm_hal); diff --git a/src/xfpm-settings.c b/src/xfpm-settings.c index ac3c9a30..e11b1919 100644 --- a/src/xfpm-settings.c +++ b/src/xfpm-settings.c @@ -165,17 +165,6 @@ set_lcd_brightness_cb(GtkWidget *widget,XfconfChannel *channel) } } -static void -set_power_save_cb(GtkWidget *widget,XfconfChannel *channel) -{ - gboolean value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); - - if(!xfconf_channel_set_bool(channel,POWER_SAVE_CFG,value)) - { - g_critical("Cannot set value %s\n",POWER_SAVE_CFG); - } -} - #ifdef HAVE_DPMS static void set_dpms_cb(GtkWidget *widget,XfconfChannel *channel) @@ -394,7 +383,6 @@ xfpm_settings_battery(XfconfChannel *channel, gboolean can_hibernate) GtkWidget *label; GtkWidget *critical_spin; GtkWidget *action; - GtkWidget *check_powersave; table = gtk_table_new(4,2,TRUE); gtk_widget_show(table); @@ -434,29 +422,17 @@ xfpm_settings_battery(XfconfChannel *channel, gboolean can_hibernate) g_signal_connect(action,"changed",G_CALLBACK(set_critical_action_cb),channel); gtk_table_attach(GTK_TABLE(table),action,1,2,1,2,GTK_SHRINK,GTK_SHRINK,0,0); - /// Enable power save - label = gtk_label_new(_("Enable power save on battery power")); - gtk_widget_show(label); - check_powersave = gtk_check_button_new(); - gtk_widget_show(check_powersave); - gtk_table_attach_defaults(GTK_TABLE(table),label,0,1,2,3); - gtk_table_attach(GTK_TABLE(table),check_powersave,1,2,2,3,GTK_SHRINK,GTK_SHRINK,0,0); - g_signal_connect(check_powersave,"toggled",G_CALLBACK(set_power_save_cb),channel); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_powersave), - xfconf_channel_get_bool(channel,POWER_SAVE_CFG,FALSE)); - - #ifdef HAVE_LIBNOTIFY GtkWidget *notify_bt; label = gtk_label_new(_("Enable battery state notification")); gtk_widget_show(label); - gtk_table_attach_defaults(GTK_TABLE(table),label,0,1,3,4); + gtk_table_attach_defaults(GTK_TABLE(table),label,0,1,2,3); notify_bt = gtk_check_button_new(); gtk_widget_show(notify_bt); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(notify_bt), xfconf_channel_get_bool(channel,BATT_STATE_NOTIFICATION_CFG,TRUE)); g_signal_connect(notify_bt,"toggled",G_CALLBACK(set_battery_state_notification_cb),channel); - gtk_table_attach(GTK_TABLE(table),notify_bt,1,2,3,4,GTK_SHRINK,GTK_SHRINK,0,0); + gtk_table_attach(GTK_TABLE(table),notify_bt,1,2,2,3,GTK_SHRINK,GTK_SHRINK,0,0); #endif gtk_container_add(GTK_CONTAINER(align),table); |