1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-21 23:32:35 +00:00

we do not support LevelButtonLevelTrace (#4236)

This commit is contained in:
A Cœur 2022-11-26 06:01:29 +08:00 committed by GitHub
parent 8a35aa0903
commit ef2415293b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View file

@ -49,7 +49,6 @@
<menuItem title="Warn" image="NSStatusPartiallyAvailable" id="menuItemWarn"/>
<menuItem title="Info" image="NSStatusAvailable" id="menuItemInfo"/>
<menuItem title="Debug" image="NSStatusNone" id="menuItemDebug"/>
<menuItem title="Trace" image="NSStatusNone" id="menuItemTracer"/>
</items>
</menu>
</popUpButtonCell>

View file

@ -16,7 +16,7 @@ typedef NS_ENUM(NSUInteger, LevelButtonLevel) {
LevelButtonLevelWarn = 1,
LevelButtonLevelInfo = 2,
LevelButtonLevelDebug = 3,
LevelButtonLevelTrace = 4,
// we do not support LevelButtonLevelTrace, as it would overwhelm everything (#4233)
};
static NSTimeInterval const kUpdateSeconds = 0.75;
@ -71,12 +71,10 @@ static NSTimeInterval const kUpdateSeconds = 0.75;
[self.fLevelButton itemAtIndex:LevelButtonLevelWarn].title = NSLocalizedString(@"Warning", "Message window -> level string");
[self.fLevelButton itemAtIndex:LevelButtonLevelInfo].title = NSLocalizedString(@"Info", "Message window -> level string");
[self.fLevelButton itemAtIndex:LevelButtonLevelDebug].title = NSLocalizedString(@"Debug", "Message window -> level string");
[self.fLevelButton itemAtIndex:LevelButtonLevelTrace].title = NSLocalizedString(@"Trace", "Message window -> level string");
[self.fLevelButton itemAtIndex:LevelButtonLevelError].image = [self.class iconForLevel:TR_LOG_ERROR];
[self.fLevelButton itemAtIndex:LevelButtonLevelWarn].image = [self.class iconForLevel:TR_LOG_WARN];
[self.fLevelButton itemAtIndex:LevelButtonLevelInfo].image = [self.class iconForLevel:TR_LOG_INFO];
[self.fLevelButton itemAtIndex:LevelButtonLevelDebug].image = [self.class iconForLevel:TR_LOG_DEBUG];
[self.fLevelButton itemAtIndex:LevelButtonLevelTrace].image = [self.class iconForLevel:TR_LOG_TRACE];
CGFloat const levelButtonOldWidth = NSWidth(self.fLevelButton.frame);
[self.fLevelButton sizeToFit];
@ -127,10 +125,8 @@ static NSTimeInterval const kUpdateSeconds = 0.75;
[self.fLevelButton selectItemAtIndex:LevelButtonLevelInfo];
break;
case TR_LOG_DEBUG:
[self.fLevelButton selectItemAtIndex:LevelButtonLevelDebug];
break;
case TR_LOG_TRACE:
[self.fLevelButton selectItemAtIndex:LevelButtonLevelTrace];
[self.fLevelButton selectItemAtIndex:LevelButtonLevelDebug];
break;
default: //safety
[NSUserDefaults.standardUserDefaults setInteger:TR_LOG_ERROR forKey:@"MessageLevel"];
@ -401,9 +397,6 @@ static NSTimeInterval const kUpdateSeconds = 0.75;
case LevelButtonLevelDebug:
level = TR_LOG_DEBUG;
break;
case LevelButtonLevelTrace:
level = TR_LOG_TRACE;
break;
default:
NSAssert1(NO, @"Unknown message log level: %ld", [self.fLevelButton indexOfSelectedItem]);
level = TR_LOG_INFO;