+ public void updateMerges()
+ {
+ // show a list of possible merges on the menu.
+ foreach (var m in this.merge_items) {
+ this.remove(m);
+ }
+ foreach(var r in GitRepo.singleton().cache.values ) {
+ GLib.debug("checking %s for branch = %s", r.name, r.currentBranch.name);
+ if (!r.is_wip_branch()) {
+ continue;
+ }
+ GLib.debug("checking for activeTicket");
+ var t = r.activeTicket;
+ if (t == null) {
+ continue;
+ }
+ var mi = new MergeMenuItem(r,t);
+ this.insert (mi,4); //backwards.
+ this.merge_items.add(mi);
+
+ }
+
+ }
+
+
+ class MergeMenuItem : Gtk.MenuItem {
+
+ GitRepo repo;
+ RooTicket ticket;
+
+ public MergeMenuItem(GitRepo r, RooTicket t)
+ {
+ this.repo = r;
+ this.ticket = t;
+
+ this.label = ("Merge [%s] #%s %s".printf(r.name, t.id , t.summary));
+
+ this.activate.connect(() => {
+ MergeBranch.singleton().show(this.ticket);
+ // show merge dialog..
+ });
+
+ }
+
+ }
+
+
+ class MenuItemPause : ImageMenuItem {
+
+ public MenuItemPause()
+ {
+ //this.set_from_stock( Gtk.Stock.MEDIA_PAUSE );
+
+ var image = new Gtk.Image();
+ image.set_from_stock(Gtk.Stock.MEDIA_PAUSE,Gtk.IconSize.MENU );
+ this.set_image (image);
+
+ this.label= "Pause Commits";
+ this.always_show_image = true;
+ this.accel_group = null;
+
+ this.activate.connect( () => {
+ statusicon.paused = true;
+ GitMonitor.gitmonitor.stop();
+
+ // this.el.label = status ? 'Resume' : 'Pause';
+ statusicon.set_from_stock( Gtk.Stock.MEDIA_PAUSE );
+
+
+ });
+ // id : 'pause',
+ }
+
+
+ }
+ class MenuItemStartCommits : ImageMenuItem {
+
+ public MenuItemStartCommits()
+ {
+
+ var image = new Gtk.Image();
+ image.set_from_stock(Gtk.Stock.MEDIA_PLAY,Gtk.IconSize.MENU );
+ this.set_image (image);
+ 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 );
+
+
+ });
+ }
+