dlgwrpstdio.h 1.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#ifndef DLGWRPSTDIO_H
#define DLGWRPSTDIO_H

#include <QDialog>
#include <QProcess>
#include <QList>
#include "listen_thread.h"
namespace Ui {
	class DlgWrpStdio;
}

class DlgWrpStdio : public QDialog
{
	Q_OBJECT

public:
	explicit DlgWrpStdio(QWidget *parent = nullptr);
	~DlgWrpStdio();
	QStringList m_lstArgs;
	bool		isRunning ();
	QProcess *	proc(){return m_process;}
protected:
	void timerEvent(QTimerEvent *event);
public slots:
	bool cmd_start();
	bool cmd_stop();
	void run();
	QStringList split_cmd(QString cmdline);
private slots:
	void slot_newPackage(QByteArray arr);
	void slot_readyReadStandardOutput();
	void slot_readyReadStandardError();
	void slot_sended(qint64 );
34
	void slot_started();
35
	void slot_stopped();
36
	void slot_quit();
37 38 39 40 41 42 43 44 45 46 47 48 49
	void on_pushButton_start_clicked();
	void on_toolButton_path_clicked();
	void on_toolButton_workingDir_clicked();
private:
	Ui::DlgWrpStdio *ui;
	int m_timerId = -1;
	listen_thread * m_plistenThd = nullptr;
	QProcess * m_process = nullptr;
	void loadIni();
	void saveIni();
};

#endif // DLGWRPSTDIO_H