Exemplo n.º 1
0
void CMainWindow::on_pbPlayPause_clicked(bool) {
    playing = !playing;

    if(playing) {
        timerParams.curTemps = 1;
        timerParams.curMeasure = 1;
        timerParams.nbMute = spMute->value();
        timerParams.nbMuteOver = spMuteOver->value();
        timerParams.timerValue = 0;
        realTime = 0;
        timerParams.nbBeat = spNbBeat->value();
        timerParams.nbDiv = spNbDiv->value();
        timerParams.nbTemps = timerParams.nbBeat * timerParams.nbDiv;
        timerParams.pads = &pads;

        enableControls(false);

        pbPlayPause->setIcon(QIcon(":/qtdrum/resources/images/stop.png"));

        startPOSIXTimer(ONE_MINUTE / spTempo->value() / timerParams.nbDiv);

        realTimeTimer->start();
    }else {
        realTimeTimer->stop();

        ssTemps->setValue(0);
        taTimer->setValues(0, 0);

        enableControls(true);

        pbPlayPause->setIcon(QIcon(":/qtdrum/resources/images/play.png"));

        stopPOSIXTimer();
    }
}
Exemplo n.º 2
0
void ImportIconsWizard::menuSelection(MythUIButtonListItem *item)
{
    if (!item)
        return;

    SearchEntry entry = item->GetData().value<SearchEntry>();

    LOG(VB_GENERAL, LOG_INFO, QString("Menu Selection: %1 %2 %3")
        .arg(entry.strID) .arg(entry.strName) .arg(entry.strLogo));

    enableControls(STATE_SEARCHING);

    CSVEntry entry2 = (*m_missingIter);
    m_strMatches += QString("%1,%2,%3,%4,%5,%6,%7,%8,%9\n")
                    .arg(escape_csv(entry.strID))
                    .arg(escape_csv(entry2.strName))
                    .arg(escape_csv(entry2.strXmlTvId))
                    .arg(escape_csv(entry2.strCallsign))
                    .arg(escape_csv(entry2.strTransportId))
                    .arg(escape_csv(entry2.strAtscMajorChan))
                    .arg(escape_csv(entry2.strAtscMinorChan))
                    .arg(escape_csv(entry2.strNetworkId))
                    .arg(escape_csv(entry2.strServiceId));

    if (checkAndDownload(entry.strLogo, entry2.strChanId))
    {
        m_statusText->SetText(tr("Icon for %1 was downloaded successfully.")
                              .arg(entry2.strName));
    }
    else
    {
        m_statusText->SetText(tr("Failed to download the icon for %1.")
                              .arg(entry2.strName));
    }

    if (m_missingMaxCount > 1)
    {
        m_missingCount++;
        m_missingIter++;
        if (!doLoad())
        {
            if (!m_strMatches.isEmpty())
                askSubmit(m_strMatches);
            else
                Close();
        }
    }
    else
    {
        enableControls(STATE_DISABLED);

        SetFocusWidget(m_iconsList);
        if (!m_strMatches.isEmpty())
            askSubmit(m_strMatches);
        else
            Close();
    }

}
Exemplo n.º 3
0
void ImagePropertyDialog::onFilePathChanged(const QString &path)
{
	QImage tmpImage(path);

	if(tmpImage.isNull()){
		enableControls(false, tmpImage);
	}else{
		enableControls(true, tmpImage);
	}
}
Exemplo n.º 4
0
void MidiConverterDialog::on_startButton_clicked() {
	if (ui->pcmList->count() == 0) {
		if (batchMode) {
			((QWidget *)parent())->close();
			return;
		}
		enableControls(true);
		return;
	}
	enableControls(false);
	ui->pcmList->setCurrentRow(0);
	const QStringList midiFileNames = getMidiFileNames();
	if (!converter.convertMIDIFiles(ui->pcmList->currentItem()->text(), midiFileNames, ui->profileComboBox->currentText())) enableControls(true);
}
void StaticStreamViewport::StaticStreamComponent::buttonClicked( Button* button)
{
	ScopedLock locker(lock);

	if (&startButton == button)
	{
		tree.setProperty(Identifiers::Active, true, nullptr);
		client->setStreamProperty(tree.getParent().getType(), tree[Identifiers::Index], Identifiers::Active, true);
		enableControls(true);
		return;
	}

#if FAULT_INJECTION_1722
	if (&faultButton == button)
	{
		if (tree.getParent().isValid())
		{
			FaultInjectionCallout * callout = new FaultInjectionCallout(tree.getParent(), lock, client);
			CallOutBox::launchAsynchronously(callout, button->getScreenBounds(), nullptr);
		}
		return;
	}
#endif

	if (&stopButton == button)
	{
		tree.setProperty(Identifiers::Active, false, nullptr);
		client->setStreamProperty(tree.getParent().getType(), tree[Identifiers::Index], Identifiers::Active, false);
		enableControls(false);
		return;
	}

	if (&clockReferenceButton == button)
	{
		int subtype = (button->getToggleState()) ? AVTP_SUBTYPE_CRS : AVTP_SUBTYPE_AUDIO;
		tree.setProperty(Identifiers::Subtype, subtype, nullptr);
		client->setStreamProperty(tree.getParent().getType(), tree[Identifiers::Index], Identifiers::Subtype, subtype);
		return;
	}

	if (&autoStartButton == button)
	{
		bool autostart = button->getToggleState();
		tree.setProperty(Identifiers::AutoStart, autostart, nullptr);
		client->setStreamProperty(tree.getParent().getType(), tree[Identifiers::Index], Identifiers::AutoStart, autostart);\
		return;
	}
}
Exemplo n.º 6
0
bool GuiCompareHistory::initialiseParams(std::string const &)
{
	string revstring = lyxview().currentBufferView()->buffer().lyxvc().revisionInfo(LyXVC::File);
	int rev=0;

	string tmp;
	// RCS case
	if (!isStrInt(revstring))
		revstring = rsplit(revstring, tmp , '.' );
	if (isStrInt(revstring))
		rev = convert<int>(revstring);

	okPB->setEnabled(rev);
	rev1SB->setMaximum(rev);
	rev2SB->setMaximum(rev);
	revbackSB->setMaximum(rev-1);
	rev2SB->setValue(rev);
	rev1SB->setValue(rev-1);

	//bc().setPolicy(ButtonPolicy::OkApplyCancelPolicy);
	//bc().setOK(okPB);
	//bc().setCancel(cancelPB);
	enableControls();
	return true;
}
Exemplo n.º 7
0
/* ////////////////////////////////////////////////////////////////////////////
 * Close the current project and free used resources.
 * Disable navigation.
 */
