Mercurial > public > ostc_companion
diff MainWindow.cpp @ 5:115cfa4a3239 default tip
Added icon upload function for OSTC 4/5
For the upload the same process as the one for the firmware update is used => CRC functionality has been copied from the ostc_pack SW
| author | Ideenmodellierer |
|---|---|
| date | Tue, 30 Dec 2025 21:41:02 +0100 |
| parents | e30f00f760d3 |
| children |
line wrap: on
line diff
--- a/MainWindow.cpp Sun Nov 30 18:37:32 2025 +0100 +++ b/MainWindow.cpp Tue Dec 30 21:41:02 2025 +0100 @@ -294,15 +294,15 @@ // ON when supported but NOT connected, OFF once connected. _ui->upgradeButton->setEnabled( ok - && (_op->supported() & HardwareOperations::FIRMWARE) + && (_op->supported() & HardwareOperations::CompanionFeatures(HardwareOperations::FIRMWARE)) && !_op->serial().isOpen()); // Only allow buttons when connected: ok &= _op->serial().isOpen(); - _ui->dateButton ->setEnabled( ok && (_op->supported() & HardwareOperations::DATE) ); - _ui->nameButton ->setEnabled( ok && (_op->supported() & HardwareOperations::NAME) ); - _ui->iconButton ->setEnabled( ok && (_op->supported() & HardwareOperations::ICON) ); - _ui->signalButton ->setEnabled( ok && (_op->supported() & HardwareOperations::SIGNAL_CHECK) ); + _ui->dateButton ->setEnabled(ok && _op->supported().testFlag(HardwareOperations::DATE)); + _ui->nameButton ->setEnabled(ok && _op->supported().testFlag(HardwareOperations::NAME)); + _ui->iconButton ->setEnabled(ok);// && _op->supported().testFlag(HardwareOperations::ICON)); + _ui->signalButton->setEnabled(ok && _op->supported().testFlag(HardwareOperations::SIGNAL_CHECK)); _ui->closeButton ->setEnabled( ok ); } @@ -411,13 +411,8 @@ QString fileName = QFileDialog::getOpenFileName(this, "Icon File...", QString(), - "Images (*.gif *.png *.tif *.tiff *.jpg *.jpeg *.ico *.svg);;" - "GIF Image (*.gif);;" - "PNG Image (*.png);;" - "TIFF Image (*.tif *.tiff);;" - "JPEG Image (*.jpg *.jpeg);;" - "Icon Image (*.ico);;" - "SVG Image (*.svg);;" + "Images (*.bmp);;" + "BMP Image (*.bmp);;" "Anything (*.*)"); if( ! fileName.isEmpty() ) _op->setIcons(fileName);
