[empathy] Show the percentage sign in the volume



commit e414085fdfc7ee1618b0402a17cc6a3858a26de2
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Thu Jul 28 09:29:04 2011 +0100

    Show the percentage sign in the volume

 src/empathy-preferences.c  |   13 +++++++++++++
 src/empathy-preferences.ui |    2 +-
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c
index 121a090..0e90d00 100644
--- a/src/empathy-preferences.c
+++ b/src/empathy-preferences.c
@@ -75,6 +75,7 @@ struct _EmpathyPreferencesPriv {
 	GtkWidget *checkbutton_notifications_contact_signin;
 	GtkWidget *checkbutton_notifications_contact_signout;
 
+	GtkWidget *scale_call_volume;
 	GtkWidget *adj_call_volume;
 
 	GtkWidget *treeview_spell_checker;
@@ -1087,6 +1088,13 @@ preferences_themes_setup (EmpathyPreferences *preferences)
 			  preferences);
 }
 
+static gchar*
+preferences_call_format_volume_cb (GtkScale *scale,
+				   gdouble value)
+{
+	return g_strdup_printf ("%g%%", value);
+}
+
 static void
 empathy_preferences_response (GtkDialog *widget,
 			      gint response)
@@ -1176,6 +1184,7 @@ empathy_preferences_init (EmpathyPreferences *preferences)
 		"checkbutton_location_resource_network", &priv->checkbutton_location_resource_network,
 		"checkbutton_location_resource_cell", &priv->checkbutton_location_resource_cell,
 		"checkbutton_location_resource_gps", &priv->checkbutton_location_resource_gps,
+		"call_volume_scale", &priv->scale_call_volume,
 		"call_volume_adjustment", &priv->adj_call_volume,
 		NULL);
 	g_free (filename);
@@ -1201,6 +1210,10 @@ empathy_preferences_init (EmpathyPreferences *preferences)
 			  preferences, 0);
 	preferences_preview_theme_changed_cb (priv->theme_manager, preferences);
 
+	g_signal_connect (priv->scale_call_volume, "format-value",
+			  G_CALLBACK (preferences_call_format_volume_cb),
+			  preferences);
+
 	preferences_themes_setup (preferences);
 
 	preferences_setup_widgets (preferences);
diff --git a/src/empathy-preferences.ui b/src/empathy-preferences.ui
index eeb05fb..f8dc0a0 100644
--- a/src/empathy-preferences.ui
+++ b/src/empathy-preferences.ui
@@ -504,7 +504,7 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkScale" id="scale2">
+                          <object class="GtkScale" id="call_volume_scale">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="adjustment">call_volume_adjustment</property>



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