[Xfce4-commits] <xfce4-power-manager:nick/upower-session> Stop using adapter.

Nick Schermer noreply at xfce.org
Fri Mar 23 21:02:01 CET 2012


Updating branch refs/heads/nick/upower-session
         to cdb7543fc11febd36de28b8b1fb37c2e14930272 (commit)
       from eb486dcfb788c8ec36f07b2015481e590ea24ede (commit)

commit cdb7543fc11febd36de28b8b1fb37c2e14930272
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Mar 23 20:57:45 2012 +0100

    Stop using adapter.
    
    Code and stuff mixed both adapter and adaptor all the time.

 common/xfpm-icons.h                                |    2 +-
 data/icons/16x16/status/Makefile.am                |    2 +-
 .../{xfpm-ac-adapter.png => xfpm-ac-adaptor.png}   |  Bin 719 -> 719 bytes
 data/icons/22x22/status/Makefile.am                |    2 +-
 .../{xfpm-ac-adapter.png => xfpm-ac-adaptor.png}   |  Bin 1168 -> 1168 bytes
 data/icons/24x24/status/Makefile.am                |    2 +-
 .../{xfpm-ac-adapter.png => xfpm-ac-adaptor.png}   |  Bin 1170 -> 1170 bytes
 data/icons/48x48/status/Makefile.am                |    2 +-
 .../{xfpm-ac-adapter.png => xfpm-ac-adaptor.png}   |  Bin 3155 -> 3155 bytes
 data/icons/scalable/status/Makefile.am             |    2 +-
 .../{xfpm-ac-adapter.svg => xfpm-ac-adaptor.svg}   |    0
 data/interfaces/xfpm-settings.ui                   |    2 +-
 settings/xfce4-power-manager-settings.desktop.in   |    2 +-
 settings/xfpm-settings.c                           |    2 +-
 src/xfce4-power-manager.desktop.in                 |    2 +-
 src/xfpm-battery.c                                 |    4 +-
 src/xfpm-power-common.c                            |    2 +-
 src/xfpm-power-info.c                              |    2 +-
 src/xfpm-power.c                                   |   49 ++++++++++----------
 19 files changed, 38 insertions(+), 39 deletions(-)

diff --git a/common/xfpm-icons.h b/common/xfpm-icons.h
index 179ecc9..540b773 100644
--- a/common/xfpm-icons.h
+++ b/common/xfpm-icons.h
@@ -23,7 +23,7 @@
 
 G_BEGIN_DECLS
 
-#define XFPM_AC_ADAPTER_ICON			"xfpm-ac-adapter"
+#define XFPM_AC_ADAPTOR_ICON			"xfpm-ac-adaptor"
 
 #define XFPM_BATTERY_ICON			"battery"
 #define XFPM_UPS_ICON				"xfpm-ups-100"
diff --git a/data/icons/16x16/status/Makefile.am b/data/icons/16x16/status/Makefile.am
index 038842d..8c57414 100644
--- a/data/icons/16x16/status/Makefile.am
+++ b/data/icons/16x16/status/Makefile.am
@@ -4,7 +4,7 @@ EXTRA_DIST =				\
 Datadir = $(datadir)/icons/hicolor/16x16/status
 
 Data_DATA =				\
-	xfpm-ac-adapter.png		\
+	xfpm-ac-adaptor.png		\
 	xfpm-primary-000.png		\
 	xfpm-primary-020.png		\
 	xfpm-primary-040.png		\
diff --git a/data/icons/16x16/status/xfpm-ac-adapter.png b/data/icons/16x16/status/xfpm-ac-adaptor.png
similarity index 100%
rename from data/icons/16x16/status/xfpm-ac-adapter.png
rename to data/icons/16x16/status/xfpm-ac-adaptor.png
diff --git a/data/icons/22x22/status/Makefile.am b/data/icons/22x22/status/Makefile.am
index 3922edd..f0d99de 100644
--- a/data/icons/22x22/status/Makefile.am
+++ b/data/icons/22x22/status/Makefile.am
@@ -4,7 +4,7 @@ EXTRA_DIST =				\
 Datadir = $(datadir)/icons/hicolor/22x22/status
 
 Data_DATA =				\
-	xfpm-ac-adapter.png		\
+	xfpm-ac-adaptor.png		\
 	xfpm-primary-000.png		\
 	xfpm-primary-020.png		\
 	xfpm-primary-040.png		\
