private void ResetSettings(ContinuationStyle continuationStyle)
 {
     if (MessageBox.Show(this, LanguageSettings.Current.Settings.ResetCustomContinuationStyleWarning, LanguageSettings.Current.General.Warning, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         LoadSettings(ContinuationUtilities.GetContinuationProfile(continuationStyle));
     }
 }
Пример #2
0
        public void Initialize(Subtitle subtitle)
        {
            if (subtitle.Paragraphs.Count > 0)
            {
                subtitle.Renumber(subtitle.Paragraphs[0].Number);
            }

            Text = LanguageSettings.Current.SplitLongLines.Title;
            labelSingleLineMaxLength.Text      = LanguageSettings.Current.SplitLongLines.SingleLineMaximumLength;
            labelLineMaxLength.Text            = LanguageSettings.Current.SplitLongLines.LineMaximumLength;
            labelLineContinuationBeginEnd.Text = LanguageSettings.Current.SplitLongLines.LineContinuationBeginEndStrings;

            listViewFixes.Columns[0].Text = LanguageSettings.Current.General.Apply;
            listViewFixes.Columns[1].Text = LanguageSettings.Current.General.LineNumber;
            listViewFixes.Columns[2].Text = LanguageSettings.Current.General.Text;

            var continuationProfile = ContinuationUtilities.GetContinuationProfile(Configuration.Settings.General.ContinuationStyle);

            comboBoxLineContinuationBegin.Text = continuationProfile.Prefix;
            comboBoxLineContinuationEnd.Text   = continuationProfile.Suffix;

            toolStripMenuItemInverseSelection.Text = LanguageSettings.Current.Main.Menu.Edit.InverseSelection;
            toolStripMenuItemSelectAll.Text        = LanguageSettings.Current.Main.Menu.ContextMenu.SelectAll;
            buttonOK.Text     = LanguageSettings.Current.General.Ok;
            buttonCancel.Text = LanguageSettings.Current.General.Cancel;
            SubtitleListview1.InitializeLanguage(LanguageSettings.Current.General, Configuration.Settings);
            UiUtil.InitializeSubtitleFont(SubtitleListview1);
            SubtitleListview1.AutoSizeAllColumns(this);
            NumberOfSplits = 0;
            numericUpDownSingleLineMaxCharacters.Value = Configuration.Settings.General.SubtitleLineMaximumLength;
            _subtitle = subtitle;
        }
Пример #3
0
 private void SetContinuationProfile(ContinuationStyle continuationStyle)
 {
     _continuationProfile = ContinuationUtilities.GetContinuationProfile(continuationStyle);
 }
        public SettingsCustomContinuationStyle()
        {
            UiUtil.PreInitialize(this);
            InitializeComponent();
            UiUtil.FixFonts(this);

            var language = LanguageSettings.Current.Settings;
            var settings = Configuration.Settings.General;

            Text = language.CustomContinuationStyle;

            toolStripMenuItemLoadStyle.Text = language.LoadStyle;
            labelSuffix.Text = language.Suffix;
            checkBoxSuffixAddForComma.Text = language.AddSuffixForComma;
            checkBoxSuffixAddSpace.Text    = language.AddSpace;
            checkBoxSuffixRemoveComma.Text = language.RemoveComma;
            labelPrefix.Text               = language.Prefix;
            checkBoxPrefixAddSpace.Text    = language.AddSpace;
            checkBoxDifferentStyleGap.Text = language.DifferentStyleGap;
            labelMs.Text        = language.Milliseconds;
            labelGapSuffix.Text = language.Suffix;
            checkBoxGapSuffixAddForComma.Text = language.AddSuffixForComma;
            checkBoxGapSuffixAddSpace.Text    = language.AddSpace;
            checkBoxGapSuffixRemoveComma.Text = language.RemoveComma;
            labelGapPrefix.Text            = language.Prefix;
            checkBoxGapPrefixAddSpace.Text = language.AddSpace;
            groupBoxPreview.Text           = language.Preview;
            labelPreviewPause.Text         = language.PreviewPause;
            labelNote.Text = language.CustomContinuationStyleNote;

            comboBoxSuffix.Left            = labelSuffix.Left + labelSuffix.Width + 6;
            checkBoxSuffixAddForComma.Left = comboBoxSuffix.Left;
            checkBoxSuffixAddSpace.Left    = comboBoxSuffix.Left;
            checkBoxSuffixRemoveComma.Left = comboBoxSuffix.Left;

            comboBoxPrefix.Left         = labelPrefix.Left + labelPrefix.Width + 6;
            checkBoxPrefixAddSpace.Left = comboBoxPrefix.Left;

            numericUpDownDifferentStyleGapMs.Left = checkBoxDifferentStyleGap.Left + checkBoxDifferentStyleGap.Width + 6;
            labelMs.Left = numericUpDownDifferentStyleGapMs.Left + numericUpDownDifferentStyleGapMs.Width + 6;

            comboBoxGapSuffix.Left            = labelGapSuffix.Left + labelGapSuffix.Width + 6;
            checkBoxGapSuffixAddForComma.Left = comboBoxGapSuffix.Left;
            checkBoxGapSuffixAddSpace.Left    = comboBoxGapSuffix.Left;
            checkBoxGapSuffixRemoveComma.Left = comboBoxGapSuffix.Left;

            comboBoxGapPrefix.Left         = labelGapPrefix.Left + labelGapPrefix.Width + 6;
            checkBoxGapPrefixAddSpace.Left = comboBoxGapPrefix.Left;

            // Populate styles menu
            toolStripMenuItemLoadStyle.DropDownItems.Clear();
            foreach (var continuationStyle in ContinuationUtilities.ContinuationStyles)
            {
                if (continuationStyle != ContinuationStyle.Custom)
                {
                    toolStripMenuItemLoadStyle.DropDownItems.Add(new ToolStripMenuItem(UiUtil.GetContinuationStyleName(continuationStyle), null, (sender, args) =>
                    {
                        ResetSettings(continuationStyle);
                    }));
                }
            }

            // Load config
            LoadSettings(ContinuationUtilities.GetContinuationProfile(ContinuationStyle.Custom));

            numericUpDownDifferentStyleGapMs.Value = settings.ContinuationPause;

            buttonOK.Text     = LanguageSettings.Current.General.Ok;
            buttonCancel.Text = LanguageSettings.Current.General.Cancel;
            UiUtil.FixLargeFonts(this, buttonOK);
        }