MythTV master
mythterminal.h
Go to the documentation of this file.
1// -*- Mode: c++ -*-
2
3#ifndef MYTH_TERMINAL_H
4#define MYTH_TERMINAL_H
5
6// Qt headers
7#include <QObject>
8#include <QString>
9#include <QProcess>
10#include <QRecursiveMutex>
11
12// MythTV headers
13#include "mythuiexp.h"
15
16class MythUIButton;
19class MythUITextEdit;
20
22{
23 Q_OBJECT
24
25 public:
26 MythTerminal(MythScreenStack *parent, QString program,
27 QStringList arguments);
28 virtual void deleteLater(void)
29 { TeardownAll(); MythScreenType::deleteLater(); }
30 void Init(void) override; // MythScreenType
31 bool Create(void) override; // MythScreenType
32 bool IsDone(void) const;
33
34 public slots:
35 void Start(void);
36 void Kill(void);
37 void AddText(const QString& _str);
38
39 protected slots:
40 void ProcessHasText(void); // connected to from process' readyRead signal
41 void ProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
42
43 protected:
44 ~MythTerminal() override { TeardownAll(); }
45 void TeardownAll(void);
46
47 mutable QRecursiveMutex m_lock;
48 bool m_running {false};
49 QProcess *m_process {nullptr};
50 QString m_program;
51 QStringList m_arguments;
52 MythUIButtonListItem *m_currentLine {nullptr};
53 MythUIButtonList *m_output {nullptr};
54 MythUITextEdit *m_textEdit {nullptr};
55 MythUIButton *m_enterButton {nullptr};
56};
57
58#endif // MYTH_TERMINAL_H
Screen in which all other widgets are contained and rendered.
virtual bool Create(void)
virtual void Init(void)
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
QString m_program
Definition: mythterminal.h:50
QRecursiveMutex m_lock
Definition: mythterminal.h:47
~MythTerminal() override
Definition: mythterminal.h:44
virtual void deleteLater(void)
Definition: mythterminal.h:28
QStringList m_arguments
Definition: mythterminal.h:51
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
A single button widget.
Definition: mythuibutton.h:22
A text entry and edit widget.
#define MUI_PUBLIC
Definition: mythuiexp.h:9