[Goodies-commits] r7389 - in xfce4-power-manager/trunk: . src

Ali Abdallah aliov at xfce.org
Thu May 21 16:33:06 CEST 2009


Author: aliov
Date: 2009-05-21 14:33:05 +0000 (Thu, 21 May 2009)
New Revision: 7389

Modified:
   xfce4-power-manager/trunk/ChangeLog
   xfce4-power-manager/trunk/src/xfpm-battery.c
   xfce4-power-manager/trunk/src/xfpm-button-hal.c
   xfce4-power-manager/trunk/src/xfpm-button-xf86.c
   xfce4-power-manager/trunk/src/xfpm-engine.c
   xfce4-power-manager/trunk/src/xfpm-inhibit.c
   xfce4-power-manager/trunk/src/xfpm-supply.c
Log:
	*: Properly free the inhibitor data when the inhibitor
	*: Don't accept events at all if they were not mapped.
	*: Fix warning button action in the critical notification.
	*: Show the "estimated time to be fully charged" when we have
	relevent estimation.
	*: Fix suspend/hibernate button configuration problem.
	
	

Modified: xfce4-power-manager/trunk/ChangeLog
===================================================================
--- xfce4-power-manager/trunk/ChangeLog	2009-05-21 13:24:42 UTC (rev 7388)
+++ xfce4-power-manager/trunk/ChangeLog	2009-05-21 14:33:05 UTC (rev 7389)
@@ -1,6 +1,14 @@
-
+2009-05-21 15:00 Ali aliov at xfce.org
+	*: Properly free the inhibitor data when the inhibitor
+	*: Don't accept events at all if they were not mapped.
+	*: Fix warning button action in the critical notification.
+	*: Show the "estimated time to be fully charged" when we have
+	relevent estimation.
+	*: Fix suspend/hibernate button configuration problem.
+	
 2009-05-21 10:30 Ali aliov at xfce.org 
 	 * : Russian translation updates
+	
 2009-05-20 10:30
 	* :Correct the makefile of the doc
 	* :Reduce suspend/hibernate timeout if the user disable screen saver lock

Modified: xfce4-power-manager/trunk/src/xfpm-battery.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-battery.c	2009-05-21 13:24:42 UTC (rev 7388)
+++ xfce4-power-manager/trunk/src/xfpm-battery.c	2009-05-21 14:33:05 UTC (rev 7389)
@@ -437,7 +437,7 @@
                                    hours,hours > 1 ? _("hours") : _("hour") ,
                                    minutes_left, minutes_left > 1 ? _("minutes") : _("minute"));
 
-	tip = hours != 0 && minutes_left != 0 ? 
+	tip = (hours != 0 || minutes_left != 0 ) ? 
 	     g_strdup_printf ("%s\n%s", tip_no_time, time_str) :
 	     g_strdup (tip_no_time);
 	     

Modified: xfce4-power-manager/trunk/src/xfpm-button-hal.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-button-hal.c	2009-05-21 13:24:42 UTC (rev 7388)
+++ xfce4-power-manager/trunk/src/xfpm-button-hal.c	2009-05-21 14:33:05 UTC (rev 7389)
@@ -174,6 +174,8 @@
 	
 	if ( xfpm_strequal (button_type, "lid") )
 	    bt->priv->mapped_keys |= LID_KEY;
+	else if ( xfpm_strequal (button_type, "suspend") )
+	    bt->priv->mapped_keys |= SLEEP_KEY;
 	else if ( xfpm_strequal (button_type, "sleep") )
 	    bt->priv->mapped_keys |= SLEEP_KEY;
 	else if ( xfpm_strequal (button_type, "hibernate") )

Modified: xfce4-power-manager/trunk/src/xfpm-button-xf86.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-button-xf86.c	2009-05-21 13:24:42 UTC (rev 7388)
+++ xfce4-power-manager/trunk/src/xfpm-button-xf86.c	2009-05-21 14:33:05 UTC (rev 7389)
@@ -50,8 +50,6 @@
 
 static void xfpm_button_xf86_finalize   (GObject *object);
 
-static gpointer xfpm_button_xf86_object = NULL;
-
 #define XFPM_BUTTON_XF86_GET_PRIVATE(o) \
 (G_TYPE_INSTANCE_GET_PRIVATE((o), XFPM_TYPE_BUTTON_XF86, XfpmButtonXf86Private))
 
