this.set_visible(true);
var menu = new MenuA();
-
+ menu.ref();
- this.activate.connect( () =>{
+ this.popup_menu.connect( ((uint button, uint time) =>{
//print(Array.prototype.slice.call(arguments).join(','));
-
+ print("menu activiate called\n");
//var menu = this.get('menu');
menu.show_all();
this.activate.connect( () => {
statusicon.paused = true;
-
- //GitMonitor.GitMonitor.stop();
+ GitMonitor.gitmonitor.stop();
+
// this.el.label = status ? 'Resume' : 'Pause';
statusicon.set_from_stock( Gtk.Stock.MEDIA_PAUSE );
var image = new Gtk.Image();
image.set_from_stock(Gtk.Stock.MEDIA_PLAY,Gtk.IconSize.MENU );
- this.set_image (image);
+ this.set_image (image);
this.label= "Start Commits";
this.always_show_image = true;
this.accel_group = null;
this.activate.connect( () => {
- //GitMonitor.GitMonitor.start();
+ GitMonitor.gitmonitor.start();
statusicon.paused = false;
//
}
+
class ImageMenuItemC : ImageMenuItem {
public ImageMenuItemC()
var image = new Gtk.Image();
image.set_from_stock(Gtk.Stock.FULLSCREEN,Gtk.IconSize.MENU );
- this.set_image (image);
+ this.set_image (image);
this.label= "Pull (Refresh) All";
this.always_show_image = true;
this.accel_group = null;
this.activate.connect( () => {
- /*
- imports.GitMonitor.GitMonitor.stop();
-
-
- var tr = imports.Scm.Repo.Repo.list();
- for (var i= 0; i< tr.length;i++) {
- this.parent.parent.el.set_from_stock( i%2 ? Gtk.STOCK_FULLSCREEN : Gtk.STOCK_LEAVE_FULLSCREEN );
+ GitMonitor.gitmonitor.stop();
+ var tr = GitRepo.list();
+ for (var i= 0; i< tr.length;i++) {
+ statusicon.set_from_stock( i%2 == 0 ? Gtk.Stock.FULLSCREEN : Gtk.Stock.LEAVE_FULLSCREEN );
- var repo = tr[i];
- if (!repo.autocommit()) {
- //??? should we ignore ones not on autocommit..
- continue;
- }
- try {
- this.parent.parent.el.set_tooltip_text("pull: " + repo.name);
-
- var str = repo.pull();
+ var repo = tr.index(i);
+ //if (!repo.autocommit()) {
+ //??? should we ignore ones not on autocommit..
+ // continue;
+ //}
+ try {
+ statusicon.set_tooltip_text("pull: " + repo.name);
+ var str = repo.pull();
// do not care if it's already in sycn..
- if (str.match(/Already up-to-date/)) {
- continue;
- }
- var notification = new Notify.Notification({
- summary: "Updated " + repo.name,
- body : str
- });
- notification.set_timeout(20);
- notification.show();
-
- } catch(e) {
- this.parent.parent.el.set_from_stock( Gtk.STOCK_MEDIA_RECORD );
- print(JSON.stringify(e));
- print("notification or push errror- probably to many in queue..");
- imports.gitlive.errorDialog(e.message);
-
- }
+ if (Regex.match_simple ("Already up-to-date", str) ) {
+ continue;
}
- this.parent.parent.el.set_tooltip_text(this.parent.parent.tooltip_text);
-
+ var notification = new Notify.Notification(
+ "Updated " + repo.name,
+ str,
+ "dialog-information"
+
+ );
+
+ notification.set_timeout(20);
+ notification.show();
+
+ } catch(Error e) {
+ print("notification or push errror- probably to many in queue..");
+ statusicon.set_from_stock( Gtk.Stock.MEDIA_RECORD );
+ print(e.message);
+ }
+
+ }
+ statusicon.set_tooltip_text("Gitlive");
-
- imports.GitMonitor.GitMonitor.start();
-
- */
+
+ GitMonitor.gitmonitor.start();
+
});
}