NetworkMenu: make the settings launcher point to the right devices
Tell gnome-control-center to focus on the associated device when launching it from one of the submenus. https://bugzilla.gnome.org/show_bug.cgi?id=709246
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib;
|
||||
const Lang = imports.lang;
|
||||
const St = imports.gi.St;
|
||||
@ -79,6 +80,22 @@ function spawnCommandLine(command_line) {
|
||||
}
|
||||
}
|
||||
|
||||
// spawnApp:
|
||||
// @argv: an argv array
|
||||
//
|
||||
// Runs @argv as if it was an application, handling startup notification
|
||||
function spawnApp(argv) {
|
||||
try {
|
||||
let app = Gio.AppInfo.create_from_commandline(argv.join(' '), null,
|
||||
Gio.AppInfoCreateFlags.SUPPORTS_STARTUP_NOTIFICATION);
|
||||
|
||||
let context = global.create_app_launch_context();
|
||||
app.launch([], context);
|
||||
} catch(err) {
|
||||
_handleSpawnError(argv[0], err);
|
||||
}
|
||||
}
|
||||
|
||||
// trySpawn:
|
||||
// @argv: an argv array
|
||||
//
|
||||
|
Reference in New Issue
Block a user