public Xcls_name name;
// my vars (def)
+ public GitRepo repo;
public RooTicket? ticket;
public bool running;
if (response_id == 0) {
_this.el.hide();
this.running = false;
+ GitMonitor.gitmonitor.start();
return;
}
/*
}
}
*/
+
+ if (this.repo != null) {
+ repo.doMerge(
+ _this.actionsel.selectedAction(),
+ _this.ticketsel.selectedTicketId(),
+ _this.name.el.get_text()
+ );
+
+ } else {
+ GitRepo.doMerges(
+ _this.actionsel.selectedAction(),
+ _this.ticketsel.selectedTicketId(),
+ _this.name.el.get_text()
+ );
+ }
this.running = false;
_this.el.hide();
-
+ GitMonitor.gitmonitor.start();
});
}
// user defined functions
- public void show ( RooTicket ticket )
+ public void show ( RooTicket ticket, GitRepo? repo )
{
// this.el.set_gravity(Gdk.Gravity.NORTH);
if (this.running) {
return;
}
+ GitMonitor.gitmonitor.stop();
+
this.ticket = ticket;
+ this.repo = repo;
this.el.move((Gdk.Screen.width() / 2)- 250 ,0);
GLib.debug("Loading tickets");
_this.dbmodel.loadTickets();
_this.actionmodel.loadActions();
+
}
public class Xcls_VBox2 : Object
{
if (this.loading) {
return;
}
- var ticket_id = this.selectedTicketId();
-
- var name = RooTicket.singleton().usernameLocal();
-
- if (ticket_id == "" || ticket_id == null) {
-
- var dt = new DateTime.now_local();
- _this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d")));
- 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.name.updateText();
//GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2);
});
}
// user defined functions
+ public string selectedAction () {
+ Gtk.TreeIter iter;
+ Value val1;
+
+ this.el.get_active_iter (out iter);
+ _this.actionmodel.el.get_value (iter, 0, out val1);
+
+ return (string) val1;
+ }
}
public class Xcls_actioncellrenderer : Object
{
el.set_value(iter, 0, "");
el.set_value(iter, 1, "-- select action --");
- _this.action.el.set_active_iter(iter);
+ _this.actionsel.el.set_active_iter(iter);
el.append(out iter);
el.set_value(iter, 0, "CLOSE");
if (this.loading) {
return;
}
- var ticket_id = this.selectedTicketId();
-
- var name = RooTicket.singleton().usernameLocal();
- if (ticket_id != null && ticket_id != "") {
- _this.ticket = RooTicket.singleton().getById(ticket_id);
- } else {
- _this.ticket = null;
- }
-
_this.name.updateText();
//_this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName()));
// user defined functions
public void loadTickets () {
- RooTicket.singleton().loadTickets();
+ RooTicket.singleton().loadTickets("",RooTicket.NotMe.FALSE, RooTicket.Closed.FALSE);
_this.ticketsel.loading = true;
var el = this.el;
el.append(out iter);
-
-
el.set_value(iter, 0, "");
el.set_value(iter, 1, "-- select a ticket --");
_this.ticketsel.el.set_active_iter(iter);
+
+ if (_this.ticket != null && _this.ticket.id == "-1") {
+ el.append(out iter);
+ el.set_value(iter, 0, "-1");
+ el.set_value(iter, 1, "Temporary Branch - No ticket specified/relivant");
+ _this.ticketsel.el.set_active_iter(iter);
+ }
+
+
+
+
var tickets = RooTicket.singleton().tickets;
foreach(var ticket in tickets) {
el.set_value(iter, 0, ticket.id);
el.set_value(iter, 1, "#%s [%s] %s".printf( ticket.id, ticket.project_id_name , ticket.summary));
- if (_this.ticket.id == ticket.id) {
+ if (_this.ticket != null && _this.ticket.id == ticket.id) {
_this.ticketsel.el.set_active_iter(iter);
}
}
// user defined functions
+ public void updateText () {
+ var ticket_id = _this.ticketsel.selectedTicketId();
+
+ RooTicket ticket = null;
+ if (ticket_id.length > 0){
+ ticket = RooTicket.singleton().getById(ticket_id);
+ }
+
+ var name = RooTicket.singleton().usernameLocal();
+ var action = _this.actionsel.selectedAction();
+ this.el.set_editable(true);
+ switch (action) {
+ case "CLOSE": // merge changes and close..
+ this.el.set_text("Fix #%s - %s".printf(ticket_id, ticket != null ? ticket.summary : ""));
+ break;
+ case "LEAVE": // partial fix
+ this.el.set_text("Partial Fix #%s - %s".printf(ticket_id, ticket != null ? ticket.summary : ""));
+ break;
+ case "MASTER": // merge master
+ case "EXIT": // just switch back...
+ this.el.set_editable(false);
+ this.el.set_text(""); // not relivant..
+ break;
+ default:
+
+ break; /// don't fix the text value.
+ }
+
+ }
}