void
PluginManagerAttributes::SetPluginCategoryName(const std::string &s, const std::string &c)
{
    int index = GetIndexByID(s);
    if(index >= 0 && (size_t)index < category.size())
    {
        category[index] = c;
        SelectCategory();
    }
}
Beispiel #2
0
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tSiriusController::CreateSiriusActions()
{
    // Select from all available channels action
    m_pSelectFromAllAction = new tAction(QIcon(), tr("Subscribed", "Sirius subscribed channels menu selection"), this );
    Connect( m_pSelectFromAllAction, SIGNAL( triggered() ), this, SLOT( SelectChannels() ), Qt::QueuedConnection );

    // Select from favorites only action
    m_pSelectFromFavoritesAction = new tAction(QIcon(), tr("Favorites", "Sirius user favorite channels menu selection"), this );
    Connect( m_pSelectFromFavoritesAction, SIGNAL( triggered() ), this, SLOT(SelectFavoriteChannels() ) );

    RefreshFavoriteChannels(tAudioSettings::Instance()->Favorites());

    // Channels status action
    m_pAllChannelStatusAction = new tAction(QIcon(), tr("All", "Sirius all channels menu selection"), this );
    Connect( m_pAllChannelStatusAction, SIGNAL( triggered() ), this, SLOT( AllChannelStatus() ) );

    // Select by category action
    m_pCategoryAction = new tAction( tr( "By category", "Sirius channel categories menu selection" ), this );
    Connect( m_pCategoryAction, SIGNAL( triggered() ), this, SLOT( SelectCategory() )) ; 

    // Channels SubMenu 
    m_pChannelsSubMenuAction = new tAction( tr( "Channels", "Sirius channel menu selection" ), this );
    m_pChannelsSubMenuAction->AppendSubAction( m_pSelectFromAllAction );
    m_pChannelsSubMenuAction->AppendSubAction( m_pSelectFromFavoritesAction );
    m_pChannelsSubMenuAction->AppendSubAction( m_pAllChannelStatusAction );
    m_pChannelsSubMenuAction->AppendSubAction( m_pCategoryAction );
    //when channels is selected we need to know this so we can refresh lists and whether a menu selection is grayed out or not
    Connect( m_pChannelsSubMenuAction, SIGNAL( triggered() ), this, SLOT( ChannelsSubmenuSelected() ) );
    //the above works for Cougar, but is not working for HDS, so in contextMenuEvent I update the channels menu
    m_MenuActionList << m_pChannelsSubMenuAction;

    m_pOptionsAction = new tAction( tr( "Options" ), this );

    // Lock code action
    m_pLockCodeAction = new tAction( tr( "Change lock code" ), this );
    Connect( m_pLockCodeAction, SIGNAL( triggered() ), this, SLOT( LockCode() ), Qt::QueuedConnection );
    m_MenuActionList << m_pLockCodeAction;

    // Lock current channel action
    m_pLockChannelAction = new tAction( tr("Lock channel"), this );
    m_pLockChannelAction->setCheckable( true );
    Connect( m_pLockChannelAction, SIGNAL( toggled( bool ) ), this, SLOT( LockChannel( bool ) ) );
    m_MenuActionList << m_pLockChannelAction;

}