mirror of
https://github.com/transmission/transmission
synced 2025-03-10 14:13:23 +00:00
phase 1 of updating menu items to remove bindings
This commit is contained in:
parent
81bf7b84d9
commit
44c66afffb
5 changed files with 28 additions and 12 deletions
|
@ -256,7 +256,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
|
||||
[fTableView setTorrents: fDisplayedTorrents];
|
||||
[[fTableView tableColumnWithIdentifier: @"Torrent"] setDataCell: [[TorrentCell alloc] init]];
|
||||
|
||||
|
||||
[fTableView registerForDraggedTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE]];
|
||||
[fWindow registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, NSURLPboardType, nil]];
|
||||
|
||||
|
@ -1804,6 +1804,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
|
||||
- (void) setSortReverse: (id) sender
|
||||
{
|
||||
[fDefaults setBool: ![fDefaults boolForKey: @"SortReverse"] forKey: @"SortReverse"];
|
||||
[self sortTorrents];
|
||||
}
|
||||
|
||||
|
@ -2265,12 +2266,12 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL) tableView: (NSTableView *) tableView writeRowsWithIndexes: (NSIndexSet *) indexes
|
||||
toPasteboard: (NSPasteboard *) pasteboard
|
||||
#warning not working in Leopard
|
||||
- (BOOL) tableView: (NSTableView *) tableView writeRowsWithIndexes: (NSIndexSet *) indexes toPasteboard: (NSPasteboard *) pasteboard
|
||||
{
|
||||
//only allow reordering of rows if sorting by order with no filter
|
||||
if ([[fDefaults stringForKey: @"Sort"] isEqualToString: @"Order"]
|
||||
&& [[fDefaults stringForKey: @"Filter"] isEqualToString: @"None"]
|
||||
if ([[fDefaults stringForKey: @"Sort"] isEqualToString: SORT_ORDER]
|
||||
&& [[fDefaults stringForKey: @"Filter"] isEqualToString: FILTER_NONE]
|
||||
&& [[fSearchFilterField stringValue] length] == 0)
|
||||
{
|
||||
[pasteboard declareTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE] owner: self];
|
||||
|
@ -2474,8 +2475,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
- (void) toggleSmallView: (id) sender
|
||||
{
|
||||
BOOL makeSmall = ![fDefaults boolForKey: @"SmallView"];
|
||||
if (![NSApp isOnLeopardOrBetter])
|
||||
makeSmall != makeSmall;
|
||||
[fDefaults setBool: makeSmall forKey: @"SmallView"];
|
||||
|
||||
[fTableView setRowHeight: makeSmall ? ROW_HEIGHT_SMALL : ROW_HEIGHT_REGULAR];
|
||||
|
||||
|
@ -2848,7 +2848,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
- (BOOL) validateMenuItem: (NSMenuItem *) menuItem
|
||||
{
|
||||
SEL action = [menuItem action];
|
||||
|
||||
|
||||
//only enable some items if it is in a context menu or the window is useable
|
||||
BOOL canUseTable = [fWindow isKeyWindow] || [[menuItem menu] supermenu] != [NSApp mainMenu];
|
||||
|
||||
|
@ -2857,8 +2857,14 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
return [fWindow attachedSheet] == nil;
|
||||
|
||||
//enable sort and advanced bar items
|
||||
if (action == @selector(setSort:) || /*action == @selector(toggleAdvancedBar:) ||*/ action == @selector(toggleSmallView:))
|
||||
if (action == @selector(setSort:) /*|| action == @selector(toggleAdvancedBar:) ||*/)
|
||||
return [fWindow isVisible];
|
||||
|
||||
if (action == @selector(toggleSmallView:))
|
||||
{
|
||||
[menuItem setState: [fDefaults boolForKey: @"SmallView"] ? NSOnState : NSOffState];
|
||||
return [fWindow isVisible];
|
||||
}
|
||||
|
||||
//enable show info
|
||||
if (action == @selector(showInfo:))
|
||||
|
@ -3050,7 +3056,10 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
|
||||
//enable reverse sort item
|
||||
if (action == @selector(setSortReverse:))
|
||||
return ![[fDefaults stringForKey: @"Sort"] isEqualToString: @"Order"];
|
||||
{
|
||||
[menuItem setState: [fDefaults boolForKey: @"SortReverse"] ? NSOnState : NSOffState];
|
||||
return ![[fDefaults stringForKey: @"Sort"] isEqualToString: SORT_ORDER];
|
||||
}
|
||||
|
||||
//check proper filter search item
|
||||
if (action == @selector(setFilterSearchType:))
|
||||
|
|
8
macosx/English.lproj/MainMenu.nib/classes.nib
generated
8
macosx/English.lproj/MainMenu.nib/classes.nib
generated
|
@ -23,6 +23,14 @@
|
|||
<key>SUPERCLASS</key>
|
||||
<string>ImageBackgroundView</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSApplication</string>
|
||||
<key>LANGUAGE</key>
|
||||
<string>ObjC</string>
|
||||
<key>SUPERCLASS</key>
|
||||
<string>NSResponder</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CLASS</key>
|
||||
<string>NSMenu</string>
|
||||
|
|
2
macosx/English.lproj/MainMenu.nib/info.nib
generated
2
macosx/English.lproj/MainMenu.nib/info.nib
generated
|
@ -10,7 +10,7 @@
|
|||
<integer>5</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>21</integer>
|
||||
<integer>1639</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>9A581</string>
|
||||
|
|
BIN
macosx/English.lproj/MainMenu.nib/keyedobjects.nib
generated
BIN
macosx/English.lproj/MainMenu.nib/keyedobjects.nib
generated
Binary file not shown.
|
@ -115,7 +115,6 @@
|
|||
|
||||
- (void) mouseDown: (NSEvent *) event
|
||||
{
|
||||
//NSLog(@"down");
|
||||
fClickPoint = [self convertPoint: [event locationInWindow] fromView: nil];
|
||||
|
||||
if ([self pointInActionRect: fClickPoint])
|
||||
|
|
Loading…
Add table
Reference in a new issue