After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 104072 - Nautilus context menu for 'rb'
Nautilus context menu for 'rb'
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: User Interface
unspecified
Other Windows
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-01-21 15:50 UTC by Mark Humphreys
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Unzip and create a component directory. (7.24 KB, application/x-compressed-tar)
2003-01-21 20:00 UTC, Mark Humphreys
  Details
Patch to the Makefile / configure files. (843 bytes, patch)
2003-01-21 20:06 UTC, Mark Humphreys
none Details | Review
Replacement code for the component subfolders. (3.01 KB, application/x-compressed-tar)
2003-01-21 21:48 UTC, Mark Humphreys
  Details
Replacement for the component subfolder. (2.93 KB, application/x-compressed-tar)
2003-01-22 00:24 UTC, Mark Humphreys
  Details
Patch to get the component subdir built (2.18 KB, patch)
2003-05-11 15:35 UTC, Mark Humphreys
none Details | Review
Untar to give a 'component' subdir (2.89 KB, application/x-compressed-tar)
2003-05-11 15:36 UTC, Mark Humphreys
  Details
Replace component/Makefile.am with this, and it will build properly (884 bytes, text/plain)
2003-05-11 16:49 UTC, Mark Humphreys
  Details
Nautilus context menu using corba call (6.55 KB, application/x-compressed-tar)
2003-07-25 12:46 UTC, Yann Rouillard
  Details
A tiny patch to have the contexy menu working correctly (3.21 KB, text/x-patch)
2003-07-26 12:50 UTC, Yann Rouillard
  Details
This archive contains the context menu code source (in component subdirectory) and the pach to apply to have the context menu compiling and working. (7.52 KB, application/x-compressed-tar)
2003-07-31 22:31 UTC, Yann Rouillard
  Details

Description Mark Humphreys 2003-01-21 15:50:47 UTC
Just found this document ..

"http://cvs.gnome.org/lxr/source/nautilus/docs/nautilus-context-menus.txt"

Using this and the 'file-roller' component, it should be possible to build
this functionality into the 'rb' source. 

I'll look at it tonite!
Comment 1 Mark Humphreys 2003-01-21 19:57:03 UTC
Attached is the first step in getting this working. Unzip to create
the component directory, and then apply the addition patch to get the
component to build. This adds the context menu option into Nautilus
when right-clicking on a mp3/off file. The actual starting of rb and
adding the file(s) is not there yet.
Comment 2 Mark Humphreys 2003-01-21 20:00:56 UTC
Created attachment 13725 [details]
Unzip and create a component directory.
Comment 3 Mark Humphreys 2003-01-21 20:06:41 UTC
Created attachment 13726 [details] [review]
Patch to the Makefile / configure files.
Comment 4 Mark Humphreys 2003-01-21 21:48:51 UTC
Created attachment 13728 [details]
Replacement code for the component subfolders.
Comment 5 Mark Humphreys 2003-01-21 21:50:01 UTC
The code in the latest tar file registers the component, so that the
option is on the context menu, and will call 'rb'. It still needs work
to actually get the file to be added. Will look at this tomorrow.
Comment 6 Mark Humphreys 2003-01-22 00:24:35 UTC
Created attachment 13735 [details]
Replacement for the component subfolder.
Comment 7 Mark Humphreys 2003-01-22 00:25:52 UTC
Latest version of the additions. This actually adds the selected files
to the Rhythmbox library. Also changed the string in the context-menu
to say "Add To Music Player Library...".
Comment 8 Jorn Baayen 2003-01-28 15:15:13 UTC
Cool. :) Sorry I did not reply earlier, I've been a bit busy... but I
will look at it soonish.
Comment 9 Mark Humphreys 2003-01-28 17:34:41 UTC
For the 2.2 version of Nautilus, the api has changed. The following
changes will need to be made ..

Before ..
                                                                        
// Try the old version of the code, in case Nautilus is still old!
list = (CORBA_sequence_CORBA_string *)args;
                                                                     
          
/* New Nautilus version after API changes ... */
//      if (!CORBA_TypeCode_equivalent (args->_type,
TC_CORBA_sequence_CORBA_string, ev))
//      {
//              return;
//      }
//      list = (CORBA_sequence_CORBA_string *)args->_value;

Needs to be ...

      if (!CORBA_TypeCode_equivalent (args->_type,
TC_CORBA_sequence_CORBA_string, ev))
      {
              return;
      }
      list = (CORBA_sequence_CORBA_string *)args->_value;

This should fix an issue with Nautilus freezing and having to be killed!
Comment 10 Mark Humphreys 2003-02-05 16:55:19 UTC
Could this patch also go into the 0.4.4.99 branch? 
Comment 11 Mark Humphreys 2003-05-11 14:14:50 UTC
Started looking at this again, and have 4 problems,

