Пример #1
0
void PagesContainer::refresh(int index)
{
    finishThreads(false, index);
    for(QVector<PageManager*>::iterator it = m_buffer->getPages(index)->begin() ; it != m_buffer->getPages(index)->end() ; it ++)
        (*it)->refresh();
    if(index == 0) emit pagesSizeChanged(getResizedPage(index)->pixmap()->width());
}
Пример #2
0
bool ScScript::finish(bool includingThreads) {
	if (_state != SCRIPT_FINISHED && includingThreads) {
		_state = SCRIPT_FINISHED;
		finishThreads();
	} else {
		_state = SCRIPT_FINISHED;
	}


	return STATUS_OK;
}
Пример #3
0
void PionScheduler::shutdown(void)
{
	// lock mutex for thread safety
	boost::mutex::scoped_lock scheduler_lock(m_mutex);
	
	if (m_is_running) {
		
		PION_LOG_INFO(m_logger, "Shutting down the thread scheduler");
		
		while (m_active_users > 0) {
			// first, wait for any active users to exit
			PION_LOG_INFO(m_logger, "Waiting for " << m_active_users << " scheduler users to finish");
			m_no_more_active_users.wait(scheduler_lock);
		}

		// shut everything down
		m_is_running = false;
		stopServices();
		stopThreads();
		finishServices();
		finishThreads();
		
		PION_LOG_INFO(m_logger, "The thread scheduler has shutdown");

		// Make sure anyone waiting on shutdown gets notified
		m_scheduler_has_stopped.notify_all();
		
	} else {
		
		// stop and finish everything to be certain that no events are pending
		stopServices();
		stopThreads();
		finishServices();
		finishThreads();
		
		// Make sure anyone waiting on shutdown gets notified
		// even if the scheduler did not startup successfully
		m_scheduler_has_stopped.notify_all();
	}
}
Пример #4
0
//Application de la politique de redimentionnement
void PagesContainer::applyResizePolicy()
{
    if (m_buffer->getNumberOfBlocs() == 0) return;

    finishThreads();
    if (m_resizePolicy & FIT_WIDTH)
        fitWidth();
    else if (m_resizePolicy & FIT_HEIGHT)
        fitHeight();
    else if (m_resizePolicy & FIT_SCREEN)
        fitScreen();
    else
        refresh();
}
Пример #5
0
PagesContainer::~PagesContainer()
{
    finishThreads();
}
Пример #6
0
void PagesContainer::setPersonalPolicy(int newWidth)
{
    setResizePolicy(PERSONAL);
    finishThreads();
    fitWidth(NONE, newWidth);
}