mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 11:35:56 +00:00
refactor: add disconnected singal
This commit is contained in:
parent
c4fdbffbf4
commit
687b146f6d
4 changed files with 24 additions and 2 deletions
|
@ -196,11 +196,13 @@ void DeviceManage::onDeviceConnected(bool success, const QString &serial, const
|
|||
if (!success) {
|
||||
removeDevice(serial);
|
||||
}
|
||||
emit deviceConnected(success, serial, deviceName, size);
|
||||
}
|
||||
|
||||
void DeviceManage::onDeviceDisconnected(QString serial)
|
||||
{
|
||||
removeDevice(serial);
|
||||
emit deviceDisconnected(serial);
|
||||
}
|
||||
|
||||
void DeviceManage::onControlStateChange(Device *device, Device::GroupControlState oldState, Device::GroupControlState newState)
|
||||
|
|
|
@ -14,12 +14,16 @@ public:
|
|||
virtual ~DeviceManage();
|
||||
|
||||
bool connectDevice(Device::DeviceParams params);
|
||||
bool disconnectDevice(const QString &serial);
|
||||
void disconnectAllDevice();
|
||||
|
||||
void updateScript(QString script);
|
||||
bool staysOnTop(const QString &serial);
|
||||
void showFPS(const QString &serial, bool show);
|
||||
|
||||
bool disconnectDevice(const QString &serial);
|
||||
void disconnectAllDevice();
|
||||
signals:
|
||||
void deviceConnected(bool success, const QString& serial, const QString& deviceName, const QSize& size);
|
||||
void deviceDisconnected(QString serial);
|
||||
|
||||
protected:
|
||||
void setGroupControlSignals(Device *host, Device *client, bool install);
|
||||
|
|
|
@ -94,6 +94,9 @@ Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog)
|
|||
qApp->quit();
|
||||
});
|
||||
connect(m_hideIcon, &QSystemTrayIcon::activated, this, &Dialog::slotActivated);
|
||||
|
||||
connect(&m_deviceManage, &DeviceManage::deviceConnected, this, &Dialog::onDeviceConnected);
|
||||
connect(&m_deviceManage, &DeviceManage::deviceDisconnected, this, &Dialog::onDeviceDisconnected);
|
||||
}
|
||||
|
||||
Dialog::~Dialog()
|
||||
|
@ -418,6 +421,16 @@ void Dialog::getIPbyIp()
|
|||
m_adb.execute(ui->serialBox->currentText().trimmed(), adbArgs);
|
||||
}
|
||||
|
||||
void Dialog::onDeviceConnected(bool success, const QString &serial, const QString &deviceName, const QSize &size)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Dialog::onDeviceDisconnected(QString serial)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Dialog::on_wirelessDisConnectBtn_clicked()
|
||||
{
|
||||
if (checkAdbRun()) {
|
||||
|
|
|
@ -31,6 +31,9 @@ public:
|
|||
void getIPbyIp();
|
||||
|
||||
private slots:
|
||||
void onDeviceConnected(bool success, const QString& serial, const QString& deviceName, const QSize& size);
|
||||
void onDeviceDisconnected(QString serial);
|
||||
|
||||
void on_updateDevice_clicked();
|
||||
void on_startServerBtn_clicked();
|
||||
void on_stopServerBtn_clicked();
|
||||
|
|
Loading…
Add table
Reference in a new issue