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 116749 - Integration with dictionary smart bookmarks
Integration with dictionary smart bookmarks
Status: RESOLVED FIXED
Product: gnome-utils
Classification: Deprecated
Component: gdict
trunk
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-utils Maintainers
John Fleck
Depends on:
Blocks:
 
 
Reported: 2003-07-05 11:48 UTC by Reinout van Schouwen
Modified: 2005-01-24 18:04 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
patch against CVS (7.35 KB, patch)
2004-12-16 15:34 UTC, Vincent Noel
committed Details | Review
screenshot (7.62 KB, image/png)
2004-12-16 15:56 UTC, Vincent Noel
  Details
another screenshot (21.02 KB, image/png)
2004-12-16 16:06 UTC, Vincent Noel
  Details
preferences screenshots (40.68 KB, image/png)
2004-12-16 23:53 UTC, Vincent Noel
  Details

Description Reinout van Schouwen 2003-07-05 11:48:48 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?
Comment 1 Vincent Noel 2004-12-03 18:49:05 UTC
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 ?)
Comment 2 Reinout van Schouwen 2004-12-06 16:37:57 UTC
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.
Comment 3 Reinout van Schouwen 2004-12-07 09:58:16 UTC
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.
Comment 4 Vincent Noel 2004-12-07 22:06:14 UTC
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.
Comment 5 Vincent Noel 2004-12-14 16:31:33 UTC
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 ? 
Comment 6 Reinout van Schouwen 2004-12-15 13:45:42 UTC
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.
Comment 7 Vincent Noel 2004-12-16 15:33:59 UTC
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 ;-)
Comment 8 Vincent Noel 2004-12-16 15:34:49 UTC
Created attachment 34903 [details] [review]
patch against CVS

New UI to switch between regular search and web search
Comment 9 Reinout van Schouwen 2004-12-16 15:37:44 UTC
Could you provide a screenshot? I'm not building from source/cvs here.
Comment 10 Vincent Noel 2004-12-16 15:54:38 UTC
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.
Comment 11 Vincent Noel 2004-12-16 15:56:08 UTC
Created attachment 34904 [details]
screenshot

Here is a screenshot showing the drop-down menu arrow...
Comment 12 Vincent Noel 2004-12-16 16:06:25 UTC
Created attachment 34905 [details]
another screenshot

Another shot showing the drop-down menu
Comment 13 Reinout van Schouwen 2004-12-16 16:49:52 UTC
I'm OK with this.
Comment 14 Vincent Noel 2004-12-16 19:01:40 UTC
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 ?
Comment 15 Vincent Noel 2004-12-16 19:03:35 UTC
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.
Comment 16 Vincent Noel 2004-12-16 20:21:44 UTC
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 ?
Comment 17 Jean-François Rameau 2004-12-16 20:27:02 UTC
Vincent,

have a look at http://dictionarysearch.mozdev.org/dictionaries.html
Comment 18 Vincent Noel 2004-12-16 20:43:15 UTC
Bliss.
Comment 19 Vincent Noel 2004-12-16 23:51:26 UTC
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 ?
Comment 20 Vincent Noel 2004-12-16 23:53:42 UTC
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.
Comment 21 Reinout van Schouwen 2004-12-17 00:09:52 UTC
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
Comment 22 Vincent Noel 2004-12-17 00:42:50 UTC
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...
Comment 23 Reinout van Schouwen 2004-12-17 01:21:30 UTC
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. :-)
Comment 24 Vincent Noel 2004-12-17 17:25:03 UTC
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...
Comment 25 Jean-François Rameau 2004-12-17 21:01:42 UTC
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
Comment 26 Vincent Noel 2004-12-17 21:55:35 UTC
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...
Comment 27 Vincent Noel 2005-01-24 18:04:05 UTC
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.