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)

pipeline 2008-03-10 23:34

How To : Associate MPlayer, Transmission, and other apps as default handlers
 
3 Attachment(s)
(Minor Update 4/11/09) : New version 1.2.8

- Mime Type integration... mostly you will notice icons for certain filetypes... doc files and excel files have nice icons, and there are simple icons for .cpp, .py, .sh, .csv, .rtf, .cs, .h files.
- Removed Debian Hack since its not needed any more
- Added geany, pygtkeditor, leafpad

Thaks goes to hvacengi for the gui editor, which allows you to configure everything... without having to use xterm.

Dbus-Switchboard Version 1.2.8

You may need a reboot after first install.

Overview :
Normally, the File Manager and web browser can only launch hildonized programs, passing parameters over dbus messaging. DBus-Switchboard intercepts those messages for certain mime types (file types) and passes them over the command-line to programs which were not coded for dbus (like mplayer and transmission).

So basically, you install the dbus-switchboard program. Immediately certain filetypes should be 'activated'... for instance bittorrents and the last chance 'catch-all' mime type : application/octet-stream. Pretty much if your maemo os doesnt know what mime type a file is, then it just calls it application/octet-stream... which will pick up xls, csv, flv, gpx... pretty much all the types which dont already have a nokia app to handle it.

If you want to take over a type currently handled by a maemo application you would load the dbus-switchboard gui program and go to the defaults tab to enable intercept of that mime type. You can find the mime type of a file by tapping-and-holding the file in file manager and choose 'Details' and the 'type' is the entry you will need to intercept in the 'defaults' tab of dbus switchboard gui.

Once intercepted, you will need to have an application in the xref tab which maps the actual file extension of such files to a 'handler' which is specially formed command line for launching programs which accept command line parameters.

So the mapping goes OS->(defaults)->DBus-Switchboard->(xref)->(handlers)-> finally to the app you want to use.

All configuration is done in the (defaults), (xref), and (handlers) tabs.

