void CProgStatusBar::ShowNetCount()
{
	CPostMsg postmsg;
	if (!theApp.m_msgConnCountQueue.pop(postmsg))
	{
		return ;
	}
	string strTemp = postmsg.GetStrType();
	int pos = strTemp.find("connections") ;
	if (pos >=0)
	{
		pos = strTemp.find("=") ;
		if (pos >=0)
		{
			strTemp = strTemp.substr(pos+1,strTemp.length());
			strTemp =  UiFun::trimleft(strTemp);
			strTemp =  UiFun::trimright(strTemp);
			int netCount = atoi(strTemp.c_str());
			m_nSigIndex = netCount>3?3:netCount;
			InvalidateRect(m_rectSignal);

			m_nConnectCount = netCount;
			if (netCount == 0 )
			{
				string strTemp ="";
				strTemp =strprintf("%s%s%s","获取",m_strNetName, "网络连接");
				m_strNeting.SetWindowText(strTemp.c_str()) ;
				Invalidate(); 
			}
		}	
	}
}
Beispiel #2
0
void CProgStatusBar::ShowNetCount()
{
	CPostMsg postmsg;
	if (!theApp.m_NetConnetCountQueue.pop(postmsg))
	{
		return ;
	}
	string strTemp = postmsg.GetStrType();
	int pos = strTemp.find("connections") ;
	if (pos >=0)
	{
		pos = strTemp.find("=") ;
		if (pos >=0)
		{
			strTemp = strTemp.substr(pos+1,strTemp.length());
			strTemp =  UiFun::trimleft(strTemp);
			strTemp =  UiFun::trimright(strTemp);
			int netCount = atoi(strTemp.c_str());
			m_nSigIndex = netCount>3?3:netCount;
			InvalidateRect(m_bmpsig);

			m_connectCount = netCount;
			if (netCount == 0 )
			{
				string strTemp ="";
				strTemp =strprintf("%s%s%s",UiFun::UI_LoadString("PROGSTATUS_MODULE"  , "PROGSTATUS_GET",theApp.gsLanguage ) ,netStr ,UiFun::UI_LoadString("PROGSTATUS_MODULE"  , "PROGSTATUS_NETWORK_CONN",theApp.gsLanguage ));
				m_strNeting.SetWindowText(strTemp.c_str()) ;
				Invalidate(); 
			}
		}	
	}
}
void CProgStatusBar::ShowLockCtrl()
{
	CPostMsg postmsg;
	if (!theApp.m_msgLockStatusQueue.pop(postmsg))
	{
		return ;
	}
	string strTemp = postmsg.GetStrType();
	if (!strcmp(strTemp.c_str(),"Lock"))
	{
		theApp.m_bIsHaveLocked = TRUE;
		m_nLockIndex = 0;
	}else if(!strcmp(strTemp.c_str(),"UnLock")){
		theApp.m_bIsHaveLocked = TRUE;
		m_nLockIndex = 1;
	}
	InvalidateRect(m_rectLock);
}