r84824 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84823‎ | r84824 | r84825 >
Date:00:01, 27 March 2011
Author:hartman
Status:deferred
Tags:
Comment:
WikiSnaps: Add a license selector. Includes descriptions of the licenses. :D
Modified paths:
  • /trunk/tools/WikiSnaps/Classes/CommonsUpload.m (modified) (history)
  • /trunk/tools/WikiSnaps/Classes/LicensePickerViewController.h (added) (history)
  • /trunk/tools/WikiSnaps/Classes/LicensePickerViewController.m (added) (history)
  • /trunk/tools/WikiSnaps/Classes/LicensePickerViewController.xib (added) (history)
  • /trunk/tools/WikiSnaps/Classes/PhotoPickerAppDelegate.h (modified) (history)
  • /trunk/tools/WikiSnaps/Classes/PhotoPickerAppDelegate.m (modified) (history)
  • /trunk/tools/WikiSnaps/Classes/SettingsViewController.h (modified) (history)
  • /trunk/tools/WikiSnaps/Classes/SettingsViewController.m (modified) (history)
  • /trunk/tools/WikiSnaps/Classes/SourcePickerViewController.h (modified) (history)
  • /trunk/tools/WikiSnaps/Licenses.plist (added) (history)
  • /trunk/tools/WikiSnaps/SettingsViewController.xib (modified) (history)
  • /trunk/tools/WikiSnaps/WikiSnaps.xcodeproj/project.pbxproj (modified) (history)

Diff [purge]

Index: trunk/tools/WikiSnaps/SettingsViewController.xib
@@ -12,8 +12,7 @@
1313 </object>
1414 <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
1515 <bool key="EncodedWithXMLCoder">YES</bool>
16 - <integer value="23"/>
17 - <integer value="31"/>
 16+ <integer value="1"/>
1817 </object>
1918 <object class="NSArray" key="IBDocument.PluginDependencies">
2019 <bool key="EncodedWithXMLCoder">YES</bool>
@@ -247,46 +246,6 @@
248247 </object>
249248 <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
250249 </object>
251 - <object class="IBUIView" id="75492359">
252 - <reference key="NSNextResponder"/>
253 - <int key="NSvFlags">292</int>
254 - <object class="NSMutableArray" key="NSSubviews">
255 - <bool key="EncodedWithXMLCoder">YES</bool>
256 - <object class="IBUINavigationBar" id="697282909">
257 - <reference key="NSNextResponder" ref="75492359"/>
258 - <int key="NSvFlags">288</int>
259 - <string key="NSFrameSize">{320, 44}</string>
260 - <reference key="NSSuperview" ref="75492359"/>
261 - <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
262 - <object class="NSArray" key="IBUIItems">
263 - <bool key="EncodedWithXMLCoder">YES</bool>
264 - <object class="IBUINavigationItem" id="840534712">
265 - <reference key="IBUINavigationBar" ref="697282909"/>
266 - <string key="IBUITitle">Title</string>
267 - <object class="IBUIBarButtonItem" key="IBUIRightBarButtonItem" id="345818059">
268 - <string key="IBUITitle">Item</string>
269 - <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
270 - <int key="IBUIStyle">1</int>
271 - <reference key="IBUINavigationItem" ref="840534712"/>
272 - </object>
273 - <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
274 - </object>
275 - </object>
276 - </object>
277 - <object class="IBUIPickerView" id="871605169">
278 - <reference key="NSNextResponder" ref="75492359"/>
279 - <int key="NSvFlags">288</int>
280 - <string key="NSFrame">{{0, 44}, {320, 216}}</string>
281 - <reference key="NSSuperview" ref="75492359"/>
282 - <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
283 - <bool key="IBUIShowsSelectionIndicator">YES</bool>
284 - </object>
285 - </object>
286 - <string key="NSFrameSize">{320, 258}</string>
287 - <reference key="NSSuperview"/>
288 - <reference key="IBUIBackgroundColor" ref="685033555"/>
289 - <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
290 - </object>
291250 </object>
292251 <object class="IBObjectContainer" key="IBDocument.Objects">
293252 <object class="NSMutableArray" key="connectionRecords">
@@ -376,14 +335,6 @@
377336 </object>
378337 <object class="IBConnectionRecord">
379338 <object class="IBCocoaTouchOutletConnection" key="connection">
380 - <string key="label">licenseLabel</string>
381 - <reference key="source" ref="372490531"/>
382 - <reference key="destination" ref="180329537"/>
383 - </object>
384 - <int key="connectionID">27</int>
385 - </object>
386 - <object class="IBConnectionRecord">
387 - <object class="IBCocoaTouchOutletConnection" key="connection">
388339 <string key="label">license</string>
389340 <reference key="source" ref="372490531"/>
390341 <reference key="destination" ref="261756187"/>
@@ -408,52 +359,12 @@
409360 </object>
410361 <object class="IBConnectionRecord">
411362 <object class="IBCocoaTouchOutletConnection" key="connection">
412 - <string key="label">delegate</string>
413 - <reference key="source" ref="871605169"/>
414 - <reference key="destination" ref="372490531"/>
415 - </object>
416 - <int key="connectionID">35</int>
417 - </object>
418 - <object class="IBConnectionRecord">
419 - <object class="IBCocoaTouchOutletConnection" key="connection">
420 - <string key="label">dataSource</string>
421 - <reference key="source" ref="871605169"/>
422 - <reference key="destination" ref="372490531"/>
423 - </object>
424 - <int key="connectionID">36</int>
425 - </object>
426 - <object class="IBConnectionRecord">
427 - <object class="IBCocoaTouchOutletConnection" key="connection">
428 - <string key="label">navItem</string>
 363+ <string key="label">licenseLabel</string>
429364 <reference key="source" ref="372490531"/>
430 - <reference key="destination" ref="840534712"/>
 365+ <reference key="destination" ref="180329537"/>
431366 </object>
432 - <int key="connectionID">38</int>
 367+ <int key="connectionID">51</int>
433368 </object>
434 - <object class="IBConnectionRecord">
435 - <object class="IBCocoaTouchOutletConnection" key="connection">
436 - <string key="label">pickerControl</string>
437 - <reference key="source" ref="372490531"/>
438 - <reference key="destination" ref="871605169"/>
439 - </object>
440 - <int key="connectionID">40</int>
441 - </object>
442 - <object class="IBConnectionRecord">
443 - <object class="IBCocoaTouchOutletConnection" key="connection">
444 - <string key="label">pickerView</string>
445 - <reference key="source" ref="372490531"/>
446 - <reference key="destination" ref="75492359"/>
447 - </object>
448 - <int key="connectionID">41</int>
449 - </object>
450 - <object class="IBConnectionRecord">
451 - <object class="IBCocoaTouchOutletConnection" key="connection">
452 - <string key="label">dismissButton</string>
453 - <reference key="source" ref="372490531"/>
454 - <reference key="destination" ref="345818059"/>
455 - </object>
456 - <int key="connectionID">42</int>
457 - </object>
458369 </object>
459370 <object class="IBMutableOrderedSet" key="objectRecords">
460371 <object class="NSArray" key="orderedObjects">
@@ -525,45 +436,6 @@
526437 <reference key="object" ref="476251156"/>
527438 <reference key="parent" ref="191373211"/>
528439 </object>
529 - <object class="IBObjectRecord">
530 - <int key="objectID">31</int>
531 - <reference key="object" ref="75492359"/>
532 - <object class="NSMutableArray" key="children">
533 - <bool key="EncodedWithXMLCoder">YES</bool>
534 - <reference ref="697282909"/>
535 - <reference ref="871605169"/>
536 - </object>
537 - <reference key="parent" ref="0"/>
538 - <string key="objectName">pickerview</string>
539 - </object>
540 - <object class="IBObjectRecord">
541 - <int key="objectID">32</int>
542 - <reference key="object" ref="697282909"/>
543 - <object class="NSMutableArray" key="children">
544 - <bool key="EncodedWithXMLCoder">YES</bool>
545 - <reference ref="840534712"/>
546 - </object>
547 - <reference key="parent" ref="75492359"/>
548 - </object>
549 - <object class="IBObjectRecord">
550 - <int key="objectID">33</int>
551 - <reference key="object" ref="840534712"/>
552 - <object class="NSMutableArray" key="children">
553 - <bool key="EncodedWithXMLCoder">YES</bool>
554 - <reference ref="345818059"/>
555 - </object>
556 - <reference key="parent" ref="697282909"/>
557 - </object>
558 - <object class="IBObjectRecord">
559 - <int key="objectID">34</int>
560 - <reference key="object" ref="871605169"/>
561 - <reference key="parent" ref="75492359"/>
562 - </object>
563 - <object class="IBObjectRecord">
564 - <int key="objectID">37</int>
565 - <reference key="object" ref="345818059"/>
566 - <reference key="parent" ref="840534712"/>
567 - </object>
568440 </object>
569441 </object>
570442 <object class="NSMutableDictionary" key="flattenedProperties">
@@ -582,13 +454,6 @@
583455 <string>24.IBViewBoundsToFrameTransform</string>
584456 <string>25.IBPluginDependency</string>
585457 <string>25.IBViewBoundsToFrameTransform</string>
586 - <string>31.IBEditorWindowLastContentRect</string>
587 - <string>31.IBPluginDependency</string>
588 - <string>32.IBPluginDependency</string>
589 - <string>32.IBViewBoundsToFrameTransform</string>
590 - <string>33.IBPluginDependency</string>
591 - <string>34.IBPluginDependency</string>
592 - <string>37.IBPluginDependency</string>
593458 <string>5.IBPluginDependency</string>
594459 <string>5.IBViewBoundsToFrameTransform</string>
595460 <string>6.IBPluginDependency</string>
@@ -618,17 +483,8 @@
619484 <object class="NSAffineTransform">
620485 <bytes key="NSTransformStruct">AUGgAABDHQAAA</bytes>
621486 </object>
622 - <string>{{190, 299}, {320, 258}}</string>
623487 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
624 - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
625488 <object class="NSAffineTransform">
626 - <bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAwigAAA</bytes>
627 - </object>
628 - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
629 - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
630 - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
631 - <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
632 - <object class="NSAffineTransform">
633489 <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwtIAAA</bytes>
634490 </object>
635491 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -657,7 +513,7 @@
658514 </object>
659515 </object>
660516 <nil key="sourceID"/>
661 - <int key="maxID">46</int>
 517+ <int key="maxID">58</int>
