Ejemplo n.º 1
0
        void IAssetMenuOperations.Add()
        {
            List <string> selectedPaths = GetSelectedPaths.ForOperation(
                mAssetSelection,
                mAssetStatusCache,
                AssetMenuOperations.Add);

            if (mIsGluonMode)
            {
                GluonAddoperation.Add(
                    mViewHost,
                    mProgressControls,
                    mGuiMessage,
                    selectedPaths.ToArray(),
                    false,
                    RefreshAsset.VersionControlCache);
                return;
            }

            AddOperation.Run(
                mWorkspaceWindow,
                mProgressControls,
                null,
                null,
                selectedPaths,
                false,
                mNewIncomingChangesUpdater,
                RefreshAsset.VersionControlCache);
        }
Ejemplo n.º 2
0
        void IAssetMenuOperations.Undo()
        {
            List <string> selectedPaths = GetSelectedPaths.ForOperation(
                mAssetSelection,
                mAssetStatusCache,
                AssetMenuOperations.Undo);

            SaveAssets.ForPathsWithoutConfirmation(selectedPaths);

            if (mIsGluonMode)
            {
                GluonUndoCheckoutOperation.UndoCheckout(
                    mWkInfo,
                    mViewHost,
                    mProgressControls,
                    mGuiMessage,
                    selectedPaths.ToArray(),
                    false,
                    RefreshAsset.UnityAssetDatabase);
                return;
            }

            UndoCheckoutOperation.Run(
                mWorkspaceWindow,
                null,
                mProgressControls,
                selectedPaths,
                mNewIncomingChangesUpdater,
                RefreshAsset.UnityAssetDatabase);
        }
Ejemplo n.º 3
0
        void IAssetMenuOperations.Checkout()
        {
            List <string> selectedPaths = GetSelectedPaths.ForOperation(
                mAssetSelection.GetSelectedAssets(),
                mAssetStatusCache,
                AssetMenuOperations.Checkout);

            if (mIsGluonMode)
            {
                GluonCheckoutOperation.Checkout(
                    mViewHost,
                    mProgressControls,
                    mGuiMessage,
                    selectedPaths.ToArray(),
                    false,
                    RefreshAsset.VersionControlCache);
                return;
            }

            CheckoutOperation.Checkout(
                mWorkspaceWindow,
                null,
                mProgressControls,
                selectedPaths,
                mNewIncomingChangesUpdater,
                RefreshAsset.VersionControlCache);
        }
Ejemplo n.º 4
0
        static bool Provider_preCheckoutCallback(
            AssetList list,
            ref string changesetID,
            ref string changesetDescription)
        {
            if (!sIsEnabled)
            {
                return(true);
            }

            if (!FindWorkspace.HasWorkspace(Application.dataPath))
            {
                Disable();
                return(true);
            }

            if (sWorkspaceWindow == null)
            {
                EditorWindow.GetWindow <PlasticWindow>();
            }

            List <string> selectedPaths = GetSelectedPaths.ForOperation(
                list,
                PlasticPlugin.AssetStatusCache,
                AssetMenuOperations.Checkout);

            if (sIsGluonMode)
            {
                GluonCheckoutOperation.Checkout(
                    sViewHost,
                    sProgressControls,
                    sGuiMessage,
                    selectedPaths.ToArray(),
                    false,
                    RefreshAsset.VersionControlCache);

                return(true);
            }

            CheckoutOperation.Checkout(
                sWorkspaceWindow,
                null,
                sProgressControls,
                selectedPaths,
                sNewIncomingChangesUpdater,
                RefreshAsset.VersionControlCache);

            return(true);
        }
Ejemplo n.º 5
0
        void IAssetMenuOperations.Checkin()
        {
            List <string> selectedPaths = GetSelectedPaths.ForOperation(
                mAssetSelection,
                mAssetStatusCache,
                AssetMenuOperations.Checkin);

            if (!CheckinDialog.CheckinPaths(
                    mWkInfo,
                    selectedPaths,
                    mAssetStatusCache,
                    mIsGluonMode,
                    mParentWindow,
                    mWorkspaceWindow,
                    mViewHost,
                    mGuiMessage,
                    mMergeViewLauncher,
                    mGluonViewSwitcher))
            {
                return;
            }

            RefreshAsset.UnityAssetDatabase();
        }