MergeBranch.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 28 Dec 2018 07:06:14 +0000 (15:06 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 28 Dec 2018 07:06:14 +0000 (15:06 +0800)
MergeBranch.vala

MergeBranch.bjs
MergeBranch.vala

index 48db135..ecf0c11 100644 (file)
@@ -17,7 +17,7 @@
    "# GitRepo repo" : "",
    "title" : "Merge Branch",
    "xtype" : "Dialog",
-   "|   void show" : "(  RooTicket ticket, GitRepo? repo ) \n{\n     // this.el.set_gravity(Gdk.Gravity.NORTH);\n    if (this.running) {\n    \treturn;\n\t}\n\tGitMonitor.gitmonitor.stop();\n\t\n\t_this.el.show_all();\n\t\n\t_this.table.el.hide();\n\t_this.scrolled_window.el.hide();\n\t_this.spinner.el.show();\n\t_this.spinner.el.start();\t\n\tthis.el.set_keep_above(true);    \n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n       \tGLib.debug(\"Loading tickets\"); \n \n\t\n    this.ticket = ticket;\n    this.repo = repo;\n    \n\t\n\tTimeout.add_seconds(1, () => {\n\t    _this.diff_view.el.get_buffer().set_text(repo.previewMerge());\t\t\n\t\t// if we are not working on a ticket, then we should be able to pick one?\n\t \t_this.dbmodel.loadTickets();\n\t \t_this.actionmodel.loadActions();\n\t\t_this.view.loadTicket(ticket.id);\n\t\t_this.spinner.el.stop();\n\t\t_this.spinner.el.hide();\t\n\n\t\tthis.table.el.show();\n\t\treturn false;\n\t});\n\t\n\tthis.el.run();\n\t \n}",
+   "|   void show" : "(  RooTicket ticket, GitRepo? repo ) \n{\n     // this.el.set_gravity(Gdk.Gravity.NORTH);\n    if (this.running) {\n    \treturn;\n\t}\n\tGitMonitor.gitmonitor.stop();\n\t\n\t_this.el.show_all();\n\t\n\t_this.table.el.hide();\n\t_this.scrolled_window.el.hide();\n\t_this.spinner.el.show();\n\t_this.spinner.el.start();\t\n\tthis.el.set_keep_above(true);    \n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n       \tGLib.debug(\"Loading tickets\"); \n \n\t\n    this.ticket = ticket;\n    this.repo = repo;\n    \n\t\n\tTimeout.add_seconds(1, () => {\n\t    _this.diff_view.el.get_buffer().set_text(\n\t    \trepo != null ? repo.previewMerge() : GitRepo.previewMerges(ticket.id)\n    \t);\t\t\n\t\t// if we are not working on a ticket, then we should be able to pick one?\n\t \t_this.dbmodel.loadTickets();\n\t \t_this.actionmodel.loadActions();\n\t\t_this.view.loadTicket(ticket.id);\n\t\t_this.spinner.el.stop();\n\t\t_this.spinner.el.hide();\t\n\n\t\tthis.table.el.show();\n\t\treturn false;\n\t});\n\t\n\tthis.el.run();\n\t \n}",
    "default_height" : 200,
    "# RooTicket? ticket" : "null",
    "$ xns" : "Gtk",
index 9b2b594..20fbc53 100644 (file)
@@ -142,7 +142,9 @@ public class MergeBranch : Object
         
        
        Timeout.add_seconds(1, () => {
-           _this.diff_view.el.get_buffer().set_text(repo.previewMerge());              
+           _this.diff_view.el.get_buffer().set_text(
+               repo != null ? repo.previewMerge() : GitRepo.previewMerges(ticket.id)
+               );              
                // if we are not working on a ticket, then we should be able to pick one?
                _this.dbmodel.loadTickets();
                _this.actionmodel.loadActions();