aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcharles kerr <charlesk@canonical.com>2015-12-19 21:11:09 -0600
committercharles kerr <charlesk@canonical.com>2015-12-19 21:11:09 -0600
commit9e54db50c17504289792ee12e4d785a69f2742ec (patch)
tree8b971c592243d2f752e4d7d6e431043af1845360 /src
parent6aa814370aab377943bd109875e8c0ae1bdcdab9 (diff)
downloadayatana-indicator-sound-9e54db50c17504289792ee12e4d785a69f2742ec.tar.gz
ayatana-indicator-sound-9e54db50c17504289792ee12e4d785a69f2742ec.tar.bz2
ayatana-indicator-sound-9e54db50c17504289792ee12e4d785a69f2742ec.zip
instantiate volume-warning and pass it to the service
Diffstat (limited to 'src')
-rw-r--r--src/main.c5
-rw-r--r--src/service.vala10
2 files changed, 10 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 01cadf1..11eaa06 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,6 +49,7 @@ on_bus_acquired(GDBusConnection *connection,
IndicatorSoundOptions * options = NULL;
VolumeControlPulse * volume = NULL;
AccountsServiceUser * accounts = NULL;
+ VolumeWarning * warning = NULL;
if (g_strcmp0("lightdm", g_get_user_name()) == 0) {
@@ -60,13 +61,15 @@ on_bus_acquired(GDBusConnection *connection,
options = indicator_sound_options_gsettings_new();
volume = volume_control_pulse_new(options);
+ warning = volume_warning_new(options);
- service = indicator_sound_service_new (playerlist, volume, accounts, options);
+ service = indicator_sound_service_new (playerlist, volume, accounts, options, warning);
g_clear_object(&playerlist);
g_clear_object(&options);
g_clear_object(&volume);
g_clear_object(&accounts);
+ g_clear_object(&warning);
}
int
diff --git a/src/service.vala b/src/service.vala
index c94deb2..ed0fc74 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -27,9 +27,10 @@ public class IndicatorSound.Service: Object {
*/
VolumeControl.Volume _pre_warn_volume = null;
- public Service (MediaPlayerList playerlist, VolumeControl volume, AccountsServiceUser? accounts, Options options) {
+ public Service (MediaPlayerList playerlist, VolumeControl volume, AccountsServiceUser? accounts, Options options, VolumeWarning volume_warning) {
_options = options;
+ _volume_warning = volume_warning;
try {
bus = Bus.get_sync(GLib.BusType.SESSION);
@@ -43,8 +44,8 @@ public class IndicatorSound.Service: Object {
warn_notification.set_hint ("x-canonical-non-shaped-icon", "true");
warn_notification.set_hint ("x-canonical-snap-decisions", "true");
warn_notification.set_hint ("x-canonical-private-affirmative-tint", "true");
- warn_notification.closed.connect((n) => {
- n.clear_actions();
+ warn_notification.closed.connect((n) => {
+ n.clear_actions();
waiting_user_approve_warn=false;
increment_volume_sync_action();
});
@@ -208,7 +209,8 @@ public class IndicatorSound.Service: Object {
bool export_to_accounts_service = false;
private Notify.Notification info_notification;
private Notify.Notification warn_notification;
- private Options _options = null;
+ private Options _options;
+ private VolumeWarning _volume_warning;
const double volume_step_percentage = 0.06;