예제 #1
0
int SettingsManager::getIntSetting( const char *inSettingName,
                                    char *outValueFound ) {

    char valueFound = false;
    int value = 0;


    char *stringValue = getStringSetting( inSettingName );

    if( stringValue != NULL ) {

        int numRead = sscanf( stringValue, "%d",
                              &value );

        if( numRead == 1 ) {
            valueFound = true;
            }

        delete [] stringValue;
        }

    *outValueFound = valueFound;

    return value;
    }
예제 #2
0
	void ChatWidget::loadSettings( ClientShared* shared )
	{
		m_shared = shared;
		m_toolbar->getCensorButton()->setToggleState(getBoolSetting("chat.censored"));
		m_fontRatio = getNumericSetting("chat.game.font");
		Log::write("ChatWidget","loaded game chat settings");
		m_toolbar->getFontSlider()->setValue(
			((m_toolbar->getFontSlider()->getMaxValue() - 
			m_toolbar->getFontSlider()->getMinValue())  * m_fontRatio)
			+ m_toolbar->getFontSlider()->getMinValue());
		//all this code just adds players to mute list
		int tbl = getTableG();
		LobbyCache::Table* t = shared->getLobbyCache()->getTableAt(tbl);

		if(t)
		{
			ClientPlayer* s = shared->getPlayerManager()->getSelfPlayer();
/*
			for(int i = 0; i < t->getNumChairs(); ++i)
			{
				ClientPlayer* p = t->getChairAt(i)->getPlayer();
				//valid and not me
				if(s && p && p->getUsername() != s->getUsername())
				{
					m_toolbar->addPlayer(p->getUsername(),getGamePlayerColor(p->getUsername()));
					m_toolbar->setPlayerMuted(p->getUsername(),isMutedG(p->getUsername()));
				}
			}
			*/

			for(int i = 0; i < t->getNumWatchers(); ++i)
			{
				ClientPlayer* p = t->getWatcherAt(i);
				if(s && p && p->getUsername() != s->getUsername())
				{
					m_toolbar->addPlayer(p->getUsername(),getGamePlayerColor(p->getUsername()));
					m_toolbar->setPlayerMuted(p->getUsername(),isMutedG(p->getUsername()));
				}
			}
		}
		
		std::string chatStyle = getStringSetting("chat.style");
		chatStyleChanged(chatStyle);
	}
예제 #3
0
파일: Settings.cpp 프로젝트: Jappen/telldus
/*
* Get device argument
*/
std::wstring Settings::getDeviceParameter(int intDeviceId, const std::wstring &strName) const {
	TelldusCore::MutexLocker locker(&mutex);
	return getStringSetting(Device, intDeviceId, strName, true);
}
예제 #4
0
파일: Settings.cpp 프로젝트: Jappen/telldus
/*
* Get the device model
*/
std::wstring Settings::getModel(int intDeviceId) const {
	TelldusCore::MutexLocker locker(&mutex);
	return getStringSetting(Device, intDeviceId, L"model", false);
}
예제 #5
0
파일: Settings.cpp 프로젝트: Jappen/telldus
std::wstring Settings::getDeviceStateValue( int intDeviceId ) const {
	TelldusCore::MutexLocker locker(&mutex);
	return getStringSetting( Settings::Device, intDeviceId, L"stateValue", true );
}
	String ConfigurationManager::getKeymap()
	{
		return getStringSetting("Keymap", "keymap-german.xml");
	}
	int ConfigurationManager::getIntSetting(const String& name, int defaultv)
	{
		String val = getStringSetting(name);
		if (val == StringUtil::BLANK) return defaultv;
		else return StringConverter::parseInt(val);
	}
예제 #8
0
QString GTDatabaseConfig::host() {
    return getStringSetting(HOST);
}
예제 #9
0
QString GTDatabaseConfig::login() {
    return getStringSetting(LOGIN);
}
예제 #10
0
QString GTDatabaseConfig::readOnlyLogin() {
    return getStringSetting(READ_ONLY_LOGIN);
}
예제 #11
0
QString GTDatabaseConfig::versionDatabase() {
    return getStringSetting(DATABASE_VERSION);
}
예제 #12
0
QString GTDatabaseConfig::uninitializedDatabase() {
    return getStringSetting(DATABASE_UNINITED_PREFIX) + getOsSuffix();
}
예제 #13
0
QString GTDatabaseConfig::secondDatabase() {
    return getStringSetting(DATABASE_PREFIX_2) + getOsSuffix();
}
예제 #14
0
파일: Settings.cpp 프로젝트: Jappen/telldus
/*
* Get the name of the device
*/
std::wstring Settings::getName(Node type, int intNodeId) const {
	TelldusCore::MutexLocker locker(&mutex);
	return getStringSetting(type, intNodeId, L"name", false);
}
	bool ConfigurationManager::getBoolSetting(const String& name, bool defaultv)
	{
		String val = getStringSetting(name);
		if (val == StringUtil::BLANK) return defaultv;
		else return StringConverter::parseBool(val);
	}
예제 #16
0
파일: Settings.cpp 프로젝트: Jappen/telldus
std::wstring Settings::getControllerSerial(int intControllerId) const {
	TelldusCore::MutexLocker locker(&mutex);
	return getStringSetting(Controller, intControllerId, L"serial", false);
}
예제 #17
0
QString GTDatabaseConfig::password() {
    return getStringSetting(PASSWORD);
}