Parameter Options :
Dbus-Switchboard gets a filename from Dbus when a file is launched from file manager or microb browser... this filename is not always in a format which command line programs understand. I provide several parameter (filename) formats which convert special chars to hex encodings, or vise versa and also provide gnome vfs file format (file://) or traditional volume mounting (/home/user/test.doc)

Example of param evaluations :

%params% : file:///media/mmc1/My%20Sample.doc
%params2% : /media/mmc1/My%20Sample.doc
%realparams% : converts any hex to actual symbols... you will probably need quotes
%realparams2% : same as above but forces filename starts with file://



Main functionality supported :

- AVI support for mplayer (enable video/x-msvideo) in defaults tab
- torrent support for Transmission (automatically enabled application/x-bittorrent)
- XLS and CSV files are now associated with Gnumeric
- XLS support using OpenOffice Calc (debian chroot)
- GPX file support using maemo-mapper
- DOC viewer using Antiword to convert PDF for display (download antiword here).
- DOC, ODT support using OpenOffice Writer (debian chroot)
- PPT (powerpoint) support using OpenOffice Impress (debian chroot)
- Evince for PDFs (enable application/pdf in defaults tab)
- MID (midi file) support for timidity
- Ebook formats PDB, MOBI, CHM, RTF support using fbreader (CHM support in fbreader is limited)

Other programs can be added within the program. To determine the mime type associated with your file, tap-and-hold stylus on you file in File Manager and view details to see the 'type'... if not already associated (and not blank), then that type should be enabled in dbus-switchboard's defaults tab and an appropriate handler and xref should be set up to handle files of similar extension (.rm, .cbz, .mp4)

For FBReader, check out http://memoware.com and look primarily for Plucker, Mobipocket, or RTF. PDB files come in various formats but i have only had luck with the pdb files in Plucker format.

Once installed you can enable and disable which defaults (mime types) dbus-switchboard will intercept. For example, double clicking on 'x-mp3' in the defaults tab will route all mp3's to XMMS by default, or it could go to whatever other program you configure it for.

Currently the main tabs you should use are Xrefs, Handlers, and Defaults (screenshots at end of post). The Urls and Uri tabs are not functional but the should usually not be used anyways.

Parameter handling is inconsistent among the maemo apps available. Some only accept dbus parameters, some only accept command line parameters, some accept both dbus and command line parameters, and some accept neither.

If you attempt to associate an application i haven't configured it for, it may or may not work or require specially forming the command line setting in dbus-switchboard config files before it will accept it. Experiment launching files yourself from xterm to get the command line right.

If you figure out new apps that work, let me know and i'll add them to configuration files.

To debug (if association doesnt work), load in xterm dbus-switchboard.py so that future request are logged (visible) in xterm console. This isnt necessary though since hildon will launch it invisibly if you dont manually have it loaded.

GeraldKo 2008-03-11 00:06

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Thanks for what appears to be a very useful task you've done. I'm not sure I understand it, though. If I install your utility will mplayer, for example, necessarily be selected as my player of, say, mp3 files? What if i wanted them to be played in Canola or in another app? Can I use it to associate other files with programs or are all the associations pre-determined within the utility? I can't remember what, but I know I've wanted to change some associations for file types -- will this utility enable that? Thanks!

pipeline 2008-03-11 00:18

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
(This message is obsolete... it talks about the first, very limited version that i released)
---
right after you install it, nothing immediately is any different.. you need to manually assign the mime types in the /usr/share/applications/defaults.list to hildon-dbus-switchboard.desktop

It is python though, so hardcoded means you could edit the python (text) file in /usr/bin/dbus-switchboard.py to pick any other media player that accepts command line parameters.

Does canola accept command-line parameters? I thought it just used mplayer or media player engine to run video.

Eventually it would be nice to have a separate python program to edit these associations and save config to file... and then make dbus-switchboard read from that configuration file... then you could switch out the associated app on the fly without editing (as root) the python file. I'm not too advanced making python programs so any help would be appreciated.

tsvest 2008-04-21 12:38

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I tried to install the program but it requires additional packages related to Python. Where is the best place to get these? (A direct link would be great)
10x

pipeline 2008-04-23 11:22

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

Originally Posted by tsvest (Post 172554)
I tried to install the program but it requires additional packages related to Python. Where is the best place to get these? (A direct link would be great)
10x

It's in maemo extras i think... make sure to have that repo enabled. With that enabled i should think it would automatically pull in python but you can manually install python runtime using this....

In xterm :
sudo gainroot
apt-get update
apt-get install python2.5-runtime

gigabites 2008-05-08 06:03

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I got .pls, .m3u, and .mp4 t open with KMPlayer. I'm still trying to get .avi and .flv to open with KMPlayer.

newbie tips:
- using emelfm2 to edit the text files makes it all easier (I did it as root)
- I never delete lines, just comment out the line with a # symbol at the beginning of the line (#video/mpeg etc...)
- reboot for it all to take effect. I thought I messed up because nothing worked until I rebooted.
- there may be a slight lag so as pipline said, click your file only once

Hope that helps some people. Thanks goes to pipeline for making my N800 better.

tsvest 2008-05-10 13:00

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

Originally Posted by gigabites (Post 179136)
- using emelfm2 to edit the text files makes it all easier (I did it as root)

Can you please explain exactly how to do that?
Do you become root in xterm and then star emelf2 or you start emelf2 and then gain root?

pipeline 2008-05-10 15:58

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
You become root in xterm, then start emelfm2.

Thats only needed to edit files outside your /home/user directory (usually).

If its a file (outside /home/user) that you want to repeatedly edit, then (while your running emelfm2 in root mode), set permissions to allow user to edit the file. Then the next time you can edit it without root permissions. If its an important system file you might not want to give this write permission to user for security reasons... in that case just xterm/sudo gainroot/ and edit each time.

tsvest 2008-05-10 19:04

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I have enough experience with MS DOS and Windows, but Linux and especially Maemo gives me hard time...
I am able to become root, but when I type emelf2 at the prompt I get
'/bin/sh: emelf2: not found'
Obviously the emelf2 is not in the PATH or whatever is the Maemo equivalent. It is strange for me that when I type mplayer at the prompt mplayer starts...
The obvious solution in such case is to find the exact location of emelf2 and start it with its full path, but I can't get it - I found a reference list with the most useful Linux commands and tried without success 'locate' and 'whereis'...
I found a command that shall do this job in Maemo in another post at ITT:
'find / -name emelf2', but I only get two paths and after them ':Too many open files'
I also tried to use the Find pluging in emelf2 but it crashes every time :( (Does anybody has the same problem?)
I tried the Search program under Applications\Utilities from N800 desktop, just to get disappointed again...

I am used to get full control on my devices/computers, but this is not the case with my N800 - I spend too much time struggling with simple tasks :(

I completely agree with you, pipeline, that changing the file associations is not 'as easy as it should have been in the first place'

I also share the dream of one of the forum members, who wrote that it would be nice to have a switch/option in Control Panel which turns off all restrictions, so the user can realy have full access to the device he bought...

Do I need to install something more to be able to run these commands in xterm?

pipeline 2008-05-10 20:16

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
you're leaving out the second letter 'm' its emelfm2 as in emel filemanager (fm) 2 panes

tsvest 2008-05-11 07:01

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Damn! You are absolutely right, pipeline.
It seems that I have misstyped emelfm2 the first time I entered its name in the console prompt and since the pop up keyboard 'learns' new words it recorded the wrong spelling. Then every time I started typing emelfm2 it suggested emelf2 and I agreed with it... By the way, how can I remove such wrong words from the pop up keyboard dictionary?

This is just another example how big plans can be ruined by a stupid mistake...

I finally made the necessary changes and it seems that this time everything is fine.

gigabites 2008-05-11 09:37

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

I HATE using the terminal but sometimes you just have to, so this is what I did to make it as painless and easy.

In terminal: (make sure you already installed gainroot)
- go to the menu, select tools, then settings, then toolbar settings
- click new
- for demonstrating purposes let's title it "root"
- type in this value s,u,d,o,KP_Space,g,a,i,n,r,o,o,t,KP_Enter
This will make a one click solution to gain root.

Now simply make a new button for "emelfm2" by using the value
e,m,e,l,f,m,2,KP_Enter

cool huh? :D

I can now get root then open emelfm2 with 2 clicks and no terminal typing.

tsvest 2008-05-11 11:15

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Thanks gigabites,
I made these two new buttons for xterm and now emelfm2 as root is just two clicks away :)

I have a small remark for anybody else trying to install these two shortcuts:

Quote:

Originally Posted by gigabites (Post 180310)
- go to the menu, select tools, then settings, then toolbar settings

It is 'Toolbar shortcut' button, not toolbar settings.

tsvest 2008-05-11 14:07

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Now that I managed to do the tricks I have another question:
How to associate application/x-mplayer2 with mplayer?
I added the necessary line in defaults.list, but it does not work. Maybe some other changes should be made.

Edit: I found this file /usr/share/applications/mimeinfo.cache and added in it 'application/x-mplayer2=hildon-dbus-switchboard.desktop'. As far as I can see this is a step in the right direction, but something more should be done as well...

Pipeline, please help. This is an important issue when watching live TV and other embedded content in Windows Media format.

pipeline 2008-05-13 11:01

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

Originally Posted by tsvest (Post 180358)
This is an important issue when watching live TV and other embedded content in Windows Media format.

Embedded, huh? Is that like an embedded video in a webpage? Can you give me web page or file location to use as a sample?

Normally everything can be done using the :
/usr/lib/application/defaults.list,
/home/user/.dbus-switch-xref.cfg, and
/home/user/.dbus-switch-apps.cfg files.

tsvest 2008-05-13 18:20

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Yes, embedded windows media video on a web page. On a windows based PC it appears as a small window in which windows media player displays video.

You may try http://www.utv.bg/
I hope you can open it from your location. This is a Bulgarian site with lots of online television channels. You can change the language from top left and then choose a category and channel to watch. For instance the first channel under weather seems quite watchable.

I also found a thread in ITT about mplayer plugin which seems to do similar job, but I haven't tried it yet. In my opinion it will be better to have application/x-mplayer2 associated with mplayer than using this plugin.

pipeline 2008-05-13 19:16

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Hmm well i went to this link : http://www.utv.bg/cat/cat_13.html
and clicked on watch link for weather channel and it took me to a page with media icon embedded... when i click the icon it loaded dbus-switchboard's 'mplayer-playlist' profile.. launching mplayer standalone and it played fine.

so my question is :
do you want your device to do the same thing or are u asking to embed moving video in webpage.

if u want embedded video u probably need (bundyo's?) plugin.

If launching standalone is fine, make sure you're running dbus-switchboard 1.1.2 and we just need to chase down which association its using.

tsvest 2008-05-13 19:54

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Yes, I prefer to be able to watch the windows media content (application/x-mplayer2) in mplayer standalone. I am able to do this with some channels, but most of the channels don't work this way. For instance http://www.utv.bg/tv/stream.php?code...ksDJ26yGhfdF4e says launching mplayer playlist, but nothing happens. I don't get any error message to understand whether the stream is not working/server is down or mplayer is unable to play such content.

I am running dbus-switchboard 1.1.2.
I checked
/usr/lib/application/defaults.list,
/home/user/.dbus-switch-xref.cfg, and
/home/user/.dbus-switch-apps.cfg files, but I am not sure where and how to put the association of application/x-mplayer2 with mplayer.

pipeline 2008-05-13 21:38

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I think the link you gave doesnt work... it wont even work on my desktop computer.. it looks like your link is meant for a single web session... give me the link to the page which doesnt have a code=LKASJDFLKFJSLDKF parameter in it.

Since you say it said mplayer-playlist that does in fact mean that the mime type has been registered to dbus-switchboard. Once dbus-switchboard is registered (via mimetype) in defaults.list you no longer care about mime type... dbus-switchboard only cares about file extensions like .asx and protocols like mms://

Open xterm and type in :
killall -9 python2.5

That kills any resident dbus-switchboard (might kill any open python apps too though so shut down those gracefully first)

Then from xterm run :
dbus-switchboard.py

Then click your link and go back to xterm to see logged info about filenames being passed to dbus-switchboard. Make sure to find the first filename (could be an asx wrapper to an asf file).

Or give me a better (reusable) link to test with.

tsvest 2008-05-14 04:37

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Yes, I understand that when it says opening mplayer-playlist that means that the mime type has been registered to dbus-switchboard, but I was unable to understand what happens after that. Now, thanks to your advice, I get some feedback from xterm.

It seems that when the embedded content is asx file it gets correctly transfered to mplayer. But when I open for instance http://retv.bg it doesn't work - I got the following in xterm:

dbus-switchboard started
osso_test_receiver: Received an RPC to mime_open.
osso_test_receiver: RPC had arguments /var/tmp/ReTV.
no handler found

Am I right that dbus-switchboard can handle certain file extentions and protocols, but maybe it cannot handle (just for the moment, I hope) appllication/x-mplayer2? That is why, as I've already written, I tried to edit the file /usr/share/applications/mimeinfo.cache, which seems to me that is responsible for handling of the diferent file types.

pipeline 2008-05-14 11:14

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I got it to work using a hack. It actually is an asx file (you can look at the file in /var/tmp/)... it just doesn't have the asx extension. I'm guessing most of these 'no extension' mime launches will be asx so i'll make default.

Would be better to be able so see what mime type launched the callback but i havent found out how to find that out yet.

I'll add this to install later today but here's what i modified in /usr/bin/dbus-switchboard.py :

(at the top, after the argstr = argstr.replace("file:///", "/"), i added :

Code:

    ASXhack = "no"
    if (argstr.find(".") == -1) :
      ASXhack = "yes"
      argstr = argstr + ".asx"

    foundhandler = "no"

then later right in the middle, before i set runcmd (and after system_note_infoprint), i add :
Code:

                        if (ASXhack == "yes") :
                                argstr = argstr.replace(".asx", "")

Indentation is very important in python, so you if you can't get it i'll update later on today.

Also make sure to kill python processes after a change unless u run dbus-switchboard from xterm.

The video does, by the way, look incredible... good quality and perfect aspect ratio.

pipeline 2008-05-14 23:27

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Ok, I've updated dbus-switchboard with the asx hack. Any associated files passed without a file extension will be interpreted as an asx file.

AFAIK, mplayer doesnt handle WMV streams as good as the nokia Media Player. Since your example seems to be a windows media format you might get better results not using dbus switchboard for those asx/asf/wmv mime types. Not sure why that file type would use mime type of mplayer for wmv i guess in most linux distros thats your best bet whereas on maemo nokia probably liscensed paid for wmv codec.

I also added and associated gnumeric files, tweaked mplayer to not log to console (little performance boost to high bandwith vids), and added (but not associated) Timidity for midi's and xarchiver (for whatever types you want).

Note timidity has no ui and cpu is high so you will have to kill task or wait for song to end which is why its not default in xref.

Link to 1.1.3 version in first post.

tsvest 2008-05-15 08:29

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

Last night I made the changes as per your previous post and the hack works fine :)
I did a lot of testing with different streams and I found that there are still many links that didn’t work. They are in format ‘channel.php?some_code’. I’ve read somewhere that this is problem related to Linux – do you know something about this?

You can check the following link as an example http://e-televizor.com/window.php?cid=1525 It produced the following file in /var/tmp/reflector:59936.asx?bkup=21918&prop=e

Code:

<ASX VERSION="3.0">
<ENTRY>
<REF HREF="mms://a1937.l4534659936.c45346.e.lm.akamaistream.net/D/1937/45346/v000 1/reflector:59936" />
</ENTRY>
<ENTRY>
<REF HREF="mms://a1919.l4534621918.c45346.e.lm.akamaistream.net/D/1919/45346/v000 1/reflector:21918" />
</ENTRY>
</ASX>

So this looks again like an .asx file, but for some reason it won’t play in mplayer. Any ideas for hack in this case?

Regarding the previous link a posted: It is the newest online TV in Bulgaria called ReTV. I guess they made a good effort to stick to the contemporary technologies. Unfortunately it plays far away from smooth on my N800. How is it playing on your IT? Do I need to make some changes in the settings of mplayer to improve the playback? It would be nice to have these settings active when dbus-switchboard transfers the link to mplayer.

Ism 2008-05-17 02:23

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

Originally Posted by tsvest (Post 181876)
Thanks pipeline,

Last night I made the changes as per your previous post and the hack works fine :)
I did a lot of testing with different streams and I found that there are still many links that didn’t work. They are in format ‘channel.php?some_code’. I’ve read somewhere that this is problem related to Linux – do you know something about this?

You can check the following link as an example http://e-televizor.com/window.php?cid=1525 It produced the following file in /var/tmp/reflector:59936.asx?bkup=21918&prop=e

Code:

<ASX VERSION="3.0">
<ENTRY>
<REF HREF="mms://a1937.l4534659936.c45346.e.lm.akamaistream.net/D/1937/45346/v000 1/reflector:59936" />
</ENTRY>
<ENTRY>
<REF HREF="mms://a1919.l4534621918.c45346.e.lm.akamaistream.net/D/1919/45346/v000 1/reflector:21918" />
</ENTRY>
</ASX>

So this looks again like an .asx file, but for some reason it won’t play in mplayer. Any ideas for hack in this case?

Regarding the previous link a posted: It is the newest online TV in Bulgaria called ReTV. I guess they made a good effort to stick to the contemporary technologies. Unfortunately it plays far away from smooth on my N800. How is it playing on your IT? Do I need to make some changes in the settings of mplayer to improve the playback? It would be nice to have these settings active when dbus-switchboard transfers the link to mplayer.

Your example link plays quite well (smoothly) with Media player. With mplayer you
can use the mms: address (there is no space in the URL between v000 and the following 1) or watch it with
mplayer -playlist http://mfile.akamai.com/45346/live/reflector:59936.asx
I think the quality is OK. No automation/filetype association here but
this particular channel works OK with my N800.
Thanks for the link.

bunanson 2008-05-17 04:27

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
link works great with N810 too. Thanks,

bun

tsvest 2008-05-17 09:28

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
You guys are welcome. There are a lot of video channels at http://www.e-televizor.com and http://www.utv.bg. Maybe it is a good idea to start another thread where the forum members will post which channels work well on their internet tablets.

However I can't understand what's going on with my NIT :confused:
Indeed http://e-televizor.com/window.php?cid=1525 works now on my N800, but now I am unable to open the stream http://retv.bg/

Also it takes a lot of time to open the streams in MPlayer and then the playback isn't smooth. I checked the MPlayer output in xterm and at a certain stage it says that my device is too slow to play the video :(

pipeline 2008-05-17 12:12

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I would revert the old windows media mime types to point to default mp_ui

some of those wm streams probably use proprietary codecs which mplayer doesnt have or doesnt do as well as the nokia media player which probably liscensed codecs?

also the retv link was very slow for me... like a slideshow... i thought that might have been internet bendwidth since its overseas, but its probably more codec related

Ism 2008-05-17 18:28

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

Originally Posted by tsvest (Post 182612)
You guys are welcome. There are a lot of video channels at http://www.e-televizor.com and http://www.utv.bg. Maybe it is a good idea to start another thread where the forum members will post which channels work well on their internet tablets.
...
Also it takes a lot of time to open the streams in MPlayer and then the playback isn't smooth. I checked the MPlayer output in xterm and at a certain stage it says that my device is too slow to play the video :(

There is already a thread for TV channels which work "well" on their internet tablets:

http://www.internettablettalk.com/fo...ad.php?t=19044

Please add new channels to that thread. It should be greatly
appreciated.

Try to install mplayer version rc1 .27 if you haven't already. It should
be better than previous versions.

ArnimS 2008-06-16 15:57

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
mega-bump. Would this be ui-able?

pipeline 2008-06-16 22:47

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Yes, given enough (some) time. I'm not the best at python user interfaces though so that would be a learning curve (time).

A simple first version UI would just let you maintain apps list and xref lists but would probably require glade.

The uglier question is what to do about defaults.list and sinking (back) to hildon/dbus apps. Sinking to dbus is still a little ugly like if you wanted to pick between mplayer and Media Player... i'm working through that quirkiness in emelfm2 associations to hildon apps but its still very much a hack with shim scripts and dbus messages that i would want to burn some grey matter and testing time on.

qole 2008-06-16 22:54

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I'd be interested in trying something like this, if I knew what was involved in setting up Glade on a development computer and then actually dropping my results into a python app... I'm trying to figure the whole glade-python-tablet thing out right now, since it seems to be the way to go to build a quick UI for tablet apps.

pipeline 2008-06-16 23:04

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
If you've got the interest and time, please do :)

I've installed glade (2?) on ubuntu and used glade in gtk/c# app. Glade is real cool but i dont know how to use from python.

On the desktop side most of what you would do looks like this (ignoring mono stuff) :
http://nat.org/demos/gtksharp.html

Obviously python/glade would be the environment of choice of something like this though.

qole 2008-06-16 23:49

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

Originally Posted by pipeline (Post 192712)
Glade is real cool but i dont know how to use from python.

I know people here are using it; GrandCentral Dialer's UI was done using Glade and it is powered by Python.

pipeline 2008-06-17 01:22

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
I think zerion's Maqii port has a python/glade launcher if you wanted to look at that code too.

hvacengi 2008-06-18 14:33

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
If you want some one to work on a Glade interface, I can free up some time this weekend to work on one. I'd probably need to coordinate closely with pipeline to make sure I interface with his files well, and I'd have to figure out the whole sudoers thing. But after that, it should just be tree lists.

Really, you could do it without glade. I'd say start out with a tree view populated with each mime type (maybe a button at the bottom to switch between file and url?). Off of the main menu would be options to add/modify the mime types, and an option to modify the apps that launch. Double tapping on an mime type in the tree view pops up a dialog box to change that type's handler (OK, Cancel). At the bottom of that first screen, and on the menu, I'd have options to save and to reset. And closing without saving will prompt "Do you want to save."

Like I said, if you want some one to work on coding it, I'll free up some time. If qole or pipeline is already working on it though, I'll leave it to them.

qole 2008-06-18 16:33

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Hi, I'm not working on it, I've just installed Glade on my PC at home, I'm going to take a while to get up to speed ;)

I would like to have some way to mark multiple handlers for an event, which means a dialog box pops up when a file of that type is clicked. "Which program do you want to use?"

Also, I would like to have a way to mark mime types as, "ask user" even if there's only one program selected.

I would also like a custom mplayer dialog box that asks the user for the aspect ratio if none can be determined, etc, but I think that should be part of this project

pipeline 2008-06-18 23:01

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Thanks all, sure if you find time to mess with a ui front end, by all means please do :)

Without knowing how hard this would be for you, I would think first iteration would be to just keep 1:1 and also not directly update defaults.list. The file format is simple csv format although i'm not keeping them in memory... i created file manually and just stream though it at run time.

Also dbus-switchboard runs as user (as it should) so it can't directly update the defaults.list. Perhaps first iteration could dump association lines to textbox for user to copy/paste? Or append commented blocks to default.list for user to uncomment and comment the existing matching line.

Feel free to pm if you want to coordinate anything.

debernardis 2008-06-19 05:35

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
dbus-switchboard allowed me to associate .odt files with openoffice writer (chrooted as described elsewhere).
In defaults.list put "application/octet-stream=hildon-dbus-switchboard.desktop" as stated by pipeline for files unknown by hildon.
In .dbus-switch-apps.cfg add
Code:

Oowriter,cli,debbie oowriter "%params%"
(double quotes were needed in my hands to allow filenames containing spaces).
In .dbus-switch-xref.cfg add
Code:

.odt,Oowriter,
.
This was enough. Other ooo files should be easy as well, but I have to test yet.

hvacengi 2008-06-26 00:20

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Just wanted to give you a bit of an update: I didn't find as much time as I thought I could this weekend (I had to buy fireworks instead), but I have indeed started on writing a gui for the switchboard. I've kind of gone in a different direction from what I thought initially, and glade quickly became required rather than a choice. I should have something atleast to Pipeline to look at by this weekend. With any luck, it will be available for download shortly there after. Assuming, of course, that I don't run into any major issues when I flash to Diablo...

pipeline 2008-06-26 01:28

Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
 
Fireworks should always take priority over any tablet development... you chose wisely... especially if it was a shady deal for the 'good stuff'.


All times are GMT. The time now is 02:59.

vBulletin® Version 3.8.8