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


C++ MythUIButtonListItem类代码示例

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


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

示例1: MythUIButtonListItem

void VideoSetupWizard::loadData(void)
{
    QStringList profiles = m_vdp->GetProfiles(gCoreContext->GetHostName());

    for (QStringList::const_iterator i = profiles.begin();
         i != profiles.end(); ++i)
    {
        MythUIButtonListItem *item =
            new MythUIButtonListItem(m_playbackProfileButtonList, *i);
        item->SetData(*i);
    }

    QString currentpbp = m_vdp->GetDefaultProfileName(gCoreContext->GetHostName());
    if (!currentpbp.isEmpty())
    {
        MythUIButtonListItem *set =
                m_playbackProfileButtonList->GetItemByData(currentpbp);
        m_playbackProfileButtonList->SetItemCurrent(set);
    }
}
开发者ID:Olti,项目名称:mythtv,代码行数:20,代码来源:setupwizard_video.cpp

示例2: upcoming

void ChannelRecPriority::upcoming()
{
    MythUIButtonListItem *item = m_channelList->GetItemCurrent();

    if (!item)
        return;

    ChannelInfo *chanInfo = item->GetData().value<ChannelInfo *>();

    if (!chanInfo || chanInfo->chanid < 1)
        return;

    QString chanID = QString("%1").arg(chanInfo->chanid);
    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
    ProgLister *pl = new ProgLister(mainStack, plChannel, chanID, "");
    if (pl->Create())
        mainStack->AddScreen(pl);
    else
        delete pl;
}
开发者ID:garybuhrmaster,项目名称:mythtv,代码行数:20,代码来源:channelrecpriority.cpp

示例3: tr

void RecordingSelector::updateRecordingList(void)
{
    if (!m_recordingList || m_recordingList->size() == 0)
        return;

    m_recordingButtonList->Reset();

    if (m_categorySelector)
    {
        ProgramInfo *p;
        vector<ProgramInfo *>::iterator i = m_recordingList->begin();
        for ( ; i != m_recordingList->end(); i++)
        {
            p = *i;

            if (p->GetTitle() == m_categorySelector->GetValue() ||
                m_categorySelector->GetValue() == tr("All Recordings"))
            {
                MythUIButtonListItem* item = new MythUIButtonListItem(
                    m_recordingButtonList,
                    p->GetTitle() + " ~ " +
                    p->GetScheduledStartTime().toString("dd MMM yy (hh:mm)"));
                item->setCheckable(true);
                if (m_selectedList.indexOf((ProgramInfo *) p) != -1)
                {
                    item->setChecked(MythUIButtonListItem::FullChecked);
                }
                else
                {
                    item->setChecked(MythUIButtonListItem::NotChecked);
                }

                item->SetData(qVariantFromValue(p));
            }
            qApp->processEvents();
        }
    }

    m_recordingButtonList->SetItemCurrent(m_recordingButtonList->GetItemFirst());
    titleChanged(m_recordingButtonList->GetItemCurrent());
}
开发者ID:Cougar,项目名称:mythtv,代码行数:41,代码来源:recordingselector.cpp

示例4: tr

void SearchView::ShowMenu(void)
{
    if (GetFocusWidget() == m_tracksList)
    {
        QString label = tr("Search Actions");

        MythMenu *menu = new MythMenu(label, this, "searchviewmenu");

        MythUIButtonListItem *item = m_tracksList->GetItemCurrent();
        if (item)
        {
            MusicMetadata *mdata = qVariantValue<MusicMetadata*> (item->GetData());
            if (mdata)
            {
                if (gPlayer->getCurrentPlaylist() && gPlayer->getCurrentPlaylist()->checkTrack(mdata->ID()))
                    menu->AddItem(tr("Remove From Playlist"));
                else
                {
                    menu->AddItem(tr("Add To Playlist"));
                    menu->AddItem(tr("Add To Playlist And Play"));
                }
            }
        }

        if (GetFocusWidget() == m_tracksList || GetFocusWidget() == m_currentPlaylist)
            menu->AddItem(tr("Search List..."));

        menu->AddItem(tr("More Options"), NULL, createSubMenu());

        MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");

        MythDialogBox *menuPopup = new MythDialogBox(menu, popupStack, "actionmenu");

        if (menuPopup->Create())
            popupStack->AddScreen(menuPopup);
        else
            delete menu;
    }
    else
        MusicCommon::ShowMenu();
}
开发者ID:DragonStalker,项目名称:mythtv,代码行数:41,代码来源:searchview.cpp

