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

MergeBranch.bjs
MergeBranch.vala

index 054eb95..d9ff6c0 100644 (file)
@@ -13,8 +13,8 @@
     "response" : " (self, response_id) =>  { \n  \n\tGLib.debug(\"got %d\", (int) response_id);\n\tif (response_id < 1) {\n\t    _this.el.hide();\t\n\t    this.running = false; \n    \tGitMonitor.gitmonitor.start();\n\t \treturn;\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\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n    if (this.repo != null) {\n    \tvar bn = _this.name.el.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\t*/\n\t\n\tif (this.repo != null) {\n\t\trepo.doMerge(\n\t\t\t_this.actionsel.selectedAction(), \n\t\t\t_this.ticketsel.selectedTicketId(),\n\t\t\t_this.name.el.get_text()\n\t\t);\n\t\n\t} else {\n\t\tGitRepo.doMerges(\n\t\t\t_this.actionsel.selectedAction(), \n\t\t\t_this.ticketsel.selectedTicketId(),\n\t\t\t_this.name.el.get_text()\n\t\t);\n\t}\n\tthis.running = false; \n\n\t \n\t_this.el.hide();\t\n \tGitMonitor.gitmonitor.start();\n\n\t \n}"
    },
    "default_width" : 500,
     "response" : " (self, response_id) =>  { \n  \n\tGLib.debug(\"got %d\", (int) response_id);\n\tif (response_id < 1) {\n\t    _this.el.hide();\t\n\t    this.running = false; \n    \tGitMonitor.gitmonitor.start();\n\t \treturn;\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\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n    if (this.repo != null) {\n    \tvar bn = _this.name.el.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\t*/\n\t\n\tif (this.repo != null) {\n\t\trepo.doMerge(\n\t\t\t_this.actionsel.selectedAction(), \n\t\t\t_this.ticketsel.selectedTicketId(),\n\t\t\t_this.name.el.get_text()\n\t\t);\n\t\n\t} else {\n\t\tGitRepo.doMerges(\n\t\t\t_this.actionsel.selectedAction(), \n\t\t\t_this.ticketsel.selectedTicketId(),\n\t\t\t_this.name.el.get_text()\n\t\t);\n\t}\n\tthis.running = false; \n\n\t \n\t_this.el.hide();\t\n \tGitMonitor.gitmonitor.start();\n\n\t \n}"
    },
    "default_width" : 500,
-   "$ deletable" : true,
    "# GitRepo repo" : "",
    "# GitRepo repo" : "",
