mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 00:50:49 +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
0b06984d4c
commit
708c9c7f32
2 changed files with 14 additions and 2 deletions
|
@ -3,6 +3,10 @@
|
||||||
* Model/GMAppKit.m (-initWithModelUnarchiver:): Don't add ourselves
|
* Model/GMAppKit.m (-initWithModelUnarchiver:): Don't add ourselves
|
||||||
to the superview if we are the contentView of an NSBox.
|
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>
|
2002-08-24 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Source/NSGraphicsContext.m: More documentation.
|
* Source/NSGraphicsContext.m: More documentation.
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <Foundation/NSString.h>
|
#include <Foundation/NSString.h>
|
||||||
#include <Foundation/NSException.h>
|
#include <Foundation/NSException.h>
|
||||||
#include <Foundation/NSTask.h>
|
#include <Foundation/NSTask.h>
|
||||||
|
#include <Foundation/NSUserDefaults.h>
|
||||||
#include <AppKit/NSApplication.h>
|
#include <AppKit/NSApplication.h>
|
||||||
#include <AppKit/NSPasteboard.h>
|
#include <AppKit/NSPasteboard.h>
|
||||||
|
|
||||||
|
@ -62,6 +63,8 @@
|
||||||
NSArray *args;
|
NSArray *args;
|
||||||
NSString *path;
|
NSString *path;
|
||||||
NSTask *task;
|
NSTask *task;
|
||||||
|
NSString *browser;
|
||||||
|
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
||||||
types = [pb types];
|
types = [pb types];
|
||||||
if (![types containsObject: NSStringPboardType])
|
if (![types containsObject: NSStringPboardType])
|
||||||
|
@ -77,11 +80,16 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
browser = [defs objectForKey:@"NSWebBrowser"];
|
||||||
|
if(!browser || [browser isEqualToString:@""])
|
||||||
|
{
|
||||||
|
browser = @"mozilla -remote \"openURL(%@,new-window)\"";
|
||||||
|
}
|
||||||
|
|
||||||
path = @"/bin/sh";
|
path = @"/bin/sh";
|
||||||
args = [NSArray arrayWithObjects:
|
args = [NSArray arrayWithObjects:
|
||||||
@"-c",
|
@"-c",
|
||||||
[NSString stringWithFormat:
|
[NSString stringWithFormat: browser, url],
|
||||||
@"netscape -noraise -remote \"openURL(%@,new-window)\"", url],
|
|
||||||
nil];
|
nil];
|
||||||
|
|
||||||
task = [NSTask launchedTaskWithLaunchPath: path
|
task = [NSTask launchedTaskWithLaunchPath: path
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue