[gnome-shell/T27795: 55/138] backgroundMenu: Adapt the background menu to Endless-specific use cases
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/T27795: 55/138] backgroundMenu: Adapt the background menu to Endless-specific use cases
- Date: Tue, 1 Oct 2019 23:33:57 +0000 (UTC)
commit 9bad7107e2ee34a2fcaefd7eac799e60f749e2af
Author: Mario Sanchez Prada <mario endlessm com>
Date: Tue Apr 25 15:43:38 2017 +0000
backgroundMenu: Adapt the background menu to Endless-specific use cases
Replace the "Display Settings" and "Settings" items with links to
"Add App", "Add Website" and "Add Folder" instead.
js/ui/backgroundMenu.js | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/backgroundMenu.js b/js/ui/backgroundMenu.js
index ec39d1290b..db3ae9ef6b 100644
--- a/js/ui/backgroundMenu.js
+++ b/js/ui/backgroundMenu.js
@@ -1,8 +1,9 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported addBackgroundMenu */
-const { Clutter, St } = imports.gi;
+const { Clutter, Meta, Shell, St } = imports.gi;
+const AppActivation = imports.ui.appActivation;
const BoxPointer = imports.ui.boxpointer;
const Main = imports.ui.main;
const PopupMenu = imports.ui.popupMenu;
@@ -13,8 +14,20 @@ var BackgroundMenu = class BackgroundMenu extends PopupMenu.PopupMenu {
this.addSettingsAction(_("Change Background…"), 'gnome-background-panel.desktop');
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
- this.addSettingsAction(_("Display Settings"), 'gnome-display-panel.desktop');
- this.addSettingsAction(_("Settings"), 'gnome-control-center.desktop');
+
+ this.addAction(_("Add App"), () => {
+ let app = Shell.AppSystem.get_default().lookup_app('org.gnome.Software.desktop');
+ let activationContext = new AppActivation.AppActivationContext(app);
+ activationContext.activate(Clutter.get_current_event());
+ });
+
+ this.addAction(_("Add Website"), () => {
+ Main.appStore.showPage(global.get_current_time(), 'web');
+ });
+
+ this.addAction(_("Add Folder"), () => {
+ Main.appStore.showPage(global.get_current_time(), 'folders');
+ });
this.actor.add_style_class_name('background-menu');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]