소스 검색

Fix some ui issue
Fix thread issue when offline download

Ray Zhang 2 년 전
부모
커밋
23c84f53df

+ 2 - 2
RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/project.pbxproj

@@ -2473,7 +2473,7 @@
 				CODE_SIGN_ENTITLEMENTS = "HMLG Scan Order/HMLG Scan Order.entitlements";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 54393;
+				CURRENT_PROJECT_VERSION = 54495;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2519,7 +2519,7 @@
 				CODE_SIGN_ENTITLEMENTS = "HMLG Scan Order/HMLG Scan Order.entitlements";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 54393;
+				CURRENT_PROJECT_VERSION = 54495;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>HMLG Scan Order.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>3</integer>
+			<integer>2</integer>
 		</dict>
 	</dict>
 </dict>

+ 4 - 440
RedAnt ERP Mobile/HMLG Scan Order/MainViewController.m

@@ -1015,10 +1015,7 @@
     ScannerViewController * scannerVC =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ScannerViewController"];
     
     
-//    LoginViewController * loginvc =[[UIStoryboard storyboardWithName:@"SO" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginViewController"];
-//        ScanOrderScanModelViewController *scanresult = [[UIStoryboard storyboardWithName:@"SO" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanOrderScanModelViewController"];
-    
-    
+
     ScanOrderModelListViewController* scanresult = [[UIStoryboard storyboardWithName:@"SO" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanOrderModelListViewController"];
     scannerVC.resultvc = scanresult;
     [self.navigationController pushViewController:scannerVC animated:true];
@@ -1052,52 +1049,6 @@
         return;
 
 
-//    if([self.current_VC isKindOfClass:[OrderListViewController class]])
-//        return;
-
-
-//    UIApplication * app = [UIApplication sharedApplication];
-//    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
-//    if(appDelegate.bLogin==false)
-//    {
-//        LoginViewController * loginvc =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginViewController"];
-//        //        loginvc.delegate = self;
-//        //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-//
-//        loginvc.returnValue = ^(bool blogin){
-//
-//
-//            if(blogin)
-//            {
-//                [self checklogin:true];
-//
-//
-//                [self flipFromViewController:self.current_VC toViewController:self.watchListViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
-//            }
-//
-//
-//        };
-//
-//        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:loginvc] ;
-//
-//
-//
-//
-//
-//        //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
-//
-//        navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-//        [self presentViewController:navi animated:YES completion:^{
-//
-//            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
-//
-//            DebugLog(@"LoginViewController present.........");
-//
-//            //   self.btop = false;
-//            //  <#code#>
-//        }];
-//    }
-//    else
     [self flipFromViewController:self.current_VC toViewController:self.scanHistoryViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
 
 }
@@ -1386,7 +1337,7 @@
 
 
 
-
+        
 
         //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
 
@@ -1836,394 +1787,7 @@
         return;
     [self clearSelected];
     self.btncart.selected = true;
-//
-//
-//    UIApplication * app = [UIApplication sharedApplication];
-//    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
-// //   MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
-//    if(appDelegate.bLogin==false&& !RASingleton.sharedInstance.enable_OfflineOrder)
-//    {
-//
-//        LoginViewController * loginvc =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginViewController"];
-//        //        loginvc.delegate = self;
-//        //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-//
-//        loginvc.returnValue = ^(bool blogin){
-//
-//
-//            //            UIApplication * app = [UIApplication sharedApplication];
-//            //            AppDelegate *appDelegate = (AppDelegate *)[app delegate];
-//
-//
-//
-//
-//            if(blogin)
-//            {
-//                if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
-//                {
-//
-//                    [self checklogin:false];
-//                    if(appDelegate.can_create_order)
-//                    {
-//
-//                        NSString* msg =@"";
-//                        if(appDelegate.contact_id.length>0)
-//                        {
-//                            msg = [msg stringByAppendingString:@"\n\nCustomer:"];
-//                            msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
-//
-//                        }
-//
-//                        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Switch To Cart" message:msg preferredStyle:UIAlertControllerStyleAlert];
-//
-//                        UIAlertAction *action_1 = [UIAlertAction actionWithTitle:@"Check for saved order" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
-//                            //open exist
-//
-//                            ScanOrderListViewController* ovc =[ [UIStoryboard storyboardWithName:@"ERP_Mobile_Order" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanOrderListViewController"];
-//                            ovc.showNavibar = true;
-//                            ovc.selectOrder = ^(NSMutableDictionary* order_detail){
-//                                if(appDelegate.order_code==nil)
-//                                {
-//                                    [self neworderforCart];
-//                                }
-//                                else
-//                                {
-//                                    self.previous_VC = self.current_VC;
-//                                    [self flipFromViewController:self.current_VC toViewController:self.cartViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
-//
-//                                    [self checklogin:true];
-//
-//                                }
-//
-//                            };
-////                            ovc.init_style = OL_OPEN;
-//                            ovc.onCancel = ^(){
-//
-//                                [self checklogin:true];
-//
-//                            };
-//                            ovc.title = @"SAVED ORDER";
-//                            [self.navigationController pushViewController:ovc animated:true];
-//                        }];
-//                         UIAlertAction *action_2 = [UIAlertAction actionWithTitle:@"Create new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-//                             //create new;
-//
-//                             if(appDelegate.customerInfo==nil)// select contact if current contact not exist
-//                             {
-//
-//                                 ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
-//                                 cvc.showNavibar = true;
-//                                 cvc.contact_type = @"Sales_Order_Customer";
-//                                 cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
-//
-//                                     appDelegate.contact_id=[value valueForKey:@"customer_cid"];
-//                                     appDelegate.customerInfo = value;
-//
-//
-//                                     if(appDelegate.order_code==nil)
-//                                         [self neworderforCart];
-//
-//
-//                                 };
-//
-//                                 cvc.onCancel = ^(){
-//
-//                                     [RAUtils message_box:@"" message:@"Cannot create order without customer infomation." completion:nil];
-//
-//
-//
-//                                 };
-//                                 cvc.onReset = ^(){
-//                                     [self checklogin:true];
-//                                 };
-//
-//                                 [self.navigationController pushViewController:cvc animated:true];
-//                             }
-//                             else
-//                             {
-//                                 [self neworderforCart];
-//                             }
-//
-//                         }];
-//                         UIAlertAction *action_3 = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
-//
-//
-//
-//                         }];
-//
-//                         [alertController addAction:action_1];
-//                         [alertController addAction:action_2];
-//                         [alertController addAction:action_3];
-//
-//
-//                         [self presentViewController:alertController animated:YES completion:nil];
-////                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch To Cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil),NSLocalizedString(@"Create new order", nil), nil];
-////
-////
-////
-////                        // alert.
-////                        [alert show];
-//                    }
-//                    else
-//                    {
-//
-//                        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Switch To Cart" message:@"Do you want to switch to a pending order?" preferredStyle:UIAlertControllerStyleAlert];
-//
-//
-//                         UIAlertAction *action_2 = [UIAlertAction actionWithTitle:@"Check for saved order" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-//                             //open exist
-//
-//                             ScanOrderListViewController* ovc =[ [UIStoryboard storyboardWithName:@"ERP_Mobile_Order" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanOrderListViewController"];
-//                             ovc.showNavibar = true;
-//                             ovc.selectOrder = ^(NSMutableDictionary* order_detail){
-//                                 if(appDelegate.order_code==nil)
-//                                 {
-//                                     [self neworderforCart];
-//                                 }
-//                                 else
-//                                 {
-//                                     self.previous_VC = self.current_VC;
-//                                     [self flipFromViewController:self.current_VC toViewController:self.cartViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
-//
-//                                     [self checklogin:true];
-//
-//                                 }
-//
-//                             };
-////                             ovc.init_style = OL_OPEN;
-//                             ovc.onCancel = ^(){
-//
-//                                 [self checklogin:true];
-//
-//                             };
-//                             ovc.title = @"SAVED ORDER";
-//                             [self.navigationController pushViewController:ovc animated:true];
-//                         }];
-//                         UIAlertAction *action_3 = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
-//
-//
-//
-//                         }];
-//
-//
-//                         [alertController addAction:action_2];
-//                         [alertController addAction:action_3];
-//
-//
-//                         [self presentViewController:alertController animated:YES completion:nil];
-//
-//
-////                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch To Cart", nil) message:NSLocalizedString(@"Do you want to switch to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil), nil];
-////
-////                        // alert.
-////                        [alert show];
-//                    }
-//                }
-////                else
-////                {
-////                    [self checklogin:true];
-////                    self.previous_VC = self.current_VC;
-////                    [self flipFromViewController:self.current_VC toViewController:self.cartViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
-////                }
-//            }
-//
-//            //            self.offset = 0;
-//            //            [self.content_data removeAllObjects];
-//            //            [self loadpage];
-//            //
-//            //            [[self navigationController] setNavigationBarHidden:YES animated:NO];
-//
-//        };
-//
-//        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:loginvc] ;
-//
-//
-//
-//
-//
-//        //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
-//
-//        navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-//        [self presentViewController:navi animated:YES completion:^{
-//
-//            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
-//
-//            DebugLog(@"LoginViewController present.........");
-//
-//            //   self.btop = false;
-//            //  <#code#>
-//        }];
-//    }
-//    else
-//    {
-////        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
-//        if(appDelegate.order_code==nil)
-//        {
-////            [self checklogin:false];
-//            if(appDelegate.can_create_order)
-//            {
-//                NSString* msg =@"";
-//                if(appDelegate.contact_id.length>0)
-//                {
-//                    msg = [msg stringByAppendingString:@"\n\nCustomer:"];
-//                    msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
-//
-//                }
-//
-//                UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Switch To Cart" message:msg preferredStyle:UIAlertControllerStyleAlert];
-//
-//                UIAlertAction *action_1 = [UIAlertAction actionWithTitle:@"Check for saved order" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
-//                    //open exist
-//
-//                    ScanOrderListViewController* ovc =[ [UIStoryboard storyboardWithName:@"ERP_Mobile_Order" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanOrderListViewController"];
-//                    ovc.showNavibar = true;
-//                    ovc.selectOrder = ^(NSMutableDictionary* order_detail){
-//                        if(appDelegate.order_code==nil)
-//                        {
-//                            [self neworderforCart];
-//                        }
-//                        else
-//                        {
-//                            self.previous_VC = self.current_VC;
-//                            [self flipFromViewController:self.current_VC toViewController:self.cartViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
-//
-//                            [self checklogin:true];
-//
-//                        }
-//
-//                    };
-////                    ovc.init_style = OL_OPEN;
-//                    ovc.onCancel = ^(){
-//
-//                        [self checklogin:true];
-//
-//                    };
-//                    ovc.title = @"SAVED ORDER";
-//                    [self.navigationController pushViewController:ovc animated:true];
-//                }];
-//                 UIAlertAction *action_2 = [UIAlertAction actionWithTitle:@"Create new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-//                     //create new;
-//
-//                     if(appDelegate.customerInfo==nil)// select contact if current contact not exist
-//                     {
-//
-//                         ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
-//                         cvc.showNavibar = true;
-//                         cvc.contact_type = @"Sales_Order_Customer";
-//                         cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
-//
-//                             appDelegate.contact_id=[value valueForKey:@"customer_cid"];
-//                             appDelegate.customerInfo = value;
-//
-//
-//                             if(appDelegate.order_code==nil)
-//                                 [self neworderforCart];
-//
-//
-//                         };
-//
-//                         cvc.onCancel = ^(){
-//
-//                             [RAUtils message_box:@"" message:@"Cannot create order without customer infomation." completion:nil];
-//
-//
-//
-//                         };
-//                         cvc.onReset = ^(){
-//                             [self checklogin:true];
-//                         };
-//
-//                         [self.navigationController pushViewController:cvc animated:true];
-//                     }
-//                     else
-//                     {
-//                         [self neworderforCart];
-//                     }
-//
-//                 }];
-//                 UIAlertAction *action_3 = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
-//
-//
-//
-//                 }];
-//
-//                 [alertController addAction:action_1];
-//                 [alertController addAction:action_2];
-//                 [alertController addAction:action_3];
-//
-//
-//                 [self presentViewController:alertController animated:YES completion:nil];
-//
-//
-////                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil),NSLocalizedString(@"Create new order", nil), nil];
-////
-////                // alert.
-////                [alert show];
-//            }
-//            else
-//            {
-//                 UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Switch To Cart" message:@"Do you want to switch to a pending order?" preferredStyle:UIAlertControllerStyleAlert];
-//
-//
-//                  UIAlertAction *action_2 = [UIAlertAction actionWithTitle:@"Switch to pending order" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-//                      //open exist
-//
-//                      ScanOrderListViewController* ovc =[ [UIStoryboard storyboardWithName:@"ERP_Mobile_Order" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanOrderListViewController"];
-//                      ovc.showNavibar = true;
-//                      ovc.selectOrder = ^(NSMutableDictionary* order_detail){
-//                          if(appDelegate.order_code==nil)
-//                          {
-//                              [self neworderforCart];
-//                          }
-//                          else
-//                          {
-//                              self.previous_VC = self.current_VC;
-//                              [self flipFromViewController:self.current_VC toViewController:self.cartViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
-//
-//                              [self checklogin:true];
-//
-//                          }
-//
-//                      };
-////                      ovc.init_style = OL_OPEN;
-//                      ovc.onCancel = ^(){
-//
-//                          [self checklogin:true];
-//
-//                      };
-//                      ovc.title = @"SAVED ORDER";
-//                      [self.navigationController pushViewController:ovc animated:true];
-//                  }];
-//                  UIAlertAction *action_3 = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
-//
-//
-//
-//                  }];
-//
-//
-//                  [alertController addAction:action_2];
-//                  [alertController addAction:action_3];
-//
-//
-//                  [self presentViewController:alertController animated:YES completion:nil];
-//
-////                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Switch to cart", nil) message:NSLocalizedString(@"Do you want to Switch to a pending order?", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Switch to pending order", nil), nil];
-////
-////                // alert.
-////                [alert show];
-//            }
-//        }
-//        else
-//        {
-//
-//                    self.previous_VC = self.current_VC;
-//                    [self flipFromViewController:self.current_VC toViewController:self.cartViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
-//
-//
-//
-//        }
-//    }
-//
+
                         self.previous_VC = self.current_VC;
                         [self flipFromViewController:self.current_VC toViewController:self.cartViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
     
@@ -2962,7 +2526,7 @@
         UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:offlineVC] ;
         
         
-        
+        navi.modalInPresentation=true;
         
         
         //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];

+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order/config.h

@@ -17,7 +17,7 @@
 #define RA_NOTIFICATION
 
 # ifdef DEBUG
-#define test_server
+//#define test_server
 # endif
 
 #define exception_switch 1

+ 6 - 51
RedAnt ERP Mobile/common/AppDelegateBase.m

@@ -1716,7 +1716,7 @@ void UncaughtExceptionHandler(NSException *exception) {
         UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:syncVC] ;
         
         
-        
+        navi.modalInPresentation=true;
         
         
         //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
@@ -1738,55 +1738,6 @@ void UncaughtExceptionHandler(NSException *exception) {
         NSArray* arr_order=nil;
         arr_order=[OLDataProvider enumOfflineOrder];
         
-        //        if(arr_order.count>0)
-        //        {
-        //
-        //            {
-        //                SelectUploadOrderViewController * vc =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SelectUploadOrderViewController"];
-        //                vc.returnValue = ^(NSArray* SelectedOrder){
-        //
-        //                    [self upload_offline:ver useInternalAddress:buseinternaladdress orderid:SelectedOrder];
-        //                    SyncControlPanelViewController * syncVC =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SyncControlPanelViewController"];
-        //                    syncVC.action_string=@"Download";
-        //                    UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:syncVC] ;
-        //
-        //
-        //
-        //
-        //
-        //                    //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
-        //
-        //                    navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
-        //                    [parent presentViewController:navi animated:YES completion:^{
-        //
-        //                        //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
-        //
-        //                        DebugLog(@"about present.........");
-        //
-        //                        //   self.btop = false;
-        //                        //  <#code#>
-        //                    }];
-        //                };
-        //
-        //                UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:vc] ;
-        //
-        //
-        //
-        //
-        //
-        //
-        //                navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
-        //                [parent presentViewController:navi animated:YES completion:^{
-        //
-        //
-        //                }];
-        //            }
-        //
-        //
-        //        }
-        //        else
-        //        {
-        
 
         NSMutableDictionary* add_params=[NSMutableDictionary new];
         add_params[@"user"]=self.user;
@@ -1796,6 +1747,7 @@ void UncaughtExceptionHandler(NSException *exception) {
         SyncControlPanelViewController * syncVC =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SyncControlPanelViewController"];
         syncVC.action_string=@"Download";
         UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:syncVC] ;
+        navi.modalInPresentation=true;
         navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
         [parent presentViewController:navi animated:YES completion:^{
             
@@ -4736,7 +4688,10 @@ void UncaughtExceptionHandler(NSException *exception) {
                 default:
                     break;
             }
-            [self download_offline:true checkdiskspace:false];
+            dispatch_sync(dispatch_get_main_queue(), ^{
+                [self download_offline:true checkdiskspace:false];
+            });
+            
         }
 
 

+ 1 - 1
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -2754,7 +2754,7 @@
         
         
         
-        
+        navi.modalInPresentation=true;
         
         //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
         

+ 1 - 1
RedAnt ERP Mobile/common/Functions/offline/OfflineSettingViewController.h

@@ -15,7 +15,7 @@
 @property (strong, nonatomic) IBOutlet UILabel *label_cachesize;
 @property (strong, nonatomic) IBOutlet UIButton *btn_checkupdate;
 @property (strong, nonatomic) IBOutlet UIButton *btn_submitlocal;
-@property (strong, nonatomic) IBOutlet UISwitch *switch_internal_address;
+@property (strong, nonatomic) IBOutlet UISwitch *switch_full_update;
 @property (strong, nonatomic) IBOutlet UILabel *label_sync;
 
 @property bool bunlock;

+ 12 - 46
RedAnt ERP Mobile/common/Functions/offline/OfflineSettingViewController.m

@@ -157,29 +157,13 @@
                     
                     NSString*  ver = [defaults stringForKey:@"OfflineVer"] ;
                     
+                    if(self.switch_full_update.isOn)
+                        ver = nil;
+                    
                     if(sender==nil)
                     {
-                        [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];
-//                        SyncControlPanelViewController * syncVC =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SyncControlPanelViewController"];
-//                        syncVC.action_string=@"Download";
-//                        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:syncVC] ;
-//                        
-//                        
-//                        
-//                        
-//                        
-//                        //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
-//                        
-//                        navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-//                        [self presentViewController:navi animated:YES completion:^{
-//                            
-//                            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
-//                            
-//                            DebugLog(@"about present.........");
-//                            
-//                            //   self.btop = false;
-//                            //  <#code#>
-//                        }];
+                        [appDelegate check_offline:ver useInternalAddress:false parentvc:self];
+
                     }
                     else
                     {
@@ -188,31 +172,10 @@
                         
                         
                         UIAlertAction *actionTwo = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-                            [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];
-                            
-                            
-//                            SyncControlPanelViewController * syncVC =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"SyncControlPanelViewController"];
-//                            syncVC.action_string=@"Download";
-//                            UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:syncVC] ;
-//                            
-//                            
-//                            
-//                            
-//                            
-//                            //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
-//                            
-//                            navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-//                            [self presentViewController:navi animated:YES completion:^{
-//                                
-//                                //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
-//                                
-//                                DebugLog(@"about present.........");
-//                                
-//                                //   self.btop = false;
-//                                //  <#code#>
-//                            }];
+                            [appDelegate check_offline:ver useInternalAddress:false parentvc:self];
                             
                             
+
                             
                             
                         }];
@@ -307,9 +270,12 @@
             ver = nil;
         }
         
+        if(self.switch_full_update.isOn)
+            ver = nil;
+        
         if(sender==nil)
         {
-            [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];
+            [appDelegate check_offline:ver useInternalAddress:false parentvc:self];
 
         }
         else
@@ -319,7 +285,7 @@
             
             
             UIAlertAction *actionTwo = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-                [appDelegate check_offline:ver useInternalAddress:self.switch_internal_address.isOn parentvc:self];
+                [appDelegate check_offline:ver useInternalAddress:false parentvc:self];
                 
                 
 

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/LoginViewController.m

@@ -395,7 +395,7 @@
                                     UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:offlineVC] ;
                                     
                                     
-                                    
+                                    navi.modalInPresentation=true;
                                     
                                     
                                     //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];

+ 6 - 6
RedAnt ERP Mobile/iSales-NPD/Base.lproj/OLM.storyboard

@@ -24,8 +24,8 @@
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Use internal address" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Baf-ru-Ueq">
-                                <rect key="frame" x="20" y="108" width="156.5" height="21"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Request full data" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Baf-ru-Ueq">
+                                <rect key="frame" x="20" y="108" width="128" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
@@ -138,6 +138,7 @@
                             <constraint firstItem="9fI-uo-0D5" firstAttribute="centerY" secondItem="iMj-3v-3eE" secondAttribute="centerY" id="DZp-4t-8ZO"/>
                             <constraint firstItem="Vzg-50-bc2" firstAttribute="centerY" secondItem="J6c-cK-Ihd" secondAttribute="centerY" id="FIS-zF-1En"/>
                             <constraint firstItem="4VN-I0-qDk" firstAttribute="leading" secondItem="iMj-3v-3eE" secondAttribute="leading" id="FWf-XI-w2t"/>
+                            <constraint firstItem="9fI-uo-0D5" firstAttribute="trailing" secondItem="lgu-mf-cTC" secondAttribute="trailing" id="Fgr-zX-Fd5"/>
                             <constraint firstItem="jns-5C-X4w" firstAttribute="centerY" secondItem="o7T-n9-rhA" secondAttribute="centerY" id="HT0-VQ-26B"/>
                             <constraint firstItem="iMj-3v-3eE" firstAttribute="top" secondItem="Dy8-hn-8hv" secondAttribute="top" constant="37" id="M83-f8-Ku6"/>
                             <constraint firstItem="cIN-uF-BHa" firstAttribute="leading" secondItem="MNF-V6-2fB" secondAttribute="trailing" constant="539" id="NIb-s3-3jb"/>
@@ -146,7 +147,6 @@
                             <constraint firstItem="Vzg-50-bc2" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="J6c-cK-Ihd" secondAttribute="trailing" constant="8" symbolic="YES" id="QzQ-hA-MDW"/>
                             <constraint firstItem="kcI-2q-g1r" firstAttribute="top" secondItem="4VN-I0-qDk" secondAttribute="bottom" constant="28" id="Sge-sp-Ia1"/>
                             <constraint firstItem="Vzg-50-bc2" firstAttribute="trailing" secondItem="jns-5C-X4w" secondAttribute="trailing" id="Txv-6t-cq0"/>
-                            <constraint firstItem="lgu-mf-cTC" firstAttribute="leading" secondItem="Baf-ru-Ueq" secondAttribute="trailing" constant="40.5" id="WUI-jk-vkj"/>
                             <constraint firstItem="J6c-cK-Ihd" firstAttribute="centerY" secondItem="4VN-I0-qDk" secondAttribute="centerY" id="XFX-zx-zZp"/>
                             <constraint firstItem="MNF-V6-2fB" firstAttribute="top" secondItem="kcI-2q-g1r" secondAttribute="bottom" constant="28" id="Xgt-t9-2Od"/>
                             <constraint firstItem="MNF-V6-2fB" firstAttribute="leading" secondItem="iMj-3v-3eE" secondAttribute="leading" id="ZPj-6Q-Ykk"/>
@@ -169,7 +169,7 @@
                         <outlet property="label_cachesize" destination="J6c-cK-Ihd" id="cpk-YX-rlK"/>
                         <outlet property="label_sync" destination="mAv-YK-pnD" id="Yjp-N4-owz"/>
                         <outlet property="label_ver" destination="Avj-sE-gE6" id="vsF-b2-8kY"/>
-                        <outlet property="switch_internal_address" destination="lgu-mf-cTC" id="8ta-De-UeF"/>
+                        <outlet property="switch_full_update" destination="lgu-mf-cTC" id="A4h-vs-7Wy"/>
                         <outlet property="switch_offline" destination="9fI-uo-0D5" id="jmI-9t-4XI"/>
                     </connections>
                 </viewController>
@@ -349,7 +349,7 @@
                                                         <constraint firstAttribute="width" constant="21" id="hbc-1I-70J"/>
                                                     </constraints>
                                                     <state key="normal" image="button:hrK-DY-RbO:image"/>
-                                                    <state key="selected" image="C0ECEA11-F90E-455B-B29F-7674A15F20B3"/>
+                                                    <state key="selected" image="84FF1FFC-4630-457E-97ED-1E2B4F01CE88"/>
                                                     <connections>
                                                         <action selector="checkButtonClick:" destination="XXr-fU-67o" eventType="touchUpInside" id="KeU-ld-H4J"/>
                                                     </connections>
@@ -1097,7 +1097,7 @@
         </scene>
     </scenes>
     <resources>
-        <image name="C0ECEA11-F90E-455B-B29F-7674A15F20B3" width="24" height="24">
+        <image name="84FF1FFC-4630-457E-97ED-1E2B4F01CE88" width="24" height="24">
             <mutableData key="keyedArchiveRepresentation">
 YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05T
 S2V5ZWRBcmNoaXZlctEICVRyb290gAGuCwwZGh8UJCkqMTQ3PUBVJG51bGzWDQ4PEBESExQVFhcYVk5T