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 @@
+
+ 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