示例5: MythUIButtonListItem

void ProgLister::UpdateButtonList(void)
{
    ProgramList::const_iterator it = m_itemList.begin();
    for (; it != m_itemList.end(); ++it)
    {
        MythUIButtonListItem *item =
            new MythUIButtonListItem(
                m_progList, "", qVariantFromValue(*it));

        InfoMap infoMap;
        (**it).ToMap(infoMap);

        QString state = toUIState((**it).GetRecordingStatus());
        if ((state == "warning") && (plPreviouslyRecorded == m_type))
            state = "disabled";

        item->SetTextFromMap(infoMap, state);

        if (m_type == plTitle)
        {
            QString tempSubTitle = (**it).GetSubtitle();
            if (tempSubTitle.trimmed().isEmpty())
                tempSubTitle = (**it).GetTitle();
            item->SetText(tempSubTitle, "titlesubtitle", state);
        }

        item->DisplayState(
            QString::number((**it).GetStars(10)), "ratingstate");

        item->DisplayState(state, "status");
    }

    if (m_positionText)
    {
        m_positionText->SetText(
            tr("%1 of %2", "Current position in list where %1 is the "
               "position, %2 is the total count")
            .arg(m_progList->GetCurrentPos())
            .arg(m_progList->GetCount()));
    }
}
开发者ID:gdenning,项目名称:mythtv,代码行数:41,代码来源:proglist.cpp

示例6: remove

void ProgramRecPriority::remove(void)
{
    MythUIButtonListItem *item = m_programList->GetItemCurrent();
    if (!item)
        return;

    ProgramRecPriorityInfo *pgRecInfo =
                        item->GetData().value<ProgramRecPriorityInfo*>();

    if (!pgRecInfo ||
        (pgRecInfo->recType == kTemplateRecord &&
         pgRecInfo->GetCategory()
         .compare("Default", Qt::CaseInsensitive) == 0))
    {
        return;
    }

    RecordingRule *record = new RecordingRule();
    record->m_recordID = pgRecInfo->GetRecordingRuleID();
    if (!record->Load())
    {
        delete record;
        return;
    }

    QString message = tr("Delete '%1' %2 rule?").arg(record->m_title)
        .arg(toString(pgRecInfo->GetRecordingRuleType()));

    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");

    MythConfirmationDialog *okPopup = new MythConfirmationDialog(popupStack,
                                                                message, true);

    okPopup->SetReturnEvent(this, "deleterule");
    okPopup->SetData(qVariantFromValue(record));

    if (okPopup->Create())
        popupStack->AddScreen(okPopup);
    else
        delete okPopup;
}
开发者ID:Saner2oo2,项目名称:mythtv,代码行数:41,代码来源:programrecpriority.cpp

示例7: GetCurrentKey

/**
 *  \brief Get the currently selected key string
 *
 *   If no key is selected, an empty string is returned.
 *
 *  \return The currently selected key string
 */
QString MythControls::GetCurrentKey(void)
{
    MythUIButtonListItem* currentButton;
    if (m_leftListType == kKeyList &&
        (currentButton = m_leftList->GetItemCurrent()))
    {
        return currentButton->GetText();
    }

    if (GetFocusWidget() == m_leftList)
        return QString();

    if ((m_leftListType == kContextList) && (m_rightListType == kActionList))
    {
        QString context = GetCurrentContext();
        QString action = GetCurrentAction();
        uint b = GetCurrentButton();
        QStringList keys = m_bindings->GetActionKeys(context, action);

        if (b < (uint)keys.count())
            return keys[b];

        return QString();
    }

    currentButton = m_rightList->GetItemCurrent();
    QString desc;
    if (currentButton)
        desc = currentButton->GetText();

    int loc = desc.indexOf(" => ");
    if (loc == -1)
        return QString(); // Should not happen


    if (m_rightListType == kKeyList)
        return desc.left(loc);

    return desc.mid(loc + 4);
}
开发者ID:JGunning,项目名称:OpenAOL-TV,代码行数:47,代码来源:mythcontrols.cpp