+   "$ deletable" : true,
    "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\n\t\n\t\n    this.ticket = ticket;\n    this.repo = repo;\n    \n\t\n\tTimeout.add_seconds(1, () => {\n\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}",
    "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\n\t\n\t\n    this.ticket = ticket;\n    this.repo = repo;\n    \n\t\n\tTimeout.add_seconds(1, () => {\n\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}",
          "items" : [
           {
            "id" : "actioncellrenderer",
          "items" : [
           {
            "id" : "actioncellrenderer",
-           "xtype" : "CellRendererText",
            "* pack" : "pack_start,true",
            "* pack" : "pack_start,true",
+           "xtype" : "CellRendererText",
            "$ xns" : "Gtk"
           },
           {
            "id" : "actionmodel",
            "$ xns" : "Gtk"
           },
           {
            "id" : "actionmodel",
-           "xtype" : "ListStore",
            "* pack" : "set_model",
            "* pack" : "set_model",
+           "xtype" : "ListStore",
            "$ columns" : "typeof(string),typeof(string)",
            "n_columns" : 2,
            "$ xns" : "Gtk",
            "$ columns" : "typeof(string),typeof(string)",
            "n_columns" : 2,
            "$ xns" : "Gtk",
          "items" : [
           {
            "id" : "dbcellrenderer",
          "items" : [
           {
            "id" : "dbcellrenderer",
-           "* pack" : "pack_start,true",
            "xtype" : "CellRendererText",
            "xtype" : "CellRendererText",
+           "* pack" : "pack_start,true",
            "$ xns" : "Gtk"
           },
           {
            "$ xns" : "Gtk"
           },
           {
         }
        ]
       },
         }
        ]
       },
+      {
+       "* pack" : "add",
+       "xtype" : "Notebook",
+       "$ xns" : "Gtk"
+      },
       {
        "int height_request" : 500,
        "id" : "scrolled_window",
       {
        "int height_request" : 500,
        "id" : "scrolled_window",
        "items" : [
         {
          "id" : "view",
        "items" : [
         {
          "id" : "view",
-         "xtype" : "WebView",
          "* pack" : "add",
          "* pack" : "add",
+         "xtype" : "WebView",
          "$ xns" : "WebKit",
          "| void loadTicket" : "(string tid) {\n\tint h,w;\n\t_this.el.get_size(out w, out h);\n\t\n\tif (tid == \"\") {\n\t\t_this.scrolled_window.el.hide();\n\t\t_this.el.resize(w, 150);\n\t} else {\n\t\t_this.scrolled_window.el.show();\n\t\t_this.el.resize(w, 800);\n\t}\n\t\n\tvar rs =  RooTicket.singleton();\t\t\n\tvar uri = new WebKit.URIRequest(\"https://roojs.com/admin.php/MTrack/View/\" + tid);\n\tvar hd = uri.get_http_headers();\n\tvar authCode = Base64.encode (\"%s:%s\".printf(rs.username, rs.password).data);\n\thd.append(\"Authorization\", \"Basic %s\".printf(authCode));\n\t\n\t this.el.load_request(uri);\n}\n"
         }
          "$ xns" : "WebKit",
          "| void loadTicket" : "(string tid) {\n\tint h,w;\n\t_this.el.get_size(out w, out h);\n\t\n\tif (tid == \"\") {\n\t\t_this.scrolled_window.el.hide();\n\t\t_this.el.resize(w, 150);\n\t} else {\n\t\t_this.scrolled_window.el.show();\n\t\t_this.el.resize(w, 800);\n\t}\n\t\n\tvar rs =  RooTicket.singleton();\t\t\n\tvar uri = new WebKit.URIRequest(\"https://roojs.com/admin.php/MTrack/View/\" + tid);\n\tvar hd = uri.get_http_headers();\n\tvar authCode = Base64.encode (\"%s:%s\".printf(rs.username, rs.password).data);\n\thd.append(\"Authorization\", \"Basic %s\".printf(authCode));\n\t\n\t this.el.load_request(uri);\n}\n"
         }
     },
     {
      "label" : "Cancel",
     },
     {
      "label" : "Cancel",
-     "* pack" : "add_action_widget,0",
      "xtype" : "Button",
      "xtype" : "Button",
+     "* pack" : "add_action_widget,0",
      "Gtk.ReliefStyle relief" : "Gtk.ReliefStyle.NONE",
      "$ xns" : "Gtk"
     },
      "Gtk.ReliefStyle relief" : "Gtk.ReliefStyle.NONE",
      "$ xns" : "Gtk"
     },
      "* init" : "{\n   this.el.get_style_context().add_class(\"suggested-action\");\n}\n",
      "xtype" : "Button",
      "* pack" : "add_action_widget,1",
      "* init" : "{\n   this.el.get_style_context().add_class(\"suggested-action\");\n}\n",
      "xtype" : "Button",
      "* pack" : "add_action_widget,1",
-     "xtype" : "Button",
      "$ xns" : "Gtk"
     }
    ]
      "$ xns" : "Gtk"
     }
    ]
index 5eec338..4c8e624 100644 (file)
@@ -48,10 +48,10 @@ public class MergeBranch : Object
         var child_0 = new Xcls_Box2( _this );
         child_0.ref();
         this.el.get_content_area().add (  child_0.el  );
         var child_0 = new Xcls_Box2( _this );
         child_0.ref();
         this.el.get_content_area().add (  child_0.el  );
