1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

#2835 remove file selection in action menu

This commit is contained in:
Mitchell Livingston 2010-01-31 21:26:45 +00:00
parent bc0f2bb3f0
commit 70793c23dd
2 changed files with 8 additions and 83 deletions

View file

@ -48,8 +48,6 @@
- (void) setGroupStatusColumns; - (void) setGroupStatusColumns;
- (void) createFileMenu: (NSMenu *) menu forFiles: (NSArray *) files;
@end @end
@implementation TorrentTableView @implementation TorrentTableView
@ -546,18 +544,9 @@
if (row < 0) if (row < 0)
return; return;
const NSInteger numberOfNonFileItems = [fActionMenu numberOfItems];
//update file action menu //update file action menu
fMenuTorrent = [[self itemAtRow: row] retain]; fMenuTorrent = [[self itemAtRow: row] retain];
//show/hide the file divider
const BOOL isFolder = [fMenuTorrent isFolder];
[[fActionMenu itemAtIndex: numberOfNonFileItems-1] setHidden: !isFolder];
if (isFolder)
[self createFileMenu: fActionMenu forFiles: [fMenuTorrent fileList]];
//update global limit check //update global limit check
[fGlobalLimitItem setState: [fMenuTorrent usesGlobalSpeedLimit] ? NSOnState : NSOffState]; [fGlobalLimitItem setState: [fMenuTorrent usesGlobalSpeedLimit] ? NSOnState : NSOffState];
@ -581,9 +570,6 @@
[NSMenu popUpContextMenu: fActionMenu withEvent: newEvent forView: self]; [NSMenu popUpContextMenu: fActionMenu withEvent: newEvent forView: self];
} }
for (NSInteger i = [fActionMenu numberOfItems]-1; i >= numberOfNonFileItems; i--)
[fActionMenu removeItemAtIndex: i];
[fMenuTorrent release]; [fMenuTorrent release];
fMenuTorrent = nil; fMenuTorrent = nil;
} }
@ -669,15 +655,6 @@
item = [menu itemWithTag: ACTION_MENU_PRIORITY_LOW_TAG]; item = [menu itemWithTag: ACTION_MENU_PRIORITY_LOW_TAG];
[item setState: priority == TR_PRI_LOW ? NSOnState : NSOffState]; [item setState: priority == TR_PRI_LOW ? NSOnState : NSOffState];
} }
else //assume the menu is part of the file list
{
if ([menu numberOfItems] > 0)
return;
NSMenu * supermenu = [menu supermenu];
[self createFileMenu: menu forFiles: [(FileListNode *)[[supermenu itemAtIndex: [supermenu indexOfItemWithSubmenu: menu]]
representedObject] children]];
}
} }
//alternating rows - first row after group row is white //alternating rows - first row after group row is white
@ -905,36 +882,4 @@
[[self tableColumnWithIdentifier: @"DL Image"] setHidden: ratio]; [[self tableColumnWithIdentifier: @"DL Image"] setHidden: ratio];
} }
- (void) createFileMenu: (NSMenu *) menu forFiles: (NSArray *) files
{
for (FileListNode * node in files)
{
NSString * name = [node name];
NSMenuItem * item = [[NSMenuItem alloc] initWithTitle: name action: @selector(checkFile:) keyEquivalent: @""];
if ([node isFolder])
{
NSMenu * itemMenu = [[NSMenu alloc] initWithTitle: name];
[itemMenu setAutoenablesItems: NO];
[item setSubmenu: itemMenu];
[itemMenu setDelegate: self];
[itemMenu release];
}
[item setRepresentedObject: node];
NSImage * icon = [node icon];
[icon setSize: NSMakeSize(16.0, 16.0)];
[item setImage: icon];
NSIndexSet * indexSet = [node indexes];
[item setState: [fMenuTorrent checkForFiles: indexSet]];
[item setEnabled: [fMenuTorrent canChangeDownloadCheckForFiles: indexSet]];
[menu addItem: item];
[item release];
}
}
@end @end

View file

