Esempio n. 1
0
        internal static void SelectChangesets(
            ChangesetsListView listView,
            List <RepObjectInfo> csetsToSelect,
            int defaultRow)
        {
            if (csetsToSelect == null || csetsToSelect.Count == 0)
            {
                TableViewOperations.SelectFirstRow(listView);
                return;
            }

            listView.SelectRepObjectInfos(csetsToSelect);

            if (listView.HasSelection())
            {
                return;
            }

            TableViewOperations.SelectDefaultRow(listView, defaultRow);

            if (listView.HasSelection())
            {
                return;
            }

            TableViewOperations.SelectFirstRow(listView);
        }
Esempio n. 2
0
        internal static RepositorySpec GetSelectedRepository(
            ChangesetsListView listView)
        {
            List <RepositorySpec> selectedRepositories = listView.GetSelectedRepositories();

            if (selectedRepositories.Count == 0)
            {
                return(null);
            }

            return(selectedRepositories[0]);
        }
Esempio n. 3
0
        internal static ChangesetExtendedInfo GetSelectedChangeset(
            ChangesetsListView listView)
        {
            List <RepObjectInfo> selectedRepObjectsInfos = listView.GetSelectedRepObjectInfos();

            if (selectedRepObjectsInfos.Count == 0)
            {
                return(null);
            }

            return((ChangesetExtendedInfo)selectedRepObjectsInfos[0]);
        }
Esempio n. 4
0
        void DoActionsToolbar(
            IRefreshableView refreshableView,
            ProgressControlsForViews progressControls,
            SearchField searchField,
            ChangesetsListView changesetsListView,
            DateFilter dateFilter,
            string changesetsLabelText,
            float showChangesButtonWidth,
            bool wasChangesPanelVisible)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            if (!string.IsNullOrEmpty(changesetsLabelText))
            {
                GUILayout.Label(
                    changesetsLabelText,
                    UnityStyles.ChangesetsTab.HeaderLabel);
            }

            if (progressControls.IsOperationRunning())
            {
                DrawProgressForViews.ForIndeterminateProgress(
                    progressControls.ProgressData);
            }

            GUILayout.FlexibleSpace();

            mIsChangesPanelVisible =
                DoShowChangesButton(
                    showChangesButtonWidth,
                    wasChangesPanelVisible);

            GUILayout.Space(2);

            DrawSearchField.For(
                searchField,
                changesetsListView,
                UnityConstants.SEARCH_FIELD_WIDTH);

            DoDateFilter(
                refreshableView,
                dateFilter,
                progressControls.IsOperationRunning());

            DoRefreshButton(
                refreshableView,
                progressControls.IsOperationRunning());

            EditorGUILayout.EndHorizontal();
        }
Esempio n. 5
0
        static void UpdateChangesetsList(
            ChangesetsListView changesetsListView,
            ViewQueryResult queryResult,
            long loadedChangesetId)
        {
            changesetsListView.BuildModel(
                queryResult,
                loadedChangesetId);

            changesetsListView.Refilter();

            changesetsListView.Sort();

            changesetsListView.Reload();
        }
Esempio n. 6
0
        static void DoChangesetsArea(
            ChangesetsListView changesetsListView,
            bool isOperationRunning)
        {
            EditorGUILayout.BeginVertical();

            GUI.enabled = !isOperationRunning;

            Rect rect = GUILayoutUtility.GetRect(0, 100000, 0, 100000);

            changesetsListView.OnGUI(rect);

            GUI.enabled = true;

            EditorGUILayout.EndVertical();
        }
Esempio n. 7
0
        void BuildComponents(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            IViewSwitcher viewSwitcher,
            IHistoryViewLauncher historyViewLauncher,
            EditorWindow parentWindow)
        {
            mSearchField = new SearchField();
            mSearchField.downOrUpArrowKeyPressed += SearchField_OnDownOrUpArrowKeyPressed;

            DateFilter.Type dateFilterType =
                EnumPopupSetting <DateFilter.Type> .Load(
                    UnityConstants.CHANGESETS_DATE_FILTER_SETTING_NAME,
                    DateFilter.Type.LastMonth);

            mDateFilter = new DateFilter(dateFilterType);

            ChangesetsListHeaderState headerState =
                ChangesetsListHeaderState.GetDefault();

            TreeHeaderSettings.Load(headerState,
                                    UnityConstants.CHANGESETS_TABLE_SETTINGS_NAME,
                                    (int)ChangesetsListColumn.CreationDate, false);

            mChangesetsListView = new ChangesetsListView(
                headerState,
                ChangesetsListHeaderState.GetColumnNames(),
                new ChangesetsViewMenu(this, this, mIsGluonMode),
                sizeChangedAction: OnChangesetsListViewSizeChanged,
                selectionChangedAction: OnSelectionChanged,
                doubleClickAction: ((IChangesetMenuOperations)this).DiffChangeset);
            mChangesetsListView.Reload();

            mIsChangesPanelVisible = BoolSetting.Load(
                UnityConstants.CHANGESETS_SHOW_CHANGES_SETTING_NAME,
                true);

            mDiffPanel = new DiffPanel(
                wkInfo, workspaceWindow, viewSwitcher,
                historyViewLauncher, parentWindow, mIsGluonMode);
        }
Esempio n. 8
0
        void DoActionsToolbar(
            IRefreshableView refreshableView,
            ProgressControlsForViews progressControls,
            SearchField searchField,
            ChangesetsListView changesetsListView,
            DateFilter dateFilter)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            if (progressControls.IsOperationRunning())
            {
                DrawProgressForViews.ForIndeterminateProgress(
                    progressControls.ProgressData);
            }

            GUILayout.FlexibleSpace();

            GUILayout.Space(2);

            EditorGUILayout.EndHorizontal();
        }
Esempio n. 9
0
 internal static int GetSelectedChangesetsCount(
     ChangesetsListView listView)
 {
     return(listView.GetSelection().Count);
 }
Esempio n. 10
0
 internal static bool IsSingleSelection(
     ChangesetsListView listView)
 {
     return(GetSelectedChangesetsCount(listView) == 1);
 }
Esempio n. 11
0
 internal static List <RepObjectInfo> GetSelectedRepObjectInfos(
     ChangesetsListView listView)
 {
     return(listView.GetSelectedRepObjectInfos());
 }