|
LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
|
Pure C++ presenter that orchestrates main-window interactions independently of the underlying widget toolkit. More...
#include <MainWindowPresenter.hpp>


Public Member Functions | |
| MainWindowPresenter (IMainWindowView &view, mvc::IController &controller, db::EventsContainer &events, ui::ISearchResultsView &searchResults, ui::IEventsListView *eventsListView, ui::ITypeFilterView *typeFilterView, ui::IItemDetailsView *itemDetailsView) | |
| void | PerformSearch () |
| Runs the search pipeline using the current UI state. | |
| void | LoadLogFile (const std::filesystem::path &path) |
| Parses and loads a log file, updating shared UI state. | |
| void | LoadLogFile (std::unique_ptr< parser::IDataParser > parser, const std::filesystem::path &path) |
| Loads a log file using a pre-configured parser instance. | |
| void | MergeLogFile (std::unique_ptr< parser::IDataParser > parser, const std::filesystem::path &path, const std::string &existingAlias, const std::string &newFileAlias, const std::string ×tampField="timestamp") |
| Parses and merges a log file with existing data, sorted by timestamp. | |
| bool | IsParsing () const |
| Allows views to query whether parsing is active. | |
| void | UpdateTypeFilters () |
| Rebuilds the available type filters from current events. | |
| void | ApplySelectedTypeFilters () |
| Applies the selected type filters to the event list. | |
| void | SetItemDetailsVisible (bool visible) |
| Shows or hides the item details view. | |
| void | ProgressUpdated () override |
| Called when parsing progress is updated. | |
| void | NewEventFound (db::LogEvent &&event) override |
| Called when a new event is discovered during parsing. | |
| void | NewEventBatchFound (std::vector< std::pair< int, db::LogEvent::EventItems > > &&eventBatch) override |
| Called when a batch of new events is discovered during parsing. | |
Private Member Functions | |
| void | clearAllData () |
| void | RunParserAsync (std::unique_ptr< parser::IDataParser > parser, const std::filesystem::path &path, const std::string &previousStatus) |
Static Private Member Functions | |
| static int | ClampToInt (std::size_t value) |
Private Attributes | |
| IMainWindowView & | m_view |
| mvc::IController & | m_controller |
| db::EventsContainer & | m_events |
| ui::ISearchResultsView & | m_searchResultsView |
| ui::IEventsListView * | m_eventsListView {nullptr} |
| ui::ITypeFilterView * | m_typeFilterView {nullptr} |
| ui::IItemDetailsView * | m_itemDetailsView {nullptr} |
| bool | m_isParsing {false} |
| bool | m_progressConfigured {false} |
Pure C++ presenter that orchestrates main-window interactions independently of the underlying widget toolkit.
| ui::MainWindowPresenter::MainWindowPresenter | ( | IMainWindowView & | view, |
| mvc::IController & | controller, | ||
| db::EventsContainer & | events, | ||
| ui::ISearchResultsView & | searchResults, | ||
| ui::IEventsListView * | eventsListView, | ||
| ui::ITypeFilterView * | typeFilterView, | ||
| ui::IItemDetailsView * | itemDetailsView | ||
| ) |
| void ui::MainWindowPresenter::ApplySelectedTypeFilters | ( | ) |
Applies the selected type filters to the event list.


|
staticprivate |

|
private |


|
inline |
Allows views to query whether parsing is active.
| void ui::MainWindowPresenter::LoadLogFile | ( | const std::filesystem::path & | path | ) |
Parses and loads a log file, updating shared UI state.

| void ui::MainWindowPresenter::LoadLogFile | ( | std::unique_ptr< parser::IDataParser > | parser, |
| const std::filesystem::path & | path | ||
| ) |
Loads a log file using a pre-configured parser instance.
Use this overload when the caller needs to pass a parser with custom construction-time parameters (e.g. AscParser with a DBC path). The parser must not yet have any observers registered.

| void ui::MainWindowPresenter::MergeLogFile | ( | std::unique_ptr< parser::IDataParser > | parser, |
| const std::filesystem::path & | path, | ||
| const std::string & | existingAlias, | ||
| const std::string & | newFileAlias, | ||
| const std::string & | timestampField = "timestamp" |
||
| ) |
Parses and merges a log file with existing data, sorted by timestamp.
| parser | Parser for the file (built by the caller, like LoadLogFile, so .txt/.log/.asc/.evl and user-chosen types are honoured) |
| path | Path to the log file to merge |
| existingAlias | User-friendly name for existing log data |
| newFileAlias | User-friendly name for new log file |
| timestampField | Name of the field containing timestamps |

|
overridevirtual |
Called when a batch of new events is discovered during parsing.
For performance reasons, parsers may collect multiple events before notifying observers. This method delivers a batch of events at once.
| eventBatch | Vector of (id, items) pairs representing the events |
Implements parser::IDataParserObserver.

|
overridevirtual |
Called when a new event is discovered during parsing.
| event | The newly parsed LogEvent (moved to avoid copying) |
Implements parser::IDataParserObserver.
| void ui::MainWindowPresenter::PerformSearch | ( | ) |
Runs the search pipeline using the current UI state.

|
overridevirtual |
Called when parsing progress is updated.
This method is invoked periodically during parsing operations to allow observers to update progress indicators in the user interface.
Implements parser::IDataParserObserver.

|
private |


| void ui::MainWindowPresenter::SetItemDetailsVisible | ( | bool | visible | ) |
Shows or hides the item details view.

| void ui::MainWindowPresenter::UpdateTypeFilters | ( | ) |
Rebuilds the available type filters from current events.


|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |