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


C++ DialogCompletionEvent类代码示例

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


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

示例1: customEvent

// does not need locking
void MythNews::customEvent(QEvent *event)
{
    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);

        QString resultid  = dce->GetId();
        int     buttonnum = dce->GetResult();

        if (resultid == "options")
        {
            if (m_NewsSites.size() > 0)
            {
                if (buttonnum == 0)
                    ShowFeedManager();
                else if (buttonnum == 1)
                    ShowEditDialog(false);
                else if (buttonnum == 2)
                    ShowEditDialog(true);
                else if (buttonnum == 3)
                    deleteNewsSite();
            }
            else
                if (buttonnum == 0)
                    ShowEditDialog(false);
        }

        m_menuPopup = NULL;
    }
}
开发者ID:drsami,项目名称:mythtv,代码行数:31,代码来源:mythnews.cpp

示例2: customEvent

void ExitPrompter::customEvent(QEvent *event)
{
    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);

        QString resultid= dce->GetId();
        int buttonnum = dce->GetResult();
        
        if (resultid == "mythfillprompt")
        {
            quit();
        }
        else if (resultid == "problemprompt")
        {
            switch (buttonnum)
            {
                case 0 :
                    break;
                case 1 :
                    masterPromptExit();
                    break;
            }
        }
    }
}
开发者ID:Openivo,项目名称:mythtv,代码行数:26,代码来源:exitprompt.cpp

示例3: customEvent

void MythThemedMenu::customEvent(QEvent *event)
{
    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);

        QString resultid = dce->GetId();
        //int buttonnum = dce->GetResult();
        QString halt_cmd = GetMythDB()->GetSetting("HaltCommand");
        QString reboot_cmd = GetMythDB()->GetSetting("RebootCommand");

        if (resultid == "popmenu")
        {
            QString action = dce->GetData().toString();
            if (action == "shutdown")
            {
                if (!halt_cmd.isEmpty())
                    myth_system(halt_cmd);
            }
            else if (action == "reboot")
            {
                if (!reboot_cmd.isEmpty())
                    myth_system(reboot_cmd);
            }
            else if (action == "about")
            {
                aboutScreen();
            }
            else if (action == "standby")
            {
                QString arg("standby_mode");
                m_state->m_callback(m_state->m_callbackdata, arg);
            }
        }
        else if (resultid == "password")
        {
            QString text = dce->GetResultText();
            MythUIButtonListItem *item = m_buttonList->GetItemCurrent();
            ThemedButton button = item->GetData().value<ThemedButton>();
            QString password = GetMythDB()->GetSetting(button.password);
            if (text == password)
            {
                QString timestamp_setting = QString("%1Time").arg(button.password);
                QDateTime curr_time = QDateTime::currentDateTime();
                QString last_time_stamp = curr_time.toString(Qt::TextDate);
                GetMythDB()->SetSetting(timestamp_setting, last_time_stamp);
                GetMythDB()->SaveSetting(timestamp_setting, last_time_stamp);
                buttonAction(item, true);
            }
        }

        m_menuPopup = NULL;
    }
}
开发者ID:killerkiwi,项目名称:mythtv,代码行数:54,代码来源:myththemedmenu.cpp

示例4: customEvent

void ImportMusicDialog::customEvent(QEvent *event)
{
    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
        if (dce->GetId() == "locationchange")
        {
            m_locationEdit->SetText(dce->GetResultText());
            startScan();
        }
    }
}
开发者ID:txase,项目名称:mythtv,代码行数:12,代码来源:importmusic.cpp

示例5: customEvent

void RSSEditPopup::customEvent(QEvent *levent)
{
    if (levent->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(levent);
        if (dce->GetId() == CEID_NEWIMAGE)
        {
            m_thumbImage->SetFilename(dce->GetResultText());
            m_thumbImage->Load();
            m_thumbImage->Show();
        }
    }
}
开发者ID:Cougar,项目名称:mythtv,代码行数:13,代码来源:rsseditor.cpp

示例6: customEvent

void EditRomInfoDialog::customEvent(QEvent *event)
{
    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
        const QString resultid = dce->GetId();

        if (resultid == CEID_FANARTFILE)
            SetFanart(dce->GetResultText());
        else if (resultid == CEID_SCREENSHOTFILE)
            SetScreenshot(dce->GetResultText());
        else if (resultid == CEID_BOXARTFILE)
            SetBoxart(dce->GetResultText());
    }
}
开发者ID:Cougar,项目名称:mythtv,代码行数:15,代码来源:romedit.cpp