662518 </object>
663519 <object class="IBClassDescriber" key="IBDocument.Classes">
664520 <object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -715,6 +571,7 @@
716572 <bool key="EncodedWithXMLCoder">YES</bool>
717573 <object class="NSArray" key="dict.sortedKeys">
718574 <bool key="EncodedWithXMLCoder">YES</bool>
 575+ <string>descriptionText</string>
719576 <string>dismissButton</string>
720577 <string>license</string>
721578 <string>licenseLabel</string>
@@ -722,6 +579,7 @@
723580 <string>password</string>
724581 <string>passwordLabel</string>
725582 <string>pickerControl</string>
 583+ <string>pickerLabel</string>
726584 <string>pickerView</string>
727585 <string>save</string>
728586 <string>username</string>
@@ -729,6 +587,7 @@
730588 </object>
731589 <object class="NSMutableArray" key="dict.values">
732590 <bool key="EncodedWithXMLCoder">YES</bool>
 591+ <string>UIWebView</string>
733592 <string>UIBarButtonItem</string>
734593 <string>UITextField</string>
735594 <string>UILabel</string>
@@ -736,6 +595,7 @@
737596 <string>UITextField</string>
738597 <string>UILabel</string>
739598 <string>UIPickerView</string>
 599+ <string>UILabel</string>
740600 <string>UIView</string>
741601 <string>UIButton</string>
742602 <string>UITextField</string>
@@ -746,6 +606,7 @@
747607 <bool key="EncodedWithXMLCoder">YES</bool>
748608 <object class="NSArray" key="dict.sortedKeys">
749609 <bool key="EncodedWithXMLCoder">YES</bool>
 610+ <string>descriptionText</string>
750611 <string>dismissButton</string>
751612 <string>license</string>
752613 <string>licenseLabel</string>
@@ -753,6 +614,7 @@
754615 <string>password</string>
755616 <string>passwordLabel</string>
756617 <string>pickerControl</string>
 618+ <string>pickerLabel</string>
757619 <string>pickerView</string>
758620 <string>save</string>
759621 <string>username</string>
@@ -761,6 +623,10 @@
762624 <object class="NSMutableArray" key="dict.values">
763625 <bool key="EncodedWithXMLCoder">YES</bool>
764626 <object class="IBToOneOutletInfo">
 627+ <string key="name">descriptionText</string>
 628+ <string key="candidateClassName">UIWebView</string>
 629+ </object>
 630+ <object class="IBToOneOutletInfo">
765631 <string key="name">dismissButton</string>
766632 <string key="candidateClassName">UIBarButtonItem</string>
767633 </object>
@@ -789,6 +655,10 @@
790656 <string key="candidateClassName">UIPickerView</string>
791657 </object>
792658 <object class="IBToOneOutletInfo">
 659+ <string key="name">pickerLabel</string>
 660+ <string key="candidateClassName">UILabel</string>
 661+ </object>
 662+ <object class="IBToOneOutletInfo">
793663 <string key="name">pickerView</string>
794664 <string key="candidateClassName">UIView</string>
795665 </object>
@@ -946,19 +816,14 @@
947817 </object>
948818 </object>
949819 <object class="IBPartialClassDescription">
950 - <string key="className">UINavigationBar</string>
951 - <string key="superclassName">UIView</string>
952 - <object class="IBClassDescriptionSource" key="sourceIdentifier" id="525548119">
 820+ <string key="className">UINavigationItem</string>
 821+ <string key="superclassName">NSObject</string>
 822+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
953823 <string key="majorKey">IBFrameworkSource</string>
954824 <string key="minorKey">UIKit.framework/Headers/UINavigationBar.h</string>
955825 </object>
956826 </object>
957827 <object class="IBPartialClassDescription">
958 - <string key="className">UINavigationItem</string>
959 - <string key="superclassName">NSObject</string>
960 - <reference key="sourceIdentifier" ref="525548119"/>
961 - </object>
962 - <object class="IBPartialClassDescription">
963828 <string key="className">UIPickerView</string>
964829 <string key="superclassName">UIView</string>
965830 <object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -1050,6 +915,14 @@
1051916 <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
1052917 </object>
1053918 </object>
 919+ <object class="IBPartialClassDescription">
 920+ <string key="className">UIWebView</string>
 921+ <string key="superclassName">UIView</string>
 922+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 923+ <string key="majorKey">IBFrameworkSource</string>
 924+ <string key="minorKey">UIKit.framework/Headers/UIWebView.h</string>
 925+ </object>
 926+ </object>
1054927 </object>
1055928 </object>
1056929 <int key="IBDocument.localizationMode">0</int>
Index: trunk/tools/WikiSnaps/Classes/SourcePickerViewController.h
@@ -17,6 +17,8 @@
1818 BOOL cameraAvailable;
1919 BOOL fakeCameraAvailable;
2020 NSData *imageData;
 21+
 22+ NSArray *licenses;
2123 }
2224
2325 - (IBAction)settingsPressed:(id)sender;
Index: trunk/tools/WikiSnaps/Classes/SettingsViewController.h
@@ -9,9 +9,11 @@
1010
1111 #import <UIKit/UIKit.h>
1212 #import "Configuration.h"
 13+#import "LicensePickerViewController.h"
1314
1415 @interface SettingsViewController : UIViewController <UINavigationControllerDelegate,
15 - UITextFieldDelegate>{
 16+ UITextFieldDelegate,
 17+ LicensePickerDelegate>{
1618
1719 IBOutlet UILabel *usernameLabel;
1820 IBOutlet UILabel *passwordLabel;
@@ -20,13 +22,8 @@
2123 IBOutlet UITextField *username;
2224 IBOutlet UITextField *password;
2325 IBOutlet UITextField *license;
24 - IBOutlet UIButton *save;
25 -
26 - IBOutlet UIView *pickerView;
27 - IBOutlet UIBarButtonItem *dismissButton;
28 - IBOutlet UINavigationItem *navItem;
29 - IBOutlet UIPickerView *pickerControl;
30 -
 26+ IBOutlet UIButton *save;
 27+ int selectedLicense;
3128 }
3229
3330 @property (retain, nonatomic) UILabel *usernameLabel;
@@ -38,13 +35,15 @@
3936 @property (retain, nonatomic) UITextField *license;
4037 @property (retain, nonatomic) UIButton *save;
4138
 39+@property (retain, nonatomic) NSArray *licenses;
 40+@property (nonatomic) int selectedLicense;
 41+
 42+-(void)loadData;
 43+-(void)saveData;
 44+
4245 -(IBAction)textFieldDidEnd:(id)sender;
4346 -(IBAction)pickLicensePicker:(id)sender;
44 --(IBAction)dismissLicensePicker:(id)sender;
4547
4648 -(IBAction)saveAction:(id)sender;
4749
48 -- (void)popupView: (UIView*) popupView;
49 -- (void)popdownView: (UIView*) popupView;
50 -
5150 @end
Index: trunk/tools/WikiSnaps/Classes/SettingsViewController.m
@@ -10,13 +10,15 @@
1111 #import "SettingsViewController.h"
1212 #import "ASIFormDataRequest.h"
1313 #import "SFHFKeychainUtils.h"
 14+#import "PhotoPickerAppDelegate.h"
1415
15 -
1616 @implementation SettingsViewController
1717
1818 @synthesize usernameLabel, passwordLabel, licenseLabel;
1919 @synthesize username,password,license;
2020 @synthesize save;
 21+@synthesize licenses;
 22+@synthesize selectedLicense;
2123
2224 // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
2325 /*
@@ -38,14 +40,14 @@
3941 usernameLabel.text = NSLocalizedString( @"Password", @"Label of the password textfield" );
4042 usernameLabel.text = NSLocalizedString( @"License", @"Label of the license textfield" );
4143
42 - username.text = [[NSUserDefaults standardUserDefaults] valueForKey: COMMONS_USERNAME_KEY];
43 - license.text = [[NSUserDefaults standardUserDefaults] valueForKey: COMMONS_LICENSE_KEY];
 44+ PhotoPickerAppDelegate *appDelegate =
 45+ (PhotoPickerAppDelegate *) [UIApplication sharedApplication].delegate;
 46+
 47+ licenses = appDelegate.licenses;
 48+ selectedLicense = 0;
 49+
 50+ [self loadData];
4451
45 - NSError *error = nil;
46 - password.text = [SFHFKeychainUtils getPasswordForUsername:username.text andServiceName:COMMONS_KEYCHAIN_KEY error: &error];
47 - if( error ) {
48 - NSLog( @"pasword storage problem: %@", [error localizedDescription] );
49 - }
5052 }
5153
5254 /*
@@ -53,38 +55,18 @@
5456 [super viewWillAppear:animated];
5557 }
5658 */
 59+
5760 /*
5861 - (void)viewDidAppear:(BOOL)animated {
5962 [super viewDidAppear:animated];
6063 }
6164 */
6265
 66+/*
6367 - (void)viewWillDisappear:(BOOL)animated {
6468 [super viewWillDisappear:animated];
65 -
66 - NSError *error = nil;
67 - NSString *oldUsername = [[NSUserDefaults standardUserDefaults] valueForKey: COMMONS_USERNAME_KEY];
68 - if( [username.text compare:oldUsername] != NSOrderedSame ) {
69 - /* Delete password for previous username */
70 - [SFHFKeychainUtils deleteItemForUsername:oldUsername andServiceName:COMMONS_KEYCHAIN_KEY error:&error];
71 - if( error ) {
72 - NSLog( @"pasword deletion problem: %@", [error localizedDescription] );
73 - error = nil;
74 - }
75 - }
76 -
77 - /* Save the data */
78 - [[NSUserDefaults standardUserDefaults] setObject:username.text forKey:COMMONS_USERNAME_KEY];
79 - [[NSUserDefaults standardUserDefaults] setObject:license.text forKey:COMMONS_LICENSE_KEY];
80 -
81 - /* Store the password in the keychain */
82 - [SFHFKeychainUtils storeUsername: username.text andPassword: password.text forServiceName:COMMONS_KEYCHAIN_KEY updateExisting: YES error: &error];
83 -
84 - if( error ) {
85 - NSLog( @"pasword storage problem: %@", [error localizedDescription] );
86 - }
87 - [[NSUserDefaults standardUserDefaults] synchronize];
8869 }
 70+*/