-        var child_1 = new Xcls_Button17( _this );
+        var child_1 = new Xcls_Button18( _this );
         child_1.ref();
         this.el.add_action_widget (  child_1.el , 0 );
         child_1.ref();
         this.el.add_action_widget (  child_1.el , 0 );
-        var child_2 = new Xcls_Button18( _this );
+        var child_2 = new Xcls_Button19( _this );
         child_2.ref();
         this.el.add_action_widget (  child_2.el , 1 );
 
         child_2.ref();
         this.el.add_action_widget (  child_2.el , 1 );
 
@@ -176,12 +176,15 @@ public class MergeBranch : Object
             var child_0 = new Xcls_table( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,false,0 );
             var child_0 = new Xcls_table( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,false,0 );
-            var child_1 = new Xcls_scrolled_window( _this );
+            var child_1 = new Xcls_Notebook14( _this );
             child_1.ref();
             this.el.add (  child_1.el  );
             child_1.ref();
             this.el.add (  child_1.el  );
-            var child_2 = new Xcls_spinner( _this );
+            var child_2 = new Xcls_scrolled_window( _this );
             child_2.ref();
             this.el.add (  child_2.el  );
             child_2.ref();
             this.el.add (  child_2.el  );
+            var child_3 = new Xcls_spinner( _this );
+            child_3.ref();
+            this.el.add (  child_3.el  );
         }
 
         // user defined functions
         }
 
         // user defined functions
@@ -506,7 +509,7 @@ public class MergeBranch : Object
 
     public class Xcls_dbmodel : Object
     {
 
     public class Xcls_dbmodel : Object
     {
-        public Gtk.ListStore el;
+        public Gtk. el;
         private MergeBranch  _this;
 
 
         private MergeBranch  _this;
 
 
@@ -517,11 +520,9 @@ public class MergeBranch : Object
         {
             _this = _owner;
             _this.dbmodel = this;
         {
             _this = _owner;
             _this.dbmodel = this;
-            this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
+            this.el = new Gtk.();
 
             // my vars (dec)
 
             // my vars (dec)
-
-            // set gobject values
         }
 
         // user defined functions
         }
 
         // user defined functions
@@ -649,6 +650,28 @@ public class MergeBranch : Object
     }
 
 
     }
 
 
+    public class Xcls_Notebook14 : Object
+    {
+        public Gtk.Notebook el;
+        private MergeBranch  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_Notebook14(MergeBranch _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.Notebook();
+
+            // my vars (dec)
+
+            // set gobject values
+        }
+
+        // user defined functions
+    }
+
     public class Xcls_scrolled_window : Object
     {
         public Gtk.ScrolledWindow el;
     public class Xcls_scrolled_window : Object
     {
         public Gtk.ScrolledWindow el;
@@ -752,7 +775,7 @@ public class MergeBranch : Object
     }
 
 
     }
 
 
-    public class Xcls_Button17 : Object
+    public class Xcls_Button18 : Object
     {
         public Gtk.Button el;
         private MergeBranch  _this;
     {
         public Gtk.Button el;
         private MergeBranch  _this;
@@ -761,7 +784,7 @@ public class MergeBranch : Object
             // my vars (def)
 
         // ctor
             // my vars (def)
 
         // ctor
-        public Xcls_Button17(MergeBranch _owner )
+        public Xcls_Button18(MergeBranch _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
         {
             _this = _owner;
             this.el = new Gtk.Button();
@@ -776,7 +799,7 @@ public class MergeBranch : Object
         // user defined functions
     }
 
         // user defined functions
     }
 
-    public class Xcls_Button18 : Object
+    public class Xcls_Button19 : Object
     {
         public Gtk.Button el;
         private MergeBranch  _this;
     {
         public Gtk.Button el;
         private MergeBranch  _this;
@@ -785,7 +808,7 @@ public class MergeBranch : Object
             // my vars (def)
 
         // ctor
             // my vars (def)
 
         // ctor
-        public Xcls_Button18(MergeBranch _owner )
+        public Xcls_Button19(MergeBranch _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
         {
             _this = _owner;
             this.el = new Gtk.Button();