本文整理汇总了C++中CGUIWindow::ResetControlStates方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIWindow::ResetControlStates方法的具体用法?C++ CGUIWindow::ResetControlStates怎么用?C++ CGUIWindow::ResetControlStates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIWindow
的用法示例。
在下文中一共展示了CGUIWindow::ResetControlStates方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeInitialize
void CGUIWindowManager::DeInitialize()
{
CSingleLock lock(g_graphicsContext);
for (WindowMap::iterator it = m_mapWindows.begin(); it != m_mapWindows.end(); it++)
{
CGUIWindow* pWindow = (*it).second;
if (IsWindowActive(it->first))
{
pWindow->DisableAnimations();
pWindow->Close(true);
}
pWindow->ResetControlStates();
pWindow->FreeResources(true);
}
UnloadNotOnDemandWindows();
m_vecMsgTargets.erase( m_vecMsgTargets.begin(), m_vecMsgTargets.end() );
// destroy our custom windows...
for (int i = 0; i < (int)m_vecCustomWindows.size(); i++)
{
CGUIWindow *pWindow = m_vecCustomWindows[i];
Remove(pWindow->GetID());
delete pWindow;
}
// clear our vectors of windows
m_vecCustomWindows.clear();
m_activeDialogs.clear();
m_initialized = false;
}
示例2: LoadProfile
void CGUIWindowLoginScreen::LoadProfile(unsigned int profile)
{
// stop service addons and give it some time before we start it again
ADDON::CAddonMgr::Get().StopServices(true);
// stop PVR related services
g_application.StopPVRManager();
if (profile != 0 || !g_settings.IsMasterUser())
{
g_application.getNetworkManager().NetworkMessage(CNetworkManager::SERVICES_DOWN,1);
g_settings.LoadProfile(profile);
}
else
{
CGUIWindow* pWindow = g_windowManager.GetWindow(WINDOW_HOME);
if (pWindow)
pWindow->ResetControlStates();
}
g_application.getNetworkManager().StartServices();
g_settings.UpdateCurrentProfileDate();
g_settings.SaveProfiles(PROFILES_FILE);
if (g_settings.GetLastUsedProfileIndex() != profile)
{
g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO);
g_playlistPlayer.ClearPlaylist(PLAYLIST_MUSIC);
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_NONE);
}
// reload the add-ons, or we will first load all add-ons from the master account without checking disabled status
ADDON::CAddonMgr::Get().ReInit();
g_weatherManager.Refresh();
#ifdef HAS_PYTHON
g_pythonParser.m_bLogin = true;
#endif
#ifdef HAS_JSONRPC
JSONRPC::CJSONRPC::Initialize();
#endif
// start services which should run on login
ADDON::CAddonMgr::Get().StartServices(false);
// start PVR related services
g_application.StartPVRManager();
g_windowManager.ChangeActiveWindow(g_SkinInfo->GetFirstWindow());
g_application.UpdateLibraries();
}
示例3: OnMessage
bool CGUIWindowLoginScreen::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
m_viewControl.Reset();
}
break;
case GUI_MSG_CLICKED:
{
int iControl = message.GetSenderId();
if (iControl == CONTROL_BIG_LIST)
{
int iAction = message.GetParam1();
// iItem is checked for validity inside these routines
if (iAction == ACTION_CONTEXT_MENU || iAction == ACTION_MOUSE_RIGHT_CLICK)
{
int iItem = m_viewControl.GetSelectedItem();
bool bResult = OnPopupMenu(m_viewControl.GetSelectedItem());
if (bResult)
{
Update();
CGUIMessage msg(GUI_MSG_ITEM_SELECT,GetID(),CONTROL_BIG_LIST,iItem);
OnMessage(msg);
}
return bResult;
}
else if (iAction == ACTION_PREVIOUS_MENU) // oh no u don't
return false;
else if (iAction == ACTION_SELECT_ITEM || iAction == ACTION_MOUSE_LEFT_CLICK)
{
int iItem = m_viewControl.GetSelectedItem();
bool bOkay = !g_guiSettings.GetBool("masterlock.loginlock");
bool bCanceled;
if (!bOkay)
bOkay = g_passwordManager.IsProfileLockUnlocked(m_viewControl.GetSelectedItem(), bCanceled);
if (bOkay)
{
if (CFile::Exists("q:\\scripts\\autoexec.py") && watch.GetElapsedMilliseconds() < 5000.f)
while (watch.GetElapsedMilliseconds() < 5000) ;
if (iItem != 0 || g_settings.m_iLastLoadedProfileIndex != 0)
{
g_application.getNetwork().NetworkMessage(CNetwork::SERVICES_DOWN,1);
#ifdef HAS_XBOX_NETWORK
g_application.getNetwork().Deinitialize();
#endif
#ifdef HAS_XBOX_HARDWARE
CLog::Log(LOGNOTICE, "stop fancontroller");
CFanController::Instance()->Stop();
#endif
g_settings.LoadProfile(m_viewControl.GetSelectedItem());
#ifdef HAS_XBOX_NETWORK
g_application.getNetwork().Initialize(g_guiSettings.GetInt("network.assignment"),
g_guiSettings.GetString("network.ipaddress").c_str(),
g_guiSettings.GetString("network.subnet").c_str(),
g_guiSettings.GetString("network.gateway").c_str(),
g_guiSettings.GetString("network.dns").c_str());
#endif
}
else
{
CGUIWindow* pWindow = m_gWindowManager.GetWindow(WINDOW_HOME);
if (pWindow)
pWindow->ResetControlStates();
}
g_settings.m_vecProfiles[g_settings.m_iLastLoadedProfileIndex].setDate();
g_settings.SaveProfiles(PROFILES_FILE);
g_weatherManager.Refresh();
#ifdef HAS_PYTHON
g_pythonParser.bLogin = true;
#endif
RESOLUTION res=INVALID;
CStdString startupPath = g_SkinInfo.GetSkinPath("startup.xml", &res);
int startWindow = g_guiSettings.GetInt("lookandfeel.startupwindow");
// test for a startup window, and activate that instead of home
if (CFile::Exists(startupPath) && (!g_SkinInfo.OnlyAnimateToHome() || startWindow == WINDOW_HOME))
{
m_gWindowManager.ChangeActiveWindow(WINDOW_STARTUP);
}
else
{
m_gWindowManager.ChangeActiveWindow(WINDOW_HOME);
m_gWindowManager.ActivateWindow(g_guiSettings.GetInt("lookandfeel.startupwindow"));
}
#ifdef HAS_KAI
if (iItem == 0)
g_application.StartKai();
#endif
return true;
}
else
{
//.........这里部分代码省略.........
示例4: LoadProfile
void CGUIWindowLoginScreen::LoadProfile(unsigned int profile)
{
// stop service addons and give it some time before we start it again
ADDON::CAddonMgr::GetInstance().StopServices(true);
// stop PVR related services
g_application.StopPVRManager();
// stop audio DSP services with a blocking message
CServiceBroker::GetADSP().Deactivate();
if (profile != 0 || !CProfilesManager::GetInstance().IsMasterProfile())
{
g_application.getNetwork().NetworkMessage(CNetwork::SERVICES_DOWN,1);
CProfilesManager::GetInstance().LoadProfile(profile);
}
else
{
CGUIWindow* pWindow = g_windowManager.GetWindow(WINDOW_HOME);
if (pWindow)
pWindow->ResetControlStates();
}
g_application.getNetwork().NetworkMessage(CNetwork::SERVICES_UP,1);
CProfilesManager::GetInstance().UpdateCurrentProfileDate();
CProfilesManager::GetInstance().Save();
if (CProfilesManager::GetInstance().GetLastUsedProfileIndex() != profile)
{
g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO);
g_playlistPlayer.ClearPlaylist(PLAYLIST_MUSIC);
g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_NONE);
}
// reload the add-ons, or we will first load all add-ons from the master account without checking disabled status
ADDON::CAddonMgr::GetInstance().ReInit();
// let CApplication know that we are logging into a new profile
g_application.SetLoggingIn(true);
if (!g_application.LoadLanguage(true))
{
CLog::Log(LOGFATAL, "CGUIWindowLoginScreen: unable to load language for profile \"%s\"", CProfilesManager::GetInstance().GetCurrentProfile().getName().c_str());
return;
}
g_weatherManager.Refresh();
#ifdef HAS_JSONRPC
JSONRPC::CJSONRPC::Initialize();
#endif
// restart PVR services
g_application.ReinitPVRManager();
// start services which should run on login
ADDON::CAddonMgr::GetInstance().StartServices(false);
int firstWindow = g_SkinInfo->GetFirstWindow();
// the startup window is considered part of the initialization as it most likely switches to the final window
bool uiInitializationFinished = firstWindow != WINDOW_STARTUP_ANIM;
g_windowManager.ChangeActiveWindow(firstWindow);
g_application.UpdateLibraries();
CStereoscopicsManager::GetInstance().Initialize();
// if the user interfaces has been fully initialized let everyone know
if (uiInitializationFinished)
{
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_UI_READY);
g_windowManager.SendThreadMessage(msg);
}
}
示例5: LoadProfile
bool CProfilesManager::LoadProfile(unsigned int index)
{
PrepareLoadProfile(index);
if (index == 0 && IsMasterProfile())
{
CGUIWindow* pWindow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow(WINDOW_HOME);
if (pWindow)
pWindow->ResetControlStates();
UpdateCurrentProfileDate();
Save();
FinalizeLoadProfile();
return true;
}
CSingleLock lock(m_critical);
// check if the index is valid or not
if (index >= m_profiles.size())
return false;
// check if the profile is already active
if (m_currentProfile == index)
return true;
// save any settings of the currently used skin but only if the (master)
// profile hasn't just been loaded as a temporary profile for login
if (g_SkinInfo != nullptr && !m_profileLoadedForLogin)
g_SkinInfo->SaveSettings();
// unload any old settings
CServiceBroker::GetSettings()->Unload();
SetCurrentProfileId(index);
m_profileLoadedForLogin = false;
// load the new settings
if (!CServiceBroker::GetSettings()->Load())
{
CLog::Log(LOGFATAL, "CProfilesManager: unable to load settings for profile \"%s\"", m_profiles.at(index).getName().c_str());
return false;
}
CServiceBroker::GetSettings()->SetLoaded();
CreateProfileFolders();
CServiceBroker::GetDatabaseManager().Initialize();
CServiceBroker::GetInputManager().LoadKeymaps();
CServiceBroker::GetInputManager().SetMouseEnabled(CServiceBroker::GetSettings()->GetBool(CSettings::SETTING_INPUT_ENABLEMOUSE));
CGUIComponent* gui = CServiceBroker::GetGUI();
if (gui)
{
CGUIInfoManager& infoMgr = gui->GetInfoManager();
infoMgr.ResetCache();
infoMgr.GetInfoProviders().GetGUIControlsInfoProvider().ResetContainerMovingCache();
infoMgr.GetInfoProviders().GetLibraryInfoProvider().ResetLibraryBools();
}
if (m_currentProfile != 0)
{
CXBMCTinyXML doc;
if (doc.LoadFile(URIUtils::AddFileToFolder(GetUserDataFolder(), "guisettings.xml")))
{
CServiceBroker::GetSettings()->LoadSetting(doc.RootElement(), CSettings::SETTING_MASTERLOCK_MAXRETRIES);
CServiceBroker::GetSettings()->LoadSetting(doc.RootElement(), CSettings::SETTING_MASTERLOCK_STARTUPLOCK);
}
}
CPasswordManager::GetInstance().Clear();
// to set labels - shares are reloaded
#if !defined(TARGET_WINDOWS) && defined(HAS_DVD_DRIVE)
MEDIA_DETECT::CDetectDVDMedia::UpdateState();
#endif
// init windows
CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_WINDOW_RESET);
CServiceBroker::GetGUI()->GetWindowManager().SendMessage(msg);
CUtil::DeleteDirectoryCache();
g_directoryCache.Clear();
lock.Leave();
UpdateCurrentProfileDate();
Save();
FinalizeLoadProfile();
return true;
}