8971
9072 /*
9173 - (void)viewDidDisappear:(BOOL)animated {
@@ -117,10 +99,65 @@
118100 - (void)dealloc {
119101 [username release];
120102 [password release];
 103+ [license release];
121104 [save release];
122105 [super dealloc];
123106 }
124107
 108+#pragma mark Data loading and saving
 109+
 110+- (void)loadData {
 111+ username.text = [[NSUserDefaults standardUserDefaults] valueForKey: COMMONS_USERNAME_KEY];
 112+
 113+ NSString *licenseDefault = [[NSUserDefaults standardUserDefaults] stringForKey: COMMONS_LICENSE_KEY];
 114+ NSEnumerator *enumerator = [licenses objectEnumerator];
 115+ NSDictionary *aLicense;
 116+ while( licenseDefault != nil && (aLicense = [enumerator nextObject]) ) {
 117+ if( [licenseDefault compare: [aLicense objectForKey:@"short"]] == NSOrderedSame ) {
 118+ license.text = [aLicense objectForKey:@"name"];
 119+ break;
 120+ }
 121+ selectedLicense++;
 122+ }
 123+ if( selectedLicense == [licenses count] )
 124+ selectedLicense = 0;
 125+
 126+ NSError *error = nil;
 127+ password.text = [SFHFKeychainUtils getPasswordForUsername:username.text andServiceName:COMMONS_KEYCHAIN_KEY error: &error];
 128+ if( error ) {
 129+ NSLog( @"pasword storage problem: %@", [error localizedDescription] );
 130+ }
 131+}
 132+
 133+- (void)saveData {
 134+ NSError *error = nil;
 135+ NSString *oldUsername = [[NSUserDefaults standardUserDefaults] valueForKey: COMMONS_USERNAME_KEY];
 136+ if( [username.text compare:oldUsername] != NSOrderedSame ) {
 137+ /* Delete password for previous username */
 138+ [SFHFKeychainUtils deleteItemForUsername:oldUsername andServiceName:COMMONS_KEYCHAIN_KEY error:&error];
 139+ if( error ) {
 140+ NSLog( @"pasword deletion problem: %@", [error localizedDescription] );
 141+ error = nil;
 142+ }
 143+ }
 144+
 145+ /* Save the data */
 146+ [[NSUserDefaults standardUserDefaults] setObject:username.text forKey:COMMONS_USERNAME_KEY];
 147+
 148+ NSDictionary *aLicense = [licenses objectAtIndex:selectedLicense];
 149+ [[NSUserDefaults standardUserDefaults] setObject:[aLicense objectForKey:@"short"] forKey:COMMONS_LICENSE_KEY];
 150+
 151+ /* Store the password in the keychain */
 152+ [SFHFKeychainUtils storeUsername: username.text andPassword: password.text forServiceName:COMMONS_KEYCHAIN_KEY updateExisting: YES error: &error];
 153+
 154+ if( error ) {
 155+ NSLog( @"pasword storage problem: %@", [error localizedDescription] );
 156+ }
 157+ [[NSUserDefaults standardUserDefaults] synchronize];
 158+}
 159+
 160+#pragma mark UITextField Delegate
 161+
125162 - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
126163 // Show UIPickerView
127164 if( textField == license ) {
@@ -134,111 +171,34 @@
135172 if(sender == username ) {
136173 [password becomeFirstResponder];
137174 return;
138 - } else if (sender == license) {
139 - [self dismissLicensePicker:sender];
140175 }
141176 [sender resignFirstResponder];
142177 }
143178
 179+#pragma mark Actions
 180+
144181 - (IBAction)saveAction:(id)sender {
 182+ [self saveData];
145183 /* Return to Primary view */
146184 [self.navigationController popViewControllerAnimated:YES];
147185 }
148186
149187 - (IBAction) pickLicensePicker:(id)sender{
150 - navItem.title = NSLocalizedString( @"License", @"Title for the license picker" );
151 - dismissButton.title = NSLocalizedString( @"Select", "Title for the select button in license picker" );
152 - dismissButton.target = self;
153 - dismissButton.action = @selector( dismissLicensePicker: );
154 -
155 - /* Select the row that is selected by default atm */
156 - //[pickerControl selectRow: 0 inComponent: 0 animated: NO];
157 -
158 - // Slide picker view in
159 - [self popupView: pickerView];
160 -
 188+ LicensePickerViewController *picker = [[LicensePickerViewController alloc] initWithNibName:@"LicensePickerViewController" bundle:nil];
 189+ picker.delegate = self;
 190+ picker.licenses = licenses;
 191+ picker.selectedLicense = selectedLicense;
 192+ [self presentModalViewController:picker animated:YES];
 193+ [picker release];
161194 }
162195
 196+#pragma mark LicensePicker Delegate
