LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
ui::qt::ScenariosPanel Class Reference

Scenario builder panel. More...

#include <ScenariosPanel.hpp>

Inheritance diagram for ui::qt::ScenariosPanel:
Inheritance graph
Collaboration diagram for ui::qt::ScenariosPanel:
Collaboration graph

Classes

struct  Scenario
 
struct  ScenarioEvent
 

Public Slots

void AddEventFromRow (int actualRow)
 

Public Member Functions

 ScenariosPanel (db::EventsContainer &events, EventsTableView *eventsView, QWidget *parent=nullptr)
 
nlohmann::json GetSessionData () const
 
void LoadSessionData (const nlohmann::json &data)
 

Private Slots

void OnNewScenario ()
 
void OnRenameScenario ()
 
void OnDeleteScenario ()
 
void OnScenarioChanged (int comboIndex)
 
void OnAddSelectedEvent ()
 
void OnRemoveEvent ()
 
void OnMoveUp ()
 
void OnMoveDown ()
 
void OnExport ()
 

Private Member Functions

void BuildLayout ()
 
void RebuildEventsTable ()
 
void UpdateScenarioCombo (int selectIndex=-1)
 
void UpdateButtonStates ()
 
int SelectedEventRow () const
 Returns the index of the selected row in m_eventsTable, or -1.
 
Scenario * ActiveScenario ()
 Returns a pointer to the active Scenario, or nullptr if none.
 
void FillEventStrings (ScenarioEvent &se) const
 Build event-item summary strings for actualRow (cached on add).
 
void SaveToSettings () const
 Persist m_scenarios to QSettings so they survive without a session file.
 
void LoadFromSettings ()
 Restore m_scenarios from QSettings (called once at construction).
 

Private Attributes

db::EventsContainer & m_events
 
EventsTableView * m_eventsView
 
QComboBox * m_scenarioCombo {nullptr}
 
QPushButton * m_newBtn {nullptr}
 
QPushButton * m_renameBtn {nullptr}
 
QPushButton * m_deleteBtn {nullptr}
 
QTableWidget * m_eventsTable {nullptr}
 
QPushButton * m_addBtn {nullptr}
 
QPushButton * m_removeBtn {nullptr}
 
QPushButton * m_upBtn {nullptr}
 
QPushButton * m_downBtn {nullptr}
 
QPushButton * m_exportBtn {nullptr}
 
QLabel * m_statusLabel {nullptr}
 
std::vector< Scenario > m_scenarios
 
int m_activeScenario {-1}
 

Detailed Description

Scenario builder panel.

A scenario is a named, ordered collection of log events assembled by the analyst. Events can be added from the Events table (via button or right-click context menu), reordered, and removed. The whole scenario can be exported as plain text, a Markdown table, or JSON Lines — with a field selector dialog to control which event items appear in the output.

Multiple independent scenarios are supported via the combo box selector. Scenarios persist in QSettings across sessions.

Constructor & Destructor Documentation

◆ ScenariosPanel()

ui::qt::ScenariosPanel::ScenariosPanel ( db::EventsContainer &  events,
EventsTableView *  eventsView,
QWidget *  parent = nullptr 
)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ ActiveScenario()

ScenariosPanel::Scenario * ui::qt::ScenariosPanel::ActiveScenario ( )
private

Returns a pointer to the active Scenario, or nullptr if none.

Here is the caller graph for this function:

◆ AddEventFromRow

void ui::qt::ScenariosPanel::AddEventFromRow ( int  actualRow)
slot

Add the event at actualRow to the currently active scenario. If no scenario exists yet a default one is created automatically.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildLayout()

void ui::qt::ScenariosPanel::BuildLayout ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillEventStrings()

void ui::qt::ScenariosPanel::FillEventStrings ( ScenarioEvent &  se) const
private

Build event-item summary strings for actualRow (cached on add).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSessionData()

nlohmann::json ui::qt::ScenariosPanel::GetSessionData ( ) const

◆ LoadFromSettings()

void ui::qt::ScenariosPanel::LoadFromSettings ( )
private

Restore m_scenarios from QSettings (called once at construction).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadSessionData()

void ui::qt::ScenariosPanel::LoadSessionData ( const nlohmann::json &  data)

◆ OnAddSelectedEvent

void ui::qt::ScenariosPanel::OnAddSelectedEvent ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnDeleteScenario

void ui::qt::ScenariosPanel::OnDeleteScenario ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnExport

void ui::qt::ScenariosPanel::OnExport ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnMoveDown

void ui::qt::ScenariosPanel::OnMoveDown ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnMoveUp

void ui::qt::ScenariosPanel::OnMoveUp ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnNewScenario

void ui::qt::ScenariosPanel::OnNewScenario ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRemoveEvent

void ui::qt::ScenariosPanel::OnRemoveEvent ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRenameScenario

void ui::qt::ScenariosPanel::OnRenameScenario ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnScenarioChanged

void ui::qt::ScenariosPanel::OnScenarioChanged ( int  comboIndex)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RebuildEventsTable()

void ui::qt::ScenariosPanel::RebuildEventsTable ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveToSettings()

void ui::qt::ScenariosPanel::SaveToSettings ( ) const
private

Persist m_scenarios to QSettings so they survive without a session file.

Here is the caller graph for this function:

◆ SelectedEventRow()

int ui::qt::ScenariosPanel::SelectedEventRow ( ) const
private

Returns the index of the selected row in m_eventsTable, or -1.

Here is the caller graph for this function:

◆ UpdateButtonStates()

void ui::qt::ScenariosPanel::UpdateButtonStates ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateScenarioCombo()

void ui::qt::ScenariosPanel::UpdateScenarioCombo ( int  selectIndex = -1)
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_activeScenario

int ui::qt::ScenariosPanel::m_activeScenario {-1}
private

◆ m_addBtn

QPushButton* ui::qt::ScenariosPanel::m_addBtn {nullptr}
private

◆ m_deleteBtn

QPushButton* ui::qt::ScenariosPanel::m_deleteBtn {nullptr}
private

◆ m_downBtn

QPushButton* ui::qt::ScenariosPanel::m_downBtn {nullptr}
private

◆ m_events

db::EventsContainer& ui::qt::ScenariosPanel::m_events
private

◆ m_eventsTable

QTableWidget* ui::qt::ScenariosPanel::m_eventsTable {nullptr}
private

◆ m_eventsView

EventsTableView* ui::qt::ScenariosPanel::m_eventsView
private

◆ m_exportBtn

QPushButton* ui::qt::ScenariosPanel::m_exportBtn {nullptr}
private

◆ m_newBtn

QPushButton* ui::qt::ScenariosPanel::m_newBtn {nullptr}
private

◆ m_removeBtn

QPushButton* ui::qt::ScenariosPanel::m_removeBtn {nullptr}
private

◆ m_renameBtn

QPushButton* ui::qt::ScenariosPanel::m_renameBtn {nullptr}
private

◆ m_scenarioCombo

QComboBox* ui::qt::ScenariosPanel::m_scenarioCombo {nullptr}
private

◆ m_scenarios

std::vector<Scenario> ui::qt::ScenariosPanel::m_scenarios
private

◆ m_statusLabel

QLabel* ui::qt::ScenariosPanel::m_statusLabel {nullptr}
private

◆ m_upBtn

QPushButton* ui::qt::ScenariosPanel::m_upBtn {nullptr}
private

The documentation for this class was generated from the following files: