private void saveButton_Click(object sender, System.EventArgs e) { if (this.saveFileDialog.ShowDialog() == DialogResult.OK) { string ext = Path.GetExtension(saveFileDialog.FileName).ToLower(System.Globalization.CultureInfo.InvariantCulture); if (Drives.ableToWriteOnThisDrive(Path.GetPathRoot(saveFileDialog.FileName))) { if (ext == ".qpf") { pgc.SaveQpfile(saveFileDialog.FileName); } else if (ext == ".xml") { pgc.SaveXml(saveFileDialog.FileName); } else { pgc.SaveText(saveFileDialog.FileName); } } else { MessageBox.Show("MeGUI cannot write on the disc " + Path.GetPathRoot(saveFileDialog.FileName) + "\n" + "Please, select another output path to save your project...", "Configuration Incomplete", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } if (this.closeOnQueue.Checked) { this.Close(); } }
private void saveButton_Click(object sender, System.EventArgs e) { if (String.IsNullOrEmpty(output.Text)) { MessageBox.Show("Please select the output file first", "Configuration Incomplete", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (!bFPSKnown && !rbTXT.Checked) { if (MessageBox.Show("The FPS value for the input file is unknown. Please make sure that the correct value is selected.\nCurrently " + fpsChooser.Value + " will be applied.\n\nDo you want to continue?", "FPS unknown", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } bFPSKnown = true; } if (!Directory.Exists(Path.GetDirectoryName(output.Text))) { btOutput_Click(null, null); if (!Directory.Exists(Path.GetDirectoryName(output.Text))) { return; } } if (FileUtil.IsDirWriteable(Path.GetDirectoryName(output.Text))) { pgc.FramesPerSecond = (double)fpsChooser.Value; if (rbQPF.Checked) { pgc.SaveQpfile(output.Text); } else if (rbXML.Checked) { pgc.SaveXml(output.Text); } else { pgc.SaveText(output.Text); } if (this.closeOnQueue.Checked) { this.Close(); } } else { MessageBox.Show("MeGUI cannot write to the path " + Path.GetDirectoryName(output.Text) + "\n" + "Please select another output path to save your file.", "Configuration Incomplete", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void saveButton_Click(object sender, System.EventArgs e) { if (String.IsNullOrEmpty(output.Text)) { btOutput_Click(null, null); if (String.IsNullOrEmpty(output.Text)) { MessageBox.Show("Please select the output file first", "Configuration Incomplete", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } if (!Directory.Exists(Path.GetDirectoryName(output.Text))) { btOutput_Click(null, null); if (!Directory.Exists(Path.GetDirectoryName(output.Text))) { return; } } if (rbQPF.Checked && fpsChooserIn.Value == null) { MessageBox.Show("The FPS value for the input file is unknown.\nPlease make sure that the correct value for the input is selected.", "FPS unknown", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (rbQPF.Checked && fpsChooserOut.Value == null) { MessageBox.Show("The FPS value for the output file is unknown.\nPlease make sure that the correct value for the output is selected.", "FPS unknown", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (!FileUtil.IsDirWriteable(Path.GetDirectoryName(output.Text))) { MessageBox.Show("MeGUI cannot write to the path " + Path.GetDirectoryName(output.Text) + "\n" + "Please select another output path to save your file.", "Configuration Incomplete", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (!pgc.HasChapters) { MessageBox.Show("Please add at least one chapter.", "Missing Chapter", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } ChapterInfo oChapterSave = new ChapterInfo(pgc); if (fpsChooserOut.Value != null) { oChapterSave.ChangeFps((double)fpsChooserOut.Value); } if (rbQPF.Checked) { oChapterSave.SaveQpfile(output.Text); } else if (rbXML.Checked) { oChapterSave.SaveXml(output.Text); } else { oChapterSave.SaveText(output.Text); } if (this.closeOnQueue.Checked) { this.Close(); } }