163197
164 -- (IBAction) dismissLicensePicker: (id) sender
165 -{
166 - // Get the data we need
167 - [self popdownView: pickerView];
 198+-(void)licensePickerDidFinish:(int)theSelectedLicense {
 199+ NSDictionary *licenseDict = [licenses objectAtIndex:theSelectedLicense];
 200+ license.text = [licenseDict objectForKey:@"name"];
 201+ selectedLicense = theSelectedLicense;
 202+ [self dismissModalViewControllerAnimated:YES];
168203 }
169204
170 -
171 -#pragma mark Helper functions to pop up a view
172 -- (void)popupView: (UIView *)popupView
173 -{
174 - CGRect settingsFrame = self.view.frame;
175 -
176 - // Move view under the screen
177 - popupView.frame = CGRectMake(popupView.frame.origin.x,
178 - settingsFrame.size.height,
179 - popupView.frame.size.width,
180 - popupView.frame.size.height);
181 - // Add view as subview
182 - [self.view addSubview: popupView];
183 -
184 - // Animate view slide (as keyboard shows)
185 -
186 - [UIView beginAnimations: @"addPopupView" context: popupView];
187 -
188 - [UIView setAnimationDuration: 0.3];
189 - [UIView setAnimationDelegate: self];
190 - [UIView setAnimationDidStopSelector: @selector(animationDidStop: finished: context:)];
191 -
192 - popupView.frame = CGRectMake(popupView.frame.origin.x,
193 - settingsFrame.size.height - popupView.frame.size.height,
194 - popupView.frame.size.width,
195 - popupView.frame.size.height);
196 -
197 - [UIView commitAnimations];
198 -}
199 -
200 -
201 -- (void)popdownView: (UIView *)popupView
202 -{
203 - [UIView beginAnimations: @"removePopupView" context: popupView];
204 -
205 - [UIView setAnimationDuration: 0.3];
206 - [UIView setAnimationDelegate: self];
207 - [UIView setAnimationDidStopSelector: @selector(animationDidStop: finished: context:)];
208 -
209 - popupView.frame = CGRectMake(popupView.frame.origin.x,
210 - popupView.frame.origin.y + popupView.frame.size.height,
211 - popupView.frame.size.width,
212 - popupView.frame.size.height);
213 -
214 - [UIView commitAnimations];
215 -}
216 -
217 -
218 -#pragma mark UIPickerViewDelegate
219 -
220 -- (NSString*)pickerView: (UIPickerView *)pickerView
221 - titleForRow: (NSInteger)row
222 - forComponent: (NSInteger)component
223 -{
224 - return [NSString stringWithFormat: @"TEST %d" ];
225 - return @"";
226 -}
227 -
228 -
229 -
230 -#pragma mark UIPickerViewDataSource
231 -
232 -- (NSInteger)numberOfComponentsInPickerView: (UIPickerView *)pickerView
233 -{
234 - return 1;
235 -}
236 -
237 -
238 -- (NSInteger)pickerView: (UIPickerView *)pickerView numberOfRowsInComponent: (NSInteger)component
239 -{
240 - NSInteger numberOfRows = 1;
241 -
242 - return numberOfRows;
243 -}
244 -
245205 @end
Index: trunk/tools/WikiSnaps/Classes/LicensePickerViewController.xib
@@ -0,0 +1,654 @@
 2+<?xml version="1.0" encoding="UTF-8"?>
 3+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
 4+ <data>
 5+ <int key="IBDocument.SystemTarget">1056</int>
 6+ <string key="IBDocument.SystemVersion">10J567</string>
 7+ <string key="IBDocument.InterfaceBuilderVersion">823</string>
 8+ <string key="IBDocument.AppKitVersion">1038.35</string>
 9+ <string key="IBDocument.HIToolboxVersion">462.00</string>
 10+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
 11+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 12+ <string key="NS.object.0">132</string>
 13+ </object>
 14+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 15+ <bool key="EncodedWithXMLCoder">YES</bool>
 16+ <integer value="9"/>
 17+ </object>
 18+ <object class="NSArray" key="IBDocument.PluginDependencies">
 19+ <bool key="EncodedWithXMLCoder">YES</bool>
 20+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 21+ </object>
 22+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
 23+ <bool key="EncodedWithXMLCoder">YES</bool>
 24+ <object class="NSArray" key="dict.sortedKeys" id="0">
 25+ <bool key="EncodedWithXMLCoder">YES</bool>
 26+ </object>
 27+ <object class="NSMutableArray" key="dict.values">
 28+ <bool key="EncodedWithXMLCoder">YES</bool>
 29+ </object>
 30+ </object>
 31+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
 32+ <bool key="EncodedWithXMLCoder">YES</bool>
 33+ <object class="IBProxyObject" id="372490531">
 34+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
 35+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
 36+ </object>
 37+ <object class="IBProxyObject" id="975951072">
 38+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
 39+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
 40+ </object>
 41+ <object class="IBUIView" id="43864540">
 42+ <reference key="NSNextResponder"/>
 43+ <int key="NSvFlags">292</int>
 44+ <object class="NSMutableArray" key="NSSubviews">
 45+ <bool key="EncodedWithXMLCoder">YES</bool>
 46+ <object class="IBUIPickerView" id="693496301">
 47+ <reference key="NSNextResponder" ref="43864540"/>
 48+ <int key="NSvFlags">258</int>
 49+ <string key="NSFrame">{{0, 244}, {320, 216}}</string>
 50+ <reference key="NSSuperview" ref="43864540"/>
 51+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
 52+ <bool key="IBUIShowsSelectionIndicator">YES</bool>
 53+ </object>
 54+ <object class="IBUILabel" id="534777641">
 55+ <reference key="NSNextResponder" ref="43864540"/>
 56+ <int key="NSvFlags">274</int>
 57+ <string key="NSFrame">{{8, 44}, {304, 21}}</string>
 58+ <reference key="NSSuperview" ref="43864540"/>
 59+ <bool key="IBUIOpaque">NO</bool>
 60+ <bool key="IBUIClipsSubviews">YES</bool>
 61+ <int key="IBUIContentMode">7</int>
 62+ <bool key="IBUIUserInteractionEnabled">NO</bool>
 63+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
 64+ <string key="IBUIText">Label</string>
 65+ <object class="NSFont" key="IBUIFont">
 66+ <string key="NSName">Helvetica-Bold</string>
 67+ <double key="NSSize">17</double>
 68+ <int key="NSfFlags">16</int>
 69+ </object>
 70+ <object class="NSColor" key="IBUITextColor">
 71+ <int key="NSColorSpace">1</int>
 72+ <bytes key="NSRGB">MCAwIDAAA</bytes>
 73+ </object>
 74+ <object class="NSColor" key="IBUIHighlightedColor">
 75+ <int key="NSColorSpace">3</int>
 76+ <bytes key="NSWhite">MQA</bytes>
 77+ </object>
 78+ <int key="IBUIBaselineAdjustment">1</int>
 79+ <float key="IBUIMinimumFontSize">10</float>
 80+ </object>
 81+ <object class="IBUINavigationBar" id="237189050">
 82+ <reference key="NSNextResponder" ref="43864540"/>
 83+ <int key="NSvFlags">288</int>
 84+ <string key="NSFrameSize">{320, 44}</string>
 85+ <reference key="NSSuperview" ref="43864540"/>
 86+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
 87+ <object class="NSArray" key="IBUIItems">
 88+ <bool key="EncodedWithXMLCoder">YES</bool>
 89+ <object class="IBUINavigationItem" id="197883586">
 90+ <reference key="IBUINavigationBar" ref="237189050"/>
 91+ <string key="IBUITitle">Title</string>
 92+ <object class="IBUIBarButtonItem" key="IBUIRightBarButtonItem" id="170566254">
 93+ <string key="IBUITitle">Item</string>
 94+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
 95+ <int key="IBUIStyle">1</int>
 96+ <reference key="IBUINavigationItem" ref="197883586"/>
 97+ </object>
 98+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
 99+ </object>
 100+ </object>
 101+ </object>
 102+ <object class="IBUIWebView" id="926905749">
 103+ <reference key="NSNextResponder" ref="43864540"/>
 104+ <int key="NSvFlags">282</int>
 105+ <string key="NSFrame">{{0, 68}, {320, 177}}</string>
 106+ <reference key="NSSuperview" ref="43864540"/>
 107+ <object class="NSColor" key="IBUIBackgroundColor" id="728739907">
 108+ <int key="NSColorSpace">1</int>
 109+ <bytes key="NSRGB">MSAxIDEAA</bytes>
 110+ </object>
 111+ <bool key="IBUIMultipleTouchEnabled">YES</bool>
 112+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
 113+ <int key="IBUIDataDetectorTypes">2</int>
 114+ </object>
 115+ </object>
 116+ <string key="NSFrameSize">{320, 460}</string>
 117+ <reference key="NSSuperview"/>
 118+ <reference key="IBUIBackgroundColor" ref="728739907"/>
 119+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
 120+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
 121+ </object>
 122+ </object>
 123+ <object class="IBObjectContainer" key="IBDocument.Objects">
 124+ <object class="NSMutableArray" key="connectionRecords">
 125+ <bool key="EncodedWithXMLCoder">YES</bool>
 126+ <object class="IBConnectionRecord">
 127+ <object class="IBCocoaTouchOutletConnection" key="connection">
 128+ <string key="label">view</string>
 129+ <reference key="source" ref="372490531"/>
 130+ <reference key="destination" ref="43864540"/>
 131+ </object>
 132+ <int key="connectionID">11</int>
 133+ </object>
 134+ <object class="IBConnectionRecord">
 135+ <object class="IBCocoaTouchOutletConnection" key="connection">
 136+ <string key="label">delegate</string>
 137+ <reference key="source" ref="693496301"/>
 138+ <reference key="destination" ref="372490531"/>
 139+ </object>
 140+ <int key="connectionID">12</int>
 141+ </object>
 142+ <object class="IBConnectionRecord">
 143+ <object class="IBCocoaTouchOutletConnection" key="connection">
 144+ <string key="label">dataSource</string>
 145+ <reference key="source" ref="693496301"/>
 146+ <reference key="destination" ref="372490531"/>
 147+ </object>
 148+ <int key="connectionID">13</int>
 149+ </object>
 150+ <object class="IBConnectionRecord">
 151+ <object class="IBCocoaTouchOutletConnection" key="connection">
 152+ <string key="label">descriptionText</string>
 153+ <reference key="source" ref="372490531"/>
 154+ <reference key="destination" ref="926905749"/>
 155+ </object>
 156+ <int key="connectionID">14</int>
 157+ </object>
 158+ <object class="IBConnectionRecord">
 159+ <object class="IBCocoaTouchOutletConnection" key="connection">
 160+ <string key="label">pickerControl</string>
 161+ <reference key="source" ref="372490531"/>
 162+ <reference key="destination" ref="693496301"/>
 163+ </object>
 164+ <int key="connectionID">15</int>
 165+ </object>
 166+ <object class="IBConnectionRecord">
 167+ <object class="IBCocoaTouchOutletConnection" key="connection">
 168+ <string key="label">pickerLabel</string>
 169+ <reference key="source" ref="372490531"/>
 170+ <reference key="destination" ref="534777641"/>
 171+ </object>
 172+ <int key="connectionID">16</int>
 173+ </object>
 174+ <object class="IBConnectionRecord">
 175+ <object class="IBCocoaTouchOutletConnection" key="connection">
 176+ <string key="label">dismissButton</string>
 177+ <reference key="source" ref="372490531"/>
 178+ <reference key="destination" ref="170566254"/>
 179+ </object>
 180+ <int key="connectionID">17</int>
 181+ </object>
 182+ <object class="IBConnectionRecord">
 183+ <object class="IBCocoaTouchOutletConnection" key="connection">
 184+ <string key="label">navItem</string>
 185+ <reference key="source" ref="372490531"/>
 186+ <reference key="destination" ref="197883586"/>
 187+ </object>
 188+ <int key="connectionID">18</int>
 189+ </object>
 190+ <object class="IBConnectionRecord">
 191+ <object class="IBCocoaTouchEventConnection" key="connection">
 192+ <string key="label">dismissLicensePicker:</string>
 193+ <reference key="source" ref="170566254"/>
 194+ <reference key="destination" ref="372490531"/>
 195+ </object>
 196+ <int key="connectionID">19</int>
 197+ </object>
 198+ </object>
 199+ <object class="IBMutableOrderedSet" key="objectRecords">
 200+ <object class="NSArray" key="orderedObjects">
 201+ <bool key="EncodedWithXMLCoder">YES</bool>
 202+ <object class="IBObjectRecord">
 203+ <int key="objectID">0</int>
 204+ <reference key="object" ref="0"/>
 205+ <reference key="children" ref="1000"/>
 206+ <nil key="parent"/>
 207+ </object>
 208+ <object class="IBObjectRecord">
 209+ <int key="objectID">-1</int>
 210+ <reference key="object" ref="372490531"/>
 211+ <reference key="parent" ref="0"/>
 212+ <string key="objectName">File's Owner</string>
 213+ </object>
 214+ <object class="IBObjectRecord">
 215+ <int key="objectID">-2</int>
 216+ <reference key="object" ref="975951072"/>
 217+ <reference key="parent" ref="0"/>
 218+ </object>
 219+ <object class="IBObjectRecord">
 220+ <int key="objectID">4</int>
 221+ <reference key="object" ref="43864540"/>
 222+ <object class="NSMutableArray" key="children">
 223+ <bool key="EncodedWithXMLCoder">YES</bool>
 224+ <reference ref="926905749"/>
 225+ <reference ref="534777641"/>
 226+ <reference ref="237189050"/>
 227+ <reference ref="693496301"/>
 228+ </object>
 229+ <reference key="parent" ref="0"/>
 230+ <string key="objectName">view</string>
 231+ </object>
 232+ <object class="IBObjectRecord">
 233+ <int key="objectID">5</int>
 234+ <reference key="object" ref="926905749"/>
 235+ <reference key="parent" ref="43864540"/>
 236+ </object>
 237+ <object class="IBObjectRecord">
 238+ <int key="objectID">6</int>
 239+ <reference key="object" ref="534777641"/>
 240+ <reference key="parent" ref="43864540"/>
 241+ </object>
 242+ <object class="IBObjectRecord">
 243+ <int key="objectID">7</int>
 244+ <reference key="object" ref="237189050"/>
 245+ <object class="NSMutableArray" key="children">
 246+ <bool key="EncodedWithXMLCoder">YES</bool>
 247+ <reference ref="197883586"/>
 248+ </object>
 249+ <reference key="parent" ref="43864540"/>
 250+ </object>
 251+ <object class="IBObjectRecord">
 252+ <int key="objectID">8</int>
 253+ <reference key="object" ref="693496301"/>
 254+ <reference key="parent" ref="43864540"/>
 255+ </object>
 256+ <object class="IBObjectRecord">
 257+ <int key="objectID">9</int>
 258+ <reference key="object" ref="197883586"/>
 259+ <object class="NSMutableArray" key="children">
 260+ <bool key="EncodedWithXMLCoder">YES</bool>
 261+ <reference ref="170566254"/>
 262+ </object>
 263+ <reference key="parent" ref="237189050"/>
 264+ </object>
 265+ <object class="IBObjectRecord">
 266+ <int key="objectID">10</int>
 267+ <reference key="object" ref="170566254"/>
 268+ <reference key="parent" ref="197883586"/>
 269+ </object>
 270+ </object>
 271+ </object>
 272+ <object class="NSMutableDictionary" key="flattenedProperties">
 273+ <bool key="EncodedWithXMLCoder">YES</bool>
 274+ <object class="NSArray" key="dict.sortedKeys">
 275+ <bool key="EncodedWithXMLCoder">YES</bool>
 276+ <string>-1.CustomClassName</string>
 277+ <string>-2.CustomClassName</string>
 278+ <string>10.IBPluginDependency</string>
 279+ <string>4.IBEditorWindowLastContentRect</string>
 280+ <string>4.IBPluginDependency</string>
 281+ <string>5.IBPluginDependency</string>
 282+ <string>5.IBViewBoundsToFrameTransform</string>
 283+ <string>6.IBPluginDependency</string>
 284+ <string>6.IBViewBoundsToFrameTransform</string>
 285+ <string>7.IBEditorWindowLastContentRect</string>
 286+ <string>7.IBPluginDependency</string>
 287+ <string>7.IBViewBoundsToFrameTransform</string>
 288+ <string>8.IBPluginDependency</string>
 289+ <string>8.IBViewBoundsToFrameTransform</string>
 290+ <string>9.IBPluginDependency</string>
 291+ </object>
 292+ <object class="NSMutableArray" key="dict.values">
 293+ <bool key="EncodedWithXMLCoder">YES</bool>
 294+ <string>LicensePickerViewController</string>
 295+ <string>UIResponder</string>
 296+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 297+ <string>{{44, 232}, {320, 480}}</string>
 298+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 299+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 300+ <object class="NSAffineTransform">
 301+ <bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAw28AAA</bytes>
 302+ </object>
 303+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 304+ <object class="NSAffineTransform">
 305+ <bytes key="NSTransformStruct">P4AAAL+AAABCSAAAwnwAAA</bytes>
 306+ </object>
 307+ <string>{{0, 951}, {320, 44}}</string>
 308+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 309+ <object class="NSAffineTransform">
 310+ <bytes key="NSTransformStruct">P4AAAL+AAADCfAAAwogAAA</bytes>
 311+ </object>
 312+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 313+ <object class="NSAffineTransform">
 314+ <bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAw88AAA</bytes>
 315+ </object>
 316+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
 317+ </object>
 318+ </object>
 319+ <object class="NSMutableDictionary" key="unlocalizedProperties">
 320+ <bool key="EncodedWithXMLCoder">YES</bool>
 321+ <reference key="dict.sortedKeys" ref="0"/>
 322+ <object class="NSMutableArray" key="dict.values">
 323+ <bool key="EncodedWithXMLCoder">YES</bool>
 324+ </object>
 325+ </object>
 326+ <nil key="activeLocalization"/>
 327+ <object class="NSMutableDictionary" key="localizations">
 328+ <bool key="EncodedWithXMLCoder">YES</bool>
 329+ <reference key="dict.sortedKeys" ref="0"/>
 330+ <object class="NSMutableArray" key="dict.values">
 331+ <bool key="EncodedWithXMLCoder">YES</bool>
 332+ </object>
 333+ </object>
 334+ <nil key="sourceID"/>
 335+ <int key="maxID">19</int>
 336+ </object>
 337+ <object class="IBClassDescriber" key="IBDocument.Classes">
 338+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
 339+ <bool key="EncodedWithXMLCoder">YES</bool>
 340+ <object class="IBPartialClassDescription">
 341+ <string key="className">LicensePickerViewController</string>
 342+ <string key="superclassName">UIViewController</string>
 343+ <object class="NSMutableDictionary" key="actions">
 344+ <string key="NS.key.0">dismissLicensePicker:</string>
 345+ <string key="NS.object.0">id</string>
 346+ </object>
 347+ <object class="NSMutableDictionary" key="actionInfosByName">
 348+ <string key="NS.key.0">dismissLicensePicker:</string>
 349+ <object class="IBActionInfo" key="NS.object.0">
 350+ <string key="name">dismissLicensePicker:</string>
 351+ <string key="candidateClassName">id</string>
 352+ </object>
 353+ </object>
 354+ <object class="NSMutableDictionary" key="outlets">
 355+ <bool key="EncodedWithXMLCoder">YES</bool>
 356+ <object class="NSArray" key="dict.sortedKeys">
 357+ <bool key="EncodedWithXMLCoder">YES</bool>
 358+ <string>descriptionText</string>
 359+ <string>dismissButton</string>
 360+ <string>navItem</string>
 361+ <string>pickerControl</string>
 362+ <string>pickerLabel</string>
 363+ </object>
 364+ <object class="NSMutableArray" key="dict.values">
 365+ <bool key="EncodedWithXMLCoder">YES</bool>
 366+ <string>UIWebView</string>
 367+ <string>UIBarButtonItem</string>
 368+ <string>UINavigationItem</string>
 369+ <string>UIPickerView</string>
 370+ <string>UILabel</string>
 371+ </object>
 372+ </object>
 373+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
 374+ <bool key="EncodedWithXMLCoder">YES</bool>
 375+ <object class="NSArray" key="dict.sortedKeys">
 376+ <bool key="EncodedWithXMLCoder">YES</bool>
 377+ <string>descriptionText</string>
 378+ <string>dismissButton</string>
 379+ <string>navItem</string>
 380+ <string>pickerControl</string>
 381+ <string>pickerLabel</string>
 382+ </object>
 383+ <object class="NSMutableArray" key="dict.values">
 384+ <bool key="EncodedWithXMLCoder">YES</bool>
 385+ <object class="IBToOneOutletInfo">
 386+ <string key="name">descriptionText</string>
 387+ <string key="candidateClassName">UIWebView</string>
 388+ </object>
 389+ <object class="IBToOneOutletInfo">
 390+ <string key="name">dismissButton</string>
 391+ <string key="candidateClassName">UIBarButtonItem</string>
 392+ </object>
 393+ <object class="IBToOneOutletInfo">
 394+ <string key="name">navItem</string>
 395+ <string key="candidateClassName">UINavigationItem</string>
 396+ </object>
 397+ <object class="IBToOneOutletInfo">
 398+ <string key="name">pickerControl</string>
 399+ <string key="candidateClassName">UIPickerView</string>
 400+ </object>
 401+ <object class="IBToOneOutletInfo">
 402+ <string key="name">pickerLabel</string>
 403+ <string key="candidateClassName">UILabel</string>
 404+ </object>
 405+ </object>
 406+ </object>
 407+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 408+ <string key="majorKey">IBProjectSource</string>
 409+ <string key="minorKey">Classes/LicensePickerViewController.h</string>
 410+ </object>
 411+ </object>
 412+ </object>
 413+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
 414+ <bool key="EncodedWithXMLCoder">YES</bool>
 415+ <object class="IBPartialClassDescription">
 416+ <string key="className">NSObject</string>
 417+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 418+ <string key="majorKey">IBFrameworkSource</string>
 419+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
 420+ </object>
 421+ </object>
 422+ <object class="IBPartialClassDescription">
 423+ <string key="className">NSObject</string>
 424+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 425+ <string key="majorKey">IBFrameworkSource</string>
 426+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
 427+ </object>
 428+ </object>
 429+ <object class="IBPartialClassDescription">
 430+ <string key="className">NSObject</string>
 431+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 432+ <string key="majorKey">IBFrameworkSource</string>
 433+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
 434+ </object>
 435+ </object>
 436+ <object class="IBPartialClassDescription">
 437+ <string key="className">NSObject</string>
 438+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 439+ <string key="majorKey">IBFrameworkSource</string>
 440+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
 441+ </object>
 442+ </object>
 443+ <object class="IBPartialClassDescription">
 444+ <string key="className">NSObject</string>
 445+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 446+ <string key="majorKey">IBFrameworkSource</string>
 447+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
 448+ </object>
 449+ </object>
 450+ <object class="IBPartialClassDescription">
 451+ <string key="className">NSObject</string>
 452+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 453+ <string key="majorKey">IBFrameworkSource</string>
 454+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
 455+ </object>
 456+ </object>
 457+ <object class="IBPartialClassDescription">
 458+ <string key="className">NSObject</string>
 459+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 460+ <string key="majorKey">IBFrameworkSource</string>
 461+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
 462+ </object>
 463+ </object>
 464+ <object class="IBPartialClassDescription">
 465+ <string key="className">NSObject</string>
 466+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 467+ <string key="majorKey">IBFrameworkSource</string>
 468+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
 469+ </object>
 470+ </object>
 471+ <object class="IBPartialClassDescription">
 472+ <string key="className">NSObject</string>
 473+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 474+ <string key="majorKey">IBFrameworkSource</string>
 475+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
 476+ </object>
 477+ </object>
 478+ <object class="IBPartialClassDescription">
 479+ <string key="className">NSObject</string>
 480+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 481+ <string key="majorKey">IBFrameworkSource</string>
 482+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
 483+ </object>
 484+ </object>
 485+ <object class="IBPartialClassDescription">
 486+ <string key="className">NSObject</string>
 487+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 488+ <string key="majorKey">IBFrameworkSource</string>
 489+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
 490+ </object>
 491+ </object>
 492+ <object class="IBPartialClassDescription">
 493+ <string key="className">NSObject</string>
 494+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 495+ <string key="majorKey">IBFrameworkSource</string>
 496+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
 497+ </object>
 498+ </object>
 499+ <object class="IBPartialClassDescription">
 500+ <string key="className">NSObject</string>
 501+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1045264098">
 502+ <string key="majorKey">IBFrameworkSource</string>
 503+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
 504+ </object>
 505+ </object>
 506+ <object class="IBPartialClassDescription">
 507+ <string key="className">UIBarButtonItem</string>
 508+ <string key="superclassName">UIBarItem</string>
 509+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 510+ <string key="majorKey">IBFrameworkSource</string>
 511+ <string key="minorKey">UIKit.framework/Headers/UIBarButtonItem.h</string>
 512+ </object>
 513+ </object>
 514+ <object class="IBPartialClassDescription">
 515+ <string key="className">UIBarItem</string>
 516+ <string key="superclassName">NSObject</string>
 517+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 518+ <string key="majorKey">IBFrameworkSource</string>
 519+ <string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string>
 520+ </object>
 521+ </object>
 522+ <object class="IBPartialClassDescription">
 523+ <string key="className">UILabel</string>
 524+ <string key="superclassName">UIView</string>
 525+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 526+ <string key="majorKey">IBFrameworkSource</string>
 527+ <string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
 528+ </object>
 529+ </object>
 530+ <object class="IBPartialClassDescription">
 531+ <string key="className">UINavigationBar</string>
 532+ <string key="superclassName">UIView</string>
 533+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="167678161">
 534+ <string key="majorKey">IBFrameworkSource</string>
 535+ <string key="minorKey">UIKit.framework/Headers/UINavigationBar.h</string>
 536+ </object>
 537+ </object>
 538+ <object class="IBPartialClassDescription">
 539+ <string key="className">UINavigationItem</string>
 540+ <string key="superclassName">NSObject</string>
 541+ <reference key="sourceIdentifier" ref="167678161"/>
 542+ </object>
 543+ <object class="IBPartialClassDescription">
 544+ <string key="className">UIPickerView</string>
 545+ <string key="superclassName">UIView</string>
 546+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 547+ <string key="majorKey">IBFrameworkSource</string>
 548+ <string key="minorKey">UIKit.framework/Headers/UIPickerView.h</string>
 549+ </object>
 550+ </object>
 551+ <object class="IBPartialClassDescription">
 552+ <string key="className">UIResponder</string>
 553+ <string key="superclassName">NSObject</string>
 554+ <reference key="sourceIdentifier" ref="1045264098"/>
 555+ </object>
 556+ <object class="IBPartialClassDescription">
 557+ <string key="className">UISearchBar</string>
 558+ <string key="superclassName">UIView</string>
 559+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 560+ <string key="majorKey">IBFrameworkSource</string>
 561+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
 562+ </object>
 563+ </object>
 564+ <object class="IBPartialClassDescription">
 565+ <string key="className">UISearchDisplayController</string>
 566+ <string key="superclassName">NSObject</string>
 567+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 568+ <string key="majorKey">IBFrameworkSource</string>
 569+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
 570+ </object>
 571+ </object>
 572+ <object class="IBPartialClassDescription">
 573+ <string key="className">UIView</string>
 574+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 575+ <string key="majorKey">IBFrameworkSource</string>
 576+ <string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
 577+ </object>
 578+ </object>
 579+ <object class="IBPartialClassDescription">
 580+ <string key="className">UIView</string>
 581+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 582+ <string key="majorKey">IBFrameworkSource</string>
 583+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
 584+ </object>
 585+ </object>
 586+ <object class="IBPartialClassDescription">
 587+ <string key="className">UIView</string>
 588+ <string key="superclassName">UIResponder</string>
 589+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 590+ <string key="majorKey">IBFrameworkSource</string>
 591+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
 592+ </object>
 593+ </object>
 594+ <object class="IBPartialClassDescription">
 595+ <string key="className">UIViewController</string>
 596+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 597+ <string key="majorKey">IBFrameworkSource</string>
 598+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
 599+ </object>
 600+ </object>
 601+ <object class="IBPartialClassDescription">
 602+ <string key="className">UIViewController</string>
 603+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 604+ <string key="majorKey">IBFrameworkSource</string>
 605+ <string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
 606+ </object>
 607+ </object>
 608+ <object class="IBPartialClassDescription">
 609+ <string key="className">UIViewController</string>
 610+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 611+ <string key="majorKey">IBFrameworkSource</string>
 612+ <string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
 613+ </object>
 614+ </object>
 615+ <object class="IBPartialClassDescription">
 616+ <string key="className">UIViewController</string>
 617+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 618+ <string key="majorKey">IBFrameworkSource</string>
 619+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
 620+ </object>
 621+ </object>
 622+ <object class="IBPartialClassDescription">
 623+ <string key="className">UIViewController</string>
 624+ <string key="superclassName">UIResponder</string>
 625+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 626+ <string key="majorKey">IBFrameworkSource</string>
 627+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
 628+ </object>
 629+ </object>
 630+ <object class="IBPartialClassDescription">
 631+ <string key="className">UIWebView</string>
 632+ <string key="superclassName">UIView</string>
 633+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
 634+ <string key="majorKey">IBFrameworkSource</string>
 635+ <string key="minorKey">UIKit.framework/Headers/UIWebView.h</string>
 636+ </object>
 637+ </object>
 638+ </object>
 639+ </object>
 640+ <int key="IBDocument.localizationMode">0</int>
 641+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
 642+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
 643+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
 644+ <integer value="1056" key="NS.object.0"/>
 645+ </object>
 646+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
 647+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
 648+ <integer value="3000" key="NS.object.0"/>
 649+ </object>
 650+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
 651+ <string key="IBDocument.LastKnownRelativeProjectPath">../WikiSnaps.xcodeproj</string>
 652+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
 653+ <string key="IBCocoaTouchPluginVersion">132</string>
 654+ </data>
 655+</archive>
Index: trunk/tools/WikiSnaps/Classes/LicensePickerViewController.h
@@ -0,0 +1,37 @@
 2+//
 3+// LicensePickerViewController.h
 4+// WikiSnaps
 5+//
 6+// Created by Derk-Jan Hartman on 26-03-11.
 7+// Copyright 2011 Wikimedia Commons. All rights reserved.
 8+//
 9+
 10+#import <UIKit/UIKit.h>
 11+
 12+@protocol LicensePickerDelegate
 13+- (void)licensePickerDidFinish: (int)selectedLicense;
 14+@end
 15+
 16+@interface LicensePickerViewController : UIViewController {
 17+ id <LicensePickerDelegate> delegate;
 18+
 19+ IBOutlet UIBarButtonItem *dismissButton;
 20+ IBOutlet UINavigationItem *navItem;
 21+ IBOutlet UIPickerView *pickerControl;
 22+ IBOutlet UIWebView *descriptionText;
 23+ IBOutlet UILabel *pickerLabel;
 24+
 25+ NSArray *licenses;
 26+ int selectedLicense;
 27+
 28+}
 29+
 30+@property (retain, nonatomic) id <LicensePickerDelegate> delegate;
 31+@property (retain, nonatomic) UIWebView *descriptionText;
 32+@property (retain, nonatomic) UILabel *pickerLabel;
 33+@property (retain, nonatomic) NSArray *licenses;
 34+@property (nonatomic) int selectedLicense;
 35+
 36+-(IBAction)dismissLicensePicker:(id)sender;
 37+
 38+@end
Property changes on: trunk/tools/WikiSnaps/Classes/LicensePickerViewController.h
___________________________________________________________________
Added: svn:eol-style
139 + native
Index: trunk/tools/WikiSnaps/Classes/PhotoPickerAppDelegate.h
@@ -16,12 +16,13 @@
1717
1818
1919 @interface PhotoPickerAppDelegate : NSObject <UIApplicationDelegate> {
20 - int defaultImageSource;
21 - BOOL justInstalled;
22 - NSString *postContext;
23 - UIWindow *window;
24 - PhotoPickerViewController *viewController;
25 - UINavigationController *navController;
 20+ int defaultImageSource;
 21+ BOOL justInstalled;
 22+ NSString *postContext;
 23+ UIWindow *window;
 24+ PhotoPickerViewController *viewController;
 25+ UINavigationController *navController;
 26+ NSArray *licenses;
2627 }
2728
2829 @property (nonatomic, assign) int defaultImageSource;
@@ -34,6 +35,7 @@
3536 @property (nonatomic, retain) IBOutlet PhotoPickerViewController *viewController;
3637 @property (nonatomic, retain) IBOutlet UINavigationController *navController;
3738 @property (nonatomic, retain) IBOutlet UIWindow *window;
 39+@property (nonatomic, retain) NSArray *licenses;
3840
3941 @end
4042
Index: trunk/tools/WikiSnaps/Classes/LicensePickerViewController.m
@@ -0,0 +1,115 @@
 2+//
 3+// LicensePickerViewController.m
 4+// WikiSnaps
 5+//
 6+// Created by Derk-Jan Hartman on 26-03-11.
 7+// Copyright 2011 Wikimedia Commons. All rights reserved.
 8+//
 9+
 10+#import "LicensePickerViewController.h"
 11+
 12+
 13+@implementation LicensePickerViewController
 14+
 15+@synthesize descriptionText, pickerLabel;
 16+@synthesize licenses, selectedLicense;
 17+@synthesize delegate;
 18+
 19+// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
 20+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
 21+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
 22+ if (self) {
 23+ // Custom init
 24+ }
 25+ return self;
 26+}
 27+
 28+
 29+// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
 30+- (void)viewDidLoad {
 31+ [super viewDidLoad];
 32+ navItem.title = NSLocalizedString( @"License", @"Title for the license picker" );
 33+ dismissButton.title = NSLocalizedString( @"Select", "Title for the select button in license picker" );
 34+ dismissButton.target = self;
 35+ dismissButton.action = @selector( dismissLicensePicker: );
 36+
 37+ [pickerControl selectRow:selectedLicense inComponent:0 animated: NO];
 38+ NSDictionary *aLicense = [licenses objectAtIndex:selectedLicense];
 39+ pickerLabel.text = [aLicense objectForKey:@"name"];
 40+ [descriptionText loadHTMLString: [aLicense objectForKey:@"description"] baseURL: nil];
 41+}
 42+
 43+
 44+/*
 45+// Override to allow orientations other than the default portrait orientation.
 46+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
 47+ // Return YES for supported orientations.
 48+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
 49+}
 50+*/
 51+
 52+- (void)didReceiveMemoryWarning {
 53+ // Releases the view if it doesn't have a superview.
 54+ [super didReceiveMemoryWarning];
 55+
 56+ // Release any cached data, images, etc. that aren't in use.
 57+}
 58+
 59+- (void)viewDidUnload {
 60+ [super viewDidUnload];
 61+ // Release any retained subviews of the main view.
 62+ // e.g. self.myOutlet = nil;
 63+}
 64+
 65+
 66+- (void)dealloc {
 67+ [super dealloc];
 68+}
 69+
 70+#pragma mark Actions
 71+- (IBAction) dismissLicensePicker: (id) sender
 72+{
 73+ [delegate licensePickerDidFinish: [pickerControl selectedRowInComponent:0]];
 74+}
 75+
 76+#pragma mark UIPickerViewDelegate
 77+
 78+- (NSString*)pickerView: (UIPickerView *)aPickerView
 79+ titleForRow: (NSInteger)row
 80+ forComponent: (NSInteger)component
 81+{
 82+ NSDictionary *dict = [licenses objectAtIndex:row];
 83+ if( dict != nil ) {
 84+ return [dict objectForKey:@"short"];
 85+ }
 86+ return @"";
 87+}
 88+
 89+- (void)pickerView: (UIPickerView *)aPickerView
 90+ didSelectRow:(NSInteger)row
 91+ inComponent:(NSInteger)component
 92+{
 93+ NSDictionary *dict = [licenses objectAtIndex:row];
 94+ if( dict != nil ) {
 95+ pickerLabel.text = [dict objectForKey:@"name"];
 96+ [descriptionText loadHTMLString: [dict objectForKey:@"description"] baseURL: nil];
 97+ }
 98+}
 99+
 100+#pragma mark UIPickerViewDataSource
 101+
 102+- (NSInteger)numberOfComponentsInPickerView: (UIPickerView *)aPickerView
 103+{
 104+ return 1;
 105+}
 106+
 107+
 108+- (NSInteger)pickerView: (UIPickerView *)aPickerView numberOfRowsInComponent: (NSInteger)component
 109+{
 110+ NSInteger numberOfRows = [licenses count];
 111+
 112+ return numberOfRows;
 113+}
 114+
 115+
 116+@end
