Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 38ff82ab97
commit 8f22facecc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -51,7 +51,6 @@
}
actionBlock:^{
OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new];
vc.soundType = OWSSoundType_Notification;
[weakSelf.navigationController pushViewController:vc animated:YES];
}]];
[contents addSection:soundsSection];

@ -512,7 +512,6 @@ NS_ASSUME_NONNULL_BEGIN
customRowHeight:45.f
actionBlock:^{
OWSSoundSettingsViewController *vc = [OWSSoundSettingsViewController new];
vc.soundType = OWSSoundType_Notification;
vc.thread = weakSelf.thread;
[weakSelf.navigationController pushViewController:vc animated:YES];
}]];

@ -6,14 +6,10 @@
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, OWSSoundType) { OWSSoundType_Notification = 0 };
@class TSThread;
@interface OWSSoundSettingsViewController : OWSTableViewController
@property (nonatomic) OWSSoundType soundType;
// This property is optional. If it is not set, we are
// editing the global notification sound.
@property (nonatomic, nullable) TSThread *thread;

@ -27,14 +27,10 @@ NS_ASSUME_NONNULL_BEGIN
{
[super viewDidLoad];
switch (self.soundType) {
case OWSSoundType_Notification:
[self setTitle:NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND",
@"Label for settings view that allows user to change the notification sound.")];
self.currentSound
= (self.thread ? [OWSSounds notificationSoundForThread:self.thread] : [OWSSounds globalNotificationSound]);
break;
}
[self setTitle:NSLocalizedString(@"SETTINGS_ITEM_NOTIFICATION_SOUND",
@"Label for settings view that allows user to change the notification sound.")];
self.currentSound
= (self.thread ? [OWSSounds notificationSoundForThread:self.thread] : [OWSSounds globalNotificationSound]);
[self updateTableContents];
[self updateNavigationItems];
@ -74,12 +70,7 @@ NS_ASSUME_NONNULL_BEGIN
soundsSection.headerTitle = NSLocalizedString(
@"NOTIFICATIONS_SECTION_SOUNDS", @"Label for settings UI that allows user to change the notification sound.");
NSArray<NSNumber *> *allSounds;
switch (self.soundType) {
case OWSSoundType_Notification:
allSounds = [OWSSounds allNotificationSounds];
break;
}
NSArray<NSNumber *> *allSounds = [OWSSounds allNotificationSounds];
for (NSNumber *nsValue in allSounds) {
OWSSound sound = (OWSSound)nsValue.intValue;
OWSTableItem *item;
@ -131,14 +122,10 @@ NS_ASSUME_NONNULL_BEGIN
- (void)saveWasPressed:(id)sender
{
switch (self.soundType) {
case OWSSoundType_Notification:
if (self.thread) {
[OWSSounds setNotificationSound:self.currentSound forThread:self.thread];
} else {
[OWSSounds setGlobalNotificationSound:self.currentSound];
}
break;
if (self.thread) {
[OWSSounds setNotificationSound:self.currentSound forThread:self.thread];
} else {
[OWSSounds setGlobalNotificationSound:self.currentSound];
}
[self.audioPlayer stop];

Loading…
Cancel
Save