void TTMpeg2MainWnd::closeProject()
{
  if (!isProjectOpen)
    return;

  isProjectOpen = false;

  enableControls(false);
  scroller->setValue(0);
  videoFileInfo->clearControl();
  frameInfo->clearControl();
  currentFrame->closeVideoStream();

  // clean up used resources
  if (mpegStream != NULL)
  {
    delete mpegStream;
    mpegStream = NULL;
  }

  if (videoType != NULL)
  {
    delete videoType;
    videoType = NULL;
  }

  videoIndexList  = NULL;
  videoHeaderList = NULL;
}
void
PrefsRunProgramWidget::changeExecutable() {
  Q_D(PrefsRunProgramWidget);

  auto filters = QStringList{};

#if defined(SYS_WINDOWS)
  filters << QY("Executable files") + Q(" (*.exe *.bat *.cmd)");
#endif
  filters << QY("All files") + Q(" (*)");

  auto realExecutable = Util::replaceMtxVariableWithApplicationDirectory(d->executable);
  auto newExecutable  = Util::getOpenFileName(this, QY("Select executable"), realExecutable, filters.join(Q(";;")));
  newExecutable       = QDir::toNativeSeparators(Util::replaceApplicationDirectoryWithMtxVariable(newExecutable));

  if (newExecutable.isEmpty() || (newExecutable == d->executable))
    return;

  changeArguments([&newExecutable](QStringList &arguments) {
    if (arguments.isEmpty())
      arguments << newExecutable;
    else
      arguments[0] = newExecutable;
  });

  d->executable = newExecutable;

  enableControls();

  emit titleChanged();
}
TEST(chatpresenter, test_incomingMessages)
{
    Poco::SharedPtr<MockChatService> m(new MockChatService);

    Mvp::Presenter::TextChatPresenter presenter(m.get());
    Poco::SharedPtr<MockChatView> v(new MockChatView());
    EXPECT_CALL(*v, initialize());

    ON_CALL(*m, getParticipants())
        .WillByDefault(Return(contacts));
    ON_CALL(*m, messageHistory(_))
        .WillByDefault(Return(messages));

    EXPECT_CALL(*m, chatName());
    EXPECT_CALL(*v, setChatTitle(_));
    EXPECT_CALL(*m, messageHistory(_));
    EXPECT_CALL(*m, isConsumer());
    EXPECT_CALL(*v, enableControls(_));
    EXPECT_CALL(*v, showLeaveAction(_));
    EXPECT_CALL(*m, getParticipants());
    EXPECT_CALL(*v, setParticipants(_));
    presenter.setView(v.get());

    EXPECT_CALL(*v, showView());
    presenter.showView();

    EXPECT_CALL(*v, addMessage(_));
    m->triggerIncomingMessage();
}
Exemplo n.º 10
0
void ImagePropertyDialog::init(Image *img)
{
	this->img = img;

	//Initialize FileEditLine
	felPath = new FileEditLine(img->getFilePath());

	//Initialize QVBoxLayout
	mainLayout = new QVBoxLayout();

	//LabeledComboBox
	lcbImageFormats = new LabeledComboBox("Formatos", img->getFormats());

	felPath->setFilter("All image formats (*.bmp *.png *.jpg *.gif);; Bitmap BMP (*.bmp);; Portable Network Graphic PNG (*.png);; JPEG image (*.jpg);; GIF image (*.gif)");
	felPath->setSelectedFilter("All image formats (*.bmp *.png *.jpg *.gif)");

	if(img->getImage()->isNull()){
		lcbImageFormats->getComboBox()->setCurrentIndex(0);
	}else{
		lcbImageFormats->getComboBox()->setCurrentIndex(img->getImage()->format()-1);
	}

	mainLayout->addWidget(felPath);
	mainLayout->addWidget(lcbImageFormats);

	getMainWindow()->centralWidget()->setLayout(mainLayout);

	if(img->getImage()->isNull()){
		enableControls(false, QImage());
	}

	connect(this, SIGNAL(accepted()), SLOT(accept()));
	connect(felPath->getLineEdit(), SIGNAL(textChanged(QString)), SLOT(onFilePathChanged(QString)));
}
Exemplo n.º 11
0
/* ////////////////////////////////////////////////////////////////////////////
 * Default constructor
 */