Index: trunk/tools/WikiSnaps/Classes/CommonsUpload.m
@@ -12,6 +12,7 @@
1313 #import "ASIFormDataRequest.h"
1414 #import "XMLReader.h"
1515 #import "SFHFKeychainUtils.h"
 16+#import "PhotoPickerAppDelegate.h"
1617
1718 /* Private */
1819 @interface CommonsUpload (Internal)
@@ -28,6 +29,28 @@
2930 return @"";
3031 }
3132
 33+- (NSString *)getLicenseString {
 34+ PhotoPickerAppDelegate *appDelegate =
 35+ (PhotoPickerAppDelegate *) [UIApplication sharedApplication].delegate;
 36+
 37+ NSString *licenseDefault = [[NSUserDefaults standardUserDefaults] stringForKey: COMMONS_LICENSE_KEY];
 38+ NSEnumerator *enumerator = [appDelegate.licenses objectEnumerator];
 39+ NSDictionary *aLicense = nil;
 40+ while( licenseDefault != nil && (aLicense = [enumerator nextObject]) ) {
 41+ if( [licenseDefault compare: [aLicense objectForKey:@"short"]] == NSOrderedSame ) {
 42+ break;
 43+ }
 44+ }
 45+ if( aLicense != nil ) {
 46+ NSString *licenseString = [aLicense objectForKey:@"template"];
 47+ licenseString = [licenseString stringByReplacingOccurrencesOfString:@"$author" withString: [[NSUserDefaults standardUserDefaults] valueForKey: COMMONS_USERNAME_KEY]];
 48+ // TODO add attribution at some point
 49+ licenseString = [licenseString stringByReplacingOccurrencesOfString:@"$attribution" withString: @""];
 50+ return licenseString;
 51+ }
 52+ return DEFAULT_LICENSE;
 53+}
 54+
