internal static void SetControlLabel <T>(
            this VisualElement element,
            string name, PlasticLocalization.Name fieldName)  where T : VisualElement
        {
            dynamic control = element.Query <T>(name).First();

            control.label = PlasticLocalization.GetString(fieldName);
        }
        internal static void SetControlText <T>(
            this VisualElement element,
            string name, PlasticLocalization.Name fieldName,
            params string[] format) where T : VisualElement
        {
            dynamic control = element.Query <T>(name).First();
            string  str     = PlasticLocalization.GetString(fieldName);

            control.text = format.Length > 0 ? string.Format(str, format) : str;
        }
Beispiel #3
0
        void BuildCreateOrganizationSection(bool firstOrganization)
        {
            PlasticLocalization.Name createOrganizationLabelName = firstOrganization ?
                                                                   PlasticLocalization.Name.CreateFirstOrganizationLabel :
                                                                   PlasticLocalization.Name.CreateOtherOrganizationLabel;

            this.SetControlText <Label>("createOrganizationLabel",
                                        createOrganizationLabelName);

            this.SetControlText <Button>("createOrganizationButton",
                                         PlasticLocalization.Name.CreateButton);
        }
        Result CheckinUIOperation.ICheckinConflictsDialog.Show(
            IList <CheckinConflict> conflicts,
            PlasticLocalization.Name dialogTitle,
            PlasticLocalization.Name dialogExplanation,
            PlasticLocalization.Name okButtonCaption)
        {
            ResponseType responseType = CheckinConflictsDialog.Show(
                conflicts, dialogTitle, dialogExplanation,
                okButtonCaption, mWindow);

            return(responseType == ResponseType.Ok ?
                   Result.Ok : Result.Cancel);
        }
Beispiel #5
0
        void BuildCreateOrganizationSection(bool firstOrganization)
        {
            this.Query <VisualElement>("createOrganization").First().RemoveFromClassList("display-none");

            PlasticLocalization.Name createOrganizationLabelName = firstOrganization ?
                                                                   PlasticLocalization.Name.CreateFirstOrganizationLabel :
                                                                   PlasticLocalization.Name.CreateOtherOrganizationLabel;

            this.SetControlText <Label>("createOrganizationLabel",
                                        createOrganizationLabelName);

            this.SetControlText <Button>("createOrganizationButton",
                                         PlasticLocalization.Name.CreateButton);
        }
        internal static ResponseType Show(
            IList <CheckinConflict> conflicts,
            PlasticLocalization.Name dialogTitle,
            PlasticLocalization.Name dialogExplanation,
            PlasticLocalization.Name okButtonCaption,
            EditorWindow parentWindow)
        {
            CheckinConflictsDialog dialog = Create(
                PlasticLocalization.GetString(dialogTitle),
                PlasticLocalization.GetString(dialogExplanation),
                GetConflictsText(conflicts),
                PlasticLocalization.GetString(okButtonCaption));

            return(dialog.RunModal(parentWindow));
        }
        void DoExplanationArea(bool isGluonMode)
        {
            PlasticLocalization.Name currentMode = isGluonMode ?
                                                   PlasticLocalization.Name.GluonMode :
                                                   PlasticLocalization.Name.DeveloperMode;

            PlasticLocalization.Name selectedMode = isGluonMode ?
                                                    PlasticLocalization.Name.DeveloperMode :
                                                    PlasticLocalization.Name.GluonMode;

            string formattedExplanation = PlasticLocalization.GetString(
                PlasticLocalization.Name.SwitchModeConfirmationDialogExplanation,
                PlasticLocalization.GetString(currentMode),
                PlasticLocalization.GetString(selectedMode),
                "{0}");

            TextBlockWithEndLink(
                GLUON_HELP_URL, formattedExplanation, UnityStyles.Paragraph);
        }
Beispiel #8
0
        static void DrawChangesOverviewItem(
            Texture icon,
            PlasticLocalization.Name singularLabel,
            PlasticLocalization.Name pluralLabel,
            int count,
            long size,
            bool showSize)
        {
            if (count == 0)
            {
                return;
            }

            EditorGUILayout.BeginHorizontal();

            GUIContent iconContent = new GUIContent(icon);

            GUILayout.Label(iconContent, GUILayout.Width(20f), GUILayout.Height(20f));

            string label = PlasticLocalization.GetString(count > 1 ? pluralLabel : singularLabel);

            if (showSize)
            {
                label = string.Format(label, count, SizeConverter.ConvertToSizeString(size));
            }
            else
            {
                label = string.Format(label, count);
            }

            GUIContent content = new GUIContent(label);

            GUILayout.Label(content, UnityStyles.IncomingChangesTab.ChangesToApplySummaryLabel);

            GUILayout.Space(5);

            EditorGUILayout.EndHorizontal();
        }
 static string GetPlasticMenuItemName(PlasticLocalization.Name name)
 {
     return(string.Format("{0}/{1}",
                          PlasticLocalization.GetString(PlasticLocalization.Name.PrefixPlasticMenu),
                          PlasticLocalization.GetString(name)));
 }