2023-11-01 22:11:11 +01:00
|
|
|
// This file Copyright © Transmission authors and contributors.
|
2022-01-20 12:27:56 -06:00
|
|
|
// 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 12:41:48 +03:00
|
|
|
- (void)validate
|
2007-11-29 01:05:11 +00:00
|
|
|
{
|
2021-08-15 12:41:48 +03:00
|
|
|
self.enabled = [self.target validateToolbarItem:self];
|
2007-11-29 01:05:11 +00:00
|
|
|
}
|
|
|
|
|
2021-08-15 12:41:48 +03:00
|
|
|
- (NSMenuItem*)menuFormRepresentation
|
2007-12-04 01:46:27 +00:00
|
|
|
{
|
2021-08-15 12:41:48 +03:00
|
|
|
NSMenuItem* menuItem = [[NSMenuItem alloc] initWithTitle:self.label action:self.action keyEquivalent:@""];
|
2021-08-07 14:27:56 +07:00
|
|
|
menuItem.target = self.target;
|
2021-08-15 12:41:48 +03:00
|
|
|
menuItem.enabled = [self.target validateToolbarItem:self];
|
2017-01-24 20:53:16 +03:00
|
|
|
|
2017-07-29 23:14:22 +07:00
|
|
|
return menuItem;
|
2007-12-04 01:46:27 +00:00
|
|
|
}
|
|
|
|
|
2007-11-29 01:05:11 +00:00
|
|
|
@end
|