Example #1
0
        public EditBranchDialog(MercurialRepository 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 (var b in repo.GetBranches())
            {
                AddValues(b.Name, ImageService.GetPixbuf("vc-git-branch", IconSize.Menu));
            }

            foreach (var t in repo.GetTags())
            {
                AddValues(t.Name, ImageService.GetPixbuf("vc-git-tag", IconSize.Menu));
            }

            foreach (var r in repo.GetRemotes())
            {
                foreach (string b in repo.GetRemoteBranches(r.Name))
                {
                    AddValues(r.Name + "/" + b, ImageService.GetPixbuf("md-web-search-icon", IconSize.Menu));
                }
            }

            UpdateStatus();
        }
        public EditBranchDialog(MercurialRepository 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 (var b in repo.GetBranches ()) {
                AddValues (b.Name, ImageService.GetPixbuf ("vc-git-branch", IconSize.Menu));
            }

            foreach (var t in repo.GetTags ())
                AddValues (t.Name, ImageService.GetPixbuf ("vc-git-tag", IconSize.Menu));

            foreach (var r in repo.GetRemotes ()) {
                foreach (string b in repo.GetRemoteBranches (r.Name))
                    AddValues (r.Name + "/" + b, ImageService.GetPixbuf ("md-web-search-icon", IconSize.Menu));
            }

            UpdateStatus ();
        }
Example #3
0
        void Fill()
        {
            store.Clear();

            foreach (var b in repo.GetBranches())
            {
                store.AppendValues(b.Name, ImageService.GetPixbuf("vc-git-branch", IconSize.Menu), b.Name, "branch");
            }

            foreach (var t in repo.GetTags())
            {
                store.AppendValues(t.Name, ImageService.GetPixbuf("vc-git-tag", IconSize.Menu), t, "tag");
            }

            foreach (var r in repo.GetRemotes())
            {
                TreeIter it = store.AppendValues(null, ImageService.GetPixbuf("md-web-search-icon", IconSize.Menu), r.Name, null);
                foreach (string b in repo.GetRemoteBranches(r.Name))
                {
                    store.AppendValues(it, r.Name + "/" + b, ImageService.GetPixbuf("vc-git-branch", IconSize.Menu), b, "remote");
                }
            }
            UpdateStatus();
        }