示例7: VERBOSE

void BackendSelection::customEvent(QEvent *event)
{
    if (((MythEvent::Type)(event->type())) == MythEvent::MythEventMessage)
    {
        MythEvent *me      = (MythEvent *)event;
        QString    message = me->Message();
        QString    URI     = me->ExtraData(0);
        QString    URN     = me->ExtraData(1);
        QString    URL     = me->ExtraData(2);


        VERBOSE(VB_UPNP, QString("BackendSelection::customEvent(%1, %2, %3, %4)")
                .arg(message).arg(URI).arg(URN).arg(URL));

        if (message.startsWith("SSDP_ADD") &&
            URI.startsWith("urn:schemas-mythtv-org:device:MasterMediaServer:"))
        {
            DeviceLocation *devLoc = SSDP::Instance()->Find(URI, URN);

            if (devLoc)
            {
                devLoc->AddRef();
                AddItem(devLoc);   // this does a Release()
            }
        }
        else if (message.startsWith("SSDP_REMOVE"))
        {
            //-=>Note: This code will never get executed until
            //         SSDPCache is changed to handle NotifyRemove correctly
            RemoveItem(URN);
        }
    }
    else if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = dynamic_cast<DialogCompletionEvent*>(event);

        if (!dce)
            return;

        QString resultid = dce->GetId();

        if (resultid == "password")
        {
            m_pinCode = dce->GetResultText();
            Accept();
        }
    }
}
开发者ID:DocOnDev,项目名称:mythtv,代码行数:48,代码来源:backendselect.cpp

示例8: if

/**
 *  \brief  Handle custom events
 *  \param  event The custom event
 */
void GallerySlideView::customEvent(QEvent *event)
{
    if ((MythEvent::Type)(event->type()) == MythEvent::MythEventMessage)
    {
        MythEvent *me      = (MythEvent *)event;
        QString    message = me->Message();

        QStringList extra = me->ExtraDataList();

        if (message == "IMAGE_METADATA" && !extra.isEmpty())
        {
            int id = extra[0].toInt();
            ImagePtrK selected = m_view->GetSelected();

            if (selected && selected->m_id == id)
                m_infoList.Display(*selected, extra.mid(1));
        }
        else if (message == "THUMB_AVAILABLE")
        {
            if (!extra.isEmpty() && m_view->Update(extra[0].toInt()))
                ShowSlide(0);
        }
    }
    else if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent *)(event);

        QString resultid  = dce->GetId();
        int     buttonnum = dce->GetResult();

        if (resultid == "metadatamenu")
        {
            switch (buttonnum)
            {
            case 0: Transform(kRotateCW); break;
            case 1: Transform(kRotateCCW); break;
            case 2: Transform(kFlipHorizontal); break;
            case 3: Transform(kFlipVertical); break;
            case 4: Transform(kResetToExif); break;
            case 5: Zoom(10); break;
            case 6: Zoom(-10); break;
            }
        }
    }
}
开发者ID:dragonian,项目名称:mythtv,代码行数:49,代码来源:galleryslideview.cpp

示例9: customEvent

void ChannelRecPriority::customEvent(QEvent *event)
{
    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);

        QString resultid  = dce->GetId();
        int     buttonnum = dce->GetResult();

        if (resultid == "options")
        {
            switch (buttonnum)
            {
                case 0:
                    upcoming();
                    break;
            }
        }
    }
}
开发者ID:garybuhrmaster,项目名称:mythtv,代码行数:20,代码来源:channelrecpriority.cpp

示例10: customEvent

void ScreenWizard::customEvent(QEvent *event)
{

    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);

        QString resultid  = dce->GetId();
        int     buttonnum = dce->GetResult();

        if (resultid == "save")
        {
            if (buttonnum == 0)
                slotSaveSettings();
            else if (buttonnum == 1)
                slotResetSettings();
            else if (buttonnum == 2)
                slotChangeCoarseFine();
        }
        else if (resultid == "nosave")
        {
            if (buttonnum == 0)
                slotResetSettings();
            if (buttonnum == 1)
                slotChangeCoarseFine();
        }
        else if (resultid == "quit")
        {
            if (buttonnum == 0)
                slotSaveSettings();
            if (buttonnum == 1)
                qApp->quit();
            if (buttonnum == 2)
                slotResetSettings();
        }

        m_menuPopup = nullptr;
    }

}
开发者ID:garybuhrmaster,项目名称:mythtv,代码行数:40,代码来源:screenwizard.cpp

