Exemplo n.º 1
0
        private void OnDefaultsFileSaveFormatChanged(object o, EventArgs args)
        {
            int active = fileSaveFormat.ActiveSelection;
            ConfigFileSaveFormatOption activeOption = (ConfigFileSaveFormatOption)Enum.ToObject(typeof(ConfigFileSaveFormatOption), active);

            if (((int)activeOption) > ((int)ConfigFileSaveFormatOption.Specific))     //Positions higher than specific are always specific too
            {
                activeOption = ConfigFileSaveFormatOption.Specific;
            }

            Base.Config.FileSaveFormatOption = activeOption;
            /* If format is specific, formatOption=Specific and format holds the format name */
            if (activeOption == ConfigFileSaveFormatOption.Specific)
            {
                SubtitleType chosenFormat = fileSaveFormat.ChosenSubtitleType;
                if (!chosenFormat.Equals(SubtitleType.Unknown))
                {
                    Base.Config.FileSaveFormatFixed = chosenFormat;
                }
            }
            else
            {
                /* If format option is keep existing or remember last, use keep existing */
                Base.Config.FileSaveFormat = ConfigFileSaveFormat.KeepExisting;
            }
        }
Exemplo n.º 2
0
        private SubtitleFormatComboBox BuildFileSaveFormatComboBox()
        {
            string[]     additionalActions = { Catalog.GetString("Keep the format used on file open"), Catalog.GetString("Remember the last used format") };
            SubtitleType fixedFormat       = SubtitleType.Unknown;
            ConfigFileSaveFormatOption fileSaveFormatOption = Base.Config.FileSaveFormatOption;

            if (fileSaveFormatOption == ConfigFileSaveFormatOption.Specific)
            {
                fixedFormat = Base.Config.FileSaveFormatFixed;
            }

            SubtitleFormatComboBox comboBox = new SubtitleFormatComboBox(fixedFormat, additionalActions);

            if (fileSaveFormatOption != ConfigFileSaveFormatOption.Specific)
            {
                comboBox.ActiveSelection = (int)fileSaveFormatOption;
            }
            comboBox.SelectionChanged += OnDefaultsFileSaveFormatChanged;
            return(comboBox);
        }