PATCH: Adding Open URL in Navigator Service

VERIFIED FIXED

Status

Camino Graveyard
General
--
enhancement
VERIFIED FIXED
16 years ago
16 years ago

People

(Reporter: Dominik Westner, Assigned: Mike Pinkerton (not reading bugmail))

Tracking

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

16 years ago
Hi,
here is another patch, which adds a service menu entry 'Open URL with Navigator'.
The Service will be tolerante of any whitespace and new lines. If somebody can provide me with a valid character set for URLs I can add checking for this aswell.
This are all valid URLS:
www.apple.com
http://www.apple.com
    http://www.apple.com    
h t t p : / / www.  app   le.   com  
h
t
t
p
:/
/ www
apple
.
com
Note: you might want to apply the patch to the project.pbxproject by hand as I use the 2.0beta ProjectBuilder.
Greetings
NikWest
(Reporter)

Comment 1

16 years ago
Created attachment 87211 [details] [diff] [review]
OpenUrlService.patch

Updated

16 years ago
Keywords: patch, review

Comment 2

16 years ago
->dagley, drive zee patch!
Assignee: saari → sdagley

Comment 3

16 years ago
Til pink gives me write access to Chimera not much use sending me patches to
land.  Over to bryner who does have access IIRC
Assignee: sdagley → bryner
This probably needs to be added to both the normal and static build targets.
Created attachment 88035 [details] [diff] [review]
updated patch to add settings to both targets
Attachment #87211 - Attachment is obsolete: true
-> pink, who says he'll land this tomorrow after fixing some stylistic nits
Assignee: bryner → pinkerton
(Assignee)

Comment 7

16 years ago
landed this, with a few changes. first, we're not C, so declare vars where they
are used. Second, stringByAppendingString: is expensive. I switched it to just
prealloc a mutable string and use appendString: over and over.

thanks!
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 8

16 years ago
Where am I supposed to find this menu entry?  I don't seem to see it under the
"Services" in the Navigator menu or in the Finder menu.  I'm using the 06-21
build on OS 10.1.5. 
(Reporter)

Comment 9

16 years ago
You have to log out and in again.

Alternativly you can run a utility programm like this:

#import <AppKit/AppKit.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    NSUpdateDynamicServices();
    [pool release];
    return 0;
}

Dominik
(Assignee)

Comment 10

16 years ago
i think this only works if the app is in the system or user "applications" dirs,
which the finder searches at login to build the services menu.

note, i haven't tried it ;)

Comment 11

16 years ago
pink, you're right, I do need to put chimera in Applications for this Services
menu item to show up.

Running 06-26 build without Navigator in Applications
1.  No Services->Open URL in Navigator menu item.
2.  Added Navigator to Applications
3.  Reboot
4.  Launched Navigator.  Open URL in Navigator appeared in Services menu.
(*However*, this menu item is grayed out)
5.  Removed Navigator from Applications.
6.  Reboot
7.  No more Services->Open URL in Navigator menu item.

Is the menu item supposed to be grayed out under certain conditions?  If so,
what are the conditions that will cause it not to be grayed out so I can test those?

Leaving as Resolved Fixed.
(Assignee)

Comment 12

16 years ago
i would imagine that it's grayed out _in navigator_. ;) the services menu is for
providing services to other application, not your own. also, not every app can
use services, so the menu may appear grayed out there too. try an app like
Terminal or TextEdit, something that is a real cocoa app.

Comment 13

16 years ago
thanks, pink.  :)  Tested this using TextEdit and Terminal.

1.  Launched chimera.
2.  Launched TextEdit.
3.  Typed "www.google.com" (amongst other text) in TextEdit.
4.  Highlighted "www.google.com".
5.  Clicked Services->Open URL in Navigator.
6.  Chimera opens new window and loads www.google.com

PASS

Tested again without Chimera initially launched (step 1 above).  Followed steps
2-5 again.  Chimera launches and loads www.google.com.

PASS
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.