示例11: customEvent

void Ripper::customEvent(QEvent* event)
{
    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = static_cast<DialogCompletionEvent *>(event);

        if (dce->GetId() == "conflictmenu")
        {
            int buttonNum = dce->GetResult();
            RipTrack *track = dce->GetData().value<RipTrack *>();

            switch (buttonNum)
            {
                case 0:
                    // Do nothing
                    break;
                case 1:
                    if (deleteExistingTrack(track))
                    {
                        track->isNew = true;
                        toggleTrackActive(track);
                    }
                    break;
                case 2:
                    deleteAllExistingTracks();
                    break;
                default:
                    break;
            }
        }

        return;
    }

    MythUIType::customEvent(event);
}
开发者ID:faginbagin,项目名称:mythtv,代码行数:36,代码来源:cdrip.cpp

示例12: customEvent

void ImportIconsWizard::customEvent(QEvent *event)
{
    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);

        QString resultid  = dce->GetId();
        int     buttonnum = dce->GetResult();

        if (resultid == "submitresults")
        {
            switch (buttonnum)
            {
            case 0 :
                Close();
                break;
            case 1 :
                submit();
                Close();
                break;
            }
        }
    }
}
开发者ID:samuelschen,项目名称:mythtv,代码行数:24,代码来源:importicons.cpp

示例13: customEvent

void GameHandler::customEvent(QEvent *event)
{
    if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);

        QString resultid   = dce->GetId();
        QString resulttext = dce->GetResultText();

        if (resultid == "removalPopup")
        {
            int buttonNum = dce->GetResult();
            GameScan scan = qVariantValue<GameScan>(dce->GetData());
            switch (buttonNum)
            {
                case 1:
                    m_KeepAll = true;
                    break;
                case 2:
                    purgeGameDB(scan.Rom() , scan.RomFullPath());
                    break;
                case 3:
                    m_RemoveAll = true;
                    purgeGameDB(scan.Rom() , scan.RomFullPath());
                    break;
                default:
                    break;
            };
        }
        else if (resultid == "clearAllPopup")
        {
            int buttonNum = dce->GetResult();
            switch (buttonNum)
            {
                case 1:
                    clearAllMetadata();
                    break;
                default:
                    break;
            }
        }
    }
}
开发者ID:killerkiwi,项目名称:mythtv,代码行数:43,代码来源:gamehandler.cpp

示例14: updateTrackInfo


//.........这里部分代码省略.........
            else if (tokens[1] == "FINISHED")
            {
                QString url = args[0];
                int fileSize  = args[2].toInt();
                int errorCode = args[4].toInt();
                QString filename = args[1];

                if ((errorCode != 0) || (fileSize == 0))
                    LOG(VB_GENERAL, LOG_ERR, QString("StreamView: failed to download radio icon from '%1'").arg(url));
                else
                {
                    for (int x = 0; x < m_streamList->GetCount(); x++)
                    {
                        MythUIButtonListItem *item = m_streamList->GetItemAt(x);
                        Metadata *mdata = qVariantValue<Metadata*> (item->GetData());
                        if (mdata && mdata->LogoUrl() == url)
                            item->SetImage(filename);
                    }
                }
            }
        }
    }
    else if (event->type() == DecoderHandlerEvent::OperationStart)
    {
        DecoderHandlerEvent *dhe = dynamic_cast<DecoderHandlerEvent*>(event);
        if (!dhe)
            return;
        if (dhe->getMessage() && m_bufferStatus)
        {
            m_bufferStatus->SetText(*dhe->getMessage());
        }
    }
    else if (event->type() == DecoderHandlerEvent::BufferStatus)
    {
        DecoderHandlerEvent *dhe = dynamic_cast<DecoderHandlerEvent*>(event);
        if (!dhe)
            return;

        int available, maxSize;
        dhe->getBufferStatus(&available, &maxSize);

        if (m_bufferStatus)
        {
            QString status = QString("%1%").arg((int)(100.0 / ((double)maxSize / (double)available)));
            m_bufferStatus->SetText(status);
        }

        if (m_bufferProgress)
        {
            m_bufferProgress->SetTotal(maxSize);
            m_bufferProgress->SetUsed(available);
        }
    }
    else if (event->type() == DecoderHandlerEvent::OperationStop)
    {
        if (m_bufferStatus)
            m_bufferStatus->SetText("");
    }
    else if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = static_cast<DialogCompletionEvent*>(event);

        // make sure the user didn't ESCAPE out of the menu
        if (dce->GetResult() < 0)
            return;

        QString resultid   = dce->GetId();
        QString resulttext = dce->GetResultText();

        if (resultid == "streammenu")
        {
            if (resulttext == tr("Add Stream"))
            {
                MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
                MythScreenType *screen = new EditStreamMetadata(mainStack, this, NULL);

                if (screen->Create())
                    mainStack->AddScreen(screen);
                else
                    delete screen;
            }
            else if (resulttext == tr("Remove Stream"))
            {
                removeStream();
            }
            else if (resulttext == tr("Edit Stream"))
            {
                editStream();
            }
        }
        else
            handled = false;
    }
    else
        handled = false;


    if (!handled)
        MusicCommon::customEvent(event);
}
开发者ID:bfosberry,项目名称:mythtv,代码行数:101,代码来源:streamview.cpp

