Dialer: do not show Send logs button in magic popup if logs are not enabled yet

This commit is contained in:
Gautier Pelloux-Prayer 2016-04-26 12:27:34 +02:00
parent f1fc46a2ce
commit 17761c10ff

View file

@ -249,17 +249,19 @@ static UICompositeViewDescription *compositeDescription = nil;
[alertView addCancelButtonWithTitle:NSLocalizedString(@"Cancel", nil) block:nil];
[alertView
addButtonWithTitle:NSLocalizedString(@"Send logs", nil)
block:^{
NSString *appName =
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
NSString *logsAddress = [mgr lpConfigStringForKey:@"debug_popup_email" withDefault:@""];
[self presentMailViewWithTitle:appName forRecipients:@[ logsAddress ] attachLogs:true];
}];
int debugLevel = [LinphoneManager.instance lpConfigIntForKey:@"debugenable_preference"];
BOOL debugEnabled = (debugLevel >= ORTP_DEBUG && debugLevel < ORTP_ERROR);
if (debugEnabled) {
[alertView
addButtonWithTitle:NSLocalizedString(@"Send logs", nil)
block:^{
NSString *appName =
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
NSString *logsAddress = [mgr lpConfigStringForKey:@"debug_popup_email" withDefault:@""];
[self presentMailViewWithTitle:appName forRecipients:@[ logsAddress ] attachLogs:true];
}];
}
NSString *actionLog =
(debugEnabled ? NSLocalizedString(@"Disable logs", nil) : NSLocalizedString(@"Enable logs", nil));
[alertView