3255 - (NSString *)getUploadDescription {
3356 NSDate *today = [NSDate date];
3457 NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
@@ -41,7 +64,7 @@
4265 description,
4366 [[NSUserDefaults standardUserDefaults] valueForKey: COMMONS_USERNAME_KEY],
4467 dateString,
45 - DEFAULT_LICENSE,
 68+ [self getLicenseString],
4669 APPLICATION_CATEGORY,
4770 nil
4871 ];
Index: trunk/tools/WikiSnaps/Classes/PhotoPickerAppDelegate.m
@@ -23,14 +23,21 @@
2424 @synthesize viewController;
2525 @synthesize navController;
2626 @synthesize window;
 27+@synthesize licenses;
2728
2829
2930 - (BOOL)application:(UIApplication *)application
3031 didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
3132
 33+ [self checkIfJustInstalled];
 34+
3235 self.defaultImageSource = -1;
3336
34 - [self checkIfJustInstalled];
 37+ NSString *path = [[NSBundle mainBundle] pathForResource:@"Licenses" ofType:@"plist"];
 38+ licenses = [[NSMutableArray alloc] initWithContentsOfFile:path];
 39+ if( licenses == nil ) {
 40+ NSLog( @"Could not load the licenses information" );
 41+ }
3542
3643 [window addSubview:navController.view];
3744 [window makeKeyAndVisible];
@@ -43,6 +50,7 @@
4451 self.viewController = nil;
4552 self.navController = nil;
4653 self.window = nil;
 54+ [licenses release];
