本文整理汇总了C++中MythUIButtonListItem::setCheckable方法的典型用法代码示例。如果您正苦于以下问题:C++ MythUIButtonListItem::setCheckable方法的具体用法?C++ MythUIButtonListItem::setCheckable怎么用?C++ MythUIButtonListItem::setCheckable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythUIButtonListItem
的用法示例。
在下文中一共展示了MythUIButtonListItem::setCheckable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillGrabberButtonList
void SearchEditor::fillGrabberButtonList()
{
for (GrabberScript::scriptList::iterator i = m_grabberList.begin();
i != m_grabberList.end(); ++i)
{
MythUIButtonListItem *item =
new MythUIButtonListItem(m_grabbers, (*i)->GetTitle());
if (item)
{
item->SetText((*i)->GetTitle(), "title");
item->SetData(qVariantFromValue(*i));
QString img = (*i)->GetImage();
QString thumb;
if (!img.startsWith("/") && !img.isEmpty())
thumb = QString("%1mythnetvision/icons/%2").arg(GetShareDir())
.arg((*i)->GetImage());
else
thumb = img;
item->SetImage(thumb);
item->setCheckable(true);
item->setChecked(MythUIButtonListItem::NotChecked);
QFileInfo fi((*i)->GetCommandline());
if (findSearchGrabberInDB(fi.fileName(), VIDEO))
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
delete item;
}
}
示例2: updateTrackList
void Ripper::updateTrackList(void)
{
if (m_tracks->isEmpty())
return;
QString tmptitle;
if (m_trackList)
{
m_trackList->Reset();
int i;
for (i = 0; i < (int)m_tracks->size(); i++)
{
if (i >= m_tracks->size())
break;
RipTrack *track = m_tracks->at(i);
Metadata *metadata = track->metadata;
MythUIButtonListItem *item = new MythUIButtonListItem(m_trackList,"");
item->setCheckable(true);
item->SetData(qVariantFromValue(track));
if (track->isNew)
item->DisplayState("new", "yes");
else
item->DisplayState("new", "no");
if (track->active)
item->setChecked(MythUIButtonListItem::FullChecked);
else
item->setChecked(MythUIButtonListItem::NotChecked);
item->SetText(QString::number(metadata->Track()), "track");
item->SetText(metadata->Title(), "title");
item->SetText(metadata->Artist(), "artist");
int length = track->length / 1000;
if (length > 0)
{
int min, sec;
min = length / 60;
sec = length % 60;
QString s;
s.sprintf("%02d:%02d", min, sec);
item->SetText(s, "length");
}
else
item->SetText("", "length");
// if (i == m_currentTrack)
// m_trackList->SetItemCurrent(i);
}
}
}
示例3: updateVideoList
void VideoSelector::updateVideoList(void)
{
if (!m_videoList)
return;
m_videoButtonList->Reset();
if (m_categorySelector)
{
VideoInfo *v;
vector<VideoInfo *>::iterator i = m_videoList->begin();
for ( ; i != m_videoList->end(); ++i)
{
v = *i;
if (v->category == m_categorySelector->GetValue() ||
m_categorySelector->GetValue() == tr("All Videos"))
{
if (v->parentalLevel <= m_currentParentalLevel)
{
MythUIButtonListItem* item = new MythUIButtonListItem(
m_videoButtonList, v->title);
item->setCheckable(true);
if (m_selectedList.indexOf((VideoInfo *) v) != -1)
{
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
{
item->setChecked(MythUIButtonListItem::NotChecked);
}
item->SetData(qVariantFromValue(v));
}
}
}
}
if (m_videoButtonList->GetCount() > 0)
{
m_videoButtonList->SetItemCurrent(m_videoButtonList->GetItemFirst());
titleChanged(m_videoButtonList->GetItemCurrent());
m_warningText->Hide();
}
else
{
m_warningText->Show();
m_titleText->Reset();
m_plotText->Reset();
m_coverImage->SetFilename("blank.png");
m_coverImage->Load();
m_filesizeText->Reset();
}
}
示例4: updateRecordingList
void RecordingSelector::updateRecordingList(void)
{
if (!m_recordingList || m_recordingList->size() == 0)
return;
m_recordingButtonList->Reset();
if (m_categorySelector)
{
ProgramInfo *p;
vector<ProgramInfo *>::iterator i = m_recordingList->begin();
for ( ; i != m_recordingList->end(); i++)
{
p = *i;
if (p->GetTitle() == m_categorySelector->GetValue() ||
m_categorySelector->GetValue() == tr("All Recordings"))
{
MythUIButtonListItem* item = new MythUIButtonListItem(
m_recordingButtonList,
p->GetTitle() + " ~ " +
p->GetScheduledStartTime().toString("dd MMM yy (hh:mm)"));
item->setCheckable(true);
if (m_selectedList.indexOf((ProgramInfo *) p) != -1)
{
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
{
item->setChecked(MythUIButtonListItem::NotChecked);
}
item->SetData(qVariantFromValue(p));
}
qApp->processEvents();
}
}
m_recordingButtonList->SetItemCurrent(m_recordingButtonList->GetItemFirst());
titleChanged(m_recordingButtonList->GetItemCurrent());
}
示例5: updateRecordingList
void ImportFile::updateRecordingList(void)
{
if (m_recordingList.empty())
return;
m_recordingButtonList->Reset();
if (m_categorySelector)
{
ImportItem *i;
for (int x = 0; x < m_recordingList.count(); x++)
{
i = m_recordingList.at(x);
if (i->category == m_categorySelector->GetValue() ||
m_categorySelector->GetValue() == tr("All Recordings"))
{
MythUIButtonListItem* item = new MythUIButtonListItem(
m_recordingButtonList,
i->title + " ~ " + MythDate::toString(i->startTime, MythDate::kDateTimeFull + MythDate::kAutoYear));
item->setCheckable(true);
if (m_selectedList.indexOf((ImportItem *) i) != -1)
{
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
{
item->setChecked(MythUIButtonListItem::NotChecked);
}
item->SetData(qVariantFromValue(i));
}
qApp->processEvents();
}
}
m_recordingButtonList->SetItemCurrent(m_recordingButtonList->GetItemFirst());
titleChanged(m_recordingButtonList->GetItemCurrent());
}
示例6: updateFileList
void FileSelector::updateFileList()
{
if (!m_fileButtonList)
return;
m_fileButtonList->Reset();
while (!m_fileData.isEmpty())
delete m_fileData.takeFirst();
m_fileData.clear();
QDir d;
d.setPath(m_curDirectory);
if (d.exists())
{
// first get a list of directory's in the current directory
QStringList filters;
filters << "*";
QFileInfoList list = d.entryInfoList(filters, QDir::Dirs, QDir::Name);
QFileInfo fi;
for (int x = 0; x < list.size(); x++)
{
fi = list.at(x);
if (fi.fileName() != ".")
{
FileData *data = new FileData;
data->selected = false;
data->directory = true;
data->filename = fi.fileName();
data->size = 0;
m_fileData.append(data);
// add a row to the MythUIButtonList
MythUIButtonListItem* item = new
MythUIButtonListItem(m_fileButtonList, data->filename);
item->setCheckable(false);
item->SetImage("ma_folder.png");
item->SetData(qVariantFromValue(data));
}
}
if (m_selectorType != FSTYPE_DIRECTORY)
{
// second get a list of file's in the current directory
filters.clear();
filters = m_filemask.split(" ", QString::SkipEmptyParts);
list = d.entryInfoList(filters, QDir::Files, QDir::Name);
for (int x = 0; x < list.size(); x++)
{
fi = list.at(x);
FileData *data = new FileData;
data->selected = false;
data->directory = false;
data->filename = fi.fileName();
data->size = fi.size();
m_fileData.append(data);
// add a row to the UIListBtnArea
MythUIButtonListItem* item =
new MythUIButtonListItem(m_fileButtonList, data->filename);
item->SetText(formatSize(data->size / 1024, 2), "size");
if (m_selectorType == FSTYPE_FILELIST)
{
item->setCheckable(true);
QString fullPath = m_curDirectory;
if (!fullPath.endsWith("/"))
fullPath += "/";
fullPath += data->filename;
if (m_selectedList.indexOf(fullPath) != -1)
{
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
{
item->setChecked(MythUIButtonListItem::NotChecked);
}
}
else
item->setCheckable(false);
item->SetData(qVariantFromValue(data));
}
}
m_locationEdit->SetText(m_curDirectory);
}
else
{
m_locationEdit->SetText("/");
LOG(VB_GENERAL, LOG_ERR,
"MythArchive: current directory does not exist!");
}
}
示例7: updateRecordingList
void RecordingSelector::updateRecordingList(void)
{
if (!m_recordingList || m_recordingList->empty())
return;
m_recordingButtonList->Reset();
if (m_categorySelector)
{
ProgramInfo *p;
vector<ProgramInfo *>::iterator i = m_recordingList->begin();
for ( ; i != m_recordingList->end(); ++i)
{
p = *i;
if (p->GetTitle() == m_categorySelector->GetValue() ||
m_categorySelector->GetValue() == tr("All Recordings"))
{
MythUIButtonListItem* item = new MythUIButtonListItem(
m_recordingButtonList,
p->GetTitle() + " ~ " +
p->GetScheduledStartTime().toLocalTime()
.toString("dd MMM yy (hh:mm)"));
item->setCheckable(true);
if (m_selectedList.indexOf((ProgramInfo *) p) != -1)
{
item->setChecked(MythUIButtonListItem::FullChecked);
}
else
{
item->setChecked(MythUIButtonListItem::NotChecked);
}
QString title = p->GetTitle();
QString subtitle = p->GetSubtitle();
QDateTime recstartts = p->GetScheduledStartTime();
QDateTime recendts = p->GetScheduledEndTime();
QString timedate = QString("%1 - %2")
.arg(MythDate::toString(recstartts,MythDate::kDateTimeFull))
.arg(MythDate::toString(recendts, MythDate::kTime));
uint season = p->GetSeason();
uint episode = p->GetEpisode();
QString seasone, seasonx;
if (season && episode)
{
seasone = QString("s%1e%2")
.arg(format_season_and_episode(season, 2))
.arg(format_season_and_episode(episode, 2));
seasonx = QString("%1x%2")
.arg(format_season_and_episode(season, 1))
.arg(format_season_and_episode(episode, 2));
}
item->SetText(title, "title");
item->SetText(subtitle, "subtitle");
if (subtitle.isEmpty())
item->SetText(title, "titlesubtitle");
else
item->SetText(title + " - \"" + subtitle + '"',
"titlesubtitle");
item->SetText(timedate, "timedate");
item->SetText(p->GetDescription(), "description");
item->SetText(formatSize(p->GetFilesize() / 1024),
"filesize_str");
item->SetText(QString::number(season), "season");
item->SetText(QString::number(episode), "episode");
item->SetText(seasonx, "00x00");
item->SetText(seasone, "s00e00");
item->DisplayState(p->HasCutlist() ? "yes" : "no", "cutlist");
item->SetData(qVariantFromValue(p));
}
qApp->processEvents();
}
}
m_recordingButtonList->SetItemCurrent(m_recordingButtonList->GetItemFirst());
titleChanged(m_recordingButtonList->GetItemCurrent());
}