mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-21 20:15:04 +00:00
feat: nickname for videoform title
This commit is contained in:
parent
47c3e6af60
commit
493c87ada1
2 changed files with 7 additions and 3 deletions
|
@ -212,6 +212,7 @@ void Device::initSignals()
|
|||
}
|
||||
});
|
||||
connect(m_server, &Server::connectToResult, this, [this](bool success, const QString &deviceName, const QSize &size) {
|
||||
Q_UNUSED(deviceName);
|
||||
if (success) {
|
||||
double diff = m_startTimeCount.elapsed() / 1000.0;
|
||||
qInfo() << QString("server start finish in %1s").arg(diff).toStdString().c_str();
|
||||
|
@ -220,8 +221,11 @@ void Device::initSignals()
|
|||
if (m_videoForm) {
|
||||
// must be show before updateShowSize
|
||||
m_videoForm->show();
|
||||
|
||||
m_videoForm->setWindowTitle(Config::getInstance().getTitle() + "-" + deviceName);
|
||||
QString name = Config::getInstance().getNickName(m_params.serial);
|
||||
if (name.isEmpty()) {
|
||||
name = Config::getInstance().getTitle();
|
||||
}
|
||||
m_videoForm->setWindowTitle(name + "-" + m_params.serial);
|
||||
m_videoForm->updateShowSize(size);
|
||||
|
||||
bool deviceVer = size.height() > size.width();
|
||||
|
|
|
@ -46,7 +46,7 @@ Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog)
|
|||
ui->connectedPhoneList->clear();
|
||||
for (auto &item : devices) {
|
||||
ui->serialBox->addItem(item);
|
||||
ui->connectedPhoneList->addItem(item+"-"+Config::getInstance().getNickName(item));
|
||||
ui->connectedPhoneList->addItem(Config::getInstance().getNickName(item) + "-" + item);
|
||||
}
|
||||
} else if (args.contains("show") && args.contains("wlan0")) {
|
||||
QString ip = m_adb.getDeviceIPFromStdOut();
|
||||
|
|
Loading…
Add table
Reference in a new issue