maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   Understanding Maemo Mime handling (https://talk.maemo.org/showthread.php?t=15194)

brontide 2008-03-25 03:12

Re: Understanding Maemo Mime handling
 
hmm.. nadda. I can run dbus-switchboard as user but, of course, nothing happens. I have rewritten and tested call.sh to take tel and sip prefixes and strip them. I have updated the following in uri-action-default.list

sip=dbus-switchboard.desktop
tel=dbus-switchboard.desktop


and this in the .desktop file

X-Osso-URI-Actions=sip;tel;mms

[X-Osso-URI-Action-Open]
Method=mime_open
Name=uri_link_play
TranslationDomain=osso-uri

[X-Osso-URI-Action Handler sip]
Method=mime_open
Name=uri_link_make_call
TranslationDomain=osso-uri

[X-Osso-URI-Action Handler tel]
Method=mime_open
Name=uri_link_make_call
TranslationDomain=osso-uri


and the mods to the app itself are..


if method.find("make_call") <> -1:
os.system("/usr/bin/call " + arguments)
print "placing call:"
return

I figured this would be easier than find'ing on the argstr.

When I try and open a tel: link in browser I get unsupported type and if I try sip: I get contacts despite the fact that I removed the sip information from those desktop files.

brontide 2008-03-25 03:37

Re: Understanding Maemo Mime handling
 
Leaving dbus-switchboard running in the forground only prints the started message, like it's not getting called for sip or tel uri's

pipeline 2008-03-25 04:11

Re: Understanding Maemo Mime handling
 
i thought you got it working without dbus-switchboard. your voip is nokia app right?

Edit : ok i forgot you have call.sh script.... make that hildon-dbus-switchboard.desktop in the uri-actions-defaults.list file

possibly run (as root) :
update-mime-database /usr/share/mime

and reboot?

oh yea and if you modify the dbus-switchboard.py file, kill all running ppython processes... it stays loaded i guess as single osso service if not already running (in xterm)

brontide 2008-03-25 13:19

Re: Understanding Maemo Mime handling
 
Adding hildon- made all the difference, now it's getting called and I'm getting somewhere.

The other oops that we missed is that when I copied and pasted the code block I missed that you had it as "/usr/bin/call " + arguments rather than argstr. So now it's running, but I would like to see about cleaning it up some.

update: Just tested iphone.facebook.com and clicking on the Call 444.555.1212 button works! Now for more world domination.:cool:

pipeline 2008-03-25 23:34

Re: Understanding Maemo Mime handling
 
Quote:

Originally Posted by brontide (Post 159887)
Adding hildon- made all the difference, now it's getting called and I'm getting somewhere.

The other oops that we missed is that when I copied and pasted the code block I missed that you had it as "/usr/bin/call " + arguments rather than argstr. So now it's running, but I would like to see about cleaning it up some.

update: Just tested iphone.facebook.com and clicking on the Call 444.555.1212 button works! Now for more world domination.:cool:

Glad its working for you, so i guess i will need to edit the python file to support the protocol types... hmm how to extract that to cfgs :(

MaemoN00B gets credit for finding the magic needed to add hildon- before the desktop file :)

brontide 2008-03-25 23:57

Re: Understanding Maemo Mime handling
 
Quote:

Originally Posted by pipeline (Post 160198)
Glad its working for you, so i guess i will need to edit the python file to support the protocol types... hmm how to extract that to cfgs :(

MaemoN00B gets credit for finding the magic needed to add hildon- before the desktop file :)

Ohh... how about this.

[X-Osso-URI-Action Handler tel]
Method=call_app_application
Name=uri_link_make_call
TranslationDomain=osso-uri


Then you could

if method.find("call_app_") <> -1:
app = method.replace("call_app_","")
os.system( app + " " argstr )

or something like that. Embed the name of the app to call into the URL handler call.

pipeline 2008-03-26 12:41

Re: Understanding Maemo Mime handling
 
i think i will add new column to xref file for specifying protocols

like:
.torrent, , Transmission
.wmv, mms, MPlayer
none, tel, BrontidesScript

and make user edit uri-action-defaults

that keeps it generic and simple for future protocols, right?

I will update installer tonight (gmt-5 time)

brontide 2008-03-26 13:12

Re: Understanding Maemo Mime handling
 
Just let me know and I'll give it a whirl.

pipeline 2008-03-27 00:43

Re: Understanding Maemo Mime handling
 
Updated installer to support protocol handlers (like tel: )

Version 1.1.2 is here :
http://wardenclyffetower.com/MaemoFi...-1.1.3.all.deb

(you might need to kill any python2.5 task or reboot to make sure the new python file is loaded instead of leftover previously launched dbus-switchboard)

ok in theory this should work with tel: if you just make sure the ur-action-defaults.list has line reading :
Code:

tel-hildon-dbus-switchboard.desktop
Let me know if you run into problems since i cant find any tel links on the internet and they seem weird like not a real file to download.

I do know that after adding support for those protocols, it didnt break my original filetypes :)

I added a column to the xref file to support protocol detection (for when you cant rely on file extension)

so the /home/user/.dbus-switch-xref.cfg now looks like :
Code:

.torrent,Transmission,
.avi,MPlayer,
.wmv,MPlayer,
.mp4,MPlayer,
.mpeg,MPlayer,
.pls,MPlayer-playlist,
.asf,MPlayer-playlist,
.asx,MPlayer-playlist,
.pdf,Evince,
.cbr,Comix,
,BrontideTel,tel:

And I added a line to the /home/user/.dbus-switch-apps.cfg file :
Code:

BrontideTel,cli,call.sh %params%
Let me know if you rename the script or appname, or if you want to bundle it in dbus-switchboard installer.

I'm trying to affect as few files as possible so that no 'magic' is introduced :) Later on i may look into ways of providing shortcuts for auto-configuring (if possible)

YoDude 2008-03-29 14:57

Re: Understanding Maemo Mime handling
 
Quote:

Originally Posted by pipeline (Post 159675)

...I have built a new version with modified dbus-switchboard.desktop and added some entries to apps and xref files. Installer will overwrite apps and xref files so backup if you need to.

Download v1.1.1 here :
http://wardenclyffetower.com/MaemoFi...-1.1.1.all.deb

Then for YoDude, you should be able to just edit (as root) the /usr/share/applications/uri-action-defaults.list file and set the mms line at top to :
mms=hildon-dbus-switchboard.desktop

Then reboot and it should work...


Works like a charm... You guys are the best!

Most excellent application.


All times are GMT. The time now is 20:50.

vBulletin® Version 3.8.8