QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) : QgsRendererV2Widget( layer, style ) { // try to recognize the previous renderer // (null renderer means "no previous renderer") if ( !renderer || renderer->type() != "RuleRenderer" ) { // we're not going to use it - so let's delete the renderer delete renderer; // some default options QgsSymbolV2* symbol = QgsSymbolV2::defaultSymbol( mLayer->geometryType() ); mRenderer = new QgsRuleBasedRendererV2( symbol ); } else { mRenderer = static_cast<QgsRuleBasedRendererV2*>( renderer ); } setupUi( this ); treeRules->setRenderer( mRenderer ); mRefineMenu = new QMenu( btnRefineRule ); mRefineMenu->addAction( tr( "Add scales" ), this, SLOT( refineRuleScales() ) ); mRefineMenu->addAction( tr( "Add categories" ), this, SLOT( refineRuleCategories() ) ); mRefineMenu->addAction( tr( "Add ranges" ), this, SLOT( refineRuleRanges() ) ); btnRefineRule->setMenu( mRefineMenu ); btnAddRule->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.png" ) ) ); btnEditRule->setIcon( QIcon( QgsApplication::iconPath( "symbologyEdit.png" ) ) ); btnRemoveRule->setIcon( QIcon( QgsApplication::iconPath( "symbologyRemove.png" ) ) ); btnIncreasePriority->setIcon( QIcon( QgsApplication::iconPath( "symbologyUp.png" ) ) ); btnDecreasePriority->setIcon( QIcon( QgsApplication::iconPath( "symbologyDown.png" ) ) ); connect( treeRules, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( editRule() ) ); connect( btnAddRule, SIGNAL( clicked() ), this, SLOT( addRule() ) ); connect( btnEditRule, SIGNAL( clicked() ), this, SLOT( editRule() ) ); connect( btnRemoveRule, SIGNAL( clicked() ), this, SLOT( removeRule() ) ); connect( btnIncreasePriority, SIGNAL( clicked() ), this, SLOT( increasePriority() ) ); connect( btnDecreasePriority, SIGNAL( clicked() ), this, SLOT( decreasePriority() ) ); connect( radNoGrouping, SIGNAL( clicked() ), this, SLOT( setGrouping() ) ); connect( radGroupFilter, SIGNAL( clicked() ), this, SLOT( setGrouping() ) ); connect( radGroupScale, SIGNAL( clicked() ), this, SLOT( setGrouping() ) ); // Make sure buttons are always in the correct state chkUsingFirstRule->setChecked( mRenderer->usingFirstRule() ); chkEnableSymbolLevels->setChecked( mRenderer->usingSymbolLevels() ); // If symbol levels are used, forcefully check and gray-out the chkUsingFirstRule checkbox if (mRenderer->usingSymbolLevels() ) { forceUsingFirstRule(); } connect( chkUsingFirstRule, SIGNAL( clicked() ), this, SLOT( usingFirstRuleChanged() )); connect( chkEnableSymbolLevels, SIGNAL( clicked() ), this, SLOT( symbolLevelsEnabledChanged() ) ); connect( this, SIGNAL( forceChkUsingFirstRule() ), this, SLOT( forceUsingFirstRule() ) ); treeRules->populateRules(); }
void TrackInfoObject::parse() { // Log parsing of header information in developer mode. This is useful for // tracking down corrupt files. const QString& canonicalLocation = m_fileInfo.canonicalFilePath(); if (CmdlineArgs::Instance().getDeveloper()) { qDebug() << "TrackInfoObject::parse()" << canonicalLocation; } // Parse the information stored in the sound file. SoundSourceProxy proxy(canonicalLocation, m_pSecurityToken); Mixxx::SoundSource* pProxiedSoundSource = proxy.getProxiedSoundSource(); if (pProxiedSoundSource != NULL && proxy.parseHeader() == OK) { // Dump the metadata extracted from the file into the track. // TODO(XXX): This involves locking the mutex for every setXXX // method. We should figure out an optimization where there are private // setters that don't lock the mutex. // If Artist, Title and Type fields are not blank, modify them. // Otherwise, keep their current values. // TODO(rryan): Should we re-visit this decision? if (!(pProxiedSoundSource->getArtist().isEmpty())) { setArtist(pProxiedSoundSource->getArtist()); } if (!(pProxiedSoundSource->getTitle().isEmpty())) { setTitle(pProxiedSoundSource->getTitle()); } if (!(pProxiedSoundSource->getType().isEmpty())) { setType(pProxiedSoundSource->getType()); } setAlbum(pProxiedSoundSource->getAlbum()); setAlbumArtist(pProxiedSoundSource->getAlbumArtist()); setYear(pProxiedSoundSource->getYear()); setGenre(pProxiedSoundSource->getGenre()); setComposer(pProxiedSoundSource->getComposer()); setGrouping(pProxiedSoundSource->getGrouping()); setComment(pProxiedSoundSource->getComment()); setTrackNumber(pProxiedSoundSource->getTrackNumber()); setReplayGain(pProxiedSoundSource->getReplayGain()); setBpm(pProxiedSoundSource->getBPM()); setDuration(pProxiedSoundSource->getDuration()); setBitrate(pProxiedSoundSource->getBitrate()); setSampleRate(pProxiedSoundSource->getSampleRate()); setChannels(pProxiedSoundSource->getChannels()); setKeyText(pProxiedSoundSource->getKey(), mixxx::track::io::key::FILE_METADATA); setHeaderParsed(true); } else { qDebug() << "TrackInfoObject::parse() error at file" << canonicalLocation; setHeaderParsed(false); // Add basic information derived from the filename: parseFilename(); } }
QgsRuleBasedRendererV2Widget::QgsRuleBasedRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) : QgsRendererV2Widget( layer, style ) { // try to recognize the previous renderer // (null renderer means "no previous renderer") if ( !renderer || renderer->type() != "RuleRenderer" ) { // we're not going to use it - so let's delete the renderer delete renderer; // some default options QgsSymbolV2* symbol = QgsSymbolV2::defaultSymbol( mLayer->geometryType() ); mRenderer = new QgsRuleBasedRendererV2( symbol ); } else { mRenderer = static_cast<QgsRuleBasedRendererV2*>( renderer ); } setupUi( this ); treeRules->setRenderer( mRenderer ); mRefineMenu = new QMenu( btnRefineRule ); mRefineMenu->addAction( tr( "Add scales" ), this, SLOT( refineRuleScales() ) ); mRefineMenu->addAction( tr( "Add categories" ), this, SLOT( refineRuleCategories() ) ); mRefineMenu->addAction( tr( "Add ranges" ), this, SLOT( refineRuleRanges() ) ); btnRefineRule->setMenu( mRefineMenu ); btnAddRule->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.png" ) ) ); btnEditRule->setIcon( QIcon( QgsApplication::iconPath( "symbologyEdit.png" ) ) ); btnRemoveRule->setIcon( QIcon( QgsApplication::iconPath( "symbologyRemove.png" ) ) ); connect( treeRules, SIGNAL( itemDoubleClicked( QTreeWidgetItem*, int ) ), this, SLOT( editRule() ) ); connect( btnAddRule, SIGNAL( clicked() ), this, SLOT( addRule() ) ); connect( btnEditRule, SIGNAL( clicked() ), this, SLOT( editRule() ) ); connect( btnRemoveRule, SIGNAL( clicked() ), this, SLOT( removeRule() ) ); connect( radNoGrouping, SIGNAL( clicked() ), this, SLOT( setGrouping() ) ); connect( radGroupFilter, SIGNAL( clicked() ), this, SLOT( setGrouping() ) ); connect( radGroupScale, SIGNAL( clicked() ), this, SLOT( setGrouping() ) ); treeRules->populateRules(); }
PwSearchResultDataModel::PwSearchResultDataModel(QObject* parent) : bb::cascades::GroupDataModel(QStringList() << "groupPath", parent) { setGrouping(ItemGrouping::ByFullValue); }