1 //<script type="text/javascript">
5 * Status icon and menu for component of gitlive.
7 * Implements XObject - however we want to control initialization.
11 * Currently only does a few things
19 XObject = imports['XObject.js'].XObject
23 StatusIcon = new XObject({
25 xtype : Gtk.StatusIcon,
26 stock : Gtk.STOCK_MEDIA_PLAY,
27 tooltip_text : 'GitLive',
29 'popup-menu' : function( w, event, event_time) {
30 print(Array.prototype.slice.call(arguments).join(','));
32 menu = this.get('menu');
36 this.get(this.status ? 'pause' : 'resume').el.hide();
38 menu.el.popup(null, null, Gtk.StatusIcon.position_menu,
39 event, event_time, this.el)
41 //menu.el.popup(null, null , null, null, event, event_time);
51 xtype: Gtk.ImageMenuItem.from_stock,
52 stock: Gtk.STOCK_MEDIA_PAUSE,
54 always_show_image : true,
60 activate : function () {
61 this.parent.parent.status = 1;
62 // this.el.label = status ? 'Resume' : 'Pause';
63 this.parent.parent.el.set_from_stock( Gtk.STOCK_MEDIA_PAUSE );
70 xtype: Gtk.ImageMenuItem.from_stock,
71 stock: Gtk.STOCK_MEDIA_PLAY,
72 always_show_image : true,
78 activate : function () {
79 this.parent.parent.status = 0;
80 //var status = this.el.label == 'Pause' ? 1 : 0
81 // this.el.label = status ? 'Resume' : 'Pause';
82 this.parent.parent.el.set_from_stock( Gtk.STOCK_MEDIA_PLAY);
93 activate : function () {
94 var msg = new Gtk.MessageDialog({message_type:
95 Gtk.MessageType.INFO, buttons : Gtk.ButtonsType.OK, text: "GIT Live - auto commits and pushes everything in ~/gitlive"});
107 activate : function () {