Merge lp:~parnold-x/slingshot/switchboard-plugin into lp:~elementary-pantheon/slingshot/trunk
- switchboard-plugin
- Merge into trunk
Proposed by
Djax
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Danielle Foré | ||||
Approved revision: | 546 | ||||
Merged at revision: | 571 | ||||
Proposed branch: | lp:~parnold-x/slingshot/switchboard-plugin | ||||
Merge into: | lp:~elementary-pantheon/slingshot/trunk | ||||
Diff against target: |
501 lines (+297/-123) 5 files modified
lib/synapse-plugins/CMakeLists.txt (+2/-0) lib/synapse-plugins/switchboard-plugin.vala (+152/-0) po/slingshot.pot (+135/-123) src/Backend/SynapseSearch.vala (+1/-0) src/Widgets/SearchView.vala (+7/-0) |
||||
To merge this branch: | bzr merge lp:~parnold-x/slingshot/switchboard-plugin | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
elementary Pantheon team | Pending | ||
Review via email: mp+261015@code.launchpad.net |
Commit message
Get Switchboard plugs from Switchboard API instead of requiring .desktops
Description of the change
Add a slingshot synapse plugin that get the plugs from the Switchboard API and show these plugs in a new "Settings" category.
To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/synapse-plugins/CMakeLists.txt' | |||
2 | --- lib/synapse-plugins/CMakeLists.txt 2015-05-20 17:13:27 +0000 | |||
3 | +++ lib/synapse-plugins/CMakeLists.txt 2015-06-03 19:12:20 +0000 | |||
4 | @@ -6,6 +6,7 @@ | |||
5 | 6 | gio-unix-2.0 | 6 | gio-unix-2.0 |
6 | 7 | gee-0.8 | 7 | gee-0.8 |
7 | 8 | gtk+-3.0 | 8 | gtk+-3.0 |
8 | 9 | switchboard-2.0 | ||
9 | 9 | ) | 10 | ) |
10 | 10 | 11 | ||
11 | 11 | pkg_check_modules(PLUGINS_DEPS REQUIRED ${PLUGINS_PKG}) | 12 | pkg_check_modules(PLUGINS_DEPS REQUIRED ${PLUGINS_PKG}) |
12 | @@ -14,6 +15,7 @@ | |||
13 | 14 | calculator-plugin.vala | 15 | calculator-plugin.vala |
14 | 15 | command-plugin.vala | 16 | command-plugin.vala |
15 | 16 | desktop-file-plugin.vala | 17 | desktop-file-plugin.vala |
16 | 18 | switchboard-plugin.vala | ||
17 | 17 | system-managment.vala | 19 | system-managment.vala |
18 | 18 | ) | 20 | ) |
19 | 19 | 21 | ||
20 | 20 | 22 | ||
21 | === added file 'lib/synapse-plugins/switchboard-plugin.vala' | |||
22 | --- lib/synapse-plugins/switchboard-plugin.vala 1970-01-01 00:00:00 +0000 | |||
23 | +++ lib/synapse-plugins/switchboard-plugin.vala 2015-06-03 19:12:20 +0000 | |||
24 | @@ -0,0 +1,152 @@ | |||
25 | 1 | /* | ||
26 | 2 | * Copyright (C) 2015 Peter Arnold | ||
27 | 3 | * | ||
28 | 4 | * This program is free software; you can redistribute it and/or modify | ||
29 | 5 | * it under the terms of the GNU General Public License as published by | ||
30 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
31 | 7 | * (at your option) any later version. | ||
32 | 8 | * | ||
33 | 9 | * This program is distributed in the hope that it will be useful, | ||
34 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
35 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
36 | 12 | * GNU General Public License for more details. | ||
37 | 13 | * | ||
38 | 14 | * You should have received a copy of the GNU General Public License | ||
39 | 15 | * along with this program; if not, write to the Free Software | ||
40 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
41 | 17 | * | ||
42 | 18 | * Authored by Peter Arnold | ||
43 | 19 | * | ||
44 | 20 | */ | ||
45 | 21 | |||
46 | 22 | namespace Synapse { | ||
47 | 23 | public class SwitchboardPlugin : Object, Activatable, ItemProvider { | ||
48 | 24 | |||
49 | 25 | public bool enabled { get; set; default = true; } | ||
50 | 26 | |||
51 | 27 | public SwitchboardPlugin() { | ||
52 | 28 | |||
53 | 29 | } | ||
54 | 30 | |||
55 | 31 | public void activate () { | ||
56 | 32 | |||
57 | 33 | } | ||
58 | 34 | |||
59 | 35 | public void deactivate () { | ||
60 | 36 | |||
61 | 37 | } | ||
62 | 38 | |||
63 | 39 | public class SwitchboardObject: Object, Match, ApplicationMatch { | ||
64 | 40 | // for Match interface | ||
65 | 41 | public string title { get; construct set; } | ||
66 | 42 | public string description { get; set; default = ""; } | ||
67 | 43 | public string icon_name { get; construct set; default = ""; } | ||
68 | 44 | public bool has_thumbnail { get; construct set; default = false; } | ||
69 | 45 | public string thumbnail_path { get; construct set; } | ||
70 | 46 | public MatchType match_type { get; construct set; } | ||
71 | 47 | |||
72 | 48 | // for ApplicationMatch | ||
73 | 49 | public AppInfo? app_info { get; set; default = null; } | ||
74 | 50 | public bool needs_terminal { get; set; default = false; } | ||
75 | 51 | public string? filename { get; construct set; default = null; } | ||
76 | 52 | public string plug { get; construct set; } | ||
77 | 53 | |||
78 | 54 | public SwitchboardObject (PlugInfo plug_info) { | ||
79 | 55 | Object (title: plug_info.title, description: _ ("Open %s settings").printf (plug_info.title), | ||
80 | 56 | plug: plug_info.code_name, icon_name: plug_info.icon, match_type: MatchType.APPLICATION); | ||
81 | 57 | |||
82 | 58 | try { | ||
83 | 59 | var cmd = "/usr/bin/switchboard -o %s".printf (plug_info.code_name); | ||
84 | 60 | app_info = AppInfo.create_from_commandline (cmd, null, 0); | ||
85 | 61 | } catch (Error err) { | ||
86 | 62 | warning ("%s", err.message); | ||
87 | 63 | } | ||
88 | 64 | } | ||
89 | 65 | } | ||
90 | 66 | |||
91 | 67 | static void register_plugin () { | ||
92 | 68 | DataSink.PluginRegistry.get_default ().register_plugin ( | ||
93 | 69 | typeof (SwitchboardPlugin), | ||
94 | 70 | "Switchboard Search", | ||
95 | 71 | _ ("Find switchboard plugs and open them."), | ||
96 | 72 | "preferences-desktop", | ||
97 | 73 | register_plugin | ||
98 | 74 | ); | ||
99 | 75 | } | ||
100 | 76 | |||
101 | 77 | static construct { | ||
102 | 78 | register_plugin (); | ||
103 | 79 | } | ||
104 | 80 | private Gee.ArrayList<PlugInfo> plugs; | ||
105 | 81 | |||
106 | 82 | construct { | ||
107 | 83 | plugs = new Gee.ArrayList<PlugInfo> (); | ||
108 | 84 | load_plugs.begin (); | ||
109 | 85 | } | ||
110 | 86 | |||
111 | 87 | public class PlugInfo : GLib.Object { | ||
112 | 88 | public string title { get; construct set; } | ||
113 | 89 | public string code_name { get; construct set; } | ||
114 | 90 | public string icon { get; construct set; } | ||
115 | 91 | |||
116 | 92 | public PlugInfo (string plug_title, string code_name, string icon) { | ||
117 | 93 | Object (title: plug_title, code_name: code_name, icon: icon); | ||
118 | 94 | } | ||
119 | 95 | } | ||
120 | 96 | |||
121 | 97 | private bool loading_in_progress = false; | ||
122 | 98 | public signal void load_complete (); | ||
123 | 99 | |||
124 | 100 | private async void load_plugs () { | ||
125 | 101 | loading_in_progress = true; | ||
126 | 102 | Idle.add_full (Priority.LOW, load_plugs.callback); | ||
127 | 103 | yield; | ||
128 | 104 | |||
129 | 105 | foreach (var plug in Switchboard.PlugsManager.get_default ().get_plugs ()) { | ||
130 | 106 | plugs.add (new PlugInfo (plug.display_name, plug.code_name, plug.icon)); | ||
131 | 107 | } | ||
132 | 108 | loading_in_progress = false; | ||
133 | 109 | load_complete (); | ||
134 | 110 | } | ||
135 | 111 | |||
136 | 112 | public async ResultSet? search (Query q) throws SearchError { | ||
137 | 113 | if (loading_in_progress) { | ||
138 | 114 | // wait | ||
139 | 115 | ulong signal_id = this.load_complete.connect (() => { | ||
140 | 116 | search.callback (); | ||
141 | 117 | }); | ||
142 | 118 | yield; | ||
143 | 119 | SignalHandler.disconnect (this, signal_id); | ||
144 | 120 | } else { | ||
145 | 121 | Idle.add_full (Priority.HIGH_IDLE, search.callback); | ||
146 | 122 | yield; | ||
147 | 123 | } | ||
148 | 124 | |||
149 | 125 | var result = new ResultSet (); | ||
150 | 126 | MatcherFlags flags; | ||
151 | 127 | if (q.query_string.length == 1) { | ||
152 | 128 | flags = MatcherFlags.NO_SUBSTRING | MatcherFlags.NO_PARTIAL | | ||
153 | 129 | MatcherFlags.NO_FUZZY; | ||
154 | 130 | } else { | ||
155 | 131 | flags = 0; | ||
156 | 132 | } | ||
157 | 133 | var matchers = Query.get_matchers_for_query (q.query_string_folded, flags); | ||
158 | 134 | |||
159 | 135 | string stripped = q.query_string.strip (); | ||
160 | 136 | if (stripped == "") return null; | ||
161 | 137 | |||
162 | 138 | foreach (var plug in plugs) { | ||
163 | 139 | foreach (var matcher in matchers) { | ||
164 | 140 | MatchInfo info; | ||
165 | 141 | if (matcher.key.match (plug.title.down (), 0, out info)) { | ||
166 | 142 | result.add (new SwitchboardObject (plug), Match.Score.AVERAGE + Match.Score.INCREMENT_MEDIUM); | ||
167 | 143 | break; | ||
168 | 144 | } | ||
169 | 145 | } | ||
170 | 146 | } | ||
171 | 147 | q.check_cancellable (); | ||
172 | 148 | |||
173 | 149 | return result; | ||
174 | 150 | } | ||
175 | 151 | } | ||
176 | 152 | } | ||
177 | 0 | \ No newline at end of file | 153 | \ No newline at end of file |
178 | 1 | 154 | ||
179 | === modified file 'po/slingshot.pot' | |||
180 | --- po/slingshot.pot 2015-05-29 01:01:19 +0000 | |||
181 | +++ po/slingshot.pot 2015-06-03 19:12:20 +0000 | |||
182 | @@ -8,7 +8,7 @@ | |||
183 | 8 | msgstr "" | 8 | msgstr "" |
184 | 9 | "Project-Id-Version: PACKAGE VERSION\n" | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
185 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
187 | 11 | "POT-Creation-Date: 2015-05-28 20:01-0500\n" | 11 | "POT-Creation-Date: 2015-06-03 20:59+0200\n" |
188 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
189 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
190 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
191 | @@ -17,6 +17,58 @@ | |||
192 | 17 | "Content-Type: text/plain; charset=UTF-8\n" | 17 | "Content-Type: text/plain; charset=UTF-8\n" |
193 | 18 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
194 | 19 | 19 | ||
195 | 20 | #: ../src/Widgets/SearchView.vala:160 | ||
196 | 21 | msgid "Other" | ||
197 | 22 | msgstr "" | ||
198 | 23 | |||
199 | 24 | #: ../src/Widgets/SearchView.vala:163 | ||
200 | 25 | msgid "Text" | ||
201 | 26 | msgstr "" | ||
202 | 27 | |||
203 | 28 | #: ../src/Widgets/SearchView.vala:166 | ||
204 | 29 | msgid "Applications" | ||
205 | 30 | msgstr "" | ||
206 | 31 | |||
207 | 32 | #: ../src/Widgets/SearchView.vala:169 | ||
208 | 33 | msgid "Files" | ||
209 | 34 | msgstr "" | ||
210 | 35 | |||
211 | 36 | #: ../src/Widgets/SearchView.vala:172 | ||
212 | 37 | msgid "Actions" | ||
213 | 38 | msgstr "" | ||
214 | 39 | |||
215 | 40 | #: ../src/Widgets/SearchView.vala:175 | ||
216 | 41 | msgid "Search" | ||
217 | 42 | msgstr "" | ||
218 | 43 | |||
219 | 44 | #: ../src/Widgets/SearchView.vala:178 | ||
220 | 45 | msgid "Contacts" | ||
221 | 46 | msgstr "" | ||
222 | 47 | |||
223 | 48 | #: ../src/Widgets/SearchView.vala:181 | ||
224 | 49 | msgid "Internet" | ||
225 | 50 | msgstr "" | ||
226 | 51 | |||
227 | 52 | #: ../src/Widgets/SearchView.vala:184 | ||
228 | 53 | msgid "Settings" | ||
229 | 54 | msgstr "" | ||
230 | 55 | |||
231 | 56 | #: ../src/Widgets/AppEntry.vala:195 | ||
232 | 57 | msgid "Remove from _Dock" | ||
233 | 58 | msgstr "" | ||
234 | 59 | |||
235 | 60 | #: ../src/Widgets/AppEntry.vala:197 | ||
236 | 61 | msgid "Add to _Dock" | ||
237 | 62 | msgstr "" | ||
238 | 63 | |||
239 | 64 | #: ../src/Widgets/CategoryView.vala:27 | ||
240 | 65 | msgid "All Applications" | ||
241 | 66 | msgstr "" | ||
242 | 67 | |||
243 | 68 | #: ../src/Widgets/CategoryView.vala:28 | ||
244 | 69 | msgid "Create a new Filter" | ||
245 | 70 | msgstr "" | ||
246 | 71 | |||
247 | 20 | #: ../src/Backend/App.vala:108 | 72 | #: ../src/Backend/App.vala:108 |
248 | 21 | msgid "Run this command…" | 73 | msgid "Run this command…" |
249 | 22 | msgstr "" | 74 | msgstr "" |
250 | @@ -33,52 +85,88 @@ | |||
251 | 33 | msgid "Search Apps" | 85 | msgid "Search Apps" |
252 | 34 | msgstr "" | 86 | msgstr "" |
253 | 35 | 87 | ||
300 | 36 | #: ../src/Widgets/CategoryView.vala:27 | 88 | #: ../lib/synapse-plugins/system-managment.vala:103 |
301 | 37 | msgid "All Applications" | 89 | msgid "Suspend" |
302 | 38 | msgstr "" | 90 | msgstr "" |
303 | 39 | 91 | ||
304 | 40 | #: ../src/Widgets/CategoryView.vala:28 | 92 | #: ../lib/synapse-plugins/system-managment.vala:104 |
305 | 41 | msgid "Create a new Filter" | 93 | msgid "Put your computer into suspend mode" |
306 | 42 | msgstr "" | 94 | msgstr "" |
307 | 43 | 95 | ||
308 | 44 | #: ../src/Widgets/AppEntry.vala:195 | 96 | #: ../lib/synapse-plugins/system-managment.vala:203 |
309 | 45 | msgid "Remove from _Dock" | 97 | msgid "Hibernate" |
310 | 46 | msgstr "" | 98 | msgstr "" |
311 | 47 | 99 | ||
312 | 48 | #: ../src/Widgets/AppEntry.vala:197 | 100 | #: ../lib/synapse-plugins/system-managment.vala:204 |
313 | 49 | msgid "Add to _Dock" | 101 | msgid "Put your computer into hibernation mode" |
314 | 50 | msgstr "" | 102 | msgstr "" |
315 | 51 | 103 | ||
316 | 52 | #: ../src/Widgets/SearchView.vala:156 | 104 | #: ../lib/synapse-plugins/system-managment.vala:302 |
317 | 53 | msgid "Other" | 105 | msgid "Shut Down" |
318 | 54 | msgstr "" | 106 | msgstr "" |
319 | 55 | 107 | ||
320 | 56 | #: ../src/Widgets/SearchView.vala:159 | 108 | #: ../lib/synapse-plugins/system-managment.vala:303 |
321 | 57 | msgid "Text" | 109 | msgid "Turn your computer off" |
322 | 58 | msgstr "" | 110 | msgstr "" |
323 | 59 | 111 | ||
324 | 60 | #: ../src/Widgets/SearchView.vala:162 | 112 | #: ../lib/synapse-plugins/system-managment.vala:386 |
325 | 61 | msgid "Applications" | 113 | msgid "Restart" |
326 | 62 | msgstr "" | 114 | msgstr "" |
327 | 63 | 115 | ||
328 | 64 | #: ../src/Widgets/SearchView.vala:165 | 116 | #: ../lib/synapse-plugins/system-managment.vala:387 |
329 | 65 | msgid "Files" | 117 | msgid "Restart your computer" |
330 | 66 | msgstr "" | 118 | msgstr "" |
331 | 67 | 119 | ||
332 | 68 | #: ../src/Widgets/SearchView.vala:168 | 120 | #: ../lib/synapse-plugins/system-managment.vala:471 |
333 | 69 | msgid "Actions" | 121 | msgid "Suspend, hibernate, restart or shutdown your computer." |
334 | 70 | msgstr "" | 122 | msgstr "" |
335 | 71 | 123 | ||
336 | 72 | #: ../src/Widgets/SearchView.vala:171 | 124 | #: ../lib/synapse-plugins/system-managment.vala:476 |
337 | 73 | msgid "Search" | 125 | msgid "ConsoleKit wasn't found" |
338 | 74 | msgstr "" | 126 | msgstr "" |
339 | 75 | 127 | ||
340 | 76 | #: ../src/Widgets/SearchView.vala:174 | 128 | #: ../lib/synapse-plugins/desktop-file-plugin.vala:94 |
341 | 77 | msgid "Contacts" | 129 | msgid "Search for and run applications on your computer." |
342 | 78 | msgstr "" | 130 | msgstr "" |
343 | 79 | 131 | ||
344 | 80 | #: ../src/Widgets/SearchView.vala:177 | 132 | #: ../lib/synapse-plugins/desktop-file-plugin.vala:283 |
345 | 81 | msgid "Internet" | 133 | msgid "Open with %s" |
346 | 134 | msgstr "" | ||
347 | 135 | |||
348 | 136 | #: ../lib/synapse-plugins/desktop-file-plugin.vala:285 | ||
349 | 137 | msgid "Opens current selection using %s" | ||
350 | 138 | msgstr "" | ||
351 | 139 | |||
352 | 140 | #: ../lib/synapse-plugins/command-plugin.vala:56 | ||
353 | 141 | msgid "Execute '%s'" | ||
354 | 142 | msgstr "" | ||
355 | 143 | |||
356 | 144 | #: ../lib/synapse-plugins/command-plugin.vala:56 | ||
357 | 145 | msgid "Run command" | ||
358 | 146 | msgstr "" | ||
359 | 147 | |||
360 | 148 | #: ../lib/synapse-plugins/command-plugin.vala:77 | ||
361 | 149 | msgid "Find and execute arbitrary commands." | ||
362 | 150 | msgstr "" | ||
363 | 151 | |||
364 | 152 | #: ../lib/synapse-plugins/calculator-plugin.vala:63 | ||
365 | 153 | msgid "Calculator" | ||
366 | 154 | msgstr "" | ||
367 | 155 | |||
368 | 156 | #: ../lib/synapse-plugins/calculator-plugin.vala:64 | ||
369 | 157 | msgid "Calculate basic expressions." | ||
370 | 158 | msgstr "" | ||
371 | 159 | |||
372 | 160 | #: ../lib/synapse-plugins/calculator-plugin.vala:68 | ||
373 | 161 | msgid "bc is not installed" | ||
374 | 162 | msgstr "" | ||
375 | 163 | |||
376 | 164 | #: ../lib/synapse-plugins/switchboard-plugin.vala:55 | ||
377 | 165 | msgid "Open %s settings" | ||
378 | 166 | msgstr "" | ||
379 | 167 | |||
380 | 168 | #: ../lib/synapse-plugins/switchboard-plugin.vala:71 | ||
381 | 169 | msgid "Find switchboard plugs and open them." | ||
382 | 82 | msgstr "" | 170 | msgstr "" |
383 | 83 | 171 | ||
384 | 84 | #: ../lib/synapse-core/common-actions.vala:77 | 172 | #: ../lib/synapse-core/common-actions.vala:77 |
385 | @@ -120,79 +208,3 @@ | |||
386 | 120 | #: ../lib/synapse-core/common-actions.vala:294 | 208 | #: ../lib/synapse-core/common-actions.vala:294 |
387 | 121 | msgid "Copy selection to clipboard" | 209 | msgid "Copy selection to clipboard" |
388 | 122 | msgstr "" | 210 | msgstr "" |
389 | 123 | |||
390 | 124 | #: ../lib/synapse-plugins/desktop-file-plugin.vala:94 | ||
391 | 125 | msgid "Search for and run applications on your computer." | ||
392 | 126 | msgstr "" | ||
393 | 127 | |||
394 | 128 | #: ../lib/synapse-plugins/desktop-file-plugin.vala:283 | ||
395 | 129 | msgid "Open with %s" | ||
396 | 130 | msgstr "" | ||
397 | 131 | |||
398 | 132 | #: ../lib/synapse-plugins/desktop-file-plugin.vala:285 | ||
399 | 133 | msgid "Opens current selection using %s" | ||
400 | 134 | msgstr "" | ||
401 | 135 | |||
402 | 136 | #: ../lib/synapse-plugins/command-plugin.vala:56 | ||
403 | 137 | msgid "Execute '%s'" | ||
404 | 138 | msgstr "" | ||
405 | 139 | |||
406 | 140 | #: ../lib/synapse-plugins/command-plugin.vala:56 | ||
407 | 141 | msgid "Run command" | ||
408 | 142 | msgstr "" | ||
409 | 143 | |||
410 | 144 | #: ../lib/synapse-plugins/command-plugin.vala:77 | ||
411 | 145 | msgid "Find and execute arbitrary commands." | ||
412 | 146 | msgstr "" | ||
413 | 147 | |||
414 | 148 | #: ../lib/synapse-plugins/calculator-plugin.vala:63 | ||
415 | 149 | msgid "Calculator" | ||
416 | 150 | msgstr "" | ||
417 | 151 | |||
418 | 152 | #: ../lib/synapse-plugins/calculator-plugin.vala:64 | ||
419 | 153 | msgid "Calculate basic expressions." | ||
420 | 154 | msgstr "" | ||
421 | 155 | |||
422 | 156 | #: ../lib/synapse-plugins/calculator-plugin.vala:68 | ||
423 | 157 | msgid "bc is not installed" | ||
424 | 158 | msgstr "" | ||
425 | 159 | |||
426 | 160 | #: ../lib/synapse-plugins/system-managment.vala:103 | ||
427 | 161 | msgid "Suspend" | ||
428 | 162 | msgstr "" | ||
429 | 163 | |||
430 | 164 | #: ../lib/synapse-plugins/system-managment.vala:104 | ||
431 | 165 | msgid "Put your computer into suspend mode" | ||
432 | 166 | msgstr "" | ||
433 | 167 | |||
434 | 168 | #: ../lib/synapse-plugins/system-managment.vala:203 | ||
435 | 169 | msgid "Hibernate" | ||
436 | 170 | msgstr "" | ||
437 | 171 | |||
438 | 172 | #: ../lib/synapse-plugins/system-managment.vala:204 | ||
439 | 173 | msgid "Put your computer into hibernation mode" | ||
440 | 174 | msgstr "" | ||
441 | 175 | |||
442 | 176 | #: ../lib/synapse-plugins/system-managment.vala:302 | ||
443 | 177 | msgid "Shut Down" | ||
444 | 178 | msgstr "" | ||
445 | 179 | |||
446 | 180 | #: ../lib/synapse-plugins/system-managment.vala:303 | ||
447 | 181 | msgid "Turn your computer off" | ||
448 | 182 | msgstr "" | ||
449 | 183 | |||
450 | 184 | #: ../lib/synapse-plugins/system-managment.vala:386 | ||
451 | 185 | msgid "Restart" | ||
452 | 186 | msgstr "" | ||
453 | 187 | |||
454 | 188 | #: ../lib/synapse-plugins/system-managment.vala:387 | ||
455 | 189 | msgid "Restart your computer" | ||
456 | 190 | msgstr "" | ||
457 | 191 | |||
458 | 192 | #: ../lib/synapse-plugins/system-managment.vala:471 | ||
459 | 193 | msgid "Suspend, hibernate, restart or shutdown your computer." | ||
460 | 194 | msgstr "" | ||
461 | 195 | |||
462 | 196 | #: ../lib/synapse-plugins/system-managment.vala:476 | ||
463 | 197 | msgid "ConsoleKit wasn't found" | ||
464 | 198 | msgstr "" | ||
465 | 199 | 211 | ||
466 | === modified file 'src/Backend/SynapseSearch.vala' | |||
467 | --- src/Backend/SynapseSearch.vala 2015-05-20 17:13:27 +0000 | |||
468 | +++ src/Backend/SynapseSearch.vala 2015-06-03 19:12:20 +0000 | |||
469 | @@ -24,6 +24,7 @@ | |||
470 | 24 | typeof (Synapse.CalculatorPlugin), | 24 | typeof (Synapse.CalculatorPlugin), |
471 | 25 | typeof (Synapse.CommandPlugin), | 25 | typeof (Synapse.CommandPlugin), |
472 | 26 | typeof (Synapse.DesktopFilePlugin), | 26 | typeof (Synapse.DesktopFilePlugin), |
473 | 27 | typeof (Synapse.SwitchboardPlugin), | ||
474 | 27 | typeof (Synapse.SystemManagementPlugin) | 28 | typeof (Synapse.SystemManagementPlugin) |
475 | 28 | }; | 29 | }; |
476 | 29 | 30 | ||
477 | 30 | 31 | ||
478 | === modified file 'src/Widgets/SearchView.vala' | |||
479 | --- src/Widgets/SearchView.vala 2015-05-29 00:40:47 +0000 | |||
480 | +++ src/Widgets/SearchView.vala 2015-06-03 19:12:20 +0000 | |||
481 | @@ -128,6 +128,10 @@ | |||
482 | 128 | || uri.has_prefix ("https://")) | 128 | || uri.has_prefix ("https://")) |
483 | 129 | type = 8; | 129 | type = 8; |
484 | 130 | } | 130 | } |
485 | 131 | // we're cheating again and assign switchboard plugs to a separate category. | ||
486 | 132 | // We assign 9 as the id for settings results | ||
487 | 133 | if (match is Synapse.SwitchboardPlugin.SwitchboardObject) | ||
488 | 134 | type = 9; | ||
489 | 131 | 135 | ||
490 | 132 | if ((list = categories.get (type)) == null) { | 136 | if ((list = categories.get (type)) == null) { |
491 | 133 | list = new Gee.LinkedList<Synapse.Match> (); | 137 | list = new Gee.LinkedList<Synapse.Match> (); |
492 | @@ -176,6 +180,9 @@ | |||
493 | 176 | case 8: | 180 | case 8: |
494 | 177 | label = _("Internet"); | 181 | label = _("Internet"); |
495 | 178 | break; | 182 | break; |
496 | 183 | case 9: | ||
497 | 184 | label = _("Settings"); | ||
498 | 185 | break; | ||
499 | 179 | } | 186 | } |
500 | 180 | 187 | ||
501 | 181 | var header = new Gtk.Label (label); | 188 | var header = new Gtk.Label (label); |
Plugin works as expected here! So we will only need to stop shipping .desktops with plugs