"show" : "(self) => {\n \n\n //test\n}"
},
"default_width" : 500,
- "$ deletable" : true,
"# 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 this.ticket = ticket;\n this.repo = repo;\n \n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n \tGLib.debug(\"Loading tickets\"); \n\n\n this.el.show_all();\n \t_this.dbmodel.loadTickets();\n \t_this.actionmodel.loadActions();\n\n\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 this.ticket = ticket;\n this.repo = repo;\n \n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n \tGLib.debug(\"Loading tickets\"); \n\n\n this.el.show_all();\n \t_this.dbmodel.loadTickets();\n \t_this.actionmodel.loadActions();\n\t_this.view.loadTicket(ticket.id);\n\n}",
"default_height" : 200,
"# RooTicket? ticket" : "null",
"$ xns" : "Gtk",
"bool modal" : true,
"items" : [
{
- "xtype" : "VBox",
+ "xtype" : "Box",
"$ pack" : "get_content_area().add",
"$ xns" : "Gtk",
+ "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
"items" : [
{
"bool homogeneous" : false,
- "xtype" : "Table",
"* pack" : "pack_start,false,false,0",
+ "xtype" : "Table",
"uint column_spacing" : 2,
"n_columns" : 2,
"$ xns" : "Gtk",
"n_rows" : 2,
+ "bool vexpand" : false,
"int margin" : 2,
"items" : [
{
"items" : [
{
"id" : "actioncellrenderer",
- "xtype" : "CellRendererText",
"* pack" : "pack_start,true",
+ "xtype" : "CellRendererText",
"$ xns" : "Gtk"
},
{
"id" : "actionmodel",
- "xtype" : "ListStore",
"* pack" : "set_model",
+ "xtype" : "ListStore",
"$ columns" : "typeof(string),typeof(string)",
"n_columns" : 2,
"$ xns" : "Gtk",
},
{
"listeners" : {
- "changed" : "() => {\n\tif (this.loading) {\n\t\treturn;\n\t}\n\t\n\t \n \t_this.name.updateText();\n\t//_this.name.el.set_text(\"wip_%s_T%s_%s\".printf(name,ticket.id, ticket.summaryToBranchName()));\n\t\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n}"
+ "changed" : "() => {\n\tif (this.loading) {\n\t\treturn;\n\t}\n\t_this.view.loadTicket(this.selectedTicketId());\n\t \n \t_this.name.updateText();\n\t//_this.name.el.set_text(\"wip_%s_T%s_%s\".printf(name,ticket.id, ticket.summaryToBranchName()));\n\t\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n}"
},
"id" : "ticketsel",
"* init" : "this.el.add_attribute(_this.dbcellrenderer.el , \"markup\", 1 );",
"* pack" : "attach_defaults,1,2,1,2",
"xtype" : "ComboBox",
- "# bool loading" : false,
+ "# bool loading" : true,
"$ xns" : "Gtk",
"| string selectedTicketId" : "() {\nGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.dbmodel.el.get_value (iter, 0, out val1);\n \n\n\treturn (string) val1;\n\t\n\t\n\t\n\t\n}\n",
"items" : [
{
"id" : "dbcellrenderer",
- "* pack" : "pack_start,true",
"xtype" : "CellRendererText",
+ "* pack" : "pack_start,true",
"$ xns" : "Gtk"
},
{
"id" : "dbmodel",
- "* pack" : "set_model",
"xtype" : "ListStore",
+ "* pack" : "set_model",
"| void loadTickets" : " () {\n\n RooTicket.singleton().loadTickets(\"\",RooTicket.Who.ME, RooTicket.Status.ACTIVE);\n \n _this.ticketsel.loading = true;\n\n this.el.clear(); \n Gtk.TreeIter iter;\n var el = this.el;\n \n el.append(out iter);\n el.set_value(iter, 0, \"\");\n el.set_value(iter, 1, \"-- select a ticket --\");\n \n _this.ticketsel.el.set_active_iter(iter);\n \n if (_this.ticket != null && _this.ticket.id == \"-1\") {\n\t\tel.append(out iter);\n\t\tel.set_value(iter, 0, \"-1\");\n\t\tel.set_value(iter, 1, \"Temporary Branch - No ticket specified/relivant\");\n _this.ticketsel.el.set_active_iter(iter);\t\n }\n \n \n \n \n var tickets = RooTicket.singleton().tickets;\n foreach(var ticket in tickets) {\n \n el.append(out iter);\n\n el.set_value(iter, 0, ticket.id);\n el.set_value(iter, 1, \"#%s [%s] %s\".printf( ticket.id, ticket.project_id_name , ticket.summary));\n\t\tif (_this.ticket != null && _this.ticket.id == ticket.id) {\n\t\t _this.ticketsel.el.set_active_iter(iter);\n\t }\n \n }\n \n _this.ticketsel.loading = false;\n //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING); \n \n}\n",
"$ columns" : "typeof(string),typeof(string)",
"n_columns" : 2,
"$ xns" : "Gtk"
}
]
+ },
+ {
+ "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",
+ "xtype" : "WebView",
+ "* pack" : "add",
+ "$ 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",
- "* pack" : "add_action_widget,0",
"xtype" : "Button",
+ "* pack" : "add_action_widget,0",
"Gtk.ReliefStyle relief" : "Gtk.ReliefStyle.NONE",
"$ xns" : "Gtk"
},
{
"label" : "Do Merge",
- "* pack" : "add_action_widget,1",
"xtype" : "Button",
+ "* pack" : "add_action_widget,1",
"$ xns" : "Gtk"
}
]
public Xcls_dbcellrenderer dbcellrenderer;
public Xcls_dbmodel dbmodel;
public Xcls_name name;
+ public Xcls_scrolled_window scrolled_window;
+ public Xcls_view view;
// my vars (def)
public GitRepo repo;
this.el.default_width = 500;
this.el.deletable = true;
this.el.modal = true;
- var child_0 = new Xcls_VBox2( _this );
+ var child_0 = new Xcls_Box2( _this );
child_0.ref();
this.el.get_content_area().add ( child_0.el );
- var child_1 = new Xcls_Button14( _this );
+ var child_1 = new Xcls_Button16( _this );
child_1.ref();
this.el.add_action_widget ( child_1.el , 0 );
- var child_2 = new Xcls_Button15( _this );
+ var child_2 = new Xcls_Button17( _this );
child_2.ref();
this.el.add_action_widget ( child_2.el , 1 );
this.el.show_all();
_this.dbmodel.loadTickets();
_this.actionmodel.loadActions();
-
+ _this.view.loadTicket(ticket.id);
}
- public class Xcls_VBox2 : Object
+ public class Xcls_Box2 : Object
{
- public Gtk.VBox el;
+ public Gtk.Box el;
private MergeBranch _this;
// my vars (def)
// ctor
- public Xcls_VBox2(MergeBranch _owner )
+ public Xcls_Box2(MergeBranch _owner )
{
_this = _owner;
- this.el = new Gtk.VBox( true, 0 );
+ this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
// my vars (dec)
var child_0 = new Xcls_Table3( _this );
child_0.ref();
this.el.pack_start ( child_0.el , false,false,0 );
+ var child_1 = new Xcls_scrolled_window( _this );
+ child_1.ref();
+ this.el.add ( child_1.el );
}
// user defined functions
// set gobject values
this.el.margin = 2;
this.el.column_spacing = 2;
+ this.el.vexpand = false;
var child_0 = new Xcls_Label4( _this );
child_0.ref();
this.el.attach_defaults ( child_0.el , 0,1,0,1 );
this.el = new Gtk.ComboBox();
// my vars (dec)
- this.loading = false;
+ this.loading = true;
// set gobject values
var child_0 = new Xcls_dbcellrenderer( _this );
if (this.loading) {
return;
}
-
+ _this.view.loadTicket(this.selectedTicketId());
_this.name.updateText();
//_this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
}
+ public class Xcls_scrolled_window : Object
+ {
+ public Gtk.ScrolledWindow el;
+ private MergeBranch _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_scrolled_window(MergeBranch _owner )
+ {
+ _this = _owner;
+ _this.scrolled_window = this;
+ this.el = new Gtk.ScrolledWindow( null, null );
+
+ // my vars (dec)
+
+ // set gobject values
+ this.el.height_request = 500;
+ this.el.vexpand = true;
+ var child_0 = new Xcls_view( _this );
+ child_0.ref();
+ this.el.add ( child_0.el );
+
+ // init method
+
+ {
+ this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
+ }
+ }
+
+ // user defined functions
+ }
+ public class Xcls_view : Object
+ {
+ public WebKit.WebView el;
+ private MergeBranch _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_view(MergeBranch _owner )
+ {
+ _this = _owner;
+ _this.view = this;
+ this.el = new WebKit.WebView();
+
+ // my vars (dec)
+ }
+
+ // user defined functions
+ public void loadTicket (string tid) {
+ int h,w;
+ _this.el.get_size(out w, out h);
+
+ if (tid == "") {
+ _this.scrolled_window.el.hide();
+ _this.el.resize(w, 150);
+ } else {
+ _this.scrolled_window.el.show();
+ _this.el.resize(w, 800);
+ }
+
+ var rs = RooTicket.singleton();
+ var uri = new WebKit.URIRequest("https://roojs.com/admin.php/MTrack/View/" + tid);
+ var hd = uri.get_http_headers();
+ var authCode = Base64.encode ("%s:%s".printf(rs.username, rs.password).data);
+ hd.append("Authorization", "Basic %s".printf(authCode));
+
+ this.el.load_request(uri);
+ }
+ }
+
+
- public class Xcls_Button14 : Object
+ public class Xcls_Button16 : Object
{
public Gtk.Button el;
private MergeBranch _this;
// my vars (def)
// ctor
- public Xcls_Button14(MergeBranch _owner )
+ public Xcls_Button16(MergeBranch _owner )
{
_this = _owner;
this.el = new Gtk.Button();
// user defined functions
}
- public class Xcls_Button15 : Object
+ public class Xcls_Button17 : Object
{
public Gtk.Button el;
private MergeBranch _this;
// my vars (def)
// ctor
- public Xcls_Button15(MergeBranch _owner )
+ public Xcls_Button17(MergeBranch _owner )
{
_this = _owner;
this.el = new Gtk.Button();