Merge lp:~jeremy-munsch/synapse-project/goldendict-support into lp:synapse-project

Proposed by Jeremy Munsch on 2015-11-11
Status: Needs review
Proposed branch: lp:~jeremy-munsch/synapse-project/goldendict-support
Merge into: lp:synapse-project
Diff against target: 35 lines (+7/-3)
1 file modified
src/plugins/dictionary.vala (+7/-3)
To merge this branch: bzr merge lp:~jeremy-munsch/synapse-project/goldendict-support
Reviewer Review Type Date Requested Status
Rico Tzschichholz 2015-11-11 Pending
Review via email: mp+277287@code.launchpad.net

Description of the change

Add support for goldendict and use it as default if available as it is more complete feature and support lot of info sources.

It should be harmless whether to use gnome-dictionary of goldendict as if the use has goldendict he is likely wanting synapse to use it.

To post a comment you must log in.
616. By Jeremy Munsch on 2015-11-14

core: Handle UriMatches pointing to executable files

617. By Rico Tzschichholz on 2015-11-14

build: Drop optional dependency on gnome-common

618. By Rico Tzschichholz on 2015-11-14

build: Bump requirements glib-2.0 >= 2.40, valac >= 0.24.0

619. By Jeremy Munsch on 2015-11-14

Add support for "Additional applications actions"

Source and evaluate "Desktop Action" groups in desktop-files.

620. By Jeremy Munsch on 2015-11-14

dictionary: Add support for goldendict and use it in priority as it is more recent and complete feature

Jeremy Munsch (jeremy-munsch) wrote :

Just updated the branch and the commit message following recommendations

Unmerged revisions

620. By Jeremy Munsch on 2015-11-14

dictionary: Add support for goldendict and use it in priority as it is more recent and complete feature

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugins/dictionary.vala'
2--- src/plugins/dictionary.vala 2015-09-29 18:25:24 +0000
3+++ src/plugins/dictionary.vala 2015-11-14 23:13:38 +0000
4@@ -45,8 +45,9 @@
5 {
6 try
7 {
8+ var search_command = dictionary_exec == "goldendict" ? "%s \"%s\"" : "%s --look-up=\"%s\"";
9 AppInfo ai = AppInfo.create_from_commandline (
10- "%s --look-up=\"%s\"".printf (dictionary_exec, match.title),
11+ search_command.printf (dictionary_exec, match.title),
12 dictionary_exec, 0);
13 ai.launch (null, null);
14 }
15@@ -74,7 +75,8 @@
16 "accessories-dictionary",
17 register_plugin,
18 Environment.find_program_in_path ("gnome-dictionary") != null
19- || Environment.find_program_in_path ("mate-dictionary") != null,
20+ || Environment.find_program_in_path ("mate-dictionary") != null
21+ || Environment.find_program_in_path ("goldendict") != null,
22 _("No compatible Dictionary installed")
23 );
24 }
25@@ -90,7 +92,9 @@
26 construct
27 {
28 unowned string dictionary_exec;
29- if (Environment.find_program_in_path ("gnome-dictionary") != null)
30+ if (Environment.find_program_in_path ("goldendict") != null)
31+ dictionary_exec = "goldendict";
32+ else if (Environment.find_program_in_path ("gnome-dictionary") != null)
33 dictionary_exec = "gnome-dictionary";
34 else if (Environment.find_program_in_path ("mate-dictionary") != null)
35 dictionary_exec = "mate-dictionary";