[Xfce4-commits] [apps/xfce4-volumed-pulse] 01/01: Make the icon names constants
noreply at xfce.org
noreply at xfce.org
Sun Sep 11 19:43:58 CEST 2016
This is an automated email from the git hooks/post-receive script.
ochosi pushed a commit to branch master
in repository apps/xfce4-volumed-pulse.
commit ddd5d9ca2dbe5cc99ab9ae8876899b63f09aad04
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Sun Sep 11 19:42:00 2016 +0200
Make the icon names constants
This is done so we can more easily exchange or ifdef them later
---
src/xvd_notify.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/xvd_notify.c b/src/xvd_notify.c
index 6760c1f..8999627 100644
--- a/src/xvd_notify.c
+++ b/src/xvd_notify.c
@@ -28,6 +28,14 @@
#include "xvd_notify.h"
+/* Icon names for the various audio notifications */
+#define ICON_AUDIO_VOLUME_MUTED "audio-volume-muted"
+#define ICON_AUDIO_VOLUME_OFF "audio-volume-off"
+#define ICON_AUDIO_VOLUME_LOW "audio-volume-low"
+#define ICON_AUDIO_VOLUME_MEDIUM "audio-volume-medium"
+#define ICON_AUDIO_VOLUME_HIGH "audio-volume-high"
+#define ICON_MICROPHONE_MUTED "microphone-sensitivity-muted"
+#define ICON_MICROPHONE_HIGH "microphone-sensitivity-high"
void
xvd_notify_notification(XvdInstance *Inst,
@@ -37,7 +45,7 @@ xvd_notify_notification(XvdInstance *Inst,
GError* error = NULL;
gchar* title = NULL;
- if ((icon != NULL) && (g_strcmp0(icon, "audio-volume-muted") == 0)) {
+ if ((icon != NULL) && (g_strcmp0(icon, ICON_AUDIO_VOLUME_MUTED) == 0)) {
// TRANSLATORS: this is the body of the ATK interface of the volume notifications. This is the case when volume is muted
title = g_strdup ("Volume is muted");
}
@@ -74,20 +82,20 @@ xvd_notify_volume_notification(XvdInstance *Inst)
{
gint vol = xvd_get_readable_volume (&Inst->volume);
if (vol == 0)
- xvd_notify_notification (Inst, (Inst->mute) ? "audio-volume-muted" : "audio-volume-off", vol);
+ xvd_notify_notification (Inst, (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_OFF, vol);
else if (vol < 34)
- xvd_notify_notification (Inst, (Inst->mute) ? "audio-volume-muted" : "audio-volume-low", vol);
+ xvd_notify_notification (Inst, (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_LOW, vol);
else if (vol < 67)
- xvd_notify_notification (Inst, (Inst->mute) ? "audio-volume-muted" : "audio-volume-medium", vol);
+ xvd_notify_notification (Inst, (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_MEDIUM, vol);
else
- xvd_notify_notification (Inst, (Inst->mute) ? "audio-volume-muted" : "audio-volume-high", vol);
+ xvd_notify_notification (Inst, (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_HIGH, vol);
}
void
xvd_notify_overshoot_notification(XvdInstance *Inst)
{
xvd_notify_notification (Inst,
- (Inst->mute) ? "audio-volume-muted" : "audio-volume-high",
+ (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_HIGH,
(Inst->gauge_notifications) ? 101 : 100);
}
@@ -95,7 +103,7 @@ void
xvd_notify_undershoot_notification(XvdInstance *Inst)
{
xvd_notify_notification (Inst,
- (Inst->mute) ? "audio-volume-muted" : "audio-volume-low",
+ (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_LOW,
(Inst->gauge_notifications) ? -1 : 0);
}
@@ -107,7 +115,7 @@ xvd_notify_mic_notification(XvdInstance *Inst)
gchar* icon = NULL;
title = g_strdup_printf ("Microphone is %s", (Inst->mic_mute) ? "muted" : "active");
- icon = (Inst->mic_mute) ? "microphone-sensitivity-muted" : "microphone-sensitivity-high";
+ icon = (Inst->mic_mute) ? ICON_MICROPHONE_MUTED : ICON_MICROPHONE_HIGH;
notify_notification_update (Inst->notification_mic,
title,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list