当前位置: 首页>>代码示例>>C++>>正文


C++ MythUIButtonListItem::SetData方法代码示例

本文整理汇总了C++中MythUIButtonListItem::SetData方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIButtonListItem::SetData方法的具体用法?C++ MythUIButtonListItem::SetData怎么用?C++ MythUIButtonListItem::SetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MythUIButtonListItem的用法示例。


在下文中一共展示了MythUIButtonListItem::SetData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Init

void AudioSetupWizard::Init(void)
{
    for (QVector<AudioOutput::AudioDeviceConfig>::const_iterator it = m_outputlist->begin();
        it != m_outputlist->end(); it++)
    {
        QString name = it->name;
        MythUIButtonListItem *output =
                new MythUIButtonListItem(m_audioDeviceButtonList, name);
        output->SetData(name);
    }

    MythUIButtonListItem *stereo =
                new MythUIButtonListItem(m_speakerNumberButtonList, "Stereo");
    stereo->SetData(2);

    MythUIButtonListItem *sixchan =
                new MythUIButtonListItem(m_speakerNumberButtonList, "5.1 Channel Audio");
    sixchan->SetData(6);

    MythUIButtonListItem *eightchan =
                new MythUIButtonListItem(m_speakerNumberButtonList, "7.1 Channel Audio");
    eightchan->SetData(8);

    // If there is a DB value for device and channels, set the buttons accordingly.

    QString currentDevice = gCoreContext->GetSetting("AudioOutputDevice");
    int channels = gCoreContext->GetNumSetting("MaxChannels", 2);

    if (!currentDevice.isEmpty())
        m_audioDeviceButtonList->SetValueByData(qVariantFromValue(currentDevice));
    m_speakerNumberButtonList->SetValueByData(qVariantFromValue(channels));
}
开发者ID:,项目名称:,代码行数:32,代码来源:

示例2: fillRegionList

void PlayerSettings::fillRegionList()
{
    MythUIButtonListItem *noRegion =
            new MythUIButtonListItem(m_blurayRegionList, tr("No Region"));
    noRegion->SetData(0);

    MythUIButtonListItem *regionA =
            new MythUIButtonListItem(m_blurayRegionList, tr("Region A: "
                                     "The Americas, Southeast Asia, Japan"));
    regionA->SetData(1);

    MythUIButtonListItem *regionB =
            new MythUIButtonListItem(m_blurayRegionList, tr("Region B: "
                                     "Europe, Middle East, Africa, Oceania"));
    regionB->SetData(2);

    MythUIButtonListItem *regionC =
            new MythUIButtonListItem(m_blurayRegionList, tr("Region C: "
                                     "Eastern Europe, Central and South Asia"));
    regionC->SetData(4);

    int region = gCoreContext->GetNumSetting("BlurayRegionCode", 0);

    MythUIButtonListItem *item = m_blurayRegionList->GetItemByData(region);

    if (item)
        m_blurayRegionList->SetItemCurrent(item);
}
开发者ID:Saner2oo2,项目名称:mythtv,代码行数:28,代码来源:videoplayersettings.cpp

示例3: fillGrabberButtonList

void SearchEditor::fillGrabberButtonList()
{
    for (GrabberScript::scriptList::iterator i = m_grabberList.begin();
            i != m_grabberList.end(); ++i)
    {
        MythUIButtonListItem *item =
                    new MythUIButtonListItem(m_grabbers, (*i)->GetTitle());
        if (item)
        {
            item->SetText((*i)->GetTitle(), "title");
            item->SetData(qVariantFromValue(*i));
            QString img = (*i)->GetImage();
            QString thumb;
            if (!img.startsWith("/") && !img.isEmpty())
                thumb = QString("%1mythnetvision/icons/%2").arg(GetShareDir())
                            .arg((*i)->GetImage());
            else
                thumb = img;
            item->SetImage(thumb);
            item->setCheckable(true);
            item->setChecked(MythUIButtonListItem::NotChecked);
            QFileInfo fi((*i)->GetCommandline());
            if (findSearchGrabberInDB(fi.fileName(), VIDEO))
                item->setChecked(MythUIButtonListItem::FullChecked);
        }
        else
            delete item;
    }
}
开发者ID:Cougar,项目名称:mythtv,代码行数:29,代码来源:searcheditor.cpp

