本文整理汇总了C++中CState::IsRemoteConnected方法的典型用法代码示例。如果您正苦于以下问题:C++ CState::IsRemoteConnected方法的具体用法?C++ CState::IsRemoteConnected怎么用?C++ CState::IsRemoteConnected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CState
的用法示例。
在下文中一共展示了CState::IsRemoteConnected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTimer
void CClearPrivateDataDialog::OnTimer(wxTimerEvent& event)
{
const std::vector<CState*> *states = CContextManager::Get()->GetAllStates();
for (std::vector<CState*>::const_iterator iter = states->begin(); iter != states->end(); ++iter)
{
CState* pState = *iter;
if (pState->IsRemoteConnected() || !pState->IsRemoteIdle())
{
if (!pState->m_pCommandQueue->Cancel())
return;
pState->Disconnect();
}
if (pState->IsRemoteConnected() || !pState->IsRemoteIdle())
return;
}
m_timer.Stop();
ClearReconnect();
Delete();
}
示例2: Show
void CClearPrivateDataDialog::Show()
{
if (!Load(m_pMainFrame, _T("ID_CLEARPRIVATEDATA")))
return;
if (ShowModal() != wxID_OK)
return;
wxCheckBox *pSitemanagerCheck = XRCCTRL(*this, "ID_CLEARSITEMANAGER", wxCheckBox);
wxCheckBox *pQueueCheck = XRCCTRL(*this, "ID_CLEARQUEUE", wxCheckBox);
if (pSitemanagerCheck->GetValue() && pQueueCheck->GetValue())
{
int res = wxMessageBox(_("Do you really want to delete all Site Manager entries and the transfer queue?"), _("Clear private data"), wxYES | wxNO | wxICON_QUESTION);
if (res != wxYES)
return;
}
else if (pQueueCheck->GetValue())
{
int res = wxMessageBox(_("Do you really want to delete the transfer queue?"), _("Clear private data"), wxYES | wxNO | wxICON_QUESTION);
if (res != wxYES)
return;
}
else if (pSitemanagerCheck->GetValue())
{
int res = wxMessageBox(_("Do you really want to delete all Site Manager entries?"), _("Clear private data"), wxYES | wxNO | wxICON_QUESTION);
if (res != wxYES)
return;
}
wxCheckBox *pCheck = XRCCTRL(*this, "ID_CLEARQUICKCONNECT", wxCheckBox);
if (!pCheck)
return;
if (pCheck->GetValue())
{
CRecentServerList::Clear();
if (m_pMainFrame->GetQuickconnectBar())
m_pMainFrame->GetQuickconnectBar()->ClearFields();
}
pCheck = XRCCTRL(*this, "ID_CLEARRECONNECT", wxCheckBox);
if (pCheck->GetValue())
{
bool asked = false;
const std::vector<CState*> *states = CContextManager::Get()->GetAllStates();
for (std::vector<CState*>::const_iterator iter = states->begin(); iter != states->end(); ++iter)
{
CState* pState = *iter;
if (pState->IsRemoteConnected() || !pState->IsRemoteIdle())
{
if (!asked)
{
int res = wxMessageBox(_("Reconnect information cannot be cleared while connected to a server.\nIf you continue, your connection will be disconnected."), _("Clear private data"), wxOK | wxCANCEL);
if (res != wxOK)
return;
asked = true;
}
pState->GetRecursiveOperationHandler()->StopRecursiveOperation();
if (!pState->m_pCommandQueue->Cancel())
{
m_timer.SetOwner(this);
m_timer.Start(250, true);
}
else
pState->Disconnect();
}
}
// Doesn't harm to do it now, but has to be repeated later just to be safe
ClearReconnect();
}
if (pSitemanagerCheck->GetValue())
{
CInterProcessMutex sitemanagerMutex(MUTEX_SITEMANAGERGLOBAL, false);
while (sitemanagerMutex.TryLock() == 0)
{
int res = wxMessageBox(_("The Site Manager is opened in another instance of FileZilla 3.\nPlease close it or the data cannot be deleted."), _("Clear private data"), wxOK | wxCANCEL);
if (res != wxYES)
return;
}
CInterProcessMutex mutex(MUTEX_SITEMANAGER);
RemoveXmlFile(_T("sitemanager"));
}
if (pQueueCheck->GetValue())
{
m_pMainFrame->GetQueue()->SetActive(false);
m_pMainFrame->GetQueue()->RemoveAll();
CInterProcessMutex mutex(MUTEX_QUEUE);
RemoveXmlFile(_T("queue"));
}
}