Merge lp:~shnatsel/switchboard-plug-about/invoke-web-browser-properly into lp:~elementary-apps/switchboard-plug-about/trunk

Proposed by Sergey "Shnatsel" Davidoff
Status: Merged
Merged at revision: 66
Proposed branch: lp:~shnatsel/switchboard-plug-about/invoke-web-browser-properly
Merge into: lp:~elementary-apps/switchboard-plug-about/trunk
Diff against target: 35 lines (+4/-4)
1 file modified
src/about-plug.vala (+4/-4)
To merge this branch: bzr merge lp:~shnatsel/switchboard-plug-about/invoke-web-browser-properly
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+144122@code.launchpad.net

Description of the change

Invoke web browser using dedicated Glib functions that look up the user-preferred web browser instead of launching a random one provided by alternatives system

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

Good fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/about-plug.vala'
2--- src/about-plug.vala 2013-01-02 19:32:11 +0000
3+++ src/about-plug.vala 2013-01-21 14:25:26 +0000
4@@ -170,7 +170,7 @@
5 website_label.set_alignment (0, 0);
6 var website = new Gtk.EventBox ();
7 website.add (website_label);
8- website.button_press_event.connect (() => { Process.spawn_command_line_async("x-www-browser http://elementaryos.org"); return true; });
9+ website.button_press_event.connect (() => { AppInfo.launch_default_for_uri ("http://elementaryos.org", null); return true; });
10
11 var details = new Gtk.Box (Gtk.Orientation.VERTICAL, 5);
12 details.pack_start (title, false, false, 0);
13@@ -247,7 +247,7 @@
14 Granite.Widgets.Utils.set_theming (help_button, HELP_BUTTON_STYLESHEET, "help_button",
15 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
16
17- help_button.clicked.connect (() => { Process.spawn_command_line_async("x-www-browser http://elementaryos.org/support"); });
18+ help_button.clicked.connect (() => { AppInfo.launch_default_for_uri ("http://elementaryos.org/support", null); });
19
20 help_button.size_allocate.connect ( (alloc) => {
21 help_button.set_size_request (alloc.height, -1);
22@@ -255,11 +255,11 @@
23
24 // Translate button
25 var translate_button = new Gtk.Button.with_label (_("Translate"));
26- translate_button.clicked.connect (() => { Process.spawn_command_line_async("x-www-browser https://translations.launchpad.net/elementary"); });
27+ translate_button.clicked.connect (() => { AppInfo.launch_default_for_uri ("https://translations.launchpad.net/elementary", null); });
28
29 // Bug button
30 var bug_button = new Gtk.Button.with_label (_("Report a Problem"));
31- bug_button.clicked.connect (() => { Process.spawn_command_line_async("x-www-browser https://bugs.launchpad.net/elementary/+filebug"); });
32+ bug_button.clicked.connect (() => { AppInfo.launch_default_for_uri ("https://bugs.launchpad.net/elementary/+filebug", null); });
33
34 // Upgrade button
35 var upgrade_button = new Gtk.Button.with_label (_("Check for Upgrades"));

Subscribers

People subscribed via source and target branches