mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 08:30:59 +00:00
Get browser from defaults
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14338 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4ee8c3ff31
commit
bdd9747e9b
2 changed files with 14 additions and 2 deletions
|
@ -3,6 +3,10 @@
|
|||
* Model/GMAppKit.m (-initWithModelUnarchiver:): Don't add ourselves
|
||||
to the superview if we are the contentView of an NSBox.
|
||||
|
||||
* Tools/example.m ([ExampleServices -openURL:userData:error:]):
|
||||
Get browser from defualts. Use mozilla if non. (Modified patch from
|
||||
Stefan Urbanek).
|
||||
|
||||
2002-08-24 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Source/NSGraphicsContext.m: More documentation.
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSTask.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSPasteboard.h>
|
||||
|
||||
|
@ -62,6 +63,8 @@
|
|||
NSArray *args;
|
||||
NSString *path;
|
||||
NSTask *task;
|
||||
NSString *browser;
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
types = [pb types];
|
||||
if (![types containsObject: NSStringPboardType])
|
||||
|
@ -77,11 +80,16 @@
|
|||
return;
|
||||
}
|
||||
|
||||
browser = [defs objectForKey:@"NSWebBrowser"];
|
||||
if(!browser || [browser isEqualToString:@""])
|
||||
{
|
||||
browser = @"mozilla -remote \"openURL(%@,new-window)\"";
|
||||
}
|
||||
|
||||
path = @"/bin/sh";
|
||||
args = [NSArray arrayWithObjects:
|
||||
@"-c",
|
||||
[NSString stringWithFormat:
|
||||
@"netscape -noraise -remote \"openURL(%@,new-window)\"", url],
|
||||
[NSString stringWithFormat: browser, url],
|
||||
nil];
|
||||
|
||||
task = [NSTask launchedTaskWithLaunchPath: path
|
||||
|
|
Loading…
Reference in a new issue