Skip to content

Commit

Permalink
refactor: 适配3.0.2的电源接口
Browse files Browse the repository at this point in the history
  • Loading branch information
barry committed Dec 7, 2024
1 parent 723b4ef commit 8e8df04
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions QtScrcpy/groupcontroller/groupcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void GroupController::postCut()
}
}

void GroupController::setScreenPowerMode(bool open)
void GroupController::setDisplayPower(bool on)
{
for (const auto& serial : m_devices) {
if (true == isHost(serial)) {
Expand All @@ -273,7 +273,7 @@ void GroupController::setScreenPowerMode(bool open)
continue;
}

device->setScreenPowerMode(open);
device->setDisplayPower(on);
}
}

Expand Down
2 changes: 1 addition & 1 deletion QtScrcpy/groupcontroller/groupcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class GroupController : public QObject, public qsc::DeviceObserver
void postVolumeDown() override;
void postCopy() override;
void postCut() override;
void setScreenPowerMode(bool open) override;
void setDisplayPower(bool on) override;
void expandNotificationPanel() override;
void collapsePanel() override;
void postBackOrScreenOn(bool down) override;
Expand Down
4 changes: 2 additions & 2 deletions QtScrcpy/ui/toolform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void ToolForm::on_closeScreenBtn_clicked()
if (!device) {
return;
}
device->setScreenPowerMode(false);
device->setDisplayPower(false);
}

void ToolForm::on_expandNotifyBtn_clicked()
Expand Down Expand Up @@ -221,5 +221,5 @@ void ToolForm::on_openScreenBtn_clicked()
if (!device) {
return;
}
device->setScreenPowerMode(true);
device->setDisplayPower(true);
}
2 changes: 1 addition & 1 deletion QtScrcpy/ui/videoform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void VideoForm::installShortcut()
if (!device) {
return;
}
emit device->setScreenPowerMode(false);
emit device->setDisplayPower(false);
});

// expandNotificationPanel
Expand Down

0 comments on commit 8e8df04

Please sign in to comment.