Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

global attributes for multiadd

  • Loading branch information...
commit 21f60dddf99b770cb8785c1eeb219352b6c7346e 1 parent c2c3686
Greg Allen authored
11 MilkMaidAppDelegate.m
View
@@ -292,12 +292,14 @@ -(void)addTask:(NSString*)task {
[progress setHidden:YES];
}
--(void)addTasks:(NSArray*)newTasks {
+-(void)addTasks:(NSArray*)newTasksArray {
[progress setHidden:NO];
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSArray *newTasks = [newTasksArray objectAtIndex:0];
+ NSString *globalAttributes = [newTasksArray objectAtIndex:1];
for (NSString *t in newTasks) {
-
- NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithObjects:[NSArray arrayWithObjects:timeline, t, @"1", nil]
+ NSString *taskName = [NSString stringWithFormat:@"%@ %@", t, globalAttributes];
+ NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithObjects:[NSArray arrayWithObjects:timeline, taskName, @"1", nil]
forKeys:[NSArray arrayWithObjects:@"timeline", @"name", @"parse", nil]];
if (currentList) {
[params setObject:[currentList objectForKey:@"id"] forKey:@"list_id"];
@@ -432,7 +434,8 @@ -(void)closeMultiAddSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode con
[sheet orderOut:self];
if (returnCode == 1) {
NSArray *newTasks = [multiAddWindowController tasks];
- [NSThread detachNewThreadSelector:@selector(addTasks:) toTarget:self withObject:newTasks];
+ NSString *globalAttributes = [multiAddWindowController globalAttributes];
+ [NSThread detachNewThreadSelector:@selector(addTasks:) toTarget:self withObject:[NSArray arrayWithObjects: newTasks,globalAttributes,nil]];
}
}
106 MultiAdd.xib
View
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="3"/>
+ <integer value="4"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -41,7 +41,7 @@
<object class="NSWindowTemplate" id="215630575">
<int key="NSWindowStyleMask">31</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{230, 343}, {285, 198}}</string>
+ <string key="NSWindowRect">{{230, 320}, {282, 221}}</string>
<int key="NSWTFlags">-1535639552</int>
<string key="NSWindowTitle">Add Multiple Tasks</string>
<string key="NSWindowClass">NSWindow</string>
@@ -55,7 +55,7 @@
<object class="NSButton" id="1069700028">
<reference key="NSNextResponder" ref="673419152"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{194, 19}, {83, 23}}</string>
+ <string key="NSFrame">{{194, 12}, {83, 23}}</string>
<reference key="NSSuperview" ref="673419152"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="871146244">
@@ -79,7 +79,7 @@
<object class="NSButton" id="152308043">
<reference key="NSNextResponder" ref="673419152"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{118, 19}, {68, 23}}</string>
+ <string key="NSFrame">{{118, 11}, {68, 23}}</string>
<reference key="NSSuperview" ref="673419152"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="930305977">
@@ -132,7 +132,7 @@
<string>public.url</string>
</object>
</object>
- <string key="NSFrameSize">{251, 81}</string>
+ <string key="NSFrameSize">{251, 14}</string>
<reference key="NSSuperview" ref="313625987"/>
<object class="NSTextContainer" key="NSTextContainer" id="144221310">
<object class="NSLayoutManager" key="NSLayoutManager">
@@ -253,7 +253,7 @@
<double key="NSPercent">0.94565218687057495</double>
</object>
</object>
- <string key="NSFrame">{{9, 49}, {268, 142}}</string>
+ <string key="NSFrame">{{9, 72}, {268, 142}}</string>
<reference key="NSSuperview" ref="673419152"/>
<reference key="NSNextKeyView" ref="313625987"/>
<int key="NSsFlags">18</int>
@@ -261,8 +261,36 @@
<reference key="NSHScroller" ref="21217123"/>
<reference key="NSContentView" ref="313625987"/>
</object>
+ <object class="NSTextField" id="73394151">
+ <reference key="NSNextResponder" ref="673419152"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{9, 42}, {268, 22}}</string>
+ <reference key="NSSuperview" ref="673419152"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="848744161">
+ <int key="NSCellFlags">-1804468671</int>
+ <int key="NSCellFlags2">272630784</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="318179855"/>
+ <string key="NSPlaceholderString">Global Attributes (ex: @home !2)</string>
+ <reference key="NSControlView" ref="73394151"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textBackgroundColor</string>
+ <reference key="NSColor" ref="588570388"/>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textColor</string>
+ <reference key="NSColor" ref="1055705804"/>
+ </object>
+ </object>
+ </object>
</object>
- <string key="NSFrameSize">{285, 198}</string>
+ <string key="NSFrameSize">{282, 221}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
@@ -304,6 +332,14 @@
</object>
<int key="connectionID">18</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">globalTextField</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="73394151"/>
+ </object>
+ <int key="connectionID">21</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -347,8 +383,9 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="683082859"/>
- <reference ref="1069700028"/>
<reference ref="152308043"/>
+ <reference ref="73394151"/>
+ <reference ref="1069700028"/>
</object>
<reference key="parent" ref="215630575"/>
</object>
@@ -406,6 +443,20 @@
<reference key="object" ref="384783118"/>
<reference key="parent" ref="683082859"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">19</int>
+ <reference key="object" ref="73394151"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="848744161"/>
+ </object>
+ <reference key="parent" ref="673419152"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">20</int>
+ <reference key="object" ref="848744161"/>
+ <reference key="parent" ref="73394151"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -417,6 +468,8 @@
<string>12.IBPluginDependency</string>
<string>13.IBPluginDependency</string>
<string>14.IBPluginDependency</string>
+ <string>19.IBPluginDependency</string>
+ <string>20.IBPluginDependency</string>
<string>3.IBEditorWindowLastContentRect</string>
<string>3.IBPluginDependency</string>
<string>3.IBWindowTemplateEditedContentRect</string>
@@ -433,9 +486,11 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{735, 860}, {285, 198}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{735, 860}, {285, 198}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{735, 837}, {282, 221}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{735, 837}, {282, 221}}</string>
<boolean value="NO"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -459,7 +514,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">18</int>
+ <int key="maxID">21</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -481,8 +536,17 @@
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">scrollTextView</string>
- <string key="NS.object.0">NSScrollView</string>
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>globalTextField</string>
+ <string>scrollTextView</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSTextField</string>
+ <string>NSScrollView</string>
+ </object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
@@ -910,6 +974,22 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSTextField</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextFieldCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSTextView</string>
<string key="superclassName">NSText</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
3  MultiAddWindowController.h
View
@@ -11,9 +11,12 @@
@interface MultiAddWindowController : NSWindowController {
IBOutlet NSScrollView *scrollTextView;
+ IBOutlet NSTextField *globalTextField;
NSArray *tasks;
+ NSString *globalAttributes;
}
@property (assign) NSArray *tasks;
+@property (assign) NSString *globalAttributes;
-(IBAction)addClicked:(id)sender;
-(IBAction)cancelClicked:(id)sender;
@end
4 MultiAddWindowController.m
View
@@ -12,14 +12,18 @@
@implementation MultiAddWindowController
@synthesize tasks;
+@synthesize globalAttributes;
-(void)addClicked:(id)sender {
NSTextView *textView = [scrollTextView documentView];
NSString *tasksString = [[textView textStorage] string];
tasksString = [tasksString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
tasks = [tasksString componentsSeparatedByString:@"\n"];
+ globalAttributes = [globalTextField stringValue];
[tasks retain];
+ [globalAttributes retain];
[textView setString:@""];
+ [globalTextField setStringValue:@""];
[NSApp endSheet:[self window] returnCode:1];
}
Please sign in to comment.
Something went wrong with that request. Please try again.