Skip to content
Snippets Groups Projects
Commit 5fd9042f authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix "Cancel"

parent 50642a61
No related branches found
No related tags found
No related merge requests found
......@@ -170,8 +170,7 @@
[self.editFilesActionSheet addButtonWithTitle:file];
}
}
[self.editFilesActionSheet addButtonWithTitle:@"Cancel"];
self.editFilesActionSheet.cancelButtonIndex = [modelFiles count];
self.editFilesActionSheet.cancelButtonIndex = [self.editFilesActionSheet addButtonWithTitle:@"Cancel"];
self.editFilesActionSheet.tag = actionSheet.tag;
[self.editFilesActionSheet showInView:self.view];
}
......@@ -208,13 +207,15 @@
}
}
else{
if(buttonIndex != actionSheet.cancelButtonIndex){
NSString *modelFile = [[models objectAtIndex:actionSheet.tag] getFile];
NSString *modelPath = [modelFile stringByDeletingLastPathComponent];
currentFileToEdit = [[modelPath stringByAppendingString:@"/"]
stringByAppendingString:[actionSheet buttonTitleAtIndex:buttonIndex]];
NSString *file = [actionSheet buttonTitleAtIndex:buttonIndex];
currentFileToEdit = [[modelPath stringByAppendingString:@"/"] stringByAppendingString:file];
[self performSegueWithIdentifier:@"showAboutSegue" sender:self];
}
}
}
- (void)attachFilesToEmail:(NSArray*)files filePath:(NSString*)path
{
......@@ -275,7 +276,6 @@
[self dismissViewControllerAnimated:YES completion:NULL];
}
- (BOOL) parseInfosFile:(NSString *)file
{
NSData *xmlFile = [[NSFileManager defaultManager] contentsAtPath:file];
......
......@@ -187,7 +187,7 @@
[_progressIndicator stopAnimating];
[_progressIndicator setHidden:YES];
if(_errors.count > 0) {
_errorAlert = [[UIErrorAlertView alloc] initWithTitle:@"Gmsh/GetDP error" message:[_errors lastObject] delegate:self cancelButtonTitle:@"Hide" otherButtonTitles:@"Show more", nil];
_errorAlert = [[UIErrorAlertView alloc] initWithTitle:@"Error" message:[_errors lastObject] delegate:self cancelButtonTitle:@"Hide" otherButtonTitles:@"Show more", nil];
[_errorAlert show];
}
}
......@@ -328,9 +328,9 @@
}
else [_errors removeLastObject];
if(_errors.count > 1)
_errorAlert = [[UIErrorAlertView alloc] initWithTitle:@"Gmsh/GetDP error" message:[_errors lastObject] delegate:self cancelButtonTitle:@"Hide" otherButtonTitles:@"Show more", nil];
_errorAlert = [[UIErrorAlertView alloc] initWithTitle:@"Error" message:[_errors lastObject] delegate:self cancelButtonTitle:@"Hide" otherButtonTitles:@"Show more", nil];
else
_errorAlert = [[UIErrorAlertView alloc] initWithTitle:@"Gmsh/GetDP error" message:[_errors lastObject] delegate:self cancelButtonTitle:@"Hide" otherButtonTitles: nil];
_errorAlert = [[UIErrorAlertView alloc] initWithTitle:@"Error" message:[_errors lastObject] delegate:self cancelButtonTitle:@"Hide" otherButtonTitles: nil];
[_errorAlert show];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment