Mercurial > public > ostc_companion
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 4:e30f00f760d3 | 5:115cfa4a3239 |
|---|---|
| 292 bool ok = _op; | 292 bool ok = _op; |
| 293 _ui->connectButton->setEnabled( ok ); | 293 _ui->connectButton->setEnabled( ok ); |
| 294 | 294 |
| 295 // ON when supported but NOT connected, OFF once connected. | 295 // ON when supported but NOT connected, OFF once connected. |
| 296 _ui->upgradeButton->setEnabled( ok | 296 _ui->upgradeButton->setEnabled( ok |
| 297 && (_op->supported() & HardwareOperations::FIRMWARE) | 297 && (_op->supported() & HardwareOperations::CompanionFeatures(HardwareOperations::FIRMWARE)) |
| 298 && !_op->serial().isOpen()); | 298 && !_op->serial().isOpen()); |
| 299 | 299 |
| 300 // Only allow buttons when connected: | 300 // Only allow buttons when connected: |
| 301 ok &= _op->serial().isOpen(); | 301 ok &= _op->serial().isOpen(); |
| 302 _ui->dateButton ->setEnabled( ok && (_op->supported() & HardwareOperations::DATE) ); | 302 _ui->dateButton ->setEnabled(ok && _op->supported().testFlag(HardwareOperations::DATE)); |
| 303 _ui->nameButton ->setEnabled( ok && (_op->supported() & HardwareOperations::NAME) ); | 303 _ui->nameButton ->setEnabled(ok && _op->supported().testFlag(HardwareOperations::NAME)); |
| 304 _ui->iconButton ->setEnabled( ok && (_op->supported() & HardwareOperations::ICON) ); | 304 _ui->iconButton ->setEnabled(ok);// && _op->supported().testFlag(HardwareOperations::ICON)); |
| 305 _ui->signalButton ->setEnabled( ok && (_op->supported() & HardwareOperations::SIGNAL_CHECK) ); | 305 _ui->signalButton->setEnabled(ok && _op->supported().testFlag(HardwareOperations::SIGNAL_CHECK)); |
| 306 _ui->closeButton ->setEnabled( ok ); | 306 _ui->closeButton ->setEnabled( ok ); |
| 307 } | 307 } |
| 308 | 308 |
| 309 ////////////////////////////////////////////////////////////////////////////// | 309 ////////////////////////////////////////////////////////////////////////////// |
| 310 | 310 |
| 409 LOG_INFO(tr("Settings icons...")); | 409 LOG_INFO(tr("Settings icons...")); |
| 410 | 410 |
| 411 QString fileName = QFileDialog::getOpenFileName(this, | 411 QString fileName = QFileDialog::getOpenFileName(this, |
| 412 "Icon File...", | 412 "Icon File...", |
| 413 QString(), | 413 QString(), |
| 414 "Images (*.gif *.png *.tif *.tiff *.jpg *.jpeg *.ico *.svg);;" | 414 "Images (*.bmp);;" |
| 415 "GIF Image (*.gif);;" | 415 "BMP Image (*.bmp);;" |
| 416 "PNG Image (*.png);;" | |
| 417 "TIFF Image (*.tif *.tiff);;" | |
| 418 "JPEG Image (*.jpg *.jpeg);;" | |
| 419 "Icon Image (*.ico);;" | |
| 420 "SVG Image (*.svg);;" | |
| 421 "Anything (*.*)"); | 416 "Anything (*.*)"); |
| 422 if( ! fileName.isEmpty() ) | 417 if( ! fileName.isEmpty() ) |
| 423 _op->setIcons(fileName); | 418 _op->setIcons(fileName); |
| 424 } | 419 } |
| 425 catch(const std::exception& e) { | 420 catch(const std::exception& e) { |
