Exemplo n.º 1
0
        private void deleteConversionTaskCmd_Click(object sender, EventArgs e)
        {
            if (taskListLv.SelectedItems.Count > 0)
            {
                int enabledCount = 0;

                foreach (ListViewItem item in taskListLv.Items)
                {
                    if (_mceOptions.GetConversionTaskByName(item.SubItems[0].Text).enabled)
                    {
                        enabledCount++;
                    }
                }

                // Cannot disable/delete all conversion tasks, if we are deleting a disabled task no issues (disable click handler will handle not allowing all tasks to be disabled)
                if (enabledCount <= 1 && _mceOptions.GetConversionTaskByName(taskListLv.SelectedItems[0].SubItems[0].Text).enabled)
                {
                    MessageBox.Show(Localise.GetPhrase("Atleast one Conversion Task must be enabled"), Localise.GetPhrase("Delete Task"));
                    return;
                }

                if (MessageBox.Show(
                        Localise.GetPhrase("Are you sure you want to delete this task?"),
                        Localise.GetPhrase("Delete Task"),
                        MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    string selectedTaskName = taskListLv.SelectedItems[0].SubItems[0].Text;
                    _mceOptions.DeleteConversionTask(selectedTaskName, false);
                    ReadConversionTaskSettings();
                }
            }
        }
Exemplo n.º 2
0
        private bool _newTask = false; // Are we creating a new task

        public ConversionTaskForm(MCEBuddyConf mceOptions, string taskName)
        {
            InitializeComponent();

            maxWidthBar.Maximum = _resolutions.Length - 1;
            _advGrpSize         = advancedSettings.Size; // Store the value
            _mceOptions         = mceOptions;
            _cjo = _mceOptions.GetConversionTaskByName(taskName);

            // First get the new scale
            using (Graphics g = this.CreateGraphics())
            {
                float _scale = g.DpiX / 96; // Get the system DPI (font scaling)

                _advancedBoxCollapsedSize = (int)(_advancedBoxCollapsedSize * _scale);
            }
        }