Merge branch 'mkirk/more-prominent-default' into release/2.21.0

pull/1/head
Michael Kirk 7 years ago
commit 716db9f4c4

@ -74,13 +74,25 @@ NS_ASSUME_NONNULL_BEGIN
for (NSNumber *nsValue in allSounds) { for (NSNumber *nsValue in allSounds) {
OWSSound sound = (OWSSound)nsValue.intValue; OWSSound sound = (OWSSound)nsValue.intValue;
OWSTableItem *item; OWSTableItem *item;
NSString *soundLabelText = ^{
NSString *baseName = [OWSSounds displayNameForSound:sound];
if (sound == OWSSound_Note) {
NSString *noteStringFormat = NSLocalizedString(@"SETTINGS_AUDIO_DEFAULT_TONE_LABEL_FORMAT",
@"Format string for the default 'Note' sound. Embeds the system {{sound name}}.");
return [NSString stringWithFormat:noteStringFormat, baseName];
} else {
return [OWSSounds displayNameForSound:sound];
}
}();
if (sound == self.currentSound) { if (sound == self.currentSound) {
item = [OWSTableItem checkmarkItemWithText:[OWSSounds displayNameForSound:sound] item = [OWSTableItem checkmarkItemWithText:soundLabelText
actionBlock:^{ actionBlock:^{
[weakSelf soundWasSelected:sound]; [weakSelf soundWasSelected:sound];
}]; }];
} else { } else {
item = [OWSTableItem actionItemWithText:[OWSSounds displayNameForSound:sound] item = [OWSTableItem actionItemWithText:soundLabelText
actionBlock:^{ actionBlock:^{
[weakSelf soundWasSelected:sound]; [weakSelf soundWasSelected:sound];
}]; }];

@ -1512,6 +1512,9 @@
/* No comment provided by engineer. */ /* No comment provided by engineer. */
"SETTINGS_ADVANCED_TITLE" = "Advanced"; "SETTINGS_ADVANCED_TITLE" = "Advanced";
/* Format string for the default 'Note' sound. Embeds the system {{sound name}}. */
"SETTINGS_AUDIO_DEFAULT_TONE_LABEL_FORMAT" = "%@ (default)";
/* A label for the 'add phone number' button in the block list table. */ /* A label for the 'add phone number' button in the block list table. */
"SETTINGS_BLOCK_LIST_ADD_BUTTON" = "Add…"; "SETTINGS_BLOCK_LIST_ADD_BUTTON" = "Add…";

@ -62,8 +62,9 @@ NSString *const kOWSSoundsStorageGlobalNotificationKey = @"kOWSSoundsStorageGlob
+ (NSArray<NSNumber *> *)allNotificationSounds + (NSArray<NSNumber *> *)allNotificationSounds
{ {
return @[ return @[
// None should be first. // None and Note (default) should be first.
@(OWSSound_None), @(OWSSound_None),
@(OWSSound_Note),
@(OWSSound_Aurora), @(OWSSound_Aurora),
@(OWSSound_Bamboo), @(OWSSound_Bamboo),
@ -74,7 +75,6 @@ NSString *const kOWSSoundsStorageGlobalNotificationKey = @"kOWSSoundsStorageGlob
@(OWSSound_Hello), @(OWSSound_Hello),
@(OWSSound_Input), @(OWSSound_Input),
@(OWSSound_Keys), @(OWSSound_Keys),
@(OWSSound_Note),
@(OWSSound_Popcorn), @(OWSSound_Popcorn),
@(OWSSound_Pulse), @(OWSSound_Pulse),
@(OWSSound_Synth), @(OWSSound_Synth),
@ -117,11 +117,9 @@ NSString *const kOWSSoundsStorageGlobalNotificationKey = @"kOWSSoundsStorageGlob
case OWSSound_ClassicNotification: case OWSSound_ClassicNotification:
return @"Classic"; return @"Classic";
// Ringtone Sounds // Call Audio
case OWSSound_Opening: case OWSSound_Opening:
return @"Opening"; return @"Opening";
// Calls
case OWSSound_CallConnecting: case OWSSound_CallConnecting:
return @"Call Connecting"; return @"Call Connecting";
case OWSSound_CallOutboundRinging: case OWSSound_CallOutboundRinging:
@ -286,6 +284,7 @@ NSString *const kOWSSoundsStorageGlobalNotificationKey = @"kOWSSoundsStorageGlob
{ {
OWSAssert(transaction); OWSAssert(transaction);
DDLogInfo(@"%@ Setting global notification sound to: %s", sound);
[transaction setObject:@(sound) [transaction setObject:@(sound)
forKey:kOWSSoundsStorageGlobalNotificationKey forKey:kOWSSoundsStorageGlobalNotificationKey
inCollection:kOWSSoundsStorageNotificationCollection]; inCollection:kOWSSoundsStorageNotificationCollection];

@ -65,10 +65,7 @@ NS_ASSUME_NONNULL_BEGIN
NSMutableArray<OWSDatabaseMigration *> *migrationsToRun = [NSMutableArray new]; NSMutableArray<OWSDatabaseMigration *> *migrationsToRun = [NSMutableArray new];
for (OWSDatabaseMigration *migration in migrations) { for (OWSDatabaseMigration *migration in migrations) {
if ([OWSDatabaseMigration fetchObjectWithUniqueID:migration.uniqueId]) { if ([OWSDatabaseMigration fetchObjectWithUniqueID:migration.uniqueId] == nil) {
DDLogDebug(@"%@ Skipping previously run migration: %@", self.logTag, migration);
} else {
DDLogWarn(@"%@ Running migration: %@", self.logTag, migration);
[migrationsToRun addObject:migration]; [migrationsToRun addObject:migration];
} }
} }

Loading…
Cancel
Save