@@ -89,7 +89,7 @@ QLabel *TLled[PROFILES_COUNT];
8989QLabel *TRled[PROFILES_COUNT];
9090QComboBox *irSens[PROFILES_COUNT];
9191QComboBox *runMode[PROFILES_COUNT];
92- QCheckBox *layoutMode[PROFILES_COUNT];
92+ QComboBox *layoutMode[PROFILES_COUNT];
9393QPushButton *color[PROFILES_COUNT];
9494QPushButton *renameBtn[PROFILES_COUNT];
9595
@@ -195,23 +195,23 @@ guiWindow::guiWindow(QWidget *parent)
195195 TRled[i] = new QLabel (" 0" );
196196 irSens[i] = new QComboBox ();
197197 runMode[i] = new QComboBox ();
198- layoutMode[i] = new QCheckBox ();
198+ layoutMode[i] = new QComboBox ();
199199 color[i] = new QPushButton ();
200- topOffset[i]->setAlignment (Qt::AlignHCenter );
201- bottomOffset[i]->setAlignment (Qt::AlignHCenter );
202- leftOffset[i]->setAlignment (Qt::AlignHCenter );
203- rightOffset[i]->setAlignment (Qt::AlignHCenter );
204- TLled[i]->setAlignment (Qt::AlignHCenter );
205- TRled[i]->setAlignment (Qt::AlignHCenter );
200+ topOffset[i]->setAlignment (Qt::AlignCenter );
201+ bottomOffset[i]->setAlignment (Qt::AlignCenter );
202+ leftOffset[i]->setAlignment (Qt::AlignCenter );
203+ rightOffset[i]->setAlignment (Qt::AlignCenter );
204+ TLled[i]->setAlignment (Qt::AlignCenter );
205+ TRled[i]->setAlignment (Qt::AlignCenter );
206206 irSens[i]->addItem (" Default" );
207207 irSens[i]->addItem (" Higher" );
208208 irSens[i]->addItem (" Highest" );
209209 connect (irSens[i], SIGNAL (activated (int )), this , SLOT (irBoxes_activated (int )));
210210 runMode[i]->addItem (" Normal" );
211211 runMode[i]->addItem (" 1-Frame Avg" );
212212 runMode[i]->addItem (" 2-Frame Avg" );
213- layoutMode[i]->setToolTip ( " Unticked is for the default double lightbar 'square' IR arrangement. \n Ticked is for the GUN4IR-compatible 'diamond' IR arrangement. " );
214- connect (layoutMode[i], SIGNAL (stateChanged (int )), this , SLOT (layoutToggles_stateChanged (int )));
213+ layoutMode[i]->addItems ({ " Square " , " Diamond " } );
214+ connect (layoutMode[i], SIGNAL (activated (int )), this , SLOT (layoutBoxes_activated (int )));
215215 connect (runMode[i], SIGNAL (activated (int )), this , SLOT (runModeBoxes_activated (int )));
216216 color[i]->setFixedWidth (32 );
217217 connect (color[i], SIGNAL (clicked ()), this , SLOT (colorBoxes_clicked ()));
@@ -297,6 +297,9 @@ guiWindow::guiWindow(QWidget *parent)
297297 // hiding tUSB elements by default since this can't be done from default
298298 ui->tUSBLayoutAdvanced ->setVisible (false );
299299
300+ // set hidden by default until a board with presets is loaded
301+ ui->presetsBox ->setHidden (true );
302+
300303 // Finally get to the thing!
301304 aliveTimer = new QTimer ();
302305 connect (aliveTimer, &QTimer::timeout, this , &guiWindow::aliveTimer_timeout);
@@ -407,7 +410,7 @@ void guiWindow::SerialLoad()
407410 TRled[i]->setText (buffer[5 ]), profilesTable[i].TRled = buffer[5 ].toFloat (), profilesTable_orig[i].TRled = profilesTable[i].TRled ;
408411 profilesTable[i].irSensitivity = buffer[6 ].toInt (), profilesTable_orig[i].irSensitivity = profilesTable[i].irSensitivity , irSens[i]->setCurrentIndex (profilesTable[i].irSensitivity ), irSensOldIndex[i] = profilesTable[i].irSensitivity ;
409412 profilesTable[i].runMode = buffer[7 ].toInt (), profilesTable_orig[i].runMode = profilesTable[i].runMode , runMode[i]->setCurrentIndex (profilesTable[i].runMode ), runModeOldIndex[i] = profilesTable[i].runMode ;
410- layoutMode[i]->setChecked (buffer[8 ].toInt ()), profilesTable[i].layoutType = buffer[8 ].toInt (), profilesTable_orig[i].layoutType = profilesTable[i].layoutType ;
413+ layoutMode[i]->setCurrentIndex (buffer[8 ].toInt ()), profilesTable[i].layoutType = buffer[8 ].toInt (), profilesTable_orig[i].layoutType = profilesTable[i].layoutType ;
411414 color[i]->setStyleSheet (QString (" background-color: #%1" ).arg (buffer[9 ].toLong (), 6 , 16 , QLatin1Char (' 0' ))), profilesTable[i].color = buffer[9 ].toLong (), profilesTable_orig[i].color = profilesTable[i].color ;
412415 selectedProfile[i]->setText (buffer[10 ]), profilesTable[i].profName = buffer[10 ], profilesTable_orig[i].profName = profilesTable[i].profName ;
413416 }
@@ -1405,8 +1408,9 @@ void guiWindow::BoxesFill()
14051408 pinBoxes[i]->insertSeparator (periphSCL);
14061409 }
14071410 }
1411+ ui->presetsBox ->clear ();
14081412 if (boardCustomPresetsCount[board.type ]) {
1409- ui->presetsBox ->clear ( );
1413+ ui->presetsBox ->setHidden ( false );
14101414 switch (board.type ) {
14111415 case rpipico:
14121416 case rpipicow:
@@ -1420,6 +1424,8 @@ void guiWindow::BoxesFill()
14201424 default :
14211425 ui->presetsBox ->setEnabled (false );
14221426 }
1427+ } else {
1428+ ui->presetsBox ->setHidden (true );
14231429 }
14241430 BoxesUpdate ();
14251431}
@@ -1596,9 +1602,9 @@ void guiWindow::colorBoxes_clicked()
15961602}
15971603
15981604
1599- void guiWindow::layoutToggles_stateChanged (int arg1)
1605+ void guiWindow::layoutBoxes_activated (int arg1)
16001606{
1601- // Demultiplexing to figure out which tick we're using.
1607+ // Demultiplexing to figure out which box we're using.
16021608 uint8_t slot;
16031609 QObject* obj = sender ();
16041610 for (uint8_t i = 0 ;;i++) {
0 commit comments