@ -12,10 +12,11 @@
</object> </object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1936"/>
<integer value="81"/>
<integer value="456"/>
<integer value="1480"/> <integer value="1480"/>
<integer value="21"/> <integer value="21"/>
<integer value="456"/>
<integer value="81"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
@ -416,9 +417,9 @@ uF1MuF0d31394F4LFIkD59u9u5SF29tt3D6d5kI1090F4V6N6V6d6g8RSF69593d3UFovl3l6t796Q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AHMAAAIDGdUUkMAAAnYAAAIDGJU
UkMAABHkAAAIDGFhcmcAABnwAAAAIGFhZ2cAABoQAAAAIGFhYmcAABowAAAAIHZjZ3QAABpQAAAGEm5k UkMAABHkAAAIDGFhcmcAABnwAAAAIGFhZ2cAABoQAAAAIGFhYmcAABowAAAAIHZjZ3QAABpQAAAGEm5k
aW4AACBkAAAGPmRlc2MAACakAAAAX2RzY20AACcEAAAA8G1tb2QAACf0AAAAKGNwcnQAACgcAAAAJFhZ aW4AACBkAAAGPmRlc2MAACakAAAAX2RzY20AACcEAAAA8G1tb2QAACf0AAAAKGNwcnQAACgcAAAAJFhZ
@ -588,7 +589,7 @@ AAgAAADoZnJGUgAAAAgAAADocHRCUgAAAAgAAADocHRQVAAAAAgAAADoemhDTgAAAAgAAADoZXNFUwAA
AAgAAADoamFKUAAAAAgAAADocnVSVQAAAAgAAADoc3ZTRQAAAAgAAADoemhUVwAAAAgAAADoZGVERQAA AAgAAADoamFKUAAAAAgAAADocnVSVQAAAAgAAADoc3ZTRQAAAAgAAADoemhUVwAAAAgAAADoZGVERQAA
AAgAAADoZmlGSQAAAAgAAADoaXRJVAAAAAgAAADoa29LUgAAAAgAAADoAGkATQBhAGNtbW9kAAAAAAAA AAgAAADoZmlGSQAAAAgAAADoaXRJVAAAAAgAAADoa29LUgAAAAgAAADoAGkATQBhAGNtbW9kAAAAAAAA
BhAAAJxqAAAAAL/TkYAAAAAAAAAAAAAAAAAAAAAAdGV4dAAAAABDb3B5cmlnaHQgQXBwbGUsIEluYy4s BhAAAJxqAAAAAL/TkYAAAAAAAAAAAAAAAAAAAAAAdGV4dAAAAABDb3B5cmlnaHQgQXBwbGUsIEluYy4s
IDIwMDkAA</bytes> IDIwMTAAA</bytes>
</object> </object>
<string key="NSCacheWindowColorSpace">NSCalibratedRGBColorSpace</string> <string key="NSCacheWindowColorSpace">NSCalibratedRGBColorSpace</string>
<int key="NSCacheWindowBPS">8</int> <int key="NSCacheWindowBPS">8</int>
@ -3309,17 +3310,6 @@ IDIwMDkAA</bytes>
</object> </object>
</object> </object>
</object> </object>
<object class="NSMenuItem" id="1033685900">
<reference key="NSMenu" ref="588646173"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="322614661"/>
<reference key="NSMixedImage" ref="3851078"/>
</object>
</object> </object>
<string key="NSName"/> <string key="NSName"/>
<bool key="NSNoAutoenable">YES</bool> <bool key="NSNoAutoenable">YES</bool>
@ -6427,7 +6417,6 @@ IDIwMDkAA</bytes>
<reference ref="624203829"/> <reference ref="624203829"/>
<reference ref="585779654"/> <reference ref="585779654"/>
<reference ref="113299757"/> <reference ref="113299757"/>
<reference ref="1033685900"/>
<reference ref="1039703472"/> <reference ref="1039703472"/>
<reference ref="48945683"/> <reference ref="48945683"/>
<reference ref="350082482"/> <reference ref="350082482"/>
@ -6957,11 +6946,6 @@ IDIwMDkAA</bytes>
<reference key="object" ref="121868389"/> <reference key="object" ref="121868389"/>
<reference key="parent" ref="354434380"/> <reference key="parent" ref="354434380"/>
</object> </object>
<object class="IBObjectRecord">
<int key="objectID">3148</int>
<reference key="object" ref="1033685900"/>
<reference key="parent" ref="588646173"/>
</object>
<object class="IBObjectRecord"> <object class="IBObjectRecord">
<int key="objectID">1282</int> <int key="objectID">1282</int>
<reference key="object" ref="311221569"/> <reference key="object" ref="311221569"/>
@ -7610,8 +7594,6 @@ IDIwMDkAA</bytes>
<string>3140.IBPluginDependency</string> <string>3140.IBPluginDependency</string>
<string>3145.IBPluginDependency</string> <string>3145.IBPluginDependency</string>
<string>3146.IBPluginDependency</string> <string>3146.IBPluginDependency</string>
<string>3148.IBPluginDependency</string>
<string>3148.ImportedFromIB2</string>
<string>3163.IBPluginDependency</string> <string>3163.IBPluginDependency</string>
<string>3163.ImportedFromIB2</string> <string>3163.ImportedFromIB2</string>
<string>3164.IBPluginDependency</string> <string>3164.IBPluginDependency</string>
@ -7990,7 +7972,7 @@ IDIwMDkAA</bytes>
<integer value="1"/> <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/> <integer value="1"/>
<string>{{209, 474}, {310, 133}}</string> <string>{{209, 484}, {310, 123}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/> <integer value="1"/>
<string>{{381, 469}, {214, 113}}</string> <string>{{381, 469}, {214, 113}}</string>
@ -8225,8 +8207,6 @@ IDIwMDkAA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/> <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/> <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>