mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
Add context menu to file table
This commit is contained in:
7
macosx/English.lproj/InfoWindow.nib/classes.nib
generated
7
macosx/English.lproj/InfoWindow.nib/classes.nib
generated
@@ -1,6 +1,11 @@
|
||||
{
|
||||
IBClasses = (
|
||||
{CLASS = FileTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; },
|
||||
{
|
||||
CLASS = FileTableView;
|
||||
LANGUAGE = ObjC;
|
||||
OUTLETS = {fContextMenu = NSMenu; };
|
||||
SUPERCLASS = NSTableView;
|
||||
},
|
||||
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
||||
{
|
||||
ACTIONS = {revealFile = id; setRatioCheck = id; setRatioLimit = id; };
|
||||
|
||||
10
macosx/English.lproj/InfoWindow.nib/info.nib
generated
10
macosx/English.lproj/InfoWindow.nib/info.nib
generated
@@ -3,7 +3,12 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>94 65 356 240 0 0 1440 878 </string>
|
||||
<string>69 61 356 240 0 0 1152 842 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>549</key>
|
||||
<string>69 306 75 68 0 0 1152 842 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>446.1</string>
|
||||
<key>IBLockedObjects</key>
|
||||
@@ -16,9 +21,10 @@
|
||||
</array>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>549</integer>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>8I1119</string>
|
||||
<string>8I127</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
BIN
macosx/English.lproj/InfoWindow.nib/keyedobjects.nib
generated
BIN
macosx/English.lproj/InfoWindow.nib/keyedobjects.nib
generated
Binary file not shown.
@@ -26,6 +26,7 @@
|
||||
|
||||
@interface FileTableView : NSTableView
|
||||
{
|
||||
IBOutlet NSMenu * fContextMenu;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -32,4 +32,20 @@
|
||||
[super mouseDown: event];
|
||||
}
|
||||
|
||||
- (NSMenu *) menuForEvent: (NSEvent *) e
|
||||
{
|
||||
int row = [self rowAtPoint: [self convertPoint: [e locationInWindow] fromView: nil]];
|
||||
|
||||
if (row >= 0)
|
||||
{
|
||||
if (![self isRowSelected: row])
|
||||
[self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
|
||||
byExtendingSelection: NO];
|
||||
}
|
||||
else
|
||||
[self deselectAll: self];
|
||||
|
||||
return fContextMenu;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -115,13 +115,9 @@
|
||||
|
||||
- (NSMenu *) menuForEvent: (NSEvent *) e
|
||||
{
|
||||
NSPoint point;
|
||||
int row;
|
||||
|
||||
point = [self convertPoint: [e locationInWindow] fromView: nil];
|
||||
row = [self rowAtPoint: point];
|
||||
int row = [self rowAtPoint: [self convertPoint: [e locationInWindow] fromView: nil]];
|
||||
|
||||
if( row >= 0 )
|
||||
if (row >= 0)
|
||||
{
|
||||
if (![self isRowSelected: row])
|
||||
[self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
|
||||
|
||||
Reference in New Issue
Block a user