aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-08-06 13:20:03 +0100
committerConor Curran <conor.curran@canonical.com>2010-08-06 13:20:03 +0100
commit734cf9dc8224140b6b729c09237d598aec546ef3 (patch)
tree4fe1716675002bc8cde09e647e8431f7da2ff235 /src
parent4a23580e7fc69500ae2a843c2b883d6f0d310b23 (diff)
downloadayatana-indicator-sound-734cf9dc8224140b6b729c09237d598aec546ef3.tar.gz
ayatana-indicator-sound-734cf9dc8224140b6b729c09237d598aec546ef3.tar.bz2
ayatana-indicator-sound-734cf9dc8224140b6b729c09237d598aec546ef3.zip
merge comments have been acted upon
Diffstat (limited to 'src')
-rw-r--r--src/indicator-sound.c15
-rw-r--r--src/metadata-widget.h2
-rw-r--r--src/scrub-widget.h2
-rw-r--r--src/slider-menu-item.c1
-rw-r--r--src/title-widget.h2
-rw-r--r--src/transport-widget.h2
-rw-r--r--src/volume-widget.c11
-rw-r--r--src/volume-widget.h2
8 files changed, 18 insertions, 19 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index ff69fff..557ce85 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -557,6 +557,8 @@ reset_mute_blocking_animation()
static void
fetch_sink_availability_from_dbus(IndicatorSound* self)
{
+ g_return_if_fail(IS_INDICATOR_SOUND(self));
+
GError * error = NULL;
gboolean * available_input;
available_input = g_new0(gboolean, 1);
@@ -573,17 +575,13 @@ fetch_sink_availability_from_dbus(IndicatorSound* self)
update_state(STATE_SINKS_NONE);
g_debug("NO DEVICE AVAILABLE");
}
- if(IS_INDICATOR_SOUND(self) == FALSE){
- g_warning("okay pointer is arseways");
- }
IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(self);
GtkWidget* slider_widget = volume_widget_get_ido_slider(VOLUME_WIDGET(priv->volume_widget));
gtk_widget_set_sensitive(slider_widget, device_available);
g_free(available_input);
- g_debug("IndicatorSound::fetch_sink_availability_from_dbus -> AVAILABILTY returned from dbus method is %i", device_available);
-
+ g_debug("IndicatorSound::fetch_sink_availability_from_dbus ->%i", device_available);
}
@@ -621,12 +619,13 @@ catch_signal_sink_input_while_muted(DBusGProxy * proxy, gboolean block_value, gp
}
}
-
+/*
+ We can be sure the service won't send a mute signal unless it has changed !
+ UNMUTE's force a volume update therefore icon is updated appropriately => no need for unmute handling here.
+*/
static void
catch_signal_sink_mute_update(DBusGProxy *proxy, gboolean mute_value, gpointer userdata)
{
- //We can be sure the service won't send a mute signal unless it has changed !
- //UNMUTE's force a volume update therefore icon is updated appropriately => no need for unmute handling here.
if (mute_value == TRUE && device_available == TRUE) {
update_state(STATE_MUTED);
} else {
diff --git a/src/metadata-widget.h b/src/metadata-widget.h
index 6f1d4d3..814d5e8 100644
--- a/src/metadata-widget.h
+++ b/src/metadata-widget.h
@@ -20,7 +20,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define __METADATA_WIDGET_H__
#include <gtk/gtkmenuitem.h>
-#include <libdbusmenu-gtk/menu.h>
+#include <libdbusmenu-gtk/menuitem.h>
G_BEGIN_DECLS
diff --git a/src/scrub-widget.h b/src/scrub-widget.h
index cebe890..e518a80 100644
--- a/src/scrub-widget.h
+++ b/src/scrub-widget.h
@@ -21,7 +21,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <glib.h>
#include <glib-object.h>
-#include <libdbusmenu-gtk/menu.h>
+#include <libdbusmenu-gtk/menuitem.h>
G_BEGIN_DECLS
diff --git a/src/slider-menu-item.c b/src/slider-menu-item.c
index 9536ff8..77c8635 100644
--- a/src/slider-menu-item.c
+++ b/src/slider-menu-item.c
@@ -79,7 +79,6 @@ slider_menu_item_finalize (GObject *object)
static void
handle_event (DbusmenuMenuitem * mi, const gchar * name, const GValue * value, guint timestamp)
{
- g_debug("in the handle event method of slider_menu_item");
gdouble volume_input = 0;
volume_input = g_value_get_double(value);
if (value != NULL)
diff --git a/src/title-widget.h b/src/title-widget.h
index efc0c78..fc8f169 100644
--- a/src/title-widget.h
+++ b/src/title-widget.h
@@ -20,7 +20,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define __TITLE_WIDGET_H__
#include <gtk/gtkmenuitem.h>
-#include <libdbusmenu-gtk/menu.h>
+#include <libdbusmenu-gtk/menuitem.h>
G_BEGIN_DECLS
diff --git a/src/transport-widget.h b/src/transport-widget.h
index 1d1aa6e..c69836a 100644
--- a/src/transport-widget.h
+++ b/src/transport-widget.h
@@ -20,7 +20,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define __TRANSPORT_WIDGET_H__
#include <gtk/gtkmenuitem.h>
-#include <libdbusmenu-gtk/menu.h>
+#include <libdbusmenu-gtk/menuitem.h>
G_BEGIN_DECLS
diff --git a/src/volume-widget.c b/src/volume-widget.c
index 69fa28f..bf1ddb9 100644
--- a/src/volume-widget.c
+++ b/src/volume-widget.c
@@ -77,7 +77,7 @@ volume_widget_init (VolumeWidget *self)
VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(self);
priv->ido_volume_slider = ido_scale_menu_item_new_with_range ("VOLUME", IDO_RANGE_STYLE_DEFAULT, 0, 0, 100, 1);
-
+ g_object_ref (priv->ido_volume_slider);
ido_scale_menu_item_set_style (IDO_SCALE_MENU_ITEM (priv->ido_volume_slider), IDO_SCALE_MENU_ITEM_STYLE_IMAGE);
g_object_set(priv->ido_volume_slider, "reverse-scroll-events", TRUE, NULL);
@@ -144,13 +144,12 @@ volume_widget_set_twin_item(VolumeWidget* self,
{
VolumeWidgetPrivate * priv = VOLUME_WIDGET_GET_PRIVATE(self);
priv->twin_item = twin_item;
-
+ g_object_ref(priv->twin_item);
g_signal_connect(G_OBJECT(twin_item), "property-changed",
G_CALLBACK(volume_widget_property_update), self);
gdouble initial_level = g_value_get_double (dbusmenu_menuitem_property_get_value(twin_item,
DBUSMENU_VOLUME_MENUITEM_LEVEL));
g_debug("volume_widget_set_twin_item initial level = %f", initial_level);
- //volume_widget_update(self, initial_level);
GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider);
GtkRange *range = (GtkRange*)slider;
gtk_range_set_value(range, initial_level);
@@ -170,6 +169,10 @@ volume_widget_change_value_cb (GtkRange *range,
return FALSE;
}
+/*
+ We only want this callback to catch mouse icon press events
+ which set the slider to 0 or 100. Ignore all other events.
+*/
static gboolean
volume_widget_value_changed_cb(GtkRange *range, gpointer user_data)
{
@@ -179,8 +182,6 @@ volume_widget_value_changed_cb(GtkRange *range, gpointer user_data)
GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_volume_slider);
gdouble current_value = CLAMP(gtk_range_get_value(GTK_RANGE(slider)), 0, 100);
- // We just want this callback to catch mouse icon press events
- // which set the slider to 0 or 100
if(current_value == 0 || current_value == 100){
volume_widget_update(mitem, current_value);
}
diff --git a/src/volume-widget.h b/src/volume-widget.h
index 2b48c39..d4929ec 100644
--- a/src/volume-widget.h
+++ b/src/volume-widget.h
@@ -21,7 +21,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <glib.h>
#include <glib-object.h>
-#include <libdbusmenu-gtk/menu.h>
+#include <libdbusmenu-gtk/menuitem.h>
G_BEGIN_DECLS