Index: trunk/tools/WikiSnaps/SettingsViewController.xib |
— | — | @@ -2,10 +2,10 @@ |
3 | 3 | <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10"> |
4 | 4 | <data> |
5 | 5 | <int key="IBDocument.SystemTarget">1056</int> |
6 | | - <string key="IBDocument.SystemVersion">10J567</string> |
| 6 | + <string key="IBDocument.SystemVersion">10J869</string> |
7 | 7 | <string key="IBDocument.InterfaceBuilderVersion">823</string> |
8 | 8 | <string key="IBDocument.AppKitVersion">1038.35</string> |
9 | | - <string key="IBDocument.HIToolboxVersion">462.00</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 | 12 | <string key="NS.object.0">132</string> |
— | — | @@ -205,6 +205,34 @@ |
206 | 206 | <int key="IBUIBaselineAdjustment">1</int> |
207 | 207 | <float key="IBUIMinimumFontSize">10</float> |
208 | 208 | </object> |
| 209 | + <object class="IBUISwitch" id="643678629"> |
| 210 | + <reference key="NSNextResponder" ref="191373211"/> |
| 211 | + <int key="NSvFlags">292</int> |
| 212 | + <string key="NSFrame">{{206, 215}, {94, 27}}</string> |
| 213 | + <reference key="NSSuperview" ref="191373211"/> |
| 214 | + <bool key="IBUIOpaque">NO</bool> |
| 215 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
| 216 | + <int key="IBUIContentHorizontalAlignment">0</int> |
| 217 | + <int key="IBUIContentVerticalAlignment">0</int> |
| 218 | + <bool key="IBUIOn">YES</bool> |
| 219 | + </object> |
| 220 | + <object class="IBUILabel" id="802277757"> |
| 221 | + <reference key="NSNextResponder" ref="191373211"/> |
| 222 | + <int key="NSvFlags">288</int> |
| 223 | + <string key="NSFrame">{{20, 219}, {280, 18}}</string> |
| 224 | + <reference key="NSSuperview" ref="191373211"/> |
| 225 | + <bool key="IBUIOpaque">NO</bool> |
| 226 | + <bool key="IBUIClipsSubviews">YES</bool> |
| 227 | + <int key="IBUIContentMode">7</int> |
| 228 | + <bool key="IBUIUserInteractionEnabled">NO</bool> |
| 229 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
| 230 | + <string key="IBUIText">Add GPS coordinates</string> |
| 231 | + <reference key="IBUIFont" ref="173062393"/> |
| 232 | + <reference key="IBUITextColor" ref="685033555"/> |
| 233 | + <reference key="IBUIHighlightedColor" ref="317385407"/> |
| 234 | + <int key="IBUIBaselineAdjustment">1</int> |
| 235 | + <float key="IBUIMinimumFontSize">10</float> |
| 236 | + </object> |
209 | 237 | </object> |
210 | 238 | <string key="NSFrameSize">{320, 416}</string> |
211 | 239 | <reference key="NSSuperview"/> |
— | — | @@ -365,6 +393,22 @@ |
366 | 394 | </object> |
367 | 395 | <int key="connectionID">51</int> |
368 | 396 | </object> |
| 397 | + <object class="IBConnectionRecord"> |
| 398 | + <object class="IBCocoaTouchOutletConnection" key="connection"> |
| 399 | + <string key="label">gpsLabel</string> |
| 400 | + <reference key="source" ref="372490531"/> |
| 401 | + <reference key="destination" ref="802277757"/> |
| 402 | + </object> |
| 403 | + <int key="connectionID">62</int> |
| 404 | + </object> |
| 405 | + <object class="IBConnectionRecord"> |
| 406 | + <object class="IBCocoaTouchOutletConnection" key="connection"> |
| 407 | + <string key="label">gpsSwitch</string> |
| 408 | + <reference key="source" ref="372490531"/> |
| 409 | + <reference key="destination" ref="643678629"/> |
| 410 | + </object> |
| 411 | + <int key="connectionID">63</int> |
| 412 | + </object> |
369 | 413 | </object> |
370 | 414 | <object class="IBMutableOrderedSet" key="objectRecords"> |
371 | 415 | <object class="NSArray" key="orderedObjects"> |
— | — | @@ -387,6 +431,8 @@ |
388 | 432 | <reference ref="307778079"/> |
389 | 433 | <reference ref="180329537"/> |
390 | 434 | <reference ref="261756187"/> |
| 435 | + <reference ref="643678629"/> |
| 436 | + <reference ref="802277757"/> |
391 | 437 | </object> |
392 | 438 | <reference key="parent" ref="0"/> |
393 | 439 | </object> |
— | — | @@ -436,6 +482,16 @@ |
437 | 483 | <reference key="object" ref="476251156"/> |
438 | 484 | <reference key="parent" ref="191373211"/> |
439 | 485 | </object> |
| 486 | + <object class="IBObjectRecord"> |
| 487 | + <int key="objectID">59</int> |
| 488 | + <reference key="object" ref="643678629"/> |
| 489 | + <reference key="parent" ref="191373211"/> |
| 490 | + </object> |
| 491 | + <object class="IBObjectRecord"> |
| 492 | + <int key="objectID">61</int> |
| 493 | + <reference key="object" ref="802277757"/> |
| 494 | + <reference key="parent" ref="191373211"/> |
| 495 | + </object> |
440 | 496 | </object> |
441 | 497 | </object> |
442 | 498 | <object class="NSMutableDictionary" key="flattenedProperties"> |
— | — | @@ -456,8 +512,11 @@ |
457 | 513 | <string>25.IBViewBoundsToFrameTransform</string> |
458 | 514 | <string>5.IBPluginDependency</string> |
459 | 515 | <string>5.IBViewBoundsToFrameTransform</string> |
| 516 | + <string>59.IBPluginDependency</string> |
460 | 517 | <string>6.IBPluginDependency</string> |
461 | 518 | <string>6.IBViewBoundsToFrameTransform</string> |
| 519 | + <string>61.IBPluginDependency</string> |
| 520 | + <string>61.IBViewBoundsToFrameTransform</string> |
462 | 521 | <string>7.IBPluginDependency</string> |
463 | 522 | <string>7.IBViewBoundsToFrameTransform</string> |
464 | 523 | </object> |
— | — | @@ -465,11 +524,11 @@ |
466 | 525 | <bool key="EncodedWithXMLCoder">YES</bool> |
467 | 526 | <string>SettingsViewController</string> |
468 | 527 | <string>UIResponder</string> |
469 | | - <string>{{590, 204}, {320, 480}}</string> |
| 528 | + <string>{{607, 235}, {320, 480}}</string> |
470 | 529 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
471 | 530 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
472 | 531 | <object class="NSAffineTransform"> |
473 | | - <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwy0AAA</bytes> |
| 532 | + <bytes key="NSTransformStruct">AUGgAABDFgAAA</bytes> |
474 | 533 | </object> |
475 | 534 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
476 | 535 | <object class="NSAffineTransform"> |
— | — | @@ -488,11 +547,16 @@ |
489 | 548 | <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwtIAAA</bytes> |
490 | 549 | </object> |
491 | 550 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
| 551 | + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
492 | 552 | <object class="NSAffineTransform"> |
493 | 553 | <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAwxAAAA</bytes> |
494 | 554 | </object> |
495 | 555 | <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
496 | 556 | <object class="NSAffineTransform"> |
| 557 | + <bytes key="NSTransformStruct">AUGgAABDFgAAA</bytes> |
| 558 | + </object> |
| 559 | + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
| 560 | + <object class="NSAffineTransform"> |
497 | 561 | <bytes key="NSTransformStruct">P4AAAL+AAABClAAAw9sAAA</bytes> |
498 | 562 | </object> |
499 | 563 | </object> |
— | — | @@ -513,7 +577,7 @@ |
514 | 578 | </object> |
515 | 579 | </object> |
516 | 580 | <nil key="sourceID"/> |
517 | | - <int key="maxID">58</int> |
| 581 | + <int key="maxID">63</int> |
518 | 582 | </object> |
519 | 583 | <object class="IBClassDescriber" key="IBDocument.Classes"> |
520 | 584 | <object class="NSMutableArray" key="referencedPartialClassDescriptions"> |
— | — | @@ -525,7 +589,6 @@ |
526 | 590 | <bool key="EncodedWithXMLCoder">YES</bool> |
527 | 591 | <object class="NSArray" key="dict.sortedKeys"> |
528 | 592 | <bool key="EncodedWithXMLCoder">YES</bool> |
529 | | - <string>dismissLicensePicker:</string> |
530 | 593 | <string>pickLicensePicker:</string> |
531 | 594 | <string>saveAction:</string> |
532 | 595 | <string>textFieldDidEnd:</string> |
— | — | @@ -535,14 +598,12 @@ |
536 | 599 | <string>id</string> |
537 | 600 | <string>id</string> |
538 | 601 | <string>id</string> |
539 | | - <string>id</string> |
540 | 602 | </object> |
541 | 603 | </object> |
542 | 604 | <object class="NSMutableDictionary" key="actionInfosByName"> |
543 | 605 | <bool key="EncodedWithXMLCoder">YES</bool> |
544 | 606 | <object class="NSArray" key="dict.sortedKeys"> |
545 | 607 | <bool key="EncodedWithXMLCoder">YES</bool> |
546 | | - <string>dismissLicensePicker:</string> |
547 | 608 | <string>pickLicensePicker:</string> |
548 | 609 | <string>saveAction:</string> |
549 | 610 | <string>textFieldDidEnd:</string> |
— | — | @@ -550,10 +611,6 @@ |
551 | 612 | <object class="NSMutableArray" key="dict.values"> |
552 | 613 | <bool key="EncodedWithXMLCoder">YES</bool> |
553 | 614 | <object class="IBActionInfo"> |
554 | | - <string key="name">dismissLicensePicker:</string> |
555 | | - <string key="candidateClassName">id</string> |
556 | | - </object> |
557 | | - <object class="IBActionInfo"> |
558 | 615 | <string key="name">pickLicensePicker:</string> |
559 | 616 | <string key="candidateClassName">id</string> |
560 | 617 | </object> |
— | — | @@ -571,32 +628,24 @@ |
572 | 629 | <bool key="EncodedWithXMLCoder">YES</bool> |
573 | 630 | <object class="NSArray" key="dict.sortedKeys"> |
574 | 631 | <bool key="EncodedWithXMLCoder">YES</bool> |
575 | | - <string>descriptionText</string> |
576 | | - <string>dismissButton</string> |
| 632 | + <string>gpsLabel</string> |
| 633 | + <string>gpsSwitch</string> |
577 | 634 | <string>license</string> |
578 | 635 | <string>licenseLabel</string> |
579 | | - <string>navItem</string> |
580 | 636 | <string>password</string> |
581 | 637 | <string>passwordLabel</string> |
582 | | - <string>pickerControl</string> |
583 | | - <string>pickerLabel</string> |
584 | | - <string>pickerView</string> |
585 | 638 | <string>save</string> |
586 | 639 | <string>username</string> |
587 | 640 | <string>usernameLabel</string> |
588 | 641 | </object> |
589 | 642 | <object class="NSMutableArray" key="dict.values"> |
590 | 643 | <bool key="EncodedWithXMLCoder">YES</bool> |
591 | | - <string>UIWebView</string> |
592 | | - <string>UIBarButtonItem</string> |
| 644 | + <string>UILabel</string> |
| 645 | + <string>UISwitch</string> |
593 | 646 | <string>UITextField</string> |
594 | 647 | <string>UILabel</string> |
595 | | - <string>UINavigationItem</string> |
596 | 648 | <string>UITextField</string> |
597 | 649 | <string>UILabel</string> |
598 | | - <string>UIPickerView</string> |
599 | | - <string>UILabel</string> |
600 | | - <string>UIView</string> |
601 | 650 | <string>UIButton</string> |
602 | 651 | <string>UITextField</string> |
603 | 652 | <string>UILabel</string> |
— | — | @@ -606,16 +655,12 @@ |
607 | 656 | <bool key="EncodedWithXMLCoder">YES</bool> |
608 | 657 | <object class="NSArray" key="dict.sortedKeys"> |
609 | 658 | <bool key="EncodedWithXMLCoder">YES</bool> |
610 | | - <string>descriptionText</string> |
611 | | - <string>dismissButton</string> |
| 659 | + <string>gpsLabel</string> |
| 660 | + <string>gpsSwitch</string> |
612 | 661 | <string>license</string> |
613 | 662 | <string>licenseLabel</string> |
614 | | - <string>navItem</string> |
615 | 663 | <string>password</string> |
616 | 664 | <string>passwordLabel</string> |
617 | | - <string>pickerControl</string> |
618 | | - <string>pickerLabel</string> |
619 | | - <string>pickerView</string> |
620 | 665 | <string>save</string> |
621 | 666 | <string>username</string> |
622 | 667 | <string>usernameLabel</string> |
— | — | @@ -623,12 +668,12 @@ |
624 | 669 | <object class="NSMutableArray" key="dict.values"> |
625 | 670 | <bool key="EncodedWithXMLCoder">YES</bool> |
626 | 671 | <object class="IBToOneOutletInfo"> |
627 | | - <string key="name">descriptionText</string> |
628 | | - <string key="candidateClassName">UIWebView</string> |
| 672 | + <string key="name">gpsLabel</string> |
| 673 | + <string key="candidateClassName">UILabel</string> |
629 | 674 | </object> |
630 | 675 | <object class="IBToOneOutletInfo"> |
631 | | - <string key="name">dismissButton</string> |
632 | | - <string key="candidateClassName">UIBarButtonItem</string> |
| 676 | + <string key="name">gpsSwitch</string> |
| 677 | + <string key="candidateClassName">UISwitch</string> |
633 | 678 | </object> |
634 | 679 | <object class="IBToOneOutletInfo"> |
635 | 680 | <string key="name">license</string> |
— | — | @@ -639,10 +684,6 @@ |
640 | 685 | <string key="candidateClassName">UILabel</string> |
641 | 686 | </object> |
642 | 687 | <object class="IBToOneOutletInfo"> |
643 | | - <string key="name">navItem</string> |
644 | | - <string key="candidateClassName">UINavigationItem</string> |
645 | | - </object> |
646 | | - <object class="IBToOneOutletInfo"> |
647 | 688 | <string key="name">password</string> |
648 | 689 | <string key="candidateClassName">UITextField</string> |
649 | 690 | </object> |
— | — | @@ -651,18 +692,6 @@ |
652 | 693 | <string key="candidateClassName">UILabel</string> |
653 | 694 | </object> |
654 | 695 | <object class="IBToOneOutletInfo"> |
655 | | - <string key="name">pickerControl</string> |
656 | | - <string key="candidateClassName">UIPickerView</string> |
657 | | - </object> |
658 | | - <object class="IBToOneOutletInfo"> |
659 | | - <string key="name">pickerLabel</string> |
660 | | - <string key="candidateClassName">UILabel</string> |
661 | | - </object> |
662 | | - <object class="IBToOneOutletInfo"> |
663 | | - <string key="name">pickerView</string> |
664 | | - <string key="candidateClassName">UIView</string> |
665 | | - </object> |
666 | | - <object class="IBToOneOutletInfo"> |
667 | 696 | <string key="name">save</string> |
668 | 697 | <string key="candidateClassName">UIButton</string> |
669 | 698 | </object> |
— | — | @@ -776,22 +805,6 @@ |
777 | 806 | </object> |
778 | 807 | </object> |
779 | 808 | <object class="IBPartialClassDescription"> |
780 | | - <string key="className">UIBarButtonItem</string> |
781 | | - <string key="superclassName">UIBarItem</string> |
782 | | - <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
783 | | - <string key="majorKey">IBFrameworkSource</string> |
784 | | - <string key="minorKey">UIKit.framework/Headers/UIBarButtonItem.h</string> |
785 | | - </object> |
786 | | - </object> |
787 | | - <object class="IBPartialClassDescription"> |
788 | | - <string key="className">UIBarItem</string> |
789 | | - <string key="superclassName">NSObject</string> |
790 | | - <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
791 | | - <string key="majorKey">IBFrameworkSource</string> |
792 | | - <string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string> |
793 | | - </object> |
794 | | - </object> |
795 | | - <object class="IBPartialClassDescription"> |
796 | 809 | <string key="className">UIButton</string> |
797 | 810 | <string key="superclassName">UIControl</string> |
798 | 811 | <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
— | — | @@ -816,22 +829,6 @@ |
817 | 830 | </object> |
818 | 831 | </object> |
819 | 832 | <object class="IBPartialClassDescription"> |
820 | | - <string key="className">UINavigationItem</string> |
821 | | - <string key="superclassName">NSObject</string> |
822 | | - <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
823 | | - <string key="majorKey">IBFrameworkSource</string> |
824 | | - <string key="minorKey">UIKit.framework/Headers/UINavigationBar.h</string> |
825 | | - </object> |
826 | | - </object> |
827 | | - <object class="IBPartialClassDescription"> |
828 | | - <string key="className">UIPickerView</string> |
829 | | - <string key="superclassName">UIView</string> |
830 | | - <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
831 | | - <string key="majorKey">IBFrameworkSource</string> |
832 | | - <string key="minorKey">UIKit.framework/Headers/UIPickerView.h</string> |
833 | | - </object> |
834 | | - </object> |
835 | | - <object class="IBPartialClassDescription"> |
836 | 833 | <string key="className">UIResponder</string> |
837 | 834 | <string key="superclassName">NSObject</string> |
838 | 835 | <reference key="sourceIdentifier" ref="577610225"/> |
— | — | @@ -853,6 +850,14 @@ |
854 | 851 | </object> |
855 | 852 | </object> |
856 | 853 | <object class="IBPartialClassDescription"> |
| 854 | + <string key="className">UISwitch</string> |
| 855 | + <string key="superclassName">UIControl</string> |
| 856 | + <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
| 857 | + <string key="majorKey">IBFrameworkSource</string> |
| 858 | + <string key="minorKey">UIKit.framework/Headers/UISwitch.h</string> |
| 859 | + </object> |
| 860 | + </object> |
| 861 | + <object class="IBPartialClassDescription"> |
857 | 862 | <string key="className">UITextField</string> |
858 | 863 | <string key="superclassName">UIControl</string> |
859 | 864 | <object class="IBClassDescriptionSource" key="sourceIdentifier" id="879815814"> |
— | — | @@ -915,14 +920,6 @@ |
916 | 921 | <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string> |
917 | 922 | </object> |
918 | 923 | </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> |
927 | 924 | </object> |
928 | 925 | </object> |
929 | 926 | <int key="IBDocument.localizationMode">0</int> |
Index: trunk/tools/WikiSnaps/Classes/Configuration.m |
— | — | @@ -1,9 +0,0 @@ |
2 | | -// |
3 | | -// Configuration.m |
4 | | -// |
5 | | -// Created by Derk-Jan Hartman on 14-01-11. |
6 | | -// Copyright 2011 Derk-Jan Hartman |
7 | | -// |
8 | | -// Dual-licensed MIT and BSD |
9 | | - |
10 | | -#import "Configuration.h" |
Index: trunk/tools/WikiSnaps/Classes/SettingsViewController.h |
— | — | @@ -15,24 +15,28 @@ |
16 | 16 | UITextFieldDelegate, |
17 | 17 | LicensePickerDelegate>{ |
18 | 18 | |
19 | | - IBOutlet UILabel *usernameLabel; |
20 | | - IBOutlet UILabel *passwordLabel; |
21 | | - IBOutlet UILabel *licenseLabel; |
| 19 | + IBOutlet UILabel *usernameLabel; |
| 20 | + IBOutlet UILabel *passwordLabel; |
| 21 | + IBOutlet UILabel *licenseLabel; |
| 22 | + IBOutlet UILabel *gpsLabel; |
22 | 23 | |
23 | | - IBOutlet UITextField *username; |
24 | | - IBOutlet UITextField *password; |
25 | | - IBOutlet UITextField *license; |
26 | | - IBOutlet UIButton *save; |
| 24 | + IBOutlet UITextField *username; |
| 25 | + IBOutlet UITextField *password; |
| 26 | + IBOutlet UITextField *license; |
| 27 | + IBOutlet UIButton *save; |
| 28 | + IBOutlet UISwitch *gpsSwitch; |
27 | 29 | int selectedLicense; |
28 | 30 | } |
29 | 31 | |
30 | 32 | @property (retain, nonatomic) UILabel *usernameLabel; |
31 | 33 | @property (retain, nonatomic) UILabel *passwordLabel; |
32 | 34 | @property (retain, nonatomic) UILabel *licenseLabel; |
| 35 | +@property (retain, nonatomic) UILabel *gpsLabel; |
33 | 36 | |
34 | 37 | @property (retain, nonatomic) UITextField *username; |
35 | 38 | @property (retain, nonatomic) UITextField *password; |
36 | 39 | @property (retain, nonatomic) UITextField *license; |
| 40 | +@property (retain, nonatomic) UISwitch *gpsSwitch; |
37 | 41 | @property (retain, nonatomic) UIButton *save; |
38 | 42 | |
39 | 43 | @property (retain, nonatomic) NSArray *licenses; |
Index: trunk/tools/WikiSnaps/Classes/SourcePickerViewController.m |
— | — | @@ -151,7 +151,7 @@ |
152 | 152 | |
153 | 153 | // Add a settings button etc |
154 | 154 | UIBarButtonItem *settingsButton = [[UIBarButtonItem alloc] |
155 | | - initWithTitle: NSLocalizedString( @"Settings", @"A button to go to the settings view" ) |
| 155 | + initWithTitle: NSLocalizedString( @"SettingsButton", @"A button to go to the settings view" ) |
156 | 156 | style: UIBarButtonItemStylePlain |
157 | 157 | target:self |
158 | 158 | action: @selector(settingsPressed:)]; |
— | — | @@ -172,6 +172,12 @@ |
173 | 173 | cameraAvailable = |
174 | 174 | [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]; |
175 | 175 | #endif |
| 176 | + |
| 177 | + if( ((PhotoPickerAppDelegate *)[UIApplication sharedApplication].delegate).justInstalled ) { |
| 178 | + SettingsViewController *settingsController = [[SettingsViewController alloc] init]; |
| 179 | + [self.navigationController pushViewController:settingsController animated:NO]; |
| 180 | + [settingsController release]; |
| 181 | + } |
176 | 182 | } |
177 | 183 | |
178 | 184 | |
Index: trunk/tools/WikiSnaps/Classes/SettingsViewController.m |
— | — | @@ -14,8 +14,8 @@ |
15 | 15 | |
16 | 16 | @implementation SettingsViewController |
17 | 17 | |
18 | | -@synthesize usernameLabel, passwordLabel, licenseLabel; |
19 | | -@synthesize username,password,license; |
| 18 | +@synthesize usernameLabel, passwordLabel, licenseLabel, gpsLabel; |
| 19 | +@synthesize username,password,license,gpsSwitch; |
20 | 20 | @synthesize save; |
21 | 21 | @synthesize licenses; |
22 | 22 | @synthesize selectedLicense; |
— | — | @@ -35,10 +35,11 @@ |
36 | 36 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. |
37 | 37 | - (void)viewDidLoad { |
38 | 38 | [super viewDidLoad]; |
39 | | - self.title = NSLocalizedString( @"Settings", @"Title of the settings view" ); |
| 39 | + self.title = NSLocalizedString( @"SettingsTitle", @"Title of the settings view" ); |
40 | 40 | usernameLabel.text = NSLocalizedString( @"Username", @"Label of the username textfield" ); |
41 | | - usernameLabel.text = NSLocalizedString( @"Password", @"Label of the password textfield" ); |
42 | | - usernameLabel.text = NSLocalizedString( @"License", @"Label of the license textfield" ); |
| 41 | + passwordLabel.text = NSLocalizedString( @"Password", @"Label of the password textfield" ); |
| 42 | + licenseLabel.text = NSLocalizedString( @"LicenseLabel", @"Label of the license textfield" ); |
| 43 | + gpsLabel.text = NSLocalizedString( @"Add GPS coordinates", @"Label of the gps coordinates settings switch" ); |
43 | 44 | |
44 | 45 | PhotoPickerAppDelegate *appDelegate = |
45 | 46 | (PhotoPickerAppDelegate *) [UIApplication sharedApplication].delegate; |
— | — | @@ -111,6 +112,7 @@ |
112 | 113 | |
113 | 114 | - (void)loadData { |
114 | 115 | self.username.text = [[NSUserDefaults standardUserDefaults] valueForKey: COMMONS_USERNAME_KEY]; |
| 116 | + self.gpsSwitch.on = [[NSUserDefaults standardUserDefaults] boolForKey: GEOTAGGING_KEY]; |
115 | 117 | |
116 | 118 | NSString *licenseDefault = [[NSUserDefaults standardUserDefaults] stringForKey: COMMONS_LICENSE_KEY]; |
117 | 119 | NSEnumerator *enumerator = [self.licenses objectEnumerator]; |
— | — | @@ -146,7 +148,9 @@ |
147 | 149 | |
148 | 150 | /* Save the data */ |
149 | 151 | [[NSUserDefaults standardUserDefaults] setObject:self.username.text forKey:COMMONS_USERNAME_KEY]; |
150 | | - |
| 152 | + [[NSUserDefaults standardUserDefaults] setBool:gpsSwitch.on forKey:GEOTAGGING_KEY]; |
| 153 | + [(PhotoPickerAppDelegate *) [UIApplication sharedApplication].delegate startLocationUpdates]; |
| 154 | + |
151 | 155 | NSDictionary *aLicense = [self.licenses objectAtIndex:self.selectedLicense]; |
152 | 156 | [[NSUserDefaults standardUserDefaults] setObject:[aLicense objectForKey:@"short"] forKey:COMMONS_LICENSE_KEY]; |
153 | 157 | |
Index: trunk/tools/WikiSnaps/Classes/PhotoPickerAppDelegate.h |
— | — | @@ -45,8 +45,11 @@ |
46 | 46 | |
47 | 47 | @property (nonatomic, retain) NSArray *licenses; |
48 | 48 | |
49 | | -@property (nonatomic, assign) CLLocationManager *locationManager; |
50 | 49 | @property (nonatomic, retain) CLLocation *lastLocation; |
51 | 50 | |
| 51 | +- (void)startLocationUpdates; |
| 52 | +- (void)stopLocationUpdates; |
| 53 | + |
| 54 | + |
52 | 55 | @end |
53 | 56 | |
Index: trunk/tools/WikiSnaps/Classes/LicensePickerViewController.m |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. |
30 | 30 | - (void)viewDidLoad { |
31 | 31 | [super viewDidLoad]; |
32 | | - navItem.title = NSLocalizedString( @"License", @"Title for the license picker" ); |
| 32 | + navItem.title = NSLocalizedString( @"License Title", @"Title for the license picker" ); |
33 | 33 | dismissButton.title = NSLocalizedString( @"Select", "Title for the select button in license picker" ); |
34 | 34 | dismissButton.target = self; |
35 | 35 | dismissButton.action = @selector( dismissLicensePicker: ); |
Index: trunk/tools/WikiSnaps/Classes/PhotoPickerAppDelegate.m |
— | — | @@ -11,9 +11,9 @@ |
12 | 12 | |
13 | 13 | |
14 | 14 | @interface PhotoPickerAppDelegate () |
| 15 | + @property (nonatomic, assign) CLLocationManager *locationManager; |
| 16 | + |
15 | 17 | - (void)checkIfJustInstalled; |
16 | | - - (void)startLocationUpdates; |
17 | | - - (void)stopLocationUpdates; |
18 | 18 | @end |
19 | 19 | |
20 | 20 | |
— | — | @@ -79,8 +79,7 @@ |
80 | 80 | // Create the location manager if this object does not |
81 | 81 | // already have one. |
82 | 82 | if( [CLLocationManager locationServicesEnabled] && |
83 | | - //[[NSUserDefaults standardUserDefaults] boolForKey: GEOTAGGING_KEY] ) |
84 | | - TRUE ) |
| 83 | + [[NSUserDefaults standardUserDefaults] boolForKey: GEOTAGGING_KEY] ) |
85 | 84 | { |
86 | 85 | if (nil == self.locationManager) |
87 | 86 | self.locationManager = [[CLLocationManager alloc] init]; |
— | — | @@ -144,6 +143,8 @@ |
145 | 144 | [defaults setBool:YES forKey:@"installed"]; |
146 | 145 | [defaults setBool:NO forKey:GEOTAGGING_KEY]; |
147 | 146 | } |
| 147 | + |
| 148 | + |
148 | 149 | } |
149 | 150 | |
150 | 151 | |