game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
TerminalPanel Class Reference

Terminal panel widget that embeds a terminal emulator. More...

#include <terminalpanel.h>

Inheritance diagram for TerminalPanel:
Collaboration diagram for TerminalPanel:

Public Member Functions

 TerminalPanel (QWidget *parent=nullptr)
 ~TerminalPanel () override
bool isPaused () const
 Check if the terminal process is currently paused.
void pauseProcess ()
 Pause the terminal process (suspends btop/htop to save CPU) Call when panel is hidden or window is minimized.
void processFinished (int exitCode)
 Emitted when the terminal process finishes.
void resumeProcess ()
 Resume the terminal process Call when panel becomes visible again.
void startBtop ()
 Start or restart the terminal with btop++.
void startCommand (const QString &command)
 Start the terminal with a custom command.

Static Public Member Functions

static QString getBestMonitorCommand ()
 Get the best available system monitor command.
static bool isBtopAvailable ()
 Check if btop++ is available on the system.
static bool isHtopAvailable ()
 Check if htop is available as a fallback.

Detailed Description

Terminal panel widget that embeds a terminal emulator.

Provides an embedded terminal for running btop++, htop, or other terminal-based system monitoring tools directly within the game launcher.

Definition at line 31 of file terminalpanel.h.

Constructor & Destructor Documentation

◆ TerminalPanel()

TerminalPanel::TerminalPanel ( QWidget * parent = nullptr)
explicit

Definition at line 24 of file terminalpanel.cpp.

◆ ~TerminalPanel()

TerminalPanel::~TerminalPanel ( )
overridedefault

Member Function Documentation

◆ getBestMonitorCommand()

QString TerminalPanel::getBestMonitorCommand ( )
static

Get the best available system monitor command.

Returns
Command string for btop++, htop, or top (in order of preference)

Definition at line 77 of file terminalpanel.cpp.

References isBtopAvailable(), and isHtopAvailable().

Referenced by startBtop().

◆ isBtopAvailable()

bool TerminalPanel::isBtopAvailable ( )
static

Check if btop++ is available on the system.

Returns
true if btop++ is found in PATH

Definition at line 65 of file terminalpanel.cpp.

Referenced by getBestMonitorCommand().

◆ isHtopAvailable()

bool TerminalPanel::isHtopAvailable ( )
static

Check if htop is available as a fallback.

Returns
true if htop is found in PATH

Definition at line 71 of file terminalpanel.cpp.

Referenced by getBestMonitorCommand().

◆ isPaused()

bool TerminalPanel::isPaused ( ) const
inline

Check if the terminal process is currently paused.

Returns
true if paused

Definition at line 84 of file terminalpanel.h.

◆ pauseProcess()

void TerminalPanel::pauseProcess ( )

Pause the terminal process (suspends btop/htop to save CPU) Call when panel is hidden or window is minimized.

Definition at line 93 of file terminalpanel.cpp.

◆ processFinished()

void TerminalPanel::processFinished ( int exitCode)

Emitted when the terminal process finishes.

Parameters
exitCodeThe exit code of the process

◆ resumeProcess()

void TerminalPanel::resumeProcess ( )

Resume the terminal process Call when panel becomes visible again.

Definition at line 111 of file terminalpanel.cpp.

◆ startBtop()

void TerminalPanel::startBtop ( )

Start or restart the terminal with btop++.

Definition at line 36 of file terminalpanel.cpp.

References getBestMonitorCommand(), and startCommand().

◆ startCommand()

void TerminalPanel::startCommand ( const QString & command)

Start the terminal with a custom command.

Parameters
commandThe command to execute in the terminal

Definition at line 41 of file terminalpanel.cpp.

Referenced by startBtop().


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