mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-07-29 20:28:38 +00:00
feat: add try check
This commit is contained in:
parent
7282c70e0d
commit
ef4280f7ff
3 changed files with 21 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -45,6 +45,7 @@ private:
|
|||
void moveCenter();
|
||||
void installShortcut();
|
||||
QRect getScreenRect();
|
||||
bool checkTrialExpire();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue