StatusIcon.vala
[gitlive] / StatusIcon.vala
index 9770850..448f6c9 100644 (file)
@@ -33,51 +33,20 @@ static int main (string[] args) {
      
 
 }
-
-public class TestButton : Button {
-    public TestButton()
-    {
-        this.set_label("Click me");
-        
-        
-        this.clicked.connect (() => {
-            this.label = "Thank you";
-        });
-        
-    }
-    
-    
-}
-
-public class TestWindow : Window {
-
-    public TestWindow() {
-         this.title = "First GTK+ Program";
-        this.border_width = 10;
-        this.window_position = WindowPosition.CENTER;
-        this.set_default_size (350, 70);
-        
-        // -- connect all
-        this.destroy.connect (Gtk.main_quit);        
-        
-        // add children..
-        this.add(new TestButton());
-
-    }
-   
-    
  
-   
-}
-
 
 
+pubic StatusIconA statusicon;
  
 class StatusIconA : StatusIcon {
 
     bool paused = false;
      
     public StatusIconA() {
+        
+        statusicon = this;
+        
+        
          //title : 'gitlive',
         this.stock = Gtk.STOCK_REFRESH;
         this.tooltip_text = "GitLive";
@@ -152,10 +121,35 @@ class StatusIconA : StatusIcon {
                 this.accel_group = null;
                 
                 this.activate.connect( () => {
-                    this.parent.parent.paused = true;
-                    imports.GitMonitor.GitMonitor.stop();
+                    statusicon.paused = true;
+                    
+                    //GitMonitor.GitMonitor.stop();
                    // this.el.label  = status ? 'Resume' : 'Pause';
-                    this.parent.parent.el.set_from_stock( Gtk.STOCK_MEDIA_PAUSE );
+                    statusicon.set_from_stock( Gtk.STOCK_MEDIA_PAUSE );
+                    
+                    
+                })
+                //    id : 'pause',
+            }
+            
+            
+        }
+         class ImageMenuItemB : ImageMenuItem {
+            
+            public ImageMenuItemB()
+            {
+                this.set_from_stock( Gtk.STOCK_MEDIA_PLAY );
+                this.label= "Start Commits";
+                this.always_show_image = true;
+                this.accel_group = null;
+                
+                this.activate.connect( () => {
+                    //GitMonitor.GitMonitor.start();
+                    statusicon.paused = false;
+                    
+                    //
+                   // this.el.label  = status ? 'Resume' : 'Pause';
+                    statusicon.set_from_stock( Gtk.STOCK_MEDIA_PLAY );
                     
                     
                 })
@@ -164,55 +158,10 @@ class StatusIconA : StatusIcon {
             
             
         }
-        
     }
+}
     
-         
-    items : [
-       {
-            xtype: Gtk.Menu,
-            id : 'menu',
-            pack: false,
-            items : [
-                {
-                    
-                    //label: 'Pause',
-                    pack:  'append',
-                    listeners : {
-                        activate : function () {
-                            this.parent.parent.paused = true;
-                            imports.GitMonitor.GitMonitor.stop();
-                           // this.el.label  = status ? 'Resume' : 'Pause';
-                            this.parent.parent.el.set_from_stock( Gtk.STOCK_MEDIA_PAUSE );
-                            
-                        }
-                    }
-                },
-                
-                {
-                    init : function() {
-                        this.el = XObject.isSeed ?
-                            new Gtk.ImageMenuItem.from_stock(Gtk.STOCK_MEDIA_PLAY)
-                            : new Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_MEDIA_PLAY, null);
-                        XObject.prototype.init.call(this);
-                    },
-                    label: 'Resume Commits',
-                    always_show_image : true,
-                    accel_group : null,
-                    id : 'resume',
-                    //label: 'Pause',
-                    pack:  'append',
-                    listeners : {
-                        activate : function () {
-                            this.parent.parent.paused = false;
-                             imports.GitMonitor.GitMonitor.start();
-                            //var status = this.el.label == 'Pause' ? 1 : 0
-                           // this.el.label  = status ? 'Resume' : 'Pause';
-                               
-                            
-                        }
-                    }
-                },
+    /*
                 
                 {
                     init : function() {