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

Helper class encapsulating file operations for MainWindow. More...

#include <MainWindowFileOpsHelper.hpp>

Collaboration diagram for ui::qt::MainWindowFileOpsHelper:
Collaboration graph

Public Member Functions

 MainWindowFileOpsHelper (ui::qt::MainWindow *mainWindow)
 
 ~MainWindowFileOpsHelper ()=default
 
void OnOpenFileRequested ()
 
void OnLoadDbcRequested ()
 
void OnLoadEvlogTemplatesRequested ()
 
void OnSaveSession ()
 
void OnOpenSession ()
 
void AutoSwitchViewForFile (const QString &filePath)
 
void HandleDroppedFile (const QString &path)
 
void LoadRecentFiles ()
 
void SaveRecentFiles ()
 
void AddToRecentFiles (const QString &filePath)
 
void RefreshRecentFilesMenu ()
 
void OnRecentFileTriggered (const QString &filePath)
 
const std::vector< QString > & GetRecentFiles () const
 
QString GetLastDirectory () const
 
void SetLastDirectory (const QString &dir)
 

Private Member Functions

void LoadFileInternal (const std::filesystem::path &path)
 
QString GetSessionFilePath () const
 
bool ValidateSessionFile (const QString &path) const
 

Private Attributes

ui::qt::MainWindow * m_mainWindow
 
std::vector< QString > m_recentFiles
 
QString m_lastDirectory
 

Static Private Attributes

static constexpr int MAX_RECENT_FILES = 10
 

Detailed Description

Helper class encapsulating file operations for MainWindow.

Delegates file I/O operations from MainWindow, reducing its complexity. Manages:

  • File loading with auto-detection or explicit parser selection
  • Session save/load
  • Recent files list
  • DBC/EVLOG template loading
  • File drop handling

Maintains state for file operations and reports back to MainWindow via callbacks and signal-like patterns.

Thread-safe: File operations happen on worker threads; main thread is notified via Qt signals connected in MainWindow.

Constructor & Destructor Documentation

◆ MainWindowFileOpsHelper()

ui::qt::MainWindowFileOpsHelper::MainWindowFileOpsHelper ( ui::qt::MainWindow *  mainWindow)
explicit
Here is the call graph for this function:

◆ ~MainWindowFileOpsHelper()

ui::qt::MainWindowFileOpsHelper::~MainWindowFileOpsHelper ( )
default

Member Function Documentation

◆ AddToRecentFiles()

void ui::qt::MainWindowFileOpsHelper::AddToRecentFiles ( const QString &  filePath)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AutoSwitchViewForFile()

void ui::qt::MainWindowFileOpsHelper::AutoSwitchViewForFile ( const QString &  filePath)
Here is the call graph for this function:

◆ GetLastDirectory()

QString ui::qt::MainWindowFileOpsHelper::GetLastDirectory ( ) const
inline

◆ GetRecentFiles()

const std::vector< QString > & ui::qt::MainWindowFileOpsHelper::GetRecentFiles ( ) const
inline

◆ GetSessionFilePath()

QString ui::qt::MainWindowFileOpsHelper::GetSessionFilePath ( ) const
private
Here is the call graph for this function:

◆ HandleDroppedFile()

void ui::qt::MainWindowFileOpsHelper::HandleDroppedFile ( const QString &  path)
Here is the call graph for this function:

◆ LoadFileInternal()

void ui::qt::MainWindowFileOpsHelper::LoadFileInternal ( const std::filesystem::path &  path)
private

◆ LoadRecentFiles()

void ui::qt::MainWindowFileOpsHelper::LoadRecentFiles ( )
Here is the call graph for this function:

◆ OnLoadDbcRequested()

void ui::qt::MainWindowFileOpsHelper::OnLoadDbcRequested ( )
Here is the call graph for this function:

◆ OnLoadEvlogTemplatesRequested()

void ui::qt::MainWindowFileOpsHelper::OnLoadEvlogTemplatesRequested ( )
Here is the call graph for this function:

◆ OnOpenFileRequested()

void ui::qt::MainWindowFileOpsHelper::OnOpenFileRequested ( )
Here is the call graph for this function:

◆ OnOpenSession()

void ui::qt::MainWindowFileOpsHelper::OnOpenSession ( )
Here is the call graph for this function:

◆ OnRecentFileTriggered()

void ui::qt::MainWindowFileOpsHelper::OnRecentFileTriggered ( const QString &  filePath)
Here is the call graph for this function:

◆ OnSaveSession()

void ui::qt::MainWindowFileOpsHelper::OnSaveSession ( )
Here is the call graph for this function:

◆ RefreshRecentFilesMenu()

void ui::qt::MainWindowFileOpsHelper::RefreshRecentFilesMenu ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveRecentFiles()

void ui::qt::MainWindowFileOpsHelper::SaveRecentFiles ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetLastDirectory()

void ui::qt::MainWindowFileOpsHelper::SetLastDirectory ( const QString &  dir)
inline

◆ ValidateSessionFile()

bool ui::qt::MainWindowFileOpsHelper::ValidateSessionFile ( const QString &  path) const
private

Member Data Documentation

◆ m_lastDirectory

QString ui::qt::MainWindowFileOpsHelper::m_lastDirectory
private

◆ m_mainWindow

ui::qt::MainWindow* ui::qt::MainWindowFileOpsHelper::m_mainWindow
private

◆ m_recentFiles

std::vector<QString> ui::qt::MainWindowFileOpsHelper::m_recentFiles
private

◆ MAX_RECENT_FILES

constexpr int ui::qt::MainWindowFileOpsHelper::MAX_RECENT_FILES = 10
staticconstexprprivate

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