[gnome-power-manager] Now we do not have the suspend and hibernate menu context items, remove the 'Always' option from the



commit fb20fdabcc4c5d22e1930cc052a0270f8ec1b347
Author: Richard Hughes <richard hughsie com>
Date:   Tue Mar 30 10:37:05 2010 +0100

    Now we do not have the suspend and hibernate menu context items, remove the 'Always' option from the prefs

 data/gnome-power-manager.schemas.in |    2 +-
 data/gpm-prefs.ui                   |   16 ----------------
 src/gpm-common.c                    |    7 ++-----
 src/gpm-common.h                    |    1 -
 src/gpm-engine.c                    |    5 ++---
 src/gpm-prefs-core.c                |   10 ----------
 src/gpm-stock-icons.h               |    1 -
 7 files changed, 5 insertions(+), 37 deletions(-)
---
diff --git a/data/gnome-power-manager.schemas.in b/data/gnome-power-manager.schemas.in
index 6967e54..679377f 100644
--- a/data/gnome-power-manager.schemas.in
+++ b/data/gnome-power-manager.schemas.in
@@ -733,7 +733,7 @@
       <default>present</default>
       <locale name="C">
         <short>When to show the notification icon</short>
-        <long>Display options for the notification icon. Valid options are "never", "low", "critical", "charge", "present" and "always".</long>
+        <long>Display options for the notification icon. Valid options are "never", "low", "critical", "charge", and "present".</long>
       </locale>
     </schema>
 
diff --git a/data/gpm-prefs.ui b/data/gpm-prefs.ui
index 702b487..b4e3f18 100644
--- a/data/gpm-prefs.ui
+++ b/data/gpm-prefs.ui
@@ -1014,22 +1014,6 @@
                                 <property name="position">3</property>
                               </packing>
                             </child>
-                            <child>
-                              <object class="GtkRadioButton" id="radiobutton_notification_always">
-                                <property name="label" translatable="yes">_Always display an icon</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="use_underline">True</property>
-                                <property name="draw_indicator">True</property>
-                                <property name="group">radiobutton_notification_never</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">4</property>
-                              </packing>
-                            </child>
                           </object>
                         </child>
                       </object>