示例4: UpdateURLList

void BookmarkManager::UpdateURLList(void)
{
    m_bookmarkList->Reset();

    if (m_messageText)
        m_messageText->SetVisible((m_siteList.count() == 0));

    MythUIButtonListItem *item = m_groupList->GetItemCurrent();
    if (!item)
        return;

    QString group = item->GetText();

    for (int x = 0; x < m_siteList.count(); x++)
    {
        Bookmark *site = m_siteList.at(x);

        if (group == site->category)
        {
            MythUIButtonListItem *item = new MythUIButtonListItem(
                    m_bookmarkList, "", "", true, MythUIButtonListItem::NotChecked);
            item->SetText(site->name, "name");
            item->SetText(site->url, "url");
            if (site->isHomepage)
                item->DisplayState("yes", "homepage");
            item->SetData(qVariantFromValue(site));
            item->setChecked(site->selected ?
                    MythUIButtonListItem::FullChecked : MythUIButtonListItem::NotChecked);
        }
    }
}
开发者ID:DragonStalker,项目名称:mythtv,代码行数:31,代码来源:bookmarkmanager.cpp

示例5: updateMenu

void MythDialogBox::updateMenu(void)
{
    if (!m_buttonList)
    {
         LOG(VB_GENERAL, LOG_ERR, "UpdateMenu() called before we have a button list to update!");
         return;
    }

    if (!m_currentMenu)
        return;

    if (m_titlearea)
        m_titlearea->SetText(m_currentMenu->m_title);

    m_textarea->SetText(m_currentMenu->m_text);

    m_buttonList->Reset();

    for (int x = 0; x < m_currentMenu->m_menuItems.count(); x++)
    {
        MythMenuItem *menuItem = m_currentMenu->m_menuItems.at(x);
        MythUIButtonListItem *button = new MythUIButtonListItem(m_buttonList, menuItem->Text);
        button->SetData(qVariantFromValue(menuItem));
        button->setDrawArrow((menuItem->SubMenu != NULL));

        if (m_currentMenu->m_selectedItem == x)
            m_buttonList->SetItemCurrent(button);
    }
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例6: updateArchiveList

void ExportNative::updateArchiveList(void)
{
    m_archiveButtonList->Reset();

    if (m_archiveList.size() == 0)
    {
        m_titleText->SetText("");
        m_datetimeText->SetText("");
        m_descriptionText->SetText("");
        m_filesizeText->SetText("");
        m_nofilesText->Show();
    }
    else
    {
        ArchiveItem *a;
        for (int x = 0;  x < m_archiveList.size(); x++)
        {
            a = m_archiveList.at(x);

            MythUIButtonListItem* item = new MythUIButtonListItem(m_archiveButtonList, a->title);
            item->SetData(qVariantFromValue(a));
        }

        m_archiveButtonList->SetItemCurrent(m_archiveButtonList->GetItemFirst());
        titleChanged(m_archiveButtonList->GetItemCurrent());
        m_nofilesText->Hide();
    }

    updateSizeBar();
}
开发者ID:lazerdye,项目名称:mythtv,代码行数:30,代码来源:exportnative.cpp

示例7: updateTrackList

void Ripper::updateTrackList(void)
{
    if (m_tracks->isEmpty())
        return;

    QString tmptitle;
    if (m_trackList)
    {
        m_trackList->Reset();

        int i;
        for (i = 0; i < (int)m_tracks->size(); i++)
        {
            if (i >= m_tracks->size())
                break;

            RipTrack *track = m_tracks->at(i);
            Metadata *metadata = track->metadata;

            MythUIButtonListItem *item = new MythUIButtonListItem(m_trackList,"");

            item->setCheckable(true);

            item->SetData(qVariantFromValue(track));

            if (track->isNew)
                item->DisplayState("new", "yes");
            else
                item->DisplayState("new", "no");

            if (track->active)
                item->setChecked(MythUIButtonListItem::FullChecked);
            else
                item->setChecked(MythUIButtonListItem::NotChecked);

            item->SetText(QString::number(metadata->Track()), "track");
            item->SetText(metadata->Title(), "title");
            item->SetText(metadata->Artist(), "artist");

            int length = track->length / 1000;
            if (length > 0)
            {
                int min, sec;
                min = length / 60;
                sec = length % 60;
                QString s;
                s.sprintf("%02d:%02d", min, sec);
                item->SetText(s, "length");
            }
            else
                item->SetText("", "length");

//             if (i == m_currentTrack)
//                 m_trackList->SetItemCurrent(i);
        }
    }
}
开发者ID:Olti,项目名称:mythtv,代码行数:57,代码来源:cdrip.cpp

示例8: Create

bool SelectDestination::Create(void)
{
    bool foundtheme = false;

    // Load the theme for this screen
    foundtheme = LoadWindowFromXML("mytharchive-ui.xml", "selectdestination", this);

    if (!foundtheme)
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_createISOCheck, "makeisoimage_check", &err);
    UIUtilE::Assign(this, m_doBurnCheck, "burntodvdr_check", &err);
    UIUtilE::Assign(this, m_doBurnText, "burntodvdr_text", &err);
    UIUtilE::Assign(this, m_eraseDvdRwCheck, "erasedvdrw_check", &err);
    UIUtilE::Assign(this, m_eraseDvdRwText, "erasedvdrw_text", &err);
    UIUtilE::Assign(this, m_nextButton, "next_button", &err);
    UIUtilE::Assign(this, m_prevButton, "prev_button", &err);
    UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);
    UIUtilE::Assign(this, m_destinationSelector, "destination_selector", &err);
    UIUtilE::Assign(this, m_destinationText, "destination_text", &err);
    UIUtilE::Assign(this, m_findButton, "find_button", &err);
    UIUtilE::Assign(this, m_filenameEdit, "filename_edit", &err);
    UIUtilE::Assign(this, m_freespaceText, "freespace_text", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'selectdestination'");
        return false;
    }

    connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(handleNextPage()));
    connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(handlePrevPage()));
    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(handleCancel()));

    connect(m_destinationSelector, SIGNAL(itemSelected(MythUIButtonListItem*)),
            this, SLOT(setDestination(MythUIButtonListItem*)));

    for (int x = 0; x < ArchiveDestinationsCount; x++)
    {
        MythUIButtonListItem *item = new 
            MythUIButtonListItem(m_destinationSelector, tr(ArchiveDestinations[x].name));
        item->SetData(qVariantFromValue(ArchiveDestinations[x].type));
    }
    connect(m_findButton, SIGNAL(Clicked()), this, SLOT(handleFind()));

    connect(m_filenameEdit, SIGNAL(LosingFocus()), this,
            SLOT(filenameEditLostFocus()));

    BuildFocusList();

    SetFocusWidget(m_nextButton);

    loadConfiguration();

    return true;
}
开发者ID:JackOfMostTrades,项目名称:mythtv,代码行数:57,代码来源:selectdestination.cpp

