void QDeclarativeFeedbackEffect::setRunning(bool running)
{
    QDeclarativeFeedbackEffect::State currentState = static_cast<QDeclarativeFeedbackEffect::State>(m_effect->state());
    if (currentState != QDeclarativeFeedbackEffect::Running && running) {
        m_running = true;
        m_effect->start();
        emit runningChanged();
    } else if (currentState != QDeclarativeFeedbackEffect::Stopped && !running) {
        m_running = false;
        m_effect->stop();
        emit runningChanged();
    }
}
Ejemplo n.º 2
0
void QServiceDiscovery::setRunning(bool arg)
{
    if (m_running != arg) {
        m_running = arg;
        emit runningChanged(arg);

        if (!m_networkReady) {
            return;
        }

        if (m_running) {
            startQueries();

            if (m_lookupMode == UnicastDNS)
            {
                m_unicastLookupTimer->start();
            }
        }
        else
        {
            if (m_lookupMode == UnicastDNS)
            {
                m_unicastLookupTimer->stop();
            }

            stopQueries();
        }
    }
}
Ejemplo n.º 3
0
void QuickScene::setRunning(const bool &running)
{
    if (m_running == running)
        return;
    m_running = running;
    emit runningChanged();
}
Ejemplo n.º 4
0
void LauncherItem::setRunning(bool running)
{
    if (m_running != running) {
        m_running = running;
        Q_EMIT runningChanged(running);
    }
}
Ejemplo n.º 5
0
void AMWorkflowManagerView::reviewWorkflowStatus(){
	bool qEmpty = workflowQueue_->isEmpty();
	bool qRunning = workflowQueue_->isRunning();
	bool blScanning = AMBeamline::bl()->isBeamlineScanning();

	/// \todo Move this code out of the UI and into the workflow proper.
	if(qEmpty || qRunning || blScanning)
		startWorkflowButton_->setEnabled(false);
	else{
		startWorkflowButton_->setEnabled(true);
		startWorkflowButton_->setText("Start This Workflow\n-- Ready --");
	}

	if(blScanning && !qRunning){
			startWorkflowButton_->setText("Start This Workflow\n-- Beamline Busy --");
	}
	else if(qEmpty){
		startWorkflowButton_->setText("Start This Workflow\n-- No Items --");
	}
	else if(qRunning){
		startWorkflowButton_->setText("Start This Workflow\n-- Already Running --");
	}
	/////////////////////////

	emit workflowStatusChanged(blScanning, qEmpty, qRunning);
	/// \todo Emit the following only when they change:
	emit actionItemCountChanged(workflowQueue_->count());
	emit runningChanged(qRunning);
	// emit beamlineBusyChanged(blScanning);
}
void MenuContentActivator::stop()
{
    d->m_timer->stop();
    if (!d->m_running) {
        d->m_running = false;
        Q_EMIT runningChanged(false);
    }
}
void AuthenticationExaminer::setRunning(bool v)
{
    if (this->m_running == v)
        return;

    this->m_running = v;
    Q_EMIT runningChanged();
}
Ejemplo n.º 8
0
void LifeEngineThread::run()
{
    qDebug()<<"start "<<mEngine;
    emit runningChanged(true);
    if (mMode == StepMode)
        mEngine->step();

    if (mMode == LoadMode)
        mEngine->load(mFileName);

    if (mMode == SaveMode)
        mEngine->save(mFileName);

    emit runningChanged(false);
    qDebug()<<"finished";


}
Ejemplo n.º 9
0
void QAbstractClipAnimator::setRunning(bool running)
{
    Q_D(QAbstractClipAnimator);
    if (d->m_running == running)
        return;

    d->m_running = running;
    emit runningChanged(running);
}
Ejemplo n.º 10
0
void QDeclarativeTimer::setRunning(bool running)
{
    Q_D(QDeclarativeTimer);
    if (d->running != running) {
        d->running = running;
        d->firstTick = true;
        emit runningChanged();
        update();
    }
}
Ejemplo n.º 11
0
void QDeclarativeTimer::finished()
{
    Q_D(QDeclarativeTimer);
    if (d->repeating || !d->running)
        return;
    emit triggered();
    d->running = false;
    d->firstTick = false;
    emit runningChanged();
}
Ejemplo n.º 12
0
// Chronos is started with running = true
void Chronos::setRunning(bool status){
    mRunning = status;
    if(status){
        startTime.start();
    }else{
        setTime = 6;
    }

    runningChanged(mRunning);
}
void QDeclarativeFeedbackEffect::updateState() {
    bool running = m_effect->state() == QFeedbackEffect::Running;
    bool paused = m_effect->state() == QFeedbackEffect::Paused;
    if (running != m_running) {
        m_running = running;
        emit runningChanged();
    }
    if (paused != m_paused) {
        m_paused = paused;
        emit pausedChanged();
    }
}
void SpriteAnimationItem::setRunning(const bool &running)
{
    bool currentState = m_spriteAnimation->state() == QAbstractAnimation::Running;

    if (currentState != running) {
        if (running)
            m_spriteAnimation->start();
        else
            m_spriteAnimation->stop();

        emit runningChanged();
    }
}
Ejemplo n.º 15
0
void Oscilloscope::stop()
{
    // TODO: release used reader?

    delete _shm->client;
    _shm->client = 0;

    timer->stop();

    _running = false;

    emit runningChanged(_running);
}
Ejemplo n.º 16
0
bool tesser::ocr(QString filename)
{
    if (m_running==true)
        return false;

    m_ocrFuture=QtConcurrent::run(this, &tesser::ocrThread, filename);

    m_running=true;
    emit runningChanged(m_running);

    m_ocrWatcher.setFuture(m_ocrFuture);
    return true;
}
Ejemplo n.º 17
0
void
LauncherApplication::updateBamfApplicationDependentProperties()
{
    activeChanged(active());
    runningChanged(running());
    urgentChanged(urgent());
    nameChanged(name());
    iconChanged(icon());
    applicationTypeChanged(application_type());
    desktopFileChanged(desktop_file());
    m_launching_timer.stop();
    launchingChanged(launching());
    updateHasVisibleWindow();
    updateWindowCount();
    fetchIndicatorMenus();
}
Ejemplo n.º 18
0
 void SpringLayoutUi::onStartStop()
 {
   m_ui.btnStartStop->setEnabled(false);
   if (m_thread == NULL)
   {
     emit runningChanged(true);
     m_thread = new WorkerThread(m_layout, 100 - m_ui.sldSpeed->value(), this);
     m_thread->connect(m_thread, SIGNAL(started()), this, SLOT(onStarted()));
     m_thread->connect(m_thread, SIGNAL(finished()), this, SLOT(onStopped()));
     m_thread->start();
   }
   else
   {
     static_cast<WorkerThread*>(m_thread)->stop();
     m_thread->wait();
     m_thread = NULL;
   }
 }
