1 | #ifndef MAINWINDOW_H |
---|
2 | #define MAINWINDOW_H |
---|
3 | |
---|
4 | #define COMMAND "command" |
---|
5 | #define COMMAND_CONFIRM "command+confirm" |
---|
6 | #define COMMAND_WITH_CONFIRMATION "commandwithconfirmation" // Backwards compatibility |
---|
7 | #define COMMAND_OUTPUT "command+output" |
---|
8 | #define COMMAND_CONFIRM_OUTPUT "command+confirm+output" |
---|
9 | #define COMMAND_OUTPUT_CONFIRM "command+output+confirm" |
---|
10 | #define ENVIRONMENT "OGLOGFILE,ogactiveadmin,DEFAULTSPEED" |
---|
11 | |
---|
12 | |
---|
13 | #include <QWidget> |
---|
14 | #include <QProcess> |
---|
15 | #include <QMap> |
---|
16 | #include <QMainWindow> |
---|
17 | #include <QNetworkReply> |
---|
18 | #include <QSslError> |
---|
19 | #include "digitalclock.h" |
---|
20 | |
---|
21 | class QWebEngineView; |
---|
22 | class QTextEdit; |
---|
23 | class QVBoxLayout; |
---|
24 | class QProcess; |
---|
25 | class QStringList; |
---|
26 | class QString; |
---|
27 | class QUrl; |
---|
28 | class QFile; |
---|
29 | class QTextStream; |
---|
30 | class QTermWidget; |
---|
31 | class QProgressBar; |
---|
32 | class QLineEdit; |
---|
33 | class QLabel; |
---|
34 | |
---|
35 | class MainWindow : public QMainWindow |
---|
36 | { |
---|
37 | Q_OBJECT |
---|
38 | |
---|
39 | public: |
---|
40 | MainWindow(QWidget *parent = 0); |
---|
41 | ~MainWindow(); |
---|
42 | |
---|
43 | public slots: |
---|
44 | // Funcion que maneja los links |
---|
45 | void slotLinkHandle(const QUrl& url); |
---|
46 | void slotWebLoadStarted(); |
---|
47 | void slotWebLoadFinished(bool ok); |
---|
48 | void slotWebLoadProgress(int progress); |
---|
49 | void slotSslErrors(QNetworkReply* reply); |
---|
50 | |
---|
51 | // Funciones que manejan cada vez que el proceso hace algo |
---|
52 | void slotProcessStarted(); |
---|
53 | void slotProcessFinished(int code,QProcess::ExitStatus status); |
---|
54 | void slotProcessError(QProcess::ProcessError error); |
---|
55 | void slotProcessOutput(); |
---|
56 | void slotProcessErrorOutput(); |
---|
57 | |
---|
58 | // Funcion para crear terminales |
---|
59 | void slotCreateTerminal(); |
---|
60 | void slotDeleteTerminal(); |
---|
61 | |
---|
62 | // Funcion para el webar |
---|
63 | void slotWebBarReturnPressed(); |
---|
64 | void slotUrlChanged(const QUrl &url); |
---|
65 | |
---|
66 | //Functions |
---|
67 | protected: |
---|
68 | int readEnvironmentValues(); |
---|
69 | void print(QString s); |
---|
70 | void write(QString s); |
---|
71 | void captureOutputForStatusBar(QString output); |
---|
72 | void startProgressBar(); |
---|
73 | void finishProgressBar(); |
---|
74 | void executeCommand(QString &string); |
---|
75 | QString readSpeed(); |
---|
76 | void showErrorMessage(QString string); |
---|
77 | |
---|
78 | protected: |
---|
79 | QWebEngineView *m_web; |
---|
80 | QTextEdit *m_output; |
---|
81 | QLabel *m_logo; |
---|
82 | QProgressBar *m_progressBar; |
---|
83 | QLabel *m_speedInfo; |
---|
84 | DigitalClock *m_clock; |
---|
85 | QTabWidget *m_tabs; |
---|
86 | QLineEdit *m_webBar; |
---|
87 | |
---|
88 | QProcess *m_process; |
---|
89 | |
---|
90 | QMap<QString,QString> m_env; |
---|
91 | QFile *m_logfile; |
---|
92 | QTextStream *m_logstream; |
---|
93 | |
---|
94 | int m_numberTerminal; |
---|
95 | }; |
---|
96 | |
---|
97 | #endif // MAINWINDOW_H |
---|