Example #1
0
        private void expertSettingsBtn_Click(object sender, EventArgs e)
        {
            // First get the latest settings
            WriteSettings(_cjo, false); // Only temp

            ConversionTaskExpertSettingsForm expertSettings = new ConversionTaskExpertSettingsForm(_mceOptions.AllMonitorTasks, _cjo);
            expertSettings.ShowDialog();

            // Now read the new settings and update
            ReadSettings(ref _cjo);
        }
Example #2
0
        private void oKcmd_Click(object sender, EventArgs e)
        {
            //Not required, since it interfers with UNC paths with Username and Passwords, either way paths can be invalidated on the fly
            /*if (!System.IO.Directory.Exists(destinationPathTxt.Text))
            {
                MessageBox.Show("Path " + destinationPathTxt.Text + " is invalid", "Invalid Path", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }*/

            string taskName = taskNameTxt.Text.Trim();
            if (String.IsNullOrWhiteSpace(taskName))
            {
                MessageBox.Show(Localise.GetPhrase("Please supply a task name"), Localise.GetPhrase("No name supplied"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            destinationPathTxt.Text = destinationPathTxt.Text.Trim();
            if (String.IsNullOrWhiteSpace(destinationPathTxt.Text))
            {
                if (MessageBox.Show(Localise.GetPhrase("No destination directory provided, converted file will be placed in original video directory"), Localise.GetPhrase("No name supplied"), MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.Cancel)
                    return;
            }

            if (_newTask)
            {
                if ((_mceOptions.AllConversionTasks.FindIndex(item => item.taskName.ToLower() == taskName.ToLower()) >= 0) || (_mceOptions.AllMonitorTasks.FindIndex(item => item.taskName.ToLower() == taskName.ToLower()) >= 0))// Check if the name already exists (check both monitor and conversion task otherwise they might overright the same section in the INI file)
                {
                    MessageBox.Show(Localise.GetPhrase("A task name or section") + " " + taskNameTxt.Text + " " + Localise.GetPhrase("already exists\n\rPlease use another name"), Localise.GetPhrase("Duplicate Name"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            CheckNetDrive(true);

            // Quick validate the remaining settings with the ExpertForm
            ConversionTaskExpertSettingsForm expertSettings = new ConversionTaskExpertSettingsForm(_mceOptions.AllMonitorTasks, _cjo);
            expertSettings.WriteAndValidateSettings(); // Clean up expert settings to avoid conflicts

            // Now write the settings
            WriteSettings(_cjo, true);

            this.Close();
        }