Beispiel #1
0
        private void toolStripMenuItemMergeLinesWithSameTimeCodes_Click(object sender, EventArgs e)
        {
            if (!IsSubtitleLoaded)
            {
                DisplaySubtitleNotLoadedMessage();
                return;
            }

            ReloadFromSourceView();
            using (var form = new MergeTextWithSameTimeCodes())
            {
                form.Initialize(_subtitle);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    MakeHistoryForUndo(_language.BeforeMergeLinesWithSameText);
                    _subtitle.Paragraphs.Clear();
                    foreach (var p in form.MergedSubtitle.Paragraphs)
                        _subtitle.Paragraphs.Add(p);
                    ShowStatus(string.Format(_language.MergedShortLinesX, form.NumberOfMerges));
                    SaveSubtitleListviewIndices();
                    ShowSource();
                    SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
                    RestoreSubtitleListviewIndices();
                }
            }
        }
Beispiel #2
0
 private void toolStripMenuItemMergeLinesWithSameTimeCodes_Click(object sender, EventArgs e)
 {
     if (IsSubtitleLoaded)
     {
         ReloadFromSourceView();
         var form = new MergeTextWithSameTimeCodes();
         _formPositionsAndSizes.SetPositionAndSize(form);
         form.Initialize(_subtitle);
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             if (!string.IsNullOrEmpty(_language.BeforeMergeLinesWithSameText)) //TODO: Remove in SE 3.3.4
                 MakeHistoryForUndo(_language.BeforeMergeLinesWithSameText);
             else
                 MakeHistoryForUndo(_language.BeforeMergeShortLines);
             _subtitle.Paragraphs.Clear();
             foreach (Paragraph p in form.MergedSubtitle.Paragraphs)
                 _subtitle.Paragraphs.Add(p);
             ShowStatus(string.Format(_language.MergedShortLinesX, form.NumberOfMerges));
             SaveSubtitleListviewIndexes();
             ShowSource();
             SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
             RestoreSubtitleListviewIndexes();
         }
         _formPositionsAndSizes.SavePositionAndSize(form);
     }
     else
     {
         MessageBox.Show(_language.NoSubtitleLoaded, Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }