本文整理汇总了C++中CGUIDialogFileBrowser::SetHeading方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogFileBrowser::SetHeading方法的具体用法?C++ CGUIDialogFileBrowser::SetHeading怎么用?C++ CGUIDialogFileBrowser::SetHeading使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogFileBrowser
的用法示例。
在下文中一共展示了CGUIDialogFileBrowser::SetHeading方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowAndGetFileList
bool CGUIDialogFileBrowser::ShowAndGetFileList(const VECSOURCES &shares, const std::string &mask, const std::string &heading, std::vector<std::string> &path, bool useThumbs /* = false */, bool useFileDirectories /* = false */)
{
CGUIDialogFileBrowser *browser = new CGUIDialogFileBrowser();
if (!browser)
return false;
CServiceBroker::GetGUI()->GetWindowManager().AddUniqueInstance(browser);
browser->m_useFileDirectories = useFileDirectories;
browser->m_multipleSelection = true;
browser->m_browsingForImages = useThumbs;
browser->SetHeading(heading);
browser->SetSources(shares);
browser->m_browsingForFolders = 0;
browser->m_rootDir.SetMask(mask);
browser->m_addNetworkShareEnabled = false;
browser->Open();
bool confirmed(browser->IsConfirmed());
if (confirmed)
{
if (browser->m_markedPath.size())
path = browser->m_markedPath;
else
path.push_back(browser->m_selectedPath);
}
CServiceBroker::GetGUI()->GetWindowManager().Remove(browser->GetID());
delete browser;
return confirmed;
}
示例2: ShowAndGetFile
bool CGUIDialogFileBrowser::ShowAndGetFile(const VECSOURCES &shares, const std::string &mask, const std::string &heading, std::string &path, bool useThumbs /* = false */, bool useFileDirectories /* = false */)
{
CGUIDialogFileBrowser *browser = new CGUIDialogFileBrowser();
if (!browser)
return false;
CServiceBroker::GetGUI()->GetWindowManager().AddUniqueInstance(browser);
browser->m_useFileDirectories = useFileDirectories;
browser->m_browsingForImages = useThumbs;
browser->SetHeading(heading);
browser->SetSources(shares);
std::string strMask = mask;
if (mask == "/")
browser->m_browsingForFolders=1;
else
if (mask == "/w")
{
browser->m_browsingForFolders=2;
strMask = "/";
}
else
browser->m_browsingForFolders = 0;
browser->m_rootDir.SetMask(strMask);
browser->m_selectedPath = path;
browser->m_addNetworkShareEnabled = false;
browser->Open();
bool confirmed(browser->IsConfirmed());
if (confirmed)
path = browser->m_selectedPath;
CServiceBroker::GetGUI()->GetWindowManager().Remove(browser->GetID());
delete browser;
return confirmed;
}
示例3: ShowAndGetImage
bool CGUIDialogFileBrowser::ShowAndGetImage(const CFileItemList &items, const VECSOURCES &shares, const CStdString &heading, CStdString &result, bool* flip, int label)
{
CStdString mask = ".png|.jpg|.bmp|.gif|.dds";
CGUIDialogFileBrowser *browser = new CGUIDialogFileBrowser();
if (!browser)
return false;
g_windowManager.AddUniqueInstance(browser);
browser->m_browsingForImages = true;
browser->m_singleList = true;
browser->m_vecItems->Clear();
browser->m_vecItems->Append(items);
if (true)
{
CFileItemPtr item(new CFileItem("image://Browse", false));
item->SetLabel(g_localizeStrings.Get(20153));
item->SetIconImage("DefaultFolder.png");
browser->m_vecItems->Add(item);
}
browser->SetHeading(heading);
browser->m_flipEnabled = flip?true:false;
browser->DoModal();
bool confirmed(browser->IsConfirmed());
if (confirmed)
{
result = browser->m_selectedPath;
if (result == "image://Browse")
{ // "Browse for thumb"
g_windowManager.Remove(browser->GetID());
delete browser;
return ShowAndGetImage(shares, g_localizeStrings.Get(label), result);
}
}
if (flip)
*flip = browser->m_bFlip != 0;
g_windowManager.Remove(browser->GetID());
delete browser;
return confirmed;
}
示例4: ShowAndGetSource
bool CGUIDialogFileBrowser::ShowAndGetSource(std::string &path, bool allowNetworkShares, VECSOURCES* additionalShare /* = NULL */, const std::string& strType /* = "" */)
{
// Technique is
// 1. Show Filebrowser with currently defined local, and optionally the network locations.
// 2. Have the "Add Network Location" option in addition.
// 3a. If the "Add Network Location" is pressed, then:
// a) Fire up the network location dialog to grab the new location
// b) Check the location by doing a GetDirectory() - if it fails, prompt the user
// to allow them to add currently disconnected network shares.
// c) Save this location to our xml file (network.xml)
// d) Return to 1.
// 3b. If the "Add Source" is pressed, then:
// a) Fire up the media source dialog to add the new location
// 4. Optionally allow user to browse the local and network locations for their share.
// 5. On OK, return.
// Create a new filebrowser window
CGUIDialogFileBrowser *browser = new CGUIDialogFileBrowser();
if (!browser) return false;
// Add it to our window manager
CServiceBroker::GetGUI()->GetWindowManager().AddUniqueInstance(browser);
VECSOURCES shares;
if (!strType.empty())
{
if (additionalShare)
shares = *additionalShare;
browser->m_addSourceType = strType;
}
else
{
browser->SetHeading(g_localizeStrings.Get(1023));
g_mediaManager.GetLocalDrives(shares);
// Now the additional share if appropriate
if (additionalShare)
{
shares.insert(shares.end(),additionalShare->begin(),additionalShare->end());
}
// Now add the network shares...
if (allowNetworkShares)
{
g_mediaManager.GetNetworkLocations(shares);
}
}
browser->SetSources(shares);
browser->m_rootDir.SetMask("/");
browser->m_rootDir.AllowNonLocalSources(false); // don't allow plug n play shares
browser->m_browsingForFolders = 1;
browser->m_addNetworkShareEnabled = allowNetworkShares;
browser->m_selectedPath = "";
browser->Open();
bool confirmed = browser->IsConfirmed();
if (confirmed)
path = browser->m_selectedPath;
CServiceBroker::GetGUI()->GetWindowManager().Remove(browser->GetID());
delete browser;
return confirmed;
}