From f631a04afe02c059dc7e5ae01ef69c2103e2e184 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 30 Oct 2018 17:05:07 +0800 Subject: [PATCH] NewBranch.bjs NewBranch.vala --- NewBranch.bjs | 7 +++--- NewBranch.vala | 66 ++++++++++++++++++++++++-------------------------- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/NewBranch.bjs b/NewBranch.bjs index b6660ab0..2af96c6d 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -10,15 +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.log(\"got %d\", reponse_id)\n}", + "response" : " (self, response_id) => { \n \n\t GLib.debug(\"got %d\", (int) response_id);\n}", "show" : "(self) => {\n this.el.run();\n //test\n}" }, - "id" : "DialogNewComponent", "default_width" : 500, "$ deletable" : true, "title" : "Create a working branch ", "xtype" : "Dialog", - "| void show" : "( ) \n{\n \n this.show();\n //this.success = c.success;\n \n \n}", + "| void show" : "( ) \n{\n \n this.el.show_all();\n \n}", "default_height" : 200, "$ modal" : true, "$ xns" : "Gtk", @@ -33,7 +32,7 @@ "xtype" : "Table", "n_columns" : 2, "$ xns" : "Gtk", - "n_rows" : 3, + "n_rows" : 2, "$ homogeneous" : true, "items" : [ { diff --git a/NewBranch.vala b/NewBranch.vala index 6bbbd017..e456d65d 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -1,16 +1,16 @@ -static Xcls_DialogNewComponent _DialogNewComponent; +static NewBranch _NewBranch; -public class Xcls_DialogNewComponent : Object +public class NewBranch : Object { public Gtk.Dialog el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; - public static Xcls_DialogNewComponent singleton() + public static NewBranch singleton() { - if (_DialogNewComponent == null) { - _DialogNewComponent= new Xcls_DialogNewComponent(); + if (_NewBranch == null) { + _NewBranch= new NewBranch(); } - return _DialogNewComponent; + return _NewBranch; } public Xcls_build_module build_module; public Xcls_dbcellrenderer dbcellrenderer; @@ -20,7 +20,7 @@ public class Xcls_DialogNewComponent : Object // my vars (def) // ctor - public Xcls_DialogNewComponent() + public NewBranch() { _this = this; this.el = new Gtk.Dialog(); @@ -51,7 +51,7 @@ public class Xcls_DialogNewComponent : Object }); this.el.response.connect( (self, response_id) => { - GLib.log("got %d", reponse_id) + GLib.debug("got %d", (int) response_id); }); this.el.show.connect( (self) => { this.el.run(); @@ -63,21 +63,19 @@ public class Xcls_DialogNewComponent : Object public void show ( ) { - this.show(); - //this.success = c.success; - - + this.el.show_all(); + } public class Xcls_VBox2 : Object { public Gtk.VBox el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_VBox2(Xcls_DialogNewComponent _owner ) + public Xcls_VBox2(NewBranch _owner ) { _this = _owner; this.el = new Gtk.VBox( true, 0 ); @@ -95,16 +93,16 @@ public class Xcls_DialogNewComponent : Object public class Xcls_Table3 : Object { public Gtk.Table el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_Table3(Xcls_DialogNewComponent _owner ) + public Xcls_Table3(NewBranch _owner ) { _this = _owner; - this.el = new Gtk.Table( 3, 2, true ); + this.el = new Gtk.Table( 2, 2, true ); // my vars (dec) @@ -128,13 +126,13 @@ public class Xcls_DialogNewComponent : Object public class Xcls_Label4 : Object { public Gtk.Label el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_Label4(Xcls_DialogNewComponent _owner ) + public Xcls_Label4(NewBranch _owner ) { _this = _owner; this.el = new Gtk.Label( "Select Ticket" ); @@ -153,13 +151,13 @@ public class Xcls_DialogNewComponent : Object public class Xcls_build_module : Object { public Gtk.ComboBox el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_build_module(Xcls_DialogNewComponent _owner ) + public Xcls_build_module(NewBranch _owner ) { _this = _owner; _this.build_module = this; @@ -185,13 +183,13 @@ public class Xcls_DialogNewComponent : Object public class Xcls_dbcellrenderer : Object { public Gtk.CellRendererText el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_dbcellrenderer(Xcls_DialogNewComponent _owner ) + public Xcls_dbcellrenderer(NewBranch _owner ) { _this = _owner; _this.dbcellrenderer = this; @@ -208,13 +206,13 @@ public class Xcls_DialogNewComponent : Object public class Xcls_dbmodel : Object { public Gtk.ListStore el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_dbmodel(Xcls_DialogNewComponent _owner ) + public Xcls_dbmodel(NewBranch _owner ) { _this = _owner; _this.dbmodel = this; @@ -266,13 +264,13 @@ public class Xcls_DialogNewComponent : Object public class Xcls_Label8 : Object { public Gtk.Label el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_Label8(Xcls_DialogNewComponent _owner ) + public Xcls_Label8(NewBranch _owner ) { _this = _owner; this.el = new Gtk.Label( "or use this as branch name" ); @@ -290,13 +288,13 @@ public class Xcls_DialogNewComponent : Object public class Xcls_name : Object { public Gtk.Entry el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_name(Xcls_DialogNewComponent _owner ) + public Xcls_name(NewBranch _owner ) { _this = _owner; _this.name = this; @@ -316,13 +314,13 @@ public class Xcls_DialogNewComponent : Object public class Xcls_Button10 : Object { public Gtk.Button el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_Button10(Xcls_DialogNewComponent _owner ) + public Xcls_Button10(NewBranch _owner ) { _this = _owner; this.el = new Gtk.Button(); @@ -339,13 +337,13 @@ public class Xcls_DialogNewComponent : Object public class Xcls_Button11 : Object { public Gtk.Button el; - private Xcls_DialogNewComponent _this; + private NewBranch _this; // my vars (def) // ctor - public Xcls_Button11(Xcls_DialogNewComponent _owner ) + public Xcls_Button11(NewBranch _owner ) { _this = _owner; this.el = new Gtk.Button(); -- 2.39.2