Merge lp:~rcmorano/classicmenu-indicator/classicmenu-indicator-gnome-shell into lp:classicmenu-indicator

Proposed by Roberto C. Morano
Status: Needs review
Proposed branch: lp:~rcmorano/classicmenu-indicator/classicmenu-indicator-gnome-shell
Merge into: lp:classicmenu-indicator
Diff against target: 139 lines (+107/-0)
5 files modified
debian/changelog (+10/-0)
debian/classicmenu-indicator-gnome-shell.install (+1/-0)
debian/control (+9/-0)
gnome-shell-extension/classicmenu-indicator@launchpad.net/extension.js (+80/-0)
gnome-shell-extension/classicmenu-indicator@launchpad.net/metadata.json (+7/-0)
To merge this branch: bzr merge lp:~rcmorano/classicmenu-indicator/classicmenu-indicator-gnome-shell
Reviewer Review Type Date Requested Status
Florian Diesch Pending
Review via email: mp+82911@code.launchpad.net

Description of the change

Hello,

I have created a gnome-shell extension for your indicator in order to place it at the left of the main bar instead of the default location (message/notifications tray).

I have added it to the source as a new package and all you have to do is installing it and enabling the extension through gnome-tweak-tool.

I hope you like the contribution :]

Kind regards.

To post a comment you must log in.

Unmerged revisions

22. By Roberto C. Morano

updated changelog

21. By Roberto C. Morano

