Пример #1
0
void TaskObject::setPriority(const QString &priority)
{
	if (m_priority != priority) {
		m_priority = priority;
		emit priorityChanged();
	}
}
Пример #2
0
void JMUCUser::setMUCAffiliationAndRole(MUCRoom::Affiliation affiliation, MUCRoom::Role role)
{
	int oldPriority = priority();
	d_func()->affiliation = affiliation;
	d_func()->role = role;
	int newPriority = priority();
	emit priorityChanged(oldPriority, newPriority);
	
	QString iconName;
	if (affiliation == MUCRoom::AffiliationOwner)
		iconName = QStringLiteral("user-role-owner");
	else if (affiliation == MUCRoom::AffiliationAdmin)
		iconName = QStringLiteral("user-role-admin");
	else if (role == MUCRoom::RoleModerator)
		iconName = QStringLiteral("user-role-moderator");
	else if (role == MUCRoom::RoleVisitor)
		iconName = QStringLiteral("user-role-visitor");
	else if (affiliation == MUCRoom::AffiliationMember)
		iconName = QStringLiteral("user-role-member");
	else
		iconName = QStringLiteral("user-role-participant");
	
	QVariantHash clientInfo;
	ExtensionIcon extIcon(iconName);
	clientInfo.insert("id", "mucRole");
	clientInfo.insert("icon", QVariant::fromValue(extIcon));
	clientInfo.insert("priorityInContactList", 30);
	setExtendedInfo("mucRole", clientInfo);
}
Пример #3
0
void NemoThumbnailItem::setPriority(Priority priority)
{
    if (m_priority != priority) {
        m_priority = priority;
        emit priorityChanged();
        if (m_request)
            NemoThumbnailLoader::instance->updateRequest(this, false);
    }
}
Пример #4
0
void PriorityMuxer::setCurrentTime(void)
{
	const int64_t now = QDateTime::currentMSecsSinceEpoch();
	int newPriority = PriorityMuxer::LOWEST_PRIORITY;

	for (auto infoIt = _activeInputs.begin(); infoIt != _activeInputs.end();)
	{
		if (infoIt->timeoutTime_ms > 0 && infoIt->timeoutTime_ms <= now)
		{
			quint8 tPrio = infoIt->priority;
			infoIt = _activeInputs.erase(infoIt);
			Debug(_log,"Timeout clear for priority %d",tPrio);
			emit priorityChanged(tPrio, false);
			emit prioritiesChanged();
		}
		else
		{
			// timeoutTime of -100 is awaiting data (inactive); skip
			if(infoIt->timeoutTime_ms >= -100)
				newPriority = qMin(newPriority, infoIt->priority);

			// call timeTrigger when effect or color is running with timeout > 0, blacklist prio 255
			if(infoIt->priority < 254 && infoIt->timeoutTime_ms > 0 && (infoIt->componentId == hyperion::COMP_EFFECT || infoIt->componentId == hyperion::COMP_COLOR))
				emit signalTimeTrigger(); // as signal to prevent Threading issues

			++infoIt;
		}
	}
	// eval if manual selected prio is still available
	if(!_sourceAutoSelectEnabled)
	{
		if(_activeInputs.contains(_manualSelectedPriority))
		{
			newPriority = _manualSelectedPriority;
		}
		else
		{
			Debug(_log, "The manual selected priority '%d' is no longer available, switching to auto selection", _manualSelectedPriority);
			// update state, but no _currentPriority re-eval
			setSourceAutoSelectEnabled(true, false);
		}
	}
	// apply & emit on change (after apply!)
	bool changed = false;
	if(_currentPriority != newPriority)
		changed = true;

	_currentPriority = newPriority;

	if(changed)
	{
		Debug(_log, "Set visible priority to %d", newPriority);
		emit visiblePriorityChanged(newPriority);
		emit prioritiesChanged();
	}
}
Пример #5
0
const bool PriorityMuxer::clearInput(const uint8_t priority)
{
	if (priority < PriorityMuxer::LOWEST_PRIORITY && _activeInputs.remove(priority))
	{
		Debug(_log,"Removed source priority %d",priority);
		// on clear success update _currentPriority
		setCurrentTime();
		emit priorityChanged(priority, false);
		emit prioritiesChanged();
		return true;
	}
	return false;
}
void LLPluginClassBasic::setPriority(EPriority priority)
{
	if (mPriority != priority)
	{
		mPriority = priority;

		LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_BASIC, "set_priority");
		
		std::string priority_string = priorityToString(priority);
		switch(priority)
		{
			case PRIORITY_SLEEP:
				mSleepTime = 1.0f;
				break;
			case PRIORITY_LOW:		
				mSleepTime = 1.0f / 25.0f;
				break;
			case PRIORITY_NORMAL:	
				mSleepTime = 1.0f / 50.0f;
				break;
			case PRIORITY_HIGH:		
				mSleepTime = 1.0f / 100.0f;
				break;
		}
		
		message.setValue("priority", priority_string);
		sendMessage(message);
		
		if(mPlugin)
		{
			mPlugin->setSleepTime(mSleepTime);
		}
		
		LL_DEBUGS("PluginPriority") << this << ": setting priority to " << priority_string << LL_ENDL;

		priorityChanged(mPriority);
	}
}
Пример #7
0
void PriorityMuxer::registerInput(const int priority, const hyperion::Components& component, const QString& origin, const QString& owner, unsigned smooth_cfg)
{
	// detect new registers
	bool newInput = false;
	if(!_activeInputs.contains(priority))
		newInput = true;

	InputInfo& input     = _activeInputs[priority];
	input.priority       = priority;
	input.timeoutTime_ms = newInput ? -100 : input.timeoutTime_ms;
	input.componentId    = component;
	input.origin         = origin;
	input.smooth_cfg     = smooth_cfg;
	input.owner          = owner;

	if(newInput)
	{
		Debug(_log,"Register new input '%s/%s' with priority %d as inactive", QSTRING_CSTR(origin), hyperion::componentToIdString(component), priority);
		emit priorityChanged(priority, true);
		emit prioritiesChanged();
		return;
	}
}
Пример #8
0
void Transfer::setPriority(Priority p) {
    if (p != priority()) {
        m_priority = p;
        emit priorityChanged();
    }
}