4755
4856 [super dealloc];
4957 }
Index: trunk/tools/WikiSnaps/Licenses.plist
@@ -0,0 +1,113 @@
 2+<?xml version="1.0" encoding="UTF-8"?>
 3+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 4+<plist version="1.0">
 5+<array>
 6+ <dict>
 7+ <key>name</key>
 8+ <string>Creative Commons Attribution Share-Alike 3.0</string>
 9+ <key>short</key>
 10+ <string>CC-BY-SA-3.0</string>
 11+ <key>template</key>
 12+ <string>{{self|1=cc-by-sa-3.0|author=$author|attribution=$attribution}}</string>
 13+ <key>description</key>
 14+ <string>&lt;html&gt;
 15+&lt;head&gt;
 16+&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
 17+&lt;/head&gt;
 18+&lt;body&gt;
 19+&lt;h4&gt;You are free:&lt;/h4&gt;
 20+&lt;ul&gt;
 21+&lt;li&gt;&lt;b&gt;to Share&lt;/b&gt; — to copy, distribute and transmit the work&lt;/li&gt;
 22+&lt;li&gt;&lt;b&gt;to Remix&lt;/b&gt; — to adapt the work&lt;/li&gt;
 23+&lt;/ul&gt;
 24+&lt;h4&gt;Under the following conditions:&lt;/h4&gt;
 25+&lt;ul&gt;
 26+&lt;li&gt;&lt;b&gt;Attribution&lt;/b&gt; — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).&lt;/li&gt;
 27+&lt;li&gt;&lt;b&gt;Share Alike&lt;/b&gt; — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;/li&gt;
 28+&lt;/ul&gt;
 29+&lt;h4&gt;With the understanding that:&lt;/h4&gt;
 30+&lt;ul&gt;
 31+&lt;li&gt;&lt;b&gt;Waiver&lt;/b&gt; — Any of the above conditions can be &lt;b&gt;&lt;u&gt;waived&lt;/u&gt;&lt;/b&gt; if you get permission from the copyright holder.&lt;/li&gt;
 32+&lt;li&gt;&lt;b&gt;Public Domain&lt;/b&gt; — Where the work or any of its elements is in the &lt;b&gt;&lt;u&gt;public domain&lt;/u&gt;&lt;/b&gt; under applicable law, that status is in no way affected by the license.&lt;/li&gt;
 33+&lt;li&gt;&lt;b&gt;Other Rights&lt;/b&gt; — In no way are any of the following rights affected by the license:
 34+&lt;ul&gt;
 35+&lt;li&gt;Your fair dealing or &lt;b&gt;&lt;u&gt;fair use&lt;/u&gt;&lt;/b&gt; rights, or other applicable copyright exceptions and limitations;
 36+&lt;li&gt;The author&apos;s &lt;b&gt;&lt;u&gt;moral&lt;/u&gt;&lt;/b&gt; rights;
 37+&lt;li&gt;Rights other persons may have either in the work itself or in how the work is used, such as &lt;b&gt;&lt;u&gt;publicity&lt;/u&gt;&lt;/b&gt; or privacy rights.
 38+&lt;/ul&gt;&lt;/li&gt;
 39+&lt;li&gt;&lt;b&gt;Notice&lt;/b&gt; — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.&lt;/li&gt;
 40+&lt;/ul&gt;
 41+&lt;p&gt;
 42+This is a human-readable summary of the &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/legalcode&quot;&gt;Legal Code (the full license)&lt;/a&gt;.
 43+&lt;/body&gt;
 44+&lt;/html&gt;</string>
 45+ </dict>
 46+ <dict>
 47+ <key>name</key>
 48+ <string>Creative Commons Attribution 3.0</string>
 49+ <key>short</key>
 50+ <string>CC-BY-3.0</string>
 51+ <key>template</key>
 52+ <string>{{self|1=cc-by-3.0|author=$author|attribution=$attribution}}</string>
 53+ <key>description</key>
 54+ <string>&lt;html&gt;
 55+&lt;head&gt;
 56+&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
 57+&lt;/head&gt;
 58+&lt;body&gt;
 59+&lt;h4&gt;You are free:&lt;/h4&gt;
 60+&lt;ul&gt;
 61+&lt;li&gt;&lt;b&gt;to Share&lt;/b&gt; — to copy, distribute and transmit the work&lt;/li&gt;
 62+&lt;li&gt;&lt;b&gt;to Remix&lt;/b&gt; — to adapt the work&lt;/li&gt;
 63+&lt;/ul&gt;
 64+&lt;h4&gt;Under the following conditions:&lt;/h4&gt;
 65+&lt;ul&gt;
 66+&lt;li&gt;&lt;b&gt;Attribution&lt;/b&gt; — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).&lt;/li&gt;
 67+&lt;/ul&gt;
 68+&lt;h4&gt;With the understanding that:&lt;/h4&gt;
 69+&lt;ul&gt;
 70+&lt;li&gt;&lt;b&gt;Waiver&lt;/b&gt; — Any of the above conditions can be &lt;b&gt;&lt;u&gt;waived&lt;/u&gt;&lt;/b&gt; if you get permission from the copyright holder.&lt;/li&gt;
 71+&lt;li&gt;&lt;b&gt;Public Domain&lt;/b&gt; — Where the work or any of its elements is in the &lt;b&gt;&lt;u&gt;public domain&lt;/u&gt;&lt;/b&gt; under applicable law, that status is in no way affected by the license.&lt;/li&gt;
 72+&lt;li&gt;&lt;b&gt;Other Rights&lt;/b&gt; — In no way are any of the following rights affected by the license:
 73+&lt;ul&gt;
 74+&lt;li&gt;Your fair dealing or &lt;b&gt;&lt;u&gt;fair use&lt;/u&gt;&lt;/b&gt; rights, or other applicable copyright exceptions and limitations;
 75+&lt;li&gt;The author&apos;s &lt;b&gt;&lt;u&gt;moral&lt;/u&gt;&lt;/b&gt; rights;
 76+&lt;li&gt;Rights other persons may have either in the work itself or in how the work is used, such as &lt;b&gt;&lt;u&gt;publicity&lt;/u&gt;&lt;/b&gt; or privacy rights.
 77+&lt;/ul&gt;&lt;/li&gt;
 78+&lt;li&gt;&lt;b&gt;Notice&lt;/b&gt; — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.&lt;/li&gt;
 79+&lt;/ul&gt;
 80+&lt;p&gt;
 81+This is a human-readable summary of the &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/legalcode&quot;&gt;Legal Code (the full license)&lt;/a&gt;.
 82+&lt;/body&gt;
 83+&lt;/html&gt;</string>
 84+ </dict>
 85+ <dict>
 86+ <key>name</key>
 87+ <string>Universal Public Domain Dedication</string>
 88+ <key>short</key>
 89+ <string>CC-Zero</string>
 90+ <key>template</key>
 91+ <string>{{self|1=cc-zero|author=$author|attribution=$attribution}}</string>
 92+ <key>description</key>
 93+ <string>&lt;html&gt;
 94+&lt;head&gt;
 95+&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
 96+&lt;/head&gt;
 97+&lt;body&gt;
 98+&lt;h4&gt;No Copyright&lt;/h4&gt;
 99+The person who associated a work with this deed has &lt;b&gt;dedicated&lt;/b&gt; the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.&lt;/p&gt;
 100+&lt;p&gt;You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. See &lt;b&gt;Other Information&lt;/b&gt; below.
 101+
 102+&lt;h4&gt;Other Information&lt;/h4&gt;
 103+&lt;ul&gt;
 104+&lt;li&gt;In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights.
 105+&lt;li&gt;Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law.
 106+&lt;/li&gt;When using or citing the work, you should not imply endorsement by the author or the affirmer.
 107+&lt;/ul&gt;
 108+
 109+&lt;p&gt;This is a human-readable summary of the &lt;a href=&quot;http://creativecommons.org/publicdomain/zero/1.0/legalcode&quot;&gt;Legal Code (read the full text)&lt;/a&gt;.&lt;/p&gt;
 110+&lt;/body&gt;
 111+&lt;/html&gt;</string>
 112+ </dict>
 113+</array>
 114+</plist>
