NewBranch.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2019 06:34:47 +0000 (14:34 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2019 06:34:47 +0000 (14:34 +0800)
NewBranch.vala

NewBranch.bjs
NewBranch.vala

index 99c13eb..de65929 100644 (file)
@@ -10,7 +10,7 @@
   {
    "listeners" : {
     "delete_event" : "(self, event) => {\n    this.el.hide();\n    return true; \n    //test  \n}\n ",
-    "response" : " (self, response_id) =>  { \n  \n\tGLib.debug(\"got %d\", (int) response_id);\n\t\n\t \n\t\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\n\t \n\tif (response_id < 1) {\n\t    _this.el.hide();\t\n\t    this.running = false; \n\t \treturn;\n\t}\n\t\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n    if (this.repo != null) {\n    \tvar bn = _this.name.el.get_text();\n\n\t\tvar res = this.repo.setActiveTicket(\t\t\t\n\t\t\t RooTicket.singleton().getById(ticket_id != \"\" ? ticket_id : \"-1\"), bn\n\t\t );\n\t\t if (res) {\n\t\t \t// start the monitoring..\n\t\t \t GitMonitor.gitmonitor.start();\n\t\t \t \n\t\t }\n    }\n     \n\n    this.running = false; \n\n\tthis.el.hide();\n\t \n\t \n\n\t \n}"
+    "response" : " (self, response_id) =>  { \n  \n\tGLib.debug(\"got %d\", (int) response_id);\n\t\n\t \n\t\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\n\t \n\tif (response_id < 1) {\n\t    _this.el.hide();\t\n\t    this.running = false; \n\t \treturn;\n\t}\n\t\n\tswitch(response_id) {\n\t\tcase 1: \n\t\n\t\t\t\n\t\t\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\t\t\n\t\t\tif (this.repo != null) {\n\t\t\t\tvar bn = _this.name.el.get_text();\n\n\t\t\t\tvar res = this.repo.setActiveTicket(\t\t\t\n\t\t\t\t\t RooTicket.singleton().getById(ticket_id != \"\" ? ticket_id : \"-1\"), bn\n\t\t\t\t );\n\t\t\t\t if (res) {\n\t\t\t\t \t// start the monitoring..\n\t\t\t\t \t GitMonitor.gitmonitor.start();\n\t\t\t\t \t \n\t\t\t\t }\n\t\t\t}\n     \t\tbreak;\n \t\tcase 2: // create ticket + branch\n\t \t\tbreak;\n \t\t\n \t\tcase 3: // just commit...\n \t\t\n \t\t\tbreak;\n\n    this.running = false; \n\n\tthis.el.hide();\n\t \n\t \n\n\t \n}"
    },
    "default_width" : 500,
    "$ deletable" : true,
index 7bb3b9f..8c392c4 100644 (file)
@@ -106,21 +106,31 @@ public class NewBranch : Object
                        return;
                }
                
-               var ticket_id = _this.ticketsel.selectedTicketId();
+               switch(response_id) {
+                       case 1: 
                
-            if (this.repo != null) {
-               var bn = _this.name.el.get_text();
+                               
+                               var ticket_id = _this.ticketsel.selectedTicketId();
+                               
+                               if (this.repo != null) {
+                                       var bn = _this.name.el.get_text();
         
-                       var res = this.repo.setActiveTicket(                    
-                                RooTicket.singleton().getById(ticket_id != "" ? ticket_id : "-1"), bn
-                        );
-                        if (res) {
-                               // start the monitoring..
-                                GitMonitor.gitmonitor.start();
-                                
-                        }
-            }
-             
+                                       var res = this.repo.setActiveTicket(                    
+                                                RooTicket.singleton().getById(ticket_id != "" ? ticket_id : "-1"), bn
+                                        );
+                                        if (res) {
+                                               // start the monitoring..
+                                                GitMonitor.gitmonitor.start();
+                                                
+                                        }
+                               }
+                       break;
+                       case 2: // create ticket + branch
+                               break;
+                       
+                       case 3: // just commit...
+                       
+                               break;
         
             this.running = false;