Index: trunk/tools/Snap-to-Commons/SettingsViewController.xib |
— | — | @@ -129,9 +129,36 @@ |
130 | 130 | <string key="NSFrameSize">{320, 416}</string> |
131 | 131 | <reference key="NSSuperview"/> |
132 | 132 | <object class="NSColor" key="IBUIBackgroundColor"> |
133 | | - <int key="NSColorSpace">3</int> |
134 | | - <bytes key="NSWhite">MQA</bytes> |
135 | | - <reference key="NSCustomColorSpace" ref="437644164"/> |
| 133 | + <int key="NSColorSpace">10</int> |
| 134 | + <object class="NSImage" key="NSImage"> |
| 135 | + <int key="NSImageFlags">549453824</int> |
| 136 | + <string key="NSSize">{84, 1}</string> |
| 137 | + <object class="NSMutableArray" key="NSReps"> |
| 138 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 139 | + <object class="NSArray"> |
| 140 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 141 | + <integer value="0"/> |
| 142 | + <object class="NSBitmapImageRep"> |
| 143 | + <object class="NSData" key="NSTIFFRepresentation"> |
| 144 | + <bytes key="NS.bytes">TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ |
| 145 | +y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ |
| 146 | +xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ |
| 147 | +xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ |
| 148 | +xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ |
| 149 | +xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB |
| 150 | +AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES |
| 151 | +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS |
| 152 | +AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA</bytes> |
| 153 | + </object> |
| 154 | + </object> |
| 155 | + </object> |
| 156 | + </object> |
| 157 | + <object class="NSColor" key="NSColor"> |
| 158 | + <int key="NSColorSpace">3</int> |
| 159 | + <bytes key="NSWhite">MCAwAA</bytes> |
| 160 | + </object> |
| 161 | + </object> |
| 162 | + <string key="IBUIColorCocoaTouchKeyPath">groupTableViewBackgroundColor</string> |
136 | 163 | </object> |
137 | 164 | <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/> |
138 | 165 | <object class="IBUISimulatedNavigationBarMetrics" key="IBUISimulatedTopBarMetrics"> |
Index: trunk/tools/Snap-to-Commons/SettingsViewController.m |
— | — | @@ -58,6 +58,9 @@ |
59 | 59 | |
60 | 60 | |
61 | 61 | - (void)dealloc { |
| 62 | + [username release]; |
| 63 | + [password release]; |
| 64 | + [save release]; |
62 | 65 | [super dealloc]; |
63 | 66 | } |
64 | 67 | |
Index: trunk/tools/Snap-to-Commons/Classes/PhotoPickerViewController.m |
— | — | @@ -9,31 +9,26 @@ |
10 | 10 | #import "NSData+PhotoPicker.h" |
11 | 11 | #import "PhotoPickerAppDelegate.h" |
12 | 12 | #import "UIImage+PhotoPicker.h" |
| 13 | +#import "CommonsUpload.h" |
| 14 | +#import "ImageDetailsViewController.h" |
13 | 15 | |
14 | 16 | static int kPhotoPickerViewControllerSourceIndexCamera = 0; |
15 | 17 | static int kPhotoPickerViewControllerSourceIndexPhotoLibrary = 1; |
| 18 | +static int kPhotoPickerViewControllerSettings = 2; |
16 | 19 | |
17 | 20 | |
18 | 21 | @interface PhotoPickerViewController () |
19 | | - @property (nonatomic, retain) NSURLConnection *connection; |
20 | 22 | @property (nonatomic, retain) NSData *imageData; |
21 | | - @property (nonatomic, retain) NSHTTPURLResponse *response; |
22 | | - @property (nonatomic, retain) NSMutableData *responseData; |
23 | 23 | - (void)cancelApp; |
24 | 24 | - (void)pickPhoto:(UIImagePickerControllerSourceType)sourceType; |
25 | 25 | - (void)showPhotoSourceMenu; |
26 | 26 | - (void)showPhotoSourceMenuOrPhotoSourceDirectly; |
27 | | - - (void)uploadImage; |
28 | 27 | @end |
29 | 28 | |
30 | 29 | |
31 | 30 | @implementation PhotoPickerViewController |
32 | 31 | |
33 | | - |
34 | | -@synthesize connection; |
35 | 32 | @synthesize imageData; |
36 | | -@synthesize response; |
37 | | -@synthesize responseData; |
38 | 33 | |
39 | 34 | |
40 | 35 | #pragma mark UIActionSheetDelegate Methods |
— | — | @@ -50,7 +45,9 @@ |
51 | 46 | [self onCameraClicked]; |
52 | 47 | } else if (buttonIndex == kPhotoPickerViewControllerSourceIndexPhotoLibrary) { |
53 | 48 | [self onPhotoLibraryClicked]; |
54 | | - } |
| 49 | + } else if (buttonIndex == kPhotoPickerViewControllerSettings) { |
| 50 | + [self onSettingsClicked]; |
| 51 | + } |
55 | 52 | } |
56 | 53 | |
57 | 54 | |
— | — | @@ -68,18 +65,26 @@ |
69 | 66 | |
70 | 67 | image = [image correctOrientation:image]; |
71 | 68 | |
72 | | - self.imageData = UIImageJPEGRepresentation(image, 0.85f); |
| 69 | + CommonsUpload *ourUpload = [[CommonsUpload alloc] init]; |
| 70 | + ourUpload.imageData = UIImageJPEGRepresentation(image, 0.85f); |
73 | 71 | |
74 | | - uploadOverlayImage.image = image; |
75 | | - uploadProgressMessage.text = @"uploading"; |
76 | | - uploadProgress.progress = 0.0f; |
| 72 | + //uploadOverlayImage.image = image; |
| 73 | + //uploadProgressMessage.text = @"uploading"; |
| 74 | + //uploadProgress.progress = 0.0f; |
77 | 75 | |
78 | | - uploadPhotoOverlay.frame = CGRectMake(0, 20, 320, 460); |
79 | | - [[UIApplication sharedApplication].keyWindow addSubview:uploadPhotoOverlay]; |
| 76 | + //uploadPhotoOverlay.frame = CGRectMake(0, 20, 320, 460); |
| 77 | + //[[UIApplication sharedApplication].keyWindow addSubview:uploadPhotoOverlay]; |
| 78 | + |
| 79 | + ImageDetailsViewController *detailsController = [[ImageDetailsViewController alloc] init]; |
| 80 | + |
| 81 | + detailsController.upload = ourUpload; |
| 82 | + [ourUpload release]; |
80 | 83 | |
81 | | - [self uploadImage]; |
82 | | - |
83 | | - [picker.view removeFromSuperview]; |
| 84 | + //to push the UIView. |
| 85 | + [self.navigationController pushViewController:detailsController animated:YES]; |
| 86 | + [detailsController release]; |
| 87 | + |
| 88 | + [picker.view removeFromSuperview]; |
84 | 89 | [picker release]; |
85 | 90 | } |
86 | 91 | |
— | — | @@ -108,6 +113,8 @@ |
109 | 114 | |
110 | 115 | |
111 | 116 | - (void)viewDidLoad { |
| 117 | + [super viewDidLoad]; |
| 118 | + |
112 | 119 | #ifdef FORCE_ENABLE_CAMERA |
113 | 120 | cameraAvailable = YES; |
114 | 121 | fakeCameraAvailable = ![UIImagePickerController |
— | — | @@ -132,79 +139,6 @@ |
133 | 140 | #endif |
134 | 141 | } |
135 | 142 | |
136 | | - |
137 | | -#pragma mark URL Connection Event Handlers |
138 | | - |
139 | | - |
140 | | -// Final event, memory is cleaned up at the end of this. |
141 | | -- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { |
142 | | - self.connection = nil; |
143 | | - self.response = nil; |
144 | | - |
145 | | - uploadProgress.progress = 0.0f; |
146 | | - uploadProgressMessage.text = @"An error occurred, retrying in 10 seconds..."; |
147 | | - |
148 | | - retryCounter = 10; |
149 | | - [self performSelector:@selector(retry) withObject:nil afterDelay:1.0f]; |
150 | | -} |
151 | | - |
152 | | - |
153 | | -// Final event, memory is cleaned up at the end of this. |
154 | | -- (void)connectionDidFinishLoading:(NSURLConnection *)connection { |
155 | | - self.connection = nil; |
156 | | - |
157 | | - if ([self.response statusCode] == 200) { |
158 | | - uploadProgress.progress = 1.0f; |
159 | | - |
160 | | - NSString *responseString = [[[NSString alloc] initWithBytes:[self.responseData bytes] |
161 | | - length:[self.responseData length] |
162 | | - encoding:NSUTF8StringEncoding] autorelease]; |
163 | | - responseString = |
164 | | - [responseString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; |
165 | | - |
166 | | - NSString *successContinueUrl = CONTINUE_URL; |
167 | | - |
168 | | - successContinueUrl = |
169 | | - [successContinueUrl stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; |
170 | | - |
171 | | - BOOL hasQuestionMark = [successContinueUrl rangeOfString:@"?"].location != NSNotFound; |
172 | | - |
173 | | - successContinueUrl = |
174 | | - [successContinueUrl stringByAppendingString:hasQuestionMark ? @"&" : @"?"]; |
175 | | - successContinueUrl = [successContinueUrl stringByAppendingFormat:@"success=1&response=%@", |
176 | | - responseString]; |
177 | | - |
178 | | - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:successContinueUrl]]; |
179 | | - } else { |
180 | | - uploadProgress.progress = 0.0f; |
181 | | - uploadProgressMessage.text = @"An error occurred, retrying in 10 seconds..."; |
182 | | - |
183 | | - retryCounter = 10; |
184 | | - [self performSelector:@selector(retry) withObject:nil afterDelay:1.0f]; |
185 | | - } |
186 | | - |
187 | | - self.response = nil; |
188 | | -} |
189 | | - |
190 | | - |
191 | | -- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)newData { |
192 | | - [responseData appendData:newData]; |
193 | | -} |
194 | | - |
195 | | - |
196 | | -- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)newResponse { |
197 | | - self.response = (NSHTTPURLResponse *) newResponse; |
198 | | -} |
199 | | - |
200 | | - |
201 | | -- (void)connection:(NSURLConnection *)connection |
202 | | - didSendBodyData:(NSInteger)bytesWritten |
203 | | - totalBytesWritten:(NSInteger)totalBytesWritten |
204 | | - totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { |
205 | | - uploadProgress.progress = (float) totalBytesWritten / totalBytesExpectedToWrite; |
206 | | -} |
207 | | - |
208 | | - |
209 | 143 | #pragma mark Public |
210 | 144 | |
211 | 145 | |
— | — | @@ -212,18 +146,20 @@ |
213 | 147 | [self pickPhoto:UIImagePickerControllerSourceTypeCamera]; |
214 | 148 | } |
215 | 149 | |
| 150 | +- (IBAction)onPhotoLibraryClicked { |
| 151 | + [self pickPhoto:UIImagePickerControllerSourceTypePhotoLibrary]; |
| 152 | +} |
216 | 153 | |
217 | | -- (IBAction)onCancelUploadClicked { |
218 | | - [self.connection cancel]; |
219 | | - self.connection = nil; |
| 154 | +- (IBAction)onSettingsClicked { |
| 155 | + [self.navigationController popToRootViewControllerAnimated:YES]; |
| 156 | +} |
220 | 157 | |
| 158 | +- (IBAction)onCancelUploadClicked { |
| 159 | +/* |
221 | 160 | [NSObject cancelPreviousPerformRequestsWithTarget:self |
222 | | - selector:@selector(retry) |
223 | | - object:nil]; |
224 | | - [NSObject cancelPreviousPerformRequestsWithTarget:self |
225 | 161 | selector:@selector(uploadImage) |
226 | 162 | object:nil]; |
227 | | - |
| 163 | +*/ |
228 | 164 | [uploadPhotoOverlay removeFromSuperview]; |
229 | 165 | |
230 | 166 | [self showPhotoSourceMenuOrPhotoSourceDirectly]; |
— | — | @@ -235,27 +171,13 @@ |
236 | 172 | } |
237 | 173 | |
238 | 174 | |
239 | | -- (IBAction)onPhotoLibraryClicked { |
240 | | - [self pickPhoto:UIImagePickerControllerSourceTypePhotoLibrary]; |
241 | | -} |
242 | 175 | |
243 | 176 | |
244 | 177 | #pragma mark Private |
245 | 178 | |
246 | 179 | |
247 | 180 | - (void)cancelApp { |
248 | | - NSString *cancelContinueUrl = CONTINUE_URL; |
249 | | - |
250 | | - cancelContinueUrl = |
251 | | - [cancelContinueUrl stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; |
252 | | - |
253 | | - BOOL hasQuestionMark = [cancelContinueUrl rangeOfString:@"?"].location != NSNotFound; |
254 | | - |
255 | | - cancelContinueUrl = |
256 | | - [cancelContinueUrl stringByAppendingString:hasQuestionMark ? @"&" : @"?"]; |
257 | | - cancelContinueUrl = [cancelContinueUrl stringByAppendingString:@"success=0"]; |
258 | | - |
259 | | - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:cancelContinueUrl]]; |
| 181 | + [self.navigationController popToRootViewControllerAnimated:YES]; |
260 | 182 | } |
261 | 183 | |
262 | 184 | |
— | — | @@ -279,22 +201,6 @@ |
280 | 202 | } |
281 | 203 | |
282 | 204 | |
283 | | -- (void)retry { |
284 | | - retryCounter--; |
285 | | - |
286 | | - if (retryCounter <= 0) { |
287 | | - [self uploadImage]; |
288 | | - } else { |
289 | | - uploadProgressMessage.text = |
290 | | - [NSString stringWithFormat:@"An error occurred, retrying in %d second%@...", |
291 | | - retryCounter, |
292 | | - retryCounter != 1 ? @"s" : @""]; |
293 | | - |
294 | | - [self performSelector:@selector(retry) withObject:nil afterDelay:1.0f]; |
295 | | - } |
296 | | -} |
297 | | - |
298 | | - |
299 | 205 | - (void)showPhotoSourceMenu { |
300 | 206 | if (cameraAvailable) { |
301 | 207 | photoSourceActionSheet = [[UIActionSheet alloc] |
— | — | @@ -302,24 +208,27 @@ |
303 | 209 | delegate:self |
304 | 210 | cancelButtonTitle:@"Cancel" |
305 | 211 | destructiveButtonTitle:nil |
306 | | - otherButtonTitles:@"Camera", @"Photo Library", nil]; |
| 212 | + otherButtonTitles:@"Camera", @"Photo Library", @"Settings", nil]; |
307 | 213 | kPhotoPickerViewControllerSourceIndexCamera = 0; |
308 | 214 | kPhotoPickerViewControllerSourceIndexPhotoLibrary = 1; |
| 215 | + kPhotoPickerViewControllerSettings = 2; |
309 | 216 | } else { |
310 | 217 | photoSourceActionSheet = [[UIActionSheet alloc] |
311 | 218 | initWithTitle:nil |
312 | 219 | delegate:self |
313 | 220 | cancelButtonTitle:@"Cancel" |
314 | 221 | destructiveButtonTitle:nil |
315 | | - otherButtonTitles:@"Choose Photo", nil]; |
| 222 | + otherButtonTitles:@"Choose Photo", @"Settings", nil]; |
316 | 223 | kPhotoPickerViewControllerSourceIndexCamera = -99; |
317 | 224 | kPhotoPickerViewControllerSourceIndexPhotoLibrary = 0; |
| 225 | + kPhotoPickerViewControllerSettings = 1; |
318 | 226 | } |
319 | 227 | photoSourceActionSheet.actionSheetStyle = UIBarStyleDefault; |
320 | 228 | |
321 | 229 | UIImage *backgroundImage = [UIImage imageNamed:@"home-background.png"]; |
322 | 230 | UIView *background = [[UIImageView alloc] initWithImage:backgroundImage]; |
323 | 231 | background.frame = CGRectMake(0, cameraAvailable ? -253 : -320, 320, 460); |
| 232 | + |
324 | 233 | [photoSourceActionSheet insertSubview:background atIndex:0]; |
325 | 234 | |
326 | 235 | [photoSourceActionSheet showInView:self.view]; |
Index: trunk/tools/Snap-to-Commons/Classes/ImageDetailsViewController.m |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | |
15 | 15 | @synthesize titleField; |
16 | 16 | @synthesize descriptionText; |
| 17 | +@synthesize upload; |
17 | 18 | |
18 | 19 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. |
19 | 20 | /* |
— | — | @@ -25,13 +26,14 @@ |
26 | 27 | } |
27 | 28 | */ |
28 | 29 | |
29 | | -/* |
| 30 | + |
30 | 31 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. |
31 | 32 | - (void)viewDidLoad { |
32 | 33 | [super viewDidLoad]; |
| 34 | + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle: @"Upload" style: UIBarButtonItemStyleDone target: self action: @selector( doUpload: ) ]; |
33 | 35 | } |
34 | | -*/ |
35 | 36 | |
| 37 | + |
36 | 38 | /* |
37 | 39 | // Override to allow orientations other than the default portrait orientation. |
38 | 40 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
— | — | @@ -55,6 +57,9 @@ |
56 | 58 | |
57 | 59 | |
58 | 60 | - (void)dealloc { |
| 61 | + [titleField release]; |
| 62 | + [descriptionText release]; |
| 63 | + [upload release]; |
59 | 64 | [super dealloc]; |
60 | 65 | } |
61 | 66 | |
— | — | @@ -66,6 +71,40 @@ |
67 | 72 | [sender resignFirstResponder]; |
68 | 73 | } |
69 | 74 | |
| 75 | +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range |
| 76 | + replacementText:(NSString *)text |
| 77 | +{ |
| 78 | + return YES; |
| 79 | +} |
70 | 80 | |
| 81 | +- (void)doUpload:(id)sender { |
| 82 | + upload.title = [NSString stringWithFormat: @"%@.jpg", titleField.text]; |
| 83 | + upload.description = descriptionText.text; |
| 84 | + [descriptionText resignFirstResponder]; |
| 85 | + upload.delegate = self; |
| 86 | + |
| 87 | + [upload uploadImage]; |
| 88 | +} |
71 | 89 | |
| 90 | +- (void)uploadSucceeded { |
| 91 | + UIAlertView *alert = |
| 92 | + [[UIAlertView alloc] initWithTitle: @"Upload succeeded" |
| 93 | + message: nil |
| 94 | + delegate: self |
| 95 | + cancelButtonTitle: @"Show upload" |
| 96 | + otherButtonTitles: nil]; |
| 97 | + [alert show]; |
| 98 | + [alert release]; |
| 99 | +} |
| 100 | + |
| 101 | +- (void)uploadFailed:(NSString *)error { |
| 102 | + NSLog(error); |
| 103 | + [self.navigationController popToRootViewControllerAnimated:YES]; |
| 104 | +} |
| 105 | + |
| 106 | +- (void) alertView: (UIAlertView *) alertView clickedButtonAtIndex: (NSInteger) buttonIndex { |
| 107 | + [[UIApplication sharedApplication] openURL:[NSURL URLWithString: [NSString stringWithFormat:@"http://commons.wikimedia.org/wiki/File:%@", [upload.title stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]]; |
| 108 | + //[self.navigationController popToRootViewControllerAnimated:YES]; |
| 109 | +} // clickedButtonAtIndex |
| 110 | + |
72 | 111 | @end |
Index: trunk/tools/Snap-to-Commons/Classes/Configuration.h |
— | — | @@ -17,5 +17,5 @@ |
18 | 18 | |
19 | 19 | // Constants |
20 | 20 | #define API_URL @"http://commons.wikimedia.org/w/api.php" |
21 | | -#define DEFAULT_LICENSE @"{{cc-by-sa-3.0}}" |
| 21 | +#define DEFAULT_LICENSE @"{{self|cc-by-sa-3.0}}" |
22 | 22 | #define APPLICATION_CATEGORY @"Images uploaded with WikiSnaps" |
\ No newline at end of file |
Index: trunk/tools/Snap-to-Commons/Classes/CommonsUpload.h |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | |
21 | 21 | |
22 | 22 | @interface CommonsUpload : NSObject { |
23 | | - UIImage *imageData; |
| 23 | + NSData *imageData; |
24 | 24 | NSString *title; |
25 | 25 | NSString *description; |
26 | 26 | NSString *token; |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | id <CommonsUploadDelegate> delegate; |
30 | 30 | } |
31 | 31 | |
32 | | -@property (nonatomic, retain) UIImage *imageData; |
| 32 | +@property (nonatomic, retain) NSData *imageData; |
33 | 33 | @property (nonatomic, retain) NSString *title; |
34 | 34 | @property (nonatomic, retain) NSString *description; |
35 | 35 | @property (nonatomic, assign) id <CommonsUploadDelegate> delegate; |
Index: trunk/tools/Snap-to-Commons/Classes/ImageDetailsViewController.xib |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | <object class="IBUITextView" id="786444300"> |
72 | 72 | <reference key="NSNextResponder" ref="191373211"/> |
73 | 73 | <int key="NSvFlags">292</int> |
74 | | - <string key="NSFrame">{{20, 59}, {280, 155}}</string> |
| 74 | + <string key="NSFrame">{{20, 84}, {280, 142}}</string> |
75 | 75 | <reference key="NSSuperview" ref="191373211"/> |
76 | 76 | <object class="NSColor" key="IBUIBackgroundColor"> |
77 | 77 | <int key="NSColorSpace">1</int> |
— | — | @@ -79,13 +79,35 @@ |
80 | 80 | <bool key="IBUIClipsSubviews">YES</bool> |
81 | 81 | <bool key="IBUIMultipleTouchEnabled">YES</bool> |
82 | 82 | <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
83 | | - <string key="IBUIText">Description</string> |
| 83 | + <string key="IBUIText"/> |
84 | 84 | <object class="IBUITextInputTraits" key="IBUITextInputTraits"> |
85 | 85 | <int key="IBUIAutocapitalizationType">2</int> |
86 | 86 | <int key="IBUIAutocorrectionType">2</int> |
87 | 87 | <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
88 | 88 | </object> |
89 | 89 | </object> |
| 90 | + <object class="IBUILabel" id="995657542"> |
| 91 | + <reference key="NSNextResponder" ref="191373211"/> |
| 92 | + <int key="NSvFlags">292</int> |
| 93 | + <string key="NSFrame">{{20, 59}, {86, 21}}</string> |
| 94 | + <reference key="NSSuperview" ref="191373211"/> |
| 95 | + <bool key="IBUIOpaque">NO</bool> |
| 96 | + <bool key="IBUIClipsSubviews">YES</bool> |
| 97 | + <int key="IBUIContentMode">7</int> |
| 98 | + <bool key="IBUIUserInteractionEnabled">NO</bool> |
| 99 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
| 100 | + <string key="IBUIText">Description</string> |
| 101 | + <object class="NSColor" key="IBUITextColor"> |
| 102 | + <int key="NSColorSpace">1</int> |
| 103 | + <bytes key="NSRGB">MCAwIDAAA</bytes> |
| 104 | + </object> |
| 105 | + <object class="NSColor" key="IBUIHighlightedColor"> |
| 106 | + <int key="NSColorSpace">3</int> |
| 107 | + <bytes key="NSWhite">MQA</bytes> |
| 108 | + </object> |
| 109 | + <int key="IBUIBaselineAdjustment">1</int> |
| 110 | + <float key="IBUIMinimumFontSize">10</float> |
| 111 | + </object> |
90 | 112 | </object> |
91 | 113 | <string key="NSFrameSize">{320, 416}</string> |
92 | 114 | <reference key="NSSuperview"/> |
— | — | @@ -197,6 +219,7 @@ |
198 | 220 | <bool key="EncodedWithXMLCoder">YES</bool> |
199 | 221 | <reference ref="717110592"/> |
200 | 222 | <reference ref="786444300"/> |
| 223 | + <reference ref="995657542"/> |
201 | 224 | </object> |
202 | 225 | <reference key="parent" ref="0"/> |
203 | 226 | </object> |
— | — | @@ -221,6 +244,11 @@ |
222 | 245 | <reference key="object" ref="786444300"/> |
223 | 246 | <reference key="parent" ref="191373211"/> |
224 | 247 | </object> |
| 248 | + <object class="IBObjectRecord"> |
| 249 | + <int key="objectID">15</int> |
| 250 | + <reference key="object" ref="995657542"/> |
| 251 | + <reference key="parent" ref="191373211"/> |
| 252 | + </object> |
225 | 253 | </object> |
226 | 254 | </object> |
227 | 255 | <object class="NSMutableDictionary" key="flattenedProperties"> |
— | — | @@ -231,8 +259,11 @@ |
232 | 260 | <string>-2.CustomClassName</string> |
233 | 261 | <string>1.IBEditorWindowLastContentRect</string> |
234 | 262 | <string>1.IBPluginDependency</string> |
| 263 | + <string>15.IBPluginDependency</string> |
| 264 | + <string>15.IBViewBoundsToFrameTransform</string> |
235 | 265 | <string>4.IBPluginDependency</string> |
236 | 266 | <string>5.IBPluginDependency</string> |
| 267 | + <string>5.IBViewBoundsToFrameTransform</string> |
237 | 268 | </object> |
238 | 269 | <object class="NSMutableArray" key="dict.values"> |
239 | 270 | <bool key="EncodedWithXMLCoder">YES</bool> |
— | — | @@ -241,7 +272,14 @@ |
242 | 273 | <string>{{791, 124}, {320, 480}}</string> |
243 | 274 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
244 | 275 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
| 276 | + <object class="NSAffineTransform"> |
| 277 | + <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwpQAAA</bytes> |
| 278 | + </object> |
245 | 279 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
| 280 | + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
| 281 | + <object class="NSAffineTransform"> |
| 282 | + <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw0cAAA</bytes> |
| 283 | + </object> |
246 | 284 | </object> |
247 | 285 | </object> |
248 | 286 | <object class="NSMutableDictionary" key="unlocalizedProperties"> |
— | — | @@ -260,7 +298,7 @@ |
261 | 299 | </object> |
262 | 300 | </object> |
263 | 301 | <nil key="sourceID"/> |
264 | | - <int key="maxID">14</int> |
| 302 | + <int key="maxID">15</int> |
265 | 303 | </object> |
266 | 304 | <object class="IBClassDescriber" key="IBDocument.Classes"> |
267 | 305 | <object class="NSMutableArray" key="referencedPartialClassDescriptions"> |
— | — | @@ -269,15 +307,36 @@ |
270 | 308 | <string key="className">ImageDetailsViewController</string> |
271 | 309 | <string key="superclassName">UIViewController</string> |
272 | 310 | <object class="NSMutableDictionary" key="actions"> |
273 | | - <string key="NS.key.0">textFieldDidEnd:</string> |
274 | | - <string key="NS.object.0">id</string> |
| 311 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 312 | + <object class="NSArray" key="dict.sortedKeys"> |
| 313 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 314 | + <string>doUpload:</string> |
| 315 | + <string>textFieldDidEnd:</string> |
| 316 | + </object> |
| 317 | + <object class="NSMutableArray" key="dict.values"> |
| 318 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 319 | + <string>id</string> |
| 320 | + <string>id</string> |
| 321 | + </object> |
275 | 322 | </object> |
276 | 323 | <object class="NSMutableDictionary" key="actionInfosByName"> |
277 | | - <string key="NS.key.0">textFieldDidEnd:</string> |
278 | | - <object class="IBActionInfo" key="NS.object.0"> |
279 | | - <string key="name">textFieldDidEnd:</string> |
280 | | - <string key="candidateClassName">id</string> |
| 324 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 325 | + <object class="NSArray" key="dict.sortedKeys"> |
| 326 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 327 | + <string>doUpload:</string> |
| 328 | + <string>textFieldDidEnd:</string> |
281 | 329 | </object> |
| 330 | + <object class="NSMutableArray" key="dict.values"> |
| 331 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 332 | + <object class="IBActionInfo"> |
| 333 | + <string key="name">doUpload:</string> |
| 334 | + <string key="candidateClassName">id</string> |
| 335 | + </object> |
| 336 | + <object class="IBActionInfo"> |
| 337 | + <string key="name">textFieldDidEnd:</string> |
| 338 | + <string key="candidateClassName">id</string> |
| 339 | + </object> |
| 340 | + </object> |
282 | 341 | </object> |
283 | 342 | <object class="NSMutableDictionary" key="outlets"> |
284 | 343 | <bool key="EncodedWithXMLCoder">YES</bool> |
— | — | @@ -419,6 +478,14 @@ |
420 | 479 | </object> |
421 | 480 | </object> |
422 | 481 | <object class="IBPartialClassDescription"> |
| 482 | + <string key="className">UILabel</string> |
| 483 | + <string key="superclassName">UIView</string> |
| 484 | + <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
| 485 | + <string key="majorKey">IBFrameworkSource</string> |
| 486 | + <string key="minorKey">UIKit.framework/Headers/UILabel.h</string> |
| 487 | + </object> |
| 488 | + </object> |
| 489 | + <object class="IBPartialClassDescription"> |
423 | 490 | <string key="className">UIResponder</string> |
424 | 491 | <string key="superclassName">NSObject</string> |
425 | 492 | <reference key="sourceIdentifier" ref="240916425"/> |
Index: trunk/tools/Snap-to-Commons/Classes/PhotoPickerAppDelegate.h |
— | — | @@ -15,7 +15,6 @@ |
16 | 16 | @interface PhotoPickerAppDelegate : NSObject <UIApplicationDelegate> { |
17 | 17 | int defaultImageSource; |
18 | 18 | BOOL justInstalled; |
19 | | - BOOL launchedAsUrlHandler; |
20 | 19 | NSString *postContext; |
21 | 20 | UIWindow *window; |
22 | 21 | PhotoPickerViewController *viewController; |
— | — | @@ -28,7 +27,6 @@ |
29 | 28 | // the first time they run the app. |
30 | 29 | @property (nonatomic, assign) BOOL justInstalled; |
31 | 30 | |
32 | | -@property (nonatomic, assign) BOOL launchedAsUrlHandler; |
33 | 31 | @property (nonatomic, retain) NSString *postContext; |
34 | 32 | @property (nonatomic, retain) IBOutlet PhotoPickerViewController *viewController; |
35 | 33 | @property (nonatomic, retain) IBOutlet UINavigationController *navController; |
Index: trunk/tools/Snap-to-Commons/Classes/CommonsUpload.m |
— | — | @@ -20,14 +20,16 @@ |
21 | 21 | } |
22 | 22 | |
23 | 23 | - (NSString *)getUploadDescription { |
24 | | - NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; |
25 | | - [formatter setDateFormat:@"%Y-%m-%d"]; |
26 | | - NSString *date = [formatter stringFromDate:[NSDate date] ]; |
| 24 | + NSDate *today = [NSDate date]; |
| 25 | + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; |
| 26 | + [formatter setDateFormat:@"yyyy-MM-dd"]; |
| 27 | + NSString *dateString = [formatter stringFromDate:today]; |
| 28 | + NSLog(dateString); |
27 | 29 | |
28 | 30 | return [NSString stringWithFormat: @"{{Information\n|Description={{en|1=%@}}\n|Author=[[User:%@]]\n|Source={{own}}\n|Date=%@\n|Permission=\n|other_versions=\n}}\n\n== {{int:license}} ==\n%@\n\n[[Category:%@]]", |
29 | 31 | description, |
30 | 32 | [[NSUserDefaults standardUserDefaults] valueForKey: COMMONS_USERNAME_KEY], |
31 | | - date, |
| 33 | + dateString, |
32 | 34 | DEFAULT_LICENSE, |
33 | 35 | APPLICATION_CATEGORY, |
34 | 36 | nil |
— | — | @@ -35,9 +37,6 @@ |
36 | 38 | } |
37 | 39 | |
38 | 40 | - (void)uploadImage { |
39 | | -// uploadProgress.progress = 0.0f; |
40 | | -// uploadProgressMessage.text = @"uploading"; |
41 | | - |
42 | 41 | NSURL *url = [NSURL URLWithString:API_URL]; |
43 | 42 | ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; |
44 | 43 | [request setPostFormat:ASIURLEncodedPostFormat]; |
— | — | @@ -130,7 +129,7 @@ |
131 | 130 | [newRequest addPostValue:@"query" forKey:@"action"]; |
132 | 131 | [newRequest addPostValue:@"xml" forKey: @"format"]; |
133 | 132 | [newRequest addPostValue:@"edit" forKey:@"intoken"]; |
134 | | - [newRequest addPostValue:@"WikiSnaps.jpg" forKey:@"titles"]; |
| 133 | + [newRequest addPostValue:title forKey:@"titles"]; |
135 | 134 | [newRequest addPostValue:@"info" forKey:@"prop"]; |
136 | 135 | |
137 | 136 | [newRequest setDelegate:self]; |
— | — | @@ -174,10 +173,10 @@ |
175 | 174 | [newRequest addPostValue:@"upload" forKey:@"action"]; |
176 | 175 | [newRequest addPostValue:@"xml" forKey: @"format"]; |
177 | 176 | [newRequest addPostValue:editToken forKey:@"token"]; |
178 | | - [newRequest addPostValue:@"WikiSnaps.jpg" forKey:@"filename"]; |
179 | | - [newRequest addPostValue:@"TestComment" forKey:@"comment"]; |
180 | | - [newRequest addPostValue:@"TestText" forKey:@"text"]; |
181 | | - [newRequest addData:self.imageData forKey:@"file"]; |
| 177 | + [newRequest addPostValue:title forKey:@"filename"]; |
| 178 | + [newRequest addPostValue:[self getUploadDescription] forKey:@"comment"]; |
| 179 | + [newRequest addPostValue:[self getUploadDescription] forKey:@"text"]; |
| 180 | + [newRequest addData:imageData forKey:@"file"]; |
182 | 181 | |
183 | 182 | |
184 | 183 | [newRequest setDelegate:self]; |
— | — | @@ -200,6 +199,7 @@ |
201 | 200 | // Use when fetching text data |
202 | 201 | NSString *responseString = [request responseString]; |
203 | 202 | NSLog(responseString ); |
| 203 | + [delegate uploadSucceeded]; |
204 | 204 | } |
205 | 205 | |
206 | 206 | - (void)requestUploadFailed:(ASIHTTPRequest *)request |
Index: trunk/tools/Snap-to-Commons/Classes/PhotoPickerViewController.h |
— | — | @@ -13,13 +13,9 @@ |
14 | 14 | UIImagePickerControllerDelegate, |
15 | 15 | UINavigationControllerDelegate> { |
16 | 16 | BOOL cameraAvailable; |
17 | | - NSURLConnection *connection; |
18 | 17 | BOOL fakeCameraAvailable; |
19 | 18 | NSData *imageData; |
20 | 19 | UIActionSheet *photoSourceActionSheet; |
21 | | - NSHTTPURLResponse *response; |
22 | | - NSMutableData *responseData; |
23 | | - int retryCounter; |
24 | 20 | IBOutlet UIButton *takePhotoButton; |
25 | 21 | IBOutlet UIView *uploadPhotoOverlay; |
26 | 22 | IBOutlet UIImageView *uploadOverlayImage; |
— | — | @@ -29,8 +25,8 @@ |
30 | 26 | } |
31 | 27 | |
32 | 28 | - (IBAction)onCameraClicked; |
33 | | -- (IBAction)onCancelUploadClicked; |
34 | 29 | - (IBAction)onPhotoLibraryClicked; |
35 | | - |
| 30 | +- (IBAction)onSettingsClicked; |
| 31 | +- (IBAction)onCancelUploadClicked; |
36 | 32 | @end |
37 | 33 | |
Index: trunk/tools/Snap-to-Commons/Classes/ImageDetailsViewController.h |
— | — | @@ -7,17 +7,23 @@ |
8 | 8 | // |
9 | 9 | |
10 | 10 | #import <UIKit/UIKit.h> |
| 11 | +#import "CommonsUpload.h" |
11 | 12 | |
12 | 13 | |
13 | 14 | @interface ImageDetailsViewController : UIViewController <UINavigationControllerDelegate, |
14 | | - UITextFieldDelegate> { |
| 15 | + UITextFieldDelegate, |
| 16 | + UITextViewDelegate, |
| 17 | + CommonsUploadDelegate, |
| 18 | + UIAlertViewDelegate> { |
15 | 19 | IBOutlet UITextField *titleField; |
16 | 20 | IBOutlet UITextView *descriptionText; |
| 21 | + CommonsUpload *upload; |
17 | 22 | } |
18 | 23 | |
19 | 24 | @property (nonatomic, retain) UITextField *titleField; |
20 | 25 | @property (nonatomic, retain) UITextView *descriptionText; |
| 26 | +@property (nonatomic, retain) CommonsUpload *upload; |
21 | 27 | |
22 | | - |
23 | | --(IBAction)textFieldDidEnd:(id)sender; |
| 28 | +- (IBAction)textFieldDidEnd:(id)sender; |
| 29 | +- (void)doUpload:(id)sender; |
24 | 30 | @end |
Index: trunk/tools/Snap-to-Commons/Classes/PhotoPickerAppDelegate.m |
— | — | @@ -11,7 +11,6 @@ |
12 | 12 | |
13 | 13 | @interface PhotoPickerAppDelegate () |
14 | 14 | - (void)checkIfJustInstalled; |
15 | | - - (void)setupForUrl:(NSURL *)url; |
16 | 15 | @end |
17 | 16 | |
18 | 17 | |
— | — | @@ -19,7 +18,6 @@ |
20 | 19 | |
21 | 20 | @synthesize defaultImageSource; |
22 | 21 | @synthesize justInstalled; |
23 | | -@synthesize launchedAsUrlHandler; |
24 | 22 | @synthesize postContext; |
25 | 23 | @synthesize viewController; |
26 | 24 | @synthesize navController; |
— | — | @@ -28,16 +26,9 @@ |
29 | 27 | |
30 | 28 | - (BOOL)application:(UIApplication *)application |
31 | 29 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { |
32 | | - self.launchedAsUrlHandler = !!launchOptions; |
33 | 30 | |
34 | 31 | self.defaultImageSource = -1; |
35 | | - self.postContext = @""; |
36 | 32 | |
37 | | - /*if (launchOptions) { |
38 | | - NSURL *url = [launchOptions valueForKey:@"UIApplicationLaunchOptionsURLKey"]; |
39 | | - [self setupForUrl:url]; |
40 | | - }*/ |
41 | | - |
42 | 33 | [self checkIfJustInstalled]; |
43 | 34 | |
44 | 35 | [window addSubview:navController.view]; |
— | — | @@ -48,8 +39,8 @@ |
49 | 40 | |
50 | 41 | |
51 | 42 | - (void)dealloc { |
52 | | - self.postContext = nil; |
53 | 43 | self.viewController = nil; |
| 44 | + self.navController = nil; |
54 | 45 | self.window = nil; |
55 | 46 | |
56 | 47 | [super dealloc]; |
— | — | @@ -70,27 +61,4 @@ |
71 | 62 | } |
72 | 63 | |
73 | 64 | |
74 | | -- (void)setupForUrl:(NSURL *)url { |
75 | | - NSString *query = [url query]; |
76 | | - if ([query length]) { |
77 | | - NSArray *queryParts = [query componentsSeparatedByString:@"&"]; |
78 | | - for (NSString *queryPart in queryParts) { |
79 | | - NSArray *kvp = [queryPart componentsSeparatedByString:@"="]; |
80 | | - NSString *key = [kvp objectAtIndex:0]; |
81 | | - NSString *value = [kvp objectAtIndex:1]; |
82 | | - |
83 | | - if ([key isEqualToString:@"context"]) { |
84 | | - self.postContext = value; |
85 | | - } else if ([key isEqualToString:@"source"]) { |
86 | | - if ([value isEqualToString:@"camera"]) { |
87 | | - self.defaultImageSource = UIImagePickerControllerSourceTypeCamera; |
88 | | - } else if ([value isEqualToString:@"library"]) { |
89 | | - self.defaultImageSource = UIImagePickerControllerSourceTypePhotoLibrary; |
90 | | - } |
91 | | - } |
92 | | - } |
93 | | - } |
94 | | -} |
95 | | - |
96 | | - |
97 | 65 | @end |
Index: trunk/tools/Snap-to-Commons/PhotoPickerViewController.xib |
— | — | @@ -1,19 +1,17 @@ |
2 | 2 | <?xml version="1.0" encoding="UTF-8"?> |
3 | 3 | <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10"> |
4 | 4 | <data> |
5 | | - <int key="IBDocument.SystemTarget">768</int> |
6 | | - <string key="IBDocument.SystemVersion">10C540</string> |
7 | | - <string key="IBDocument.InterfaceBuilderVersion">740</string> |
8 | | - <string key="IBDocument.AppKitVersion">1038.25</string> |
9 | | - <string key="IBDocument.HIToolboxVersion">458.00</string> |
| 5 | + <int key="IBDocument.SystemTarget">1056</int> |
| 6 | + <string key="IBDocument.SystemVersion">10H574</string> |
| 7 | + <string key="IBDocument.InterfaceBuilderVersion">823</string> |
| 8 | + <string key="IBDocument.AppKitVersion">1038.35</string> |
| 9 | + <string key="IBDocument.HIToolboxVersion">461.00</string> |
10 | 10 | <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> |
11 | 11 | <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
12 | | - <string key="NS.object.0">62</string> |
| 12 | + <string key="NS.object.0">132</string> |
13 | 13 | </object> |
14 | 14 | <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> |
15 | 15 | <bool key="EncodedWithXMLCoder">YES</bool> |
16 | | - <integer value="6"/> |
17 | | - <integer value="13"/> |
18 | 16 | </object> |
19 | 17 | <object class="NSArray" key="IBDocument.PluginDependencies"> |
20 | 18 | <bool key="EncodedWithXMLCoder">YES</bool> |
— | — | @@ -32,15 +30,18 @@ |
33 | 31 | <bool key="EncodedWithXMLCoder">YES</bool> |
34 | 32 | <object class="IBProxyObject" id="372490531"> |
35 | 33 | <string key="IBProxiedObjectIdentifier">IBFilesOwner</string> |
| 34 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
36 | 35 | </object> |
37 | 36 | <object class="IBProxyObject" id="843779117"> |
38 | 37 | <string key="IBProxiedObjectIdentifier">IBFirstResponder</string> |
| 38 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
39 | 39 | </object> |
40 | 40 | <object class="IBUIView" id="774585933"> |
41 | 41 | <reference key="NSNextResponder"/> |
42 | 42 | <int key="NSvFlags">274</int> |
43 | 43 | <string key="NSFrameSize">{320, 460}</string> |
44 | 44 | <reference key="NSSuperview"/> |
| 45 | + <reference key="NSWindow"/> |
45 | 46 | <object class="NSColor" key="IBUIBackgroundColor"> |
46 | 47 | <int key="NSColorSpace">5</int> |
47 | 48 | <bytes key="NSCMYK">MCAwIDAgMAA</bytes> |
— | — | @@ -51,6 +52,7 @@ |
52 | 53 | </object> |
53 | 54 | <bool key="IBUIClearsContextBeforeDrawing">NO</bool> |
54 | 55 | <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/> |
| 56 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
55 | 57 | </object> |
56 | 58 | <object class="IBUIView" id="79809793"> |
57 | 59 | <reference key="NSNextResponder"/> |
— | — | @@ -62,14 +64,17 @@ |
63 | 65 | <int key="NSvFlags">290</int> |
64 | 66 | <string key="NSFrameSize">{320, 44}</string> |
65 | 67 | <reference key="NSSuperview" ref="79809793"/> |
| 68 | + <reference key="NSWindow"/> |
66 | 69 | <bool key="IBUIOpaque">NO</bool> |
67 | 70 | <bool key="IBUIClearsContextBeforeDrawing">NO</bool> |
| 71 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
68 | 72 | <int key="IBUIBarStyle">1</int> |
69 | 73 | <object class="NSArray" key="IBUIItems"> |
70 | 74 | <bool key="EncodedWithXMLCoder">YES</bool> |
71 | 75 | <object class="IBUINavigationItem" id="766765125"> |
72 | 76 | <reference key="IBUINavigationBar" ref="923235693"/> |
73 | 77 | <string key="IBUITitle"/> |
| 78 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
74 | 79 | </object> |
75 | 80 | </object> |
76 | 81 | </object> |
— | — | @@ -78,18 +83,22 @@ |
79 | 84 | <int key="NSvFlags">292</int> |
80 | 85 | <string key="NSFrame">{{20, 64}, {279, 310}}</string> |
81 | 86 | <reference key="NSSuperview" ref="79809793"/> |
| 87 | + <reference key="NSWindow"/> |
82 | 88 | <bool key="IBUIOpaque">NO</bool> |
83 | 89 | <bool key="IBUIClearsContextBeforeDrawing">NO</bool> |
84 | 90 | <int key="IBUIContentMode">1</int> |
85 | 91 | <bool key="IBUIUserInteractionEnabled">NO</bool> |
| 92 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
86 | 93 | </object> |
87 | 94 | <object class="IBUIButton" id="106179972"> |
88 | 95 | <reference key="NSNextResponder" ref="79809793"/> |
89 | 96 | <int key="NSvFlags">292</int> |
90 | 97 | <string key="NSFrame">{{21, 394}, {278, 46}}</string> |
91 | 98 | <reference key="NSSuperview" ref="79809793"/> |
| 99 | + <reference key="NSWindow"/> |
92 | 100 | <bool key="IBUIOpaque">NO</bool> |
93 | 101 | <bool key="IBUIClearsContextBeforeDrawing">NO</bool> |
| 102 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
94 | 103 | <int key="IBUIContentHorizontalAlignment">0</int> |
95 | 104 | <int key="IBUIContentVerticalAlignment">0</int> |
96 | 105 | <object class="NSFont" key="IBUIFont"> |
— | — | @@ -123,9 +132,11 @@ |
124 | 133 | <int key="NSvFlags">292</int> |
125 | 134 | <string key="NSFrame">{{78, 26}, {164, 11}}</string> |
126 | 135 | <reference key="NSSuperview" ref="79809793"/> |
| 136 | + <reference key="NSWindow"/> |
127 | 137 | <bool key="IBUIOpaque">NO</bool> |
128 | 138 | <bool key="IBUIClipsSubviews">YES</bool> |
129 | 139 | <bool key="IBUIMultipleTouchEnabled">YES</bool> |
| 140 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
130 | 141 | <float key="IBUIProgress">0.5</float> |
131 | 142 | <int key="IBUIProgressViewStyle">1</int> |
132 | 143 | </object> |
— | — | @@ -134,9 +145,11 @@ |
135 | 146 | <int key="NSvFlags">292</int> |
136 | 147 | <string key="NSFrameSize">{320, 23}</string> |
137 | 148 | <reference key="NSSuperview" ref="79809793"/> |
| 149 | + <reference key="NSWindow"/> |
138 | 150 | <bool key="IBUIOpaque">NO</bool> |
139 | 151 | <bool key="IBUIClipsSubviews">YES</bool> |
140 | 152 | <bool key="IBUIUserInteractionEnabled">NO</bool> |
| 153 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
141 | 154 | <string key="IBUIText">uploading</string> |
142 | 155 | <object class="NSFont" key="IBUIFont"> |
143 | 156 | <string key="NSName">Helvetica</string> |
— | — | @@ -164,11 +177,13 @@ |
165 | 178 | </object> |
166 | 179 | <string key="NSFrameSize">{320, 460}</string> |
167 | 180 | <reference key="NSSuperview"/> |
| 181 | + <reference key="NSWindow"/> |
168 | 182 | <object class="NSColor" key="IBUIBackgroundColor"> |
169 | 183 | <int key="NSColorSpace">3</int> |
170 | 184 | <bytes key="NSWhite">MC4xMzMwNjQ1MTYxAA</bytes> |
171 | 185 | </object> |
172 | 186 | <bool key="IBUIClearsContextBeforeDrawing">NO</bool> |
| 187 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
173 | 188 | </object> |
174 | 189 | </object> |
175 | 190 | <object class="IBObjectContainer" key="IBDocument.Objects"> |
— | — | @@ -331,7 +346,7 @@ |
332 | 347 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
333 | 348 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
334 | 349 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
335 | | - <string>{{150, 209}, {320, 480}}</string> |
| 350 | + <string>{{329, 209}, {320, 480}}</string> |
336 | 351 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
337 | 352 | </object> |
338 | 353 | </object> |
— | — | @@ -366,14 +381,45 @@ |
367 | 382 | <string>onCameraClicked</string> |
368 | 383 | <string>onCancelUploadClicked</string> |
369 | 384 | <string>onPhotoLibraryClicked</string> |
| 385 | + <string>onSettingsClicked</string> |
370 | 386 | </object> |
371 | 387 | <object class="NSMutableArray" key="dict.values"> |
372 | 388 | <bool key="EncodedWithXMLCoder">YES</bool> |
373 | 389 | <string>id</string> |
374 | 390 | <string>id</string> |
375 | 391 | <string>id</string> |
| 392 | + <string>id</string> |
376 | 393 | </object> |
377 | 394 | </object> |
| 395 | + <object class="NSMutableDictionary" key="actionInfosByName"> |
| 396 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 397 | + <object class="NSArray" key="dict.sortedKeys"> |
| 398 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 399 | + <string>onCameraClicked</string> |
| 400 | + <string>onCancelUploadClicked</string> |
| 401 | + <string>onPhotoLibraryClicked</string> |
| 402 | + <string>onSettingsClicked</string> |
| 403 | + </object> |
| 404 | + <object class="NSMutableArray" key="dict.values"> |
| 405 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 406 | + <object class="IBActionInfo"> |
| 407 | + <string key="name">onCameraClicked</string> |
| 408 | + <string key="candidateClassName">id</string> |
| 409 | + </object> |
| 410 | + <object class="IBActionInfo"> |
| 411 | + <string key="name">onCancelUploadClicked</string> |
| 412 | + <string key="candidateClassName">id</string> |
| 413 | + </object> |
| 414 | + <object class="IBActionInfo"> |
| 415 | + <string key="name">onPhotoLibraryClicked</string> |
| 416 | + <string key="candidateClassName">id</string> |
| 417 | + </object> |
| 418 | + <object class="IBActionInfo"> |
| 419 | + <string key="name">onSettingsClicked</string> |
| 420 | + <string key="candidateClassName">id</string> |
| 421 | + </object> |
| 422 | + </object> |
| 423 | + </object> |
378 | 424 | <object class="NSMutableDictionary" key="outlets"> |
379 | 425 | <bool key="EncodedWithXMLCoder">YES</bool> |
380 | 426 | <object class="NSArray" key="dict.sortedKeys"> |
— | — | @@ -393,6 +439,40 @@ |
394 | 440 | <string>UILabel</string> |
395 | 441 | </object> |
396 | 442 | </object> |
| 443 | + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> |
| 444 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 445 | + <object class="NSArray" key="dict.sortedKeys"> |
| 446 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 447 | + <string>takePhotoButton</string> |
| 448 | + <string>uploadOverlayImage</string> |
| 449 | + <string>uploadPhotoOverlay</string> |
| 450 | + <string>uploadProgress</string> |
| 451 | + <string>uploadProgressMessage</string> |
| 452 | + </object> |
| 453 | + <object class="NSMutableArray" key="dict.values"> |
| 454 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 455 | + <object class="IBToOneOutletInfo"> |
| 456 | + <string key="name">takePhotoButton</string> |
| 457 | + <string key="candidateClassName">UIButton</string> |
| 458 | + </object> |
| 459 | + <object class="IBToOneOutletInfo"> |
| 460 | + <string key="name">uploadOverlayImage</string> |
| 461 | + <string key="candidateClassName">UIImageView</string> |
| 462 | + </object> |
| 463 | + <object class="IBToOneOutletInfo"> |
| 464 | + <string key="name">uploadPhotoOverlay</string> |
| 465 | + <string key="candidateClassName">UIView</string> |
| 466 | + </object> |
| 467 | + <object class="IBToOneOutletInfo"> |
| 468 | + <string key="name">uploadProgress</string> |
| 469 | + <string key="candidateClassName">UIProgressView</string> |
| 470 | + </object> |
| 471 | + <object class="IBToOneOutletInfo"> |
| 472 | + <string key="name">uploadProgressMessage</string> |
| 473 | + <string key="candidateClassName">UILabel</string> |
| 474 | + </object> |
| 475 | + </object> |
| 476 | + </object> |
397 | 477 | <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
398 | 478 | <string key="majorKey">IBProjectSource</string> |
399 | 479 | <string key="minorKey">Classes/PhotoPickerViewController.h</string> |
— | — | @@ -440,13 +520,6 @@ |
441 | 521 | <string key="className">NSObject</string> |
442 | 522 | <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
443 | 523 | <string key="majorKey">IBFrameworkSource</string> |
444 | | - <string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string> |
445 | | - </object> |
446 | | - </object> |
447 | | - <object class="IBPartialClassDescription"> |
448 | | - <string key="className">NSObject</string> |
449 | | - <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
450 | | - <string key="majorKey">IBFrameworkSource</string> |
451 | 524 | <string key="minorKey">Foundation.framework/Headers/NSObject.h</string> |
452 | 525 | </object> |
453 | 526 | </object> |
— | — | @@ -454,13 +527,6 @@ |
455 | 528 | <string key="className">NSObject</string> |
456 | 529 | <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
457 | 530 | <string key="majorKey">IBFrameworkSource</string> |
458 | | - <string key="minorKey">Foundation.framework/Headers/NSPort.h</string> |
459 | | - </object> |
460 | | - </object> |
461 | | - <object class="IBPartialClassDescription"> |
462 | | - <string key="className">NSObject</string> |
463 | | - <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
464 | | - <string key="majorKey">IBFrameworkSource</string> |
465 | 531 | <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string> |
466 | 532 | </object> |
467 | 533 | </object> |
— | — | @@ -468,13 +534,6 @@ |
469 | 535 | <string key="className">NSObject</string> |
470 | 536 | <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
471 | 537 | <string key="majorKey">IBFrameworkSource</string> |
472 | | - <string key="minorKey">Foundation.framework/Headers/NSStream.h</string> |
473 | | - </object> |
474 | | - </object> |
475 | | - <object class="IBPartialClassDescription"> |
476 | | - <string key="className">NSObject</string> |
477 | | - <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
478 | | - <string key="majorKey">IBFrameworkSource</string> |
479 | 538 | <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> |
480 | 539 | </object> |
481 | 540 | </object> |
— | — | @@ -496,13 +555,6 @@ |
497 | 556 | <string key="className">NSObject</string> |
498 | 557 | <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
499 | 558 | <string key="majorKey">IBFrameworkSource</string> |
500 | | - <string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string> |
501 | | - </object> |
502 | | - </object> |
503 | | - <object class="IBPartialClassDescription"> |
504 | | - <string key="className">NSObject</string> |
505 | | - <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
506 | | - <string key="majorKey">IBFrameworkSource</string> |
507 | 559 | <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string> |
508 | 560 | </object> |
509 | 561 | </object> |
— | — | @@ -614,6 +666,13 @@ |
615 | 667 | <string key="className">UIView</string> |
616 | 668 | <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
617 | 669 | <string key="majorKey">IBFrameworkSource</string> |
| 670 | + <string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string> |
| 671 | + </object> |
| 672 | + </object> |
| 673 | + <object class="IBPartialClassDescription"> |
| 674 | + <string key="className">UIView</string> |
| 675 | + <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
| 676 | + <string key="majorKey">IBFrameworkSource</string> |
618 | 677 | <string key="minorKey">UIKit.framework/Headers/UITextField.h</string> |
619 | 678 | </object> |
620 | 679 | </object> |
— | — | @@ -636,6 +695,20 @@ |
637 | 696 | <string key="className">UIViewController</string> |
638 | 697 | <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
639 | 698 | <string key="majorKey">IBFrameworkSource</string> |
| 699 | + <string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string> |
| 700 | + </object> |
| 701 | + </object> |
| 702 | + <object class="IBPartialClassDescription"> |
| 703 | + <string key="className">UIViewController</string> |
| 704 | + <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
| 705 | + <string key="majorKey">IBFrameworkSource</string> |
| 706 | + <string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string> |
| 707 | + </object> |
| 708 | + </object> |
| 709 | + <object class="IBPartialClassDescription"> |
| 710 | + <string key="className">UIViewController</string> |
| 711 | + <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
| 712 | + <string key="majorKey">IBFrameworkSource</string> |
640 | 713 | <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string> |
641 | 714 | </object> |
642 | 715 | </object> |
— | — | @@ -650,9 +723,10 @@ |
651 | 724 | </object> |
652 | 725 | </object> |
653 | 726 | <int key="IBDocument.localizationMode">0</int> |
| 727 | + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> |
654 | 728 | <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> |
655 | 729 | <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string> |
656 | | - <integer value="768" key="NS.object.0"/> |
| 730 | + <integer value="1056" key="NS.object.0"/> |
657 | 731 | </object> |
658 | 732 | <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> |
659 | 733 | <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string> |
— | — | @@ -661,6 +735,19 @@ |
662 | 736 | <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> |
663 | 737 | <string key="IBDocument.LastKnownRelativeProjectPath">photopicker.xcodeproj</string> |
664 | 738 | <int key="IBDocument.defaultPropertyAccessControl">3</int> |
665 | | - <string key="IBCocoaTouchPluginVersion">3.1</string> |
| 739 | + <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> |
| 740 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 741 | + <object class="NSArray" key="dict.sortedKeys"> |
| 742 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 743 | + <string>cancel-button-pressed.png</string> |
| 744 | + <string>cancel-button.png</string> |
| 745 | + </object> |
| 746 | + <object class="NSMutableArray" key="dict.values"> |
| 747 | + <bool key="EncodedWithXMLCoder">YES</bool> |
| 748 | + <string>{278, 46}</string> |
| 749 | + <string>{278, 46}</string> |
| 750 | + </object> |
| 751 | + </object> |
| 752 | + <string key="IBCocoaTouchPluginVersion">132</string> |
666 | 753 | </data> |
667 | 754 | </archive> |