コード例 #1
0
        public void CheckForProjectFacilitator(StoryProjectData storyProjectData, TeamMemberData loggedOnMember)
        {
            if (CraftingInfo.ProjectFacilitatorMemberID == null)
            {
                // this means that we've opened a file which didn't have the proj fac listed
                // if there's only one PF, then just put that one in. If there are multiple,
                //  then ask which one to use
                if ((storyProjectData.TeamMembers.CountOfProjectFacilitator == 1) &&
                    (loggedOnMember.MemberType == TeamMemberData.UserTypes.eProjectFacilitator))
                {
                    CraftingInfo.ProjectFacilitatorMemberID = loggedOnMember.MemberGuid;
                    return;
                }

                // fall thru means either the logged in person isn't a PF or there are multiple,
                //  so, ask the user to tell which PF added this story
                var dlg = new MemberPicker(storyProjectData, TeamMemberData.UserTypes.eProjectFacilitator)
                {
                    Text = "Choose the Project Facilitator that entered this story"
                };
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                CraftingInfo.ProjectFacilitatorMemberID = dlg.SelectedMember.MemberGuid;
            }
        }
コード例 #2
0
        public MemberPicker(StoryProjectData theStoryProjectData, TeamMemberData.UserTypes eWantedType)
        {
            _theStoryProjectData = theStoryProjectData;
            _eWantedType         = eWantedType;

            InitializeComponent();

            InitializeListBox(eWantedType);
        }
コード例 #3
0
 public PanoramaView(StoryProjectData storyProject)
 {
     _storyProject = storyProject;
     InitializeComponent();
     richTextBoxPanoramaFrontMatter.Rtf = storyProject.PanoramaFrontMatter;
     _bInCtor = false;               // prevent the _TextChanged during ctor
     dataGridViewPanorama.Columns[CnColumnStoryName].DefaultCellStyle.Font        =
         dataGridViewPanorama.Columns[CnColumnStoryPurpose].DefaultCellStyle.Font = _fontForDev;
 }
コード例 #4
0
        public StoryFrontMatterForm(StoryEditor theSE, StoryProjectData theStoryProjectData, StoryData theCurrentStory)
        {
            _theSE = theSE;
            _theStoryProjectData = theStoryProjectData;
            _theCurrentStory     = theCurrentStory;

            InitializeComponent();

            InitToolboxTextTip(theCurrentStory.CraftingInfo.ProjectFacilitatorMemberID,
                               textBoxProjectFacilitator);

            InitToolboxTextTip(theCurrentStory.CraftingInfo.StoryCrafterMemberID,
                               textBoxStoryCrafter);

            textBoxStoryPurpose.Text  = theCurrentStory.CraftingInfo.StoryPurpose;
            textBoxResourcesUsed.Text = theCurrentStory.CraftingInfo.ResourcesUsed;

            InitToolboxTextTip(theCurrentStory.CraftingInfo.BackTranslatorMemberID,
                               textBoxUnsBackTranslator);

            if (theCurrentStory.CraftingInfo.Testors.Count > 0)
            {
                InitToolboxTextTip(theCurrentStory.CraftingInfo.Testors[0],
                                   textBoxUnsTest1);

                buttonBrowseUnsTest2.Enabled = true;
            }
            else
            {
                buttonBrowseUnsTest2.Enabled = false;
            }

            if (theCurrentStory.CraftingInfo.Testors.Count > 1)
            {
                InitToolboxTextTip(theCurrentStory.CraftingInfo.Testors[1],
                                   textBoxUnsTest2);

                buttonBrowseUnsTest3.Enabled = true;
            }
            else
            {
                buttonBrowseUnsTest3.Enabled = false;
            }

            if (theCurrentStory.CraftingInfo.Testors.Count > 2)
            {
                InitToolboxTextTip(theCurrentStory.CraftingInfo.Testors[2],
                                   textBoxUnsTest3);
            }

            Text = String.Format("Story Information for '{0}'", theCurrentStory.Name);
        }
