private void launchgeniso(bool usb) { Form ask = null; if (usb) { var fs = new[] { "NTFS", "FAT32", "FAT16", "FAT12" }.AddRecommended(CurImages.Any(x => x.SizeB >= uint.MaxValue) ? 0 : 1); ask = new USBFrm(Strings.CreateMultibootUsb, Strings.Filesystem, Strings.OK, true, fs); } else { ask = new AskPath(); } if (ask.ShowDialog() == DialogResult.OK) { var fn = ""; fn = usb ? ((USBFrm)ask).SelectedUSB.Name.ToUpper().Substring(0, 3) : ((AskPath)ask).FileName; var g = new GenIsoFrm(fn, usb); g.GenerationFinished += delegate { g_GenerationFinished(g); }; g.Title = txtTitle.Text; if (usb) { g.filesystem = ((USBFrm)ask).TheComboBox.SelectedItem.ToString().RemoveRecommended(); } switch (cbxBackType.SelectedIndex) { case 0: g.IsoBackgroundImage = ""; break; case 1: g.IsoBackgroundImage = txtBackFile.Text; break; default: g.IsoBackgroundImage = "$$NONE$$"; break; } var bl = SelectedBootloader(); g.bloader = bl; Program.SupportAccent = bl.SupportAccent; g.Res = ((dynamic)cbxRes.SelectedItem).Val; g.Images = CurImages.Select( x => new ImageLine(x.Name.RemoveAccent(), x.FilePath, x.Description.RemoveAccent(), x.Category.RemoveAccent(), x.CustomCode, x.EntryType)).ToList(); g.CustomFiles = CustomFiles; g.ShowDialog(this); Program.ClrTmp(); Program.SupportAccent = false; } }
private void g_GenerationFinished(GenIsoFrm g) { Program.ClrTmp(); Thread.CurrentThread.CurrentCulture = new CultureInfo(Settings.Default.Lang); Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.Lang); if (g.filesystem == "NTFS" && g.bloader is Grub4DOS) { return; } if ( MessageBox.Show(this, Strings.IsoCreated.Replace(@"\n", "\n"), Strings.IsoCreatedTitle, MessageBoxButtons.YesNo) == DialogResult.Yes) { QEMUISO.LaunchQemu(g.OutputFilepath, g._usb); } }
private void launchgeniso(bool usb) { Form ask = null; if (usb) { var fs = new[] {"NTFS", "FAT32", "FAT16", "FAT12"}.AddRecommended(CurImages.Any(x => x.SizeB >= uint.MaxValue) ? 0 : 1); ask = new USBFrm(Strings.CreateMultibootUsb, Strings.Filesystem, Strings.OK, true, fs); } else ask = new AskPath(); if (ask.ShowDialog() == DialogResult.OK) { var fn = ""; fn = usb ? ((USBFrm) ask).SelectedUSB.Name.ToUpper().Substring(0, 3) : ((AskPath) ask).FileName; var g = new GenIsoFrm(fn, usb); g.GenerationFinished += delegate { g_GenerationFinished(g); }; g.Title = txtTitle.Text; if (usb) g.filesystem = ((USBFrm) ask).TheComboBox.SelectedItem.ToString().RemoveRecommended(); switch (cbxBackType.SelectedIndex) { case 0: g.IsoBackgroundImage = ""; break; case 1: g.IsoBackgroundImage = txtBackFile.Text; break; default: g.IsoBackgroundImage = "$$NONE$$"; break; } var bl = SelectedBootloader(); g.bloader = bl; Program.SupportAccent = bl.SupportAccent; g.Res = ((dynamic)cbxRes.SelectedItem).Val; g.Images = CurImages.Select( x => new ImageLine(x.Name.RemoveAccent(), x.FilePath, x.Description.RemoveAccent(), x.Category.RemoveAccent(), x.CustomCode, x.EntryType)).ToList(); g.CustomFiles = CustomFiles; g.ShowDialog(this); Program.ClrTmp(); Program.SupportAccent = false; } }
private void g_GenerationFinished(GenIsoFrm g) { Program.ClrTmp(); Thread.CurrentThread.CurrentCulture = new CultureInfo(Settings.Default.Lang); Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.Lang); if (g.filesystem == "NTFS" && g.bloader is Grub4DOS) return; if ( MessageBox.Show(this, Strings.IsoCreated.Replace(@"\n", "\n"), Strings.IsoCreatedTitle, MessageBoxButtons.YesNo) == DialogResult.Yes) { QEMUISO.LaunchQemu(g.OutputFilepath, g._usb); } }