X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=NewBranch.vala;h=230fc6fcb84507c92418cb31fdd364156f4da588;hb=a98f14046fab1ea28caf81998741ee7bfb26f58e;hp=15a40f84c1cb10f774af94acb4a2692838db2607;hpb=a24b731810fce5cd4e06d8a1e5dc0d45d1ac267e;p=gitlive diff --git a/NewBranch.vala b/NewBranch.vala index 15a40f84..230fc6fc 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -55,9 +55,7 @@ public class NewBranch : Object }); this.el.show.connect( (self) => { - - this.el.run(); //test }); } @@ -66,15 +64,15 @@ public class NewBranch : Object public void show ( ) { // this.el.set_gravity(Gdk.Gravity.NORTH); - this.el.move((Gdk.Screen.width() / 2)- 250 ,0); - - - + + this.el.move((Gdk.Screen.width() / 2)- 250 ,0); + GLib.debug("Loading tickets"); + _this.dbmodel.loadTickets(); + this.el.show_all(); - _this.dbmodel.loadTickets(); - - + + } @@ -114,11 +112,13 @@ public class NewBranch : Object public Xcls_Table3(NewBranch _owner ) { _this = _owner; - this.el = new Gtk.Table( 2, 2, true ); + this.el = new Gtk.Table( 2, 2, false ); // my vars (dec) // set gobject values + this.el.margin = 2; + this.el.column_spacing = 2; var child_0 = new Xcls_Label4( _this ); child_0.ref(); this.el.attach_defaults ( child_0.el , 0,1,0,1 ); @@ -188,6 +188,32 @@ public class NewBranch : Object // init method this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 ); + + //listeners + this.el.changed.connect( () => { + Gtk.TreeIter iter; + Value val1; + Value val2; + + this.el.get_active_iter (out iter); + _this.dbmodel.el.get_value (iter, 0, out val1); + _this.dbmodel.el.get_value (iter, 1, out val2); + + var ticket_id = (string) val1; + + var name = RooTicket.singleton().usernameLocal(); + + if (ticket_id == "") { + _this.name.el.set_text("wip_%s_%s".printf(name,date)); + return; + } + + var ticket = RooTicket.singleton().getById(ticket_id); + + _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName())); + + //GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2); + }); } // user defined functions @@ -260,7 +286,7 @@ public class NewBranch : Object el.append(out iter); el.set_value(iter, 0, ticket.id); - el.set_value(iter, 1, "#%s %s %s".printf( ticket.id, ticket.project_id_name , ticket.summary)); + el.set_value(iter, 1, "#%s [%s] %s".printf( ticket.id, ticket.project_id_name , ticket.summary)); //if (data.get(i) == cur) { // _this.build_module.el.set_active_iter(iter);