@@ -248,16 +246,9 @@
 XfpmButtonXf86 *
 xfpm_button_xf86_new(void)
 {
-    if ( xfpm_button_xf86_object != NULL )
-    {
-	g_object_ref (xfpm_button_xf86_object);
-    }
-    else
-    {
-	xfpm_button_xf86_object = g_object_new (XFPM_TYPE_BUTTON_XF86, NULL);
-	g_object_add_weak_pointer (xfpm_button_xf86_object, &xfpm_button_xf86_object);
-    }
-    return XFPM_BUTTON_XF86 (xfpm_button_xf86_object);
+    XfpmButtonXf86 *button = NULL;
+    button = g_object_new (XFPM_TYPE_BUTTON_XF86, NULL);
+    return button;
 }
 
 guint8 xfpm_button_xf86_get_mapped_buttons (XfpmButtonXf86 *button)

Modified: xfce4-power-manager/trunk/src/xfpm-engine.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-engine.c	2009-05-21 13:24:42 UTC (rev 7388)
+++ xfce4-power-manager/trunk/src/xfpm-engine.c	2009-05-21 14:33:05 UTC (rev 7389)
@@ -219,15 +219,32 @@
     if ( type == BUTTON_MON_BRIGHTNESS_DOWN || type == BUTTON_MON_BRIGHTNESS_UP )
 	return;
     
-    if ( type == BUTTON_POWER_OFF || type == BUTTON_SLEEP || type == BUTTON_HIBERNATE )
-	shutdown = xfpm_xfconf_get_property_enum (engine->priv->conf, 
-					          type == BUTTON_POWER_OFF ? POWER_SWITCH_CFG :
-					          SLEEP_SWITCH_CFG );
-    else
+    if ( type == BUTTON_POWER_OFF )
+    {
 	shutdown = xfpm_xfconf_get_property_enum (engine->priv->conf,
+						  POWER_SWITCH_CFG);
+    }
+    else if ( type == BUTTON_SLEEP )
+    {
+	shutdown = xfpm_xfconf_get_property_enum (engine->priv->conf,
+						  SLEEP_SWITCH_CFG);
+    }
+    else if ( type == BUTTON_HIBERNATE )
+    {
+	shutdown = xfpm_xfconf_get_property_enum (engine->priv->conf,
+						  HIBERNATE_SWITCH_CFG);
+    }
+    else if ( type == BUTTON_LID_CLOSED )
+    {
+	shutdown = xfpm_xfconf_get_property_enum (engine->priv->conf,
 					          engine->priv->on_battery ?
 					          LID_SWITCH_ON_BATTERY_CFG :
 					          LID_SWITCH_ON_AC_CFG);
+    }
+    else
+    {
+	g_return_if_reached ();
+    }
 	
     if ( shutdown == XFPM_ASK )
 	xfpm_shutdown_ask (engine->priv->shutdown);

Modified: xfce4-power-manager/trunk/src/xfpm-inhibit.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-inhibit.c	2009-05-21 13:24:42 UTC (rev 7388)
+++ xfce4-power-manager/trunk/src/xfpm-inhibit.c	2009-05-21 14:33:05 UTC (rev 7389)
@@ -77,11 +77,11 @@
 {
     g_return_if_fail (inhibitor != NULL );
     
+    g_ptr_array_remove (inhibit->priv->array, inhibitor);
+    
     g_free (inhibitor->app_name);
     g_free (inhibitor->unique_name);
     g_free (inhibitor);
-    
-    g_ptr_array_remove (inhibit->priv->array, inhibitor);
 }
 
 static gboolean
@@ -195,8 +195,7 @@
     if ( inhibitor )
     {
 	TRACE ("Application=%s with unique connection name=%s disconnected", inhibitor->app_name, inhibitor->unique_name);
-	g_free (inhibitor);
-	g_ptr_array_remove (inhibit->priv->array, inhibitor);
+	xfpm_inhibit_free_inhibitor (inhibit, inhibitor);
 	xfpm_inhibit_has_inhibit_changed (inhibit);
     }
 }

Modified: xfce4-power-manager/trunk/src/xfpm-supply.c
===================================================================
--- xfce4-power-manager/trunk/src/xfpm-supply.c	2009-05-21 13:24:42 UTC (rev 7388)
+++ xfce4-power-manager/trunk/src/xfpm-supply.c	2009-05-21 14:33:05 UTC (rev 7389)
@@ -283,7 +283,7 @@
     if ( xfpm_strequal(action, "shutdown") )
 	g_signal_emit (G_OBJECT(supply ), signals[SHUTDOWN_REQUEST], 0, TRUE, XFPM_DO_SHUTDOWN);
     else if ( xfpm_strequal(action, "hibernate") )
-	g_signal_emit (G_OBJECT(supply ), signals[SHUTDOWN_REQUEST], 0, TRUE, XFPM_DO_SHUTDOWN);
+	g_signal_emit (G_OBJECT(supply ), signals[SHUTDOWN_REQUEST], 0, TRUE, XFPM_DO_HIBERNATE);
 }
 
 static void




More information about the Goodies-commits mailing list