diff --git a/src/gpm-common.c b/src/gpm-common.c
index 09e34f5..f2640cd 100644
--- a/src/gpm-common.c
+++ b/src/gpm-common.c
@@ -86,9 +86,8 @@ gpm_icon_policy_from_string (const gchar *policy)
 {
 	if (policy == NULL)
 		return GPM_ICON_POLICY_NEVER;
-	if (g_strcmp0 (policy, "always") == 0)
-		return GPM_ICON_POLICY_ALWAYS;
-	if (g_strcmp0 (policy, "present") == 0)
+	if (g_strcmp0 (policy, "always") == 0 ||
+	    g_strcmp0 (policy, "present") == 0)
 		return GPM_ICON_POLICY_PRESENT;
 	if (g_strcmp0 (policy, "charge") == 0)
 		return GPM_ICON_POLICY_CHARGE;
@@ -107,8 +106,6 @@ gpm_icon_policy_from_string (const gchar *policy)
 const gchar *
 gpm_icon_policy_to_string (GpmIconPolicy policy)
 {
-	if (policy == GPM_ICON_POLICY_ALWAYS)
-		return "always";
 	if (policy == GPM_ICON_POLICY_PRESENT)
 		return "present";
 	if (policy == GPM_ICON_POLICY_CHARGE)
diff --git a/src/gpm-common.h b/src/gpm-common.h
index dc45e3a..807a34c 100644
--- a/src/gpm-common.h
+++ b/src/gpm-common.h
@@ -156,7 +156,6 @@ G_BEGIN_DECLS
 #define GPM_CONF_IDLE_DELAY			"/desktop/gnome/session/idle_delay"
 
 typedef enum {
-	GPM_ICON_POLICY_ALWAYS,
 	GPM_ICON_POLICY_PRESENT,
 	GPM_ICON_POLICY_CHARGE,
 	GPM_ICON_POLICY_LOW,
diff --git a/src/gpm-engine.c b/src/gpm-engine.c
index e0ce38c..7524329 100644
--- a/src/gpm-engine.c
+++ b/src/gpm-engine.c
@@ -397,9 +397,8 @@ gpm_engine_get_icon (GpmEngine *engine)
 		return NULL;
 	}
 
-	/* we fallback to the ac_adapter icon */
-	egg_debug ("Using fallback");
-	return g_strdup (GPM_STOCK_AC_ADAPTER);
+	/* do not show an icon */
+	return NULL;
 }
 
 /**
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index 7596fcd..42dfadc 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -573,7 +573,6 @@ prefs_setup_notification (GpmPrefs *prefs)
 {
 	gchar *icon_policy_str;
 	gint icon_policy;
-	GtkWidget *radiobutton_icon_always;
 	GtkWidget *radiobutton_icon_present;
 	GtkWidget *radiobutton_icon_charge;
 	GtkWidget *radiobutton_icon_low;
@@ -584,8 +583,6 @@ prefs_setup_notification (GpmPrefs *prefs)
 	icon_policy = gpm_icon_policy_from_string (icon_policy_str);
 	g_free (icon_policy_str);
 
-	radiobutton_icon_always = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder,
-					      "radiobutton_notification_always"));
 	radiobutton_icon_present = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder,
 					       "radiobutton_notification_present"));
 	radiobutton_icon_charge = GTK_WIDGET (gtk_builder_get_object (prefs->priv->builder,
@@ -596,14 +593,11 @@ prefs_setup_notification (GpmPrefs *prefs)
 					     "radiobutton_notification_never"));
 
 	is_writable = gconf_client_key_is_writable (prefs->priv->conf, GPM_CONF_UI_ICON_POLICY, NULL);
-	gtk_widget_set_sensitive (radiobutton_icon_always, is_writable);
 	gtk_widget_set_sensitive (radiobutton_icon_present, is_writable);
 	gtk_widget_set_sensitive (radiobutton_icon_charge, is_writable);
 	gtk_widget_set_sensitive (radiobutton_icon_low, is_writable);
 	gtk_widget_set_sensitive (radiobutton_icon_never, is_writable);
 
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_always),
-				      icon_policy == GPM_ICON_POLICY_ALWAYS);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_present),
 				      icon_policy == GPM_ICON_POLICY_PRESENT);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_charge),
@@ -613,8 +607,6 @@ prefs_setup_notification (GpmPrefs *prefs)
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_icon_never),
 				      icon_policy == GPM_ICON_POLICY_NEVER);
 
-	g_object_set_data (G_OBJECT (radiobutton_icon_always), "policy",
-			   GINT_TO_POINTER (GPM_ICON_POLICY_ALWAYS));
 	g_object_set_data (G_OBJECT (radiobutton_icon_present), "policy",
 			   GINT_TO_POINTER (GPM_ICON_POLICY_PRESENT));
 	g_object_set_data (G_OBJECT (radiobutton_icon_charge), "policy",
@@ -626,8 +618,6 @@ prefs_setup_notification (GpmPrefs *prefs)
 
 	/* only connect the callbacks after we set the value, else the conf
 	 * keys gets written to (for a split second), and the icon flickers. */
-	g_signal_connect (radiobutton_icon_always, "clicked",
-			  G_CALLBACK (gpm_prefs_icon_radio_cb), prefs);
 	g_signal_connect (radiobutton_icon_present, "clicked",
 			  G_CALLBACK (gpm_prefs_icon_radio_cb), prefs);
 	g_signal_connect (radiobutton_icon_charge, "clicked",
diff --git a/src/gpm-stock-icons.h b/src/gpm-stock-icons.h
index f6a486d..ac65570 100644
--- a/src/gpm-stock-icons.h
+++ b/src/gpm-stock-icons.h
@@ -27,7 +27,6 @@
 G_BEGIN_DECLS
 
 #define GPM_STOCK_APP_ICON			"gnome-power-manager"
-#define GPM_STOCK_AC_ADAPTER			"gpm-ac-adapter"
 #define GPM_STOCK_BATTERY_CHARGED		"gpm-primary-charged"
 #define GPM_STOCK_HIBERNATE			"gpm-hibernate"
 #define GPM_STOCK_SUSPEND			"gpm-suspend"



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