README.txt
[gitlive] / GitMonitor.js
index 85525c2..df3565a 100644 (file)
@@ -48,10 +48,27 @@ var GitMonitor = new Monitor({
         imports.StatusIcon.StatusIcon.el.set_from_stock( Gtk.STOCK_REFRESH );
         var _this = this;
         this.lastAdd = new Date();
+        
         GLib.timeout_add(GLib.PRIORITY_LOW, 500, function() {
-            this.top.forEach(this.monitor, this);
-        }
-        GLib.timeout_add(GLib.PRIORITY_LOW, 500, function() {
+            _this.top.forEach(_this.monitor, _this);
+            imports.StatusIcon.StatusIcon.el.set_from_stock( Gtk.STOCK_MEDIA_PLAY );
+            
+            try { 
+                var notification = new Notify.Notification({
+                    summary: "Git Live",
+                    body : this.gitlive + "\nMonitoring " + _this.monitors.length + " Directories",
+                    timeout : 5
+                });
+        
+                notification.set_timeout(5);
+                notification.show();
+            } catch(e) {
+                print(e.toString());
+            }
+
+        });
+        
+        GLib.timeout_add(GLib.PRIORITY_LOW, 1000, function() {
             //TIMEOUT", _this.queue.length , _this.queueRunning].join(', '));
             if (!_this.queue.length || _this.queueRunning) {
                 return 1;
@@ -70,19 +87,13 @@ var GitMonitor = new Monitor({
             return 1;
         },null,null);
         
-        try { 
-            var notification = new Notify.Notification({
-                summary: "Git Live",
-                body : this.gitlive + "\nMonitoring " + this.monitors.length + " Directories",
-                timeout : 5
-            });
+      
+    },
     
-            notification.set_timeout(5);
-            notification.show();
-        } catch(e) {
-            print(e.toString());
-        }
-        imports.StatusIcon.StatusIcon.el.set_from_stock( Gtk.STOCK_MEDIA_PLAY );
+    
+    stop: function() {
+        imports.StatusIcon.StatusIcon.el.set_from_stock( Gtk.STOCK_MEDIA_PAUSE );
+        Monitor.prototype.stop.call(this);
     },