| 1 | #ifndef MANUALCOMMANDS_H | 
 
 
 
 
 | 2 | #define MANUALCOMMANDS_H | 
 
 
 
 
 | 3 |  | 
 
 
 
 
 | 4 | #include <QMainWindow> | 
 
 
 
 
 | 5 | #include <QClipboard> | 
 
 
 
 
 | 6 | #include <QProcess> | 
 
 
 
 
 | 7 | #include <QScrollBar> | 
 
 
 
 
 | 8 | #include <util.h> | 
 
 
 
 
 | 9 |  | 
 
 
 
 
 | 10 |  | 
 
 
 
 
 | 11 | namespace Ui { | 
 
 
 
 
 | 12 | class ManualCommands; | 
 
 
 
 
 | 13 | } | 
 
 
 
 
 | 14 |  | 
 
 
 
 
 | 15 | class ManualCommands : public QMainWindow | 
 
 
 
 
 | 16 | { | 
 
 
 
 
 | 17 | Q_OBJECT | 
 
 
 
 
 | 18 |  | 
 
 
 
 
 | 19 | public: | 
 
 
 
 
 | 20 | explicit ManualCommands(QWidget *parent = 0); | 
 
 
 
 
 | 21 | ~ManualCommands(); | 
 
 
 
 
 | 22 |  | 
 
 
 
 
 | 23 | protected: | 
 
 
 
 
 | 24 | bool eventFilter(QObject* obj, QEvent *event); | 
 
 
 
 
 | 25 |  | 
 
 
 
 
 | 26 | private slots: | 
 
 
 
 
 | 27 | void on_pbInput_clicked(); | 
 
 
 
 
 | 28 |  | 
 
 
 
 
 | 29 | void on_pcCopyClipboard_clicked(); | 
 
 
 
 
 | 30 |  | 
 
 
 
 
 | 31 | void on_pbClear_clicked(); | 
 
 
 
 
 | 32 |  | 
 
 
 
 
 | 33 | private: | 
 
 
 
 
 | 34 | void executeCommand(); | 
 
 
 
 
 | 35 | Ui::ManualCommands *ui; | 
 
 
 
 
 | 36 | static const int limHistory=50; | 
 
 
 
 
 | 37 | QString history[limHistory]; //this is kinda a circular buffer manual implementation (http://www.boost.org/doc/libs/1_36_0/libs/circular_buffer/doc/circular_buffer.html) | 
 
 
 
 
 | 38 | int nextInsertHistoryIdx; //next index where new commands will be inserted | 
 
 
 
 
 | 39 | int searchHistoryIdx; //current index when searching history with arrows | 
 
 
 
 
 | 40 | QProcess *myProcess; | 
 
 
 
 
 | 41 | }; | 
 
 
 
 
 | 42 |  | 
 
 
 
 
 | 43 | #endif // MANUALCOMMANDS_H |