2018-04-02 23:29:39 +02:00
|
|
|
#ifndef SYNCTHINGWIDGETS_SYNCTHINGKILLER_H
|
|
|
|
#define SYNCTHINGWIDGETS_SYNCTHINGKILLER_H
|
|
|
|
|
|
|
|
#include "../global.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Data {
|
2021-07-15 02:38:26 +02:00
|
|
|
class SyncthingConnection;
|
2018-04-02 23:29:39 +02:00
|
|
|
class SyncthingProcess;
|
2021-07-15 02:38:26 +02:00
|
|
|
} // namespace Data
|
2018-04-02 23:29:39 +02:00
|
|
|
|
|
|
|
namespace QtGui {
|
|
|
|
|
2021-07-15 02:38:26 +02:00
|
|
|
struct ProcessWithConnection {
|
|
|
|
explicit ProcessWithConnection(Data::SyncthingProcess *process, Data::SyncthingConnection *connection = nullptr);
|
|
|
|
Data::SyncthingProcess *const process;
|
|
|
|
Data::SyncthingConnection *const connection;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline ProcessWithConnection::ProcessWithConnection(Data::SyncthingProcess *process, Data::SyncthingConnection *connection)
|
|
|
|
: process(process)
|
|
|
|
, connection(connection)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-04-02 23:29:39 +02:00
|
|
|
class SYNCTHINGWIDGETS_EXPORT SyncthingKiller : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-07-15 02:38:26 +02:00
|
|
|
explicit SyncthingKiller(std::vector<ProcessWithConnection> &&processes);
|
2018-04-02 23:29:39 +02:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void ignored();
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void waitForFinished();
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void confirmKill() const;
|
|
|
|
|
|
|
|
private:
|
2021-07-15 02:38:26 +02:00
|
|
|
std::vector<ProcessWithConnection> m_processes;
|
2018-04-02 23:29:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace QtGui
|
|
|
|
|
|
|
|
#endif // SYNCTHINGWIDGETS_SYNCTHINGKILLER_H
|