diff --git a/contrib/mobile/iOS/Onelab/ModelViewController.mm b/contrib/mobile/iOS/Onelab/ModelViewController.mm index c8159c026f981b6edf040ea10013867f1e66112b..ed9558aeff834681f3b1969622934cb1ace9594c 100644 --- a/contrib/mobile/iOS/Onelab/ModelViewController.mm +++ b/contrib/mobile/iOS/Onelab/ModelViewController.mm @@ -18,7 +18,6 @@ @end @interface ModelViewController () -@property (strong, nonatomic) UIPopoverController *masterPopoverController; - (void)configureView; @end @@ -34,10 +33,6 @@ // Update the view. [self configureView]; } - - if (self.masterPopoverController != nil) { - [self.masterPopoverController dismissPopoverAnimated:YES]; - } } - (void)configureView @@ -50,7 +45,6 @@ -(void)viewWillAppear:(BOOL)animated { - //if(self.initialModel != nil) { if([[UIDevice currentDevice].model isEqualToString:@"iPad"] || [[UIDevice currentDevice].model isEqualToString:@"iPad Simulator"]) { _loadingAlert = [[UIAlertView alloc] initWithTitle:@"Please wait..." message: @"The model is loading" delegate: self cancelButtonTitle: nil otherButtonTitles: nil]; [_loadingAlert show]; @@ -316,7 +310,7 @@ -(void)addError:(std::string)msg { - [_errors addObject:[NSString stringWithCString:msg.c_str() encoding:[NSString defaultCStringEncoding]]]; + [_errors addObject:[NSString stringWithCString:msg.c_str() encoding:NSUTF8StringEncoding]]; } -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex @@ -335,20 +329,13 @@ #pragma mark - Split view -- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController -{ - barButtonItem.title = NSLocalizedString(@"Parameters", @"Parameters"); - [self.navigationItem setLeftBarButtonItem:barButtonItem]; - self.masterPopoverController = popoverController; -} -- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem +-(BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation { - // Called when the view is shown again in the split view, invalidating the button and popover controller. - [self.navigationItem setLeftBarButtonItem:nil animated:YES]; - self.masterPopoverController = nil; + return NO; } + void messageFromCpp (void *self, std::string level, std::string msg) { if(level == "RequestRender"){ @@ -356,7 +343,7 @@ void messageFromCpp (void *self, std::string level, std::string msg) [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshParameters" object:nil]; } else if(level == "Progress"){ - [(__bridge id)self performSelectorOnMainThread:@selector(setProgress:) withObject:[NSString stringWithCString:msg.c_str() encoding:[NSString defaultCStringEncoding]] waitUntilDone:YES]; + [(__bridge id)self performSelectorOnMainThread:@selector(setProgress:) withObject:[NSString stringWithCString:msg.c_str() encoding:NSUTF8StringEncoding] waitUntilDone:YES]; } else if(level == "Error") [(__bridge id)self addError:msg]; diff --git a/contrib/mobile/iOS/Onelab/OptionsViewController.mm b/contrib/mobile/iOS/Onelab/OptionsViewController.mm index 99a4ae4a3d0e951cde763d9ec9bc227825b5446e..012d8a822b72c0e3031dbfa102aa0e10052e3ac9 100644 --- a/contrib/mobile/iOS/Onelab/OptionsViewController.mm +++ b/contrib/mobile/iOS/Onelab/OptionsViewController.mm @@ -188,7 +188,7 @@ [showHide setTag:i]; [showHide addTarget:self action:@selector(PViewVisible:) forControlEvents:UIControlEventValueChanged]; [lbl setBackgroundColor: [UIColor clearColor]]; - [lbl setText:[NSString stringWithCString:PView::list[i]->getData()->getName().c_str() encoding:[NSString defaultCStringEncoding]]]; + [lbl setText:[NSString stringWithCString:PView::list[i]->getData()->getName().c_str() encoding:NSUTF8StringEncoding]]; [cell addSubview:showHide]; [cell addSubview:lbl]; } diff --git a/contrib/mobile/iOS/Onelab/Parameter.mm b/contrib/mobile/iOS/Onelab/Parameter.mm index 5ac5cba4f882c41bb57680e1789bd8c86c07c105..47974c805cc5a453fdb71c7fc9637e18904ac8ce 100644 --- a/contrib/mobile/iOS/Onelab/Parameter.mm +++ b/contrib/mobile/iOS/Onelab/Parameter.mm @@ -59,8 +59,8 @@ self = [super init]; if(self){ label.alpha = (string.getReadOnly())? 0.439216f : 1.0f; - [label setText:[NSString stringWithCString:string.getShortName().c_str() encoding:[NSString defaultCStringEncoding]]]; - name = [NSString stringWithCString:string.getName().c_str() encoding:[NSString defaultCStringEncoding]]; + [label setText:[NSString stringWithCString:string.getShortName().c_str() encoding:NSUTF8StringEncoding]]; + name = [NSString stringWithCString:string.getName().c_str() encoding:NSUTF8StringEncoding]; button = [UIButton buttonWithType:UIButtonTypeSystem]; [button addTarget:self action:@selector(selectValue) forControlEvents:UIControlEventTouchDown]; [button setTitle:[NSString stringWithFormat:@"%s", string.getValue().c_str()] forState:UIControlStateNormal]; @@ -131,8 +131,8 @@ self = [super init]; if(self) { label.alpha = (number.getReadOnly())? 0.439216f : 1.0f; - [label setText:[NSString stringWithCString:number.getShortName().c_str() encoding:[NSString defaultCStringEncoding]]]; - name = [NSString stringWithCString:number.getName().c_str() encoding:[NSString defaultCStringEncoding]]; + [label setText:[NSString stringWithCString:number.getShortName().c_str() encoding:NSUTF8StringEncoding]]; + name = [NSString stringWithCString:number.getName().c_str() encoding:NSUTF8StringEncoding]; button = [UIButton buttonWithType:UIButtonTypeSystem]; [button addTarget:self action:@selector(selectValue) forControlEvents:UIControlEventTouchDown]; [button setTitle:[NSString stringWithFormat:@"%s", number.getValueLabel(number.getValue()).c_str()] forState:UIControlStateNormal]; @@ -218,8 +218,8 @@ self = [super init]; if(self) { label.alpha = (number.getReadOnly())? 0.439216f : 1.0f; - [label setText:[NSString stringWithCString:number.getShortName().c_str() encoding:[NSString defaultCStringEncoding]]]; - name = [NSString stringWithCString:number.getName().c_str() encoding:[NSString defaultCStringEncoding]]; + [label setText:[NSString stringWithCString:number.getShortName().c_str() encoding:NSUTF8StringEncoding]]; + name = [NSString stringWithCString:number.getName().c_str() encoding:NSUTF8StringEncoding]; checkbox = [[UISwitch alloc] init]; [checkbox setOn:(number.getValue() == 1)]; [checkbox addTarget:self action:@selector(valueChange:) forControlEvents:UIControlEventValueChanged]; @@ -273,7 +273,7 @@ { self = [super init]; if(self) { - name = [NSString stringWithCString:number.getName().c_str() encoding:[NSString defaultCStringEncoding]]; + name = [NSString stringWithCString:number.getName().c_str() encoding:NSUTF8StringEncoding]; label.alpha = (number.getReadOnly())? 0.439216f : 1.0f; stepper = [[UIStepper alloc] init]; [stepper setValue:number.getValue()]; @@ -328,7 +328,7 @@ self = [super init]; if(self) { label.alpha = (number.getReadOnly())? 0.439216f : 1.0f; - name = [NSString stringWithCString:number.getName().c_str() encoding:[NSString defaultCStringEncoding]]; + name = [NSString stringWithCString:number.getName().c_str() encoding:NSUTF8StringEncoding]; slider = [[UISlider alloc] init]; [slider setMaximumValue:number.getMax()]; [slider setMinimumValue:number.getMin()]; @@ -336,7 +336,7 @@ //TODO add step ? [slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventTouchUpOutside]; [slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventTouchUpInside]; - [label setText:[NSString stringWithFormat:@"%@ %g", [NSString stringWithCString:number.getShortName().c_str() encoding:[NSString defaultCStringEncoding]], number.getValue()]]; + [label setText:[NSString stringWithFormat:@"%@ %g", [NSString stringWithCString:number.getShortName().c_str() encoding:NSUTF8StringEncoding], number.getValue()]]; } return self; } @@ -349,7 +349,7 @@ [slider setMaximumValue:number[0].getMax()]; [slider setMinimumValue:number[0].getMin()]; [slider setValue:number[0].getValue()]; - [label setText:[NSString stringWithFormat:@"%@ %g", [NSString stringWithCString:number[0].getShortName().c_str() encoding:[NSString defaultCStringEncoding]], number[0].getValue()]]; + [label setText:[NSString stringWithFormat:@"%@ %g", [NSString stringWithCString:number[0].getShortName().c_str() encoding:NSUTF8StringEncoding], number[0].getValue()]]; } -(void)sliderValueChanged:(UISlider *)sender @@ -393,8 +393,8 @@ self = [super init]; if(self) { label.alpha = (number.getReadOnly())? 0.439216f : 1.0f; - [label setText:[NSString stringWithCString:number.getShortName().c_str() encoding:[NSString defaultCStringEncoding]]]; - name = [NSString stringWithCString:number.getName().c_str() encoding:[NSString defaultCStringEncoding]]; + [label setText:[NSString stringWithCString:number.getShortName().c_str() encoding:NSUTF8StringEncoding]]; + name = [NSString stringWithCString:number.getName().c_str() encoding:NSUTF8StringEncoding]; textbox = [[UITextField alloc] init]; [textbox setBorderStyle:UITextBorderStyleRoundedRect]; [textbox setText:[NSString stringWithFormat:@"%g", number.getValue()]]; diff --git a/contrib/mobile/iOS/Onelab/ParametersViewController.mm b/contrib/mobile/iOS/Onelab/ParametersViewController.mm index ea269e958f859def605eef4a7975ff1533126054..5024a776b2978e8beb53c7b438229e08aacdc677 100644 --- a/contrib/mobile/iOS/Onelab/ParametersViewController.mm +++ b/contrib/mobile/iOS/Onelab/ParametersViewController.mm @@ -179,7 +179,7 @@ // check for new/updated parameters (number) for(int i=0;i<number.size();i++) { if(!number[i].getVisible()) continue; // Do not add invisible parameter - NSString *name=[NSString stringWithCString:number[i].getName().c_str() encoding:[NSString defaultCStringEncoding]]; + NSString *name=[NSString stringWithCString:number[i].getName().c_str() encoding:NSUTF8StringEncoding]; NSString *sectiontitle = [[name componentsSeparatedByString:@"/"] objectAtIndex:0]; Boolean found = false; @@ -211,7 +211,7 @@ // check for new/updated parameters (string) for(int i=0;i<string.size();i++) { if(!string[i].getVisible() || string[i].getKind() == "file") continue; // Do not add invisible parameter - NSString *name=[NSString stringWithCString:string[i].getName().c_str() encoding:[NSString defaultCStringEncoding]]; + NSString *name=[NSString stringWithCString:string[i].getName().c_str() encoding:NSUTF8StringEncoding]; NSString *sectiontitle = [[name componentsSeparatedByString:@"/"] objectAtIndex:0]; Boolean found = false; diff --git a/contrib/mobile/iOS/Onelab/PostProcessingViewController.mm b/contrib/mobile/iOS/Onelab/PostProcessingViewController.mm index 872b3f8785d58328d0f253938095c197ce9b666c..119dd56621662784e05f2ea5f7d3abd0f3f2e12c 100644 --- a/contrib/mobile/iOS/Onelab/PostProcessingViewController.mm +++ b/contrib/mobile/iOS/Onelab/PostProcessingViewController.mm @@ -27,7 +27,7 @@ [super viewDidLoad]; // Do any additional setup after loading the view. if(_pview) { - [_Name setText:[NSString stringWithCString:_pview->getData()->getName().c_str() encoding:[NSString defaultCStringEncoding]]]; + [_Name setText:[NSString stringWithCString:_pview->getData()->getName().c_str() encoding:NSUTF8StringEncoding]]; [_IntervalsType setDataSource:self]; [_IntervalsType setDelegate:self]; [_Intervals setText:[NSString stringWithFormat:@"%d",_pview->getOptions()->nbIso]];