From 20ebb623b8a435cd610dd1ef301764f0e5196e26 Mon Sep 17 00:00:00 2001 From: Tom Perez <60866122+tper0700@users.noreply.github.com> Date: Sun, 19 Apr 2020 21:14:04 -0700 Subject: [PATCH] Incorporating feedback to address gsettings localization issues. --- appIcons.js | 67 +++++++++++++++++-- ...shell.extensions.dash-to-panel.gschema.xml | 40 ++++------- utils.js | 1 - 3 files changed, 72 insertions(+), 36 deletions(-) diff --git a/appIcons.js b/appIcons.js index 0f1be45..804fe25 100644 --- a/appIcons.js +++ b/appIcons.js @@ -1755,34 +1755,87 @@ var MyShowAppsIconMenu = Utils.defineClass({ return null; } - function _appendList(obj, cmd_list, title_list) { - if (cmd_list.length != title_list.length) { + function _appendList(obj, commandList, titleList) { + if (commandList.length != titleList.length) { return; } - for (var entry = 0; entry < cmd_list.length; entry++) { + for (var entry = 0; entry < commandList.length; entry++) { _appendItem(obj, { - title: title_list[entry], - cmd: cmd_list[entry].split(' ') + title: titleList[entry], + cmd: commandList[entry].split(' ') }); } - - obj._appendSeparator(); } if (this.sourceActor != Main.layoutManager.dummyCursor) { + _appendItem(this, { + title: 'Power options', + cmd: ['gnome-control-center', 'power'] + }); + + _appendItem(this, { + title: 'Event logs', + cmd: ['gnome-logs'] + }); + + _appendItem(this, { + title: 'System', + cmd: ['gnome-control-center', 'info-overview'] + }); + + _appendItem(this, { + title: 'Device Management', + cmd: ['gnome-control-center', 'display'] + }); + + _appendItem(this, { + title: 'Disk Management', + cmd: ['gnome-disks'] + }); + _appendList( this, Me.settings.get_strv('show-apps-button-context-menu-commands'), Me.settings.get_strv('show-apps-button-context-menu-titles') ) + + this._appendSeparator(); } + + _appendItem(this, { + title: 'Terminal', + cmd: ['gnome-terminal'] + }); + + _appendItem(this, { + title: 'System monitor', + cmd: ['gnome-system-monitor'] + }); + + _appendItem(this, { + title: 'Files', + cmd: ['nautilus'] + }); + + _appendItem(this, { + title: 'Extensions', + cmd: ['gnome-shell-extension-prefs'] + }); + + _appendItem(this, { + title: 'Settings', + cmd: ['gnome-control-center', 'wifi'] + }); + _appendList( this, Me.settings.get_strv('panel-context-menu-commands'), Me.settings.get_strv('panel-context-menu-titles') ) + this._appendSeparator(); + let lockTaskbarMenuItem = this._appendMenuItem(Me.settings.get_boolean('taskbar-locked') ? _('Unlock taskbar') : _('Lock taskbar')); lockTaskbarMenuItem.connect('activate', () => { Me.settings.set_boolean('taskbar-locked', !Me.settings.get_boolean('taskbar-locked')); diff --git a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml index cc5a50d..d40ca56 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -373,40 +373,24 @@ Animate Show Applications from the desktop - ['gnome-control-center power', - 'gnome-logs', - 'gnome-control-center info-overview', - 'gnome-control-center display', - 'gnome-disks'] - Commands to run on Show Apps Menu - Commands to run in the Show Apps button context menu + [] + Show Apps button context menu commands + Commands to add to the Show Apps button right click menu - ['Power options', - 'Event logs', - 'System', - 'Device Management', - 'Disk Management'] - Titles to show on Show Apps Menu - Titles to show in the Show Apps button context menu + [] + Show Apps button context menu titles + Titles for commands added to Show Apps button right click menu - ['gnome-terminal', - 'gnome-system-monitor', - 'nautilus', - 'gnome-shell-extension-prefs', - 'gnome-control-center wifi'] - Commands to run on panel context menu - Commands to run in the panel context menu + [] + Panel context menu commands + Commands to add to the panel right click menu - ['Terminal', - 'System monitor', - 'Files', - 'Extensions', - 'Settings'] - Titles to show on panel context menu - Titles to show in the panel context menu + [] + Panel context menu titles + Titles for commands added to panel right click menu false diff --git a/utils.js b/utils.js index aa5e618..038379d 100644 --- a/utils.js +++ b/utils.js @@ -880,7 +880,6 @@ var drawRoundedLine = function(cr, x, y, width, height, isRoundLeft, isRoundRigh /** * Check if an app exists in the system. - * Depends on "which" to find app in $PATH */ var checkedCommandsMap = new Map();