Merge pull request #389 from barry-ran/dev

Dev
This commit is contained in:
Barry 2021-04-17 18:23:01 +08:00 committed by GitHub
commit fc6314b8f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 830 additions and 222 deletions

View file

@ -186,7 +186,8 @@
same "printed page" as the copyright notice for easier same "printed page" as the copyright notice for easier
identification within third-party archives. identification within third-party archives.
Copyright [yyyy] [name of copyright owner] Copyright (C) 2019 Rankun
Copyright (C) 2019-2025 Rankun
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View file

@ -179,7 +179,6 @@ macos {
APP_CONFIG.files = $$files($$PWD/../config/config.ini) APP_CONFIG.files = $$files($$PWD/../config/config.ini)
APP_CONFIG.path = Contents/MacOS/config APP_CONFIG.path = Contents/MacOS/config
QMAKE_BUNDLE_DATA += APP_CONFIG QMAKE_BUNDLE_DATA += APP_CONFIG
# mac application icon # mac application icon
ICON = $$PWD/res/QtScrcpy.icns ICON = $$PWD/res/QtScrcpy.icns
QMAKE_INFO_PLIST = $$PWD/res/Info_Mac.plist QMAKE_INFO_PLIST = $$PWD/res/Info_Mac.plist

View file

@ -33,7 +33,7 @@ Device::Device(DeviceParams params, QObject *parent) : QObject(parent), m_params
m_decoder = new Decoder(m_vb, this); m_decoder = new Decoder(m_vb, this);
m_fileHandler = new FileHandler(this); m_fileHandler = new FileHandler(this);
m_controller = new Controller(params.gameScript, this); m_controller = new Controller(params.gameScript, this);
m_videoForm = new VideoForm(Config::getInstance().getFramelessWindow(), Config::getInstance().getSkin()); m_videoForm = new VideoForm(params.framelessWindow, Config::getInstance().getSkin());
m_videoForm->setDevice(this); m_videoForm->setDevice(this);
} }
@ -382,7 +382,7 @@ bool Device::saveFrame(const AVFrame *frame)
// save // save
QString absFilePath; QString absFilePath;
QString fileDir(Config::getInstance().getRecordPath()); QString fileDir(m_params.recordPath);
if (fileDir.isEmpty()) { if (fileDir.isEmpty()) {
qWarning() << "please select record save path!!!"; qWarning() << "please select record save path!!!";
return false; return false;

View file

@ -26,6 +26,7 @@ public:
struct DeviceParams struct DeviceParams
{ {
QString recordFileName = ""; // 视频录制文件名 QString recordFileName = ""; // 视频录制文件名
QString recordPath = ""; // 视频保存路径
QString serial = ""; // 设备序列号 QString serial = ""; // 设备序列号
quint16 localPort = 27183; // reverse时本地监听端口 quint16 localPort = 27183; // reverse时本地监听端口
quint16 maxSize = 720; // 视频分辨率 quint16 maxSize = 720; // 视频分辨率
@ -37,7 +38,8 @@ public:
QString gameScript = ""; // 游戏映射脚本 QString gameScript = ""; // 游戏映射脚本
bool renderExpiredFrames = false; // 是否渲染延迟视频帧 bool renderExpiredFrames = false; // 是否渲染延迟视频帧
int lockVideoOrientation = -1; // 是否锁定视频方向 int lockVideoOrientation = -1; // 是否锁定视频方向
int stayAwake = false; // 是否保持唤醒 bool stayAwake = false; // 是否保持唤醒
bool framelessWindow = false; // 是否无边框窗口
}; };
enum GroupControlState enum GroupControlState
{ {

View file

@ -1,4 +1,4 @@
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QFileDialog> #include <QFileDialog>
#include <QKeyEvent> #include <QKeyEvent>
@ -43,8 +43,10 @@ Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog)
if (args.contains("devices")) { if (args.contains("devices")) {
QStringList devices = m_adb.getDevicesSerialFromStdOut(); QStringList devices = m_adb.getDevicesSerialFromStdOut();
ui->serialBox->clear(); ui->serialBox->clear();
ui->connectedPhoneList->clear();
for (auto &item : devices) { for (auto &item : devices) {
ui->serialBox->addItem(item); ui->serialBox->addItem(item);
ui->connectedPhoneList->addItem(item+"-"+Config::getInstance().getNickName(item));
} }
} else if (args.contains("show") && args.contains("wlan0")) { } else if (args.contains("show") && args.contains("wlan0")) {
QString ip = m_adb.getDeviceIPFromStdOut(); QString ip = m_adb.getDeviceIPFromStdOut();
@ -74,10 +76,25 @@ Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog)
outLog(log, newLine); outLog(log, newLine);
} }
}); });
m_hideIcon = new QSystemTrayIcon();
m_hideIcon->setIcon(QIcon(":/image/tray/logo.png"));
m_menu = new QMenu();
m_quit = new QAction();
m_showWindow = new QAction();;
m_showWindow->setText(tr("show"));
m_quit->setText(tr("quit"));
m_menu->addAction(m_showWindow);
m_menu->addAction(m_quit);
m_hideIcon->setContextMenu(m_menu);
connect(m_showWindow, &QAction::triggered, this, &Dialog::slotShow);
connect(m_quit, SIGNAL(triggered()), this, SLOT(close()));
connect(m_hideIcon, &QSystemTrayIcon::activated,this,&Dialog::slotActivated);
} }
Dialog::~Dialog() Dialog::~Dialog()
{ {
updateBootConfig(false);
m_deviceManage.disconnectAllDevice(); m_deviceManage.disconnectAllDevice();
delete ui; delete ui;
} }
@ -95,7 +112,6 @@ void Dialog::initUI()
ui->bitRateBox->addItem("50000000"); ui->bitRateBox->addItem("50000000");
ui->bitRateBox->addItem("100000000"); ui->bitRateBox->addItem("100000000");
ui->bitRateBox->addItem("200000000"); ui->bitRateBox->addItem("200000000");
ui->bitRateBox->setCurrentIndex(Config::getInstance().getBitRateIndex());
ui->maxSizeBox->addItem("640"); ui->maxSizeBox->addItem("640");
ui->maxSizeBox->addItem("720"); ui->maxSizeBox->addItem("720");
@ -103,11 +119,9 @@ void Dialog::initUI()
ui->maxSizeBox->addItem("1280"); ui->maxSizeBox->addItem("1280");
ui->maxSizeBox->addItem("1920"); ui->maxSizeBox->addItem("1920");
ui->maxSizeBox->addItem(tr("original")); ui->maxSizeBox->addItem(tr("original"));
ui->maxSizeBox->setCurrentIndex(Config::getInstance().getMaxSizeIndex());
ui->formatBox->addItem("mp4"); ui->formatBox->addItem("mp4");
ui->formatBox->addItem("mkv"); ui->formatBox->addItem("mkv");
ui->formatBox->setCurrentIndex(Config::getInstance().getRecordFormatIndex());
ui->lockOrientationBox->addItem(tr("no lock")); ui->lockOrientationBox->addItem(tr("no lock"));
ui->lockOrientationBox->addItem("0"); ui->lockOrientationBox->addItem("0");
@ -116,20 +130,64 @@ void Dialog::initUI()
ui->lockOrientationBox->addItem("270"); ui->lockOrientationBox->addItem("270");
ui->lockOrientationBox->setCurrentIndex(0); ui->lockOrientationBox->setCurrentIndex(0);
ui->recordPathEdt->setText(Config::getInstance().getRecordPath()); updateBootConfig(true);
ui->framelessCheck->setChecked(Config::getInstance().getFramelessWindow());
on_useSingleModeCheck_clicked();
on_updateDevice_clicked();
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
// mac need more width // mac need more width
setFixedWidth(520); setFixedWidth(550);
#endif #endif
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
// linux need more width // linux need more width
setFixedWidth(480); setFixedWidth(520);
#endif #endif
} }
void Dialog::updateBootConfig(bool toView)
{
if (toView) {
UserBootConfig config = Config::getInstance().getUserBootConfig();
ui->bitRateBox->setCurrentIndex(config.bitRateIndex);
ui->maxSizeBox->setCurrentIndex(config.maxSizeIndex);
ui->formatBox->setCurrentIndex(config.recordFormatIndex);
ui->recordPathEdt->setText(config.recordPath);
ui->lockOrientationBox->setCurrentIndex(config.lockOrientationIndex);
ui->framelessCheck->setChecked(config.framelessWindow);
ui->recordScreenCheck->setChecked(config.recordScreen);
ui->notDisplayCheck->setChecked(config.recordBackground);
ui->useReverseCheck->setChecked(config.reverseConnect);
ui->fpsCheck->setChecked(config.showFPS);
ui->alwaysTopCheck->setChecked(config.windowOnTop);
ui->closeScreenCheck->setChecked(config.autoOffScreen);
ui->stayAwakeCheck->setChecked(config.keepAlive);
ui->useSingleModeCheck->setChecked(config.simpleMode);
} else {
UserBootConfig config;
config.bitRateIndex = ui->bitRateBox->currentIndex();
config.maxSizeIndex = ui->maxSizeBox->currentIndex();
config.recordFormatIndex = ui->formatBox->currentIndex();
config.recordPath = ui->recordPathEdt->text();
config.lockOrientationIndex = ui->lockOrientationBox->currentIndex();
config.recordScreen = ui->recordScreenCheck->isChecked();
config.recordBackground = ui->notDisplayCheck->isChecked();
config.reverseConnect = ui->useReverseCheck->isChecked();
config.showFPS = ui->fpsCheck->isChecked();
config.windowOnTop = ui->alwaysTopCheck->isChecked();
config.autoOffScreen = ui->closeScreenCheck->isChecked();
config.framelessWindow = ui->framelessCheck->isChecked();
config.keepAlive = ui->stayAwakeCheck->isChecked();
config.simpleMode = ui->useSingleModeCheck->isChecked();
Config::getInstance().setUserBootConfig(config);
}
}
void Dialog::execAdbCmd() void Dialog::execAdbCmd()
{ {
if (checkAdbRun()) { if (checkAdbRun()) {
@ -140,6 +198,15 @@ void Dialog::execAdbCmd()
m_adb.execute(ui->serialBox->currentText().trimmed(), cmd.split(" ", Qt::SkipEmptyParts)); m_adb.execute(ui->serialBox->currentText().trimmed(), cmd.split(" ", Qt::SkipEmptyParts));
} }
void Dialog::delayMs(int ms)
{
QTime dieTime = QTime::currentTime().addMSecs(ms);
while (QTime::currentTime() < dieTime) {
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
}
QString Dialog::getGameScript(const QString &fileName) QString Dialog::getGameScript(const QString &fileName)
{ {
QFile loadFile(KeyMap::getKeyMapPath() + "/" + fileName); QFile loadFile(KeyMap::getKeyMapPath() + "/" + fileName);
@ -153,6 +220,48 @@ QString Dialog::getGameScript(const QString &fileName)
return ret; return ret;
} }
void Dialog::slotShow()
{
this->show();
m_hideIcon->hide();
}
void Dialog::slotActivated(QSystemTrayIcon::ActivationReason reason)
{
switch (reason) {
case QSystemTrayIcon::Trigger:
this->show();
m_hideIcon->hide();
break;
default:
break;
}
}
void Dialog::closeEvent(QCloseEvent *event)
{
int res = QMessageBox::question(this,tr("warning"),tr("Quit or set tray?"),tr("Quit"),tr("Set tray"),tr("Cancel"));
if(res == 0)
{
event->accept();
}
else if(res == 1)
{
this->hide();
m_hideIcon->show();
m_hideIcon->showMessage(tr("Notice"),
tr("Hidden here!"),
QSystemTrayIcon::Information,
3000);
event->ignore();
}
else
{
event->ignore();
}
}
void Dialog::on_updateDevice_clicked() void Dialog::on_updateDevice_clicked()
{ {
if (checkAdbRun()) { if (checkAdbRun()) {
@ -195,6 +304,8 @@ void Dialog::on_startServerBtn_clicked()
params.renderExpiredFrames = Config::getInstance().getRenderExpiredFrames(); params.renderExpiredFrames = Config::getInstance().getRenderExpiredFrames();
params.lockVideoOrientation = ui->lockOrientationBox->currentIndex() - 1; params.lockVideoOrientation = ui->lockOrientationBox->currentIndex() - 1;
params.stayAwake = ui->stayAwakeCheck->isChecked(); params.stayAwake = ui->stayAwakeCheck->isChecked();
params.framelessWindow = ui->framelessCheck->isChecked();
params.recordPath = ui->recordPathEdt->text().trimmed();
m_deviceManage.connectDevice(params); m_deviceManage.connectDevice(params);
@ -341,7 +452,6 @@ void Dialog::on_selectRecordPathBtn_clicked()
void Dialog::on_recordPathEdt_textChanged(const QString &arg1) void Dialog::on_recordPathEdt_textChanged(const QString &arg1)
{ {
Config::getInstance().setRecordPath(arg1);
ui->recordPathEdt->setToolTip(arg1.trimmed()); ui->recordPathEdt->setToolTip(arg1.trimmed());
ui->notDisplayCheck->setCheckable(!arg1.trimmed().isEmpty()); ui->notDisplayCheck->setCheckable(!arg1.trimmed().isEmpty());
} }
@ -402,23 +512,118 @@ void Dialog::on_recordScreenCheck_clicked(bool checked)
} }
} }
void Dialog::on_bitRateBox_activated(int index) void Dialog::on_usbConnectBtn_clicked()
{ {
Config::getInstance().setBitRateIndex(index); on_stopAllServerBtn_clicked();
delayMs(200);
on_updateDevice_clicked();
delayMs(200);
int firstUsbDevice = findDeviceFromeSerialBox(false);
if (-1 == firstUsbDevice) {
qWarning() << "No use device is found!";
return;
}
ui->serialBox->setCurrentIndex(firstUsbDevice);
on_startServerBtn_clicked();
} }
void Dialog::on_maxSizeBox_activated(int index) int Dialog::findDeviceFromeSerialBox(bool wifi) {
{ QRegExp regIP("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\:([0-9]|[1-9]\\d|[1-9]\\d{2}|[1-9]\\d{3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])\\b");
Config::getInstance().setMaxSizeIndex(index); for (int i = 0; i < ui->serialBox->count(); ++i)
{
bool isWifi = regIP.exactMatch(ui->serialBox->itemText(i));
bool found = wifi ? isWifi : !isWifi;
if(found)
{
return i;
}
}
return -1;
} }
void Dialog::on_formatBox_activated(int index) void Dialog::on_wifiConnectBtn_clicked()
{ {
Config::getInstance().setRecordFormatIndex(index); on_stopAllServerBtn_clicked();
delayMs(200);
on_updateDevice_clicked();
delayMs(200);
int firstUsbDevice = findDeviceFromeSerialBox(false);
if (-1 == firstUsbDevice) {
qWarning() << "No use device is found!";
return;
}
ui->serialBox->setCurrentIndex(firstUsbDevice);
on_getIPBtn_clicked();
delayMs(200);
on_startAdbdBtn_clicked();
delayMs(1000);
on_wirelessConnectBtn_clicked();
delayMs(2000);
on_updateDevice_clicked();
delayMs(200);
int firstWifiDevice = findDeviceFromeSerialBox(true);
if (-1 == firstWifiDevice) {
qWarning() << "No wifi device is found!";
return;
}
ui->serialBox->setCurrentIndex(firstWifiDevice);
on_startServerBtn_clicked();
} }
void Dialog::on_framelessCheck_stateChanged(int arg1) void Dialog::on_connectedPhoneList_itemDoubleClicked(QListWidgetItem *item)
{ {
Q_UNUSED(arg1) Q_UNUSED(item);
Config::getInstance().setFramelessWindow(ui->framelessCheck->isChecked()); ui->serialBox->setCurrentIndex(ui->connectedPhoneList->currentRow());
on_startServerBtn_clicked();
}
void Dialog::on_updateNameBtn_clicked()
{
if(ui->serialBox->count()!=0) {
if(ui->userNameEdt->text().isEmpty()) {
Config::getInstance().setNickName(ui->serialBox->currentText(), "Phone");
} else {
Config::getInstance().setNickName(ui->serialBox->currentText(), ui->userNameEdt->text());
}
on_updateDevice_clicked();
qDebug()<<"Update OK!";
} else {
qWarning()<<"No device is connected!";
}
}
void Dialog::on_useSingleModeCheck_clicked()
{
if(ui->useSingleModeCheck->isChecked())
{
ui->configGroupBox->hide();
ui->adbGroupBox->hide();
ui->wirelessGroupBox->hide();
ui->usbGroupBox->hide();
}
else
{
ui->configGroupBox->show();
ui->adbGroupBox->show();
ui->wirelessGroupBox->show();
ui->usbGroupBox->show();
}
}
void Dialog::on_serialBox_currentIndexChanged(const QString &arg1)
{
ui->userNameEdt->setText(Config::getInstance().getNickName(arg1));
} }

View file

@ -1,8 +1,13 @@
#ifndef DIALOG_H #ifndef DIALOG_H
#define DIALOG_H #define DIALOG_H
#include <QDialog> #include <QDialog>
#include <QPointer> #include <QPointer>
#include <QMessageBox>
#include <QMenu>
#include <QSystemTrayIcon>
#include <QListWidget>
#include "adbprocess.h" #include "adbprocess.h"
#include "devicemanage.h" #include "devicemanage.h"
@ -58,24 +63,40 @@ private slots:
void on_recordScreenCheck_clicked(bool checked); void on_recordScreenCheck_clicked(bool checked);
void on_bitRateBox_activated(int index); void on_usbConnectBtn_clicked();
void on_maxSizeBox_activated(int index); void on_wifiConnectBtn_clicked();
void on_formatBox_activated(int index); void on_connectedPhoneList_itemDoubleClicked(QListWidgetItem *item);
void on_framelessCheck_stateChanged(int arg1); void on_updateNameBtn_clicked();
void on_useSingleModeCheck_clicked();
void on_serialBox_currentIndexChanged(const QString &arg1);
private: private:
bool checkAdbRun(); bool checkAdbRun();
void initUI(); void initUI();
void updateBootConfig(bool toView = true);
void execAdbCmd(); void execAdbCmd();
void delayMs(int ms);
QString getGameScript(const QString &fileName); QString getGameScript(const QString &fileName);
void slotShow();
void slotActivated(QSystemTrayIcon::ActivationReason reason);
int findDeviceFromeSerialBox(bool wifi);
protected:
void closeEvent(QCloseEvent *event);
private: private:
Ui::Dialog *ui; Ui::Dialog *ui;
AdbProcess m_adb; AdbProcess m_adb;
DeviceManage m_deviceManage; DeviceManage m_deviceManage;
QSystemTrayIcon *m_hideIcon;
QMenu *m_menu;
QAction *m_showWindow;
QAction *m_quit;
}; };
#endif // DIALOG_H #endif // DIALOG_H

View file

@ -6,19 +6,19 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>420</width> <width>500</width>
<height>517</height> <height>745</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>420</width> <width>500</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>420</width> <width>500</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -26,6 +26,63 @@
<string notr="true">QtScrcpy</string> <string notr="true">QtScrcpy</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="useSingleModeCheck">
<property name="text">
<string>Use Simple Mode</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="simpleGroupBox">
<property name="title">
<string>Simple Mode</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QPushButton" name="wifiConnectBtn">
<property name="text">
<string>WIFI Connect</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="usbConnectBtn">
<property name="text">
<string>USB Connect</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>Double click to connect:</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="connectedPhoneList">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="configGroupBox"> <widget class="QGroupBox" name="configGroupBox">
<property name="title"> <property name="title">
@ -350,21 +407,43 @@
<string>USB line</string> <string>USB line</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing"> <item>
<number>3</number> <layout class="QHBoxLayout" name="horizontalLayout_10">
</property> <item>
<property name="leftMargin"> <widget class="QLabel" name="label_9">
<number>5</number> <property name="minimumSize">
</property> <size>
<property name="topMargin"> <width>110</width>
<number>5</number> <height>0</height>
</property> </size>
<property name="rightMargin"> </property>
<number>5</number> <property name="text">
</property> <string>device name:</string>
<property name="bottomMargin"> </property>
<number>5</number> </widget>
</property> </item>
<item>
<widget class="QLineEdit" name="userNameEdt">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="updateNameBtn">
<property name="text">
<string>update name</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<widget class="QWidget" name="usbWidget1" native="true"> <widget class="QWidget" name="usbWidget1" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
@ -382,6 +461,12 @@
</property> </property>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>device serial:</string> <string>device serial:</string>
</property> </property>

View file

@ -1,4 +1,4 @@
#include <QApplication> #include <QApplication>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QSurfaceFormat> #include <QSurfaceFormat>

Binary file not shown.

View file

@ -16,22 +16,22 @@
<translation type="vanished">file transfer failed</translation> <translation type="vanished">file transfer failed</translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="181"/> <location filename="../../device/device.cpp" line="184"/>
<source>install apk</source> <source>install apk</source>
<translation>install apk</translation> <translation>install apk</translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="183"/> <location filename="../../device/device.cpp" line="186"/>
<source>file transfer</source> <source>file transfer</source>
<translation>file transfer</translation> <translation>file transfer</translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="187"/> <location filename="../../device/device.cpp" line="190"/>
<source>wait current %1 to complete</source> <source>wait current %1 to complete</source>
<translation>wait current %1 to complete</translation> <translation>wait current %1 to complete</translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="190"/> <location filename="../../device/device.cpp" line="193"/>
<source>%1 complete, save in %2</source> <source>%1 complete, save in %2</source>
<translation>%1 complete, save in %2</translation> <translation>%1 complete, save in %2</translation>
</message> </message>
@ -41,7 +41,7 @@
<translation type="vanished">%1 complete\n save in %2</translation> <translation type="vanished">%1 complete\n save in %2</translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="193"/> <location filename="../../device/device.cpp" line="196"/>
<source>%1 failed</source> <source>%1 failed</source>
<translation>%1 failed</translation> <translation>%1 failed</translation>
</message> </message>
@ -49,93 +49,134 @@
<context> <context>
<name>Dialog</name> <name>Dialog</name>
<message> <message>
<location filename="../../dialog.ui" line="477"/> <location filename="../../dialog.ui" line="562"/>
<source>Wireless</source> <source>Wireless</source>
<translation>Wireless</translation> <translation>Wireless</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="561"/> <location filename="../../dialog.ui" line="646"/>
<source>wireless connect</source> <source>wireless connect</source>
<translation>wireless connect</translation> <translation>wireless connect</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="577"/> <location filename="../../dialog.ui" line="662"/>
<source>wireless disconnect</source> <source>wireless disconnect</source>
<translation>wireless disconnect</translation> <translation>wireless disconnect</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="32"/> <location filename="../../dialog.ui" line="89"/>
<source>Start Config</source> <source>Start Config</source>
<translation>Start Config</translation> <translation>Start Config</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="168"/> <location filename="../../dialog.ui" line="225"/>
<source>record save path:</source> <source>record save path:</source>
<translation>record save path:</translation> <translation>record save path:</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="185"/> <location filename="../../dialog.ui" line="242"/>
<location filename="../../dialog.cpp" line="338"/> <location filename="../../dialog.cpp" line="449"/>
<source>select path</source> <source>select path</source>
<translation>select path</translation> <translation>select path</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="99"/> <location filename="../../dialog.ui" line="156"/>
<source>record format</source> <source>record format</source>
<translation>record format:</translation> <translation>record format:</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="323"/> <location filename="../../dialog.ui" line="380"/>
<source>record screen</source> <source>record screen</source>
<translation>record screen</translation> <translation>record screen</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="268"/> <location filename="../../dialog.ui" line="325"/>
<source>frameless</source> <source>frameless</source>
<translation>frameless</translation> <translation>frameless</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="127"/> <location filename="../../dialog.ui" line="32"/>
<source>Use Simple Mode</source>
<translatorcomment>Use Simple Mode</translatorcomment>
<translation>Use Simple Mode</translation>
</message>
<message>
<location filename="../../dialog.ui" line="42"/>
<source>Simple Mode</source>
<translatorcomment>Simple Mode</translatorcomment>
<translation>Simple Mode</translation>
</message>
<message>
<location filename="../../dialog.ui" line="53"/>
<source>WIFI Connect</source>
<translatorcomment>WIFI Connect</translatorcomment>
<translation>WIFI Connect</translation>
</message>
<message>
<location filename="../../dialog.ui" line="60"/>
<source>USB Connect</source>
<translatorcomment>USB Connect</translatorcomment>
<translation>USB Connect</translation>
</message>
<message>
<location filename="../../dialog.ui" line="69"/>
<source>Double click to connect:</source>
<translation>Double click to connect:</translation>
</message>
<message>
<location filename="../../dialog.ui" line="184"/>
<source>lock orientation:</source> <source>lock orientation:</source>
<translation>lock orientation:</translation> <translation>lock orientation:</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="330"/> <location filename="../../dialog.ui" line="387"/>
<source>show fps</source> <source>show fps</source>
<translation>show fps</translation> <translation>show fps</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="337"/> <location filename="../../dialog.ui" line="394"/>
<source>stay awake</source> <source>stay awake</source>
<translation>stay awake</translation> <translation>stay awake</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="434"/> <location filename="../../dialog.ui" line="421"/>
<source>device name:</source>
<translatorcomment>device name:</translatorcomment>
<translation>device name:</translation>
</message>
<message>
<location filename="../../dialog.ui" line="438"/>
<source>update name</source>
<translatorcomment>update name</translatorcomment>
<translation>update name</translation>
</message>
<message>
<location filename="../../dialog.ui" line="519"/>
<source>stop all server</source> <source>stop all server</source>
<translation>stop all server</translation> <translation>stop all server</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="611"/> <location filename="../../dialog.ui" line="696"/>
<source>adb command:</source> <source>adb command:</source>
<translation>adb command:</translation> <translation>adb command:</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="647"/> <location filename="../../dialog.ui" line="732"/>
<source>terminate</source> <source>terminate</source>
<translation>terminate</translation> <translation>terminate</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="634"/> <location filename="../../dialog.ui" line="719"/>
<source>execute</source> <source>execute</source>
<translation>execute</translation> <translation>execute</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="660"/> <location filename="../../dialog.ui" line="745"/>
<source>clear</source> <source>clear</source>
<translation>clear</translation> <translation>clear</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="313"/> <location filename="../../dialog.ui" line="370"/>
<source>reverse connection</source> <source>reverse connection</source>
<translation>reverse connection</translation> <translation>reverse connection</translation>
</message> </message>
@ -144,57 +185,57 @@
<translation type="vanished">auto enable</translation> <translation type="vanished">auto enable</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="297"/> <location filename="../../dialog.ui" line="354"/>
<source>background record</source> <source>background record</source>
<translation>background record</translation> <translation>background record</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="261"/> <location filename="../../dialog.ui" line="318"/>
<source>screen-off</source> <source>screen-off</source>
<translation>screen-off</translation> <translation>screen-off</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="230"/> <location filename="../../dialog.ui" line="287"/>
<source>apply</source> <source>apply</source>
<translation>apply</translation> <translation>apply</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="85"/> <location filename="../../dialog.ui" line="142"/>
<source>max size:</source> <source>max size:</source>
<translation>max size:</translation> <translation>max size:</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="281"/> <location filename="../../dialog.ui" line="338"/>
<source>always on top</source> <source>always on top</source>
<translation>always on top</translation> <translation>always on top</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="223"/> <location filename="../../dialog.ui" line="280"/>
<source>refresh script</source> <source>refresh script</source>
<translation>refresh script</translation> <translation>refresh script</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="451"/> <location filename="../../dialog.ui" line="536"/>
<source>get device IP</source> <source>get device IP</source>
<translation>get device IP</translation> <translation>get device IP</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="350"/> <location filename="../../dialog.ui" line="407"/>
<source>USB line</source> <source>USB line</source>
<translation>USB line</translation> <translation>USB line</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="406"/> <location filename="../../dialog.ui" line="491"/>
<source>stop server</source> <source>stop server</source>
<translation>stop server</translation> <translation>stop server</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="396"/> <location filename="../../dialog.ui" line="481"/>
<source>start server</source> <source>start server</source>
<translation>start server</translation> <translation>start server</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="386"/> <location filename="../../dialog.ui" line="471"/>
<source>device serial:</source> <source>device serial:</source>
<translation>device serial:</translation> <translation>device serial:</translation>
</message> </message>
@ -203,30 +244,110 @@
<translation type="vanished">Config</translation> <translation type="vanished">Config</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="68"/> <location filename="../../dialog.ui" line="125"/>
<source>bit rate:</source> <source>bit rate:</source>
<translation>bit rate:</translation> <translation>bit rate:</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="461"/> <location filename="../../dialog.ui" line="546"/>
<source>start adbd</source> <source>start adbd</source>
<translation>start adbd</translation> <translation>start adbd</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="441"/> <location filename="../../dialog.ui" line="526"/>
<source>refresh devices</source> <source>refresh devices</source>
<translation>refresh devices</translation> <translation>refresh devices</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.cpp" line="105"/> <location filename="../../dialog.cpp" line="85"/>
<source>show</source>
<translatorcomment>show</translatorcomment>
<translation>show</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="86"/>
<source>quit</source>
<translatorcomment>quit</translatorcomment>
<translation>quit</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="121"/>
<source>original</source> <source>original</source>
<translation>original</translation> <translation>original</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.cpp" line="112"/> <location filename="../../dialog.cpp" line="126"/>
<source>no lock</source> <source>no lock</source>
<translation>no lock</translation> <translation>no lock</translation>
</message> </message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>warning</source>
<translatorcomment>Warning</translatorcomment>
<translation>Warning</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>Quit or set tray?</source>
<translatorcomment>Quit or set tray?</translatorcomment>
<translation>Quit or set tray?</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>Quit</source>
<translatorcomment>Quit</translatorcomment>
<translation>Quit</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>Set tray</source>
<translatorcomment>Set tray</translatorcomment>
<translation>Set tray</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>Cancel</source>
<translatorcomment>Cancel</translatorcomment>
<translation>Cancel</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="253"/>
<source>Notice</source>
<translatorcomment>Notice</translatorcomment>
<translation>Notice</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="254"/>
<source>Hidden here!</source>
<translatorcomment>Hidden here!</translatorcomment>
<translation>Hidden here!</translation>
</message>
</context>
<context>
<name>InputConvertGame</name>
<message>
<location filename="../../device/controller/inputconvert/inputconvertgame.cpp" line="507"/>
<source>current keymap mode: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../device/controller/inputconvert/inputconvertgame.cpp" line="507"/>
<source>custom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../device/controller/inputconvert/inputconvertgame.cpp" line="507"/>
<source>normal</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KeyMap</name>
<message>
<location filename="../../device/controller/inputconvert/keymap/keymap.cpp" line="307"/>
<source>Script updated, current keymap mode:normal, Press ~ key to switch keymap mode</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>QObject</name> <name>QObject</name>
@ -241,7 +362,7 @@ You can download it at the following address:</source>
<translation type="vanished">This software is completely open source and free.\nStrictly used for illegal purposes, or at your own risk.\nYou can download it at the following address:</translation> <translation type="vanished">This software is completely open source and free.\nStrictly used for illegal purposes, or at your own risk.\nYou can download it at the following address:</translation>
</message> </message>
<message> <message>
<location filename="../../main.cpp" line="108"/> <location filename="../../main.cpp" line="109"/>
<source>This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the following address:</source> <source>This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the following address:</source>
<translation>This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the following address:</translation> <translation>This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the following address:</translation>
</message> </message>
@ -337,7 +458,7 @@ You can download it at the following address:</source>
<translation type="vanished">file transfer failed</translation> <translation type="vanished">file transfer failed</translation>
</message> </message>
<message> <message>
<location filename="../../device/ui/videoform.cpp" line="710"/> <location filename="../../device/ui/videoform.cpp" line="749"/>
<source>file does not exist</source> <source>file does not exist</source>
<translation>file does not exist</translation> <translation>file does not exist</translation>
</message> </message>

Binary file not shown.

View file

@ -16,22 +16,22 @@
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="181"/> <location filename="../../device/device.cpp" line="184"/>
<source>install apk</source> <source>install apk</source>
<translation>apk</translation> <translation>apk</translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="183"/> <location filename="../../device/device.cpp" line="186"/>
<source>file transfer</source> <source>file transfer</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="187"/> <location filename="../../device/device.cpp" line="190"/>
<source>wait current %1 to complete</source> <source>wait current %1 to complete</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="190"/> <location filename="../../device/device.cpp" line="193"/>
<source>%1 complete, save in %2</source> <source>%1 complete, save in %2</source>
<translation>%1,%2</translation> <translation>%1,%2</translation>
</message> </message>
@ -41,7 +41,7 @@
<translation type="vanished">%1\n %2</translation> <translation type="vanished">%1\n %2</translation>
</message> </message>
<message> <message>
<location filename="../../device/device.cpp" line="193"/> <location filename="../../device/device.cpp" line="196"/>
<source>%1 failed</source> <source>%1 failed</source>
<translation>%1 </translation> <translation>%1 </translation>
</message> </message>
@ -49,93 +49,134 @@
<context> <context>
<name>Dialog</name> <name>Dialog</name>
<message> <message>
<location filename="../../dialog.ui" line="477"/> <location filename="../../dialog.ui" line="562"/>
<source>Wireless</source> <source>Wireless</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="561"/> <location filename="../../dialog.ui" line="646"/>
<source>wireless connect</source> <source>wireless connect</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="577"/> <location filename="../../dialog.ui" line="662"/>
<source>wireless disconnect</source> <source>wireless disconnect</source>
<translation>线</translation> <translation>线</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="32"/> <location filename="../../dialog.ui" line="89"/>
<source>Start Config</source> <source>Start Config</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="168"/> <location filename="../../dialog.ui" line="225"/>
<source>record save path:</source> <source>record save path:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="185"/> <location filename="../../dialog.ui" line="242"/>
<location filename="../../dialog.cpp" line="338"/> <location filename="../../dialog.cpp" line="449"/>
<source>select path</source> <source>select path</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="99"/> <location filename="../../dialog.ui" line="156"/>
<source>record format</source> <source>record format</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="323"/> <location filename="../../dialog.ui" line="380"/>
<source>record screen</source> <source>record screen</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="268"/> <location filename="../../dialog.ui" line="325"/>
<source>frameless</source> <source>frameless</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="127"/> <location filename="../../dialog.ui" line="32"/>
<source>Use Simple Mode</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
<message>
<location filename="../../dialog.ui" line="42"/>
<source>Simple Mode</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
<message>
<location filename="../../dialog.ui" line="53"/>
<source>WIFI Connect</source>
<translatorcomment>WIFI连接</translatorcomment>
<translation>WIFI连接</translation>
</message>
<message>
<location filename="../../dialog.ui" line="60"/>
<source>USB Connect</source>
<translatorcomment>USB连接</translatorcomment>
<translation>USB连接</translation>
</message>
<message>
<location filename="../../dialog.ui" line="69"/>
<source>Double click to connect:</source>
<translation></translation>
</message>
<message>
<location filename="../../dialog.ui" line="184"/>
<source>lock orientation:</source> <source>lock orientation:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="330"/> <location filename="../../dialog.ui" line="387"/>
<source>show fps</source> <source>show fps</source>
<translation>fps</translation> <translation>fps</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="337"/> <location filename="../../dialog.ui" line="394"/>
<source>stay awake</source> <source>stay awake</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="434"/> <location filename="../../dialog.ui" line="421"/>
<source>device name:</source>
<translatorcomment>:</translatorcomment>
<translation>:</translation>
</message>
<message>
<location filename="../../dialog.ui" line="438"/>
<source>update name</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
<message>
<location filename="../../dialog.ui" line="519"/>
<source>stop all server</source> <source>stop all server</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="611"/> <location filename="../../dialog.ui" line="696"/>
<source>adb command:</source> <source>adb command:</source>
<translation>adb命令</translation> <translation>adb命令</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="647"/> <location filename="../../dialog.ui" line="732"/>
<source>terminate</source> <source>terminate</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="634"/> <location filename="../../dialog.ui" line="719"/>
<source>execute</source> <source>execute</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="660"/> <location filename="../../dialog.ui" line="745"/>
<source>clear</source> <source>clear</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="313"/> <location filename="../../dialog.ui" line="370"/>
<source>reverse connection</source> <source>reverse connection</source>
<translation></translation> <translation></translation>
</message> </message>
@ -144,57 +185,57 @@
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="297"/> <location filename="../../dialog.ui" line="354"/>
<source>background record</source> <source>background record</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="261"/> <location filename="../../dialog.ui" line="318"/>
<source>screen-off</source> <source>screen-off</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="230"/> <location filename="../../dialog.ui" line="287"/>
<source>apply</source> <source>apply</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="85"/> <location filename="../../dialog.ui" line="142"/>
<source>max size:</source> <source>max size:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="281"/> <location filename="../../dialog.ui" line="338"/>
<source>always on top</source> <source>always on top</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="223"/> <location filename="../../dialog.ui" line="280"/>
<source>refresh script</source> <source>refresh script</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="451"/> <location filename="../../dialog.ui" line="536"/>
<source>get device IP</source> <source>get device IP</source>
<translation>IP</translation> <translation>IP</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="350"/> <location filename="../../dialog.ui" line="407"/>
<source>USB line</source> <source>USB line</source>
<translation>USB线</translation> <translation>USB线</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="406"/> <location filename="../../dialog.ui" line="491"/>
<source>stop server</source> <source>stop server</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="396"/> <location filename="../../dialog.ui" line="481"/>
<source>start server</source> <source>start server</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="386"/> <location filename="../../dialog.ui" line="471"/>
<source>device serial:</source> <source>device serial:</source>
<translation></translation> <translation></translation>
</message> </message>
@ -203,30 +244,110 @@
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="68"/> <location filename="../../dialog.ui" line="125"/>
<source>bit rate:</source> <source>bit rate:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="461"/> <location filename="../../dialog.ui" line="546"/>
<source>start adbd</source> <source>start adbd</source>
<translation>adbd</translation> <translation>adbd</translation>
</message> </message>
<message> <message>
<location filename="../../dialog.ui" line="441"/> <location filename="../../dialog.ui" line="526"/>
<source>refresh devices</source> <source>refresh devices</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.cpp" line="105"/> <location filename="../../dialog.cpp" line="85"/>
<source>show</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
<message>
<location filename="../../dialog.cpp" line="86"/>
<source>quit</source>
<translatorcomment>退</translatorcomment>
<translation>退</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="121"/>
<source>original</source> <source>original</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../../dialog.cpp" line="112"/> <location filename="../../dialog.cpp" line="126"/>
<source>no lock</source> <source>no lock</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>warning</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>Quit or set tray?</source>
<translatorcomment>退</translatorcomment>
<translation>退</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>Quit</source>
<translatorcomment>退</translatorcomment>
<translation>退</translation>
</message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>Set tray</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
<message>
<location filename="../../dialog.cpp" line="243"/>
<source>Cancel</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
<message>
<location filename="../../dialog.cpp" line="253"/>
<source>Notice</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
<message>
<location filename="../../dialog.cpp" line="254"/>
<source>Hidden here!</source>
<translatorcomment></translatorcomment>
<translation></translation>
</message>
</context>
<context>
<name>InputConvertGame</name>
<message>
<location filename="../../device/controller/inputconvert/inputconvertgame.cpp" line="507"/>
<source>current keymap mode: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../device/controller/inputconvert/inputconvertgame.cpp" line="507"/>
<source>custom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../device/controller/inputconvert/inputconvertgame.cpp" line="507"/>
<source>normal</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>KeyMap</name>
<message>
<location filename="../../device/controller/inputconvert/keymap/keymap.cpp" line="307"/>
<source>Script updated, current keymap mode:normal, Press ~ key to switch keymap mode</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>QObject</name> <name>QObject</name>
@ -241,7 +362,7 @@ You can download it at the following address:</source>
<translation type="vanished">.\n严禁用于非法用途.\n你可以在下面地址下载:</translation> <translation type="vanished">.\n严禁用于非法用途.\n你可以在下面地址下载:</translation>
</message> </message>
<message> <message>
<location filename="../../main.cpp" line="108"/> <location filename="../../main.cpp" line="109"/>
<source>This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the following address:</source> <source>This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the following address:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
@ -337,7 +458,7 @@ You can download it at the following address:</source>
<translation type="vanished"></translation> <translation type="vanished"></translation>
</message> </message>
<message> <message>
<location filename="../../device/ui/videoform.cpp" line="710"/> <location filename="../../device/ui/videoform.cpp" line="749"/>
<source>file does not exist</source> <source>file does not exist</source>
<translation></translation> <translation></translation>
</message> </message>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -2,7 +2,7 @@
<qresource prefix="/"> <qresource prefix="/">
<file>font/fontawesome-webfont.ttf</file> <file>font/fontawesome-webfont.ttf</file>
<file>image/videoform/phone-h.png</file> <file>image/videoform/phone-h.png</file>
<file>image/videoform/phone-v.png</file> <file>image/videoform/phone-v.png</file>
<file>qss/psblack.css</file> <file>qss/psblack.css</file>
<file>qss/psblack/add_bottom.png</file> <file>qss/psblack/add_bottom.png</file>
<file>qss/psblack/add_left.png</file> <file>qss/psblack/add_left.png</file>
@ -24,5 +24,6 @@
<file>qss/psblack/radiobutton_unchecked_disable.png</file> <file>qss/psblack/radiobutton_unchecked_disable.png</file>
<file>i18n/QtScrcpy_en.qm</file> <file>i18n/QtScrcpy_en.qm</file>
<file>i18n/QtScrcpy_zh.qm</file> <file>i18n/QtScrcpy_zh.qm</file>
<file>image/tray/logo.png</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -9,6 +9,7 @@ MagneticWidget::MagneticWidget(QWidget *adsorbWidget, AdsorbPositions adsorbPos)
Q_ASSERT(m_adsorbWidget); Q_ASSERT(m_adsorbWidget);
setParent(m_adsorbWidget); setParent(m_adsorbWidget);
setWindowFlags(windowFlags() | Qt::Tool); setWindowFlags(windowFlags() | Qt::Tool);
m_adsorbWidgetSize = m_adsorbWidget->size();
m_adsorbWidget->installEventFilter(this); m_adsorbWidget->installEventFilter(this);
} }
@ -30,6 +31,10 @@ bool MagneticWidget::eventFilter(QObject *watched, QEvent *event)
if (watched != m_adsorbWidget || !event) { if (watched != m_adsorbWidget || !event) {
return false; return false;
} }
// 始终记录adsorbWidget最新size
if (QEvent::Resize == event->type()) {
m_adsorbWidgetSize = m_adsorbWidget->size();
}
if (m_adsorbed && QEvent::Move == event->type()) { if (m_adsorbed && QEvent::Move == event->type()) {
move(m_adsorbWidget->pos() - m_relativePos); move(m_adsorbWidget->pos() - m_relativePos);
} }
@ -48,7 +53,7 @@ bool MagneticWidget::eventFilter(QObject *watched, QEvent *event)
pos.setY(pos.y() - m_relativePos.y()); pos.setY(pos.y() - m_relativePos.y());
break; break;
case AP_OUTSIDE_RIGHT: case AP_OUTSIDE_RIGHT:
pos.setX(pos.x() + m_adsorbWidget->width()); pos.setX(pos.x() + m_adsorbWidgetSize.width());
pos.setY(pos.y() - m_relativePos.y()); pos.setY(pos.y() - m_relativePos.y());
break; break;
case AP_OUTSIDE_TOP: case AP_OUTSIDE_TOP:
@ -165,8 +170,8 @@ void MagneticWidget::moveEvent(QMoveEvent *event)
void MagneticWidget::getGeometry(QRect &relativeWidgetRect, QRect &targetWidgetRect) void MagneticWidget::getGeometry(QRect &relativeWidgetRect, QRect &targetWidgetRect)
{ {
relativeWidgetRect.setTopLeft(m_adsorbWidget->pos()); relativeWidgetRect.setTopLeft(m_adsorbWidget->pos());
relativeWidgetRect.setWidth(m_adsorbWidget->width()); relativeWidgetRect.setWidth(m_adsorbWidgetSize.width());
relativeWidgetRect.setHeight(m_adsorbWidget->height()); relativeWidgetRect.setHeight(m_adsorbWidgetSize.height());
targetWidgetRect.setTopLeft(pos()); targetWidgetRect.setTopLeft(pos());
targetWidgetRect.setWidth(width()); targetWidgetRect.setWidth(width());

View file

@ -46,6 +46,9 @@ private:
QPoint m_relativePos; QPoint m_relativePos;
bool m_adsorbed = false; bool m_adsorbed = false;
QPointer<QWidget> m_adsorbWidget; QPointer<QWidget> m_adsorbWidget;
// 单独记录adsorbWidgetSize因为Widget setGeometry的时候会先收到Move事件后收到Resize事件
// 但是收到Move事件时Widget的size()已经是setGeometry指定的size了
QSize m_adsorbWidgetSize;
AdsorbPosition m_curAdsorbPosition; AdsorbPosition m_curAdsorbPosition;
}; };

