}
public Xcls_reposel reposel;
public Xcls_prcellrenderer prcellrenderer;
- public Xcls_prmodel prmodel;
+ public Xcls_repomodel repomodel;
// my vars (def)
- public GitRepo repo;
// ctor
public Clone()
this.el.position = Gtk.PositionType.RIGHT;
var child_0 = new Xcls_Box2( _this );
child_0.ref();
- this.el.pack_end ( child_0.el , false,false,0 );
+ this.el.add ( child_0.el );
}
// user defined functions
- public void show (Gtk.Widget btn, GitRepo repo) {
+ public void show (Gtk.Widget btn) {
//console.log('show all');
this.el.set_modal(true);
this.el.set_relative_to(btn);
-
+ this.repomodel.loadRepos();
//this.el.set_position(Gtk.PositionType.RIGHT);
// window + header?
this.el.vexpand = false;
var child_0 = new Xcls_reposel( _this );
child_0.ref();
- this.el.attach_defaults ( child_0.el , 0,1,1,2 );
+ this.el.add ( child_0.el );
var child_1 = new Xcls_Button6( _this );
child_1.ref();
this.el.add ( child_1.el );
var child_0 = new Xcls_prcellrenderer( _this );
child_0.ref();
this.el.pack_start ( child_0.el , true );
- var child_1 = new Xcls_prmodel( _this );
+ var child_1 = new Xcls_repomodel( _this );
child_1.ref();
this.el.set_model ( child_1.el );
// user defined functions
}
- public class Xcls_prmodel : Object
+ public class Xcls_repomodel : Object
{
public Gtk.ListStore el;
private Clone _this;
// my vars (def)
// ctor
- public Xcls_prmodel(Clone _owner )
+ public Xcls_repomodel(Clone _owner )
{
_this = _owner;
- _this.prmodel = this;
+ _this.repomodel = this;
this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
// my vars (dec)
}
// user defined functions
- public void loadProjects (string id) {
+ public void loadRepos () {
var rt = RooTicket.singleton();
var gr = GitRepo.singleton();
foreach(var newrepo in rt.repos) {
var has_repo = false;
foreach(var repo in gr.cache.values) {
- if (newrepo.name == repo.shortname) {
+ if (newrepo.shortname == repo.name) {
has_repo = true;
+ }
}
if (has_repo) {
continue;
}
el.append(out iter);
- el.set_value(iter, 0, repo.name);
- el.set_value(iter, 1, "%s : %s".printf(repo.shortname, repo.description) );
+ el.set_value(iter, 0, newrepo.shortname);
+ el.set_value(iter, 1, newrepo.shortname); // "%s : %s".printf(newrepo.shortname, newrepo.description) );
}
//listeners
this.el.button_press_event.connect( () => {
- _this.el.hide();
+ _this.el.hide();
+ Clones.singleton().el.hide();
+ var repo = _this.reposel.selectedRepo();
+ GitMonitor.gitmonitor.stop();
+
+
+ string[] args = { "git" , "--no-pager" , "clone" };
+
+ args += ("http://git.roojs.com/" + repo );
+
+
+
+ string[] env = {};
+ string home = "HOME=" + Environment.get_home_dir() ;
+ env += home ;
+ //v.push("GITPATH=" + this.repo );
+ //}
+
+ var cfg = new SpawnConfig(Environment.get_home_dir() + "/gitlive" , args , env);
+ //cfg.debug = true;
+
+ // may throw error...
+ var sp = new Spawn(cfg);
+
+ GLib.debug("Spawn: %s", sp.output);
+
+
+
+
+
+
+ GitMonitor.gitmonitor.start();
+
+ GitRepo.updateAll("show_clones");
+
return false;
});
}