mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 19:44:59 +00:00
更新ui功能
This commit is contained in:
parent
8dc0e39b03
commit
7ae6aa298c
2 changed files with 29 additions and 28 deletions
|
@ -34,8 +34,9 @@ Dialog::Dialog(QWidget *parent) :
|
|||
QStringList args = m_adb.arguments();
|
||||
if (args.contains("devices")) {
|
||||
QStringList devices = m_adb.getDevicesSerialFromStdOut();
|
||||
if (!devices.isEmpty()) {
|
||||
ui->serialEdt->setText(devices.at(0));
|
||||
ui->serialBox->clear();
|
||||
for (auto& item : devices) {
|
||||
ui->serialBox->addItem(item);
|
||||
}
|
||||
} else if (args.contains("show") && args.contains("wlan0")) {
|
||||
QString ip = m_adb.getDeviceIPFromStdOut();
|
||||
|
@ -69,7 +70,7 @@ void Dialog::on_updateDevice_clicked()
|
|||
void Dialog::on_startServerBtn_clicked()
|
||||
{
|
||||
if (!m_videoForm) {
|
||||
m_videoForm = new VideoForm(ui->serialEdt->text().trimmed());
|
||||
m_videoForm = new VideoForm(ui->serialBox->currentText().trimmed());
|
||||
}
|
||||
m_videoForm->show();
|
||||
}
|
||||
|
@ -108,7 +109,7 @@ void Dialog::on_startAdbdBtn_clicked()
|
|||
QStringList adbArgs;
|
||||
adbArgs << "tcpip";
|
||||
adbArgs << "5555";
|
||||
m_adb.execute(ui->serialEdt->text().trimmed(), adbArgs);
|
||||
m_adb.execute(ui->serialBox->currentText().trimmed(), adbArgs);
|
||||
}
|
||||
|
||||
void Dialog::outLog(const QString &log, bool newLine)
|
||||
|
@ -145,5 +146,5 @@ void Dialog::on_getIPBtn_clicked()
|
|||
adbArgs << "addr";
|
||||
adbArgs << "show";
|
||||
adbArgs << "wlan0";
|
||||
m_adb.execute(ui->serialEdt->text().trimmed(), adbArgs);
|
||||
m_adb.execute(ui->serialBox->currentText().trimmed(), adbArgs);
|
||||
}
|
||||
|
|
|
@ -97,31 +97,14 @@
|
|||
<string>USB line</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="startAdbdBtn">
|
||||
<property name="text">
|
||||
<string>device serial:</string>
|
||||
<string>start device adbd</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="serialEdt"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="updateDevice">
|
||||
<property name="text">
|
||||
<string>update device</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="startServerBtn">
|
||||
<property name="text">
|
||||
<string>start server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="stopServerBtn">
|
||||
<property name="text">
|
||||
<string>stop server</string>
|
||||
|
@ -129,19 +112,36 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="startAdbdBtn">
|
||||
<widget class="QPushButton" name="updateDevice">
|
||||
<property name="text">
|
||||
<string>start device adbd</string>
|
||||
<string>update device</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="startServerBtn">
|
||||
<property name="text">
|
||||
<string>start server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>device serial:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="getIPBtn">
|
||||
<property name="text">
|
||||
<string>get ip</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="serialBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Add table
Reference in a new issue