View file

@ -1,6 +1,7 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QFileInfo> #include <QFileInfo>
#include <QSettings> #include <QSettings>
#include <QDebug>
#include "config.h" #include "config.h"
@ -43,7 +44,7 @@
#define COMMON_CODEC_NAME_KEY "CodecName" #define COMMON_CODEC_NAME_KEY "CodecName"
#define COMMON_CODEC_NAME_DEF "-" #define COMMON_CODEC_NAME_DEF "-"
// user data // user config
#define COMMON_RECORD_KEY "RecordPath" #define COMMON_RECORD_KEY "RecordPath"
#define COMMON_RECORD_DEF "" #define COMMON_RECORD_DEF ""
@ -56,16 +57,44 @@
#define COMMON_RECORD_FORMAT_INDEX_KEY "RecordFormatIndex" #define COMMON_RECORD_FORMAT_INDEX_KEY "RecordFormatIndex"
#define COMMON_RECORD_FORMAT_INDEX_DEF 0 #define COMMON_RECORD_FORMAT_INDEX_DEF 0
#define COMMON_LOCK_ORIENTATION_INDEX_KEY "LockDirectionIndex"
#define COMMON_LOCK_ORIENTATION_INDEX_DEF 0
#define COMMON_RECORD_SCREEN_KEY "RecordScreen"
#define COMMON_RECORD_SCREEN_DEF false
#define COMMON_RECORD_BACKGROUD_KEY "RecordBackGround"
#define COMMON_RECORD_BACKGROUD_DEF false
#define COMMON_REVERSE_CONNECT_KEY "ReverseConnect"
#define COMMON_REVERSE_CONNECT_DEF true
#define COMMON_SHOW_FPS_KEY "ShowFPS"
#define COMMON_SHOW_FPS_DEF false
#define COMMON_WINDOW_ON_TOP_KEY "WindowOnTop"
#define COMMON_WINDOW_ON_TOP_DEF false
#define COMMON_AUTO_OFF_SCREEN_KEY "AutoOffScreen"
#define COMMON_AUTO_OFF_SCREEN_DEF false
#define COMMON_FRAMELESS_WINDOW_KEY "FramelessWindow"
#define COMMON_FRAMELESS_WINDOW_DEF false
#define COMMON_KEEP_ALIVE_KEY "KeepAlive"
#define COMMON_KEEP_ALIVE_DEF false
#define COMMON_SIMPLE_MODE_KEY "SimpleMode"
#define COMMON_SIMPLE_MODE_DEF false
// device config
#define SERIAL_WINDOW_RECT_KEY_X "WindowRectX" #define SERIAL_WINDOW_RECT_KEY_X "WindowRectX"
#define SERIAL_WINDOW_RECT_KEY_Y "WindowRectY" #define SERIAL_WINDOW_RECT_KEY_Y "WindowRectY"
#define SERIAL_WINDOW_RECT_KEY_W "WindowRectW" #define SERIAL_WINDOW_RECT_KEY_W "WindowRectW"
#define SERIAL_WINDOW_RECT_KEY_H "WindowRectH" #define SERIAL_WINDOW_RECT_KEY_H "WindowRectH"
#define SERIAL_WINDOW_RECT_KEY_DEF -1 #define SERIAL_WINDOW_RECT_KEY_DEF -1
#define SERIAL_NICK_NAME_KEY "NickName"
#define COMMON_FRAMELESS_WINDOW_KEY "FramelessWindow" #define SERIAL_NICK_NAME_DEF "Phone"
#define COMMON_FRAMELESS_WINDOW_DEF false
// 最大尺寸 录制格式
QString Config::s_configPath = ""; QString Config::s_configPath = "";
@ -76,6 +105,8 @@ Config::Config(QObject *parent) : QObject(parent)
m_userData = new QSettings(getConfigPath() + "/userdata.ini", QSettings::IniFormat); m_userData = new QSettings(getConfigPath() + "/userdata.ini", QSettings::IniFormat);
m_userData->setIniCodec("UTF-8"); m_userData->setIniCodec("UTF-8");
qDebug()<<m_userData->childGroups();
} }
Config &Config::getInstance() Config &Config::getInstance()
@ -97,68 +128,47 @@ const QString &Config::getConfigPath()
return s_configPath; return s_configPath;
} }
QString Config::getRecordPath() void Config::setUserBootConfig(const UserBootConfig &config)
{ {
QString record;
m_userData->beginGroup(GROUP_COMMON); m_userData->beginGroup(GROUP_COMMON);
record = m_userData->value(COMMON_RECORD_KEY, COMMON_RECORD_DEF).toString(); m_userData->setValue(COMMON_RECORD_KEY, config.recordPath);
m_userData->setValue(COMMON_BITRATE_INDEX_KEY, config.bitRateIndex);
m_userData->setValue(COMMON_MAX_SIZE_INDEX_KEY, config.maxSizeIndex);
m_userData->setValue(COMMON_RECORD_FORMAT_INDEX_KEY, config.recordFormatIndex);
m_userData->setValue(COMMON_FRAMELESS_WINDOW_KEY, config.framelessWindow);
m_userData->setValue(COMMON_LOCK_ORIENTATION_INDEX_KEY, config.lockOrientationIndex);
m_userData->setValue(COMMON_RECORD_SCREEN_KEY, config.recordScreen);
m_userData->setValue(COMMON_RECORD_BACKGROUD_KEY, config.recordBackground);
m_userData->setValue(COMMON_REVERSE_CONNECT_KEY, config.reverseConnect);
m_userData->setValue(COMMON_SHOW_FPS_KEY, config.showFPS);
m_userData->setValue(COMMON_WINDOW_ON_TOP_KEY, config.windowOnTop);
m_userData->setValue(COMMON_AUTO_OFF_SCREEN_KEY, config.autoOffScreen);
m_userData->setValue(COMMON_KEEP_ALIVE_KEY, config.keepAlive);
m_userData->setValue(COMMON_SIMPLE_MODE_KEY, config.simpleMode);
m_userData->endGroup(); m_userData->endGroup();
return record; m_userData->sync();
} }
void Config::setRecordPath(const QString &path) UserBootConfig Config::getUserBootConfig()
{ {
UserBootConfig config;
m_userData->beginGroup(GROUP_COMMON); m_userData->beginGroup(GROUP_COMMON);
m_userData->setValue(COMMON_RECORD_KEY, path); config.recordPath = m_userData->value(COMMON_RECORD_KEY, COMMON_RECORD_DEF).toString();
m_userData->endGroup(); config.bitRateIndex = m_userData->value(COMMON_BITRATE_INDEX_KEY, COMMON_BITRATE_INDEX_DEF).toInt();
} config.maxSizeIndex = m_userData->value(COMMON_MAX_SIZE_INDEX_KEY, COMMON_MAX_SIZE_INDEX_DEF).toInt();
config.recordFormatIndex = m_userData->value(COMMON_RECORD_FORMAT_INDEX_KEY, COMMON_RECORD_FORMAT_INDEX_DEF).toInt();
int Config::getBitRateIndex() config.lockOrientationIndex = m_userData->value(COMMON_LOCK_ORIENTATION_INDEX_KEY, COMMON_LOCK_ORIENTATION_INDEX_DEF).toInt();
{ config.framelessWindow = m_userData->value(COMMON_FRAMELESS_WINDOW_KEY, COMMON_FRAMELESS_WINDOW_DEF).toBool();
int bitRateIndex; config.recordScreen = m_userData->value(COMMON_RECORD_SCREEN_KEY, COMMON_RECORD_SCREEN_DEF).toBool();
m_userData->beginGroup(GROUP_COMMON); config.recordBackground = m_userData->value(COMMON_RECORD_BACKGROUD_KEY, COMMON_RECORD_BACKGROUD_DEF).toBool();
bitRateIndex = m_userData->value(COMMON_BITRATE_INDEX_KEY, COMMON_BITRATE_INDEX_DEF).toInt(); config.reverseConnect = m_userData->value(COMMON_REVERSE_CONNECT_KEY, COMMON_REVERSE_CONNECT_DEF).toBool();
m_userData->endGroup(); config.showFPS = m_userData->value(COMMON_SHOW_FPS_KEY, COMMON_SHOW_FPS_DEF).toBool();
return bitRateIndex; config.windowOnTop = m_userData->value(COMMON_WINDOW_ON_TOP_KEY, COMMON_WINDOW_ON_TOP_DEF).toBool();
} config.autoOffScreen = m_userData->value(COMMON_AUTO_OFF_SCREEN_KEY, COMMON_AUTO_OFF_SCREEN_DEF).toBool();
config.keepAlive = m_userData->value(COMMON_KEEP_ALIVE_KEY, COMMON_KEEP_ALIVE_DEF).toBool();
void Config::setBitRateIndex(int bitRateIndex) config.simpleMode = m_userData->value(COMMON_SIMPLE_MODE_KEY, COMMON_SIMPLE_MODE_DEF).toBool();
{
m_userData->beginGroup(GROUP_COMMON);
m_userData->setValue(COMMON_BITRATE_INDEX_KEY, bitRateIndex);
m_userData->endGroup();
}
int Config::getMaxSizeIndex()
{
int maxSizeIndex;
m_userData->beginGroup(GROUP_COMMON);
maxSizeIndex = m_userData->value(COMMON_MAX_SIZE_INDEX_KEY, COMMON_MAX_SIZE_INDEX_DEF).toInt();
m_userData->endGroup();
return maxSizeIndex;
}
void Config::setMaxSizeIndex(int maxSizeIndex)
{
m_userData->beginGroup(GROUP_COMMON);
m_userData->setValue(COMMON_MAX_SIZE_INDEX_KEY, maxSizeIndex);
m_userData->endGroup();
}
int Config::getRecordFormatIndex()
{
int recordFormatIndex;
m_userData->beginGroup(GROUP_COMMON);
recordFormatIndex = m_userData->value(COMMON_RECORD_FORMAT_INDEX_KEY, COMMON_RECORD_FORMAT_INDEX_DEF).toInt();
m_userData->endGroup();
return recordFormatIndex;
}
void Config::setRecordFormatIndex(int recordFormatIndex)
{
m_userData->beginGroup(GROUP_COMMON);
m_userData->setValue(COMMON_RECORD_FORMAT_INDEX_KEY, recordFormatIndex);
m_userData->endGroup(); m_userData->endGroup();
return config;
} }
void Config::setRect(const QString &serial, const QRect &rc) void Config::setRect(const QString &serial, const QRect &rc)
@ -184,20 +194,21 @@ QRect Config::getRect(const QString &serial)
return rc; return rc;
} }
void Config::setFramelessWindow(bool frameless) void Config::setNickName(const QString &serial, const QString &name)
{ {
m_userData->beginGroup(GROUP_COMMON); m_userData->beginGroup(serial);
m_userData->setValue(COMMON_FRAMELESS_WINDOW_KEY, frameless); m_userData->setValue(SERIAL_NICK_NAME_KEY, name);
m_userData->endGroup(); m_userData->endGroup();
m_userData->sync();
} }
bool Config::getFramelessWindow() QString Config::getNickName(const QString &serial)
{ {
bool framelessWindow = false; QString name;
m_userData->beginGroup(GROUP_COMMON); m_userData->beginGroup(serial);
framelessWindow = m_userData->value(COMMON_FRAMELESS_WINDOW_KEY, COMMON_FRAMELESS_WINDOW_DEF).toBool(); name = m_userData->value(SERIAL_NICK_NAME_KEY, SERIAL_NICK_NAME_DEF).toString();
m_userData->endGroup(); m_userData->endGroup();
return framelessWindow; return name;
} }
QString Config::getServerVersion() QString Config::getServerVersion()
@ -301,6 +312,16 @@ QString Config::getCodecName()
return codecName; return codecName;
} }
QStringList Config::getConnectedGroups()
{
return m_userData->childGroups();
}
void Config::deleteGroup(const QString &serial)
{
m_userData->remove(serial);
}
QString Config::getTitle() QString Config::getTitle()
{ {
QString title; QString title;

View file

@ -1,16 +1,36 @@
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
#include <QObject> #include <QObject>
#include <QPointer> #include <QPointer>
#include <QRect> #include <QRect>
struct UserBootConfig
{
QString recordPath = "";
int bitRateIndex = 0;
int maxSizeIndex = 0;
int recordFormatIndex = 0;
int lockOrientationIndex = 0;
bool recordScreen = false;
bool recordBackground = false;
bool reverseConnect = true;
bool showFPS = false;
bool windowOnTop = false;
bool autoOffScreen = false;
bool framelessWindow = false;
bool keepAlive = false;
bool simpleMode = false;
};
class QSettings; class QSettings;
class Config : public QObject class Config : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
static Config &getInstance(); static Config &getInstance();
// config // config
QString getTitle(); QString getTitle();
QString getServerVersion(); QString getServerVersion();
@ -24,20 +44,19 @@ public:
QString getLogLevel(); QString getLogLevel();
QString getCodecOptions(); QString getCodecOptions();
QString getCodecName(); QString getCodecName();
QStringList getConnectedGroups();
// user data // user data:common
QString getRecordPath(); void setUserBootConfig(const UserBootConfig &config);
void setRecordPath(const QString &path); UserBootConfig getUserBootConfig();
int getBitRateIndex();
void setBitRateIndex(int bitRateIndex); // user data:device
int getMaxSizeIndex(); void setNickName(const QString &serial, const QString &name);
void setMaxSizeIndex(int maxSizeIndex); QString getNickName(const QString &serial);
int getRecordFormatIndex();
void setRecordFormatIndex(int recordFormatIndex);
void setRect(const QString &serial, const QRect &rc); void setRect(const QString &serial, const QRect &rc);
QRect getRect(const QString &serial); QRect getRect(const QString &serial);
bool getFramelessWindow();
void setFramelessWindow(bool frameless); void deleteGroup(const QString &serial);
private: private:
explicit Config(QObject *parent = nullptr); explicit Config(QObject *parent = nullptr);

View file

@ -124,7 +124,9 @@ you can [build it by yourself](##Build)(just ubuntu test)
## Run ## Run
### Simple Mode
Connect to your Android device on your computer, then run the program and click `USB connect` or `WiFi connect`
### Not Simple Mode
Connect to your Android device on your computer, then run the program and click the button below to connect to the Android device. Connect to your Android device on your computer, then run the program and click the button below to connect to the Android device.
![run](screenshot/run.png) ![run](screenshot/run.png)
@ -260,7 +262,7 @@ All the dependencies are provided and it is easy to compile.
## Licence ## Licence
Since it is based on scrcpy, respect its Licence Since it is based on scrcpy, respect its Licence
Copyright (C) 2020 Barry Copyright (C) 2025 Rankun
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View file

@ -128,7 +128,9 @@ Mac OS平台你可以直接使用我编译好的可执行程序:
目前只在ubuntu上测试过 目前只在ubuntu上测试过
## 运行 ## 运行
### 精简模式
在你的电脑上接入Android设备然后运行程序点击`一键USB连接`或者`一键WIFI连接`
### 非精简模式
在你的电脑上接入Android设备然后运行程序按顺序点击如下按钮即可连接到Android设备 在你的电脑上接入Android设备然后运行程序按顺序点击如下按钮即可连接到Android设备
![运行](screenshot/run.png) ![运行](screenshot/run.png)
@ -256,7 +258,7 @@ Mac OS平台你可以直接使用我编译好的可执行程序:
## Licence ## Licence
由于是复刻的scrcpy尊重它的Licence 由于是复刻的scrcpy尊重它的Licence
Copyright (C) 2020 Barry Copyright (C) 2025 Rankun
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.