Index: trunk/tools/WikiSnaps/WikiSnaps.xcodeproj/project.pbxproj
@@ -22,6 +22,9 @@
2323 494C82C812ECBEB6000931F2 /* ImageUploadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 494C82C612ECBEB6000931F2 /* ImageUploadViewController.m */; };
2424 494C82C912ECBEB6000931F2 /* ImageUploadViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 494C82C712ECBEB6000931F2 /* ImageUploadViewController.xib */; };
2525 494C834E12ECEAB3000931F2 /* XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 494C834D12ECEAB3000931F2 /* XMLReader.m */; };
 26+ 4971EC87133E77FD0043DD67 /* Licenses.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4971EC86133E77FD0043DD67 /* Licenses.plist */; };
 27+ 4971ED31133E9DD90043DD67 /* LicensePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4971ED2F133E9DD90043DD67 /* LicensePickerViewController.m */; };
 28+ 4971ED32133E9DD90043DD67 /* LicensePickerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4971ED30133E9DD90043DD67 /* LicensePickerViewController.xib */; };
2629 A127DA4012E0DF9700149FC9 /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A127DA3E12E0DF9700149FC9 /* SettingsViewController.m */; };
2730 A127DA4112E0DF9700149FC9 /* SettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A127DA3F12E0DF9700149FC9 /* SettingsViewController.xib */; };
2831 A1338B8612E0F01700662B28 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = A1338B7312E0F01700662B28 /* ASIAuthenticationDialog.m */; };
@@ -73,6 +76,10 @@
7477 494C82C712ECBEB6000931F2 /* ImageUploadViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ImageUploadViewController.xib; sourceTree = "<group>"; };
7578 494C834C12ECEAB3000931F2 /* XMLReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLReader.h; path = XMLtoDict/XMLReader.h; sourceTree = "<group>"; };
7679 494C834D12ECEAB3000931F2 /* XMLReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMLReader.m; path = XMLtoDict/XMLReader.m; sourceTree = "<group>"; };
 80+ 4971EC86133E77FD0043DD67 /* Licenses.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Licenses.plist; sourceTree = "<group>"; };
 81+ 4971ED2E133E9DD90043DD67 /* LicensePickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LicensePickerViewController.h; sourceTree = "<group>"; };
 82+ 4971ED2F133E9DD90043DD67 /* LicensePickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LicensePickerViewController.m; sourceTree = "<group>"; };
 83+ 4971ED30133E9DD90043DD67 /* LicensePickerViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = LicensePickerViewController.xib; path = Classes/LicensePickerViewController.xib; sourceTree = "<group>"; };
7784 8D1107310486CEB800E47090 /* WikiSnaps-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "WikiSnaps-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
7885 A127DA3D12E0DF9700149FC9 /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = "<group>"; };
7986 A127DA3E12E0DF9700149FC9 /* SettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsViewController.m; sourceTree = "<group>"; };
@@ -165,6 +172,8 @@
166173 A1FECB2A12E10DCA007CF08C /* ImageDetailsViewController.m */,
167174 494C82C512ECBEB6000931F2 /* ImageUploadViewController.h */,
168175 494C82C612ECBEB6000931F2 /* ImageUploadViewController.m */,
 176+ 4971ED2E133E9DD90043DD67 /* LicensePickerViewController.h */,
 177+ 4971ED2F133E9DD90043DD67 /* LicensePickerViewController.m */,
169178 );
170179 path = Classes;
171180 sourceTree = "<group>";
@@ -206,6 +215,7 @@
207216 494C82FA12ECDE94000931F2 /* Images */,
208217 494C82FB12ECDEA6000931F2 /* Xibs */,
209218 8D1107310486CEB800E47090 /* WikiSnaps-Info.plist */,
 219+ 4971EC86133E77FD0043DD67 /* Licenses.plist */,
210220 );
211221 name = Resources;
212222 sourceTree = "<group>";
@@ -255,6 +265,7 @@
256266 A127DA3F12E0DF9700149FC9 /* SettingsViewController.xib */,
257267 A1FECB2B12E10DCA007CF08C /* ImageDetailsViewController.xib */,
258268 494C82C712ECBEB6000931F2 /* ImageUploadViewController.xib */,
 269+ 4971ED30133E9DD90043DD67 /* LicensePickerViewController.xib */,
259270 );
260271 name = Xibs;
261272 sourceTree = "<group>";
@@ -361,6 +372,8 @@
362373 494C81E212E8DBAD000931F2 /* Default.png in Resources */,
363374 494C821312E8E385000931F2 /* SourcePickerViewController.xib in Resources */,
364375 494C82C912ECBEB6000931F2 /* ImageUploadViewController.xib in Resources */,
 376+ 4971EC87133E77FD0043DD67 /* Licenses.plist in Resources */,
 377+ 4971ED32133E9DD90043DD67 /* LicensePickerViewController.xib in Resources */,
365378 );
366379 runOnlyForDeploymentPostprocessing = 0;
367380 };
@@ -392,6 +405,7 @@
393406 494C82C812ECBEB6000931F2 /* ImageUploadViewController.m in Sources */,
394407 494C834E12ECEAB3000931F2 /* XMLReader.m in Sources */,
395408 4935493F13008DA900A7A44E /* SFHFKeychainUtils.m in Sources */,
 409+ 4971ED31133E9DD90043DD67 /* LicensePickerViewController.m in Sources */,
396410 );
397411 runOnlyForDeploymentPostprocessing = 0;
398412 };

Status & tagging log