diff --git a/dde-bluetooth-dialog/src/main.cpp b/dde-bluetooth-dialog/src/main.cpp index 60e68258..8f356c0d 100644 --- a/dde-bluetooth-dialog/src/main.cpp +++ b/dde-bluetooth-dialog/src/main.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2016 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -19,6 +19,7 @@ DCORE_USE_NAMESPACE const int PingCode = 1; const int DevicePath = 2; const int PingTime = 3; +const int CancelBtnState = 4; int main(int argc, char *argv[]) { @@ -35,9 +36,14 @@ int main(int argc, char *argv[]) qDebug() << "number of parameters must be greater than 3"; return -1; } - qDebug() << "PingCode:" << arguslist[PingCode] << " Device Path:" << arguslist[DevicePath] << "Ping Time:" + arguslist[PingTime]; + auto cancelable = true; + if (arguslist.size() >= 5) { + cancelable = arguslist[CancelBtnState] == "true"; + } + qDebug() << "PingCode:" << arguslist[PingCode] << " Device Path:" << arguslist[DevicePath] << "Ping Time:" + arguslist[PingTime] + << "isCancelBtnShown:" << cancelable; - PinCodeDialog dialog(arguslist[PingCode], arguslist[DevicePath], arguslist[PingTime], true); + PinCodeDialog dialog(arguslist[PingCode], arguslist[DevicePath], arguslist[PingTime], cancelable); #if (defined QT_DEBUG) && (defined CHECK_ACCESSIBLENAME) AccessibilityCheckerEx checker; checker.setOutputFormat(DAccessibilityChecker::FullFormat);