Ejemplo n.º 1
0
void LevelCollection::setCurrentLevel(int level)
{
	if (currentLevel_ == levels_.size())
	{
		emit collectionCompleted();
		return;
	}
	disconnect(levels_.at(currentLevel_));
	currentLevel_ = level;
	connect(levels_.at(currentLevel_), &Level::levelCompleted, this, &LevelCollection::unlockNextLevel);
	connect(levels_.at(currentLevel_), &Level::levelCompleted, this, &LevelCollection::nextLevel);
	emit currentLevelChanged();
	levels_.at(currentLevel_)->undoStack()->reset();
	//Making sure next button's state is recalculated
	emit unlockedLevelChanged();
}
Ejemplo n.º 2
0
void QmlFeatureBattery::updateBatteryLevel(feature::BatteryLevel level) {
	if (_current_level != level.current_discharge_level || !refreshed()) {
		_current_level = level.current_discharge_level;
		emit currentLevelChanged();
	}

	if (_next_level != level.next_discharge_level || !refreshed()) {
		_next_level = level.next_discharge_level;
		emit nextLevelChanged();
	}

	if (_status != (QmlBatteryStatus)level.status || !refreshed()) {
		_status = (QmlBatteryStatus)level.status;
		emit statusChanged();
	}
}