From 2d72ff336fd4e4993df2f0b4ab0e79d478bfffc6 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Sun, 28 Apr 2002 22:07:03 +0000 Subject: [PATCH] Ok, so now it's picking a URL for import. git-svn-id: svn://10.0.0.236/trunk@120151 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/camino/MainController.mm | 15 +++++++++++++++ mozilla/camino/src/application/MainController.mm | 15 +++++++++++++++ mozilla/chimera/MainController.mm | 15 +++++++++++++++ mozilla/chimera/src/application/MainController.mm | 15 +++++++++++++++ 4 files changed, 60 insertions(+) diff --git a/mozilla/camino/MainController.mm b/mozilla/camino/MainController.mm index 4011ed5ea33..e3bf6333373 100644 --- a/mozilla/camino/MainController.mm +++ b/mozilla/camino/MainController.mm @@ -292,6 +292,21 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1"; { // IE favorites: ~/Library/Preferences/Explorer/Favorites.html // Omniweb favorites: ~/Library/Application Support/Omniweb/Bookmarks.html + // For now, open the panel to IE's favorites. + NSOpenPanel* openPanel = [[NSOpenPanel alloc] init]; + [openPanel setCanChooseFiles: YES]; + [openPanel setCanChooseDirectories: NO]; + [openPanel setAllowsMultipleSelection: NO]; + NSArray* array = [NSArray arrayWithObjects: @"htm",@"html",@"xml", nil]; + int result = [openPanel runModalForDirectory: @"~/Library/Preferences/Explorer/" + file: @"Favorites.html" + types: array]; + if (result == NSOKButton) { + NSArray* urlArray = [openPanel URLs]; + if ([urlArray count] == 0) + return; + NSURL* url = [urlArray objectAtIndex: 0]; + } } -(IBAction) addBookmark:(id)aSender diff --git a/mozilla/camino/src/application/MainController.mm b/mozilla/camino/src/application/MainController.mm index 4011ed5ea33..e3bf6333373 100644 --- a/mozilla/camino/src/application/MainController.mm +++ b/mozilla/camino/src/application/MainController.mm @@ -292,6 +292,21 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1"; { // IE favorites: ~/Library/Preferences/Explorer/Favorites.html // Omniweb favorites: ~/Library/Application Support/Omniweb/Bookmarks.html + // For now, open the panel to IE's favorites. + NSOpenPanel* openPanel = [[NSOpenPanel alloc] init]; + [openPanel setCanChooseFiles: YES]; + [openPanel setCanChooseDirectories: NO]; + [openPanel setAllowsMultipleSelection: NO]; + NSArray* array = [NSArray arrayWithObjects: @"htm",@"html",@"xml", nil]; + int result = [openPanel runModalForDirectory: @"~/Library/Preferences/Explorer/" + file: @"Favorites.html" + types: array]; + if (result == NSOKButton) { + NSArray* urlArray = [openPanel URLs]; + if ([urlArray count] == 0) + return; + NSURL* url = [urlArray objectAtIndex: 0]; + } } -(IBAction) addBookmark:(id)aSender diff --git a/mozilla/chimera/MainController.mm b/mozilla/chimera/MainController.mm index 4011ed5ea33..e3bf6333373 100644 --- a/mozilla/chimera/MainController.mm +++ b/mozilla/chimera/MainController.mm @@ -292,6 +292,21 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1"; { // IE favorites: ~/Library/Preferences/Explorer/Favorites.html // Omniweb favorites: ~/Library/Application Support/Omniweb/Bookmarks.html + // For now, open the panel to IE's favorites. + NSOpenPanel* openPanel = [[NSOpenPanel alloc] init]; + [openPanel setCanChooseFiles: YES]; + [openPanel setCanChooseDirectories: NO]; + [openPanel setAllowsMultipleSelection: NO]; + NSArray* array = [NSArray arrayWithObjects: @"htm",@"html",@"xml", nil]; + int result = [openPanel runModalForDirectory: @"~/Library/Preferences/Explorer/" + file: @"Favorites.html" + types: array]; + if (result == NSOKButton) { + NSArray* urlArray = [openPanel URLs]; + if ([urlArray count] == 0) + return; + NSURL* url = [urlArray objectAtIndex: 0]; + } } -(IBAction) addBookmark:(id)aSender diff --git a/mozilla/chimera/src/application/MainController.mm b/mozilla/chimera/src/application/MainController.mm index 4011ed5ea33..e3bf6333373 100644 --- a/mozilla/chimera/src/application/MainController.mm +++ b/mozilla/chimera/src/application/MainController.mm @@ -292,6 +292,21 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1"; { // IE favorites: ~/Library/Preferences/Explorer/Favorites.html // Omniweb favorites: ~/Library/Application Support/Omniweb/Bookmarks.html + // For now, open the panel to IE's favorites. + NSOpenPanel* openPanel = [[NSOpenPanel alloc] init]; + [openPanel setCanChooseFiles: YES]; + [openPanel setCanChooseDirectories: NO]; + [openPanel setAllowsMultipleSelection: NO]; + NSArray* array = [NSArray arrayWithObjects: @"htm",@"html",@"xml", nil]; + int result = [openPanel runModalForDirectory: @"~/Library/Preferences/Explorer/" + file: @"Favorites.html" + types: array]; + if (result == NSOKButton) { + NSArray* urlArray = [openPanel URLs]; + if ([urlArray count] == 0) + return; + NSURL* url = [urlArray objectAtIndex: 0]; + } } -(IBAction) addBookmark:(id)aSender