sync
[gitlive] / GitMonitor.vala
index 67288bb..bf890be 100644 (file)
@@ -179,14 +179,26 @@ public class GitMonitor : Monitor
                GitMonitor.gitmonitor = this;
        }
 
-       public new void pauseError() {
+       public new void pauseError(string failure) 
+       {
+       
+               var notification = new Notify.Notification(
+                         "Git Live ERROR!!",
+                       failure,
+                       "dialog-information"
+                       
+               );
+                       
+               notification.set_timeout(60); // show errros for longer
+               notification.show();
+                               
+       
                this.paused = true;
                // what does this do to the old one...
                this.queue = new Array<GitMonitorQueue> ();
+               this.stop();
                StatusIconA.statusicon.pauseError();
-
        }
-
  
        public new void pause() {
                this.paused = true;
@@ -427,6 +439,7 @@ public class GitMonitor : Monitor
                        }
                        print( "ADD : %s\n", GitMonitorQueue.queueArrayToString(add_files));
                        print( "REMOVE FILES: %s\n", GitMonitorQueue.queueArrayToString(remove_files));
+                       
                        //repo.debug = 1;
                        // these can fail... at present... as we wildcard stuff.
                   
@@ -481,7 +494,7 @@ public class GitMonitor : Monitor
                        } catch(Error e) {
                                this.pauseError(e.message);
                                //failure +=  e.message;
-                               ..print("Pull failed:\n");
+                               //print("Pull failed:\n");
                                return;
                        }
                        
@@ -490,12 +503,16 @@ public class GitMonitor : Monitor
                        try {
                                repo.add(add_files_f);
                        } catch(Error e) {
+                               this.pauseError(e.message);
+                               return;
                                failure +=  e.message;
                                print("Add failed:\n");
                        }  
                        try {
                                 repo.remove(remove_files_f);
                        } catch(Error e) {
+                               this.pauseError(e.message);
+                               return;
                                failure +=  e.message;
                                print("Remove failed:\n");
                        }  
@@ -511,6 +528,8 @@ public class GitMonitor : Monitor
                                success += repo.push();
 
                        } catch(Error e) {
+                               this.pauseError(e.message);
+                               return;
                                failure += e.message;
                                print("Push failed:\n");
                                
@@ -536,21 +555,11 @@ public class GitMonitor : Monitor
                                notification.show();   
                        }
                        
-                       if (failure.length > 0) {
+                       //if (failure.length > 0) {
 
-                               var notification = new Notify.Notification(
-                                         "Git Live ERROR!!",
-                                       string.joinv("\n",failure),
-                                       "dialog-information"
-                                       
-                               );
-                               
-       
-                               notification.set_timeout(10); // show errros for longer
-                               notification.show();
-                               
-                               this.pauseError();   
-                       }
+                               // should never get this far...
+                       //      this.pauseError();   
+                       //}
                } catch(Error e) {
                        print(e.message);