Go to the documentation of this file.
33 QStringList _arguments) :
35 m_process(new QProcess()), m_program(std::move(_program)),
36 m_arguments(std::move(_arguments))
38 m_process->setProcessChannelMode(QProcess::MergedChannels);
42 connect(
m_process, qOverload<int,QProcess::ExitStatus>(&QProcess::finished),
48 QMutexLocker locker(&
m_lock);
61 QMutexLocker locker(&
m_lock);
63 while (!str.isEmpty())
65 int nlf = str.indexOf(
"\r\n");
66 nlf = (nlf < 0) ? str.indexOf(
"\r") : nlf;
67 nlf = (nlf < 0) ? str.indexOf(
"\n") : nlf;
69 QString curStr = (nlf >= 0) ? str.left(nlf) : str;
70 if (!curStr.isEmpty())
82 str = str.mid(nlf + 1);
93 QMutexLocker locker(&
m_lock);
100 QMutexLocker locker(&
m_lock);
107 QMutexLocker locker(&
m_lock);
108 return QProcess::NotRunning ==
m_process->state();
113 QMutexLocker locker(&
m_lock);
114 int64_t len =
m_process->bytesAvailable();
129 int exitCode, QProcess::ExitStatus exitStatus)
131 QMutexLocker locker(&
m_lock);
132 if (exitStatus == QProcess::CrashExit) {
133 AddText(tr(
"*** Crashed with status: %1 ***").arg(exitCode));
135 AddText(tr(
"*** Exited with status: %1 ***").arg(exitCode));
154 LOG(VB_GENERAL, LOG_ERR,
"Theme elements missing.");
169 QMutexLocker locker(&
m_lock);
175 m_process->write(text.toLocal8Bit().constData());
static void error(const char *str,...)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Screen in which all other widgets are contained and rendered.
QString GetText(void) const
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
void ProcessHasText(void)
void ProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
MythUIButtonListItem * m_currentLine
void BuildFocusList(void)
void AddText(const QString &_str)
void SetEnabled(bool enable)
MythUIButtonList * m_output
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
bool Create(void) override
MythUIButton * m_enterButton
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
MythUITextEdit * m_textEdit
MythTerminal(MythScreenStack *parent, QString program, QStringList arguments)