a) the nautilus component crashes due to a free on an unallocated buffer
b) Its Nautilus version specific - the API has changed, but most
people should be on the new version by now 
c) It doesn't seem to work! The application is started, but the file
to be added is not passed. 
d) The addFile mechanism in Rhythmbox doesn't work as before, and even
when the command is typed at the command line, the file is not added.
This is a different problem to (c) 

Comment 12 Mark Humphreys 2003-05-11 14:15:56 UTC
(a) Solved and fixed
(b) Solved and fixed
(c) ???
(d) Working on reintoducing this mechanism.
Comment 13 Mark Humphreys 2003-05-11 14:29:48 UTC
(d) It works, I was being stupid!

This just leaves (c)!
Comment 14 Mark Humphreys 2003-05-11 14:51:12 UTC
(c) Solved. 
Comment 15 Mark Humphreys 2003-05-11 15:35:35 UTC
Created attachment 16427 [details] [review]
Patch to get the component subdir built
Comment 16 Mark Humphreys 2003-05-11 15:36:51 UTC
Created attachment 16428 [details]
Untar to give a 'component' subdir
Comment 17 Mark Humphreys 2003-05-11 16:49:43 UTC
Created attachment 16429 [details]
Replace component/Makefile.am with this, and it will build properly
Comment 18 Mark Humphreys 2003-07-25 12:12:20 UTC
This should do a CORBA call, rather than spawn a process - as 
suggested by Yann Rouillard. Will work on a patch with him!
Comment 19 Yann Rouillard 2003-07-25 12:46:52 UTC
Created attachment 18598 [details]
Nautilus context menu using corba call
Comment 20 Yann Rouillard 2003-07-25 12:48:32 UTC
I attached my code with old commented codes removed.
I investigated the crash which happens when using the context menu
with Rhythmbox not launched.
What happens is that bonobo-activation laucnh with rhythmbox with the
following arguments:

rhythmbox --oaf-activate-iid=OAFIID:GNOME_Rhythmbox_Factory
--oaf-ior-fd=20

which raises the following error:

** ERROR **: This process has not registered the required OAFIID your
source code should register 'OAFIID:GNOME_Rhythmbox_Factory'. If your
code is performing delayed registration and this message is trapped in
error, see bonobo_activation_idle_reg_check_set.

Indeed Rhythmbox never registers "OAFIID:GNOME_Rhythmbox_Factory", it
registers "OAFIID:GNOME_Rhythmbox" instead, I tried to change this
behaviour as a result Rhythmbox is launched without crashing but files
are not added anymore to the library (I suppose that the Corba
interface isn't registered anymore).

I think me (or Rhythmbox) must not corba/bonobo things correctly but I
don't understand bonobo enough to understand.
Comment 21 Mark Humphreys 2003-07-25 18:36:53 UTC
Yann, I'm going to try and get your patch integrated with the layout
of my patch, so we can see whether your problem is something in the
build mechanism or an issue with 'rb'.
Comment 22 Yann Rouillard 2003-07-25 19:22:46 UTC
Concerning the mime types, we should use the generic audio mime types
because Rhythmbox is potentially able to support more mime type than
just ogg, mp3 and wav.

<oaf_attribute name="bonobo:supported_mime_types" type="stringv">
  <item value="x-directory/normal"/>
  <item value="audio/*"/>
  <item value="application/x-ogg"/>
  <item value="application/ogg"/>
</oaf_attribute>
Comment 23 Mark Humphreys 2003-07-26 08:48:51 UTC
Having patched my code to do your corba activation, I get the same
errors as you did....

** ERROR **: This process has not registered the required OAFIID your
source code should register 'OAFIID:GNOME_Rhythmbox_Factory'. If your
code is performing delayed registration and this message is trapped in
error, see bonobo_activation_idle_reg_check_set.

So something is up with the corba registration.
Comment 24 Yann Rouillard 2003-07-26 10:23:53 UTC
I ad a look a Gedit code and it register the factory OAFIID at the
beginning so I think this is correct behaviour I changed this in
rhythmbox but I get segfault.
The rb_library_add_uri is called but the library argument is NULL !
Comment 25 Yann Rouillard 2003-07-26 12:50:27 UTC
Created attachment 18623 [details]
A tiny patch to have the contexy menu working correctly
Comment 26 Mark Humphreys 2003-07-26 16:50:01 UTC
That works for me! I get a crash on exit, but I get that whatever
happens. 

If you roll all the patches together, then we should push for this to
be applied.
Comment 27 Yann Rouillard 2003-07-31 22:31:13 UTC
Created attachment 18801 [details]
This archive contains the context menu code source (in component subdirectory) and the pach to apply to have the context menu compiling and working.
Comment 28 Colin Walters 2003-08-01 04:49:31 UTC
This patch has been applied in CVS.  Thanks!