示例15: playlistItemClicked

void SearchView::customEvent(QEvent *event)
{
    bool handled = false;

    if (event->type() == MusicPlayerEvent::TrackRemovedEvent ||
        event->type() == MusicPlayerEvent::TrackAddedEvent)
    {
        MusicPlayerEvent *mpe = dynamic_cast<MusicPlayerEvent *>(event);

        if (!mpe)
            return;

        int trackID = mpe->TrackID;

        for (int x = 0; x < m_tracksList->GetCount(); x++)
        {
            MythUIButtonListItem *item = m_tracksList->GetItemAt(x);
            MusicMetadata *mdata = qVariantValue<MusicMetadata*> (item->GetData());
            if (mdata && (mdata->ID() == (MusicMetadata::IdType) trackID || trackID == -1))
            {
                if (gPlayer->getCurrentPlaylist() && gPlayer->getCurrentPlaylist()->checkTrack(mdata->ID()))
                    item->DisplayState("on", "selectedstate");
                else
                    item->DisplayState("off", "selectedstate");
            }
        }

        // call the default handler in MusicCommon so the playlist and UI is updated
        MusicCommon::customEvent(event);
        handled = true;

        if (m_playTrack)
        {
            m_playTrack = false;

            if (event->type() == MusicPlayerEvent::TrackAddedEvent)
            {
                // make the added track current and play it
                m_currentPlaylist->SetItemCurrent(m_currentPlaylist->GetCount() - 1);
                playlistItemClicked(m_currentPlaylist->GetItemCurrent());
            }
        }
    }
    else if (event->type() == MusicPlayerEvent::AllTracksRemovedEvent)
    {
        for (int x = 0; x < m_tracksList->GetCount(); x++)
        {
            MythUIButtonListItem *item = m_tracksList->GetItemAt(x);
            if (item)
                item->DisplayState("off", "selectedstate");
        }
    }
    else if (event->type() == MusicPlayerEvent::MetadataChangedEvent)
    {
        MusicPlayerEvent *mpe = dynamic_cast<MusicPlayerEvent *>(event);

        if (!mpe)
            return;

        uint trackID = mpe->TrackID;

        for (int x = 0; x < m_tracksList->GetCount(); x++)
        {
            MythUIButtonListItem *item = m_tracksList->GetItemAt(x);
            MusicMetadata *mdata = qVariantValue<MusicMetadata*> (item->GetData());
            if (mdata && mdata->ID() == trackID)
            {
                InfoMap metadataMap;
                mdata->toMap(metadataMap);
                item->SetTextFromMap(metadataMap);
            }
        }

//        if (trackID == gPlayer->getCurrentMetadata()->ID())
//            updateTrackInfo(gPlayer->getCurrentMetadata());
    }
    else if (event->type() == DialogCompletionEvent::kEventType)
    {
        DialogCompletionEvent *dce = static_cast<DialogCompletionEvent *>(event);

        // make sure the user didn't ESCAPE out of the menu
        if (dce->GetResult() < 0)
            return;

        QString resultid   = dce->GetId();
        QString resulttext = dce->GetResultText();
        if (resultid == "searchviewmenu")
        {
            if (resulttext == tr("Add To Playlist") || resulttext == tr("Remove From Playlist"))
            {
                if (GetFocusWidget() == m_tracksList)
                {
                    MythUIButtonListItem *item = m_tracksList->GetItemCurrent();
                    if (item)
                    {
                        m_playTrack = false;
                        trackClicked(item);
                    }
                }
            }
//.........这里部分代码省略.........
开发者ID:DragonStalker,项目名称:mythtv,代码行数:101,代码来源:searchview.cpp


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