keyboard: Use addSettingsItem() in language menu

If the session mode doesn't allow access to Settings, the language
menu should respect that and not expose the "Region & Languages"
panel. Using the dedicated method instead of manually constructing
the menu item takes care of that and makes for less code.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/780
This commit is contained in:
Florian Müllner 2018-11-15 15:38:11 +01:00 committed by Florian Müllner
parent ddb3a5c625
commit f8ce47c24d

View File

@ -195,7 +195,7 @@ var LanguageSelectionPopup = new Lang.Class({
}
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
this.addAction(_("Region & Language Settings"), this._launchSettings.bind(this));
this.addSettingsAction(_("Region & Language Settings"), 'gnome-region-panel.desktop');
this._capturedEventId = 0;
this._unmapId = actor.connect('notify::mapped', () => {
@ -204,11 +204,6 @@ var LanguageSelectionPopup = new Lang.Class({
});
},
_launchSettings() {
Util.spawn(['gnome-control-center', 'region']);
this.close(true);
},
_onCapturedEvent(actor, event) {
if (event.get_source() == this.actor ||
this.actor.contains(event.get_source()))