Example #1
0
        protected virtual void OnButtonEditBranchClicked(object sender, System.EventArgs e)
        {
            TreeIter it;

            if (!listBranches.Selection.GetSelected(out it))
            {
                return;
            }
            Branch b   = (Branch)storeBranches.GetValue(it, 0);
            var    dlg = new EditBranchDialog(repo, b, false);

            try {
                if (MessageService.RunCustomDialog(dlg) == (int)ResponseType.Ok)
                {
                    if (dlg.BranchName != b.Name)
                    {
                        try {
                            repo.RenameBranch(b.Name, dlg.BranchName);
                        } catch (Exception ex) {
                            MessageService.ShowException(ex, GettextCatalog.GetString("The branch could not be renamed"));
                        }
                    }
                    repo.SetBranchTrackSource(dlg.BranchName, dlg.TrackSource);
                    FillBranches();
                }
            } finally {
                dlg.Destroy();
            }
        }