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:
parent
8a35aa0903
commit
ef2415293b
2 changed files with 2 additions and 10 deletions
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue