diff --git a/tools/camflasher/dialogs.py b/tools/camflasher/dialogs.py index b60acf6..571c1ed 100644 --- a/tools/camflasher/dialogs.py +++ b/tools/camflasher/dialogs.py @@ -143,7 +143,13 @@ def accept(self): def on_firmware_clicked(self, event): """ Selection of firmware button clicked """ - firmware = QFileDialog.getOpenFileName(self, caption='Select firmware file', directory=str(Path.home()),filter="Firmware files (*.bin)") + path = str(Path.home()) + if self.dialog.firmware.maxCount() > 0: + firmware = self.dialog.firmware.currentText() + if os.path.exists(firmware): + path = os.path.split(firmware)[0] + + firmware = QFileDialog.getOpenFileName(self, caption='Select firmware file', directory=path, filter="Firmware files (*.bin)") if firmware != ('', ''): for i in range(self.dialog.firmware.count()): if self.dialog.firmware.itemText(i) == firmware[0]: