本文整理汇总了C++中CGUIDialogYesNo::SetHeading方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogYesNo::SetHeading方法的具体用法?C++ CGUIDialogYesNo::SetHeading怎么用?C++ CGUIDialogYesNo::SetHeading使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogYesNo
的用法示例。
在下文中一共展示了CGUIDialogYesNo::SetHeading方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAction
bool CGUIWindowSettingsScreenCalibration::OnAction(const CAction &action)
{
switch (action.GetID())
{
case ACTION_CALIBRATE_SWAP_ARROWS:
{
NextControl();
return true;
}
break;
case ACTION_CALIBRATE_RESET:
{
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
pDialog->SetHeading(20325);
CStdString strText;
strText.Format(g_localizeStrings.Get(20326).c_str(), g_settings.m_ResInfo[m_Res[m_iCurRes]].strMode.c_str());
pDialog->SetLine(0, strText);
pDialog->SetLine(1, 20327);
pDialog->SetChoice(0, 222);
pDialog->SetChoice(1, 186);
pDialog->DoModal();
if (pDialog->IsConfirmed())
{
g_graphicsContext.ResetScreenParameters(m_Res[m_iCurRes]);
ResetControls();
}
return true;
}
break;
case ACTION_CHANGE_RESOLUTION:
// choose the next resolution in our list
{
m_iCurRes = (m_iCurRes+1) % m_Res.size();
g_graphicsContext.SetVideoResolution(m_Res[m_iCurRes]);
ResetControls();
return true;
}
break;
}
return CGUIWindow::OnAction(action); // base class to handle basic movement etc.
}
示例2: Process
void CAddonStatusHandler::Process()
{
CSingleLock lock(m_critSection);
std::string heading = StringUtils::Format("%s: %s", TranslateType(m_addon->Type(), true).c_str(), m_addon->Name().c_str());
/* Request to restart the AddOn and data structures need updated */
if (m_status == ADDON_STATUS_NEED_RESTART)
{
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (!pDialog) return;
pDialog->SetHeading(CVariant{heading});
pDialog->SetLine(1, CVariant{24074});
pDialog->Open();
CAddonMgr::GetInstance().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
/* Some required settings are missing/invalid */
else if ((m_status == ADDON_STATUS_NEED_SETTINGS) || (m_status == ADDON_STATUS_NEED_SAVEDSETTINGS))
{
CGUIDialogYesNo* pDialogYesNo = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialogYesNo) return;
pDialogYesNo->SetHeading(CVariant{heading});
pDialogYesNo->SetLine(1, CVariant{24070});
pDialogYesNo->SetLine(2, CVariant{24072});
pDialogYesNo->SetLine(3, CVariant{m_message});
pDialogYesNo->Open();
if (!pDialogYesNo->IsConfirmed()) return;
if (!m_addon->HasSettings())
return;
if (CGUIDialogAddonSettings::ShowAndGetInput(m_addon))
{
//! @todo Doesn't dialogaddonsettings save these automatically? It should do this.
m_addon->SaveSettings();
CAddonMgr::GetInstance().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
}
}
示例3: DeleteProfile
bool CSettings::DeleteProfile(unsigned int index)
{
const CProfile *profile = GetProfile(index);
if (!profile)
return false;
CGUIDialogYesNo* dlgYesNo = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (dlgYesNo)
{
CStdString message;
CStdString str = g_localizeStrings.Get(13201);
message.Format(str.c_str(), profile->getName());
dlgYesNo->SetHeading(13200);
dlgYesNo->SetLine(0, message);
dlgYesNo->SetLine(1, "");
dlgYesNo->SetLine(2, "");
dlgYesNo->DoModal();
if (dlgYesNo->IsConfirmed())
{
//delete profile
CStdString strDirectory = profile->getDirectory();
m_vecProfiles.erase(m_vecProfiles.begin()+index);
if (index == m_currentProfile)
{
LoadProfile(0);
Save();
}
CFileItemPtr item = CFileItemPtr(new CFileItem(URIUtils::AddFileToFolder(GetUserDataFolder(), strDirectory)));
item->SetPath(URIUtils::AddFileToFolder(GetUserDataFolder(), strDirectory + "/"));
item->m_bIsFolder = true;
item->Select(true);
CFileUtils::DeleteItem(item);
}
else
return false;
}
SaveProfiles( PROFILES_FILE );
return true;
}
示例4: ActionDeleteRecording
bool CGUIWindowPVRRecordings::ActionDeleteRecording(CFileItem *item)
{
bool bReturn = false;
if ((!item->IsPVRRecording() && !item->m_bIsFolder) || item->IsParentFolder())
return bReturn;
/* show a confirmation dialog */
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialog)
return bReturn;
int iLine0 = item->m_bIsFolder ? 19113 : item->GetPVRRecordingInfoTag()->IsDeleted() ? 19294 : 19112;
pDialog->SetHeading(CVariant{122}); // Confirm delete
pDialog->SetLine(0, CVariant{iLine0}); // Delete all recordings in this folder? / Delete this recording permanently? / Delete this recording?
pDialog->SetLine(1, CVariant{""});
pDialog->SetLine(2, CVariant{item->GetLabel()});
pDialog->SetChoice(1, CVariant{117}); // Delete
/* prompt for the user's confirmation */
pDialog->Open();
if (!pDialog->IsConfirmed())
return bReturn;
/* delete the recording */
if (g_PVRRecordings->Delete(*item))
{
g_PVRManager.TriggerRecordingsUpdate();
bReturn = true;
/* remove the item from the list immediately, otherwise the
item count further down may be wrong */
m_vecItems->Remove(item);
/* go to the parent folder if we're in a subdirectory and just deleted the last item */
CPVRRecordingsPath path(m_vecItems->GetPath());
if (path.IsValid() && !path.IsRecordingsRoot() && m_vecItems->GetObjectCount() == 0)
GoParentFolder();
}
return bReturn;
}
示例5: ActionRecord
bool CGUIWindowPVRCommon::ActionRecord(CFileItem *item)
{
bool bReturn = false;
CEpgInfoTag *epgTag = item->GetEPGInfoTag();
if (!epgTag)
return bReturn;
const CPVRChannel *channel = epgTag->ChannelTag();
if (!channel || channel->ChannelNumber() > 0)
return bReturn;
if (epgTag->Timer() == NULL)
{
/* create a confirmation dialog */
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialog)
return bReturn;
pDialog->SetHeading(264);
pDialog->SetLine(0, "");
pDialog->SetLine(1, epgTag->Title());
pDialog->SetLine(2, "");
pDialog->DoModal();
/* prompt for the user's confirmation */
if (!pDialog->IsConfirmed())
return bReturn;
CPVRTimerInfoTag *newtimer = CPVRTimerInfoTag::CreateFromEpg(*epgTag);
CFileItem *item = new CFileItem(*newtimer);
bReturn = g_PVRTimers->AddTimer(*item);
}
else
{
CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
bReturn = true;
}
return bReturn;
}
示例6: StartRecordFile
bool CGUIWindowPVRBase::StartRecordFile(const CFileItem &item)
{
if (!item.HasEPGInfoTag())
return false;
const CEpgInfoTag *tag = item.GetEPGInfoTag();
CPVRChannelPtr channel;
if (tag)
channel = tag->ChannelTag();
if (!channel || !g_PVRManager.CheckParentalLock(*channel))
return false;
CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(&item);
if (timer && timer->HasPVRTimerInfoTag())
{
CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
return false;
}
// ask for confirmation before starting a timer
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialog)
return false;
pDialog->SetHeading(264);
pDialog->SetLine(0, tag->PVRChannelName());
pDialog->SetLine(1, "");
pDialog->SetLine(2, tag->Title());
pDialog->DoModal();
if (!pDialog->IsConfirmed())
return false;
CPVRTimerInfoTag *newTimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
bool bReturn(false);
if (newTimer)
{
bReturn = g_PVRTimers->AddTimer(*newTimer);
delete newTimer;
}
return bReturn;
}
示例7: ShowAndGetInput
bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, bool &bCanceled, CVariant noLabel, CVariant yesLabel, unsigned int autoCloseTime)
{
CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!dialog)
return false;
dialog->SetHeading(heading);
dialog->SetLine(0, line0);
dialog->SetLine(1, line1);
dialog->SetLine(2, line2);
if (autoCloseTime)
dialog->SetAutoClose(autoCloseTime);
dialog->SetChoice(0, !noLabel.empty() ? noLabel : 106);
dialog->SetChoice(1, !yesLabel.empty() ? yesLabel : 107);
dialog->m_bCanceled = false;
dialog->Open();
bCanceled = dialog->m_bCanceled;
return (dialog->IsConfirmed()) ? true : false;
}
示例8: OnContextButtonDeleteAll
bool CGUIWindowPVRRecordings::OnContextButtonDeleteAll(CFileItem *item, CONTEXT_BUTTON button)
{
bool bReturn = false;
if (button != CONTEXT_BUTTON_DELETE_ALL || !item->IsDeletedPVRRecording())
return bReturn;
/* show a confirmation dialog */
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialog)
return bReturn;
pDialog->SetHeading(CVariant{19292}); // Delete all permanently
pDialog->SetLine(0, CVariant{19293}); // Delete all recordings permanently?
pDialog->SetLine(1, CVariant{""});
pDialog->SetLine(2, CVariant{""});
pDialog->SetChoice(1, CVariant{117}); // Delete
/* prompt for the user's confirmation */
pDialog->Open();
if (!pDialog->IsConfirmed())
return bReturn;
/* undelete the recording */
if (g_PVRRecordings->DeleteAllRecordingsFromTrash())
{
g_PVRManager.TriggerRecordingsUpdate();
bReturn = true;
/* remove the item from the list immediately, otherwise the
item count further down may be wrong */
m_vecItems->Clear();
/* go to the parent folder if we're in a subdirectory and just deleted the last item */
CPVRRecordingsPath path(m_vecItems->GetPath());
if (path.IsValid() && !path.IsRecordingsRoot() && m_vecItems->GetObjectCount() == 0)
GoParentFolder();
}
return bReturn;
}
示例9: ShowAndGetInput
bool CGUIDialogYesNo::ShowAndGetInput(const CStdString& heading, const CStdString& line0, const CStdString& line1, const CStdString& line2, bool& bCanceled, const CStdString& noLabel, const CStdString& yesLabel)
{
CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!dialog) return false;
dialog->SetHeading(heading);
dialog->SetLine(0, line0);
dialog->SetLine(1, line1);
dialog->SetLine(2, line2);
dialog->m_bCanceled = false;
if (!noLabel.IsEmpty())
dialog->SetChoice(0,noLabel);
else
dialog->SetChoice(0,106);
if (!yesLabel.IsEmpty())
dialog->SetChoice(1,yesLabel);
else
dialog->SetChoice(1,107);
dialog->DoModal();
bCanceled = dialog->m_bCanceled;
return (dialog->IsConfirmed()) ? true : false;
}
示例10: ActionStartTimer
bool CGUIDialogPVRGuideInfo::ActionStartTimer(const CEpgInfoTag *tag)
{
bool bReturn = false;
if (!tag)
return false;
CPVRChannelPtr channel = tag->ChannelTag();
if (!channel || !g_PVRManager.CheckParentalLock(*channel))
return false;
// prompt user for confirmation of channel record
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (pDialog)
{
pDialog->SetHeading(264);
pDialog->SetLine(0, "");
pDialog->SetLine(1, tag->Title());
pDialog->SetLine(2, "");
pDialog->DoModal();
if (pDialog->IsConfirmed())
{
Close();
CPVRTimerInfoTag *newTimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
if (newTimer)
{
bReturn = CPVRTimers::AddTimer(*newTimer);
delete newTimer;
}
else
{
bReturn = false;
}
}
}
return bReturn;
}
示例11: StartRecordFile
bool CGUIWindowPVRCommon::StartRecordFile(CFileItem *item)
{
bool bReturn = false;
if (!item->HasEPGInfoTag())
return bReturn;
CPVREpgInfoTag *tag = (CPVREpgInfoTag *) item->GetEPGInfoTag();
if (!tag || !tag->ChannelTag() || tag->ChannelTag()->ChannelNumber() <= 0)
return bReturn;
CPVRTimerInfoTag *timer = CPVRManager::GetTimers()->GetMatch(item);
if (timer)
{
CGUIDialogOK::ShowAndGetInput(19033,19034,0,0);
return bReturn;
}
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialog)
return bReturn;
pDialog->SetHeading(264);
pDialog->SetLine(0, tag->ChannelTag()->ChannelName());
pDialog->SetLine(1, "");
pDialog->SetLine(2, tag->Title());
pDialog->DoModal();
if (!pDialog->IsConfirmed())
return bReturn;
CPVRTimerInfoTag *newtimer = CPVRTimerInfoTag::CreateFromEpg(*tag);
CFileItem *newTimerItem = new CFileItem(*newtimer);
if (CPVRManager::GetTimers()->AddTimer(*newTimerItem))
{
CPVRManager::GetTimers()->Update();
bReturn = true;
}
return bReturn;
}
示例12: ActionDeleteRecording
bool CGUIWindowPVRRecordings::ActionDeleteRecording(CFileItem *item)
{
bool bReturn = false;
if (!item->IsPVRRecording() && !item->m_bIsFolder)
return bReturn;
/* show a confirmation dialog */
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialog)
return bReturn;
pDialog->SetHeading(122); // Confirm delete
pDialog->SetLine(0, item->m_bIsFolder ? 19113 : 19112); // Are you sure?
pDialog->SetLine(1, "");
pDialog->SetLine(2, item->GetLabel());
pDialog->SetChoice(1, 117); // Delete
/* prompt for the user's confirmation */
pDialog->DoModal();
if (!pDialog->IsConfirmed())
return bReturn;
/* delete the recording */
if (g_PVRRecordings->Delete(*item))
{
g_PVRManager.TriggerRecordingsUpdate();
bReturn = true;
/* remove the item from the list immediately, otherwise the
item count further down may be wrong */
m_vecItems->Remove(item);
/* go to the parent folder if we're in a subdirectory and just deleted the last item */
if (m_vecItems->GetPath() != "pvr://recordings/" && m_vecItems->GetObjectCount() == 0)
GoParentFolder();
}
return bReturn;
}
示例13: ShowAndGetInput
bool CGUIDialogYesNo::ShowAndGetInput(int heading, int line0, int line1, int line2, int iNoLabel, int iYesLabel, bool& bCanceled, unsigned int autoCloseTime)
{
CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!dialog) return false;
dialog->SetHeading(heading);
dialog->SetLine(0, line0);
dialog->SetLine(1, line1);
dialog->SetLine(2, line2);
if (autoCloseTime)
dialog->SetAutoClose(autoCloseTime);
if (iNoLabel != -1)
dialog->SetChoice(0,iNoLabel);
else
dialog->SetChoice(0,106);
if (iYesLabel != -1)
dialog->SetChoice(1,iYesLabel);
else
dialog->SetChoice(1,107);
dialog->m_bCanceled = false;
dialog->DoModal();
bCanceled = dialog->m_bCanceled;
return (dialog->IsConfirmed()) ? true : false;
}
示例14: ActionDeleteTimer
bool CGUIWindowPVRCommon::ActionDeleteTimer(CFileItem *item)
{
/* check if the timer tag is valid */
CPVRTimerInfoTag *timerTag = item->GetPVRTimerInfoTag();
if (!timerTag || timerTag->m_iClientIndex < 0)
return false;
/* show a confirmation dialog */
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialog)
return false;
pDialog->SetHeading(122);
pDialog->SetLine(0, 19040);
pDialog->SetLine(1, "");
pDialog->SetLine(2, timerTag->m_strTitle);
pDialog->DoModal();
/* prompt for the user's confirmation */
if (!pDialog->IsConfirmed())
return false;
/* delete the timer */
return g_PVRTimers->DeleteTimer(*item);
}
示例15: ActionCancelTimer
bool CGUIDialogPVRGuideInfo::ActionCancelTimer(const CPVRTimerInfoTag *tag)
{
bool bReturn = false;
// prompt user for confirmation of timer deletion
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (pDialog)
{
pDialog->SetHeading(265);
pDialog->SetLine(0, "");
pDialog->SetLine(1, tag->m_strTitle);
pDialog->SetLine(2, "");
pDialog->DoModal();
if (pDialog->IsConfirmed())
{
Close();
bReturn = CPVRTimers::DeleteTimer(*tag);
}
}
return bReturn;
}