void IRefreshableView.Refresh()
        {
            string query = GetBranchesQuery(mDateFilter);

            FillBranches(mWkInfo,
                         query,
                         BranchesSelection.GetSelectedRepObjectInfos(mBranchesListView));
        }
        void IBranchMenuOperations.DeleteBranch()
        {
            RepositorySpec        repSpec          = BranchesSelection.GetSelectedRepository(mBranchesListView);
            List <RepositorySpec> repositories     = BranchesSelection.GetSelectedRepositories(mBranchesListView);
            List <BranchInfo>     branchesToDelete = BranchesSelection.GetSelectedBranches(mBranchesListView);

            mBranchOperations.DeleteBranch(repositories, branchesToDelete);
        }
Beispiel #3
0
        void FillBranches(WorkspaceInfo wkInfo, string query, List <RepObjectInfo> branchesToSelect)
        {
            if (mIsRefreshing)
            {
                return;
            }

            mIsRefreshing = true;

            int defaultRow = TableViewOperations.
                             GetFirstSelectedRow(mBranchesListView);

            ((IProgressControls)mProgressControls).ShowProgress(
                PlasticLocalization.GetString(
                    PlasticLocalization.Name.LoadingBranches));

            ViewQueryResult queryResult = null;

            IThreadWaiter waiter = ThreadWaiter.GetWaiter();

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                queryResult = new ViewQueryResult(
                    PlasticGui.Plastic.API.FindQuery(wkInfo, query));
            },
                /*afterOperationDelegate*/ delegate
            {
                try
                {
                    if (waiter.Exception != null)
                    {
                        ExceptionsHandler.DisplayException(waiter.Exception);
                        return;
                    }

                    UpdateBranchesList(
                        mBranchesListView,
                        queryResult);

                    int branchesCount = GetBranchesCount(queryResult);

                    if (branchesCount == 0)
                    {
                        return;
                    }

                    BranchesSelection.SelectBranches(
                        mBranchesListView, branchesToSelect, defaultRow);
                }
                finally
                {
                    ((IProgressControls)mProgressControls).HideProgress();
                    mIsRefreshing = false;
                }
            });
        }
        void IBranchMenuOperations.SwitchToBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            mBranchOperations.SwitchToBranch(
                repSpec,
                branchInfo,
                RefreshAsset.UnityAssetDatabase);
        }
        void IBranchMenuOperations.RenameBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            BranchRenameData branchRenameData = RenameBranchDialog.GetBranchRenameData(
                repSpec,
                branchInfo,
                mParentWindow);

            mBranchOperations.RenameBranch(branchRenameData);
        }
        void IBranchMenuOperations.CreateBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            BranchCreationData branchCreationData = CreateBranchDialog.CreateBranchFromLastParentBranchChangeset(
                mParentWindow,
                repSpec,
                branchInfo);

            mBranchOperations.CreateBranch(branchCreationData, RefreshAsset.UnityAssetDatabase);
        }
Beispiel #7
0
        void IBranchMenuOperations.DeleteBranch()
        {
            RepositorySpec        repSpec          = BranchesSelection.GetSelectedRepository(mBranchesListView);
            List <RepositorySpec> repositories     = BranchesSelection.GetSelectedRepositories(mBranchesListView);
            List <BranchInfo>     branchesToDelete = BranchesSelection.GetSelectedBranches(mBranchesListView);

            mBranchOperations.DeleteBranch(repositories, branchesToDelete, () =>
            {
                TrackFeatureUseEvent.For(
                    repSpec,
                    TrackFeatureUseEvent.Features.DeleteBranch);
            });
        }
Beispiel #8
0
        void IBranchMenuOperations.SwitchToBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            mBranchOperations.SwitchToBranch(
                repSpec,
                branchInfo,
                () =>
            {
                TrackFeatureUseEvent.For(
                    repSpec,
                    TrackFeatureUseEvent.Features.SwitchBranch);
                RefreshAsset.UnityAssetDatabase();
            });
        }
Beispiel #9
0
        void IBranchMenuOperations.RenameBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            BranchRenameData branchRenameData = RenameBranchDialog.GetBranchRenameData(
                repSpec,
                branchInfo,
                mParentWindow);

            mBranchOperations.RenameBranch(branchRenameData, () =>
            {
                TrackFeatureUseEvent.For(
                    repSpec,
                    TrackFeatureUseEvent.Features.RenameBranch);
            });
        }
Beispiel #10
0
        void IBranchMenuOperations.CreateBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            BranchCreationData branchCreationData = CreateBranchDialog.CreateBranchFromLastParentBranchChangeset(
                mParentWindow,
                repSpec,
                branchInfo);

            mBranchOperations.CreateBranch(branchCreationData, () =>
            {
                TrackFeatureUseEvent.For(
                    repSpec,
                    TrackFeatureUseEvent.Features.CreateBranch);
            });
        }
 int IBranchMenuOperations.GetSelectedBranchesCount()
 {
     return(BranchesSelection.GetSelectedBranchesCount(mBranchesListView));
 }