diff --git a/macosx/AddWindowController.h b/macosx/AddWindowController.h index 00b77eac1..cd6b624fb 100644 --- a/macosx/AddWindowController.h +++ b/macosx/AddWindowController.h @@ -33,7 +33,7 @@ IBOutlet NSImageView * fIconView, * fLocationImageView; IBOutlet NSTextField * fNameField, * fStatusField, * fLocationField; IBOutlet NSButton * fStartCheck, * fDeleteCheck; - IBOutlet NSPopUpButton * fGroupPopUp; + IBOutlet NSPopUpButton * fGroupPopUp, * fPriorityPopUp; IBOutlet NSProgressIndicator * fVerifyIndicator; IBOutlet FileOutlineController * fFileController; @@ -63,6 +63,8 @@ - (void) verifyLocalData: (id) sender; +- (void) changePriority: (id) sender; + - (void) updateStatusField: (NSNotification *) notification; - (void) updateGroupMenu: (NSNotification *) notification; diff --git a/macosx/AddWindowController.m b/macosx/AddWindowController.m index fddb6e80f..661a3b6e4 100644 --- a/macosx/AddWindowController.m +++ b/macosx/AddWindowController.m @@ -32,6 +32,10 @@ #define UPDATE_SECONDS 1.0 +#define POPUP_PRIORITY_HIGH 0 +#define POPUP_PRIORITY_NORMAL 1 +#define POPUP_PRIORITY_LOW 2 + @interface AddWindowController (Private) - (void) updateFiles; @@ -94,6 +98,16 @@ [self setGroupsMenu]; [fGroupPopUp selectItemWithTag: fGroupValue]; + NSInteger priorityTag; + switch ([fTorrent priority]) + { + case TR_PRI_HIGH: priorityTag = POPUP_PRIORITY_HIGH; break; + case TR_PRI_NORMAL: priorityTag = POPUP_PRIORITY_NORMAL; break; + case TR_PRI_LOW: priorityTag = POPUP_PRIORITY_LOW; break; + default: NSAssert1(NO, @"Unknown priority for adding torrent: %d", [fTorrent priority]); + } + [fPriorityPopUp selectItemWithTag: priorityTag]; + [fStartCheck setState: [[NSUserDefaults standardUserDefaults] boolForKey: @"AutoStartDownload"] ? NSOnState : NSOffState]; [fDeleteCheck setState: fDeleteTorrent ? NSOnState : NSOffState]; @@ -197,6 +211,19 @@ [self updateFiles]; } +- (void) changePriority: (id) sender +{ + tr_priority_t priority; + switch ([sender tag]) + { + case POPUP_PRIORITY_HIGH: priority = TR_PRI_HIGH; break; + case POPUP_PRIORITY_NORMAL: priority = TR_PRI_NORMAL; break; + case POPUP_PRIORITY_LOW: priority = TR_PRI_LOW; break; + default: NSAssert1(NO, @"Unknown priority tag for adding torrent: %d", [sender tag]); + } + [fTorrent setPriority: priority]; +} + - (void) updateStatusField: (NSNotification *) notification { NSString * statusString = [NSString stringForFileSize: [fTorrent size]]; diff --git a/macosx/en.lproj/AddWindow.xib b/macosx/en.lproj/AddWindow.xib index dbfb18749..a3e36ab1b 100644 --- a/macosx/en.lproj/AddWindow.xib +++ b/macosx/en.lproj/AddWindow.xib @@ -12,7 +12,7 @@ YES - + YES @@ -305,7 +305,7 @@ 289 - {{275, 68}, {122, 26}} + {{272, 88}, {125, 26}} YES @@ -337,7 +337,7 @@ 289 - {{225, 73}, {48, 17}} + {{224, 94}, {48, 17}} YES @@ -363,7 +363,7 @@ 256 - {357, 262} + {357, 241} YES @@ -501,7 +501,7 @@ 0 - {{1, 1}, {357, 262}} + {{1, 1}, {357, 241}} @@ -511,11 +511,11 @@ 256 - {{358, 1}, {15, 262}} + {{358, 1}, {15, 241}} _doScroller: - 0.99619771863117867 + 0.88163265306122451 @@ -528,7 +528,7 @@ 0.95348829999999996 - {{20, 107}, {374, 264}} + {{20, 128}, {374, 243}} 18 @@ -565,7 +565,7 @@ 292 - {{14, 64}, {146, 32}} + {{14, 85}, {146, 32}} YES @@ -586,11 +586,110 @@ 1316 - {{162, 72}, {16, 16}} + {{162, 94}, {16, 16}} 28936 1 + + + 289 + {{216, 66}, {54, 17}} + + YES + + 67239424 + 272629760 + Priority: + + + + + + + + + 289 + {{272, 60}, {125, 26}} + + YES + + -2076049856 + 2048 + + + 109199615 + 1 + + + 400 + 75 + + + Low + + 2147483647 + 1 + + NSImage + PriorityLow + + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + 2 + + + YES + + OtherViews + + YES + + + High + + 2147483647 + + NSImage + PriorityHigh + + + + _popUpItemAction: + + + + + Normal + + 2147483647 + + NSImage + PriorityNormal + + + + _popUpItemAction: + 1 + + + + + + 2 + 1 + YES + YES + 2 + + {414, 493} @@ -759,6 +858,22 @@ 69 + + + changePriority: + + + + 98 + + + + fPriorityPopUp + + + + 99 + @@ -818,6 +933,8 @@ + + @@ -1114,6 +1231,64 @@ + + 84 + + + YES + + + + + + 85 + + + YES + + + + + + 86 + + + YES + + + + + + 87 + + + YES + + + + + + + + 88 + + + + + 89 + + + + + 90 + + + + + 91 + + + @@ -1194,15 +1369,26 @@ 68.IBPluginDependency 7.IBPluginDependency 8.IBPluginDependency + 84.IBPluginDependency + 84.ImportedFromIB2 + 85.IBPluginDependency + 86.IBPluginDependency + 87.IBEditorWindowLastContentRect + 87.IBPluginDependency + 87.editorWindowContentRectSynchronizationRect + 88.IBPluginDependency + 89.IBPluginDependency 9.IBPluginDependency 9.ImportedFromIB2 + 90.IBPluginDependency + 91.IBPluginDependency YES com.apple.InterfaceBuilder.CocoaPlugin - {{82, 425}, {414, 493}} + {{81, 433}, {414, 493}} com.apple.InterfaceBuilder.CocoaPlugin - {{82, 425}, {414, 493}} + {{81, 433}, {414, 493}} {196, 240} {{186, 418}, {414, 493}} @@ -1234,7 +1420,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{333, 417}, {173, 4}} + {{347, 528}, {122, 6}} com.apple.InterfaceBuilder.CocoaPlugin {{465, 481}, {173, 33}} com.apple.InterfaceBuilder.CocoaPlugin @@ -1275,6 +1461,17 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{342, 456}, {125, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + {{465, 481}, {173, 33}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -1293,7 +1490,7 @@ - 69 + 99 @@ -1307,6 +1504,7 @@ YES add: cancelAdd: + changePriority: setDestination: verifyLocalData: @@ -1316,6 +1514,7 @@ id id id + id @@ -1329,6 +1528,7 @@ fLocationField fLocationImageView fNameField + fPriorityPopUp fStartCheck fStatusField fVerifyIndicator @@ -1342,6 +1542,7 @@ NSTextField NSImageView NSTextField + NSPopUpButton NSButton NSTextField NSProgressIndicator @@ -1535,6 +1736,14 @@ AppKit.framework/Headers/NSMenu.h + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + NSMenuItemCell NSButtonCell @@ -1969,10 +2178,7 @@ NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - + NSView