Exemple #1
0
        void OnSelectionChanged()
        {
            List <RepObjectInfo> selectedChangesets = ChangesetsSelection.
                                                      GetSelectedRepObjectInfos(mChangesetsListView);

            if (selectedChangesets.Count != 1)
            {
                return;
            }

            mDiffPanel.UpdateInfo(
                MountPointWithPath.BuildWorkspaceRootMountPoint(
                    ChangesetsSelection.GetSelectedRepository(mChangesetsListView)),
                (ChangesetExtendedInfo)selectedChangesets[0]);
        }
Exemple #2
0
        void IChangesetMenuOperations.DiffSelectedChangesets()
        {
            List <RepObjectInfo> selectedChangesets = ChangesetsSelection.
                                                      GetSelectedRepObjectInfos(mChangesetsListView);

            if (selectedChangesets.Count < 2)
            {
                return;
            }

            LaunchDiffOperations.DiffSelectedChangesets(
                ChangesetsSelection.GetSelectedRepository(mChangesetsListView),
                (ChangesetExtendedInfo)selectedChangesets[0],
                (ChangesetExtendedInfo)selectedChangesets[1],
                mIsGluonMode);
        }
Exemple #3
0
        void FillChangesets(WorkspaceInfo wkInfo, string query)
        {
            if (mIsRefreshing)
            {
                return;
            }

            mIsRefreshing = true;

            List <RepObjectInfo> changesetsToSelect =
                ChangesetsSelection.GetSelectedRepObjectInfos(mChangesetsListView);

            int defaultRow = TableViewOperations.
                             GetFirstSelectedRow(mChangesetsListView);

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

            long            loadedChangesetId = -1;
            ViewQueryResult queryResult       = null;

            IThreadWaiter waiter = ThreadWaiter.GetWaiter();

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                queryResult = new ViewQueryResult(
                    PlasticGui.Plastic.API.FindQuery(wkInfo, query));

                loadedChangesetId = GetLoadedChangesetId(
                    wkInfo, mIsGluonMode);
            },
                /*afterOperationDelegate*/ delegate
            {
                try
                {
                    if (waiter.Exception != null)
                    {
                        ExceptionsHandler.DisplayException(waiter.Exception);
                        return;
                    }

                    int changesetsCount = GetChangesetsCount(queryResult);

                    mChangesetsLabelText = string.Format(
                        PlasticLocalization.GetString(PlasticLocalization.Name.ChangesetsCount),
                        changesetsCount);

                    UpdateChangesetsList(
                        mChangesetsListView,
                        queryResult,
                        loadedChangesetId);

                    if (changesetsCount == 0)
                    {
                        mDiffPanel.ClearInfo();
                        return;
                    }

                    ChangesetsSelection.SelectChangesets(
                        mChangesetsListView, changesetsToSelect, defaultRow);
                }
                finally
                {
                    ((IProgressControls)mProgressControls).HideProgress();
                    mIsRefreshing = false;
                }
            });
        }