private void AddNewEntry(HistoryEntry he, HistoryList hl) { if (he.IsJournalEventInEventFilter(SQLiteDBClass.GetSettingString(DbFilterSave, "All"))) { AddNewJournalRow(true, he); } }
private void AddNewEntry(HistoryEntry he, HistoryList hl) // add if in event filter, and not in field filter.. { bool add = he.IsJournalEventInEventFilter(SQLiteDBClass.GetSettingString(DbFilterSave, "All")); if (!add) { ftotalevents++; UpdateToolTipsForFilter(); } if (add && !FilterHelpers.FilterHistory(he, fieldfilter, discoveryform.Globals)) { add = false; ftotalfilters++; UpdateToolTipsForFilter(); } if (add) { AddNewJournalRow(true, he); var filter = (TravelHistoryFilter)comboBoxJournalWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; if (filter.MaximumNumberOfItems != null) { for (int r = dataGridViewJournal.Rows.Count - 1; r >= dataGridViewJournal.Rows.Count; r--) { dataGridViewJournal.Rows.RemoveAt(r); } } if (filter.MaximumDataAge != null) { for (int r = dataGridViewJournal.Rows.Count - 1; r > 0; r--) { var rhe = dataGridViewJournal.Rows[r].Tag as HistoryEntry; if (rhe != null && rhe.AgeOfEntry() > filter.MaximumDataAge) { dataGridViewJournal.Rows.RemoveAt(r); } else { break; } } } if (checkBoxMoveToTop.Checked && dataGridViewJournal.DisplayedRowCount(false) > 0) // Move focus to new row { dataGridViewJournal.ClearSelection(); int rowno = dataGridViewJournal.Rows.GetFirstRow(DataGridViewElementStates.Visible); if (rowno != -1) { dataGridViewJournal.CurrentCell = dataGridViewJournal.Rows[rowno].Cells[1]; // its the current cell which needs to be set, moves the row marker as well } FireChangeSelection(); } } }
private void AddNewEntry(HistoryEntry he, HistoryList hl) // add if in event filter, and not in field filter.. { if (todotimer.Enabled) { todo.Enqueue(() => AddNewEntry(he, hl)); return; } bool add = he.IsJournalEventInEventFilter(GetSetting(dbFilter, "All")); if (!add) { ftotalevents++; UpdateToolTipsForFilter(); } if (add && !FilterHelpers.FilterHistory(he, fieldfilter, discoveryform.Globals)) { add = false; ftotalfilters++; UpdateToolTipsForFilter(); } if (add) { var row = CreateHistoryRow(he, textBoxFilter.Text); // we might be filtered out by search if (row != null) { dataGridViewJournal.Rows.Insert(0, row); } else { add = false; } } if (add) // its been added, we have at least 1 row visible, at row 0 { var filter = (TravelHistoryFilter)comboBoxJournalWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; if (filter.MaximumNumberOfItems != null) // this one won't remove the latest one { for (int r = dataGridViewJournal.Rows.Count - 1; r >= filter.MaximumNumberOfItems; r--) { dataGridViewJournal.Rows.RemoveAt(r); } } if (checkBoxCursorToTop.Checked) // Move focus to first row { dataGridViewJournal.ClearSelection(); dataGridViewJournal.SetCurrentAndSelectAllCellsOnRow(0); // its the current cell which needs to be set, moves the row marker as well FireChangeSelection(); } } }
private void AddNewEntry(HistoryEntry he, HistoryList hl) // add if in event filter, and not in field filter.. { if (he.IsJournalEventInEventFilter(SQLiteDBClass.GetSettingString(DbFilterSave, "All")) && HistoryList.FilterHistory(he, fieldfilter, discoveryform.Globals)) { AddNewJournalRow(true, he); if (EDDiscoveryForm.EDDConfig.FocusOnNewSystem) // Move focus to new row { SelectTopRow(); } } }
private void AddEntry(HistoryEntry he) { bool add = he.IsJournalEventInEventFilter(GetSetting(dbFilter, "All")); if (!add) { ftotalevents++; UpdateToolTipsForFilter(); } if (add && !HistoryFilterHelpers.FilterHistory(he, fieldfilter, discoveryform.Globals)) { add = false; ftotalfilters++; UpdateToolTipsForFilter(); } if (add) { var sst = new BaseUtils.StringSearchTerms(textBoxSearch.Text, searchterms); var row = CreateHistoryRow(he, sst); // we might be filtered out by search if (row != null) { dataGridViewJournal.Rows.Insert(0, row); } else { add = false; } } if (add) // its been added, we have at least 1 row visible, at row 0 { var filter = (TravelHistoryFilter)comboBoxTime.SelectedItem ?? TravelHistoryFilter.NoFilter; if (filter.MaximumNumberOfItems != null) // this one won't remove the latest one { for (int r = dataGridViewJournal.Rows.Count - 1; r >= filter.MaximumNumberOfItems; r--) { dataGridViewJournal.Rows.RemoveAt(r); } } if (checkBoxCursorToTop.Checked) // Move focus to first row { dataGridViewJournal.ClearSelection(); dataGridViewJournal.SetCurrentAndSelectAllCellsOnRow(0); // its the current cell which needs to be set, moves the row marker as well FireChangeSelection(); } } }
private void AddNewEntry(HistoryEntry he, HistoryList hl) // add if in event filter, and not in field filter.. { if (he.IsJournalEventInEventFilter(SQLiteDBClass.GetSettingString(DbFilterSave, "All")) && FilterHelpers.FilterHistory(he, fieldfilter, discoveryform.Globals)) { AddNewJournalRow(true, he); if (checkBoxMoveToTop.Checked && dataGridViewJournal.DisplayedRowCount(false) > 0) // Move focus to new row { dataGridViewJournal.ClearSelection(); dataGridViewJournal.CurrentCell = dataGridViewJournal.Rows[0].Cells[1]; // its the current cell which needs to be set, moves the row marker as well FireChangeSelection(); } } }
public bool WouldAddEntry(HistoryEntry he) // do we filter? if its not in the journal event filter, or it is in the field filter { return(he.IsJournalEventInEventFilter(SQLiteDBClass.GetSettingString(DbFilterSave, "All")) && FilterHelpers.FilterHistory(he, fieldfilter, discoveryform.Globals)); }
// add if in event filter, and not in field filter.. private void AddNewEntry(HistoryEntry he, HistoryList hl) { if (he.IsJournalEventInEventFilter(SQLiteDBClass.GetSettingString(DbFilterSave, "All")) && fieldfilter.FilterHistory(he) ) { AddNewJournalRow(true, he); } }
private void AddNewEntry(HistoryEntry he, HistoryList hl) // add if in event filter, and not in field filter.. { if (!loadcomplete) { todo.Enqueue(() => AddNewEntry(he, hl)); return; } bool add = he.IsJournalEventInEventFilter(EliteDangerousCore.DB.UserDatabase.Instance.GetSettingString(DbFilterSave, "All")); if (!add) { ftotalevents++; UpdateToolTipsForFilter(); } if (add && !FilterHelpers.FilterHistory(he, fieldfilter, discoveryform.Globals)) { add = false; ftotalfilters++; UpdateToolTipsForFilter(); } if (add) { var row = CreateHistoryRow(he, textBoxFilter.Text); if (row != null) { dataGridViewJournal.Rows.Insert(0, row); } var filter = (TravelHistoryFilter)comboBoxJournalWindow.SelectedItem ?? TravelHistoryFilter.NoFilter; if (filter.MaximumNumberOfItems != null) { for (int r = dataGridViewJournal.Rows.Count - 1; r >= dataGridViewJournal.Rows.Count; r--) { dataGridViewJournal.Rows.RemoveAt(r); } } if (filter.MaximumDataAge != null) { for (int r = dataGridViewJournal.Rows.Count - 1; r > 0; r--) { var rhe = dataGridViewJournal.Rows[r].Tag as HistoryEntry; if (rhe != null && rhe.AgeOfEntry() > filter.MaximumDataAge) { dataGridViewJournal.Rows.RemoveAt(r); } else { break; } } } if (checkBoxCursorToTop.Checked && dataGridViewJournal.DisplayedRowCount(false) > 0) // Move focus to new row { dataGridViewJournal.ClearSelection(); int rowno = dataGridViewJournal.Rows.GetFirstRow(DataGridViewElementStates.Visible); if (rowno != -1) { dataGridViewJournal.SetCurrentAndSelectAllCellsOnRow(rowno); // its the current cell which needs to be set, moves the row marker as well } FireChangeSelection(); } } }
// do we filter? if its not in the journal event filter, or it is in the field filter public bool WouldAddEntry(HistoryEntry he) { return he.IsJournalEventInEventFilter(SQLiteDBClass.GetSettingString(DbFilterSave, "All")) && fieldfilter.FilterHistory(he); }
public bool WouldAddEntry(HistoryEntry he) { return(he.IsJournalEventInEventFilter(SQLiteDBClass.GetSettingString(DbFilterSave, "All"))); }