コード例 #5
0
        public NewProjectWizard(StoryProjectData storyProjectData)
        {
            InitializeComponent();
            _storyProjectData = storyProjectData;

            if ((_storyProjectData.ProjSettings != null) &&
                _storyProjectData.ProjSettings.IsConfigured)
            {
                ProjSettings = _storyProjectData.ProjSettings;
                ProjectName  = ProjSettings.ProjectName;
                string strDummy;
                if (Program.GetHgRepoParameters(ProjectName, out strDummy, out strDummy, out strDummy))
                {
                    checkBoxUseInternetRepo.Checked = true;
                }
            }

            if (!checkBoxUseInternetRepo.Checked)
            {
                tabControl.TabPages.Remove(tabPageInternetRepository);
            }

            if ((_storyProjectData.ProjSettings == null) ||
                !_storyProjectData.ProjSettings.Vernacular.HasData)
            {
                tabControl.TabPages.Remove(tabPageLanguageVernacular);
            }
            else
            {
                checkBoxStoryLanguage.Checked = true;
            }

            if ((_storyProjectData.ProjSettings == null) ||
                !_storyProjectData.ProjSettings.NationalBT.HasData)
            {
                tabControl.TabPages.Remove(tabPageLanguageNationalBT);
            }
            else
            {
                checkBoxNationalBT.Checked = true;
            }

            if ((_storyProjectData.ProjSettings != null) &&
                !_storyProjectData.ProjSettings.InternationalBT.HasData)
            {
                checkBoxEnglishBT.Checked = false;
                tabControl.TabPages.Remove(tabPageLanguageEnglishBT);
            }
        }
コード例 #6
0
        public StageEditorForm(StoryProjectData storyProjectData, StoryData theCurrentStory)
        {
            InitializeComponent();
            _storyProjectData = storyProjectData;
            _theCurrentStory  = theCurrentStory;

            if (!storyProjectData.TeamMembers.HasOutsideEnglishBTer)
            {
                ColumnEnglishBackTranslator.Visible = false;
            }
            else
            {
                checkBoxOutsideEnglishBackTranslator.Checked = true;
            }

            if (!storyProjectData.TeamMembers.HasFirstPassMentor)
            {
                ColumnFirstPassMentor.Visible = false;
            }
            else
            {
                checkBoxFirstPassMentor.Checked = true;
            }

            if (storyProjectData.TeamMembers.HasIndependentConsultant)
            {
                ColumnConsultantInTraining.HeaderText = TeamMemberData.CstrIndependentConsultantDisplay;
                ColumnCoach.Visible = false;
                radioButtonIndependentConsultant.Checked = true;
            }
            else
            {
                radioButtonManageWithCoaching.Checked = true;
            }

            InitGrid();
        }
コード例 #7
0
        public void Show(AnchorsData theAnchors, StoryProjectData theStoryProject)
        {
            Show();
            Cursor curCursor = Cursor;

            Cursor = Cursors.WaitCursor;

            try
            {
#if DEBUG
                // Test the Sword names vs. the names used by Paratext
                foreach (string str in AnchorData.mapSwordToParatextBookCodes.Values)
                {
                    VerseRef verser = new VerseRef(str + " 1:1");
                }
                foreach (string str in AnchorData.mapSwordToParatextBookCodes.Keys)
                {
                    string     strAnchor  = str + " 1:1";
                    AnchorData anchorData = new AnchorData(strAnchor, strAnchor);
                    VerseRef   verser     = new VerseRef(anchorData.AnchorAsVerseRef);
                }
#endif

                List <string> lstRefs = new List <string>();
                foreach (AnchorData anAnchor in theAnchors)
                {
                    VerseRef verseRef = new VerseRef(anAnchor.AnchorAsVerseRef);
                    lstRefs.Add(verseRef.BBBCCCVVV());
                }

                visibleTerms.Clear();
                progressBarLoadingKeyTerms.Maximum = _biblicalTerms.Terms.Count;
                progressBarLoadingKeyTerms.Value   = 0;
                foreach (Term term in _biblicalTerms.Terms)
                {
                    foreach (Verse aVerseReference in term.References)
                    {
                        if (lstRefs.Contains(aVerseReference.VerseRef.BBBCCCVVV()))
                        {
                            visibleTerms.Add(term);
                            break;
                        }
                    }
                    progressBarLoadingKeyTerms.Value++;
                }

                // indicate that we've checked the key terms here.
                theAnchors.IsKeyTermChecked = true;

                if (visibleTerms.Count == 0)
                {
                    MessageBox.Show(Localizer.Str("There are no Biblical Terms in this verse(s)."));
                    return;
                }

                renderings        = TermRenderingsList.GetTermRenderings(_projSettings.ProjectFolder, MainLang.LangCode);
                termLocalizations = TermLocalizations.Localizations;

                ColumnTermLemma.DefaultCellStyle.Font       = new Font("Charis SIL", 12);
                ColumnStatus.DefaultCellStyle.Font          = new Font("Wingdings", 11);
                ColumnRenderings.DefaultCellStyle.Font      = MainLang.FontToUse;
                ColumnRenderings.DefaultCellStyle.ForeColor = MainLang.FontColor;

                termIndexRequested = -1;
                LoadTermsList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format(Properties.Resources.IDS_KeyTermsProblem,
                                              Environment.NewLine, ex.Message), Properties.Resources.IDS_Caption);
                return;
            }
            finally
            {
                Cursor = curCursor;
            }
        }
