private void buttonExtCoriolis_Click(object sender, EventArgs e) { ShipInformation si = null; if (comboBoxShips.Text.Contains("Travel") || comboBoxShips.Text.Length == 0) // second is due to the order History gets called vs this on start { if (last_he != null && last_he.ShipInformation != null) { si = last_he.ShipInformation; } } else { si = discoveryform.history.shipinformationlist.GetShipByNameIdentType(comboBoxShips.Text); } if (si != null) { string errstr; string s = si.ToJSONCoriolis(out errstr); if (errstr.Length > 0) { ExtendedControls.MessageBoxTheme.Show(FindForm(), errstr + Environment.NewLine + "This is probably a new or powerplay module" + Environment.NewLine + "Report to EDD Team by Github giving the full text above", "Unknown Module Type"); } string uri = Properties.Resources.URLCoriolis + "data=" + BaseUtils.HttpUriEncode.URIGZipBase64Escape(s) + "&bn=" + Uri.EscapeDataString(si.Name); if (!BaseUtils.BrowserInfo.LaunchBrowser(uri)) { ExtendedControls.InfoForm info = new ExtendedControls.InfoForm(); info.Info("Cannot launch browser, use this JSON for manual Coriolis import", Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetExecutingAssembly().Location), s, new int[] { 0, 100 }); info.ShowDialog(FindForm()); } } }
private void buttonExtCoriolis_Click(object sender, EventArgs e) { ShipInformation si = null; if (comboBoxShips.Text == travelhistorytext || comboBoxShips.Text.Length == 0) // second is due to the order History gets called vs this on start { if (last_he?.ShipInformation != null) { si = last_he.ShipInformation; } } else { si = discoveryform.history.ShipInformationList.GetShipByNameIdentType(comboBoxShips.Text); } if (si != null) { string errstr; string s = si.ToJSONCoriolis(out errstr); if (errstr.Length > 0) { ExtendedControls.MessageBoxTheme.Show(FindForm(), errstr + Environment.NewLine + "This is probably a new or powerplay module" + Environment.NewLine + "Report to EDD Team by Github giving the full text above", "Unknown Module Type"); } string uri = EDDConfig.Instance.CoriolisURL + "data=" + BaseUtils.HttpUriEncode.URIGZipBase64Escape(s) + "&bn=" + Uri.EscapeDataString(si.Name); if (!BaseUtils.BrowserInfo.LaunchBrowser(uri)) { ExtendedControls.InfoForm info = new ExtendedControls.InfoForm(); info.Info("Cannot launch browser, use this JSON for manual Coriolis import", FindForm().Icon, s); info.ShowDialog(FindForm()); } } }