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 af6cde6619
8 changed files with 25 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -343,6 +343,16 @@ QRect VideoForm::getScreenRect()
return screenRect; 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) void VideoForm::updateStyleSheet(bool vertical)
{ {
if (vertical) { if (vertical) {
@ -500,6 +510,12 @@ void VideoForm::setDevice(Device *device)
void VideoForm::mousePressEvent(QMouseEvent *event) void VideoForm::mousePressEvent(QMouseEvent *event)
{ {
#ifdef TRIAL_EXPIRE_CHECK
if (checkTrialExpire()) {
return;
}
#endif
if (event->button() == Qt::MiddleButton) { if (event->button() == Qt::MiddleButton) {
if (m_device && !m_device->isCurrentCustomKeymap()) { if (m_device && !m_device->isCurrentCustomKeymap()) {
emit m_device->postGoHome(); emit m_device->postGoHome();

View file

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

View file

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

View file

@ -8,8 +8,6 @@
![license](https://img.shields.io/badge/license-Apache2.0-blue.svg) ![license](https://img.shields.io/badge/license-Apache2.0-blue.svg)
![release](https://img.shields.io/github/v/release/barry-ran/QtScrcpy.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) [中文介绍](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. QtScrcpy connects to Android devices via USB (or via TCP/IP) for display and control. It does NOT require the root privileges.