本文整理汇总了C++中CServerPath::SetType方法的典型用法代码示例。如果您正苦于以下问题:C++ CServerPath::SetType方法的具体用法?C++ CServerPath::SetType怎么用?C++ CServerPath::SetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CServerPath
的用法示例。
在下文中一共展示了CServerPath::SetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Verify
bool CBookmarksDialog::Verify()
{
wxTreeItemId item = m_pTree->GetSelection();
if (!item)
return true;
CBookmarkItemData *data = (CBookmarkItemData *)m_pTree->GetItemData(item);
if (!data)
return true;
const CServer *server;
if (m_pTree->GetItemParent(item) == m_bookmarks_site)
server = m_server;
else
server = 0;
const wxString remotePathRaw = XRCCTRL(*this, "ID_BOOKMARK_REMOTEDIR", wxTextCtrl)->GetValue();
if (!remotePathRaw.empty())
{
CServerPath remotePath;
if (server)
remotePath.SetType(server->GetType());
if (!remotePath.SetPath(remotePathRaw))
{
XRCCTRL(*this, "ID_BOOKMARK_REMOTEDIR", wxTextCtrl)->SetFocus();
if (server)
{
wxString msg;
if (server->GetType() != DEFAULT)
msg = wxString::Format(_("Remote path cannot be parsed. Make sure it is a valid absolute path and is supported by the current site's servertype (%s)."), server->GetNameFromServerType(server->GetType()));
else
msg = _("Remote path cannot be parsed. Make sure it is a valid absolute path.");
wxMessageBoxEx(msg);
}
else
wxMessageBoxEx(_("Remote path cannot be parsed. Make sure it is a valid absolute path."));
return false;
}
}
const wxString localPath = XRCCTRL(*this, "ID_BOOKMARK_LOCALDIR", wxTextCtrl)->GetValue();
if (remotePathRaw.empty() && localPath.empty())
{
XRCCTRL(*this, "ID_BOOKMARK_LOCALDIR", wxTextCtrl)->SetFocus();
wxMessageBoxEx(_("You need to enter at least one path, empty bookmarks are not supported."));
return false;
}
bool sync = XRCCTRL(*this, "ID_BOOKMARK_SYNC", wxCheckBox)->GetValue();
if (sync && (localPath.empty() || remotePathRaw.empty()))
{
wxMessageBoxEx(_("You need to enter both a local and a remote path to enable synchronized browsing for this bookmark."), _("New bookmark"), wxICON_EXCLAMATION, this);
return false;
}
return true;
}
示例2: OnSearch
void CSearchDialog::OnSearch(wxCommandEvent& event)
{
if (!m_pState->IsRemoteIdle())
{
wxBell();
return;
}
CServerPath path;
const CServer* pServer = m_pState->GetServer();
if (!pServer)
{
wxMessageBox(_("Connection to server lost."), _("Remote file search"), wxICON_EXCLAMATION);
return;
}
path.SetType(pServer->GetType());
if (!path.SetPath(XRCCTRL(*this, "ID_PATH", wxTextCtrl)->GetValue()) || path.IsEmpty())
{
wxMessageBox(_("Need to enter valid remote path"), _("Remote file search"), wxICON_EXCLAMATION);
return;
}
m_search_root = path;
// Prepare filter
wxString error;
if (!ValidateFilter(error, true))
{
wxMessageBox(wxString::Format(_("Invalid search conditions: %s"), error.c_str()), _("Remote file search"), wxICON_EXCLAMATION);
return;
}
m_search_filter = GetFilter();
if (!CFilterManager::CompileRegexes(m_search_filter))
{
wxMessageBox(_("Invalid regular expression in search conditions."), _("Remote file search"), wxICON_EXCLAMATION);
return;
}
m_search_filter.matchCase = XRCCTRL(*this, "ID_CASE", wxCheckBox)->GetValue();
// Delete old results
m_results->ClearSelection();
m_results->m_indexMapping.clear();
m_results->m_fileData.clear();
m_results->SetItemCount(0);
m_visited.clear();
m_results->RefreshListOnly(true);
m_results->GetFilelistStatusBar()->Clear();
// Start
m_searching = true;
m_pState->GetRecursiveOperationHandler()->AddDirectoryToVisitRestricted(path, _T(""), true);
std::list<CFilter> filters; // Empty, recurse into everything
m_pState->GetRecursiveOperationHandler()->StartRecursiveOperation(CRecursiveOperation::recursive_list, path, filters, true);
}