TTMpeg2MainWnd::TTMpeg2MainWnd()
  :QMainWindow()
{
  setupUi(this);

  // some default values
  currentStreamOrder = -1;
  isProjectOpen      = false;
  sliderUpdateFrame  = false;

  enableControls(false);

  // Conect signals from main menu
  connect(actionFileOpen,  SIGNAL(triggered()), videoFileInfo, SLOT(onFileOpen()));
  connect(actionAnalyze,   SIGNAL(triggered()), SLOT(onAnalyze()));
  connect(actionSettings,  SIGNAL(triggered()), SLOT(onSettings()));
  connect(actionExit,      SIGNAL(triggered()), SLOT(onExit()));

  connect(actionWriteHeaderList, SIGNAL(triggered()), SLOT(onWriteHeaderList()));

  // Connect signals from video file info widget
  connect(videoFileInfo,  SIGNAL(fileOpened(QString)), SLOT(onLoadVideoFile(QString)));

  // Connect signals from the step control widget
  connect(stepControl,    SIGNAL(gotoNextFrame(int, int)), SLOT(onGotoNextFrame(int, int)));
  connect(stepControl,    SIGNAL(gotoPrevFrame(int, int)), SLOT(onGotoPrevFrame(int, int)));

  // Scroller
  connect(scroller,       SIGNAL(valueChanged(int)), SLOT(onSliderValueChanged(int)));
}
Exemplo n.º 12
0
bool ImportIconsWizard::doLoad()
{
    LOG(VB_CHANNEL, LOG_INFO, QString("Icons: Found %1 / Missing %2")
        .arg(m_missingCount).arg(m_missingMaxCount));

    // skip over empty entries
    while (m_missingIter != m_missingEntries.end() &&
            (*m_missingIter).strName.isEmpty())
    {
        m_missingCount++;
        m_missingIter++;
    }

    if (m_missingIter == m_missingEntries.end())
    {
        LOG(VB_CHANNEL, LOG_INFO, "doLoad Icon search complete");
        enableControls(STATE_DISABLED);
        return false;
    }

    // Look for the next missing icon
    m_nameText->SetText(tr("Choose icon for channel %1")
                        .arg((*m_missingIter).strName));
    m_manualEdit->SetText((*m_missingIter).strName);
    if (!search((*m_missingIter).strName))
        m_statusText->SetText(tr("No matches found for %1")
                              .arg((*m_missingIter).strName));
    else
        m_statusText->Reset();

    return true;
}
void FSPanelClassifieds::processProperties(void* data, EAvatarProcessorType type)
{
	if(APT_CLASSIFIEDS == type)
	{
		LLAvatarClassifieds* c_info = static_cast<LLAvatarClassifieds*>(data);
		if(c_info && getAvatarId() == c_info->target_id)
		{
			// do not clear classified list in case we will receive two or more data packets.
			// list has been cleared in updateData(). (fix for EXT-6436)

			LLAvatarClassifieds::classifieds_list_t::const_iterator it = c_info->classifieds_list.begin();
			for(; c_info->classifieds_list.end() != it; ++it)
			{
				LLAvatarClassifieds::classified_data c_data = *it;

				FSClassifiedItem* c_item = new FSClassifiedItem(getAvatarId(), c_data.classified_id);
				c_item->childSetAction("info_chevron", boost::bind(&FSPanelClassifieds::onClickInfo, this));
				c_item->setClassifiedName(c_data.name);

				LLSD pick_value = LLSD();
				pick_value.insert(CLASSIFIED_ID, c_data.classified_id);
				pick_value.insert(CLASSIFIED_NAME, c_data.name);

				if (!findClassifiedById(c_data.classified_id))
				{
					mClassifiedsList->addItem(c_item, pick_value);
				}

				c_item->setDoubleClickCallback(boost::bind(&FSPanelClassifieds::onDoubleClickClassifiedItem, this, _1));
				c_item->setRightMouseUpCallback(boost::bind(&FSPanelClassifieds::onRightMouseUpItem, this, _1, _2, _3, _4));
				c_item->setMouseUpCallback(boost::bind(&FSPanelClassifieds::updateButtons, this));
			}

			resetDirty();
			updateButtons();
		}
		
		mNoClassifieds = !mClassifiedsList->size();

        bool no_data = mNoClassifieds;
        mNoItemsLabel->setVisible(no_data);
        if (no_data)
        {
            if(getAvatarId() == gAgentID)
            {
                mNoItemsLabel->setValue(LLTrans::getString("NoClassifiedsText"));
            }
            else
            {
                mNoItemsLabel->setValue(LLTrans::getString("NoAvatarClassifiedsText"));
            }
        }

        enableControls();
	}
}
void
PrefsRunProgramWidget::typeChanged(int index) {
  Q_D(PrefsRunProgramWidget);

  auto type = static_cast<Util::Settings::RunProgramType>(d->ui->cbType->itemData(index).value<int>());
  showPageForType(type);

  emit titleChanged();

  enableControls();
}
Exemplo n.º 15
0
void GPControlView::on_gpMapSelector_mapSelected(const QString &mapPath)
{
    if (gpControl->setMap(mapPath)) {
        emit mapChanged(gpControl);
        enableControls();
    } else {
        QMessageBox msg(this);
        msg.setText(tr("Invalid map, please choose another one."));
        msg.exec();
    }
}
ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
{
    m_telemetry = new Ui_CC_HW_Widget();
    m_telemetry->setupUi(this);

    ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance();
    Core::Internal::GeneralSettings * settings=pm->getObject<Core::Internal::GeneralSettings>();
    if(!settings->useExpertMode())
        m_telemetry->saveTelemetryToRAM->setVisible(false);


    UAVObjectUtilManager* utilMngr = pm->getObject<UAVObjectUtilManager>();
    int id = utilMngr->getBoardModel();

    switch (id) {
    case 0x0101:
        m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0101.svg"));
        break;
    case 0x0301:
        m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0301.svg"));
        break;
    case 0x0401:
        m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg"));
        break;
    case 0x0402:
        m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg"));
        break;
    case 0x0201:
        m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0201.svg"));
        break;
    default:
        m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg"));
        break;
    }
    addApplySaveButtons(m_telemetry->saveTelemetryToRAM,m_telemetry->saveTelemetryToSD);
    addUAVObjectToWidgetRelation("HwCopterControl","FlexiPort",m_telemetry->cbFlexi);
    addUAVObjectToWidgetRelation("HwCopterControl","MainPort",m_telemetry->cbTele);
    addUAVObjectToWidgetRelation("HwCopterControl","RcvrPort",m_telemetry->cbRcvr);
    addUAVObjectToWidgetRelation("HwCopterControl","USB_HIDPort",m_telemetry->cbUsbHid);
    addUAVObjectToWidgetRelation("HwCopterControl","USB_VCPPort",m_telemetry->cbUsbVcp);
    addUAVObjectToWidgetRelation("ModuleSettings","TelemetrySpeed",m_telemetry->telemetrySpeed);
    addUAVObjectToWidgetRelation("ModuleSettings","GPSSpeed",m_telemetry->gpsSpeed);
    addUAVObjectToWidgetRelation("ModuleSettings","ComUsbBridgeSpeed",m_telemetry->comUsbBridgeSpeed);

    // Load UAVObjects to widget relations from UI file
    // using objrelation dynamic property
    autoLoadWidgets();

    connect(m_telemetry->cchwHelp,SIGNAL(clicked()),this,SLOT(openHelp()));
    enableControls(false);
    populateWidgets();
    refreshWidgetsValues();
    forceConnectedState();
}
Exemplo n.º 17
0
void WelcomeDialog::verifyAccountDone(bool succeeded, const CString& errorMessage)
{
    if (succeeded) {
        updateUserSettings();
        QDialog::accept();
    } else {
        QMessageBox::critical(this, "", errorMessage);
    }

    enableControls(true);
}
void StaticStreamViewport::StaticStreamComponent::valueTreePropertyChanged( ValueTree& treeWhosePropertyHasChanged, const Identifier& property )
{
	ScopedLock locker(lock);

	DBG("StaticStreamViewport::StaticStreamComponent::valueTreePropertyChanged " + treeWhosePropertyHasChanged.getType().toString() + " " + property.toString());

	if (Identifiers::Name == property)
	{
		repaint();
		return;
	}

	if (Identifiers::StreamID == property)
	{
		int64 streamID = tree[Identifiers::StreamID];
		streamIdEditor.setText(String::toHexString(streamID));
		return;
	}

	if (Identifiers::DestinationAddress == property)
	{
		int64 address64 = tree[Identifiers::DestinationAddress];
		MACAddress address(Int64ToMACAddress(address64));
		multicastAddressEditor.setText(address.toString());
		return;
	}

	if (Identifiers::ChannelCount == property)
	{
		channelsCombo.setSelectedId(tree[Identifiers::ChannelCount], dontSendNotification);
		return;
	}

	if (Identifiers::Subtype == property)
	{
		int subtype = tree[Identifiers::Subtype];
		clockReferenceButton.setToggleState(AVTP_SUBTYPE_CRS == subtype,dontSendNotification);
		setChannelsVisible();
		return;
	}

	if (Identifiers::Active == property)
	{
		enableControls(treeWhosePropertyHasChanged.getProperty(property));
		return;
	}

	if (Identifiers::AutoStart == property)
	{
		autoStartButton.setToggleState(treeWhosePropertyHasChanged[property],dontSendNotification);
		return;
	}
}
Exemplo n.º 19
0
void GPControlView::on_abortbutton_clicked()
{
    gpControl->disconnect(SIGNAL(end(QString)));
    gpControl->disconnect(SIGNAL(carMoved()));
    gpControl->disconnect(SIGNAL(carMovedWithBoost()));
    gpControl->disconnect(SIGNAL(invalidMove()));
    gpControl->disconnect(SIGNAL(syntaxError()));
    gpControl->disconnect(SIGNAL(driverTimeout()));

    newGPControl();
    enableControls();
}
Exemplo n.º 20
0
void QtPSTNNumber::onNumberChanged(const QString &text)
{
    // Only enable the controls is the text is bigger than the minimalLength.
    enableControls((text.length() >= minimalLength));

    // Always add the country indicator in front of the number.
    if (text.length() > 0)
        ui->labelNumber->setText((text[0] == '+') ? text : "+" + text);
    else
        ui->labelNumber->setText("+");

}
Exemplo n.º 21
0
bool ImportIconsWizard::Create()
{
    if (!initialLoad(m_strChannelname))
        return false;


    bool foundtheme = false;

    // Load the theme for this screen
    foundtheme = LoadWindowFromXML("config-ui.xml", "iconimport", this);

    if (!foundtheme)
        return false;

    m_iconsList = dynamic_cast<MythUIButtonList *>(GetChild("icons"));
    m_manualEdit = dynamic_cast<MythUITextEdit *>(GetChild("manualsearch"));
    m_nameText = dynamic_cast<MythUIText *>(GetChild("name"));
    m_manualButton = dynamic_cast<MythUIButton *>(GetChild("search"));
    m_skipButton = dynamic_cast<MythUIButton *>(GetChild("skip"));
    m_statusText = dynamic_cast<MythUIText *>(GetChild("status"));
    m_preview = dynamic_cast<MythUIImage *>(GetChild("preview"));
    m_previewtitle = dynamic_cast<MythUIText *>(GetChild("previewtitle"));

    if (!m_iconsList || !m_manualEdit || !m_nameText || !m_manualButton ||
        !m_skipButton || !m_statusText)
    {
        LOG(VB_GENERAL, LOG_ERR,
            "Unable to load window 'iconimport', missing required element(s)");
        return false;
    }

    m_nameText->SetEnabled(false);

    m_nameText->SetHelpText(tr("Name of the icon file"));
    m_iconsList->SetHelpText(tr("List of possible icon files"));
    m_manualEdit->SetHelpText(tr("Enter text here for the manual search"));
    m_manualButton->SetHelpText(tr("Manually search for the text"));
    m_skipButton->SetHelpText(tr("Skip this icon"));

    connect(m_manualButton, SIGNAL(Clicked()), SLOT(manualSearch()));
    connect(m_skipButton, SIGNAL(Clicked()), SLOT(skip()));
    connect(m_iconsList, SIGNAL(itemClicked(MythUIButtonListItem *)),
            SLOT(menuSelection(MythUIButtonListItem *)));
    connect(m_iconsList, SIGNAL(itemSelected(MythUIButtonListItem *)),
            SLOT(itemChanged(MythUIButtonListItem *)));

    BuildFocusList();

    enableControls(STATE_NORMAL);

    return true;
}
void CreateAccountDialog::createAccountDone(bool succeeded, const CString& errorMessage)
{
    enableControls(true);
    //
    if (succeeded)
    {
        QDialog::accept();
    }
    else
    {
        QMessageBox::critical(this, "", errorMessage);
    }
}
Exemplo n.º 23
0
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);
}
Exemplo n.º 24
0
void CSearchResultDlg::onUserFound(PtrList *l)
{
	if (!l->empty()) {
		pages[pageCount++] = l;
		displayPage(++curPage);
		startUIN = ((SEARCH_RESULT *) l->back())->uin;
	} else {
		CString str;
		str.LoadString(IDS_SEARCH_NONE);
		SetDlgItemText(IDC_STATUS, str);
	}

	enableControls();
}
void ConfigCCHWWidget::widgetsContentsChanged()
{
    ConfigTaskWidget::widgetsContentsChanged();
    if (((m_telemetry->cbTele->currentIndex() == HwCopterControl::MAINPORT_DEBUGCONSOLE) &&
	 (m_telemetry->cbFlexi->currentIndex() == HwCopterControl::FLEXIPORT_DEBUGCONSOLE)) ||
	((m_telemetry->cbFlexi->currentIndex() == HwCopterControl::FLEXIPORT_DEBUGCONSOLE) &&
	 (m_telemetry->cbUsbVcp->currentIndex() == HwCopterControl::USB_VCPPORT_DEBUGCONSOLE)) ||
	((m_telemetry->cbUsbVcp->currentIndex() == HwCopterControl::USB_VCPPORT_DEBUGCONSOLE) &&
	 (m_telemetry->cbTele->currentIndex() == HwCopterControl::MAINPORT_DEBUGCONSOLE)))
    {
        enableControls(false);
        m_telemetry->problems->setText(tr("Warning: you have configured more than one DebugConsole, this currently is not supported"));
    }
    else if (((m_telemetry->cbTele->currentIndex() == HwCopterControl::MAINPORT_TELEMETRY) && (m_telemetry->cbFlexi->currentIndex() == HwCopterControl::FLEXIPORT_TELEMETRY)) ||
        ((m_telemetry->cbTele->currentIndex() == HwCopterControl::MAINPORT_GPS) && (m_telemetry->cbFlexi->currentIndex() == HwCopterControl::FLEXIPORT_GPS)) ||
        ((m_telemetry->cbTele->currentIndex() == HwCopterControl::MAINPORT_DEBUGCONSOLE) && (m_telemetry->cbFlexi->currentIndex() == HwCopterControl::FLEXIPORT_DEBUGCONSOLE)) ||
        ((m_telemetry->cbTele->currentIndex() == HwCopterControl::MAINPORT_COMBRIDGE) && (m_telemetry->cbFlexi->currentIndex() == HwCopterControl::FLEXIPORT_COMBRIDGE)))
    {
        enableControls(false);
        m_telemetry->problems->setText(tr("Warning: you have configured both MainPort and FlexiPort for the same function, this currently is not supported"));
    }
    else if ((m_telemetry->cbUsbHid->currentIndex() == HwCopterControl::USB_HIDPORT_USBTELEMETRY) && (m_telemetry->cbUsbVcp->currentIndex() == HwCopterControl::USB_VCPPORT_USBTELEMETRY))
    {
        enableControls(false);
        m_telemetry->problems->setText(tr("Warning: you have configured both USB HID Port and USB VCP Port for the same function, this currently is not supported"));
    }
    else if ((m_telemetry->cbUsbHid->currentIndex() != HwCopterControl::USB_HIDPORT_USBTELEMETRY) && (m_telemetry->cbUsbVcp->currentIndex() != HwCopterControl::USB_VCPPORT_USBTELEMETRY))
    {
        enableControls(false);
        m_telemetry->problems->setText(tr("Warning: you have disabled USB Telemetry on both USB HID Port and USB VCP Port, this currently is not supported"));
    }
    else
    {
        m_telemetry->problems->setText("");
        enableControls(true);
    }
}
Exemplo n.º 26
0
/* ////////////////////////////////////////////////////////////////////////////
 * Open ttmpeg2 project: open video file
 *                       anaylize the stream
 *                       enable navigation
 */
