Revision: 18433
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18433&view=rev
Author:   hofman
Date:     2012-01-19 16:19:35 +0000 (Thu, 19 Jan 2012)
Log Message:
-----------
Load webview before showing text import sheet. Rename method.

Modified Paths:
--------------
    trunk/bibdesk/BDSKTextImportController.h
    trunk/bibdesk/BDSKTextImportController.m
    trunk/bibdesk/BibDocument_Actions.m

Modified: trunk/bibdesk/BDSKTextImportController.h
===================================================================
--- trunk/bibdesk/BDSKTextImportController.h    2012-01-19 15:20:31 UTC (rev 
18432)
+++ trunk/bibdesk/BDSKTextImportController.h    2012-01-19 16:19:35 UTC (rev 
18433)
@@ -100,7 +100,7 @@
 
 - (id)initWithDocument:(BibDocument *)doc;
 
-- (void)beginSheetModalForWindow:(NSWindow *)aWindow forURL:(NSURL *)aURL;
+- (void)beginSheetForURL:(NSURL *)aURL modalForWindow:(NSWindow *)aWindow;
 
 - (IBAction)addItemAction:(id)sender;
 - (IBAction)closeAction:(id)sender;

Modified: trunk/bibdesk/BDSKTextImportController.m
===================================================================
--- trunk/bibdesk/BDSKTextImportController.m    2012-01-19 15:20:31 UTC (rev 
18432)
+++ trunk/bibdesk/BDSKTextImportController.m    2012-01-19 16:19:35 UTC (rev 
18433)
@@ -194,21 +194,18 @@
 
 #pragma mark Calling the main sheet
 
-- (void)beginSheetModalForWindow:(NSWindow *)aWindow forURL:(NSURL *)aURL {
+- (void)beginSheetForURL:(NSURL *)aURL modalForWindow:(NSWindow *)aWindow {
     // make sure we loaded the nib
     [self window];
-    if (aURL == nil)
+    if (aURL == nil) {
         [self loadPasteboardData];
-       else if ([aURL isFileURL])
+       } else if ([aURL isFileURL]) {
                [self loadFromFileURL:aURL];
-       else
+       } else {
                [self setShowingWebView:YES];
-    
-    [self beginSheetModalForWindow:aWindow];
-    
-    // not sure if this could be done safely before showing the sheet
-    if (aURL && [aURL isFileURL] == NO)
         [webView setURL:aURL];
+    }
+    [self beginSheetModalForWindow:aWindow];
 }
 
 #pragma mark Actions

Modified: trunk/bibdesk/BibDocument_Actions.m
===================================================================
--- trunk/bibdesk/BibDocument_Actions.m 2012-01-19 15:20:31 UTC (rev 18432)
+++ trunk/bibdesk/BibDocument_Actions.m 2012-01-19 16:19:35 UTC (rev 18433)
@@ -1448,7 +1448,7 @@
     }
     
     BDSKTextImportController *tic = [[(BDSKTextImportController 
*)[BDSKTextImportController alloc] initWithDocument:self] autorelease];
-    [tic beginSheetModalForWindow:documentWindow forURL:nil];
+    [tic beginSheetForURL:nil modalForWindow:documentWindow];
 }
 
 - (void)importOpenPanelDidEnd:(NSOpenPanel *)sheet 
returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo{
@@ -1465,7 +1465,7 @@
             [sheet orderOut:nil];
             
             BDSKTextImportController *tic = [[(BDSKTextImportController 
*)[BDSKTextImportController alloc] initWithDocument:self] autorelease];
-            [tic beginSheetModalForWindow:documentWindow forURL:[NSURL 
fileURLWithPath:fileName]];
+            [tic beginSheetForURL:[NSURL fileURLWithPath:fileName] 
modalForWindow:documentWindow];
         }
     }
 }
@@ -1489,7 +1489,7 @@
         [[urlSheetController window] orderOut:nil];
         
         BDSKTextImportController *tic = [[(BDSKTextImportController 
*)[BDSKTextImportController alloc] initWithDocument:self] autorelease];
-        [tic beginSheetModalForWindow:documentWindow 
forURL:[urlSheetController URL]];
+        [tic beginSheetForURL:[urlSheetController URL] 
modalForWindow:documentWindow];
     }
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to