maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   How To : Associate MPlayer, Transmission, and other apps as default handlers (https://talk.maemo.org/showthread.php?t=17757)

qole 2010-06-13 04:26

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
OK, qwerty12's gnomevfs suggestion prints the correct mimetype for both a local PDF with no extension and Dr. Hawking's paper on the web.

So now to fundamentally rewrite dbus-switchboard to use mime types instead of extensions :)

EDIT: I installed python-gnome2 and just did "import gnomevfs"

rebhana 2010-06-13 12:26

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Quote:

Originally Posted by qole (Post 712742)
I find it interesting that Maemo pretends to use the /etc/gnome/defaults.list file but it doesn't really, it still uses the /usr/share/applications/defaults.list ...

I find it interesting, too, that I copy the original file to a safe location, and then copy it back in my postrm file. But how is it that the file that my postrm script copies back upon removal of dbus-switchboard is different than the file it was supposedly linked to?

In Maemo /usr/share/applications/defaults.list is just a symbolic link to /etc/gnome/defaults.list, but not after dbus-switchboard is installed. It seems that dbus-switchboard should simply keep this symbolic link, which apparently it doesn't - otherwise the copying back would have restored things.

EDIT: After having studied the postinst, postrm, and dswitch-ini.sh scripts, I also don't understand how the symlink could have been broken by installing and deinstalling dbus-switchboard.:confused:

rebhana 2010-06-13 12:33

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Quote:

Originally Posted by qole (Post 712768)
OK, qwerty12's gnomevfs suggestion prints the correct mimetype for both a local PDF with no extension and Dr. Hawking's paper on the web.

So now to fundamentally rewrite dbus-switchboard to use mime types instead of extensions :)

EDIT: I installed python-gnome2 and just did "import gnomevfs"

I admire you for being able to put a smiley after the conclusion that it requires a fundamental rewrite! I really feel bad that I cannot offer any help out of fundamental ignorance. I even had to look up "dbus" on wikipedia - and unsurprisingly still no precise idea what's involved :o

qole 2010-06-15 21:19

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
New version in Extras-devel (1.2.13) has rudimentary, hackish support for mimetypes. If your file doesn't have a recognised file extension, it will try to match the file to a recognised mimetype.

I have added a new file,

/home/user/.mimetypes/user-mimetypes.list

which you must edit by hand. Find the mimetype in the incredibly long list (taken from my desktop Ubuntu defaults.list) and change the "none" to the name of the handler (from the Handlers list in the GUI).

I have defined one mimetype as an example, application/pdf=Evince to show you how to do it (and to keep the invaluable rebhana as my betatester :)).

If people express any interest in this approach, I could rewrite the app to use the mimetypes as the primary method, and then it could try file extensions as the backup.

It's been good programming experience, anyway.

DaSilva 2010-06-15 21:45

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I cannot install it because of a conflict with "gnome-python" dependency.

casper27 2010-06-15 21:46

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
New update conflicts with gnome/python and is unnstallable.

qole 2010-06-15 21:49

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I'm uploading a new version due to a postinst error...

Should I switch to gnome-python as my dependency? python-gnome2 seemed so much cleaner to use... Can anyone tell me what package uses gnome-python?

qwerty12 2010-06-15 21:54

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Quote:

Originally Posted by qole (Post 716692)
I'm uploading a new version due to a postinst error...

Should I switch to gnome-python as my dependency? python-gnome2 seemed so much cleaner to use... Can anyone tell me what package uses gnome-python?

Quote:

~ $ apt-cache rdepends gnome-python
gnome-python
Reverse Depends:
digghomewidget
python-gnome2
rapier
python-gnome2
python-runtime
hermes
python-gnome2
fmms
fmms
fmms
fmms
fmms
fmms
fmms
fmms
fmms
fapn
python-gnome2
gnome-python-dev
python-gnome2
gnome-python-dev
python-gnome2
gnome-python-dev
python-gnome2
maegios
python-gnome2
|mevemon
python-gnome2
mclock
python-gnome2
lybniz
python-gnome2
mastory
python-gnome2
I think it's possible to use either one, actually.

Sth. like:
Quote:

Originally Posted by debian/control
Depends: python-gnome | python-gnome2

Quote:

Originally Posted by dbus-switchboard.py
try:
from gnome import gnomevfs
except ImportError:
import gnomevfs


DaSilva 2010-06-15 21:54

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
fmms uses gnome-python.

qole 2010-06-15 21:59

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I'll try qwerty12's suggestion to use either of the two packages.

And DaSilva is right, who cares about what other apps use gnome-python!? No man dare interfere with the mighty fmms!


All times are GMT. The time now is 16:12.

vBulletin® Version 3.8.8