Ejemplo n.º 19
0
void SpriteAnimation::setRunning(const bool &running)
{
    if (!m_spriteAnimation) {
        qWarning() << "SpriteAnimation" << "invalid";
        return;
    }

    bool currentState = m_spriteAnimation->state() == QAbstractAnimation::Running;

    if (currentState != running) {
        if (running)
            m_spriteAnimation->start();
        else
            m_spriteAnimation->stop();

        emit runningChanged();
    }
}
Ejemplo n.º 20
0
void Oscilloscope::start()
{
    if( _running ) return;
    if( _srvPort < 0 || _scopeIndex < 0 ) return;

    connectSharedMemory( _srvPort );
    if( !_shm->client ) {
        stop();
        return;
    }

    initScopeReader( _shm, _scopeIndex );

    timer->start();

    _running = true;

    emit runningChanged(_running);
}
void MenuContentActivator::restart()
{
    // when we start, make sure we have the base index in the list.
    setMenuContentState(d->m_baseIndex, true);
    setDelta(0);

    // check if we've finished before starting the timer.
    bool finished = false;
    d->findNextInactiveDelta(&finished);
    if (!finished) {
        d->m_timer->start();
    } else {
        d->m_timer->stop();
    }

    if (!d->m_running) {
        d->m_running = true;
        Q_EMIT runningChanged(true);
    }
}
Ejemplo n.º 22
0
void RunnerModel::startQuery()
{
    if (m_pendingQuery.isEmpty()) {
        clear();
    }

    if (!m_manager && m_pendingQuery.isEmpty()) {
        // avoid creating a manager just so we can run nothing
        return;
    }

    createManager();
    /* DEBUG
    kWarning() << "Start query" << m_pendingQuery << "on runners:";
    Q_FOREACH(Plasma::AbstractRunner *runner, m_manager->runners()) {
        kWarning() << "-" << runner->name();
    }
    */
    m_manager->launchQuery(m_pendingQuery);
    emit queryChanged();
    m_running = true;
    emit runningChanged(true);
}
void SatelliteModel::setRunning(bool isActive)
{
    if (!source && !demo)
        return;

    if (!m_componentCompleted) {
        m_runningRequested = isActive;
        return;
    }

    if (m_running == isActive)
        return;

    m_running = isActive;

    if (m_running) {
        clearModel();
        if (demo)
            timer->start(2000);
        else if (isSingleRequest())
            source->requestUpdate(10000);
        else
            source->startUpdates();

        if (demo)
            singleRequestServed = false;
    } else {
        if (demo)
            timer->stop();
        else if (!isSingleRequest())
            source->stopUpdates();
    }


    Q_EMIT runningChanged();
}
Ejemplo n.º 24
0
 void SpringLayoutUi::onStopped()
 {
   m_ui.btnStartStop->setText("Start");
   m_ui.btnStartStop->setEnabled(true);
   emit runningChanged(false);
 }
