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 <QMutex>
11 
12 // MythTV headers
13 #include "mythexp.h"
14 #include "mythscreentype.h"
15 
16 class MythUIButton;
17 class MythUIButtonList;
19 class 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 QMutex m_lock {QMutex::Recursive};
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
MPUBLIC
#define MPUBLIC
Definition: mythexp.h:10
mythexp.h
MythScreenStack
Definition: mythscreenstack.h:16
MythScreenType::Create
virtual bool Create(void)
Definition: mythscreentype.cpp:282
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:33
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
MythTerminal::m_arguments
QStringList m_arguments
Definition: mythterminal.h:51
MythUIButton
A single button widget.
Definition: mythuibutton.h:22
MythScreenType::Init
virtual void Init(void)
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
Definition: mythscreentype.cpp:397
MythTerminal::m_program
QString m_program
Definition: mythterminal.h:50
MythTerminal::~MythTerminal
~MythTerminal() override
Definition: mythterminal.h:44
MythTerminal::deleteLater
virtual void deleteLater(void)
Definition: mythterminal.h:28
MythTerminal
Definition: mythterminal.h:22
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:152
mythscreentype.h