public EditBranchDialog (GitRepository repo, Branch branch, bool isNew) { this.Build (); this.repo = repo; comboStore = new ListStore (typeof(string), typeof(Gdk.Pixbuf), typeof (string)); comboSources.Model = comboStore; CellRendererPixbuf crp = new CellRendererPixbuf (); comboSources.PackStart (crp, false); comboSources.AddAttribute (crp, "pixbuf", 1); CellRendererText crt = new CellRendererText (); comboSources.PackStart (crt, true); comboSources.AddAttribute (crt, "text", 2); if (branch != null) { if (!isNew) oldName = branch.Name; currentTracking = branch.Tracking; entryName.Text = branch.Name; if (currentTracking != null) checkTrack.Active = true; } foreach (Branch b in repo.GetBranches ()) { AddValues (b.Name, ImageService.GetPixbuf ("vc-git-branch")); } foreach (string t in repo.GetTags ()) AddValues (t, ImageService.GetPixbuf ("vc-git-tag")); foreach (RemoteSource r in repo.GetRemotes ()) { foreach (string b in repo.GetRemoteBranches (r.Name)) AddValues (r.Name + "/" + b, ImageService.GetPixbuf ("md-web-search-icon")); } UpdateStatus (); }
public EditBranchDialog (GitRepository repo, Branch branch, bool isNew) { this.Build (); this.repo = repo; comboStore = new ListStore (typeof(string), typeof(Xwt.Drawing.Image), typeof (string)); comboSources.Model = comboStore; var crp = new CellRendererImage (); comboSources.PackStart (crp, false); comboSources.AddAttribute (crp, "image", 1); var crt = new CellRendererText (); comboSources.PackStart (crt, true); comboSources.AddAttribute (crt, "text", 2); if (branch != null) { if (!isNew) oldName = branch.Name; currentTracking = branch.Tracking; entryName.Text = branch.Name; checkTrack.Active = currentTracking != null; } foreach (Branch b in repo.GetBranches ()) { AddValues (b.Name, ImageService.GetIcon ("vc-branch", IconSize.Menu)); } foreach (string t in repo.GetTags ()) AddValues (t, ImageService.GetIcon ("vc-tag", IconSize.Menu)); foreach (RemoteSource r in repo.GetRemotes ()) { foreach (string b in repo.GetRemoteBranches (r.Name)) AddValues (r.Name + "/" + b, ImageService.GetIcon ("vc-repository", IconSize.Menu)); } UpdateStatus (); }