示例8: recordFile

void ImportFile::recordFile(void)
{
    MythUIButtonListItem *item = m_recordingButtonList->GetItemCurrent();

    if (!item)
        return;

    ImportItem *i = item->GetData().value<ImportItem *>();

    if (!i)
        return;

    if (!doPlayFile(i, false))
        return;

    QString message = tr("Getting List Of Recording.\nPlease Wait...");

    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");

    MythUIBusyDialog *busyPopup = new
            MythUIBusyDialog(message, popupStack, "recordingbusydialog");

    if (busyPopup->Create())
        popupStack->AddScreen(busyPopup, false);
    else
    {
        delete busyPopup;
        busyPopup = NULL;
    }

    GetImportRecordingThread *thread = new GetImportRecordingThread(this);
    while (thread->isRunning())
    {
        qApp->processEvents();
        usleep(2000);
    }

    if (busyPopup)
        busyPopup->Close();
}
开发者ID:paul-h,项目名称:mythtv,代码行数:40,代码来源:importfile.cpp

示例9: tr

void ImportFile::updateRecordingList(void)
{
    if (m_recordingList.empty())
        return;

    m_recordingButtonList->Reset();

    if (m_categorySelector)
    {
        ImportItem *i;
        for (int x = 0; x < m_recordingList.count(); x++)
        {
            i = m_recordingList.at(x);

            if (i->category == m_categorySelector->GetValue() ||
                m_categorySelector->GetValue() == tr("All Recordings"))
            {
                MythUIButtonListItem* item = new MythUIButtonListItem(
                    m_recordingButtonList,
                    i->title + " ~ " + MythDate::toString(i->startTime, MythDate::kDateTimeFull + MythDate::kAutoYear));
                item->setCheckable(true);

                if (m_selectedList.indexOf((ImportItem *) i) != -1)
                {
                    item->setChecked(MythUIButtonListItem::FullChecked);
                }
                else
                {
                    item->setChecked(MythUIButtonListItem::NotChecked);
                }

                item->SetData(qVariantFromValue(i));
            }
            qApp->processEvents();
        }
    }

    m_recordingButtonList->SetItemCurrent(m_recordingButtonList->GetItemFirst());
    titleChanged(m_recordingButtonList->GetItemCurrent());
}
开发者ID:paul-h,项目名称:mythtv,代码行数:40,代码来源:importfile.cpp

示例10: tr

void SearchStream::updateStreams(void)
{
    m_streamList->Reset();

    QString station = m_stationList->GetValue();
    QString genre = m_genreList->GetValue();
    QString channel = m_channelEdit->GetText();

    bool searchStation = (station != tr("<All Stations>"));
    bool searchGenre = (genre != tr("<All Genres>"));
    bool searchChannel = !channel.isEmpty();

    QMap<QString, Metadata>::iterator it;

    for (it = m_streams.begin(); it != m_streams.end(); ++it)
    {
        Metadata *mdata = &(*it);

        if (searchStation && station != mdata->Station())
            continue;

        if (searchGenre && !mdata->Genre().contains(genre, Qt::CaseInsensitive))
            continue;

        if (searchChannel && !mdata->Channel().contains(channel, Qt::CaseInsensitive))
            continue;

        // if we got here we must have a match so add it to the list
        MythUIButtonListItem *item = new MythUIButtonListItem(m_streamList, 
                "", qVariantFromValue(mdata));

        MetadataMap metadataMap;
        mdata->toMap(metadataMap);
        item->SetTextFromMap(metadataMap);

        item->SetText(" ", "dummy");
    }

    m_matchesText->SetText(QString("%1").arg(m_streamList->GetCount()));
}
开发者ID:bfosberry,项目名称:mythtv,代码行数:40,代码来源:streamview.cpp

示例11: MythUIButtonListItem