コード例 #8
0
        /// <summary>
        /// Build by project by reference array of verse text for this term
        /// </summary>
        internal void ReadVerseText(Term myTerm, StoryProjectData theSPD, ProgressBar progressBarLoadingKeyTerms)
        {
            mapReferenceToVerseTextList = new Dictionary <string, List <string> >();

            ArrayList vrefs = new ArrayList();

            foreach (var vref in myTerm.VerseRefs())
            {
                vrefs.Add(vref.BBBCCCVVVS());
            }

            // List<VerseRef> vrefs = new List<VerseRef>(myTerm.VerseRefs());

            // get the current stories only (not the obsolete ones)
            StoriesData theStories = theSPD[Properties.Resources.IDS_MainStoriesSet];

            progressBarLoadingKeyTerms.Maximum = theStories.Count;
            progressBarLoadingKeyTerms.Value   = 0;

            for (int nStoryNumber = 0; nStoryNumber < theStories.Count; nStoryNumber++)
            {
                StoryData aStory = theStories[nStoryNumber];
                for (int nVerseNumber = 0; nVerseNumber < aStory.Verses.Count; nVerseNumber++)
                {
                    VerseData aVerse = aStory.Verses[nVerseNumber];
                    for (int nAnchorNumber = 0; nAnchorNumber < aVerse.Anchors.Count; nAnchorNumber++)
                    {
                        AnchorData anAnchor    = aVerse.Anchors[nAnchorNumber];
                        VerseRef   theVerseRef = new VerseRef(anAnchor.AnchorAsVerseRef);
                        int        nIndex      = vrefs.BinarySearch(theVerseRef.BBBCCCVVVS());
                        if (nIndex < 0)
                        {
                            continue;
                        }

                        string strVerseReference = String.Format("Story: '{0}' line: {1} anchor: {2}",
                                                                 aStory.Name, nVerseNumber + 1, anAnchor.JumpTarget);

                        List <string> astrVerseText = new List <string>(projectVariablesList.Count);
                        if (theSPD.ProjSettings.Vernacular.HasData)
                        {
                            astrVerseText.Add(aVerse.VernacularText.ToString());
                        }
                        if (theSPD.ProjSettings.NationalBT.HasData)
                        {
                            astrVerseText.Add(aVerse.NationalBTText.ToString());
                        }
                        if (theSPD.ProjSettings.InternationalBT.HasData)
                        {
                            astrVerseText.Add(aVerse.InternationalBTText.ToString());
                        }

                        // keep track of this verse and it's reference
                        if (!mapReferenceToVerseTextList.ContainsKey(strVerseReference))
                        {
                            mapReferenceToVerseTextList.Add(strVerseReference, astrVerseText);
                        }

                        // we don't need to do any more anchors with this same line of the same story
                        //  so set the anchor # to the number of anchors so the next outer for loop
                        //  will think it's finished
                        nAnchorNumber = aVerse.Anchors.Count;
                        break;
                    }
                }
                progressBarLoadingKeyTerms.Value++;
            }
        }