本文整理汇总了C++中CFileItemPtr::IsCBZ方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileItemPtr::IsCBZ方法的具体用法?C++ CFileItemPtr::IsCBZ怎么用?C++ CFileItemPtr::IsCBZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileItemPtr
的用法示例。
在下文中一共展示了CFileItemPtr::IsCBZ方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnClick
void CGUIWindowFileManager::OnClick(int iList, int iItem)
{
if ( iList < 0 || iList > 2) return ;
if ( iItem < 0 || iItem >= m_vecItems[iList]->Size() ) return ;
CFileItemPtr pItem = m_vecItems[iList]->Get(iItem);
if (pItem->GetPath() == "add" && pItem->GetLabel() == g_localizeStrings.Get(1026)) // 'add source button' in empty root
{
if (CGUIDialogMediaSource::ShowAndAddMediaSource("files"))
{
m_rootDir.SetSources(g_settings.m_fileSources);
Update(0,m_Directory[0]->GetPath());
Update(1,m_Directory[1]->GetPath());
}
return;
}
if (pItem->m_bIsFolder)
{
// save path + drive type because of the possible refresh
CStdString strPath = pItem->GetPath();
int iDriveType = pItem->m_iDriveType;
if ( pItem->m_bIsShareOrDrive )
{
if ( !g_passwordManager.IsItemUnlocked( pItem.get(), "files" ) )
{
Refresh();
return ;
}
if ( !HaveDiscOrConnection( strPath, iDriveType ) )
return ;
}
if (!Update(iList, strPath))
ShowShareErrorMessage(pItem.get());
}
else if (pItem->IsZIP() || pItem->IsCBZ()) // mount zip archive
{
CStdString strArcivedPath;
URIUtils::CreateArchivePath(strArcivedPath, "zip", pItem->GetPath(), "");
Update(iList, strArcivedPath);
}
else if (pItem->IsRAR() || pItem->IsCBR())
{
CStdString strArcivedPath;
URIUtils::CreateArchivePath(strArcivedPath, "rar", pItem->GetPath(), "");
Update(iList, strArcivedPath);
}
else
{
OnStart(pItem.get());
return ;
}
// UpdateButtons();
}
示例2: OnClick
bool CGUIWindowPictures::OnClick(int iItem)
{
if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return true;
CFileItemPtr pItem = m_vecItems->Get(iItem);
if (pItem->IsCBZ() || pItem->IsCBR())
{
CStdString strComicPath;
if (pItem->IsCBZ())
URIUtils::CreateArchivePath(strComicPath, "zip", pItem->GetPath(), "");
else
URIUtils::CreateArchivePath(strComicPath, "rar", pItem->GetPath(), "");
OnShowPictureRecursive(strComicPath);
return true;
}
else if (CGUIMediaWindow::OnClick(iItem))
return true;
return false;
}
示例3: OnClick
bool CGUIWindowPictures::OnClick(int iItem)
{
if ( iItem < 0 || iItem >= (int)m_vecItems->Size() ) return true;
CFileItemPtr pItem = m_vecItems->Get(iItem);
if (pItem->IsCBZ() || pItem->IsCBR())
{
CURL pathToUrl;
if (pItem->IsCBZ())
pathToUrl = URIUtils::CreateArchivePath("zip", pItem->GetURL(), "");
else
pathToUrl = URIUtils::CreateArchivePath("rar", pItem->GetURL(), "");
OnShowPictureRecursive(pathToUrl.Get());
return true;
}
else if (CGUIMediaWindow::OnClick(iItem))
return true;
return false;
}
示例4: OnInfo
void CGUIWindowPictures::OnInfo(int itemNumber)
{
CFileItemPtr item = (itemNumber >= 0 && itemNumber < m_vecItems->Size()) ? m_vecItems->Get(itemNumber) : CFileItemPtr();
if (!item || item->m_bIsFolder || item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR() || !item->IsPicture())
return;
CGUIDialogPictureInfo *pictureInfo = (CGUIDialogPictureInfo *)g_windowManager.GetWindow(WINDOW_DIALOG_PICTURE_INFO);
if (pictureInfo)
{
pictureInfo->SetPicture(item.get());
pictureInfo->DoModal();
}
}
示例5: GetContextButtons
void CGUIWindowPictures::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
if (item && !item->GetProperty("pluginreplacecontextitems").asBoolean())
{
if ( m_vecItems->IsVirtualDirectoryRoot() || m_vecItems->GetPath() == "sources://pictures/" )
{
CGUIDialogContextMenu::GetContextButtons("pictures", item, buttons);
}
else
{
if (item && !StringUtils::StartsWithNoCase(item->GetPath(), "addons://more/"))
{
if (!m_vecItems->IsPlugin() && (item->IsPlugin() || item->IsScript()))
buttons.Add(CONTEXT_BUTTON_INFO, 24003); // Add-on info
if (!(item->m_bIsFolder || item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR() || item->IsScript()))
{
buttons.Add(CONTEXT_BUTTON_INFO, 13406); // picture info
buttons.Add(CONTEXT_BUTTON_VIEW_SLIDESHOW, item->m_bIsFolder ? 13317 : 13422); // View Slideshow
}
if (item->m_bIsFolder)
buttons.Add(CONTEXT_BUTTON_RECURSIVE_SLIDESHOW, 13318); // Recursive Slideshow
if (!m_thumbLoader.IsLoading())
buttons.Add(CONTEXT_BUTTON_REFRESH_THUMBS, 13315); // Create Thumbnails
if (CSettings::Get().GetBool("filelists.allowfiledeletion") && !item->IsReadOnly())
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
}
}
if (item->IsPlugin() || item->IsScript() || m_vecItems->IsPlugin())
buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045);
else
{
buttons.Add(CONTEXT_BUTTON_GOTO_ROOT, 20128);
buttons.Add(CONTEXT_BUTTON_SWITCH_MEDIA, 523);
}
}
}
CGUIMediaWindow::GetContextButtons(itemNumber, buttons);
if (item && !item->GetProperty("pluginreplacecontextitems").asBoolean())
buttons.Add(CONTEXT_BUTTON_SETTINGS, 5); // Settings
CContextMenuManager::Get().AddVisibleItems(item, buttons);
}
示例6: OnInfo
void CGUIWindowPictures::OnInfo(int itemNumber)
{
CFileItemPtr item = (itemNumber >= 0 && itemNumber < m_vecItems->Size()) ? m_vecItems->Get(itemNumber) : CFileItemPtr();
if (!item)
return;
if (!m_vecItems->IsPlugin() && (item->IsPlugin() || item->IsScript()))
{
CGUIDialogAddonInfo::ShowForItem(item);
return;
}
if (item->m_bIsFolder || item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR() || !item->IsPicture())
return;
CGUIDialogPictureInfo *pictureInfo = (CGUIDialogPictureInfo *)g_windowManager.GetWindow(WINDOW_DIALOG_PICTURE_INFO);
if (pictureInfo)
{
pictureInfo->SetPicture(item.get());
pictureInfo->Open();
}
}
示例7: OnItemInfo
void CGUIWindowPictures::OnItemInfo(int itemNumber)
{
CFileItemPtr item = m_vecItems->Get(itemNumber);
if (!item)
return;
if (!m_vecItems->IsPlugin() && (item->IsPlugin() || item->IsScript()))
{
CGUIDialogAddonInfo::ShowForItem(item);
return;
}
if (item->m_bIsFolder || item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR() || !item->IsPicture())
return;
CGUIDialogPictureInfo *pictureInfo = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogPictureInfo>(WINDOW_DIALOG_PICTURE_INFO);
if (pictureInfo)
{
pictureInfo->SetPicture(item.get());
pictureInfo->Open();
}
}
示例8: GetContextButtons
void CGUIWindowPictures::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
if (item && !item->GetPropertyBOOL("pluginreplacecontextitems"))
{
if ( m_vecItems->IsVirtualDirectoryRoot() && item)
{
CGUIDialogContextMenu::GetContextButtons("pictures", item, buttons);
}
else
{
if (item)
{
if (!(item->m_bIsFolder || item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR()))
buttons.Add(CONTEXT_BUTTON_INFO, 13406); // picture info
buttons.Add(CONTEXT_BUTTON_VIEW_SLIDESHOW, item->m_bIsFolder ? 13317 : 13422); // View Slideshow
if (item->m_bIsFolder)
buttons.Add(CONTEXT_BUTTON_RECURSIVE_SLIDESHOW, 13318); // Recursive Slideshow
if (!m_thumbLoader.IsLoading())
buttons.Add(CONTEXT_BUTTON_REFRESH_THUMBS, 13315); // Create Thumbnails
if (g_guiSettings.GetBool("filelists.allowfiledeletion") && !item->IsReadOnly())
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
}
}
if (item->IsPlugin() || item->m_strPath.Left(9).Equals("script://") || m_vecItems->IsPlugin())
buttons.Add(CONTEXT_BUTTON_PLUGIN_SETTINGS, 1045);
buttons.Add(CONTEXT_BUTTON_GOTO_ROOT, 20128);
buttons.Add(CONTEXT_BUTTON_SWITCH_MEDIA, 523);
}
}
CGUIMediaWindow::GetContextButtons(itemNumber, buttons);
if (item && !item->GetPropertyBOOL("pluginreplacecontextitems"))
buttons.Add(CONTEXT_BUTTON_SETTINGS, 5); // Settings
}
示例9: GetContextButtons
void CGUIWindowPictures::GetContextButtons(int itemNumber, CContextButtons &buttons)
{
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
if (item)
{
if ( m_vecItems->IsVirtualDirectoryRoot() || m_vecItems->GetPath() == "sources://pictures/" )
{
CGUIDialogContextMenu::GetContextButtons("pictures", item, buttons);
}
else
{
if (item)
{
if (!(item->m_bIsFolder || item->IsZIP() || item->IsRAR() || item->IsCBZ() || item->IsCBR() || item->IsScript()))
{
if (item->IsPicture())
buttons.Add(CONTEXT_BUTTON_INFO, 13406); // picture info
buttons.Add(CONTEXT_BUTTON_VIEW_SLIDESHOW, item->m_bIsFolder ? 13317 : 13422); // View Slideshow
}
if (item->m_bIsFolder)
buttons.Add(CONTEXT_BUTTON_RECURSIVE_SLIDESHOW, 13318); // Recursive Slideshow
if (!m_thumbLoader.IsLoading())
buttons.Add(CONTEXT_BUTTON_REFRESH_THUMBS, 13315); // Create Thumbnails
if (CServiceBroker::GetSettings().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION) && !item->IsReadOnly())
{
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
}
}
if (!item->IsPlugin() && !item->IsScript() && !m_vecItems->IsPlugin())
buttons.Add(CONTEXT_BUTTON_SWITCH_MEDIA, 523);
}
}
CGUIMediaWindow::GetContextButtons(itemNumber, buttons);
}
示例10: LoadPlayList
void CGUIWindowPictures::LoadPlayList(const CStdString& strPlayList)
{
CLog::Log(LOGDEBUG,"CGUIWindowPictures::LoadPlayList()... converting playlist into slideshow: %s", strPlayList.c_str());
auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList));
if ( NULL != pPlayList.get())
{
if (!pPlayList->Load(strPlayList))
{
CGUIDialogOK::ShowAndGetInput(6, 0, 477, 0);
return ; //hmmm unable to load playlist?
}
}
CPlayList playlist = *pPlayList;
if (playlist.size() > 0)
{
// set up slideshow
CGUIWindowSlideShow *pSlideShow = (CGUIWindowSlideShow *)g_windowManager.GetWindow(WINDOW_SLIDESHOW);
if (!pSlideShow)
return;
if (g_application.m_pPlayer->IsPlayingVideo())
g_application.StopPlaying();
// convert playlist items into slideshow items
pSlideShow->Reset();
for (int i = 0; i < (int)playlist.size(); ++i)
{
CFileItemPtr pItem = playlist[i];
//CLog::Log(LOGDEBUG,"-- playlist item: %s", pItem->GetPath().c_str());
if (pItem->IsPicture() && !(pItem->IsZIP() || pItem->IsRAR() || pItem->IsCBZ() || pItem->IsCBR()))
pSlideShow->Add(pItem.get());
}
// start slideshow if there are items
pSlideShow->StartSlideShow();
if (pSlideShow->NumSlides())
g_windowManager.ActivateWindow(WINDOW_SLIDESHOW);
}
}
示例11: LoadPlayList
void CGUIWindowPictures::LoadPlayList(const std::string& strPlayList)
{
CLog::Log(LOGDEBUG,"CGUIWindowPictures::LoadPlayList()... converting playlist into slideshow: %s", strPlayList.c_str());
std::unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList));
if ( NULL != pPlayList.get())
{
if (!pPlayList->Load(strPlayList))
{
HELPERS::ShowOKDialogText(CVariant{6}, CVariant{477});
return ; //hmmm unable to load playlist?
}
}
CPlayList playlist = *pPlayList;
if (playlist.size() > 0)
{
// set up slideshow
CGUIWindowSlideShow *pSlideShow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIWindowSlideShow>(WINDOW_SLIDESHOW);
if (!pSlideShow)
return;
if (g_application.GetAppPlayer().IsPlayingVideo())
g_application.StopPlaying();
// convert playlist items into slideshow items
pSlideShow->Reset();
for (int i = 0; i < (int)playlist.size(); ++i)
{
CFileItemPtr pItem = playlist[i];
//CLog::Log(LOGDEBUG,"-- playlist item: %s", pItem->GetPath().c_str());
if (pItem->IsPicture() && !(pItem->IsZIP() || pItem->IsRAR() || pItem->IsCBZ() || pItem->IsCBR()))
pSlideShow->Add(pItem.get());
}
// start slideshow if there are items
pSlideShow->StartSlideShow();
if (pSlideShow->NumSlides())
CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(WINDOW_SLIDESHOW);
}
}
示例12: OnClick
void CGUIWindowFileManager::OnClick(int iList, int iItem)
{
if ( iList < 0 || iList >= 2) return ;
if ( iItem < 0 || iItem >= m_vecItems[iList]->Size() ) return ;
CFileItemPtr pItem = m_vecItems[iList]->Get(iItem);
if (pItem->GetPath() == "add" && pItem->GetLabel() == g_localizeStrings.Get(1026)) // 'add source button' in empty root
{
if (CGUIDialogMediaSource::ShowAndAddMediaSource("files"))
{
m_rootDir.SetSources(*CMediaSourceSettings::Get().GetSources("files"));
Update(0,m_Directory[0]->GetPath());
Update(1,m_Directory[1]->GetPath());
}
return;
}
if (!pItem->m_bIsFolder && pItem->IsFileFolder(EFILEFOLDER_MASK_ALL))
{
XFILE::IFileDirectory *pFileDirectory = NULL;
pFileDirectory = XFILE::CFileDirectoryFactory::Create(pItem->GetURL(), pItem.get(), "");
if(pFileDirectory)
pItem->m_bIsFolder = true;
else if(pItem->m_bIsFolder)
pItem->m_bIsFolder = false;
delete pFileDirectory;
}
if (pItem->m_bIsFolder)
{
// save path + drive type because of the possible refresh
CStdString strPath = pItem->GetPath();
int iDriveType = pItem->m_iDriveType;
if ( pItem->m_bIsShareOrDrive )
{
if ( !g_passwordManager.IsItemUnlocked( pItem.get(), "files" ) )
{
Refresh();
return ;
}
if ( !HaveDiscOrConnection( strPath, iDriveType ) )
return ;
}
if (!Update(iList, strPath))
ShowShareErrorMessage(pItem.get());
}
else if (pItem->IsZIP() || pItem->IsCBZ()) // mount zip archive
{
CURL pathToUrl = URIUtils::CreateArchivePath("zip", pItem->GetURL(), "");
Update(iList, pathToUrl.Get());
}
else if (pItem->IsRAR() || pItem->IsCBR())
{
CURL pathToUrl = URIUtils::CreateArchivePath("rar", pItem->GetURL(), "");
Update(iList, pathToUrl.Get());
}
else
{
OnStart(pItem.get());
return ;
}
// UpdateButtons();
}