本文整理汇总了C++中CVar::setValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CVar::setValue方法的具体用法?C++ CVar::setValue怎么用?C++ CVar::setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVar
的用法示例。
在下文中一共展示了CVar::setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onLogin
void LoginForm::onLogin()
{
ASSERT_UITHREAD();
safe_delete(m_pLogThread);
bool remPass = m_cbRemPass->GetValue();
gc_savelogin.setValue(remPass);
if (gc_saveusername.getBool())
{
wxString dastr = m_tbUsername->GetValue();
gc_lastusername.setValue(dastr.ToUTF8());
}
SaveCVars();
if (m_comboProvider)
gc_login_stage_last.setValue(m_comboProvider->GetStringSelection().ToUTF8());
Show(false);
MainApp* temp = dynamic_cast<MainApp*>(GetParent());
if (temp)
temp->onLoginAccepted(remPass, m_bAutoLogin);
}
示例2: Init
void MainApp::Init(int argc, wxCmdLineArgsArray &argv)
{
gcTrace("");
if (argc > 0)
{
for (int x=0; x<argc; x++)
{
wxString str = argv[x].MakeLower();
if (str == "-dgl")
m_bQuiteMode = true;
if (str.StartsWith("desura://"))
m_szDesuraCache = gcString(argv[x].ToStdString());
}
}
//char *comAppPath = nullptr;
//UTIL::OS::getAppDataPath(&comAppPath);
//UTIL::FS::recMakeFolder(comAppPath);
//safe_delete(comAppPath);
InitLogging();
cc_PrintVersion();
cc_CheckCert();
Msg("Logging Has started\n");
Msg("\n\n");
InitManagers();
InitLocalManagers();
std::string val = UTIL::OS::getConfigValue(REGRUN);
gc_autostart.setValue( val.size() > 0 );
//because logging gets init first we need to man reg it
RegLogWithWindow();
//because logging gets init before managers we need to reapply the color scheme.
LoggingapplyTheme();
loadFrame(wxDEFAULT_FRAME_STYLE);
#ifndef NIX
if (!m_bQuiteMode)
m_wxTBIcon = new TaskBarIcon(this);
#endif
m_wxTBIcon = nullptr;
std::string szAppid = UTIL::OS::getConfigValue(APPID);
uint32 appid = -1;
if (szAppid.size() > 0)
appid = Safe::atoi(szAppid.c_str());
if (appid == BUILDID_BETA || appid == BUILDID_INTERNAL)
gc_uploaddumps.setValue(true);
}
示例3: onMove
void LoginForm::onMove(wxMoveEvent &event)
{
if (m_bSavePos)
{
gc_login_x.setValue(GetPosition().x);
gc_login_y.setValue(GetPosition().y);
}
event.Skip();
}
示例4: setValue
void DesuraJSSettings::setValue(gcString name, gcString val)
{
CVar* cvar = GetCVarManager()->findCVar(name.c_str());
if (cvar && val != gcString(cvar->getString()))
cvar->setValue(val.c_str());
}
示例5: guiDelegate
MainApp::MainApp()
{
Bind(wxEVT_CLOSE_WINDOW, &MainApp::onClose, this);
m_wxLoginForm = nullptr;
m_wxTBIcon = nullptr;
m_wxMainForm = nullptr;
m_bQuiteMode = false;
m_bLoggedIn = false;
m_iMode = MODE_LOGOUT;
//need to overide the value in corecount if not set
if (gc_corecount.getInt() == 0)
{
//need to change the value so it will trigger the cvar callback
gc_corecount.setValue(1);
gc_corecount.setValue(0);
}
m_pOfflineDialog = nullptr;
m_pInternalLink = nullptr;
#ifdef WITH_GTEST
m_UnitTestForm = nullptr;
#endif
onLoginAcceptedEvent += guiDelegate(this, &MainApp::onLoginAcceptedCB);
onInternalLinkEvent += guiDelegate(this, &MainApp::onInternalLink);
onInternalLinkStrEvent += guiDelegate(this, &MainApp::onInternalStrLink);
onNotifyGiftUpdateEvent += guiDelegate(this, &MainApp::onNotifyGiftUpdate);
}
示例6: validateUsernameChange
bool validateUsernameChange(const CVar* cvar, const char* newValue)
{
if (gcString(newValue) == gcString(cvar->getString()))
return false;
gc_lastavatar.setValue("");
return true;
}
示例7: onLoginAcceptedCB
void MainApp::onLoginAcceptedCB(std::pair<bool,bool> &loginInfo)
{
bool saveLoginInfo = loginInfo.first;
bool autologin = loginInfo.second;
if (m_wxLoginForm)
{
m_wxLoginForm->Show(false);
m_wxLoginForm->Destroy();
m_wxLoginForm = nullptr;
}
if (saveLoginInfo)
GetUserCore()->saveLoginInfo();
GetUserCore()->getAppUpdateProgEvent() += guiDelegate(this, &MainApp::onAppUpdateProg);
GetUserCore()->getAppUpdateCompleteEvent() += guiDelegate(this, &MainApp::onAppUpdate);
GetWebCore()->getCookieUpdateEvent() += guiDelegate(this, &MainApp::onCookieUpdate);
GetWebCore()->getLoggedOutEvent() += delegate(&onLoggedOutEvent);
GetUserCore()->getPipeDisconnectEvent() += guiDelegate(this, &MainApp::onPipeDisconnect);
//trigger this so it sets cookies first time around
onCookieUpdate();
admin_developer.setValue(GetUserCore()->isAdmin());
GetCVarManager()->loadUser(GetUserCore()->getUserId());
gcWString userName(GetUserCore()->getUserName());
SetCrashDumpSettings(userName.c_str(), gc_uploaddumps.getBool());
m_bLoggedIn = true;
m_iMode = APP_MODE::MODE_ONLINE;
bool showMain = !(autologin && gc_silentlaunch.getBool());
showMainForm(false, showMain);
m_pInternalLink = new InternalLink(this);
if (!m_bQuiteMode)
GetUserCore()->getItemManager()->checkItems();
if (m_wxTBIcon)
m_wxTBIcon->regEvents();
if (showMain && !m_bQuiteMode)
showNews();
if (m_szDesuraCache != "")
{
m_pInternalLink->handleInternalLink(m_szDesuraCache.c_str());
m_szDesuraCache = "";
}
onLoginEvent();
}
示例8: onCheckBoxClick
void LoginForm::onCheckBoxClick( wxCommandEvent& event )
{
#ifdef WIN32
if ( event.GetId() == m_cbProxyOff->GetId() )
{
bool isProxyOff = event.IsChecked();
m_cbProxyOff->SetValue( isProxyOff );
gc_saveProxyOff.setValue( isProxyOff );
UTIL::OS::setProxyOff( isProxyOff );
}
else
#endif
if ( event.GetId() == m_cbBypassSSLRevocationCheck->GetId() )
{
bool isBypassSSLRevocationCheck = event.IsChecked();
m_cbBypassSSLRevocationCheck->SetValue( isBypassSSLRevocationCheck );
gc_saveBypassSSLRevocationCheck.setValue( isBypassSSLRevocationCheck );
UTIL::OS::setBypassSSLRevocationCheck( isBypassSSLRevocationCheck );
}
}
示例9: onLogin
void LoginForm::onLogin()
{
safe_delete(m_pLogThread);
#ifndef UI_HIDE_AUTOLOGIN
bool remPass = m_cbRemPass->GetValue();
gc_savelogin.setValue(remPass);
#else
bool remPass = false;
#endif
if (gc_saveusername.getBool())
{
wxString dastr = m_tbUsername->GetValue();
gc_lastusername.setValue((const char*)dastr.c_str());
}
Show(false);
MainApp* temp = dynamic_cast<MainApp*>(GetParent());
if (temp)
temp->onLoginAccepted(remPass, m_bAutoLogin);
}
示例10: guiDelegate
MainApp::MainApp()
{
Bind(wxEVT_CLOSE_WINDOW, &MainApp::onClose, this);
//need to override the value in core count if not set
if (gc_corecount.getInt() == 0)
{
//need to change the value so it will trigger the cvar callback
gc_corecount.setValue(1);
gc_corecount.setValue(0);
}
onLoginAcceptedEvent += guiDelegate(this, &MainApp::onLoginAcceptedCB);
onInternalLinkEvent += guiDelegate(this, &MainApp::onInternalLink);
onInternalLinkStrEvent += guiDelegate(this, &MainApp::onInternalStrLink);
onNotifyGiftUpdateEvent += guiDelegate(this, &MainApp::onNotifyGiftUpdate);
onLoggedOutEvent += guiDelegate(this, &MainApp::onLoggedOut);
}
示例11: getSteamUser
void MainApp::getSteamUser(WCSpecialInfo *info, wxWindow *parent)
{
if (gc_steamuser.getString() && strcmp(gc_steamuser.getString(), "") != 0)
{
info->result = gc_steamuser.getString();
info->handled = true;
}
else
{
SteamUserDialog dlg(parent?parent:this);
dlg.ShowModal();
const char *steamuser = dlg.getSteamUser();
if (steamuser)
{
gc_steamuser.setValue(steamuser);
info->result = steamuser;
info->handled = true;
}
}
}
示例12: strProv
DesuraControl::DesuraControl(gcFrame* parent, bool offline, const char* szProvider)
: gcPanel(parent)
{
m_iIndex = -1;
m_bDownloadingUpdate = false;
m_uiUpdateProgress = 0;
this->SetBackgroundColour( wxColor(GetGCThemeManager()->getColor("headerbottomborder", "bg")));
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
auto userCore = GetUserCore();
if (userCore)
userCore->getNewAvatarEvent() += guiDelegate(this, &DesuraControl::onNewAvatar);
parent->onActiveEvent += guiDelegate(this, &DesuraControl::onActiveToggle);
m_pMainMenuButton = new MainMenuButton(this, offline);
m_pAvatar = new gcImageButton( this, wxID_ANY, wxDefaultPosition, wxSize( 66,66 ), wxTAB_TRAVERSAL );
#ifdef WIN32
m_pAvatar->SetCursor(wxCURSOR_HAND);
#endif
const char* szUsername = Managers::GetString("#MP_OFFLINE");
const char* szAvatar = nullptr;
if (userCore)
{
szAvatar = GetUserCore()->getAvatar();
if (!offline)
szUsername = GetUserCore()->getUserName();
}
if (szAvatar && UTIL::FS::isValidFile(UTIL::FS::PathWithFile(szAvatar)))
{
gc_lastavatar.setValue(szAvatar);
m_pAvatar->setDefaultImage(szAvatar);
}
else
{
m_pAvatar->setDefaultImage("#icon_avatar");
}
m_pFiller = new DesuraMenuFiller(this);
m_pFiller->SetMinSize( wxSize( 25,38 ) );
m_pUsernameBox = new UsernameBox(this, szUsername);
m_pMenuStrip = new MenuStrip(this);
m_sizerContent = new wxFlexGridSizer( 1, 1, 0, 0 );
m_sizerContent->AddGrowableCol( 0 );
m_sizerContent->AddGrowableRow( 0 );
m_sizerContent->SetFlexibleDirection( wxBOTH );
m_sizerContent->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxFlexGridSizer* fgSizer3;
fgSizer3 = new wxFlexGridSizer( 1, 4, 0, 0 );
fgSizer3->AddGrowableCol( 2 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer3->Add( m_pUsernameBox, 1, wxEXPAND, 5 );
fgSizer3->Add( m_pMenuStrip, 1, wxEXPAND, 5 ); // main buttons across the top
fgSizer3->Add( m_pFiller, 1, wxEXPAND, 5 );
m_sizerHeader = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 1, 2, 0, 0 );
fgSizer4->SetFlexibleDirection( wxBOTH );
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
if (!offline)
{
m_bButtonStrip = new ButtonStrip( this );
fgSizer4->Add( m_bButtonStrip, 1, wxEXPAND|wxBOTTOM, 1 ); // mail buttons
}
else
{
m_bButtonStrip = nullptr;
fgSizer4->Add( 5, 0, 1, wxEXPAND, 5 );
}
fgSizer4->AddGrowableCol( 1 );
fgSizer4->Add( m_sizerHeader, 1, wxEXPAND, 5 ); // arrows, home button,
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 2, 1, 0, 0 );
//.........这里部分代码省略.........
示例13: gcPanel
DesuraControl::DesuraControl(gcFrame* parent, bool offline) : gcPanel(parent)
{
m_iIndex = -1;
m_bDownloadingUpdate = false;
m_uiUpdateProgress = 0;
this->SetBackgroundColour( wxColor(GetGCThemeManager()->getColor("headerbottomborder", "bg")));
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
*GetUserCore()->getNewAvatarEvent() += guiDelegate(this, &DesuraControl::onNewAvatar);
parent->onActiveEvent += guiDelegate(this, &DesuraControl::onActiveToggle);
m_pMainMenuButton = new MainMenuButton(this, offline);
m_pAvatar = new gcImageButton( this, wxID_ANY, wxDefaultPosition, wxSize( 66,66 ), wxTAB_TRAVERSAL );
#ifdef WIN32
m_pAvatar->SetCursor(wxCURSOR_HAND);
#endif
const char* szAvatar = GetUserCore()->getAvatar();
if (szAvatar && UTIL::FS::isValidFile(UTIL::FS::PathWithFile(szAvatar)))
{
gc_lastavatar.setValue(szAvatar);
m_pAvatar->setDefaultImage(szAvatar);
}
else
{
m_pAvatar->setDefaultImage("#icon_avatar");
}
m_pFiller = new DesuraMenuFiller(this);
m_pFiller->SetMinSize( wxSize( 25,38 ) );
m_pUsernameBox = new UsernameBox(this, offline?"Offline":GetUserCore()->getUserName());
m_pMenuStrip = new MenuStrip(this);
m_sizerContent = new wxFlexGridSizer( 1, 1, 0, 0 );
m_sizerContent->AddGrowableCol( 0 );
m_sizerContent->AddGrowableRow( 0 );
m_sizerContent->SetFlexibleDirection( wxBOTH );
m_sizerContent->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxFlexGridSizer* fgSizer3;
fgSizer3 = new wxFlexGridSizer( 1, 4, 0, 0 );
fgSizer3->AddGrowableCol( 2 );
fgSizer3->SetFlexibleDirection( wxBOTH );
fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer3->Add( m_pUsernameBox, 1, wxEXPAND, 5 );
fgSizer3->Add( m_pMenuStrip, 1, wxEXPAND, 5 ); // main buttons across the top
fgSizer3->Add( m_pFiller, 1, wxEXPAND, 5 );
m_sizerHeader = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizer4;
fgSizer4 = new wxFlexGridSizer( 1, 2, 0, 0 );
fgSizer4->SetFlexibleDirection( wxBOTH );
fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
if (!offline)
{
m_bButtonStrip = new ButtonStrip( this );
fgSizer4->Add( m_bButtonStrip, 1, wxEXPAND|wxBOTTOM, 1 ); // mail buttons
}
else
{
m_bButtonStrip = NULL;
fgSizer4->Add( 5, 0, 1, wxEXPAND, 5 );
}
fgSizer4->AddGrowableCol( 1 );
fgSizer4->Add( m_sizerHeader, 1, wxEXPAND, 5 ); // arrows, home button,
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 2, 1, 0, 0 );
fgSizer2->AddGrowableCol( 0 );
fgSizer2->SetFlexibleDirection( wxBOTH );
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer2->Add( fgSizer3, 1, wxEXPAND, 5 );
fgSizer2->Add( fgSizer4, 1, wxEXPAND, 5 );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 1, 4, 0, 0 );
fgSizer1->AddGrowableCol( 2 );
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer1->Add( m_pMainMenuButton, 1, 0, 5 );
//.........这里部分代码省略.........
示例14: onNewAvatar
void DesuraControl::onNewAvatar(gcString& image)
{
m_pAvatar->setDefaultImage(image.c_str());
gc_lastavatar.setValue(image.c_str());
}
示例15: OnRunOnStartupClicked
void gcUnitTestForm::OnRunOnStartupClicked(wxCommandEvent& event)
{
g_bRunOnStartup.setValue(m_cbRunOnStartup->IsChecked());
}