Merge lp:~tombeckmann/pantheon-plugs/gcc-links into lp:~elementary-apps/pantheon-plugs/dynamic-gcc-plug-freya

Proposed by Tom Beckmann
Status: Merged
Merged at revision: 50
Proposed branch: lp:~tombeckmann/pantheon-plugs/gcc-links
Merge into: lp:~elementary-apps/pantheon-plugs/dynamic-gcc-plug-freya
Diff against target: 138 lines (+26/-21)
4 files modified
libgnome-control-center/switchboard-shell.c (+13/-1)
plugs/Bluetooth/BluetoothPlug.vala (+6/-2)
plugs/UniversalAccess/UniversalAccessPlug.vala (+1/-16)
plugs/Wacom/WacomPlug.vala (+6/-2)
To merge this branch: bzr merge lp:~tombeckmann/pantheon-plugs/gcc-links
Reviewer Review Type Date Requested Status
Avi Romanoff Pending
Review via email: mp+226151@code.launchpad.net

This proposal supersedes a proposal from 2014-07-09.

Description of the change

This implements the link functionality in GCC plugs by taking advantage of the single instance system of GApplication, which allows us to just run the switchboard exec to tell the shell to go to a different plug.

To post a comment you must log in.
45. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

46. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

47. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

48. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

49. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

50. By Tom Beckmann

support links in gcc plugs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libgnome-control-center/switchboard-shell.c'
2--- libgnome-control-center/switchboard-shell.c 2014-07-07 22:24:03 +0000
3+++ libgnome-control-center/switchboard-shell.c 2014-08-13 23:34:34 +0000
4@@ -23,7 +23,19 @@
5 _shell_set_active_panel_from_id (CcShell *shell, const gchar **start_id,
6 const gchar **argv, GError **error)
7 {
8- // FIXME do we need this?
9+ GError *e = NULL;
10+ gchar *prog_name;
11+ gchar *app[3];
12+
13+ prog_name = g_getenv ("_");
14+ app[0] = prog_name;
15+ app[1] = start_id;
16+ app[2] = NULL;
17+
18+ if (!g_spawn_async (NULL, app, NULL, G_SPAWN_DEFAULT, NULL, NULL, NULL, &e)) {
19+ g_warning ("Opening link failed: %s", e->message);
20+ g_error_free (e);
21+ }
22 }
23
24 static void
25
26=== modified file 'plugs/Bluetooth/BluetoothPlug.vala'
27--- plugs/Bluetooth/BluetoothPlug.vala 2014-04-14 17:14:38 +0000
28+++ plugs/Bluetooth/BluetoothPlug.vala 2014-08-13 23:34:34 +0000
29@@ -26,12 +26,16 @@
30 private Cc.Panel panel;
31 private Gtk.InfoBar infobar;
32
33+ SwitchboardShell shell;
34+
35 public Plug () {
36 Object (category: Category.NETWORK,
37 code_name: "network-gcc-bluetooth",
38 display_name: GLib.dgettext ("gnome-control-center-2.0", "Bluetooth"),
39 description: GLib.dgettext ("gnome-control-center-2.0", "Configure Bluetooth settings"),
40 icon: "bluetooth");
41+
42+ shell = new SwitchboardShell ();
43 }
44
45 public override Gtk.Widget get_widget () {
46@@ -53,7 +57,7 @@
47 if (GLib.Type.from_name ("CcBluetoothPanel") == 0) {
48 panel = Object.new(typeof(Cc.GnomeCCPanel)) as Cc.Panel;
49 } else {
50- panel = Object.new(GLib.Type.from_name ("CcBluetoothPanel")) as Cc.Panel;
51+ panel = Object.new(GLib.Type.from_name ("CcBluetoothPanel"), "shell", shell.@ref ()) as Cc.Panel;
52 }
53
54 //It's hacky but needed to have it looking good…
55@@ -103,4 +107,4 @@
56 debug ("Activating Bluetooth plug");
57 var plug = new GCC.Bluetooth.Plug ();
58 return plug;
59-}
60\ No newline at end of file
61+}
62
63=== modified file 'plugs/UniversalAccess/UniversalAccessPlug.vala'
64--- plugs/UniversalAccess/UniversalAccessPlug.vala 2014-04-14 17:14:38 +0000
65+++ plugs/UniversalAccess/UniversalAccessPlug.vala 2014-08-13 23:34:34 +0000
66@@ -85,19 +85,6 @@
67 return bin.get_child ();
68 }
69
70- private void eradicate_linkbuttons (Gtk.Container container) {
71- foreach (var child in container.get_children ()) {
72- if (child == null)
73- continue;
74- if (child is Gtk.Container)
75- eradicate_linkbuttons ((Gtk.Container)child);
76- if (child is Gtk.LinkButton) {
77- child.no_show_all = true;
78- child.hide ();
79- }
80- }
81- }
82-
83 public Gtk.Grid shamelessly_copy_notebook (Gtk.Notebook notebook) {
84 notebook.hide ();
85 notebook.no_show_all = true;
86@@ -115,8 +102,6 @@
87 for (int i=0; i<notebook.get_n_pages (); i++) {
88 var widget = notebook.get_nth_page (i);
89 var title = notebook.get_tab_label_text (widget);
90- if (widget is Gtk.Container)
91- eradicate_linkbuttons ((Gtk.Container)widget);
92 widget.unparent ();
93 stack.add_titled (widget, "page #%d".printf (i), title);
94 }
95@@ -147,4 +132,4 @@
96 debug ("Activating UniversalAccess plug");
97 var plug = new GCC.UniversalAccess.Plug ();
98 return plug;
99-}
100\ No newline at end of file
101+}
102
103=== modified file 'plugs/Wacom/WacomPlug.vala'
104--- plugs/Wacom/WacomPlug.vala 2014-04-14 17:14:38 +0000
105+++ plugs/Wacom/WacomPlug.vala 2014-08-13 23:34:34 +0000
106@@ -26,12 +26,16 @@
107 private Gtk.Grid main_grid;
108 private Gtk.InfoBar infobar;
109
110+ SwitchboardShell shell;
111+
112 public Plug () {
113 Object (category: Category.HARDWARE,
114 code_name: "hardware-gcc-wacom",
115 display_name: GLib.dgettext ("gnome-control-center-2.0", "Wacom Tablet"),
116 description: GLib.dgettext ("gnome-control-center-2.0", "Set your Wacom tablet preferences"),
117 icon: "input-tablet");
118+
119+ shell = new SwitchboardShell ();
120 }
121
122 public override Gtk.Widget get_widget () {
123@@ -48,7 +52,7 @@
124 if (GLib.Type.from_name ("CcWacomPanel") == 0) {
125 panel = Object.new(typeof(Cc.GnomeCCPanel)) as Cc.Panel;
126 } else {
127- panel = Object.new(GLib.Type.from_name ("CcWacomPanel")) as Cc.Panel;
128+ panel = Object.new(GLib.Type.from_name ("CcWacomPanel"), "shell", shell.@ref ()) as Cc.Panel;
129 }
130 panel.expand = true;
131 var permission = panel.get_permission();
132@@ -92,4 +96,4 @@
133 debug ("Activating Wacom plug");
134 var plug = new GCC.Wacom.Plug ();
135 return plug;
136-}
137\ No newline at end of file
138+}

Subscribers

People subscribed via source and target branches