2022-01-20 18:27:56 +00:00
|
|
|
// This file Copyright © 2007-2022 Transmission authors and contributors.
|
|
|
|
// It may be used under the MIT (SPDX: MIT) license.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2007-11-29 01:05:11 +00:00
|
|
|
|
|
|
|
#import "ButtonToolbarItem.h"
|
|
|
|
|
|
|
|
@implementation ButtonToolbarItem
|
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
- (void)validate
|
2007-11-29 01:05:11 +00:00
|
|
|
{
|
2021-08-15 09:41:48 +00:00
|
|
|
self.enabled = [self.target validateToolbarItem:self];
|
2007-11-29 01:05:11 +00:00
|
|
|
}
|
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
- (NSMenuItem*)menuFormRepresentation
|
2007-12-04 01:46:27 +00:00
|
|
|
{
|
2021-08-15 09:41:48 +00:00
|
|
|
NSMenuItem* menuItem = [[NSMenuItem alloc] initWithTitle:self.label action:self.action keyEquivalent:@""];
|
2021-08-07 07:27:56 +00:00
|
|
|
menuItem.target = self.target;
|
2021-08-15 09:41:48 +00:00
|
|
|
menuItem.enabled = [self.target validateToolbarItem:self];
|
2017-01-24 17:53:16 +00:00
|
|
|
|
2017-07-29 16:14:22 +00:00
|
|
|
return menuItem;
|
2007-12-04 01:46:27 +00:00
|
|
|
}
|
|
|
|
|
2007-11-29 01:05:11 +00:00
|
|
|
@end
|