Merge lp:~madsa/switchboard/switchboard-fix-1586631 into lp:~elementary-pantheon/switchboard/switchboard

Proposed by Matt Spaulding
Status: Merged
Approved by: Cody Garver
Approved revision: 682
Merged at revision: 682
Proposed branch: lp:~madsa/switchboard/switchboard-fix-1586631
Merge into: lp:~elementary-pantheon/switchboard/switchboard
Diff against target: 39 lines (+14/-1)
1 file modified
src/Switchboard.vala (+14/-1)
To merge this branch: bzr merge lp:~madsa/switchboard/switchboard-fix-1586631
Reviewer Review Type Date Requested Status
Santiago (community) Approve
Review via email: mp+306727@code.launchpad.net

Commit message

Support opening specific plug window from command line

To post a comment you must log in.
Revision history for this message
Santiago (santileortiz) wrote :

I think the documentation should be updated to show that using <plug_name>:<keyword> will call the plug as if <keyword> was searched on switchboard.

Revision history for this message
Santiago (santileortiz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Switchboard.vala'
2--- src/Switchboard.vala 2016-07-30 19:05:42 +0000
3+++ src/Switchboard.vala 2016-09-26 03:11:09 +0000
4@@ -53,6 +53,7 @@
5 private int default_height = 0;
6
7 private static string? plug_to_open = null;
8+ private static string? open_window = null;
9 private static bool opened_directly = false;
10 private static bool should_animate_next_transition = true;
11 private const uint[] NAVIGATION_KEYS = {
12@@ -118,7 +119,13 @@
13
14 // we have an unparsed argument. Assume that it's a gcc plug name
15 if (tmp.length > 1) {
16- plug_to_open = gcc_to_switchboard_code_name (tmp[1]);
17+ if (":" in tmp[1]) {
18+ var parts = tmp[1].split (":");
19+ plug_to_open = gcc_to_switchboard_code_name (parts[0]);
20+ open_window = parts[1];
21+ } else {
22+ plug_to_open = gcc_to_switchboard_code_name (tmp[1]);
23+ }
24 }
25 } catch (Error e) {
26 warning (e.message);
27@@ -215,6 +222,12 @@
28 headerbar.title = plug.display_name;
29 current_plug = plug;
30
31+ // open window was set by command line argument
32+ if (open_window != null) {
33+ plug.search_callback (open_window);
34+ open_window = null;
35+ }
36+
37 switch_to_plug (plug);
38 return false;
39 }, priority);

Subscribers

People subscribed via source and target branches

to all changes: