コード例 #1
0
        void IOpenMenuOperations.Open()
        {
            List <string> selectedPaths = PendingChangesSelection.
                                          GetSelectedPathsWithoutMeta(mPendingChangesTreeView);

            FileSystemOperation.Open(selectedPaths);
        }
コード例 #2
0
        void PendingChangesViewMenu.IMetaMenuOperations.DiffMeta()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mWkInfo,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffWorkspaceContent,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffWorkspaceContent,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffWorkspaceContent))
            {
                return;
            }

            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);
            ChangeInfo selectedChangeMeta = mPendingChangesTreeView.GetMetaChange(
                selectedChange);

            ChangeInfo changedForMoved     = mPendingChanges.GetChangedForMoved(selectedChange);
            ChangeInfo changedForMovedMeta = (changedForMoved == null) ?
                                             null : mPendingChangesTreeView.GetMetaChange(changedForMoved);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChangeMeta,
                changedForMovedMeta,
                mProgressControls,
                null,
                null);
        }
コード例 #3
0
        void IOpenMenuOperations.OpenWithCustom(string exePath, string args)
        {
            List <string> selectedPaths = PendingChangesSelection.
                                          GetSelectedPathsWithoutMeta(mPendingChangesTreeView);

            OpenOperation.OpenWith(exePath, selectedPaths);
        }
コード例 #4
0
        void PendingChangesViewMenu.IMetaMenuOperations.OpenMeta()
        {
            List <string> selectedPaths = PendingChangesSelection
                                          .GetSelectedMetaPaths(mPendingChangesTreeView);

            FileSystemOperation.Open(selectedPaths);
        }
コード例 #5
0
        void IPendingChangesMenuOperations.UndoChanges()
        {
            List <ChangeInfo> changesToUndo = PendingChangesSelection
                                              .GetSelectedChanges(mPendingChangesTreeView);

            List <ChangeInfo> dependenciesCandidates =
                mPendingChangesTreeView.GetDependenciesCandidates(changesToUndo, true);

            UndoChangesForMode(mIsGluonMode, changesToUndo, dependenciesCandidates);
        }
コード例 #6
0
        void IPendingChangesMenuOperations.History()
        {
            ChangeInfo selectedChange = PendingChangesSelection.
                                        GetSelectedChange(mPendingChangesTreeView);

            mHistoryViewLauncher.ShowHistoryView(
                selectedChange.RepositorySpec,
                selectedChange.RevInfo.ItemId,
                selectedChange.Path,
                selectedChange.IsDirectory);
        }
コード例 #7
0
        void IOpenMenuOperations.OpenInExplorer()
        {
            List <string> selectedPaths = PendingChangesSelection
                                          .GetSelectedPathsWithoutMeta(mPendingChangesTreeView);

            if (selectedPaths.Count < 1)
            {
                return;
            }

            FileSystemOperation.OpenInExplorer(selectedPaths[0]);
        }
コード例 #8
0
        void IPendingChangesMenuOperations.Diff()
        {
            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChange,
                mPendingChanges.GetChangedForMoved(selectedChange),
                null,
                null,
                null);
        }
コード例 #9
0
        void PendingChangesViewMenu.IMetaMenuOperations.HistoryMeta()
        {
            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);
            ChangeInfo selectedChangeMeta = mPendingChangesTreeView.GetMetaChange(
                selectedChange);

            mHistoryViewLauncher.ShowHistoryView(
                selectedChangeMeta.RepositorySpec,
                selectedChangeMeta.RevInfo.ItemId,
                selectedChangeMeta.Path,
                selectedChangeMeta.IsDirectory);
        }
コード例 #10
0
        void IPendingChangesMenuOperations.SearchMatches()
        {
            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);

            if (selectedChange == null)
            {
                return;
            }

            SearchMatchesOperation operation = new SearchMatchesOperation(
                mWkInfo, mPlasticClient, mPlasticClient,
                mProgressControls, mDeveloperNewIncomingChangesUpdater);

            operation.SearchMatches(
                selectedChange,
                PendingChangesSelection.GetAllChanges(mPendingChangesTreeView));
        }
コード例 #11
0
        void PendingChangesViewMenu.IMetaMenuOperations.DiffMeta()
        {
            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);
            ChangeInfo selectedChangeMeta = mPendingChangesTreeView.GetMetaChange(
                selectedChange);

            ChangeInfo changedForMoved     = mPendingChanges.GetChangedForMoved(selectedChange);
            ChangeInfo changedForMovedMeta = (changedForMoved == null) ?
                                             null : mPendingChangesTreeView.GetMetaChange(changedForMoved);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChangeMeta,
                changedForMovedMeta,
                mProgressControls,
                null, null);
        }
コード例 #12
0
        void IPendingChangesMenuOperations.Diff()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChange,
                mPendingChanges.GetChangedForMoved(selectedChange),
                null,
                null,
                null);
        }
コード例 #13
0
        void IPendingChangesMenuOperations.ApplyLocalChanges()
        {
            List <ChangeInfo> selectedChanges = PendingChangesSelection
                                                .GetSelectedChanges(mPendingChangesTreeView);

            if (selectedChanges.Count == 0)
            {
                return;
            }

            ApplyLocalChangesOperation operation = new ApplyLocalChangesOperation(
                mWkInfo, mPlasticClient, mPlasticClient,
                mProgressControls, mDeveloperNewIncomingChangesUpdater);

            operation.ApplyLocalChanges(
                selectedChanges,
                PendingChangesSelection.GetAllChanges(mPendingChangesTreeView));
        }
コード例 #14
0
        void IFilesFilterPatternsMenuOperations.AddFilesFilterPatterns(
            FilterTypes type, FilterActions action, FilterOperationType operation)
        {
            List <string> selectedPaths = PendingChangesSelection.GetSelectedPaths(
                mPendingChangesTreeView);

            string[] rules = FilterRulesGenerator.GenerateRules(
                selectedPaths, mWkInfo.ClientPath, action, operation);

            bool isApplicableToAllWorkspaces = !mIsGluonMode;
            bool isAddOperation = operation == FilterOperationType.Add;

            FilterRulesConfirmationData filterRulesConfirmationData =
                FilterRulesConfirmationDialog.AskForConfirmation(
                    rules, isAddOperation, isApplicableToAllWorkspaces, mParentWindow);

            AddFilesFilterPatternsOperation.Run(
                mWkInfo, mPlasticClient, type, operation, filterRulesConfirmationData);
        }
コード例 #15
0
        internal static List<string> GetSelectedMetaPaths(
            PendingChangesTreeView treeView)
        {
            List<ChangeInfo> selectedChanges = PendingChangesSelection
                .GetSelectedChanges(treeView);

            List<string> result = new List<string>();

            foreach (ChangeInfo change in selectedChanges)
            {
                string path = change.GetFullPath();

                if (!MetaPath.IsMetaPath(path))
                    continue;

                result.Add(path);
            }

            return result;
        }
コード例 #16
0
        void IPendingChangesMenuOperations.Diff()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(
                    mWkInfo,
                    mIsGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromDiffWorkspaceContent,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromDiffWorkspaceContent,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromDiffWorkspaceContent))
            {
                return;
            }

            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChange,
                mPendingChanges.GetChangedForMoved(selectedChange),
                null,
                null,
                null);
        }
コード例 #17
0
        void PendingChangesViewMenu.IMetaMenuOperations.DiffMeta()
        {
            if (LaunchTool.ShowDownloadPlasticExeWindow(mIsGluonMode))
            {
                return;
            }

            ChangeInfo selectedChange = PendingChangesSelection
                                        .GetSelectedChange(mPendingChangesTreeView);
            ChangeInfo selectedChangeMeta = mPendingChangesTreeView.GetMetaChange(
                selectedChange);

            ChangeInfo changedForMoved     = mPendingChanges.GetChangedForMoved(selectedChange);
            ChangeInfo changedForMovedMeta = (changedForMoved == null) ?
                                             null : mPendingChangesTreeView.GetMetaChange(changedForMoved);

            DiffOperation.DiffWorkspaceContent(
                mWkInfo,
                selectedChangeMeta,
                changedForMovedMeta,
                mProgressControls,
                null, null);
        }
コード例 #18
0
        void FillPendingChanges(INewChangesInWk newChangesInWk)
        {
            if (mIsRefreshing)
            {
                return;
            }

            mIsRefreshing = true;

            List <ChangeInfo> changesToSelect =
                PendingChangesSelection.GetChangesToFocus(mPendingChangesTreeView);

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

            IDictionary <MountPoint, IList <PendingMergeLink> > mergeLinks = null;

            IThreadWaiter waiter = ThreadWaiter.GetWaiter();

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                FilterManager.Get().Reload();

                WorkspaceStatusOptions options = WorkspaceStatusOptions.None;
                options |= WorkspaceStatusOptions.FindAdded;
                options |= WorkspaceStatusOptions.FindDeleted;
                options |= WorkspaceStatusOptions.FindMoved;
                options |= WorkspaceStatusOptions.SplitModifiedMoved;
                options |= PendingChangesOptions.GetWorkspaceStatusOptions();

                if (newChangesInWk != null)
                {
                    newChangesInWk.Detected();
                }

                mPendingChanges.Calculate(
                    options, PendingChangesOptions.GetMovedMatchingOptions());

                mergeLinks = PlasticGui.Plastic.API.GetPendingMergeLinks(mWkInfo);
            },
                /*afterOperationDelegate*/ delegate
            {
                mPendingMergeLinks = mergeLinks;

                try
                {
                    if (waiter.Exception != null)
                    {
                        ExceptionsHandler.DisplayException(waiter.Exception);
                        return;
                    }

                    UpdateChangesTree();

                    UpdateMergeLinksList();

                    PendingChangesSelection.SelectChanges(
                        mPendingChangesTreeView, changesToSelect);
                }
                finally
                {
                    ((IProgressControls)mProgressControls).HideProgress();

                    //UpdateIsCommentWarningNeeded(CommentText);

                    UpdateNotificationPanel();

                    mIsRefreshing = false;
                }
            });
        }
コード例 #19
0
 SelectedChangesGroupInfo IPendingChangesMenuOperations.GetSelectedChangesGroupInfo()
 {
     return(PendingChangesSelection.GetSelectedChangesGroupInfo(
                mPendingChangesTreeView));
 }