diff --git a/data/icons/22x22/status/xfpm-ac-adapter.png b/data/icons/22x22/status/xfpm-ac-adaptor.png
similarity index 100%
rename from data/icons/22x22/status/xfpm-ac-adapter.png
rename to data/icons/22x22/status/xfpm-ac-adaptor.png
diff --git a/data/icons/24x24/status/Makefile.am b/data/icons/24x24/status/Makefile.am
index 327187a..3a89f0a 100644
--- a/data/icons/24x24/status/Makefile.am
+++ b/data/icons/24x24/status/Makefile.am
@@ -4,7 +4,7 @@ EXTRA_DIST =				\
 Datadir = $(datadir)/icons/hicolor/24x24/status
 
 Data_DATA =				\
-	xfpm-ac-adapter.png		\
+	xfpm-ac-adaptor.png		\
 	xfpm-primary-000.png		\
 	xfpm-primary-020.png		\
 	xfpm-primary-040.png		\
diff --git a/data/icons/24x24/status/xfpm-ac-adapter.png b/data/icons/24x24/status/xfpm-ac-adaptor.png
similarity index 100%
rename from data/icons/24x24/status/xfpm-ac-adapter.png
rename to data/icons/24x24/status/xfpm-ac-adaptor.png
diff --git a/data/icons/48x48/status/Makefile.am b/data/icons/48x48/status/Makefile.am
index f442fed..dbcbe61 100644
--- a/data/icons/48x48/status/Makefile.am
+++ b/data/icons/48x48/status/Makefile.am
@@ -4,7 +4,7 @@ EXTRA_DIST =				\
 Datadir = $(datadir)/icons/hicolor/48x48/status
 
 Data_DATA =				\
-	xfpm-ac-adapter.png		\
+	xfpm-ac-adaptor.png		\
 	xfpm-primary-000.png		\
 	xfpm-primary-020.png		\
 	xfpm-primary-040.png		\
diff --git a/data/icons/48x48/status/xfpm-ac-adapter.png b/data/icons/48x48/status/xfpm-ac-adaptor.png
similarity index 100%
rename from data/icons/48x48/status/xfpm-ac-adapter.png
rename to data/icons/48x48/status/xfpm-ac-adaptor.png
diff --git a/data/icons/scalable/status/Makefile.am b/data/icons/scalable/status/Makefile.am
index eb1fa94..3fbe030 100644
--- a/data/icons/scalable/status/Makefile.am
+++ b/data/icons/scalable/status/Makefile.am
@@ -4,7 +4,7 @@ EXTRA_DIST =				\
 Datadir = $(datadir)/icons/hicolor/scalable/status
 
 Data_DATA =				\
-	xfpm-ac-adapter.svg		\
+	xfpm-ac-adaptor.svg		\
 	xfpm-primary-000.svg		\
 	xfpm-primary-020.svg		\
 	xfpm-primary-040.svg		\
diff --git a/data/icons/scalable/status/xfpm-ac-adapter.svg b/data/icons/scalable/status/xfpm-ac-adaptor.svg
similarity index 100%
rename from data/icons/scalable/status/xfpm-ac-adapter.svg
rename to data/icons/scalable/status/xfpm-ac-adaptor.svg
diff --git a/data/interfaces/xfpm-settings.ui b/data/interfaces/xfpm-settings.ui
index 98f8710..2ca01a3 100644
--- a/data/interfaces/xfpm-settings.ui
+++ b/data/interfaces/xfpm-settings.ui
@@ -127,7 +127,7 @@
   <object class="XfceTitledDialog" id="xfpm-settings-dialog">
     <property name="title" translatable="yes">Xfce Power Manager</property>
     <property name="window_position">center-on-parent</property>
-    <property name="icon_name">xfpm-ac-adapter</property>
+    <property name="icon_name">xfpm-ac-adaptor</property>
     <property name="type_hint">dialog</property>
     <property name="subtitle" translatable="yes">Power manager settings</property>
     <child internal-child="vbox">
diff --git a/settings/xfce4-power-manager-settings.desktop.in b/settings/xfce4-power-manager-settings.desktop.in
index ee9d4fb..0199e34 100644
--- a/settings/xfce4-power-manager-settings.desktop.in
+++ b/settings/xfce4-power-manager-settings.desktop.in
@@ -4,7 +4,7 @@ _Name=Power Manager
 _GenericName=Power Manager
 _Comment=Settings for the Xfce Power Manager
 Exec=xfce4-power-manager-settings
-Icon=xfpm-ac-adapter
+Icon=xfpm-ac-adaptor
 Terminal=false
 Type=Application
 Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-PersonalSettings;
