WIP: main

This commit is contained in:
driftingsun 2020-12-26 15:03:51 +03:00
parent f25f34565a
commit 15730b470e
52 changed files with 2438 additions and 208 deletions

View file

@ -0,0 +1,43 @@
#ifndef LOCALSERVER_H
#define LOCALSERVER_H
#include <QObject>
#include <QProcess>
#include <QStringList>
#include <QVector>
#include "message.h"
class QLocalServer;
class QLocalSocket;
class QProcess;
class LocalServer : public QObject
{
Q_OBJECT
public:
explicit LocalServer(const QString& name, QObject* parent = nullptr);
~LocalServer();
bool isRunning() const;
protected slots:
void onDisconnected();
void onNewConnection();
void onFinished(int exitCode, QProcess::ExitStatus exitStatus);
void onStarted();
private:
void finishProcess(const QStringList& messageArgs);
void sendMessage(const Message& message);
void startProcess(const QStringList& messageArgs);
QLocalServer* m_server;
QLocalSocket* m_clientConnection;
QVector<QProcess*> m_processList;
bool m_clientConnected;
};
#endif // LOCALSERVER_H