[gnome-shell-extensions/extension-live-disable: 8/11] alternative-status-menu: port to new extension API



commit aa38aa1e9e52a2d74f7163cb895f0d8ee7e9040e
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Aug 2 23:32:51 2011 +0200

    alternative-status-menu: port to new extension API
    
    main() has been	replaced by init(), enable() and disable()
    possibly not working, a better infrastructure for monkey patching
    would be helpful

 extensions/alternative-status-menu/extension.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/extensions/alternative-status-menu/extension.js b/extensions/alternative-status-menu/extension.js
index 25a9025..d65c9d3 100644
--- a/extensions/alternative-status-menu/extension.js
+++ b/extensions/alternative-status-menu/extension.js
@@ -98,8 +98,17 @@ function createSubMenu() {
 // Put your extension initialization code here
 function main(metadata) {
     imports.gettext.bindtextdomain('gnome-shell-extensions', metadata.localedir);
+}
 
+function enable() {
     let statusMenu = Main.panel._userMenu;
     statusMenu.menu.removeAll();
     createSubMenu.call(statusMenu);
 }
+
+function disable() {
+    // not guarranteed to work, if more extensions operate in the same place
+    let statusMenu = Main.panel._userMenu;
+    statusMenu.menu.removeAll();
+    statusMenu._createSubMenu();
+}
\ No newline at end of file



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