void HighlightManager::load(SimpleXML& aXml) {
    aXml.resetCurrentChild();

    if(aXml.findChild("Highlights")) {
        aXml.stepIn();
        while(aXml.findChild("Highlight")) {
            ColorSettings cs;
            cs.setMatch( Text::utf8ToWide( aXml.getChildAttrib("Match") ) );
            cs.setBold(	aXml.getBoolChildAttrib("Bold") );
            cs.setItalic( aXml.getBoolChildAttrib("Italic") );
            cs.setUnderline( aXml.getBoolChildAttrib("Underline") );
            cs.setStrikeout( aXml.getBoolChildAttrib("Strikeout") );
            cs.setIncludeNickList( aXml.getBoolChildAttrib("IncludeNickList") );
            cs.setCaseSensitive( aXml.getBoolChildAttrib("CaseSensitive") );
            cs.setWholeLine( aXml.getBoolChildAttrib("WholeLine") );
            cs.setWholeWord( aXml.getBoolChildAttrib("WholeWord") );
            cs.setPopup( aXml.getBoolChildAttrib("Popup") );
            cs.setTab( aXml.getBoolChildAttrib("Tab") );
            cs.setPlaySound( aXml.getBoolChildAttrib("PlaySound") );
            cs.setLog( aXml.getBoolChildAttrib("LastLog") );
            cs.setFlashWindow( aXml.getBoolChildAttrib("FlashWindow") );
            cs.setMatchType( aXml.getIntChildAttrib("MatchType") );
            cs.setHasFgColor( aXml.getBoolChildAttrib("HasFgColor") );
            cs.setHasBgColor( aXml.getBoolChildAttrib("HasBgColor") );
            cs.setBgColor( (int)aXml.getLongLongChildAttrib("BgColor") );
            cs.setFgColor( (int)aXml.getLongLongChildAttrib("FgColor") );
            cs.setSoundFile( Text::utf8ToWide( aXml.getChildAttrib("SoundFile") ) );

            colorSettings.push_back(cs);
        }
        aXml.stepOut();
    } else {
        aXml.resetCurrentChild();
    }
}
void HighlightManager::load(SimpleXML& aXml){
	aXml.resetCurrentChild();

	if(aXml.findChild("Highlights")) {
		aXml.stepIn();
		while(aXml.findChild("Highlight")) {
			try{
				ColorSettings cs;
				cs.setContext(aXml.getIntChildAttrib("Context"));
				cs.setMatch( Text::utf8ToWide( aXml.getChildAttrib("Match") ) );
				cs.setBold(	aXml.getBoolChildAttrib("Bold") );
				cs.setItalic( aXml.getBoolChildAttrib("Italic") );
				cs.setUnderline( aXml.getBoolChildAttrib("Underline") );
				cs.setStrikeout( aXml.getBoolChildAttrib("Strikeout") );
				//Convert old setting to correct context
				if(aXml.getBoolChildAttrib("IncludeNickList") == true)
					cs.setContext(CONTEXT_NICKLIST);
				cs.setCaseSensitive( aXml.getBoolChildAttrib("CaseSensitive") );
				cs.setWholeLine( aXml.getBoolChildAttrib("WholeLine") );
				cs.setWholeWord( aXml.getBoolChildAttrib("WholeWord") );
				cs.setPopup( aXml.getBoolChildAttrib("Popup") );
				cs.setTab( aXml.getBoolChildAttrib("Tab") );
				cs.setPlaySound( aXml.getBoolChildAttrib("PlaySound") );
				//cs.setLog( aXml.getBoolChildAttrib("LastLog") );
				cs.setFlashWindow( aXml.getBoolChildAttrib("FlashWindow") );
				cs.setMatchType( aXml.getIntChildAttrib("MatchType") );
				cs.setHasFgColor( aXml.getBoolChildAttrib("HasFgColor") );
				cs.setHasBgColor( aXml.getBoolChildAttrib("HasBgColor") );
				cs.setBgColor( (int)aXml.getLongLongChildAttrib("BgColor") );
				cs.setFgColor( (int)aXml.getLongLongChildAttrib("FgColor") );
				cs.setSoundFile( Text::utf8ToWide( aXml.getChildAttrib("SoundFile") ) );
				cs.setMatchColumn(aXml.getIntChildAttrib("MatchColumn"));

				cs.setRegexp();
				colorSettings.push_back(cs);
			}catch(...) { }
		}
		aXml.stepOut();
	} else {
		aXml.resetCurrentChild();
	}
	//convert the old setting to highlights
	if(!SETTING(HIGHLIGHT_LIST).empty()) {
		ColorSettings cs;
		cs.setContext(CONTEXT_FILELIST);
		cs.setMatch(Text::toT(SETTING(HIGHLIGHT_LIST)));
		cs.setHasFgColor(true);
		cs.setFgColor( SETTING(LIST_HL_COLOR) );
		cs.setHasBgColor(true);
		cs.setBgColor( SETTING(LIST_HL_BG_COLOR) );
		SettingsManager::getInstance()->set(SettingsManager::HIGHLIGHT_LIST, "");
		SettingsManager::getInstance()->set(SettingsManager::USE_HIGHLIGHT, true);
		colorSettings.push_back(cs);
	}

}
Example #3
0
void HighlightManager::load(SimpleXML& aXml){
	aXml.resetCurrentChild();

	if(aXml.findChild("Highlights")) {
		aXml.stepIn();
		while(aXml.findChild("Highlight")) {
			try{
				ColorSettings cs;
				cs.setContext(aXml.getIntChildAttrib("Context"));
				cs.setMatch( Text::toT( aXml.getChildAttrib("Match") ) );
				cs.setBold(	aXml.getBoolChildAttrib("Bold") );
				cs.setItalic( aXml.getBoolChildAttrib("Italic") );
				cs.setUnderline( aXml.getBoolChildAttrib("Underline") );
				cs.setStrikeout( aXml.getBoolChildAttrib("Strikeout") );
				//Convert old setting to correct context
				if(aXml.getBoolChildAttrib("IncludeNickList") == true)
					cs.setContext(CONTEXT_NICKLIST);
				cs.setCaseSensitive( aXml.getBoolChildAttrib("CaseSensitive") );
				cs.setWholeLine( aXml.getBoolChildAttrib("WholeLine") );
				cs.setWholeWord( aXml.getBoolChildAttrib("WholeWord") );
				cs.setPopup( aXml.getBoolChildAttrib("Popup") );
				cs.setTab( aXml.getBoolChildAttrib("Tab") );
				cs.setPlaySound( aXml.getBoolChildAttrib("PlaySound") );
				//cs.setLog( aXml.getBoolChildAttrib("LastLog") );
				cs.setFlashWindow( aXml.getBoolChildAttrib("FlashWindow") );
				cs.setMatchType( aXml.getIntChildAttrib("MatchType") );
				cs.setHasFgColor(aXml.getBoolChildAttrib("HasFgColor"));
				cs.setHasBgColor(aXml.getBoolChildAttrib("HasBgColor"));
				cs.setBgColor(aXml.getIntChildAttrib("BgColor"));
				cs.setFgColor(aXml.getIntChildAttrib("FgColor"));
				cs.setSoundFile(aXml.getChildAttrib("SoundFile"));
				cs.setMatchColumn(aXml.getIntChildAttrib("MatchColumn"));

				cs.setRegexp();
				colorSettings.push_back(cs);
			}catch(...) { }
		}
		aXml.stepOut();
	} else {
		aXml.resetCurrentChild();
	}
}