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();
37 menu.el.popup(null, null , null, null, event, event_time);
47 el: new Gtk.ImageMenuItem.from_stock(Gtk.STOCK_MEDIA_PAUSE),
48 always_show_image : true,
54 activate : function () {
55 this.parent.parent.status = 1;
56 // this.el.label = status ? 'Resume' : 'Pause';
57 this.parent.parent.el.set_from_stock( Gtk.STOCK_MEDIA_PAUSE );
64 el: new Gtk.ImageMenuItem.from_stock(Gtk.STOCK_MEDIA_PLAY),
65 always_show_image : true,
71 activate : function () {
72 this.parent.parent.status = 0;
73 //var status = this.el.label == 'Pause' ? 1 : 0
74 // this.el.label = status ? 'Resume' : 'Pause';
75 this.parent.parent.el.set_from_stock( Gtk.STOCK_MEDIA_PLAY);
86 activate : function () {
87 var msg = new Gtk.MessageDialog({message_type:
88 Gtk.MessageType.INFO, buttons : Gtk.ButtonsType.OK, text: "GIT Live - auto commits and pushes everything in ~/gitlive"});
100 activate : function () {