GNOME Bugzilla – Bug 116749
Integration with dictionary smart bookmarks
Last modified: 2005-01-24 18:04:05 UTC
I'm not quite sure this is the right module to file this bug, but I figure gdict-users are most likely to benefit from this idea. What I would like is for gdict to not just be a dict.org client, but also to be able to interface with dictionary smart bookmarks. I often find myself entering some words in gdict and other words in a galeon/epiphany smart bookmark to get word explanations. Of course this is far from trivial because gdict wouldn't be able to use the default feedback window. The easiest way out would be to call the preferred browser and have it open the requested URL. (This functionality would be very similar to what daveb is trying to achieve with his Open Applet.) Any thoughts?
I don't understand what you are requesting. Could you explain how this would work in gnome-dictionary (ie provide an example of what a user would do ?)
Vincent: for an example of how it could be done, take a look at StarDict (http://stardict.sourceforge.net/), especially the 'search an internet dictionary' function. Advantages of StarDict are: - it doesn't need a local or remote dict.org daemon, but can access dict.org dictionaries nonetheless; - setting up a local dictd is essential if you want more (international) dictionaries than dict.org offers, yet this is totally non obvious; In my 'ideal vision', gdict web dictionaries would seamlessly integrate with epiphany smart bookmarks and/or the epiphany lookup extension.
Above comment needs clarification. What I meant by the second advantage is that the GNOME dictionary needs a dictionary deamon, yet Stardict doesn't. It's unobvious that for more dictionaries to be supported in gdict, you need to connect to a local dictd.
This app looks very good. Actually I was just thinking about integrating the spelling window into the main gnome-dictionary window, and it would end up looking very close to stardict. I'm going to look into translation if I can as well.
I'm looking into how integrating the same "internet search" function into gnome-dictionary, but the UI part worries me. I would be ok with adding a "internet dictionary servers" tab to the preferences. However I don't see how where/how to add the lookup functionality itself. I really don't want to add anything to the gnome-dictionary main window (eg an "internet search" button), so right now I'm leaning towards a menu item - but this is not very discoverable. Adding a "Search more definitions on the internet" link at the end of the definitions would be fine by me too. Any ideas ?
I've talked to Jean-François Rameau who's developing D-BUS functionality for Epiphany. He wants to help with this. My idea is that gdict would tell Epiphany in the background to start querying selected web dictionaries, the moment the user presses the 'Lookup' button. Then there should be an obvious way to open the browser window in case the dict-search doesn't yield satisfactory results. I don't think adding a link at the end of the definitions is a very good way to do it, because it's not immedeately visible. However if you really don't want to add any more buttons to the main window, the only other way I can think of is to add the link at the beginning of the search results. To make the web dictionary search even more useful, it would be nice if gdict would be able to keep track of for which language(s) a dictionary is meant for, and select default(s) based on the current language.
Here is a patch to let the user switch between the regular, dict.org search, and a possible search on a web site via epiphany. The web search part is not hooked up yet (and not even written yet), but could any of you guys try it out and see if the UI looks good to you ? Jean-Francois contacted me about the D-BUS integration with epiphany. I will need some example of how this is done ;-)
Created attachment 34903 [details] [review] patch against CVS New UI to switch between regular search and web search
Could you provide a screenshot? I'm not building from source/cvs here.
Actually there's not much to see, I'm just using a GtkMenuToolButton for the "Look for word" button (like in the epiphany "back" button) - ie a button with a drop-down menu. In the menu you can select between a regular search and a web site search.
Created attachment 34904 [details] screenshot Here is a screenshot showing the drop-down menu arrow...
Created attachment 34905 [details] another screenshot Another shot showing the drop-down menu
I'm OK with this.
Reinout, what is the benefit of using DBUS for querying epiphany ? Like you said in your original report, opening the preferred web browser with a search-specific URL should work very well... With the added benefit that it would work with any browser, whereas the DBUS approach will only work with epiphany. If the user wants to use (let's say) firefox as its default browser, the DBUS approach won't work, right ?
Moreover, if epiphany is not running when we send the DBUS query, we will have to launch it ourselves anyway (right ?). If so, we might as well do all our querying that way. But I may be mistaken.
After discussing the matter with Jean-Francois, we agreed that there is little gain in using the dbus approach right now, so I'm going to implement a web searching with standard application launch (a la gaim). However Jean-Francois is going to look into a possible dbus integration, and should it work well I would be very happy to include it in gnome-dictionary as a "epiphany-only" technique. Right now I'm trying to come up with a good list of URLs for web searching. Up to now I've used the google definition tool : http://www.google.com/search?q=define: There are a couple of URLs in Stardict that I will add too. Any more ideas ?
Vincent, have a look at http://dictionarysearch.mozdev.org/dictionaries.html
Bliss.
Ok, I have implemented something in CVS. It's not perfect but it works. Something I'm not sure about right now is should gdict let the user launch several searches on several different websites ? Or just select one website at a time ?
Created attachment 34921 [details] preferences screenshots As you can see from the screenshot, I have not implemented the Adding/Removing of web search sites, but it should not take too long.
Launching/opening new tab(s) in the preferred browser if !epiphany, and using D-BUS if epiphany is used, sounds fine to me. Note that the Epiphany lookup extension should be cooperating with gdict too. On http://nl.gnome.org/woordenboeken.php we have a few on line dictionaries, here are even more (some might be outdated): http://galeon.sourceforge.net/bookmarks/browse.php?category=Research
I wonder if it would be possible, once a dbus dialogue is established between gdict and epiphany, to just ask epiphany about the smart bookmarks it knows about...
Querying epiphany about smart bookmarks won't be the biggest problem. Knowing which sbms are for dictionaries and which aren't will be much harder. :-)
Ok, the implementation in CVS is now complete, with adding/removing of websites. These are not stored in gconf yet, but I guess they should. Another problem is that to open the browser, right now I'm just calling "gnome-open URL", which does the right thing (ie launching the preferred web browser). However, with this scheme there's no way to detect if epiphany is the standard browser or not, thus it's impossible to pass parameters. How do I get the preferred browser in gnome ? The GConf key /desktop/gnome/applications/browser looked promising, but on my setup it is set to mozilla, and my default browser is epiphany, so...
Vincent, I think the key is /desktop/gnome/url-handlers/http. Have a look at http://cvs.gnome.org/viewcvs/gnome-control-center/capplets/default-applications/gnome-default-applications-properties.c
Thanks J-F, right now gdict * launches web searches in different tabs if your preferred browser is epiphany * launches whatever your preferred browser is if it's not epiphany I have also included a bunch of dictionaries and translation tools from http://dictionarysearch.mozdev.org/dictionaries.html So, what else is left ? I guess the DBUS thing will have to wait a little...
I'm going to mark this as fixed. This is not really a bug anymore, if someone has great ideas on how to better implement this (and I'm sure there are much better ways) please discuss it on the mailing list.