本文整理汇总了C++中DialogCompletionEvent::GetResultText方法的典型用法代码示例。如果您正苦于以下问题:C++ DialogCompletionEvent::GetResultText方法的具体用法?C++ DialogCompletionEvent::GetResultText怎么用?C++ DialogCompletionEvent::GetResultText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DialogCompletionEvent
的用法示例。
在下文中一共展示了DialogCompletionEvent::GetResultText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
}
示例2: 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;
}
}
示例3: 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();
}
}
}
示例4: 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();
}
}
}
示例5: customEvent
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();
}
}
}
示例6: 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;
}
}
}
}
示例7: customEvent
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);
}
}
}
//.........这里部分代码省略.........
示例8: customEvent
void ViewScheduled::customEvent(QEvent *event)
{
if ((MythEvent::Type)(event->type()) == MythEvent::MythEventMessage)
{
MythEvent *me = (MythEvent *)event;
QString message = me->Message();
if (message != "SCHEDULE_CHANGE")
return;
m_needFill = true;
if (m_inEvent)
return;
m_inEvent = true;
LoadList();
m_inEvent = false;
}
else if (event->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
QString resultid = dce->GetId();
QString resulttext = dce->GetResultText();
int buttonnum = dce->GetResult();
if (resultid == "deleterule")
{
RecordingRule *record = qVariantValue<RecordingRule *>(dce->GetData());
if (record)
{
if (buttonnum > 0)
{
if (!record->Delete())
VERBOSE(VB_IMPORTANT, "Failed to delete recording rule");
}
delete record;
}
EmbedTVWindow();
}
else if (resultid == "menu")
{
if (resulttext == tr("Show Important"))
{
setShowAll(false);
}
else if (resulttext == tr("Show All"))
{
setShowAll(true);
}
else if (resulttext == tr("Program Details"))
{
details();
}
else if (resulttext == tr("Upcoming by title"))
{
upcoming();
}
else if (resulttext == tr("Upcoming scheduled"))
{
upcomingScheduled();
}
else if (resulttext == tr("Custom Edit"))
{
customEdit();
}
else if (resulttext == tr("Delete Rule"))
{
deleteRule();
}
else if (resulttext == tr("Show Cards"))
{
viewCards();
}
else if (resulttext == tr("Show Inputs"))
{
viewInputs();
}
if (m_needFill)
LoadList();
}
else
ScheduleCommon::customEvent(event);
}
}
示例9: customEvent
void ViewScheduled::customEvent(QEvent *event)
{
if (event->type() == MythEvent::MythEventMessage)
{
MythEvent *me = static_cast<MythEvent *>(event);
QString message = me->Message();
if (message != "SCHEDULE_CHANGE")
return;
m_needFill = true;
if (m_inEvent)
return;
m_inEvent = true;
LoadList();
m_inEvent = false;
}
else if (event->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
QString resultid = dce->GetId();
QString resulttext = dce->GetResultText();
int buttonnum = dce->GetResult();
if (resultid == "deleterule")
{
RecordingRule *record =
dce->GetData().value<RecordingRule *>();
if (record)
{
if (buttonnum > 0)
{
if (!record->Delete())
LOG(VB_GENERAL, LOG_ERR,
"Failed to delete recording rule");
}
delete record;
}
EmbedTVWindow();
}
else if (resultid == "menu")
{
if (resulttext == tr("Show Important"))
{
setShowAll(false);
}
else if (resulttext == tr("Show All"))
{
setShowAll(true);
}
else if (resulttext == tr("Program Details"))
{
ShowDetails();
}
else if (resulttext == tr("Program Guide"))
{
ShowGuide();
}
else if (resulttext == tr("Channel Search"))
{
ShowChannelSearch();
}
else if (resulttext == tr("Upcoming by title"))
{
ShowUpcoming();
}
else if (resulttext == tr("Upcoming scheduled"))
{
ShowUpcomingScheduled();
}
else if (resulttext == tr("Previously Recorded"))
{
ShowPrevious();
}
else if (resulttext == tr("Custom Edit"))
{
EditCustom();
}
else if (resulttext == tr("Delete Rule"))
{
deleteRule();
}
else if (resulttext == tr("Show Inputs"))
{
viewInputs();
}
if (m_needFill)
LoadList();
}
else
ScheduleCommon::customEvent(event);
}
}
示例10: customEvent
void EditMetadataDialog::customEvent(QEvent *levent)
{
if (levent->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (DialogCompletionEvent*)(levent);
const QString resultid = dce->GetId();
if (resultid == CEID_COVERARTFILE)
SetCoverArt(dce->GetResultText());
else if (resultid == CEID_BANNERFILE)
SetBanner(dce->GetResultText());
else if (resultid == CEID_FANARTFILE)
SetFanart(dce->GetResultText());
else if (resultid == CEID_SCREENSHOTFILE)
SetScreenshot(dce->GetResultText());
else if (resultid == CEID_TRAILERFILE)
SetTrailer(dce->GetResultText());
else if (resultid == CEID_NEWCATEGORY)
AddCategory(dce->GetResultText());
}
else if (levent->type() == MetadataLookupEvent::kEventType)
{
MetadataLookupEvent *lue = (MetadataLookupEvent *)levent;
MetadataLookupList lul = lue->lookupList;
if (lul.isEmpty())
return;
// There should really only be one result here.
// If not, USER ERROR!
if (lul.count() == 1)
{
OnArtworkSearchDone(lul[0]);
}
else
{
if (m_busyPopup)
{
m_busyPopup->Close();
m_busyPopup = NULL;
}
}
}
else if (levent->type() == MetadataLookupFailure::kEventType)
{
MetadataLookupFailure *luf = (MetadataLookupFailure *)levent;
MetadataLookupList lul = luf->lookupList;
if (m_busyPopup)
{
m_busyPopup->Close();
m_busyPopup = NULL;
}
if (lul.size())
{
MetadataLookup *lookup = lul[0];
LOG(VB_GENERAL, LOG_INFO,
QString("No results found for %1 %2 %3").arg(lookup->GetTitle())
.arg(lookup->GetSeason()).arg(lookup->GetEpisode()));
}
}
else if (levent->type() == ImageDLEvent::kEventType)
{
ImageDLEvent *ide = (ImageDLEvent *)levent;
MetadataLookup *lookup = ide->item;
if (!lookup)
return;
handleDownloadedImages(lookup);
}
else if (levent->type() == ImageDLFailureEvent::kEventType)
{
MythErrorNotification n(tr("Failed to retrieve image"),
tr("Metadata Editor"),
tr("Check logs"));
GetNotificationCenter()->Queue(n);
}
}
示例11: customEvent
void EditMetadataDialog::customEvent(QEvent *event)
{
if (event->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (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 == "optionsmenu")
{
if (resulttext == tr("Edit Albumart Images"))
switchToAlbumArt();
else if (resulttext == tr("Search Internet For Genre Image"))
{
updateMetadata();
searchForGenreImages();
}
else if (resulttext == tr("Search Internet For Artist Image"))
{
updateMetadata();
searchForArtistImages();
}
else if (resulttext == tr("Search Internet For Album Image"))
{
updateMetadata();
searchForAlbumImages();
}
else if (resulttext == tr("Check Track Length"))
{
int length = calcTrackLength(m_metadata->Filename());
if (length != m_metadata->Length() / 1000)
{
int oldLength = m_metadata->Length() / 1000;
// save the new length to our working copy of the metadata
m_metadata->setLength(length * 1000);
// save the new length to the source copy of the metadata
m_sourceMetadata->setLength(length * 1000);
m_sourceMetadata->dumpToDatabase();
// this will update any track lengths displayed on screen
gPlayer->sendMetadataChangedEvent(m_sourceMetadata->ID());
// this will force the playlist stats to update
MusicPlayerEvent me(MusicPlayerEvent::TrackChangeEvent, gPlayer->getCurrentTrackPos());
gPlayer->dispatch(me);
ShowOkPopup(QString("Updated track length to %1 seconds\nwas %2 seconds").arg(length).arg(oldLength));
}
}
}
}
else if (event->type() == MythEvent::MythEventMessage)
{
MythEvent *me = (MythEvent *)event;
QStringList tokens = me->Message().split(" ", QString::SkipEmptyParts);
if (!tokens.isEmpty())
{
if (tokens[0] == "BROWSER_DOWNLOAD_FINISHED")
{
scanForImages();
// force the icons to update
updateAlbumImage();
updateArtistImage();
updateGenreImage();
m_metadata->getAlbumArtImages()->dumpToDatabase();
// force a reload of the images for any tracks affected
MetadataPtrList *allMusic = gMusicData->all_music->getAllMetadata();
for (int x = 0; x < allMusic->count(); x++)
{
if ((allMusic->at(x)->ID() == m_sourceMetadata->ID()) ||
(allMusic->at(x)->getDirectoryId() == m_sourceMetadata->getDirectoryId()))
{
allMusic->at(x)->reloadAlbumArtImages();
gPlayer->sendAlbumArtChangedEvent(allMusic->at(x)->ID());
}
}
}
}
}
}
示例12: customEvent
//.........这里部分代码省略.........
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);
}
示例13: customEvent
void ScheduleCommon::customEvent(QEvent *event)
{
if (event->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
QString resultid = dce->GetId();
QString resulttext = dce->GetResultText();
if (resultid == "editrecording")
{
if (!dce->GetData().canConvert<RecordingInfo>())
return;
RecordingInfo recInfo = dce->GetData().value<RecordingInfo>();
if (resulttext == tr("Record this showing"))
{
if (recInfo.GetRecordingRuleType() == kNotRecording)
recInfo.ApplyRecordStateChange(kSingleRecord);
else
{
recInfo.ApplyRecordStateChange(kOverrideRecord);
if (recInfo.GetRecordingStartTime() < MythDate::current())
recInfo.ReactivateRecording();
}
}
else if (resulttext == tr("Record all showings"))
recInfo.ApplyRecordStateChange(kAllRecord);
else if (resulttext == tr("Record one showing (this episode)") ||
resulttext == tr("Record one showing"))
{
recInfo.ApplyRecordStateChange(kOneRecord, false);
recInfo.GetRecordingRule()->m_filter |= 64; // This episode
recInfo.GetRecordingRule()->Save();
}
else if (resulttext == tr("Record all showings (this channel)"))
{
recInfo.ApplyRecordStateChange(kAllRecord, false);
recInfo.GetRecordingRule()->m_filter |= 1024; // This channel
recInfo.GetRecordingRule()->Save();
}
else if (resulttext == tr("Stop this recording"))
{
RemoteStopRecording(&recInfo);
}
else if (resulttext == tr("Modify recording options") ||
resulttext == tr("Add override rule"))
{
if (recInfo.GetRecordingRuleType() == kSingleRecord ||
recInfo.GetRecordingRuleType() == kOverrideRecord ||
recInfo.GetRecordingRuleType() == kOneRecord)
EditScheduled(&recInfo);
else
MakeOverride(&recInfo);
}
else if (resulttext == tr("Restart this recording"))
recInfo.ReactivateRecording();
else if (resulttext == tr("Forget previous recording"))
recInfo.ForgetHistory();
else if (resulttext == tr("Don't record this showing"))
recInfo.ApplyRecordStateChange(kDontRecord);
else if (resulttext == tr("Never record this episode"))
{
recInfo.ApplyNeverRecord();
}
else if (resulttext == tr("Edit recording rule") ||
resulttext == tr("Edit override rule"))
EditScheduled(&recInfo);
else if (resulttext == tr("Delete recording rule") ||
resulttext == tr("Delete override rule"))
recInfo.ApplyRecordStateChange(kNotRecording);
}
}
}
示例14: customEvent
void ProgramRecPriority::customEvent(QEvent *event)
{
if (event->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
QString resultid = dce->GetId();
QString resulttext = dce->GetResultText();
int buttonnum = dce->GetResult();
if (resultid == "menu")
{
if (resulttext == tr("Increase Priority"))
{
changeRecPriority(1);
}
else if (resulttext == tr("Decrease Priority"))
{
changeRecPriority(-1);
}
else if (resulttext == tr("Sort"))
{
showSortMenu();
}
else if (resulttext == tr("Program Details"))
{
ShowDetails();
}
else if (resulttext == tr("Upcoming"))
{
saveRecPriority();
ShowUpcoming();
}
else if (resulttext == tr("Custom Edit"))
{
saveRecPriority();
EditCustom();
}
else if (resulttext == tr("Delete Rule"))
{
saveRecPriority();
remove();
}
else if (resulttext == tr("New Template"))
{
MythScreenStack *popupStack =
GetMythMainWindow()->GetStack("popup stack");
MythTextInputDialog *textInput =
new MythTextInputDialog(popupStack,
tr("Template Name"));
if (textInput->Create())
{
textInput->SetReturnEvent(this, "templatecat");
popupStack->AddScreen(textInput);
}
}
}
else if (resultid == "sortmenu")
{
if (resulttext == tr("Reverse Sort Order"))
{
m_reverseSort = !m_reverseSort;
SortList();
}
else if (resulttext == tr("Sort By Title"))
{
if (m_sortType != byTitle)
{
m_sortType = byTitle;
m_reverseSort = false;
}
else
m_reverseSort = !m_reverseSort;
SortList();
}
else if (resulttext == tr("Sort By Priority"))
{
if (m_sortType != byRecPriority)
{
m_sortType = byRecPriority;
m_reverseSort = false;
}
else
m_reverseSort = !m_reverseSort;
SortList();
}
else if (resulttext == tr("Sort By Type"))
{
if (m_sortType != byRecType)
{
m_sortType = byRecType;
m_reverseSort = false;
}
else
m_reverseSort = !m_reverseSort;
SortList();
}
else if (resulttext == tr("Sort By Count"))
{
if (m_sortType != byCount)
//.........这里部分代码省略.........
示例15: customEvent
void ProgLister::customEvent(QEvent *event)
{
bool needUpdate = false;
if (event->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
QString resultid = dce->GetId();
QString resulttext = dce->GetResultText();
int buttonnum = dce->GetResult();
if (resultid == "sortmenu")
{
switch (buttonnum)
{
case 0:
m_reverseSort = !m_reverseSort;
needUpdate = true;
break;
case 1:
m_titleSort = true;
m_reverseSort = false;
needUpdate = true;
break;
case 2:
m_titleSort = false;
m_reverseSort = (m_type == plPreviouslyRecorded);
needUpdate = true;
break;
}
}
else if (resultid == "deletemenu")
{
switch (buttonnum)
{
case 0:
{
ProgramInfo *pi = GetCurrent();
if (pi)
{
RecordingInfo ri(*pi);
if (ri.IsDuplicate())
ri.ForgetHistory();
else
ri.SetDupHistory();
*pi = ri;
}
break;
}
case 1:
ShowDeleteOldEpisodeMenu();
break;
case 2:
ShowDeleteOldSeriesMenu();
break;
}
}
else if (resultid == "deleterule")
{
RecordingRule *record =
qVariantValue<RecordingRule *>(dce->GetData());
if (record && buttonnum > 0 && !record->Delete())
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"Failed to delete recording rule");
}
if (record)
delete record;
}
else
{
ScheduleCommon::customEvent(event);
}
}
else if (event->type() == ScreenLoadCompletionEvent::kEventType)
{
ScreenLoadCompletionEvent *slce = (ScreenLoadCompletionEvent*)(event);
QString id = slce->GetId();
if (id == objectName())
{
CloseBusyPopup(); // opened by LoadInBackground()
UpdateDisplay();
if (m_curView < 0 && m_type != plPreviouslyRecorded)
ShowChooseViewMenu();
}
}
else if ((MythEvent::Type)(event->type()) == MythEvent::MythEventMessage)
{
MythEvent *me = (MythEvent *)event;
QString message = me->Message();
if (message == "CHOOSE_VIEW")
ShowChooseViewMenu();
else if (message == "SCHEDULE_CHANGE")
needUpdate = true;
}
//.........这里部分代码省略.........