public bool Init() { List <EDCommander> commanders = EDCommander.GetListCommanders(); comboBoxCommanders.DisplayMember = "Name"; comboBoxCommanders.ValueMember = "Nr"; comboBoxCommanders.DataSource = commanders; EDDiscovery.EDDTheme theme = EDDiscovery.EDDTheme.Instance; theme.ApplyToFormStandardFontSize(this); return(true); }
public void UpdateCommandersListBox() { int selrow = dataGridViewCommanders.SelectedRows.Count > 0 ? dataGridViewCommanders.SelectedRows[0].Index : -1; dataGridViewCommanders.DataSource = null; List <EDCommander> cmdrs = EDCommander.GetListCommanders(); dataGridViewCommanders.DataSource = cmdrs; if (selrow >= 0 && selrow < dataGridViewCommanders.RowCount) { dataGridViewCommanders.Rows[selrow].Selected = true; } dataGridViewCommanders.Update(); }
public void ReadJournals(HistoryEntry currenthe) { dataGridViewCommanders.AutoGenerateColumns = false; // BEFORE assigned to list.. dataGridViewCommanders.DataSource = EDCommander.GetListCommanders(); if (currenthe != null) { DLLManager.Refresh(EDCommander.Current.Name, EDDDLLCallerHE.CreateFromHistoryEntry(currenthe)); if (currenthe.Commander.SyncToInara) { EliteDangerousCore.Inara.InaraSync.Refresh(LogLine, currenthe, currenthe.Commander); } } }
public override void InitialDisplay() { checkBoxOrderRowsInverted.Checked = EDDiscoveryForm.EDDConfig.OrderRowsInverted; checkBoxMinimizeToNotifyIcon.Checked = EDDiscoveryForm.EDDConfig.MinimizeToNotifyIcon; checkBoxKeepOnTop.Checked = EDDiscoveryForm.EDDConfig.KeepOnTop; checkBoxUseNotifyIcon.Checked = EDDiscoveryForm.EDDConfig.UseNotifyIcon; checkBoxUTC.Checked = EDDiscoveryForm.EDDConfig.DisplayUTC; checkBoxAutoLoad.Checked = EDDiscoveryForm.EDDConfig.AutoLoadPopOuts; checkBoxAutoSave.Checked = EDDiscoveryForm.EDDConfig.AutoSavePopOuts; checkBoxShowUIEvents.Checked = EDDiscoveryForm.EDDConfig.ShowUIEvents; checkBoxMinimizeToNotifyIcon.Enabled = EDDiscoveryForm.EDDConfig.UseNotifyIcon; textBoxHomeSystem.Text = EDDConfig.Instance.HomeSystem.Name; textBoxDefaultZoom.ValueNoChange = EDDConfig.Instance.MapZoom; bool selectionCentre = EDDConfig.Instance.MapCentreOnSelection; radioButtonHistorySelection.Checked = selectionCentre; radioButtonCentreHome.Checked = !selectionCentre; dataGridViewCommanders.AutoGenerateColumns = false; // BEFORE assigned to list.. dataGridViewCommanders.DataSource = EDCommander.GetListCommanders(); panel_defaultmapcolor.BackColor = Color.FromArgb(EDDConfig.Instance.DefaultMapColour); this.comboBoxTheme.SelectedIndexChanged += this.comboBoxTheme_SelectedIndexChanged; // now turn on the handler.. checkBoxCustomRemoveOriginals.Checked = discoveryform.screenshotconverter.RemoveOriginal; checkBoxCustomMarkHiRes.Checked = discoveryform.screenshotconverter.MarkHiRes; checkBoxCustomEnableScreenshots.Checked = discoveryform.screenshotconverter.AutoConvert; checkBoxCustomCopyToClipboard.Checked = discoveryform.screenshotconverter.CopyToClipboard; this.checkBoxCustomRemoveOriginals.CheckedChanged += new System.EventHandler(this.checkBoxCustomRemoveOriginals_CheckedChanged); this.checkBoxCustomMarkHiRes.CheckedChanged += new System.EventHandler(this.checkBoxCustomMarkHiRes_CheckedChanged); this.checkBoxCustomEnableScreenshots.CheckedChanged += new System.EventHandler(this.checkBoxCustomEnableScreenshots_CheckedChanged); this.checkBoxCustomCopyToClipboard.CheckedChanged += new System.EventHandler(this.checkBoxCustomCopyToClipboard_CheckedChanged); checkBoxCustomEDSMEDDBDownload.Checked = EDDConfig.Instance.EDSMEDDBDownload; this.checkBoxCustomEDSMEDDBDownload.CheckedChanged += new System.EventHandler(this.checkBoxCustomEDSMDownload_CheckedChanged); comboBoxCustomHistoryLoadTime.Items = new string[] { "Disabled-Load All", ">7 days old", ">30 days old", ">60 days old", ">90 days old", ">180 days old", "> 365 days old" }; comboBoxCustomHistoryLoadTime.Tag = new int[] { 0, 7, 30, 60, 90, 180, 365 }; int ix = Array.FindIndex(comboBoxCustomHistoryLoadTime.Tag as int[], x => x == EDDConfig.Instance.FullHistoryLoadDayLimit); comboBoxCustomHistoryLoadTime.SelectedIndex = ix >= 0 ? ix : 0; comboBoxCustomHistoryLoadTime.SelectedIndexChanged += ComboBoxCustomHistoryLoadTime_SelectedIndexChanged; }
public bool Init() { List <EDCommander> commanders = EDCommander.GetListCommanders(); comboBoxCommanders.DisplayMember = "Name"; comboBoxCommanders.ValueMember = "Nr"; comboBoxCommanders.DataSource = commanders; BaseUtils.Translator.Instance.Translate(this); EDDiscovery.EDDTheme theme = EDDiscovery.EDDTheme.Instance; theme.ApplyDialog(this); return(true); }
public bool Init() { List <EDCommander> commanders = EDCommander.GetListCommanders(); comboBoxCommanders.DisplayMember = "Name"; comboBoxCommanders.ValueMember = "Nr"; comboBoxCommanders.DataSource = commanders; var enumlist = new Enum[] { EDTx.MoveToCommander, EDTx.MoveToCommander_buttonTransfer, EDTx.MoveToCommander_label1 }; BaseUtils.Translator.Instance.TranslateControls(this, enumlist); var theme = ExtendedControls.Theme.Current; theme.ApplyDialog(this); return(true); }
public override void InitialDisplay() { checkBoxEDSMLog.Checked = EDDiscoveryForm.EDDConfig.EDSMLog; checkBoxOrderRowsInverted.Checked = EDDiscoveryForm.EDDConfig.OrderRowsInverted; checkBoxMinimizeToNotifyIcon.Checked = EDDiscoveryForm.EDDConfig.MinimizeToNotifyIcon; checkBoxKeepOnTop.Checked = EDDiscoveryForm.EDDConfig.KeepOnTop; checkBoxUseNotifyIcon.Checked = EDDiscoveryForm.EDDConfig.UseNotifyIcon; checkBoxUTC.Checked = EDDiscoveryForm.EDDConfig.DisplayUTC; checkBoxAutoLoad.Checked = EDDiscoveryForm.EDDConfig.AutoLoadPopOuts; checkBoxAutoSave.Checked = EDDiscoveryForm.EDDConfig.AutoSavePopOuts; checkBoxShowUIEvents.Checked = EDDiscoveryForm.EDDConfig.ShowUIEvents; checkBoxMinimizeToNotifyIcon.Enabled = EDDiscoveryForm.EDDConfig.UseNotifyIcon; textBoxHomeSystem.Text = EDDConfig.Instance.HomeSystem.Name; textBoxDefaultZoom.ValueNoChange = EDDConfig.Instance.MapZoom; bool selectionCentre = EDDConfig.Instance.MapCentreOnSelection; radioButtonHistorySelection.Checked = selectionCentre; radioButtonCentreHome.Checked = !selectionCentre; dataGridViewCommanders.AutoGenerateColumns = false; // BEFORE assigned to list.. dataGridViewCommanders.DataSource = EDCommander.GetListCommanders(); panel_defaultmapcolor.BackColor = Color.FromArgb(EDDConfig.Instance.DefaultMapColour); this.comboBoxTheme.SelectedIndexChanged += this.comboBoxTheme_SelectedIndexChanged; // now turn on the handler.. checkBoxCustomRemoveOriginals.Checked = discoveryform.screenshotconverter.RemoveOriginal; checkBoxCustomMarkHiRes.Checked = discoveryform.screenshotconverter.MarkHiRes; checkBoxCustomEnableScreenshots.Checked = discoveryform.screenshotconverter.AutoConvert; checkBoxCustomCopyToClipboard.Checked = discoveryform.screenshotconverter.CopyToClipboard; this.checkBoxCustomRemoveOriginals.CheckedChanged += new System.EventHandler(this.checkBoxCustomRemoveOriginals_CheckedChanged); this.checkBoxCustomMarkHiRes.CheckedChanged += new System.EventHandler(this.checkBoxCustomMarkHiRes_CheckedChanged); this.checkBoxCustomEnableScreenshots.CheckedChanged += new System.EventHandler(this.checkBoxCustomEnableScreenshots_CheckedChanged); this.checkBoxCustomCopyToClipboard.CheckedChanged += new System.EventHandler(this.checkBoxCustomCopyToClipboard_CheckedChanged); checkBoxCustomEDSMEDDBDownload.Checked = EDDConfig.Instance.EDSMEDDBDownload; this.checkBoxCustomEDSMEDDBDownload.CheckedChanged += new System.EventHandler(this.checkBoxCustomEDSMDownload_CheckedChanged); }
public override void Init() { extComboBoxGameTime.Items.Add("Local"); extComboBoxGameTime.Items.Add("UTC"); extComboBoxGameTime.Items.Add("Game Time"); BaseUtils.Translator.Instance.Translate(this); BaseUtils.Translator.Instance.Translate(toolTip, this); ResetThemeList(); SetEntryThemeComboBox(); btnDeleteCommander.Enabled = EDCommander.NumberOfCommanders > 1; comboBoxClickThruKey.Items = KeyObjectExtensions.KeyListString(inclshifts: true); comboBoxClickThruKey.SelectedItem = EDDConfig.Instance.ClickThruKey.VKeyToString(); comboBoxClickThruKey.SelectedIndexChanged += comboBoxClickThruKey_SelectedIndexChanged; comboBoxCustomLanguage.Items.AddRange(BaseUtils.Translator.EnumerateLanguageNames(EDDOptions.Instance.TranslatorFolders())); comboBoxCustomLanguage.Items.Add("Auto"); comboBoxCustomLanguage.Items.Add("Default (English)"); if (comboBoxCustomLanguage.Items.Contains(EDDConfig.Instance.Language)) { comboBoxCustomLanguage.SelectedItem = EDDConfig.Instance.Language; } else { comboBoxCustomLanguage.SelectedIndex = comboBoxCustomLanguage.Items.Count - 1; } comboBoxCustomLanguage.SelectedIndexChanged += ComboBoxCustomLanguage_SelectedIndexChanged; discoveryform.OnRefreshCommanders += DiscoveryForm_OnRefreshCommanders; checkBoxOrderRowsInverted.Checked = EDDiscoveryForm.EDDConfig.OrderRowsInverted; checkBoxMinimizeToNotifyIcon.Checked = EDDiscoveryForm.EDDConfig.MinimizeToNotifyIcon; checkBoxKeepOnTop.Checked = EDDiscoveryForm.EDDConfig.KeepOnTop; checkBoxPanelSortOrder.Checked = EDDConfig.Instance.SortPanelsByName; checkBoxUseNotifyIcon.Checked = EDDiscoveryForm.EDDConfig.UseNotifyIcon; checkBoxCustomResize.Checked = EDDiscoveryForm.EDDConfig.DrawDuringResize; extComboBoxGameTime.SelectedIndex = EDDiscoveryForm.EDDConfig.DisplayTimeIndex; checkBoxOrderRowsInverted.CheckedChanged += checkBoxOrderRowsInverted_CheckedChanged; checkBoxMinimizeToNotifyIcon.CheckedChanged += checkBoxMinimizeToNotifyIcon_CheckedChanged; checkBoxKeepOnTop.CheckedChanged += checkBoxKeepOnTop_CheckedChanged; checkBoxPanelSortOrder.CheckedChanged += checkBoxPanelSortOrder_CheckedChanged; checkBoxUseNotifyIcon.CheckedChanged += checkBoxUseNotifyIcon_CheckedChanged; extComboBoxGameTime.SelectedIndexChanged += ExtComboBoxGameTime_SelectedIndexChanged; checkBoxCustomResize.CheckedChanged += checkBoxCustomResize_CheckedChanged; checkBoxMinimizeToNotifyIcon.Enabled = EDDiscoveryForm.EDDConfig.UseNotifyIcon; dataGridViewCommanders.AutoGenerateColumns = false; // BEFORE assigned to list.. dataGridViewCommanders.DataSource = EDCommander.GetListCommanders(); this.comboBoxTheme.SelectedIndexChanged += this.comboBoxTheme_SelectedIndexChanged; // now turn on the handler.. checkBoxCustomRemoveOriginals.Checked = discoveryform.screenshotconverter.RemoveOriginal; checkBoxCustomMarkHiRes.Checked = discoveryform.screenshotconverter.MarkHiRes; checkBoxCustomEnableScreenshots.Checked = discoveryform.screenshotconverter.AutoConvert; checkBoxCustomCopyToClipboard.Checked = discoveryform.screenshotconverter.CopyToClipboard; this.checkBoxCustomRemoveOriginals.CheckedChanged += new System.EventHandler(this.checkBoxCustomRemoveOriginals_CheckedChanged); this.checkBoxCustomMarkHiRes.CheckedChanged += new System.EventHandler(this.checkBoxCustomMarkHiRes_CheckedChanged); this.checkBoxCustomEnableScreenshots.CheckedChanged += new System.EventHandler(this.checkBoxCustomEnableScreenshots_CheckedChanged); this.checkBoxCustomCopyToClipboard.CheckedChanged += new System.EventHandler(this.checkBoxCustomCopyToClipboard_CheckedChanged); checkBoxCustomEDSMEDDBDownload.Checked = EDDConfig.Instance.EDSMEDDBDownload; this.checkBoxCustomEDSMEDDBDownload.CheckedChanged += new System.EventHandler(this.checkBoxCustomEDSMDownload_CheckedChanged); comboBoxCustomHistoryLoadTime.Items = new string[] { "Disabled-Load All".T(EDTx.UserControlSettings_DLA), ">7 days old".T(EDTx.UserControlSettings_7daysold), ">30 days old".T(EDTx.UserControlSettings_30daysold), ">60 days old".T(EDTx.UserControlSettings_60daysold), ">90 days old".T(EDTx.UserControlSettings_90daysold), ">180 days old".T(EDTx.UserControlSettings_180daysold), ">270 days old".T(EDTx.UserControlSettings_270daysold), "> 365 days old".T(EDTx.UserControlSettings_365daysold) }; comboBoxCustomHistoryLoadTime.Tag = new int[] { 0, 7, 30, 60, 90, 180, 270, 365 }; int ix = Array.FindIndex(comboBoxCustomHistoryLoadTime.Tag as int[], x => x == EDDConfig.Instance.FullHistoryLoadDayLimit); comboBoxCustomHistoryLoadTime.SelectedIndex = ix >= 0 ? ix : 0; comboBoxCustomHistoryLoadTime.SelectedIndexChanged += ComboBoxCustomHistoryLoadTime_SelectedIndexChanged; var eetn = new string[] { nameof(JournalEssentialEvents.EssentialEvents), nameof(JournalEssentialEvents.FullStatsEssentialEvents), nameof(JournalEssentialEvents.JumpScanEssentialEvents), nameof(JournalEssentialEvents.JumpEssentialEvents), nameof(JournalEssentialEvents.NoEssentialEvents) }; comboBoxCustomEssentialEntries.Items = new string[] { "Scans,Cargo,Missions,State,Jumps etc".T(EDTx.UserControlSettings_ESM), "All entries for Statistics".T(EDTx.UserControlSettings_FS), "Jumps and Scans".T(EDTx.UserControlSettings_EJS), "Jumps".T(EDTx.UserControlSettings_EJ), "Nothing".T(EDTx.UserControlSettings_EN) }; comboBoxCustomEssentialEntries.Tag = eetn; ix = Array.FindIndex(eetn, x => x == EDDConfig.Instance.EssentialEventTypes); comboBoxCustomEssentialEntries.SelectedIndex = ix >= 0 ? ix : 0; comboBoxCustomEssentialEntries.SelectedIndexChanged += ComboBoxCustomEssentialEntries_SelectedIndexChanged; extCheckBoxWebServerEnable.Checked = false; extButtonTestWeb.Enabled = numberBoxLongPortNo.Enabled = false; numberBoxLongPortNo.Value = EDDConfig.Instance.WebServerPort; tm.Tick += PeriodicCheck; tm.Interval = 1000; tm.Start(); extCheckBoxWebServerEnable.CheckedChanged += ExtCheckBoxWebServerEnable_CheckedChanged; }
public override void Init() { ResetThemeList(); SetEntryThemeComboBox(); textBoxHomeSystem.SetAutoCompletor(SystemClassDB.ReturnSystemListForAutoComplete); btnDeleteCommander.Enabled = EDCommander.NumberOfCommanders > 1; comboBoxClickThruKey.Items = KeyObjectExtensions.KeyListString(inclshifts: true); comboBoxClickThruKey.SelectedItem = EDDConfig.Instance.ClickThruKey.VKeyToString(); comboBoxClickThruKey.SelectedIndexChanged += comboBoxClickThruKey_SelectedIndexChanged; comboBoxCustomLanguage.Items.AddRange(BaseUtils.Translator.EnumerateLanguageNames(EDDOptions.Instance.TranslatorFolders())); comboBoxCustomLanguage.Items.Add("Auto"); comboBoxCustomLanguage.Items.Add("Default (English)"); if (comboBoxCustomLanguage.Items.Contains(EDDConfig.Instance.Language)) { comboBoxCustomLanguage.SelectedItem = EDDConfig.Instance.Language; } else { comboBoxCustomLanguage.SelectedIndex = comboBoxCustomLanguage.Items.Count - 1; } comboBoxCustomLanguage.SelectedIndexChanged += ComboBoxCustomLanguage_SelectedIndexChanged; discoveryform.OnRefreshCommanders += DiscoveryForm_OnRefreshCommanders; checkBoxOrderRowsInverted.Checked = EDDiscoveryForm.EDDConfig.OrderRowsInverted; checkBoxMinimizeToNotifyIcon.Checked = EDDiscoveryForm.EDDConfig.MinimizeToNotifyIcon; checkBoxKeepOnTop.Checked = EDDiscoveryForm.EDDConfig.KeepOnTop; checkBoxPanelSortOrder.Checked = EDDConfig.Instance.SortPanelsByName; checkBoxUseNotifyIcon.Checked = EDDiscoveryForm.EDDConfig.UseNotifyIcon; checkBoxUTC.Checked = EDDiscoveryForm.EDDConfig.DisplayUTC; checkBoxShowUIEvents.Checked = EDDiscoveryForm.EDDConfig.ShowUIEvents; checkBoxCustomResize.Checked = EDDiscoveryForm.EDDConfig.DrawDuringResize; checkBoxOrderRowsInverted.CheckedChanged += checkBoxOrderRowsInverted_CheckedChanged; checkBoxMinimizeToNotifyIcon.CheckedChanged += checkBoxMinimizeToNotifyIcon_CheckedChanged; checkBoxKeepOnTop.CheckedChanged += checkBoxKeepOnTop_CheckedChanged; checkBoxPanelSortOrder.CheckedChanged += checkBoxPanelSortOrder_CheckedChanged; checkBoxUseNotifyIcon.CheckedChanged += checkBoxUseNotifyIcon_CheckedChanged; checkBoxUTC.CheckedChanged += checkBoxUTC_CheckedChanged; checkBoxShowUIEvents.CheckedChanged += checkBoxShowUIEvents_CheckedChanged; checkBoxCustomResize.CheckedChanged += checkBoxCustomResize_CheckedChanged; checkBoxMinimizeToNotifyIcon.Enabled = EDDiscoveryForm.EDDConfig.UseNotifyIcon; textBoxHomeSystem.Text = EDDConfig.Instance.HomeSystem.Name; textBoxDefaultZoom.ValueNoChange = EDDConfig.Instance.MapZoom; textBoxDefaultZoom.ValueChanged += textBoxDefaultZoom_ValueChanged; bool selectionCentre = EDDConfig.Instance.MapCentreOnSelection; radioButtonHistorySelection.Checked = selectionCentre; radioButtonCentreHome.Checked = !selectionCentre; radioButtonCentreHome.CheckedChanged += radioButtonCentreHome_CheckedChanged; dataGridViewCommanders.AutoGenerateColumns = false; // BEFORE assigned to list.. dataGridViewCommanders.DataSource = EDCommander.GetListCommanders(); panel_defaultmapcolor.BackColor = Color.FromArgb(EDDConfig.Instance.DefaultMapColour); this.comboBoxTheme.SelectedIndexChanged += this.comboBoxTheme_SelectedIndexChanged; // now turn on the handler.. checkBoxCustomRemoveOriginals.Checked = discoveryform.screenshotconverter.RemoveOriginal; checkBoxCustomMarkHiRes.Checked = discoveryform.screenshotconverter.MarkHiRes; checkBoxCustomEnableScreenshots.Checked = discoveryform.screenshotconverter.AutoConvert; checkBoxCustomCopyToClipboard.Checked = discoveryform.screenshotconverter.CopyToClipboard; this.checkBoxCustomRemoveOriginals.CheckedChanged += new System.EventHandler(this.checkBoxCustomRemoveOriginals_CheckedChanged); this.checkBoxCustomMarkHiRes.CheckedChanged += new System.EventHandler(this.checkBoxCustomMarkHiRes_CheckedChanged); this.checkBoxCustomEnableScreenshots.CheckedChanged += new System.EventHandler(this.checkBoxCustomEnableScreenshots_CheckedChanged); this.checkBoxCustomCopyToClipboard.CheckedChanged += new System.EventHandler(this.checkBoxCustomCopyToClipboard_CheckedChanged); checkBoxCustomEDSMEDDBDownload.Checked = EDDConfig.Instance.EDSMEDDBDownload; this.checkBoxCustomEDSMEDDBDownload.CheckedChanged += new System.EventHandler(this.checkBoxCustomEDSMDownload_CheckedChanged); comboBoxCustomHistoryLoadTime.Items = new string[] { "Disabled-Load All".Tx(this, "DLA"), ">7 days old".Tx(this), ">30 days old".Tx(this), ">60 days old".Tx(this), ">90 days old".Tx(this), ">180 days old".Tx(this), ">270 days old".Tx(this), "> 365 days old".Tx(this) }; comboBoxCustomHistoryLoadTime.Tag = new int[] { 0, 7, 30, 60, 90, 180, 270, 365 }; int ix = Array.FindIndex(comboBoxCustomHistoryLoadTime.Tag as int[], x => x == EDDConfig.Instance.FullHistoryLoadDayLimit); comboBoxCustomHistoryLoadTime.SelectedIndex = ix >= 0 ? ix : 0; comboBoxCustomHistoryLoadTime.SelectedIndexChanged += ComboBoxCustomHistoryLoadTime_SelectedIndexChanged; var eetn = new string[] { nameof(JournalEntry.EssentialEvents), nameof(JournalEntry.FullStatsEssentialEvents), nameof(JournalEntry.JumpScanEssentialEvents), nameof(JournalEntry.JumpEssentialEvents), nameof(JournalEntry.NoEssentialEvents) }; comboBoxCustomEssentialEntries.Items = new string[] { "Scans,Cargo,Missions,State,Jumps etc".Tx(this, "ESM"), "All entries for Statistics".Tx(this, "FS"), "Jumps and Scans".Tx(this, "EJS"), "Jumps".Tx(this, "EJ"), "Nothing".Tx(this, "EN") }; comboBoxCustomEssentialEntries.Tag = eetn; ix = Array.FindIndex(eetn, x => x == EDDConfig.Instance.EssentialEventTypes); comboBoxCustomEssentialEntries.SelectedIndex = ix >= 0 ? ix : 0; comboBoxCustomEssentialEntries.SelectedIndexChanged += ComboBoxCustomEssentialEntries_SelectedIndexChanged; BaseUtils.Translator.Instance.Translate(this); BaseUtils.Translator.Instance.Translate(toolTip, this); }
public void UpdateCommandersListBox() { dataGridViewCommanders.DataSource = null; dataGridViewCommanders.DataSource = EDCommander.GetListCommanders(); dataGridViewCommanders.Update(); }
public override bool ExecuteAction(ActionProgramRun ap) { string res; if (ap.Functions.ExpandString(UserData, out res) != BaseUtils.Functions.ExpandResult.Failed) { StringParser sp = new StringParser(res); string prefix = "CMDR_"; string cmdname = sp.NextWord(); if (cmdname != null && cmdname.Equals("PREFIX", StringComparison.InvariantCultureIgnoreCase)) { prefix = sp.NextWord(); if (prefix == null) { ap.ReportError("Missing name after Prefix"); return(true); } cmdname = sp.NextWord(); } int cmdrid = EDCommander.CurrentCmdrID; if (cmdname != null && cmdname.Equals("CMDR", StringComparison.InvariantCultureIgnoreCase)) { string name = sp.NextQuotedWord() ?? "-----!"; EDCommander cmdr = EDCommander.GetCommander(name); if (cmdr != null) { cmdrid = cmdr.Id; } else { ap.ReportError("Commander not found"); } cmdname = sp.NextWord(); } EDDiscoveryForm discoveryform = (ap.ActionController as ActionController).DiscoveryForm; List <EDCommander> cmdrlist = EDCommander.GetListCommanders(); if (cmdname != null) { if (cmdname.Equals("LIST", StringComparison.InvariantCultureIgnoreCase)) { string wildcard = sp.NextQuotedWord() ?? "*"; int count = 1; foreach (var cmdr in cmdrlist) // only current commander ID considered { if (cmdr.Name.WildCardMatch(wildcard, true)) { DumpCMDR(ap, prefix + count++.ToStringInvariant() + "_", cmdr); } } ap[prefix + "MatchCount"] = (count - 1).ToStringInvariant(); ap[prefix + "TotalCount"] = cmdrlist.Count.ToStringInvariant(); } else if (cmdname.Equals("CHANGETO", StringComparison.InvariantCultureIgnoreCase)) { discoveryform.ChangeToCommander(cmdrid); // which will cause DIsplay to be called as some point } else { ap.ReportError("Unknown command"); } } else { ap.ReportError("Missing command"); } } else { ap.ReportError(res); } return(true); }
public override void Init() { extComboBoxGameTime.Items.Add("Local".T(EDTx.UserControlSettings_Local)); extComboBoxGameTime.Items.Add("UTC"); extComboBoxGameTime.Items.Add("Game Time".T(EDTx.UserControlSettings_GameTime)); ConfigureHelpButton(extButtonDrawnHelpTheme, "Theming"); ConfigureHelpButton(extButtonDrawnHelpScreenshots, "Screenshots"); ConfigureHelpButton(extButtonDrawnHelpTransparency, "Transparency"); ConfigureHelpButton(extButtonDrawnHelpWebServer, "Webserver"); ConfigureHelpButton(extButtonDrawnHelpSafeMode, "SafeMode"); ConfigureHelpButton(extButtonDrawnHelpMemory, "Memory"); ConfigureHelpButton(extButtonDrawnHelpEDSM, "EDSMSettings"); ConfigureHelpButton(extButtonDrawnHelpHistory, "HistoryDisplay"); ConfigureHelpButton(extButtonDrawnHelpDLL, "DLL"); ConfigureHelpButton(extButtonDrawnHelpWindowOptions, "WindowOptions"); ConfigureHelpButton(extButtonDrawnHelpCommanders, "Commanders"); var enumlist = new Enum[] { EDTx.UserControlSettings_groupBoxCommanders, EDTx.UserControlSettings_ColumnCommander, EDTx.UserControlSettings_EdsmName, EDTx.UserControlSettings_JournalDirCol, EDTx.UserControlSettings_NotesCol, EDTx.UserControlSettings_btnDeleteCommander, EDTx.UserControlSettings_buttonEditCommander, EDTx.UserControlSettings_buttonAddCommander, EDTx.UserControlSettings_groupBoxTheme, EDTx.UserControlSettings_button_edittheme, EDTx.UserControlSettings_buttonSaveTheme, EDTx.UserControlSettings_groupBoxCustomHistoryLoad, EDTx.UserControlSettings_checkBoxOrderRowsInverted, EDTx.UserControlSettings_labelTimeDisplay, EDTx.UserControlSettings_extGroupBoxWebServer, EDTx.UserControlSettings_labelPortNo, EDTx.UserControlSettings_extButtonTestWeb, EDTx.UserControlSettings_extCheckBoxWebServerEnable, EDTx.UserControlSettings_groupBoxInteraction, EDTx.UserControlSettings_labelTKey, EDTx.UserControlSettings_groupBoxMemory, EDTx.UserControlSettings_labelHistoryEssItems, EDTx.UserControlSettings_labelHistorySel, EDTx.UserControlSettings_groupBoxCustomScreenShots, EDTx.UserControlSettings_buttonExtScreenshot, EDTx.UserControlSettings_checkBoxCustomEnableScreenshots, EDTx.UserControlSettings_groupBoxCustomEDSM, EDTx.UserControlSettings_buttonExtEDSMConfigureArea, EDTx.UserControlSettings_checkBoxCustomEDSMDownload, EDTx.UserControlSettings_groupBoxPopOuts, EDTx.UserControlSettings_checkBoxPanelSortOrder, EDTx.UserControlSettings_checkBoxKeepOnTop, EDTx.UserControlSettings_checkBoxCustomResize, EDTx.UserControlSettings_checkBoxMinimizeToNotifyIcon, EDTx.UserControlSettings_checkBoxUseNotifyIcon, EDTx.UserControlSettings_extGroupBoxDLLPerms, EDTx.UserControlSettings_extButtonDLLConfigure, EDTx.UserControlSettings_extButtonDLLPerms, EDTx.UserControlSettings_groupBoxCustomLanguage, EDTx.UserControlSettings_groupBoxCustomSafeMode, EDTx.UserControlSettings_buttonExtSafeMode, EDTx.UserControlSettings_labelSafeMode }; var enumlisttt = new Enum[] { EDTx.UserControlSettings_btnDeleteCommander_ToolTip, EDTx.UserControlSettings_buttonEditCommander_ToolTip, EDTx.UserControlSettings_buttonAddCommander_ToolTip, EDTx.UserControlSettings_comboBoxTheme_ToolTip, EDTx.UserControlSettings_button_edittheme_ToolTip, EDTx.UserControlSettings_buttonSaveTheme_ToolTip, EDTx.UserControlSettings_checkBoxOrderRowsInverted_ToolTip, EDTx.UserControlSettings_comboBoxClickThruKey_ToolTip, EDTx.UserControlSettings_comboBoxCustomEssentialEntries_ToolTip, EDTx.UserControlSettings_comboBoxCustomHistoryLoadTime_ToolTip, EDTx.UserControlSettings_buttonExtScreenshot_ToolTip, EDTx.UserControlSettings_checkBoxCustomEnableScreenshots_ToolTip, EDTx.UserControlSettings_buttonExtEDSMConfigureArea_ToolTip, EDTx.UserControlSettings_checkBoxCustomEDSMDownload_ToolTip, EDTx.UserControlSettings_checkBoxPanelSortOrder_ToolTip, EDTx.UserControlSettings_checkBoxKeepOnTop_ToolTip, EDTx.UserControlSettings_checkBoxCustomResize_ToolTip, EDTx.UserControlSettings_checkBoxMinimizeToNotifyIcon_ToolTip, EDTx.UserControlSettings_checkBoxUseNotifyIcon_ToolTip, EDTx.UserControlSettings_buttonExtSafeMode_ToolTip }; BaseUtils.Translator.Instance.TranslateControls(this, enumlist); BaseUtils.Translator.Instance.TranslateTooltip(toolTip, enumlisttt, this); ResetThemeList(); btnDeleteCommander.Enabled = EDCommander.NumberOfCommanders > 1; comboBoxClickThruKey.Items = KeyObjectExtensions.KeyListString(inclshifts: true); comboBoxClickThruKey.SelectedItem = EDDConfig.Instance.ClickThruKey.VKeyToString(); comboBoxClickThruKey.SelectedIndexChanged += comboBoxClickThruKey_SelectedIndexChanged; comboBoxCustomLanguage.Items.AddRange(BaseUtils.Translator.EnumerateLanguageNames(EDDOptions.Instance.TranslatorFolders())); comboBoxCustomLanguage.Items.Add("Auto"); comboBoxCustomLanguage.Items.Add("Default (English)"); if (comboBoxCustomLanguage.Items.Contains(EDDConfig.Instance.Language)) { comboBoxCustomLanguage.SelectedItem = EDDConfig.Instance.Language; } else { comboBoxCustomLanguage.SelectedIndex = comboBoxCustomLanguage.Items.Count - 1; } comboBoxCustomLanguage.SelectedIndexChanged += ComboBoxCustomLanguage_SelectedIndexChanged; discoveryform.OnRefreshCommanders += DiscoveryForm_OnRefreshCommanders; checkBoxOrderRowsInverted.Checked = EDDConfig.Instance.OrderRowsInverted; checkBoxMinimizeToNotifyIcon.Checked = EDDConfig.Instance.MinimizeToNotifyIcon; checkBoxKeepOnTop.Checked = EDDConfig.Instance.KeepOnTop; checkBoxPanelSortOrder.Checked = EDDConfig.Instance.SortPanelsByName; checkBoxUseNotifyIcon.Checked = EDDConfig.Instance.UseNotifyIcon; checkBoxCustomResize.Checked = EDDConfig.Instance.DrawDuringResize; extComboBoxGameTime.SelectedIndex = EDDConfig.Instance.DisplayTimeIndex; checkBoxOrderRowsInverted.CheckedChanged += checkBoxOrderRowsInverted_CheckedChanged; checkBoxMinimizeToNotifyIcon.CheckedChanged += checkBoxMinimizeToNotifyIcon_CheckedChanged; checkBoxKeepOnTop.CheckedChanged += checkBoxKeepOnTop_CheckedChanged; checkBoxPanelSortOrder.CheckedChanged += checkBoxPanelSortOrder_CheckedChanged; checkBoxUseNotifyIcon.CheckedChanged += checkBoxUseNotifyIcon_CheckedChanged; extComboBoxGameTime.SelectedIndexChanged += ExtComboBoxGameTime_SelectedIndexChanged; checkBoxCustomResize.CheckedChanged += checkBoxCustomResize_CheckedChanged; checkBoxMinimizeToNotifyIcon.Enabled = EDDConfig.Instance.UseNotifyIcon; dataGridViewCommanders.AutoGenerateColumns = false; // BEFORE assigned to list.. dataGridViewCommanders.DataSource = EDCommander.GetListCommanders(); this.comboBoxTheme.SelectedIndexChanged += this.comboBoxTheme_SelectedIndexChanged; // now turn on the handler.. checkBoxCustomEnableScreenshots.Checked = discoveryform.ScreenshotConverter.AutoConvert; this.checkBoxCustomEnableScreenshots.CheckedChanged += new System.EventHandler(this.checkBoxCustomEnableScreenshots_CheckedChanged); checkBoxCustomEDSMDownload.Checked = EDDConfig.Instance.EDSMDownload; this.checkBoxCustomEDSMDownload.CheckedChanged += new System.EventHandler(this.checkBoxCustomEDSMDownload_CheckedChanged); comboBoxCustomHistoryLoadTime.Items = new string[] { "Disabled-Load All".T(EDTx.UserControlSettings_DLA), ">7 days old".T(EDTx.UserControlSettings_7daysold), ">30 days old".T(EDTx.UserControlSettings_30daysold), ">60 days old".T(EDTx.UserControlSettings_60daysold), ">90 days old".T(EDTx.UserControlSettings_90daysold), ">180 days old".T(EDTx.UserControlSettings_180daysold), ">270 days old".T(EDTx.UserControlSettings_270daysold), "> 365 days old".T(EDTx.UserControlSettings_365daysold) }; comboBoxCustomHistoryLoadTime.Tag = new int[] { 0, 7, 30, 60, 90, 180, 270, 365 }; int ix = Array.FindIndex(comboBoxCustomHistoryLoadTime.Tag as int[], x => x == EDDConfig.Instance.FullHistoryLoadDayLimit); comboBoxCustomHistoryLoadTime.SelectedIndex = ix >= 0 ? ix : 0; comboBoxCustomHistoryLoadTime.SelectedIndexChanged += ComboBoxCustomHistoryLoadTime_SelectedIndexChanged; var eetn = new string[] { nameof(JournalEssentialEvents.EssentialEvents), nameof(JournalEssentialEvents.FullStatsEssentialEvents), nameof(JournalEssentialEvents.JumpScanEssentialEvents), nameof(JournalEssentialEvents.JumpEssentialEvents), nameof(JournalEssentialEvents.NoEssentialEvents) }; comboBoxCustomEssentialEntries.Items = new string[] { "Scans,Cargo,Missions,State,Jumps etc".T(EDTx.UserControlSettings_ESM), "All entries for Statistics".T(EDTx.UserControlSettings_FS), "Jumps and Scans".T(EDTx.UserControlSettings_EJS), "Jumps".T(EDTx.UserControlSettings_EJ), "Nothing".T(EDTx.UserControlSettings_EN) }; comboBoxCustomEssentialEntries.Tag = eetn; ix = Array.FindIndex(eetn, x => x == EDDConfig.Instance.EssentialEventTypes); comboBoxCustomEssentialEntries.SelectedIndex = ix >= 0 ? ix : 0; comboBoxCustomEssentialEntries.SelectedIndexChanged += ComboBoxCustomEssentialEntries_SelectedIndexChanged; extCheckBoxWebServerEnable.Checked = false; extButtonTestWeb.Enabled = numberBoxLongPortNo.Enabled = false; numberBoxLongPortNo.Value = EDDConfig.Instance.WebServerPort; tm.Tick += PeriodicCheck; tm.Interval = 1000; tm.Start(); extCheckBoxWebServerEnable.CheckedChanged += ExtCheckBoxWebServerEnable_CheckedChanged; }