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

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