From: Alan Knowles Date: Fri, 28 Dec 2018 06:55:34 +0000 (+0800) Subject: MergeBranch.bjs X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=9d778954a71b4085f3013d33aebcb3447820a0ca MergeBranch.bjs MergeBranch.vala --- diff --git a/MergeBranch.bjs b/MergeBranch.bjs index 802da430..9282dcf8 100644 --- a/MergeBranch.bjs +++ b/MergeBranch.bjs @@ -163,10 +163,30 @@ "xtype" : "Box", "gboolean homogeneous" : false, "$ xns" : "Gtk", - "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL" + "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", + "items" : [ + { + "int height_request" : 500, + "id" : "scrolled_window", + "* init" : "{\n\tthis.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n", + "* pack" : "add", + "xtype" : "ScrolledWindow", + "$ xns" : "Gtk", + "bool vexpand" : true, + "items" : [ + { + "id" : "view", + "* 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" + } + ] + } + ] }, { - "* pack" : "append_page,_this.label_status.el", + "* pack" : "append_page,_this.label_ticket.el", "xtype" : "Box", "gboolean homogeneous" : false, "$ xns" : "Gtk", @@ -174,24 +194,6 @@ } ] }, - { - "int height_request" : 500, - "id" : "scrolled_window", - "* init" : "{\n\tthis.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n", - "* pack" : "add", - "xtype" : "ScrolledWindow", - "$ xns" : "Gtk", - "bool vexpand" : true, - "items" : [ - { - "id" : "view", - "* 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" - } - ] - }, { "id" : "spinner", "bool hexpand" : true, diff --git a/MergeBranch.vala b/MergeBranch.vala index cda84538..ed1618b9 100644 --- a/MergeBranch.vala +++ b/MergeBranch.vala @@ -181,12 +181,9 @@ public class MergeBranch : Object var child_1 = new Xcls_Notebook14( _this ); child_1.ref(); this.el.add ( child_1.el ); - var child_2 = new Xcls_scrolled_window( _this ); + var child_2 = new Xcls_spinner( _this ); 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 @@ -677,9 +674,9 @@ public class MergeBranch : Object var child_2 = new Xcls_Box17( _this ); child_2.ref(); this.el.append_page ( child_2.el , _this.label_diff.el ); - var child_3 = new Xcls_Box18( _this ); + var child_3 = new Xcls_Box20( _this ); child_3.ref(); - this.el.append_page ( child_3.el , _this.label_status.el ); + this.el.append_page ( child_3.el , _this.label_ticket.el ); } // user defined functions @@ -748,35 +745,13 @@ public class MergeBranch : Object // set gobject values this.el.homogeneous = false; + var child_0 = new Xcls_scrolled_window( _this ); + child_0.ref(); + this.el.add ( child_0.el ); } // user defined functions } - - public class Xcls_Box18 : Object - { - public Gtk.Box el; - private MergeBranch _this; - - - // my vars (def) - - // ctor - public Xcls_Box18(MergeBranch _owner ) - { - _this = _owner; - this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 ); - - // my vars (dec) - - // set gobject values - this.el.homogeneous = false; - } - - // user defined functions - } - - public class Xcls_scrolled_window : Object { public Gtk.ScrolledWindow el; @@ -854,6 +829,31 @@ public class MergeBranch : Object } + + public class Xcls_Box20 : Object + { + public Gtk.Box el; + private MergeBranch _this; + + + // my vars (def) + + // ctor + public Xcls_Box20(MergeBranch _owner ) + { + _this = _owner; + this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 ); + + // my vars (dec) + + // set gobject values + this.el.homogeneous = false; + } + + // user defined functions + } + + public class Xcls_spinner : Object { public Gtk.Spinner el;