Exemplo n.º 1
0
        static void DoDateFilter(
            IRefreshableView refreshableView,
            DateFilter dateFilter,
            bool isOperationRunning)
        {
            GUI.enabled = !isOperationRunning;

            EditorGUI.BeginChangeCheck();

            dateFilter.FilterType = (DateFilter.Type)
                                    EditorGUILayout.EnumPopup(
                dateFilter.FilterType,
                EditorStyles.toolbarDropDown,
                GUILayout.Width(100));

            if (EditorGUI.EndChangeCheck())
            {
                EnumPopupSetting <DateFilter.Type> .Save(
                    dateFilter.FilterType,
                    UnityConstants.CHANGESETS_DATE_FILTER_SETTING_NAME);

                refreshableView.Refresh();
            }

            GUI.enabled = true;
        }
Exemplo n.º 2
0
        static string GetChangesetsQuery(DateFilter dateFilter)
        {
            if (dateFilter.FilterType == DateFilter.Type.AllTime)
            {
                return(QueryConstants.ChangesetsBeginningQuery);
            }

            string whereClause = QueryConstants.GetChangesetsDateWhereClause(
                dateFilter.GetFilterDate(DateTime.UtcNow));

            return(string.Format("{0} {1}",
                                 QueryConstants.ChangesetsBeginningQuery,
                                 whereClause));
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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();
        }