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;
}
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.
} catch(Error e) {
this.pauseError(e.message);
//failure += e.message;
- ..print("Pull failed:\n");
+ //print("Pull failed:\n");
return;
}
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");
}
success += repo.push();
} catch(Error e) {
+ this.pauseError(e.message);
+ return;
failure += e.message;
print("Push failed:\n");
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);
{
// convert arguments.
-
string[] args = { "git" };
//args += "--git-dir";
//args += this.gitdir;
args += "--no-pager";
-
+
//if (this.gitdir != this.repopath) {
// args += "--work-tree";
// args += this.repopath;
// may throw error...
var sp = new Spawn(cfg);
+
stdout.printf( "GOT: %s\n" , sp.output);
// parse output for some commands ?
if (this.cfg.exceptions && this.result != 0) {
-
- var errstr = this.output;
- errstr += errstr.length > 0 ? "\n" : "";
+ var errstr = string.joinv(" ", this.cfg.args) + "\n";
+ errstr += this.output;
+ errstr += this.output.length > 0 ? "\n" : "";
errstr += this.stderr;
- print("Throwing execute error:%s\n", errstr);
+ //print("Throwing execute error:%s\n", errstr);
throw new SpawnError.EXECUTE_ERROR(errstr);
//this.toString = function() { return this.stderr; };
///throw new Exception this; // we throw self...
}
-
-
// finally throw, or return self..
-
return;
}
}
- void pause()
+ public void pause()
{
this.set_from_stock( Gtk.Stock.MEDIA_PAUSE );
+ this.paused = true;
}
- void resume()
+
+ public void resume()
{
this.set_from_stock( Gtk.Stock.MEDIA_PLAY );
- this.error_animate= false;
+ this.paused = false;
}
- void refreshing()
+ public void refreshing()
{
this.set_from_stock( Gtk.Stock.REFRESH );
}
- void pauseError()
+
+ public void pauseError()
{
- this.error_animate = true;
+ this.paused = true;
var flag = true;
Timeout.add_full(Priority.LOW, 500, () => {
- if (!this.error_animate) {
+ if (!this.paused) {
return false;
}
this.set_from_stock( flag == true ? Gtk.Stock.MEDIA_RECORD
}
-
+
\ No newline at end of file