void QDeclarativeBluetoothDiscoveryModel::setRunning(bool running)
{
    if (!d->m_componentCompleted) {
        d->m_runningRequested = running;
        return;
    }

    if (d->m_running == running)
        return;

    d->m_running = running;

    if (!running) {
        if (d->m_deviceAgent)
            d->m_deviceAgent->stop();
        if (d->m_serviceAgent)
            d->m_serviceAgent->stop();
    } else {
        clearModel();
        d->m_error = NoError;
        if (d->m_discoveryMode == DeviceDiscovery) {
            if (!d->m_deviceAgent) {
                d->m_deviceAgent = new QBluetoothDeviceDiscoveryAgent(this);
                connect(d->m_deviceAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)), this, SLOT(deviceDiscovered(QBluetoothDeviceInfo)));
                connect(d->m_deviceAgent, SIGNAL(finished()), this, SLOT(finishedDiscovery()));
                connect(d->m_deviceAgent, SIGNAL(canceled()), this, SLOT(finishedDiscovery()));
                connect(d->m_deviceAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)), this, SLOT(errorDeviceDiscovery(QBluetoothDeviceDiscoveryAgent::Error)));
            }
            d->m_deviceAgent->start();
        } else {
            if (!d->m_serviceAgent) {
                d->m_serviceAgent = new QBluetoothServiceDiscoveryAgent(this);
                connect(d->m_serviceAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)), this, SLOT(serviceDiscovered(QBluetoothServiceInfo)));
                connect(d->m_serviceAgent, SIGNAL(finished()), this, SLOT(finishedDiscovery()));
                connect(d->m_serviceAgent, SIGNAL(canceled()), this, SLOT(finishedDiscovery()));
                connect(d->m_serviceAgent, SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)), this, SLOT(errorDiscovery(QBluetoothServiceDiscoveryAgent::Error)));
            }

            d->m_serviceAgent->setRemoteAddress(QBluetoothAddress(d->m_remoteAddress));
            d->m_serviceAgent->clear();

            if (!d->m_uuid.isEmpty())
                d->m_serviceAgent->setUuidFilter(QBluetoothUuid(d->m_uuid));

            if (discoveryMode() == FullServiceDiscovery)  {
                //qDebug() << "Full Discovery";
                d->m_serviceAgent->start(QBluetoothServiceDiscoveryAgent::FullDiscovery);
            } else {
                //qDebug() << "Minimal Discovery";
                d->m_serviceAgent->start(QBluetoothServiceDiscoveryAgent::MinimalDiscovery);
            }

            // we could not start service discovery
            if (!d->m_serviceAgent->isActive()) {
                d->m_running = false;
                errorDiscovery(d->m_serviceAgent->error());
                return;
            }
        }
    }

    emit runningChanged();
}
Ejemplo n.º 26
0
void Server::setRunning(bool arg)
{
    if (m_running == arg) return;
    m_running = arg;
    emit runningChanged(arg);
}
Ejemplo n.º 27
0
void tesser::ocrFinished()
{
    m_running=false;
    emit runningChanged(m_running);
    emit textAvailable();
}