[gnome-shell/wip/fmuellner/osk-settings-item] keyboard: Use addSettingsItem() in language menu



commit bb08350ce18def28eabef7b00f71bbfc5c9e59fb
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Nov 15 15:38:11 2018 +0100

    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

 js/ui/keyboard.js | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 106c30210..fac42671d 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -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()))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]