示例9: AddButton

void MythDialogBox::AddButton(const QString &title, QVariant data, bool newMenu,
                              bool setCurrent)
{
    MythUIButtonListItem *button = new MythUIButtonListItem(m_buttonList, title);
    button->SetData(data);
    button->setDrawArrow(newMenu);

    if (setCurrent)
        m_buttonList->SetItemCurrent(button);
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例10: updateVideoList

void VideoSelector::updateVideoList(void)
{
    if (!m_videoList)
        return;

    m_videoButtonList->Reset();

    if (m_categorySelector)
    {
        VideoInfo *v;
        vector<VideoInfo *>::iterator i = m_videoList->begin();
        for ( ; i != m_videoList->end(); ++i)
        {
            v = *i;

            if (v->category == m_categorySelector->GetValue() ||
                m_categorySelector->GetValue() == tr("All Videos"))
            {
                if (v->parentalLevel <= m_currentParentalLevel)
                {
                    MythUIButtonListItem* item = new MythUIButtonListItem(
                            m_videoButtonList, v->title);
                    item->setCheckable(true);
                    if (m_selectedList.indexOf((VideoInfo *) v) != -1)
                    {
                        item->setChecked(MythUIButtonListItem::FullChecked);
                    }
                    else
                    {
                        item->setChecked(MythUIButtonListItem::NotChecked);
                    }

                    item->SetData(qVariantFromValue(v));
                }
            }
        }
    }

    if (m_videoButtonList->GetCount() > 0)
    {
        m_videoButtonList->SetItemCurrent(m_videoButtonList->GetItemFirst());
        titleChanged(m_videoButtonList->GetItemCurrent());
        m_warningText->Hide();
    }
    else
    {
        m_warningText->Show();
        m_titleText->Reset();
        m_plotText->Reset();
        m_coverImage->SetFilename("blank.png");
        m_coverImage->Load();
        m_filesizeText->Reset();
    }
}
开发者ID:Beirdo,项目名称:mythtv-stabilize,代码行数:54,代码来源:videoselector.cpp

示例11: MythUIButtonListItem

MythUIButtonListItem *MythGenericTree::CreateListButton(MythUIButtonList *list)
{
    MythUIButtonListItem *item = new MythUIButtonListItem(list, getString());
    item->SetData(qVariantFromValue(this));
    item->SetTextFromMap(m_strings);
    item->SetImageFromMap(m_imageFilenames);

    if (visibleChildCount() > 0)
        item->setDrawArrow(true);

    return item;
}
开发者ID:Openivo,项目名称:mythtv,代码行数:12,代码来源:mythgenerictree.cpp

示例12: storeRule

void CustomEdit::storeRule(bool is_search, bool is_new)
{
    CustomRuleInfo rule;
    rule.recordid = '0';
    rule.title = m_titleEdit->GetText();
    rule.subtitle = m_subtitleEdit->GetText();
    rule.description = m_descriptionEdit->GetText();

    MSqlQuery query(MSqlQuery::InitCon());
    query.prepare("REPLACE INTO customexample "
                   "(rulename,fromclause,whereclause,search) "
                   "VALUES(:RULE,:FROMC,:WHEREC,:SEARCH);");
    query.bindValue(":RULE", rule.title);
    query.bindValue(":FROMC", rule.subtitle);
    query.bindValue(":WHEREC", rule.description);
    query.bindValue(":SEARCH", is_search);

    if (is_search)
        rule.title += m_seSuffix;
    else
        rule.title += m_exSuffix;

    if (!query.exec())
        MythDB::DBError("Store custom example", query);
    else if (is_new)
    {
        new MythUIButtonListItem(m_clauseList, rule.title,
                                 qVariantFromValue(rule));
    }
    else
    {
        /* Modify the existing entry.  We know one exists from the database
           search but do not know its position in the clause list.  It may
           or may not be the current item. */
        for (int i = m_maxex; i < m_clauseList->GetCount(); i++)
        {
            MythUIButtonListItem* item = m_clauseList->GetItemAt(i);
            QString removedStr = item->GetText().remove(m_seSuffix)
                                                .remove(m_exSuffix);
            if (m_titleEdit->GetText() == removedStr)
            {
                item->SetData(qVariantFromValue(rule));
                clauseChanged(item);
                break;
            }
        }
    }


}
开发者ID:,项目名称:,代码行数:50,代码来源:

示例13: loadSites

void MythNews::loadSites(void)
{
    QMutexLocker locker(&m_lock);

    clearSites();

    MSqlQuery query(MSqlQuery::InitCon());
    query.prepare(
        "SELECT name, url, ico, updated, podcast "
        "FROM newssites "
        "ORDER BY name");

    if (!query.exec())
    {
        MythDB::DBError(LOC_ERR + "Could not load sites from DB", query);
        return;
    }

    while (query.next())
    {
        QString name = query.value(0).toString();
        QString url  = query.value(1).toString();
        QString icon = query.value(2).toString();
        QDateTime time = MythDate::fromTime_t(query.value(3).toUInt());
        bool podcast = query.value(4).toInt();
        m_NewsSites.push_back(new NewsSite(name, url, time, podcast));
    }

    NewsSite::List::iterator it = m_NewsSites.begin();
    for (; it != m_NewsSites.end(); ++it)
    {
        MythUIButtonListItem *item =
            new MythUIButtonListItem(m_sitesList, (*it)->name());
        item->SetData(qVariantFromValue(*it));

        connect(*it, SIGNAL(finished(NewsSite*)),
                this, SLOT(slotNewsRetrieved(NewsSite*)));
    }

    slotRetrieveNews();

    if (m_nositesText)
    {
        if (m_NewsSites.size() == 0)
            m_nositesText->Show();
        else
            m_nositesText->Hide();
    }
}
开发者ID:drsami,项目名称:mythtv,代码行数:49,代码来源:mythnews.cpp

示例14: loadData

void MythNewsConfig::loadData(void)
{
    QMutexLocker locker(&m_lock);

    NewsCategory::List::iterator it = m_priv->categoryList.begin();
    for (; it != m_priv->categoryList.end(); ++it)
    {
        MythUIButtonListItem *item =
            new MythUIButtonListItem(m_categoriesList, (*it).name);
        item->SetData(qVariantFromValue(&(*it)));
        if (!(*it).siteList.empty())
            item->setDrawArrow(true);
    }
    slotCategoryChanged(m_categoriesList->GetItemFirst());
}
开发者ID:Beirdo,项目名称:mythtv-stabilize,代码行数:15,代码来源:mythnewsconfig.cpp

示例15: loadData

void NetTree::loadData(void)
{
    if (m_type == DLG_TREE)
        m_siteMap->AssignTree(m_siteGeneric);
    else
    {
        m_siteButtonList->Reset();

        if (!m_currentNode)
            SetCurrentNode(m_siteGeneric);

        if (!m_currentNode)
            return;

        MythGenericTree *selectedNode = m_currentNode->getSelectedChild();

        typedef QList<MythGenericTree *> MGTreeChildList;
        MGTreeChildList *lchildren = m_currentNode->getAllChildren();

        for (MGTreeChildList::const_iterator p = lchildren->begin();
                p != lchildren->end(); ++p)
        {
            if (*p != NULL)
            {
                MythUIButtonListItem *item =
                        new MythUIButtonListItem(m_siteButtonList, QString(), 0,
                                true, MythUIButtonListItem::NotChecked);

                item->SetData(qVariantFromValue(*p));

                UpdateItem(item);

                if (*p == selectedNode)
                    m_siteButtonList->SetItemCurrent(item);
            }
        }

        slotItemChanged();
    }

    if (m_siteGeneric->childCount() == 0 && m_noSites)
        m_noSites->SetVisible(true);
    else if (m_noSites)
        m_noSites->SetVisible(false);

    if (m_siteGeneric->childCount() == 0)
        runTreeEditor();
}
开发者ID:JackOfMostTrades,项目名称:mythtv,代码行数:48,代码来源:nettree.cpp


注:本文中的MythUIButtonListItem::SetData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。