diff --git a/src/items/itemstore.cpp b/src/items/itemstore.cpp index 2a335f8..8584eae 100644 --- a/src/items/itemstore.cpp +++ b/src/items/itemstore.cpp @@ -56,10 +56,15 @@ void ItemStore::jsReqNewItem() { if(!oldItem || *items_[i] == *oldItem) { - if(i+1 < items_.size()) - joystick->setItem(items_[i+1]); - else - joystick->setItem(items_[0]); + for(size_t j = 1; j < items_.size(); ++j) + { + std::shared_ptr item = items_[(i+j) % items_.size()]; + if(dynamic_cast(item.get())) + { + joystick->setItem(item); + break; + } + } break; } } diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 7f7d361..71fb464 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -25,6 +25,8 @@ MainWindow::MainWindow(Microcontroller * const micro, ItemStore* items, QWidget } connect(ui->relayList, &ItemScrollBox::deleteRequest, items, &ItemStore::removeItem); + + ui->pushButton_addItem->hide(); } MainWindow::~MainWindow() diff --git a/src/ui/signalwidget.cpp b/src/ui/signalwidget.cpp index 443d7f0..17550ec 100644 --- a/src/ui/signalwidget.cpp +++ b/src/ui/signalwidget.cpp @@ -34,6 +34,9 @@ SignalWidget::SignalWidget(std::weak_ptr item, QWidget *parent) : }); connect(signal.get(), &Item::valueChanged, this, &SignalWidget::moveToValue); + + if(!signal->hasSlow()) + ui->radioButton_slow->hide(); } } else