void TTMpeg2MainWnd::openProject(QString fileName)
{
  if (!openVideoFile(fileName))
  {
    // TODO: throw exception
    return;
  }

  videoFileInfo->setFileName(fileName);

  onAnalyze();

  isProjectOpen = true;
  enableControls(true);
}
Exemplo n.º 27
0
BOOL COptionSoundDlg::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

	IcqOption &options = icqLink->options;

	for (int i = 0; i < NR_SOUNDS; i++)
		soundFiles[i] = options.soundFiles[i].c_str();
	m_cmbSoundEvent.SetCurSel(curSel);
	SetDlgItemText(IDC_SOUND_FILE, soundFiles[curSel]);

	enableControls(m_soundOn == 0);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
void
PrefsRunProgramWidget::commandLineEdited(QString const &commandLine) {
  Q_D(PrefsRunProgramWidget);

  auto arguments     = Util::unescapeSplit(commandLine, Util::EscapeShellUnix);
  auto newExecutable = arguments.value(0);

  if (d->executable == newExecutable)
    return;

  d->executable = newExecutable;

  enableControls();

  emit titleChanged();
}
ConfigRevoNanoHWWidget::ConfigRevoNanoHWWidget(QWidget *parent) : ConfigTaskWidget(parent), m_refreshing(true)
{
    m_ui = new Ui_RevoNanoHWWidget();
    m_ui->setupUi(this);

    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
    Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
    if (!settings->useExpertMode()) {
        m_ui->saveTelemetryToRAM->setEnabled(false);
        m_ui->saveTelemetryToRAM->setVisible(false);
    }

    addApplySaveButtons(m_ui->saveTelemetryToRAM, m_ui->saveTelemetryToSD);

    forceConnectedState();

    addWidgetBinding("HwSettings", "RM_FlexiPort", m_ui->cbFlexi);
    addWidgetBinding("HwSettings", "RM_MainPort", m_ui->cbMain);
    addWidgetBinding("HwSettings", "RM_RcvrPort", m_ui->cbRcvr, 0, 1, true);

    addWidgetBinding("HwSettings", "USB_HIDPort", m_ui->cbUSBHIDFunction);
    addWidgetBinding("HwSettings", "USB_VCPPort", m_ui->cbUSBVCPFunction);
    addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbUSBVCPSpeed);

    addWidgetBinding("HwSettings", "TelemetrySpeed", m_ui->cbFlexiTelemSpeed);
    addWidgetBinding("HwSettings", "GPSSpeed", m_ui->cbFlexiGPSSpeed);
    addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbFlexiComSpeed);

    addWidgetBinding("HwSettings", "TelemetrySpeed", m_ui->cbMainTelemSpeed);
    addWidgetBinding("HwSettings", "GPSSpeed", m_ui->cbMainGPSSpeed);
    addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbMainComSpeed);

    addWidgetBinding("HwSettings", "TelemetrySpeed", m_ui->cbRcvrTelemSpeed);
    addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbRcvrComSpeed);

    // Add Gps protocol configuration
    addWidgetBinding("GPSSettings", "DataProtocol", m_ui->cbMainGPSProtocol);
    addWidgetBinding("GPSSettings", "DataProtocol", m_ui->cbFlexiGPSProtocol);

    connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
    setupCustomCombos();
    enableControls(true);
    populateWidgets();
    refreshWidgetsValues();
    setDirty(false);
    m_refreshing = false;
}
void CreateAccountDialog::accept()
{
    if (userId().isEmpty())
    {
        QMessageBox::critical(this, "", tr("Please enter user id"));
        return;
    }
    if (password().isEmpty())
    {
        QMessageBox::critical(this, "", tr("Please enter user password"));
        return;
    }
    //
    enableControls(false);
    //
    m_createAccount.createAccount(userId(), password(), "");
}