int CGUIDialogYesNo::ShowAndGetInput(const KODI::MESSAGING::HELPERS::DialogYesNoMessage& options) { //Set default yes/no labels, these might be overwritten further down if specified //by the caller SetChoice(0, 106); SetChoice(1, 107); if (!options.heading.isNull()) SetHeading(options.heading); if (!options.text.isNull()) SetText(options.text); if (!options.noLabel.isNull()) SetChoice(0, options.noLabel); if (!options.yesLabel.isNull()) SetChoice(1, options.yesLabel); if (options.autoclose > 0) SetAutoClose(options.autoclose); m_bCanceled = false; for (size_t i = 0; i < 3; ++i) { if (!options.lines[i].isNull()) SetLine(i, options.lines[i]); } Open(); if (m_bCanceled) return -1; return IsConfirmed() ? 1 : 0; }
bool CGUIDialogOK::ShowAndGetInput(const HELPERS::DialogOKMessage & options) { if (!options.heading.isNull()) SetHeading(options.heading); if (!options.text.isNull()) SetText(options.text); for (size_t i = 0; i < 3; ++i) { if (!options.lines[i].isNull()) SetLine(i, options.lines[i]); } Open(); return IsConfirmed(); }