Permalink
Browse files

Creating matching import flow using export classes

  • Loading branch information...
mmattozzi committed Jan 16, 2012
1 parent d250375 commit 9a72dc409d824ca7926318d44abcce6e031ad772
Showing with 350 additions and 131 deletions.
  1. +12 −5 CocoaRestClientAppDelegate.m
  2. +255 −122 ExportRequests.xib
  3. +18 −3 ExportRequestsController.h
  4. +65 −1 ExportRequestsController.m
@@ -106,7 +106,7 @@ - (id) init {
exportRequestsController = [[ExportRequestsController alloc] initWithWindowNibName:@"ExportRequests"];
exportRequestsController.savedRequestsArray = savedRequestsArray;
-
+
return self;
}
@@ -146,6 +146,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[urlBox setNumberOfVisibleItems:10];
[savedRequestsDrawer open];
+ exportRequestsController.savedOutlineView = savedOutlineView;
}
- (void) determineRequestContentType{
@@ -877,23 +878,29 @@ - (IBAction) importRequests:(id)sender {
[picker setCanChooseDirectories:NO];
[picker setAllowsMultipleSelection:NO];
+ NSMutableArray *loadedRequests = [[NSMutableArray alloc] init];
+
if ( [picker runModalForDirectory:nil file:nil] == NSOKButton )
{
for(NSURL* url in [picker URLs])
{
NSString *path = [url path];
NSLog(@"Loading requests from %@", path);
- [savedRequestsArray addObjectsFromArray:[NSKeyedUnarchiver unarchiveObjectWithFile:path]];
- [savedOutlineView reloadItem:nil reloadChildren:YES];
+ [loadedRequests addObjectsFromArray:[NSKeyedUnarchiver unarchiveObjectWithFile:path]];
}
}
-
+ [exportRequestsController prepareToDisplayImports:loadedRequests];
+ [NSApp beginSheet: [exportRequestsController window]
+ modalForWindow: window
+ modalDelegate: exportRequestsController
+ didEndSelector: @selector(didEndSheet:returnCode:contextInfo:)
+ contextInfo: nil];
}
- (IBAction) exportRequests:(id)sender {
- [exportRequestsController prepareToDisplay];
+ [exportRequestsController prepareToDisplayExports];
[NSApp beginSheet: [exportRequestsController window]
modalForWindow: window
modalDelegate: exportRequestsController
Oops, something went wrong.

0 comments on commit 9a72dc4

Please sign in to comment.