Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
ProcessTab Class Reference

A tab widget for displaying process output. More...

#include <process_tab.h>

Inheritance diagram for ProcessTab:

Signals

void processStarted ()
 Emitted when a process starts.
void processFinished (int exitCode, QProcess::ExitStatus status)
 Emitted when a process finishes.

Public Member Functions

 ProcessTab (QWidget *parent=nullptr)
 Constructs a new ProcessTab with the given parent.
void addPipeline (Pipeline *pipeline)
 Sets the pipeline for this tab.

Private Slots

void onStartingProcess (const Pipeline::Info &info, const QString &process, const QStringList &arguments)
 Handles the start of a process.
void onFinished (const Pipeline::Info &info, int exitCode, QProcess::ExitStatus status)
 Handles the completion of a process.
void onFinishedLast (const Pipeline::Info &info, int exitCode, const QString &message)
 Handles the completion of the last process.
void onReadyReadStandardOutput (const QByteArray &message)
 Handles ready read standard output.
void onReadyReadStandardError (const QByteArray &message)
 Handles ready read standard error.
void onErrorOccurred (const Pipeline::Info &info, QProcess::ProcessError error, const QString &process)
 Handles an error occurring during process execution.

Private Member Functions

void appendText (const QString &text)
 Appends text to the output.
void handleProcessData (const QByteArray &raw)
 Handles process data.
void applySgr (const QList< int > &codes)
 Applies SGR (Select Graphic Rendition) codes to the current format.
void deleteLastLine (QTextCursor &cursor)
 Deletes the last line from the text cursor.

Private Attributes

QTextCharFormat mCurrentFormat
 Pointer to the text browser for displaying output.
bool mMergeLogs
 Current text format for output.

Detailed Description

A tab widget for displaying process output.

Constructor & Destructor Documentation

◆ ProcessTab()

ProcessTab::ProcessTab ( QWidget * parent = nullptr)

Constructs a new ProcessTab with the given parent.

Parameters
parentThe parent widget.

Member Function Documentation

◆ addPipeline()

void ProcessTab::addPipeline ( Pipeline * pipeline)

Sets the pipeline for this tab.

Parameters
pipelineThe pipeline to set.

◆ appendText()

void ProcessTab::appendText ( const QString & text)
private

Appends text to the output.

Parameters
textThe text to append.

◆ applySgr()

void ProcessTab::applySgr ( const QList< int > & codes)
private

Applies SGR (Select Graphic Rendition) codes to the current format.

Parameters
codesA list of SGR codes.

◆ deleteLastLine()

void ProcessTab::deleteLastLine ( QTextCursor & cursor)
private

Deletes the last line from the text cursor.

Parameters
cursorThe text cursor.

◆ handleProcessData()

void ProcessTab::handleProcessData ( const QByteArray & raw)
private

Handles process data.

Parameters
rawThe raw data received from the process.

◆ onErrorOccurred

void ProcessTab::onErrorOccurred ( const Pipeline::Info & info,
QProcess::ProcessError error,
const QString & process )
privateslot

Handles an error occurring during process execution.

Parameters
infoInformation about the pipeline.
errorThe type of error that occurred.
processThe name of the process.

◆ onFinished

void ProcessTab::onFinished ( const Pipeline::Info & info,
int exitCode,
QProcess::ExitStatus status )
privateslot

Handles the completion of a process.

Parameters
infoInformation about the pipeline.
exitCodeThe exit code of the process.
statusThe exit status of the process.

◆ onFinishedLast

void ProcessTab::onFinishedLast ( const Pipeline::Info & info,
int exitCode,
const QString & message )
privateslot

Handles the completion of the last process.

Parameters
infoInformation about the pipeline.
exitCodeThe exit code of the process.
messageA message related to the process.

◆ onReadyReadStandardError

void ProcessTab::onReadyReadStandardError ( const QByteArray & message)
privateslot

Handles ready read standard error.

Parameters
messageThe data read from standard error.

◆ onReadyReadStandardOutput

void ProcessTab::onReadyReadStandardOutput ( const QByteArray & message)
privateslot

Handles ready read standard output.

Parameters
messageThe data read from standard output.

◆ onStartingProcess

void ProcessTab::onStartingProcess ( const Pipeline::Info & info,
const QString & process,
const QStringList & arguments )
privateslot

Handles the start of a process.

Parameters
infoInformation about the pipeline.
processThe name of the process.
argumentsThe arguments for the process.

◆ processFinished

void ProcessTab::processFinished ( int exitCode,
QProcess::ExitStatus status )
signal

Emitted when a process finishes.

Parameters
exitCodeThe exit code of the process.
statusThe exit status of the process.

The documentation for this class was generated from the following files:
  • /__w/maki/maki/app/system/process_tab.h
  • /__w/maki/maki/app/system/process_tab.cpp