Closed Bug 69707 Opened 24 years ago Closed 23 years ago

need BeOS implementation of nsILocalFile::Launch and nsILocalFile::Reveal

Categories

(SeaMonkey :: UI Design, defect)

x86
BeOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rosenauer, Assigned: beos)

References

Details

Attachments

(1 file, 2 obsolete files)

The "Launch" and "Reveal Location"-buttons seem to do nothing...
I believe this is a duplicate of bug 67001. Just change OS:All..
confirming.

Reveal needs to launch /system/Tracker with the parent folder that the file is in. Or for
bonus points:
   If the folder has a BEOS:PREF_APP mimetype, open the folder in that app.
   If the folder doesn't, use the default app for "application/x-vnd.Be-directory"
   (The user might not nessessarily use Tracker)

Launch runs the application (if it is one), else the default app for the filetype.

This bug depends on bug 69891
Assignee: darin → koehler
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Download-Window: "Launch" and "Reveal.." don't work → need BeOS implementation of nsILocalFile::Launch and nsILocalFile::Reveal
Depends on: 69891
Why is this bug assigned to Networking:HTTP ?
Component: Networking: HTTP → XP Apps: GUI Features
QA Contact: tever → guru
Sorry, my fault - I am a bit lost with the variety of Mozilla-modules;) (thought
downloading belonged to networking?)
No more working on Bezilla
Assignee: koehler → nobody
Still true for 0.9.2/BeOS. BTW I'm sure there is already request for bundling
downloads in *one* single download-window, so I won't mention that here. :^)
//this code freely contributed by AnEvilYak
//this code is untested, anyone interested in testing it?
#include <Roster.h> 
#include <Entry.h>

NS_IMETHODIMP
nsLocalFile::Reveal()
{
  nsXPIDLCString path;
  GetPath(getter_Copies(path));
  BRoster roster;
  entry_ref ref;
  BPath beosPath (path);
  beosPath.GetParent (&beosPath);
  get_ref_for_path (beosPath.Path(), &ref);
  roster.Launch (&ref);
  return NS_OK;
}

NS_IMETHODIMP
nsLocalFile::Launch()
{
  nsXPIDLCString path;
  GetPath(getter_Copies(path));

  BRoster roster;
  entry_ref ref;
  get_ref_for_path (path, &ref);
  roster.Launch (&ref);

  return NS_OK;
}
//end of code

could someone please test this? it does make the assumption that path is a path 
to a file, so if you reveal /home/Desktop /home will open.  I didn't hunt for a 
way to select the file object. -- If anyone comes up w/ a way they can 
implement that later.
Assignee: nobody → timeless
Keywords: patch, review
Attached patch people demand real patches... (obsolete) — Splinter Review
you have to use be_roster instead of your own instance. but it doesn't work for directories. I made a patch to launch tracker and pass the path as an argument. This is a dirty hack but it works. It would be better to use scripting. 
=> current maintainer.
Assignee: timeless → arougthopher
QA Contact: wade → timeless
Marking assigned.
Status: NEW → ASSIGNED
I was looking at the last patch:

+nsLocalFile::Reveal() 
+{ 
+  nsXPIDLCString path; 
+  GetPath(getter_Copies(path)); 
+  entry_ref ref; 
+  BPath beosPath (path); 
+  beosPath.GetParent (&beosPath); 
+  get_ref_for_path ("/boot/beos/system/Tracker", &ref); 
+  char* args[1]; 
+  args[0] = beosPath.Path(); 
+  be_roster->Launch (&ref, 1, args); 
+  return NS_OK; 
+}

If this is supposed to work like a normal command line app, argc should be 2, with the app 
name at argv[0] and the first argument at argv[1]. Anyway, better to do it with messaging 
as follows:

BMessage message(B_REFS_RECEIVED);
message.AddRef("refs", &ref);
BMessenger messenger("application/x-vnd.Be-TRAK");
messenger.SendMessage(&message);

where ref is an entry_ref to the parent folder.
You mean something like this?

Created a new patch.  Now uses a BMessenger to tell Tracker to open the parent
directory for the file.
Attachment #41984 - Attachment is obsolete: true
Attachment #45347 - Attachment is obsolete: true
Who do I need to contact to get the latest patch reviewed, so I can check it in?

Also, the Launch button is always disabled, what causes that button to be
enabled/disabled?
Comment on attachment 68682 [details] [diff] [review]
Update patch.  Uses a BMessenger to lauch Tracker for reveal.

Looks good to me. r=cls
Attachment #68682 - Flags: review+
The tree is currently closed for 0.9.9.  I have sent an email to
drivers@mozilla.org to get permission to check this patch in.
a=asa (on behalf of drivers) for checkin to 0.9.9
Keywords: mozilla0.9.9+
This has been checked in.  Marking resolved/fixed.  (Thanks for the aproval!)
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Paul, was it really checked in, and if, where it disappeared?
http://bugzilla.mozilla.org/show_bug.cgi?id=145860
Sergei, look at the patch attached to this bug.  Then look at the file it was supposed
to modify.  As you can see, the patch WAS checked in.  I don't know what you mean by
this disappearing.  The bug you listed, though related, is not this bug.
Product: Core → Mozilla Application Suite
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: