@@ -69,6 +69,10 @@ void BleDev::keyPressEvent(QKeyEvent *event)
6969 {
7070 DeviceDetector::instance ().shiftPressed ();
7171 }
72+ if (event->key () == Qt::Key_Control)
73+ {
74+ DeviceDetector::instance ().ctrlPressed ();
75+ }
7276}
7377
7478void BleDev::keyReleaseEvent (QKeyEvent *event)
@@ -77,6 +81,10 @@ void BleDev::keyReleaseEvent(QKeyEvent *event)
7781 {
7882 DeviceDetector::instance ().shiftReleased ();
7983 }
84+ if (event->key () == Qt::Key_Control)
85+ {
86+ DeviceDetector::instance ().ctrlReleased ();
87+ }
8088}
8189
8290void BleDev::initUITexts ()
@@ -179,11 +187,16 @@ void BleDev::on_btnFileBrowser_clicked()
179187 }
180188 QSettings s;
181189
190+ bool skipFilePwdCheck = wsClient->get_status () == Common::NoBundle &&
191+ DeviceDetector::instance ().isCtrlPressed ();
192+
182193 QString fileName = QFileDialog::getOpenFileName (this , tr (" Select bundle file" ),
183194 s.value (" last_used_path/bundle_dir" , QDir::homePath ()).toString (),
184195 " *.img" );
185196
197+ // Due to file selection dialog opened, release events are not catched
186198 DeviceDetector::instance ().shiftReleased ();
199+ DeviceDetector::instance ().ctrlReleased ();
187200
188201 if (fileName.isEmpty ())
189202 {
@@ -211,8 +224,9 @@ void BleDev::on_btnFileBrowser_clicked()
211224 }
212225
213226 QString password = " " ;
214- if (!checkBundleFilePassword (QFileInfo{file}, password))
227+ if (!skipFilePwdCheck && ! checkBundleFilePassword (QFileInfo{file}, password))
215228 {
229+ qCritical () << " Invalid bundle file password" ;
216230 return ;
217231 }
218232
0 commit comments