diff --git a/settings/xfpm-settings.c b/settings/xfpm-settings.c
index 67cc5a1..a6b9cf3 100644
--- a/settings/xfpm-settings.c
+++ b/settings/xfpm-settings.c
@@ -1550,7 +1550,7 @@ xfpm_settings_tree_view (XfconfChannel *channel, gboolean system_laptop)
     i++;
     
     /* ON ac power */
-    pix = xfpm_icon_load (XFPM_AC_ADAPTER_ICON, 48); 
+    pix = xfpm_icon_load (XFPM_AC_ADAPTOR_ICON, 48); 
     gtk_list_store_append(list_store, &iter);
     if ( pix )
     {
diff --git a/src/xfce4-power-manager.desktop.in b/src/xfce4-power-manager.desktop.in
index 34074eb..3d9d38a 100644
--- a/src/xfce4-power-manager.desktop.in
+++ b/src/xfce4-power-manager.desktop.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
 _Name=Power Manager
 _Comment=Power management for the Xfce desktop
-Icon=xfpm-ac-adapter
+Icon=xfpm-ac-adaptor
 Exec=xfce4-power-manager
 Terminal=false
 Type=Application
diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c
index 2b4f03f..be3e9ff 100644
--- a/src/xfpm-battery.c
+++ b/src/xfpm-battery.c
@@ -318,8 +318,6 @@ xfpm_battery_refresh_icon (XfpmBattery *battery)
     gboolean is_present;
     gdouble percentage;
 
-    XFPM_DEBUG ("Battery state %d", battery->device_state);
-
     g_snprintf (icon_name, sizeof (icon_name), GTK_STOCK_MISSING_IMAGE);
 
     g_object_get (battery->device,
@@ -618,6 +616,8 @@ xfpm_battery_changed_cb (UpDevice *device, XfpmBattery *battery)
 
     if ( state != battery->device_state )
     {
+        XFPM_DEBUG ("Battery state %d", state);
+
         battery->device_state = state;
         xfpm_battery_refresh_visible (battery);
         xfpm_battery_notify_state (battery);
diff --git a/src/xfpm-power-common.c b/src/xfpm-power-common.c
index cdfa30d..6da52d8 100644
--- a/src/xfpm-power-common.c
+++ b/src/xfpm-power-common.c
@@ -115,7 +115,7 @@ xfpm_power_get_icon_name (UpDeviceKind kind)
             return XFPM_UPS_ICON;
 
         case UP_DEVICE_KIND_LINE_POWER:
-            return XFPM_AC_ADAPTER_ICON;
+            return XFPM_AC_ADAPTOR_ICON;
 
         case UP_DEVICE_KIND_MOUSE:
             return XFPM_MOUSE_ICON;
diff --git a/src/xfpm-power-info.c b/src/xfpm-power-info.c
index 62658bd..94f4ac9 100644
--- a/src/xfpm-power-info.c
+++ b/src/xfpm-power-info.c
@@ -772,7 +772,7 @@ xfpm_info_create (XfpmInfo *info)
     gtk_box_pack_start (GTK_BOX (hbox), info->notebook, TRUE, TRUE, 0);
     gtk_notebook_set_show_tabs (GTK_NOTEBOOK (info->notebook), FALSE);
 
-    /* Show power devices information, AC adapter, batteries */
+    /* Show power devices information, AC adaptor, batteries */
     xfpm_info_power_devices (info);
 
     /* Show CPU wakeups */
diff --git a/src/xfpm-power.c b/src/xfpm-power.c
index cbeb8bd..b2794f8 100644
--- a/src/xfpm-power.c
+++ b/src/xfpm-power.c
@@ -103,8 +103,8 @@ struct _XfpmPower
     /* last know on-battery state */
     gboolean on_battery;
 
-    /* ac-adapter icon */
-    GtkStatusIcon *adapter_icon;
+    /* ac-adaptor icon */
+    GtkStatusIcon *adaptor_icon;
 
     XfpmBatteryCharge overall_state;
     gboolean          critical_action_done;
@@ -289,7 +289,7 @@ xfpm_power_show_tray_menu (XfpmPower *power,
      **/
     /* TRANSLATOR: Mode here is the power profile (presentation, power save, normal) */
     mi = gtk_image_menu_item_new_with_label (_("Mode"));
-    img = gtk_image_new_from_icon_name (XFPM_AC_ADAPTER_ICON, GTK_ICON_SIZE_MENU);
+    img = gtk_image_new_from_icon_name (XFPM_AC_ADAPTOR_ICON, GTK_ICON_SIZE_MENU);
     gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img);
     gtk_widget_set_sensitive (mi,TRUE);
     gtk_widget_show (mi);
@@ -545,7 +545,8 @@ xfpm_power_add_device (XfpmPower *power, UpDevice *device)
             break;
 
         case UP_DEVICE_KIND_LINE_POWER:
-            g_warning ("Unable to monitor unkown power device: %s", "TODO");
+            g_warning ("Unable to monitor unkown power device: %s",
+                       up_device_get_object_path (device));
             break;
 
         default:
@@ -672,31 +673,31 @@ xfpm_power_device_changed_cb (UpClient *up_client, UpDevice *device, XfpmPower *
 }
 
 static void
-xfpm_power_hide_adapter_icon (XfpmPower *power)
+xfpm_power_hide_adaptor_icon (XfpmPower *power)
 {
-     XFPM_DEBUG ("Hide adaptor icon");
-
-    if ( power->adapter_icon )
+    if ( power->adaptor_icon )
     {
-        g_object_unref (power->adapter_icon);
-        power->adapter_icon = NULL;
+        XFPM_DEBUG ("Hide adaptor icon");
+
+        g_object_unref (power->adaptor_icon);
+        power->adaptor_icon = NULL;
     }
 }
 
 static void
-xfpm_power_show_adapter_icon (XfpmPower *power)
+xfpm_power_show_adaptor_icon (XfpmPower *power)
 {
-    g_return_if_fail (power->adapter_icon == NULL);
+    g_return_if_fail (power->adaptor_icon == NULL);
 
-    power->adapter_icon = gtk_status_icon_new ();
+    power->adaptor_icon = gtk_status_icon_new ();
 
     XFPM_DEBUG ("Showing adaptor icon");
 
-    gtk_status_icon_set_from_icon_name (power->adapter_icon, XFPM_AC_ADAPTER_ICON);
+    gtk_status_icon_set_from_icon_name (power->adaptor_icon, XFPM_AC_ADAPTOR_ICON);
 
-    gtk_status_icon_set_visible (power->adapter_icon, TRUE);
+    gtk_status_icon_set_visible (power->adaptor_icon, TRUE);
 
-    g_signal_connect (power->adapter_icon, "popup-menu",
+    g_signal_connect (power->adaptor_icon, "popup-menu",
                       G_CALLBACK (xfpm_power_show_tray_menu_adaptor), power);
 }
 
@@ -709,27 +710,25 @@ xfpm_power_refresh_adaptor_visible (XfpmPower *power)
                   SHOW_TRAY_ICON_CFG, &show_icon,
                   NULL);
 
-    XFPM_DEBUG_ENUM (show_icon, XFPM_TYPE_SHOW_ICON, "Tray icon configuration: ");
-
     if ( show_icon == SHOW_ICON_ALWAYS )
     {
-
         if (power->batteries == NULL)
         {
-            xfpm_power_show_adapter_icon (power);
-            gtk_status_icon_set_tooltip_text (power->adapter_icon,
+            xfpm_power_show_adaptor_icon (power);
+
+            gtk_status_icon_set_tooltip_text (power->adaptor_icon,
                                               power->on_battery ?
                                               _("Adaptor is offline") :
                                               _("Adaptor is online") );
         }
         else
         {
-            xfpm_power_hide_adapter_icon (power);
+            xfpm_power_hide_adaptor_icon (power);
         }
     }
     else
     {
-        xfpm_power_hide_adapter_icon (power);
+        xfpm_power_hide_adaptor_icon (power);
     }
 }
 
@@ -790,7 +789,7 @@ xfpm_power_init (XfpmPower *power)
 {
     GError *error = NULL;
 
-    power->adapter_icon = NULL;
+    power->adaptor_icon = NULL;
     power->overall_state = XFPM_BATTERY_CHARGE_OK;
     power->critical_action_done = FALSE;
     power->power_mode = XFPM_POWER_MODE_NORMAL;
@@ -860,7 +859,7 @@ xfpm_power_finalize (GObject *object)
     g_slist_foreach (power->batteries, (GFunc) g_object_unref, NULL);
     g_slist_free (power->batteries);
 
-    xfpm_power_hide_adapter_icon (power);
+    xfpm_power_hide_adaptor_icon (power);
 
     G_OBJECT_CLASS (xfpm_power_parent_class)->finalize (object);
 }


More information about the Xfce4-commits mailing list