-
Notifications
You must be signed in to change notification settings - Fork 15
/
SLNotificationController.m
41 lines (34 loc) · 1.2 KB
/
SLNotificationController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// SLNotificationController.m
// Semulov
//
// Created by Kevin Wojniak on 11/5/06.
// Copyright 2006-2014 Kevin Wojniak. All rights reserved.
//
#import "SLNotificationController.h"
#import "SLVolume.h"
@implementation SLNotificationController
+ (void)postNotificationCenterWithTitle:(NSString *)title subtitle:(NSString *)subtitle
{
NSUserNotification *note = [[NSUserNotification alloc] init];
note.title = title;
note.subtitle = subtitle;
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:note];
}
+ (void)postVolumeMounted:(SLVolume *)volume
{
NSString *notifTitle = NSLocalizedString(@"Volume Mounted", "");
NSString *notifDescription = [volume name];
[self postNotificationCenterWithTitle:notifTitle subtitle:notifDescription];
}
+ (void)postVolumeUnmounted:(SLVolume *)volume
{
NSString *notifTitle = NSLocalizedString(@"Volume Unmounted", "");
NSString *notifDescription = [volume name];
[self postNotificationCenterWithTitle:notifTitle subtitle:notifDescription];
}
+ (void)postVolumeMountBlocked:(NSString *)volumeName
{
[self postNotificationCenterWithTitle:NSLocalizedString(@"Mount Blocked", "") subtitle:volumeName];
}
@end