added gnome-shell extension and packaging

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-10-14 21:32:29 +0000
3+++ debian/changelog 2011-11-21 16:56:30 +0000
4@@ -1,3 +1,13 @@
5+classicmenu-indicator (0.06rcmorano1) oneiric; urgency=low
6+
7+ * debian/control:
8+ - Added classicmenu-indicator-gnome-shell package
9+
10+ * gnome-shell-extension:
11+ - Added gnome-shell extension for classicmenu-indicator
12+
13+ -- Roberto C. Morano <rcmova@gmail.com> Mon, 21 Nov 2011 17:45:12 +0200
14+
15 classicmenu-indicator (0.06) natty; urgency=low
16
17 * cmdindicator.py:
18
19=== added file 'debian/classicmenu-indicator-gnome-shell.install'
20--- debian/classicmenu-indicator-gnome-shell.install 1970-01-01 00:00:00 +0000
21+++ debian/classicmenu-indicator-gnome-shell.install 2011-11-21 16:56:30 +0000
22@@ -0,0 +1,1 @@
23+gnome-shell-extension/classicmenu-indicator@launchpad.net /usr/share/gnome-shell/extensions
24
25=== modified file 'debian/control'
26--- debian/control 2011-06-04 23:20:58 +0000
27+++ debian/control 2011-11-21 16:56:30 +0000
28@@ -14,3 +14,12 @@
29 Description: indicator showing the main menu from Gnome Classic
30 classicmenu-indicator displays the main menu from Gnome2/Gnome Classic
31 Homepage: http://www.florian-diesch.de/software/classicmenu-indicator/
32+
33+Package: classicmenu-indicator-gnome-shell
34+Architecture: all
35+Depends: ${misc:Depends}, ${python:Depends}, gnome-shell (>= 3.2), classicmenu-indicator
36+Breaks: ${python:Breaks}
37+Description: gnome-shell extension that relocates indicator
38+ classicmenu-indicator-gnome-shell displays the main menu from Gnome2/Gnome
39+ Classic at the left of the gnome-shell main bar.
40+Homepage: http://www.florian-diesch.de/software/classicmenu-indicator/
41
42=== added directory 'gnome-shell-extension'
43=== added directory 'gnome-shell-extension/classicmenu-indicator@launchpad.net'
44=== added file 'gnome-shell-extension/classicmenu-indicator@launchpad.net/extension.js'
45--- gnome-shell-extension/classicmenu-indicator@launchpad.net/extension.js 1970-01-01 00:00:00 +0000
46+++ gnome-shell-extension/classicmenu-indicator@launchpad.net/extension.js 2011-11-21 16:56:30 +0000
47@@ -0,0 +1,80 @@
48+/**
49+* extension.js
50+* Copyright (C) 2011, Roberto C. Morano <rcmova@gmail.com>
51+*
52+* This software is free software; you can redistribute it and/or modify
53+* it under the terms of the GNU General Public License as published by
54+* the Free Software Foundation; either version 2 of the License, or
55+* (at your option) any later version.
56+*
57+* This software is distributed in the hope that it will be useful,
58+* but WITHOUT ANY WARRANTY; without even the implied warranty of
59+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60+* GNU General Public License for more details.
61+*
62+* You should have received a copy of the GNU General Public License
63+* along with this library; if not, write to the Free Software
64+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
65+*
66+* As a special exception, if you link this library with other files to
67+* produce an executable, this library does not by itself cause the
68+* resulting executable to be covered by the GNU General Public License.
69+* This exception does not however invalidate any other reasons why the
70+* executable file might be covered by the GNU General Public License.
71+*/
72+
73+const StatusIconDispatcherOrig = imports.ui.statusIconDispatcher;
74+const Main = imports.ui.main;
75+const Signals = imports.signals;
76+const PanelMenu = imports.ui.panelMenu;
77+
78+const STANDARD_TRAY_ICON_IMPLEMENTATIONS = imports.ui.statusIconDispatcher.STANDARD_TRAY_ICON_IMPLEMENTATIONS;
79+const PANEL_ICON_SIZE = imports.ui.panel.PANEL_ICON_SIZE
80+
81+function StatusIconDispatcher() {
82+ this._init();
83+}
84+
85+StatusIconDispatcher.prototype = {
86+ _init: StatusIconDispatcherOrig.StatusIconDispatcher.prototype._init,
87+
88+ start: StatusIconDispatcherOrig.StatusIconDispatcher.prototype.start,
89+ _onTrayIconRemoved: StatusIconDispatcherOrig.StatusIconDispatcher.prototype._onTrayIconRemoved,
90+ _onTrayIconAdded: function(o, icon) {
91+
92+
93+ let wmClass = (icon.wm_class || 'unknown').toLowerCase();
94+ let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
95+ if (role)
96+ this.emit('status-icon-added', icon, role);
97+ else
98+ if ( wmClass == "classicmenu-indicator" ) {
99+ global.log(wmClass);
100+// Main.panel._leftBox.remove_actor(Main.panel._activitiesButton.actor);
101+ icon.height = PANEL_ICON_SIZE;
102+ let buttonBox = new PanelMenu.ButtonBox();
103+ let box = buttonBox.actor;
104+ box.add_actor(icon);
105+ Main.panel._leftBox.insert_actor(box, 0);
106+ }
107+ this.emit('message-icon-added', icon);
108+ },
109+};
110+
111+Signals.addSignalMethods(StatusIconDispatcher.prototype);
112+
113+function main(meta) {
114+
115+ Main.statusIconDispatcher = new StatusIconDispatcher();
116+ Main.statusIconDispatcher.start(Main.messageTray.actor);
117+}
118+
119+function init() {
120+}
121+
122+function enable(meta) {
123+ main(meta);
124+}
125+
126+function disable() {
127+}
128
129=== added file 'gnome-shell-extension/classicmenu-indicator@launchpad.net/metadata.json'
130--- gnome-shell-extension/classicmenu-indicator@launchpad.net/metadata.json 1970-01-01 00:00:00 +0000
131+++ gnome-shell-extension/classicmenu-indicator@launchpad.net/metadata.json 2011-11-21 16:56:30 +0000
132@@ -0,0 +1,7 @@
133+{
134+ "shell-version": ["3.2"],
135+ "uuid": "classicmenu-indicator@launchpad.net",
136+ "name": "classicmenu-indicator",
137+ "description": "Places the indicator at the left of the main gnome-shell bar.",
138+ "url": "https://launchpad.net/classicmenu-indicator"
139+}

Subscribers

People subscribed via source and target branches