MythUIButtonListItem* StatusBox::AddLogLine(const QString & line,
                                            const QString & help,
                                            const QString & detail,
                                            const QString & helpdetail,
                                            const QString & state,
                                            const QString & data)
{
    LogLine logline;
    logline.line = line;

    if (detail.isEmpty())
        logline.detail = line;
    else
        logline.detail = detail;

    if (help.isEmpty())
        logline.help = logline.detail;
    else
        logline.help = help;

    if (helpdetail.isEmpty())
        logline.helpdetail = logline.detail;
    else
        logline.helpdetail = helpdetail;

    logline.state = state;
    logline.data = data;

    MythUIButtonListItem *item = new MythUIButtonListItem(m_logList, line,
                                                qVariantFromValue(logline));
    if (logline.state.isEmpty())
        logline.state = "normal";

    item->SetFontState(logline.state);
    item->DisplayState(logline.state, "status");
    item->SetText(logline.detail, "detail");

    return item;
}
开发者ID:killerkiwi,项目名称:mythtv,代码行数:39,代码来源:statusbox.cpp

示例12: del

void ChannelEditor::del()
{
    MythUIButtonListItem *item = m_channelList->GetItemCurrent();

    if (!item)
        return;

    QString message = tr("Delete channel '%1'?").arg(item->GetText("name"));

    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
    MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);

    if (dialog->Create())
    {
        dialog->SetData(qVariantFromValue(item));
        dialog->SetReturnEvent(this, "delsingle");
        popupStack->AddScreen(dialog);
    }
    else
        delete dialog;

}
开发者ID:StefanRoss,项目名称:mythtv,代码行数:22,代码来源:channeleditor.cpp

示例13: while

/** \fn RawSettingsEditor::Init(void)
 *  \brief Initialize the settings screen with the loaded data
 */
void RawSettingsEditor::Init(void)
{
    QList<QString>settingsList = m_settings.keys();
    QList<QString>::iterator it = settingsList.begin();

    while (it != settingsList.end())
    {
        MythUIButtonListItem *item = new MythUIButtonListItem(m_settingsList,
                                                    "", qVariantFromValue(*it));

        if (m_settings[*it].isEmpty())
            item->SetText(*it);
        else
            item->SetText(m_settings[*it]);

        ++it;
    }

    m_settingsList->SetItemCurrent(0);
    m_textLabel->SetText(m_settingsList->GetItemFirst()->GetText());
    updatePrevNextTexts();
}
开发者ID:garybuhrmaster,项目名称:mythtv,代码行数:25,代码来源:rawsettingseditor.cpp

示例14: editFileMetadata

void ImportFile::editFileMetadata(void)
{
    MythUIButtonListItem *item = m_recordingButtonList->GetItemCurrent();

    if (!item)
        return;

    ImportItem *i = item->GetData().value<ImportItem *>();

    if (!i)
        return;

    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();

    ImportEditMetadataDialog *editor = new ImportEditMetadataDialog(mainStack, i);

    connect(editor, SIGNAL(haveResult(bool, ImportItem *)),
            this, SLOT(editorClosed(bool, ImportItem *)));

    if (editor->Create())
        mainStack->AddScreen(editor);
}
开发者ID:paul-h,项目名称:mythtv,代码行数:22,代码来源:importfile.cpp

示例15: menu

void ChannelEditor::menu()
{
    MythUIButtonListItem *item = m_channelList->GetItemCurrent();

    if (!item)
        return;

    int chanid = item->GetData().toInt();
    if (chanid == 0)
       edit(item);
    else
    {
        QString label = tr("Channel Options");

        MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");

        MythDialogBox *menu = new MythDialogBox(label, popupStack, "chanoptmenu");

        if (menu->Create())
        {
            menu->SetReturnEvent(this, "channelopts");

            menu->AddButton(tr("Edit"));
//             if ()
//                 menu->AddButton(tr("Set Hidden"));
//             else
//                 menu->AddButton(tr("Set Visible"));
            menu->AddButton(tr("Delete"));

            popupStack->AddScreen(menu);
        }
        else
        {
            delete menu;
            return;
        }
    }
}
开发者ID:StefanRoss,项目名称:mythtv,代码行数:38,代码来源:channeleditor.cpp


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