コード例 #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();
            }
        }
コード例 #2
0
        protected virtual void OnButtonAddBranchClicked(object sender, System.EventArgs e)
        {
            var dlg = new EditBranchDialog(repo, null, true);

            try {
                if (MessageService.RunCustomDialog(dlg) == (int)ResponseType.Ok)
                {
                    repo.CreateBranch(dlg.BranchName, dlg.TrackSource);
                    FillBranches();
                }
            } finally {
                dlg.Destroy();
            }
        }
コード例 #3
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 ();
     }
 }
コード例 #4
0
 protected virtual void OnButtonAddBranchClicked(object sender, System.EventArgs e)
 {
     var dlg = new EditBranchDialog (repo, null, true);
     try {
         if (MessageService.RunCustomDialog (dlg) == (int) ResponseType.Ok) {
             repo.CreateBranch (dlg.BranchName, dlg.TrackSource);
             FillBranches ();
         }
     } finally {
         dlg.Destroy ();
     }
 }