本文整理汇总了C++中MythUIText::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIText::SetText方法的具体用法?C++ MythUIText::SetText怎么用?C++ MythUIText::SetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIText
的用法示例。
在下文中一共展示了MythUIText::SetText方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
bool ScreenSetup::Create()
{
bool foundtheme = false;
// Load the theme for this screen
foundtheme = LoadWindowFromXML("weather-ui.xml", "screen-setup", this);
if (!foundtheme)
return false;
m_helpText = dynamic_cast<MythUIText *> (GetChild("helptxt"));
m_activeList = dynamic_cast<MythUIButtonList *> (GetChild("activelist"));
m_inactiveList = dynamic_cast<MythUIButtonList *> (GetChild("inactivelist"));
m_finishButton = dynamic_cast<MythUIButton *> (GetChild("finishbutton"));
MythUIText *activeheader = dynamic_cast<MythUIText *> (GetChild("activehdr"));
if (activeheader)
activeheader->SetText(tr("Active Screens"));
MythUIText *inactiveheader = dynamic_cast<MythUIText *> (GetChild("inactivehdr"));
if (inactiveheader)
inactiveheader->SetText(tr("Inactive Screens"));
if (!m_activeList || !m_inactiveList || !m_finishButton || !m_helpText)
{
LOG(VB_GENERAL, LOG_ERR, "Theme is missing required elements.");
return false;
}
BuildFocusList();
connect(m_activeList, SIGNAL(itemSelected(MythUIButtonListItem *)),
this, SLOT(updateHelpText()));
connect(m_activeList, SIGNAL(itemClicked(MythUIButtonListItem *)),
this, SLOT(doListSelect(MythUIButtonListItem *)));
connect(m_inactiveList, SIGNAL(itemSelected(MythUIButtonListItem *)),
this, SLOT(updateHelpText()));
connect(m_inactiveList, SIGNAL(itemClicked(MythUIButtonListItem *)),
this, SLOT(doListSelect(MythUIButtonListItem *)));
SetFocusWidget(m_inactiveList);
m_finishButton->SetText(tr("Finish"));
connect(m_finishButton, SIGNAL(Clicked()), this, SLOT(saveData()));
loadData();
return true;
}
示例2: Create
bool PlotDialog::Create()
{
if (!LoadWindowFromXML("video-ui.xml", "descriptionpopup", this))
return false;
MythUIText *plotText = nullptr;
MythUIButton *okButton = nullptr;
bool err = false;
UIUtilE::Assign(this, plotText, "description", &err);
if (err)
{
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'descriptionpopup'");
return false;
}
UIUtilW::Assign(this, okButton, "ok");
plotText->SetText(m_metadata->GetPlot());
if (okButton)
connect(okButton, SIGNAL(Clicked()), SLOT(Close()));
BuildFocusList();
return true;
}
示例3: Init
void AirPlayPictureScreen::Init(void)
{
if (m_airplayImage)
{
if (!m_imageFilename.isEmpty())
{
m_airplayImage->SetFilename(m_imageFilename); // Absolute path, http or SG url
m_airplayImage->Load(); // By default the image is loaded in a background thread, use LoadNow() to load in foreground
}
else
{
// Will default to displaying whatever placeholder image is defined
// in the xml by the themer, means we can show _something_ rather than
// a big empty hole. Generally you always want to call Reset() in
// these circumstances
m_airplayImage->Reset();
}
}
if (m_airplayText)
{
if (!m_imageDescription.isEmpty())
{
m_airplayText->SetText(m_imageDescription);
}
else
{
// Same as above, calling Reset() allows for a sane, themer defined
//default to be displayed
m_airplayText->Reset();
}
}
}
示例4: Create
/** \fn RawSettingsEditor::Create(void)
* \brief Creates the UI screen.
*/
bool RawSettingsEditor::Create(void)
{
if (!LoadWindowFromXML("settings-ui.xml", "rawsettingseditor", this))
return false;
m_settingsList = dynamic_cast<MythUIButtonList *> (GetChild("settings"));
m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save"));
m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel"));
m_textLabel = dynamic_cast<MythUIText *> (GetChild("label-text"));
if (!m_settingsList || !m_textLabel || !m_saveButton || !m_cancelButton)
{
LOG(VB_GENERAL, LOG_EMERG,
"Theme is missing critical theme elements.");
return false;
}
BuildFocusList();
MythUIText *text = dynamic_cast<MythUIText *> (GetChild("heading"));
if (text)
text->SetText(m_title);
MythUIShape *shape = nullptr;
for (int i = -8; i <= 8; i++)
{
text = dynamic_cast<MythUIText *>
(GetChild(QString("value%1%2").arg(i >= 0? "+" : "").arg(i)));
if (text)
m_prevNextTexts[i] = text;
shape = dynamic_cast<MythUIShape *>
(GetChild(QString("shape%1%2").arg(i >= 0? "+" : "").arg(i)));
if (shape)
m_prevNextShapes[i] = shape;
}
m_settingValue = dynamic_cast<MythUITextEdit *> (GetChild("settingvalue"));
connect(m_settingsList, SIGNAL(itemSelected(MythUIButtonListItem*)),
SLOT(selectionChanged(MythUIButtonListItem*)));
connect(m_settingValue, SIGNAL(LosingFocus()), SLOT(valueChanged()));
connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(Save()));
connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close()));
LoadInBackground();
return true;
}
示例5: SetFocusWidget
bool MythScreenType::SetFocusWidget(MythUIType *widget)
{
if (!widget || !widget->IsVisible())
{
QMap<int, MythUIType *>::iterator it = m_FocusWidgetList.begin();
MythUIType *current;
while (it != m_FocusWidgetList.end())
{
current = *it;
if (current->CanTakeFocus() && current->IsVisible())
{
widget = current;
break;
}
++it;
}
}
if (!widget)
return false;
if (m_CurrentFocusWidget == widget)
return true;
MythUIText *helpText = dynamic_cast<MythUIText *>(GetChild("helptext"));
if (helpText)
helpText->Reset();
if (m_CurrentFocusWidget)
m_CurrentFocusWidget->LoseFocus();
m_CurrentFocusWidget = widget;
m_CurrentFocusWidget->TakeFocus();
if (helpText && !widget->GetHelpText().isEmpty())
helpText->SetText(widget->GetHelpText());
return true;
}
示例6: UpdateStatus
void IdleScreen::UpdateStatus(void)
{
QString state = "idle";
if (CheckConnectionToServer())
{
if (m_secondsToShutdown >= 0)
state = "shuttingdown";
else if (RemoteGetRecordingStatus())
state = "recording";
}
else
{
state = "offline";
}
m_statusState->DisplayState(state);
MythUIType* shuttingdown = m_statusState->GetState("shuttingdown");
if (shuttingdown)
{
MythUIText *statusText = dynamic_cast<MythUIText *>(shuttingdown->GetChild("status"));
if (statusText)
{
if (m_secondsToShutdown >= 0)
{
QString status = tr("Backend will shutdown in %n "
"second(s).", "", m_secondsToShutdown);
statusText->SetText(status);
}
else
statusText->Reset();
}
}
}
示例7: Create
bool MythConfirmationDialog::Create(void)
{
if (!CopyWindowFromBase("MythConfirmationDialog", this))
return false;
MythUIText *messageText = NULL;
MythUIButton *okButton = NULL;
MythUIButton *cancelButton = NULL;
bool err = false;
UIUtilE::Assign(this, messageText, "message", &err);
UIUtilE::Assign(this, okButton, "ok", &err);
UIUtilE::Assign(this, cancelButton, "cancel", &err);
if (err)
{
VERBOSE(VB_IMPORTANT, "Cannot load screen 'MythConfirmationDialog'");
return false;
}
if (m_showCancel)
{
connect(cancelButton, SIGNAL(Clicked()), SLOT(Cancel()));
}
else
cancelButton->SetVisible(false);
connect(okButton, SIGNAL(Clicked()), SLOT(Confirm()));
messageText->SetText(m_message);
BuildFocusList();
SetFocusWidget(okButton);
return true;
}
示例8: FillList
void ViewScheduled::FillList()
{
m_schedulesList->Reset();
MythUIText *norecordingText = dynamic_cast<MythUIText*>
(GetChild("norecordings_info"));
if (norecordingText)
norecordingText->SetVisible(m_recList.empty());
if (m_recList.empty())
return;
ProgramList plist;
if (!m_recgroupList.contains(m_currentGroup))
m_currentGroup = m_defaultGroup;
plist = m_recgroupList[m_currentGroup];
ProgramList::iterator pit = plist.begin();
while (pit != plist.end())
{
ProgramInfo *pginfo = *pit;
if (!pginfo)
{
++pit;
continue;
}
QString state;
const RecStatusType recstatus = pginfo->GetRecordingStatus();
if (recstatus == rsRecording)
state = "running";
else if (recstatus == rsConflict ||
recstatus == rsOffLine ||
recstatus == rsTunerBusy ||
recstatus == rsFailed ||
recstatus == rsAborted ||
recstatus == rsMissed)
state = "error";
else if (recstatus == rsWillRecord)
{
if ((m_curcard == 0 && m_curinput == 0) ||
pginfo->GetCardID() == m_curcard ||
pginfo->GetInputID() == m_curinput)
{
if (pginfo->GetRecordingPriority2() < 0)
state = "warning";
else
state = "normal";
}
}
else if (recstatus == rsRepeat ||
recstatus == rsOtherShowing ||
recstatus == rsNeverRecord ||
recstatus == rsDontRecord ||
(recstatus != rsDontRecord &&
recstatus <= rsEarlierShowing))
state = "disabled";
else
state = "warning";
MythUIButtonListItem *item =
new MythUIButtonListItem(m_schedulesList,"",
qVariantFromValue(pginfo));
InfoMap infoMap;
pginfo->ToMap(infoMap);
item->SetTextFromMap(infoMap, state);
QString rating = QString::number(pginfo->GetStars(10));
item->DisplayState(rating, "ratingstate");
item->DisplayState(state, "status");
++pit;
}
MythUIText *statusText = dynamic_cast<MythUIText*>(GetChild("status"));
if (statusText)
{
if (m_conflictBool)
{
// Find first conflict and store in m_conflictDate field
ProgramList::const_iterator it = plist.begin();
for (; it != plist.end(); ++it)
{
ProgramInfo &p = **it;
if (p.GetRecordingStatus() == rsConflict)
{
m_conflictDate = p.GetRecordingStartTime().date();
break;
}
}
// figure out caption based on m_conflictDate
QString cstring = tr("Time Conflict");
QDate now = QDate::currentDate();
int daysToConflict = now.daysTo(m_conflictDate);
//.........这里部分代码省略.........
示例9: FillList
void ViewScheduled::FillList()
{
m_schedulesList->Reset();
MythUIText *norecordingText = dynamic_cast<MythUIText*>
(GetChild("norecordings_info"));
if (norecordingText)
norecordingText->SetVisible(m_recList.empty());
if (m_recList.empty())
return;
ProgramList plist;
if (!m_recgroupList.contains(m_currentGroup))
m_currentGroup = m_defaultGroup;
plist = m_recgroupList[m_currentGroup];
ProgramList::iterator pit = plist.begin();
while (pit != plist.end())
{
ProgramInfo *pginfo = *pit;
if (!pginfo)
{
++pit;
continue;
}
QString state;
const RecStatus::Type recstatus = pginfo->GetRecordingStatus();
if (recstatus == RecStatus::Recording ||
recstatus == RecStatus::Tuning)
state = "running";
else if (recstatus == RecStatus::Conflict ||
recstatus == RecStatus::Offline ||
recstatus == RecStatus::TunerBusy ||
recstatus == RecStatus::Failed ||
recstatus == RecStatus::Failing ||
recstatus == RecStatus::Aborted ||
recstatus == RecStatus::Missed)
state = "error";
else if (recstatus == RecStatus::WillRecord ||
recstatus == RecStatus::Pending)
{
if (m_curinput == 0 || pginfo->GetInputID() == m_curinput)
{
if (pginfo->GetRecordingPriority2() < 0)
state = "warning";
else
state = "normal";
}
}
else if (recstatus == RecStatus::Repeat ||
recstatus == RecStatus::NeverRecord ||
recstatus == RecStatus::DontRecord ||
(recstatus != RecStatus::DontRecord &&
recstatus <= RecStatus::EarlierShowing))
state = "disabled";
else
state = "warning";
MythUIButtonListItem *item =
new MythUIButtonListItem(m_schedulesList,"",
qVariantFromValue(pginfo));
InfoMap infoMap;
pginfo->ToMap(infoMap);
item->SetTextFromMap(infoMap, state);
QString rating = QString::number(pginfo->GetStars(10));
item->DisplayState(rating, "ratingstate");
item->DisplayState(state, "status");
++pit;
}
MythUIText *statusText = dynamic_cast<MythUIText*>(GetChild("status"));
if (statusText)
{
if (m_conflictBool)
{
// Find first conflict and store in m_conflictDate field
ProgramList::const_iterator it = plist.begin();
for (; it != plist.end(); ++it)
{
ProgramInfo &p = **it;
if (p.GetRecordingStatus() == RecStatus::Conflict)
{
m_conflictDate = p.GetRecordingStartTime()
.toLocalTime().date();
break;
}
}
// TODO: This can be templated instead of hardcoding
// Conflict/No Conflict
QString cstring = tr("Conflict %1")
//.........这里部分代码省略.........
示例10: SetText
void OSD::SetText(const QString &window, const InfoMap &map,
OSDTimeout timeout)
{
MythScreenType *win = GetWindow(window);
if (!win)
return;
if (map.contains("numstars"))
{
MythUIStateType *state = dynamic_cast<MythUIStateType *> (win->GetChild("ratingstate"));
if (state)
state->DisplayState(map["numstars"]);
}
if (map.contains("tvstate"))
{
MythUIStateType *state = dynamic_cast<MythUIStateType *> (win->GetChild("tvstate"));
if (state)
state->DisplayState(map["tvstate"]);
}
if (map.contains("videocodec"))
{
MythUIStateType *state = dynamic_cast<MythUIStateType *> (win->GetChild("videocodec"));
if (state)
state->DisplayState(map["videocodec"]);
}
if (map.contains("videodescrip"))
{
MythUIStateType *state = dynamic_cast<MythUIStateType *> (win->GetChild("videodescrip"));
if (state)
state->DisplayState(map["videodescrip"]);
}
if (map.contains("audiocodec"))
{
MythUIStateType *state = dynamic_cast<MythUIStateType *> (win->GetChild("audiocodec"));
if (state)
state->DisplayState(map["audiocodec"]);
}
if (map.contains("audiochannels"))
{
MythUIStateType *state = dynamic_cast<MythUIStateType *> (win->GetChild("audiochannels"));
if (state)
state->DisplayState(map["audiochannels"]);
}
if (map.contains("chanid"))
{
MythUIImage *icon = dynamic_cast<MythUIImage *> (win->GetChild("iconpath"));
if (icon)
{
icon->Reset();
uint chanid = map["chanid"].toUInt();
QString iconpath;
if (map.contains("iconpath"))
iconpath = map["iconpath"];
else
iconpath = ChannelUtil::GetIcon(chanid);
if (!iconpath.isEmpty())
{
QString iconurl =
gCoreContext->GetMasterHostPrefix("ChannelIcons",
iconpath);
icon->SetFilename(iconurl);
icon->Load(false);
}
}
}
if (map.contains("channelgroup"))
{
MythUIText *textArea = dynamic_cast<MythUIText *> (win->GetChild("channelgroup"));
if (textArea)
{
textArea->SetText(map["channelgroup"]);
}
}
if (map.contains("inetref"))
{
MythUIImage *cover = dynamic_cast<MythUIImage *> (win->GetChild("coverart"));
if (cover && map.contains("coverartpath"))
{
QString coverpath = map["coverartpath"];
cover->SetFilename(coverpath);
cover->Load(false);
}
MythUIImage *fanart = dynamic_cast<MythUIImage *> (win->GetChild("fanart"));
if (fanart && map.contains("fanartpath"))
{
QString fanartpath = map["fanartpath"];
fanart->SetFilename(fanartpath);
fanart->Load(false);
}
MythUIImage *banner = dynamic_cast<MythUIImage *> (win->GetChild("banner"));
if (banner && map.contains("bannerpath"))
{
QString bannerpath = map["bannerpath"];
banner->SetFilename(bannerpath);
banner->Load(false);
//.........这里部分代码省略.........