diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-02-16 11:20:21 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-02-16 11:20:21 +0000 |
commit | 5d32cec559249cb0e3b0a85ecdc8e0a5dc1ab199 (patch) | |
tree | 3bd913436e953b6c1221698f36607d2f61d26331 | |
parent | 431eac89cb2c57253deb8004e910d1c51332410c (diff) | |
download | ayatana-indicator-sound-5d32cec559249cb0e3b0a85ecdc8e0a5dc1ab199.tar.gz ayatana-indicator-sound-5d32cec559249cb0e3b0a85ecdc8e0a5dc1ab199.tar.bz2 ayatana-indicator-sound-5d32cec559249cb0e3b0a85ecdc8e0a5dc1ab199.zip |
reverted luke's work until indicator object is updated
-rw-r--r-- | po/POTFILES.in | 1 | ||||
-rw-r--r-- | src/indicator-sound.c | 18 | ||||
-rw-r--r-- | src/volume-widget.c | 22 | ||||
-rw-r--r-- | src/volume-widget.h | 3 |
4 files changed, 4 insertions, 40 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in index 2f68d1a..9cceace 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,4 +1,3 @@ [encoding: UTF-8] -src/indicator-sound.c src/mute-menu-item.c src/sound-service-dbus.c diff --git a/src/indicator-sound.c b/src/indicator-sound.c index f020bb8..96ab89b 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -20,7 +20,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <math.h> #include <glib.h> #include <glib-object.h> -#include <glib/gi18n.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #include <libdbusmenu-gtk/menu.h> @@ -67,7 +66,6 @@ G_DEFINE_TYPE (IndicatorSound, indicator_sound, INDICATOR_OBJECT_TYPE); static GtkLabel * get_label (IndicatorObject * io); static GtkImage * get_icon (IndicatorObject * io); static GtkMenu * get_menu (IndicatorObject * io); -static const gchar * get_accessible_desc (IndicatorObject * io); static void indicator_sound_scroll (IndicatorObject* io, gint delta, IndicatorScrollDirection direction); @@ -119,7 +117,6 @@ indicator_sound_class_init (IndicatorSoundClass *klass) io_class->get_label = get_label; io_class->get_image = get_icon; io_class->get_menu = get_menu; - io_class->get_accessible_desc = get_accessible_desc; io_class->scroll = indicator_sound_scroll; } @@ -210,19 +207,6 @@ get_menu (IndicatorObject * io) return GTK_MENU(menu); } -static const gchar * -get_accessible_desc (IndicatorObject * io) -{ - IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(io); - - if (priv->volume_widget != NULL){ - return g_strdup_printf(_("Volume (%'.0f%%)"), volume_widget_get_current_volume(priv->volume_widget)); - } - - return NULL; -} - - static void connection_changed (IndicatorServiceManager * sm, gboolean connected, @@ -398,8 +382,8 @@ new_volume_slider_widget(DbusmenuMenuitem * newitem, g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE); g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE); + volume_widget = volume_widget_new (newitem); io = g_object_get_data (G_OBJECT (client), "indicator"); - volume_widget = volume_widget_new (newitem, io); IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io)); priv->volume_widget = volume_widget; diff --git a/src/volume-widget.c b/src/volume-widget.c index 247dfe6..ceebec5 100644 --- a/src/volume-widget.c +++ b/src/volume-widget.c @@ -37,7 +37,6 @@ struct _VolumeWidgetPrivate DbusmenuMenuitem* twin_item; GtkWidget* ido_volume_slider; gboolean grabbed; - IndicatorObject* indicator; }; #define VOLUME_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VOLUME_WIDGET_TYPE, VolumeWidgetPrivate)) @@ -138,11 +137,6 @@ volume_widget_property_update( DbusmenuMenuitem* item, gchar* property, gdouble update = g_variant_get_double (value); //g_debug("volume-widget - update level with value %f", update); gtk_range_set_value(range, update); - g_signal_emit(G_OBJECT(priv->indicator), - INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, - 0, - (IndicatorObjectEntry *)indicator_object_get_entries(INDICATOR_OBJECT(priv->indicator))->data, - TRUE); } } } @@ -162,11 +156,6 @@ volume_widget_set_twin_item(VolumeWidget* self, GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider); GtkRange *range = (GtkRange*)slider; gtk_range_set_value(range, initial_level); - g_signal_emit(G_OBJECT(priv->indicator), - INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, - 0, - (IndicatorObjectEntry *)indicator_object_get_entries(INDICATOR_OBJECT(priv->indicator))->data, - TRUE); } static gboolean @@ -207,11 +196,6 @@ volume_widget_update(VolumeWidget* self, gdouble update) gdouble clamped = CLAMP(update, 0, 100); GVariant* new_volume = g_variant_new_double(clamped); dbusmenu_menuitem_handle_event (priv->twin_item, "update", new_volume, 0); - g_signal_emit(G_OBJECT(priv->indicator), - INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, - 0, - (IndicatorObjectEntry *)indicator_object_get_entries(INDICATOR_OBJECT(priv->indicator))->data, - TRUE); } GtkWidget* @@ -267,12 +251,10 @@ volume_widget_get_current_volume ( GtkWidget *widget ) * volume_widget_new: * @returns: a new #VolumeWidget. **/ -GtkWidget* -volume_widget_new(DbusmenuMenuitem *item, IndicatorObject* io) +GtkWidget* +volume_widget_new(DbusmenuMenuitem *item) { GtkWidget* widget = g_object_new(VOLUME_WIDGET_TYPE, NULL); - VolumeWidgetPrivate* priv = VOLUME_WIDGET_GET_PRIVATE(VOLUME_WIDGET(widget)); - priv->indicator = io; volume_widget_set_twin_item((VolumeWidget*)widget, item); return widget; } diff --git a/src/volume-widget.h b/src/volume-widget.h index 50ef377..072cfde 100644 --- a/src/volume-widget.h +++ b/src/volume-widget.h @@ -22,7 +22,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <glib.h> #include <glib-object.h> #include <libdbusmenu-gtk/menuitem.h> -#include <libindicator/indicator-object.h> G_BEGIN_DECLS @@ -45,7 +44,7 @@ struct _VolumeWidget { }; GType volume_widget_get_type (void) G_GNUC_CONST; -GtkWidget* volume_widget_new(DbusmenuMenuitem *item, IndicatorObject* io); +GtkWidget* volume_widget_new(DbusmenuMenuitem* twin_item); GtkWidget* volume_widget_get_ido_slider(VolumeWidget* self); void volume_widget_update(VolumeWidget* self, gdouble update); void volume_widget_tidy_up (GtkWidget *widget); |