X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=NewBranch.bjs;h=4ecfa4251952558ff7f3f07c1c45ee16a7c7e1f6;hb=55e9325349365ed19eb69c73ea4a8f9759c5c056;hp=e437dd1ba3cbbce638396765ef8448a51005f62f;hpb=93b9c0306ec49015507a664fa266517746c7e197;p=gitlive diff --git a/NewBranch.bjs b/NewBranch.bjs index e437dd1b..4ecfa425 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -10,13 +10,14 @@ { "listeners" : { "delete_event" : "(self, event) => {\n this.el.hide();\n return true; \n //test \n}\n ", - "response" : " (self, response_id) => { \n \n\t GLib.debug(\"got %d\", (int) response_id);\n}", + "response" : " (self, response_id) => { \n \n\tGLib.debug(\"got %d\", (int) response_id);\n\tif (response_id == 0) {\n\t _this.el.hide();\t \n\t \treturn;\n\t}\n\t// have they selected a ticket..\n\t// make that the current active ticket?\n\t// we really need to store locally what ticket is being worked on..\n\t// in theory we could be working on multiple project and not merging..\n\t// -- each repo would have their active ticket (only one per repo)\n\t// -- so we could just store that in there\n\t// -- initial load can check the contents of the ticket files on first scan.\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n if (this.repo != null) {\n \tvar bn = _this.name.get_text();\n \tif (ticket_id != \"\" ) {\n\t\t\tthis.repo.setActiveTicket( RooTicket.singleton.getById(ticket_id), bn);\n\t\t} else {\n\t\t\tthis.repo.createBranchNamed(bn);\n\t\t}\n }\n\n\t\n\n\t \n\t \n\t \n\n\t \n}", "show" : "(self) => {\n \n\n //test\n}" }, "default_width" : 500, "$ deletable" : true, "title" : "Create a working branch ", "xtype" : "Dialog", + "# GitRepo? repo" : "null", "| void show" : "( ) \n{\n // this.el.set_gravity(Gdk.Gravity.NORTH);\n \n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n \tGLib.debug(\"Loading tickets\"); \n \t_this.dbmodel.loadTickets();\n\n this.el.show_all();\n\n\n \n \n \n}", "default_height" : 200, "$ xns" : "Gtk", @@ -49,13 +50,14 @@ }, { "listeners" : { - "changed" : "() => {\n\tGtk.TreeIter iter;\n\tValue val1;\n\tValue val2;\n \n\tthis.el.get_active_iter (out iter);\n\t_this.dbmodel.el.get_value (iter, 0, out val1);\n\t_this.dbmodel.el.get_value (iter, 1, out val2);\n\n\tvar ticket_id = (string) val1;\n\t\n\tif (ticket_id == \"\") {\n\t\t_this.name.el.set_text(\"wip_NAME_DATE\");\n\t\treturn;\n\t}\n\tvar ticket = RooTicket.singleton().getById(ticket_id);\n \n\t\t_this.name.el.set_text(\"wip_NAME_%s\".printf(ticket.toBranchName());\n\tGLib.debug (\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n}" + "changed" : "() => {\n\n\tvar ticket_id = this.selectedTicketId();\n\t\n\tvar name = RooTicket.singleton().usernameLocal();\n\t\n\tif (ticket_id == \"\") {\n\t\n\t\tvar dt = new DateTime.now_local();\n\t\t_this.name.el.set_text(\"wip_%s_%s\".printf(name,dt.format(\"%Y_%b_%d\")));\n\t\treturn;\n\t}\n\t\n\tvar ticket = RooTicket.singleton().getById(ticket_id);\n \n\t_this.name.el.set_text(\"wip_%s_T%s_%s\".printf(name,ticket.id, ticket.summaryToBranchName()));\n\t\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n}" }, - "id" : "build_module", + "id" : "ticketsel", "* init" : "this.el.add_attribute(_this.dbcellrenderer.el , \"markup\", 1 );", "* pack" : "attach_defaults,1,2,0,1", "xtype" : "ComboBox", "$ xns" : "Gtk", + "| string selectedTicketId" : "() {\nGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.dbmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn (string) val1;\n\t\n\t\n\t\n\t\n}\n", "items" : [ { "id" : "dbcellrenderer",