void PlayMusicWindow::songsChanged() { Song* currentSong = player->getCurrentSong(); if (currentSong != NULL) { ui->lblCurrentCoverBackground->setVisible(true); ui->lblCurrentCover->setVisible(true); if (currentSong->getCoverArtFilename() != currentCoverFile) { ui->lblCurrentCover->setPixmap(QPixmap(":/theme/gen/RES/loader.png")); coverHelper->getPathForCover(currentSong->getCoverArtFilename()); currentCoverFile = currentSong->getCoverArtFilename(); } if (!player->isStopped()) { enableAll(); wasPlaying = true; } else { makePlayButton(); enablePlay(); disableControls(); } ui->lblCurrentSong->setText(QString::fromStdString(currentSong->getArtistName() + " - " + currentSong->getSongName())); } else { ui->lblCurrentCoverBackground->setVisible(false); ui->lblCurrentCover->setVisible(false); ui->lblCurrentSong->setText("No song playing"); makePlayButton(); enablePlay(); disableControls(); } Song* songBefore = player->getSongBefore(); if (songBefore != NULL) { ui->lblCoverBeforeBackground->setVisible(true); ui->lblBeforeCover->setVisible(true); if (songBefore->getCoverArtFilename() != prevCoverFile) { ui->lblBeforeCover->setPixmap(QPixmap(":/theme/gen/RES/loader.png")); coverHelper->getPathForCover(songBefore->getCoverArtFilename()); prevCoverFile = songBefore->getCoverArtFilename(); } ui->btnPrev->setEnabled(true); } else { ui->lblCoverBeforeBackground->setVisible(false); ui->lblBeforeCover->setVisible(false); ui->btnPrev->setEnabled(false); } Song* songAfter = player->getSongAfter(); if (songAfter != NULL) { ui->lblCoverAfterBackground->setVisible(true); ui->lblAfterCover->setVisible(true); if (songAfter->getCoverArtFilename() != nextCoverFile) { ui->lblAfterCover->setPixmap(QPixmap(":/theme/gen/RES/loader.png")); coverHelper->getPathForCover(songAfter->getCoverArtFilename()); nextCoverFile = songAfter->getCoverArtFilename(); } ui->btnNext->setEnabled(true); } else { ui->lblCoverAfterBackground->setVisible(false); ui->lblAfterCover->setVisible(false); ui->btnNext->setEnabled(false); } }
// ****************************************************************************************** // Changes the table to show or hide collisions that are not disabled (that have collision checking enabled) // ****************************************************************************************** void DefaultCollisionsWidget::collisionCheckboxToggle() { // Show Progress bar disableControls( true ); // Now update collision table with updates loadCollisionTable(); // Hide Progress bar disableControls( false ); }
LayersSettings::LayersSettings(QWidget *parent, FANN::neural_net *net, bool isNewNet, Qt::WindowFlags flags) : QWidget(parent, flags), Ui::LayersSettings(), net(net) { assert(net && "Illegal program state, net uninitialized"); setupUi(this); populateComboBox(networkTypeCombo, FANN::NET_TYPES, "NetworkTypes", 2); if (isNewNet == 0) { loadData(); disableControls(); } std::auto_ptr<StrictIntValidator> i1(new StrictIntValidator(1, 999, neuronCountEdit)), i2(new StrictIntValidator(1, 999, inputNeuronsEdit)), i3(new StrictIntValidator(1, 999, outputNeuronsEdit)); connect(hiddenLayersSpin, SIGNAL(valueChanged(int)), this, SLOT(layersNumberChanged(const int))); connect(networkTypeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(networkTypeChanged(int))); connect(neuronCountEdit, SIGNAL(textChanged(const QString&)), this, SLOT(neuronsNumberChanged(const QString&))); connect(layerNumberCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(layersChoiceChanged(const int))); neuronCountEdit->setValidator(i1.release()); inputNeuronsEdit->setValidator(i2.release()); outputNeuronsEdit->setValidator(i3.release()); }
void PositioningMethodSerialPortOptions::onTest(bool ATest) { if (ATest) { ui->console->clear(); PortSettings portSettings; portSettings.FBaudRate = QSerialPort::BaudRate(ui->cmbBaudRate->itemData(ui->cmbBaudRate->currentIndex()).toInt()); portSettings.FDataBits = QSerialPort::DataBits(ui->cmbDataBits->itemData(ui->cmbDataBits->currentIndex()).toInt()); portSettings.FStopBits = QSerialPort::StopBits(ui->cmbStopBits->itemData(ui->cmbStopBits->currentIndex()).toInt()); portSettings.FParity = QSerialPort::Parity(ui->cmbParity->itemData(ui->cmbParity->currentIndex()).toInt()); portSettings.FFlowControl = QSerialPort::FlowControl(ui->cmbFlowControl->itemData(ui->cmbFlowControl->currentIndex()).toInt()); ReaderSettings readerSettings; readerSettings.FName = ui->cmbPortName->currentText(); readerSettings.FSize = ui->spbBufferSize->value(); readerSettings.FTimeout = ui->spbTimeout->value(); readerSettings.FTimeTreshold = ui->spbTimeTreshold->value(); readerSettings.FDistanceTreshold = ui->spbDistanceTreshold->value(); FSerialPort->startReadPort(readerSettings, portSettings); if (FSerialPort->reader()) { connect(FSerialPort->reader(),SIGNAL(portRead(QByteArray)),SLOT(onPortRead(QByteArray))); connect(FSerialPort->reader(),SIGNAL(finished(int)),SLOT(onPortReadFinished(int))); disableControls(true); } else {
void PositioningMethodSerialPortOptions::onPortReadFinished(int AErrorCode) { disableControls(false); ui->pbTest->setChecked(false); ui->pbTest->setDisabled(false); if(AErrorCode == QSerialPort::NoError) ui->lblWait->clear(); else ui->lblWait->setText(tr("Error %1").arg(AErrorCode)); }
// ****************************************************************************************** // Called when setup assistant navigation switches to this screen // ****************************************************************************************** void DefaultCollisionsWidget::focusGiven() { // Convert the SRDF data to LinkPairData format linkPairsFromSRDF(); // Load the data to the table loadCollisionTable(); // Enable the table disableControls( false ); }
void CMod_SellerApp::showConfigDialog() { AFX_MANAGE_STATE(AfxGetStaticModuleState()); if (!m_configDialog) { m_configDialog = new CConfigDialog(this); m_configDialog->Create(IDD_CONFIG); configToControls(); if (m_started) disableControls(); else enableControls(); m_configDialog->m_enable.SetCheck(m_started); } m_configDialog->ShowWindow(SW_SHOW); }
void GPControlView::on_runbutton_clicked() { emit start(); for (int noCar = 0; noCar < gpControl->getNbCars(); noCar++) { gpControl->setDriverPath(noCar, driverSelectors[noCar].getDriverPath()); } disableControls(); QObject::connect(gpControl, SIGNAL(end(QString)), this, SLOT(gpControl_end(QString))); QObject::connect(gpControl, SIGNAL(carMoved()), this, SLOT(gpControl_carMoved())); QObject::connect(gpControl, SIGNAL(carMovedWithBoost()), this, SLOT(gpControl_carMovedWithBoost())); QObject::connect(gpControl, SIGNAL(invalidMove()), this, SLOT(gpControl_invalidMove())); QObject::connect(gpControl, SIGNAL(syntaxError()), this, SLOT(gpControl_syntaxError())); QObject::connect(gpControl, SIGNAL(driverTimeout()), this, SLOT(gpControl_driverTimeout())); gpControl->nextMove(); }
void PlayMusicWindow::refreshPlayPause() { if (player->isPlaying()) { enableAll(); songsChanged(); makePauseButton(); on_sldVolume_valueChanged(ui->sldVolume->value()); ui->lblCurrentState->setText("Playing"); wasPlaying = true; } else if (player->isPaused()) { enableAll(); songsChanged(); makePlayButton(); wasPlaying = true; ui->lblCurrentState->setText("Paused"); } else if (player->isStarting()) { disableControls(); disablePlay(); ui->lblCurrentState->setText("Starting..."); } else if (player->isStopped()) { makePlayButton(); ui->lblCurrentState->setText("Stopped"); wasPlaying = false; } }