public Xcls_name name;
public Xcls_btn_not_me btn_not_me;
public Xcls_btn_closed btn_closed;
+ public Xcls_scrolled_window scrolled_window;
+ public Xcls_view view;
// my vars (def)
public GitRepo? repo;
// set gobject values
this.el.title = "Create a working branch ";
- this.el.default_height = 200;
+ this.el.default_height = 500;
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 );
this.repo = repo;
-
-
+
this.el.move((Gdk.Screen.width() / 2)- 250 ,0);
this.el.set_default_size( 500,200); // not sure why it grows..
_this.prmodel.loadProjects(curproj == null ? "" : curproj.id);
_this.dbmodel.loadTickets(curproj == null ? "": curproj.id, tid);
+
+ if (tid != "") {
+ var name = RooTicket.singleton().usernameLocal();
+ var ticket = RooTicket.singleton().getById(tid);
+ _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
+
+
+ }
+ _this.view.loadTicket(tid);
this.el.run();
}
- public class Xcls_VBox2 : Object
+ public class Xcls_Box2 : Object
{
- public Gtk.VBox el;
+ public Gtk.Box el;
private NewBranch _this;
// my vars (def)
// ctor
- public Xcls_VBox2(NewBranch _owner )
+ public Xcls_Box2(NewBranch _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
var dt = new DateTime.now_local();
_this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d")));
+ _this.view.loadTicket("");
return;
}
var ticket = RooTicket.singleton().getById(ticket_id);
_this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
-
+ _this.scrolled_window.el.show();
+
+ _this.view.loadTicket(ticket.id);
//GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2);
});
}
RooTicket.singleton().loadTickets(
project_id,
- _this.btn_not_me.el.active ? RooTicket.NotMe.TRUE : RooTicket.NotMe.FALSE,
- _this.btn_closed.el.active ? RooTicket.Closed.TRUE : RooTicket.Closed.FALSE
+ _this.btn_not_me.el.active ? RooTicket.Who.ANYBODY : RooTicket.Who.ME,
+ _this.btn_closed.el.active ? RooTicket.Status.ALL : RooTicket.Status.ACTIVE
);
_this.ticketsel.loading = true;
// set gobject values
this.el.expand = false;
this.el.label = "New Ticket";
+
+ //listeners
+ this.el.clicked.connect( () => {
+ _this.el.response(-1);
+ Ticket.singleton().show(_this.repo);
+
+ });
}
// user defined functions
+ public class Xcls_scrolled_window : Object
+ {
+ public Gtk.ScrolledWindow el;
+ private NewBranch _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_scrolled_window(NewBranch _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 NewBranch _this;
+
+
+ // my vars (def)
+
+ // ctor
+ public Xcls_view(NewBranch _owner )
+ {
+ _this = _owner;
+ _this.view = this;
+ this.el = new WebKit.WebView();
+
+ // my vars (dec)
+
+ // set gobject values
+
+ //listeners
+ this.el.authenticate.connect( (auth) => {
+
+
+ });
+ }
+
+ // 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);
+ }
+ this.el.load_uri("https://roojs.com/admin.php/MTrack/View/" + tid);
+ }
+ }
+
+
}