Merge pull request #277 from barry-ran/dev

Dev
This commit is contained in:
Barry 2020-08-30 13:08:56 +08:00 committed by GitHub
commit d45c9b03f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 6 deletions

View file

@ -16,7 +16,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
qt-ver: [5.15.0]
qt-ver: [5.15.1]
qt-arch-install: [clang_64]
clang-arch: [x64]
env:

View file

@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-16.04,ubuntu-18.04]
qt-ver: [5.15.0]
qt-ver: [5.15.1]
qt-arch-install: [gcc_64]
gcc-arch: [x64]
env:

View file

@ -22,7 +22,7 @@ jobs:
# 矩阵配置 https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
strategy:
matrix:
qt-ver: [5.15.0]
qt-ver: [5.15.1]
qt-arch: [win64_msvc2019_64, win32_msvc2019]
# 配置qt-arch的额外设置msvc-archqt-arch-install
include:

View file

@ -48,6 +48,10 @@ HEADERS += \
FORMS += \
dialog.ui
# 试用检查
# DEFINES += TRIAL_EXPIRE_CHECK
DEFINES += TRIAL_TIMES=10
# 子工程
include ($$PWD/common/common.pri)
include ($$PWD/adb/adb.pri)

View file

@ -343,6 +343,16 @@ QRect VideoForm::getScreenRect()
return screenRect;
}
bool VideoForm::checkTrialExpire()
{
static int trialTimes = 0;
if (++trialTimes > TRIAL_TIMES) {
QMessageBox::warning(this, "QtScrcpy", QStringLiteral("试用已结束,购买正式版本请联系作者"), QMessageBox::Ok);
return true;
}
return false;
}
void VideoForm::updateStyleSheet(bool vertical)
{
if (vertical) {
@ -500,6 +510,12 @@ void VideoForm::setDevice(Device *device)
void VideoForm::mousePressEvent(QMouseEvent *event)
{
#ifdef TRIAL_EXPIRE_CHECK
if (checkTrialExpire()) {
return;
}
#endif
if (event->button() == Qt::MiddleButton) {
if (m_device && !m_device->isCurrentCustomKeymap()) {
emit m_device->postGoHome();

View file

@ -45,6 +45,7 @@ private:
void moveCenter();
void installShortcut();
QRect getScreenRect();
bool checkTrialExpire();
protected:
void mousePressEvent(QMouseEvent *event);

View file

@ -7,7 +7,7 @@
#include "server.h"
#include "videoform.h"
#define DM_MAX_DEVICES_NUM 16
#define DM_MAX_DEVICES_NUM 1000
DeviceManage::DeviceManage(QObject *parent) : QObject(parent) {}

View file

@ -8,8 +8,6 @@
![license](https://img.shields.io/badge/license-Apache2.0-blue.svg)
![release](https://img.shields.io/github/v/release/barry-ran/QtScrcpy.svg)
<a href="https://tracking.gitads.io/?repo=QtScrcpy"><img src="https://images.gitads.io/QtScrcpy" alt="GitAds"/></a>
[中文介绍](README_zh.md)
QtScrcpy connects to Android devices via USB (or via TCP/IP) for display and control. It does NOT require the root privileges.