int StorageObject::Load(char *fName) { IoDataStream s(fName, "r"); return(Load(s)); }
xmlNodePtr HisBase::GetNodePtr() { Load(); return node; }
IDynamicObject& MemoryCache::Access(const std::string& id) { return *Load(id).content_; }
bool CSG_MetaData::Create(CSG_File &Stream) { return( Load(Stream) ); }
Weapon::Weapon(std::string _id, JsonBox::Value& _v, EntityManager* _manager) : Item(_id, _v, _manager) { Load(_v, _manager); }
//Metoda ³aduj¹ca dane bool CMonsterTemplate::Load(const std::string &name) { CXml xml(name, "root" ); return Load(xml); }
Texture::Texture(const String& name, const String& filename) : m_Name(name), m_FileName(filename) { m_TID = Load(); }
uint32 GameBase::EngineMessageFn(uint32 messageID, void *pData, float fData) { switch(messageID) { case MID_ACTIVATING: { g_pCommonLT->SetObjectFlags(m_hObject, OFT_User, USRFLG_GAMEBASE_ACTIVE, USRFLG_GAMEBASE_ACTIVE); } break; case MID_DEACTIVATING: { g_pCommonLT->SetObjectFlags(m_hObject, OFT_User, 0, USRFLG_GAMEBASE_ACTIVE); } break; case MID_PRECREATE: { uint32 dwRet = BaseClass::EngineMessageFn(messageID, pData, fData); int nInfo = (int)fData; if (nInfo == PRECREATE_WORLDFILE || nInfo == PRECREATE_STRINGPROP || nInfo == PRECREATE_NORMAL) { ObjectCreateStruct* pocs = (ObjectCreateStruct*)pData; if( !ReadProp( pocs )) return 0; } return dwRet; } break; case MID_OBJECTCREATED: { if( fData != OBJECTCREATED_SAVEGAME ) { ObjectCreated( reinterpret_cast<const GenericPropList*>(pData) ); } } break; case MID_MODELSTRINGKEY: { HandleModelString( (ArgList*)pData ); } break; case MID_SAVEOBJECT: { Save((ILTMessage_Write*)pData); } break; case MID_LOADOBJECT: { Load((ILTMessage_Read*)pData); } break; default: break; } return BaseClass::EngineMessageFn(messageID, pData, fData); }
// Dialog box handling functions void vncProperties::Show(BOOL show, BOOL usersettings) { if (show) { if (!m_allowproperties) { // If the user isn't allowed to override the settings then tell them MessageBox(NULL, NO_OVERRIDE_ERR, "WinVNC Error", MB_OK | MB_ICONEXCLAMATION); return; } // Verify that we know who is logged on if (usersettings) { char username[UNLEN+1]; if (!vncService::CurrentUser(username, sizeof(username))) return; if (strcmp(username, "") == 0) { MessageBox(NULL, NO_CURRENT_USER_ERR, "WinVNC Error", MB_OK | MB_ICONEXCLAMATION); return; } } else { // We're trying to edit the default local settings - verify that we can HKEY hkLocal, hkDefault; BOOL canEditDefaultPrefs = 1; DWORD dw; if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, WINVNC_REGISTRY_KEY, 0, REG_NONE, REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS) canEditDefaultPrefs = 0; else if (RegCreateKeyEx(hkLocal, "Default", 0, REG_NONE, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &hkDefault, &dw) != ERROR_SUCCESS) canEditDefaultPrefs = 0; if (hkLocal) RegCloseKey(hkLocal); if (hkDefault) RegCloseKey(hkDefault); if (!canEditDefaultPrefs) { MessageBox(NULL, CANNOT_EDIT_DEFAULT_PREFS, "WinVNC Error", MB_OK | MB_ICONEXCLAMATION); return; } } // Now, if the dialog is not already displayed, show it! if (!m_dlgvisible) { if (usersettings) vnclog.Print(LL_INTINFO, VNCLOG("show per-user Properties\n")); else vnclog.Print(LL_INTINFO, VNCLOG("show default system Properties\n")); // Load in the settings relevant to the user or system Load(usersettings); for (;;) { m_returncode_valid = FALSE; // Do the dialog box int result = DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_PROPERTIES), NULL, (DLGPROC) DialogProc, (LONG) this); if (!m_returncode_valid) result = IDCANCEL; vnclog.Print(LL_INTINFO, VNCLOG("dialog result = %d\n"), result); if (result == -1) { // Dialog box failed, so quit PostQuitMessage(0); return; } // We're allowed to exit if the password is not empty char passwd[MAXPWLEN]; m_server->GetPassword(passwd); { vncPasswd::ToText plain(passwd); if ((strlen(plain) != 0) || !m_server->AuthRequired()) break; } vnclog.Print(LL_INTERR, VNCLOG("warning - empty password\n")); // The password is empty, so if OK was used then redisplay the box, // otherwise, if CANCEL was used, close down WinVNC if (result == IDCANCEL) { vnclog.Print(LL_INTERR, VNCLOG("no password - QUITTING\n")); PostQuitMessage(0); return; } // If we reached here then OK was used & there is no password! int result2 = MessageBox(NULL, NO_PASSWORD_WARN, "WinVNC Warning", MB_OK | MB_ICONEXCLAMATION); omni_thread::sleep(4); } // Load in all the settings Load(TRUE); } } }
GeneralView::GeneralView(SettingsHost* host) : SettingsPane("general", host) { BFont statusFont; // Set a smaller font for the status label statusFont.SetSize(be_plain_font->Size() * 0.8); // Status button and label fServerButton = new BButton("server", kStartServer, new BMessage(kServer)); fStatusLabel = new BStringView("status", kStopped); fStatusLabel->SetFont(&statusFont); // Update status label and server button if (_IsServerRunning()) { fServerButton->SetLabel(kStopServer); fStatusLabel->SetText(kStarted); } else { fServerButton->SetLabel(kStartServer); fStatusLabel->SetText(kStopped); } // Autostart fAutoStart = new BCheckBox("autostart", B_TRANSLATE("Enable notifications at startup"), new BMessage(kSettingChanged)); // Display time fTimeout = new BTextControl(B_TRANSLATE("Hide notifications from screen" " after"), NULL, new BMessage(kSettingChanged)); BStringView* displayTimeLabel = new BStringView("dt_label", B_TRANSLATE("seconds of inactivity")); // Default position // TODO: Here will come a screen representation with the four corners clickable // Load settings Load(); // Calculate inset float inset = ceilf(be_plain_font->Size() * 0.7f); SetLayout(new BGroupLayout(B_VERTICAL)); AddChild(BGroupLayoutBuilder(B_VERTICAL, inset) .AddGroup(B_HORIZONTAL, inset) .Add(fServerButton) .Add(fStatusLabel) .AddGlue() .End() .AddGroup(B_VERTICAL, inset) .Add(fAutoStart) .AddGroup(B_HORIZONTAL) .AddGroup(B_HORIZONTAL, 2) .Add(fTimeout) .Add(displayTimeLabel) .End() .End() .End() .AddGlue() ); }
//============================================================================== // Brief : エフェクト取得処理 // Return : CEffect* : エフェクトクラス // Arg : const TCHAR* pNameFile : ファイル名 //============================================================================== CEffect* CManagerEffect::Get( const TCHAR* pNameFile ) { // 読み込み return m_pBufferItem[ Load( pNameFile ) ]->GetEffect(); }
// Constructor Scanner::Scanner(string fileName) { Initialize(); Load(fileName); }
void CImportDialog::Show() { wxFileDialog dlg(m_parent, _("Select file to import settings from"), _T(""), _T("FileZilla.xml"), _T("XML files (*.xml)|*.xml"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); dlg.CenterOnParent(); if (dlg.ShowModal() != wxID_OK) return; wxFileName fn(dlg.GetPath()); const wxString& path = fn.GetPath(); const wxString& settings = wxGetApp().GetSettingsDir(); if (path == settings) { wxMessageBox(_("You cannot import settings from FileZilla's own settings directory."), _("Error importing"), wxICON_ERROR, m_parent); return; } TiXmlDocument* xmlDocument = new TiXmlDocument(); xmlDocument->SetCondenseWhiteSpace(false); if (!LoadXmlDocument(xmlDocument, dlg.GetPath())) { delete xmlDocument; wxMessageBox(_("Cannot load file, not a valid XML file."), _("Error importing"), wxICON_ERROR, m_parent); return; } TiXmlElement* fz3Root = xmlDocument->FirstChildElement("FileZilla3"); TiXmlElement* fz2Root = xmlDocument->FirstChildElement("FileZilla"); if (fz3Root) { bool settings = fz3Root->FirstChildElement("Settings") != 0; bool queue = fz3Root->FirstChildElement("Queue") != 0; bool sites = fz3Root->FirstChildElement("Servers") != 0; if (settings || queue || sites) { Load(m_parent, _T("ID_IMPORT")); if (!queue) XRCCTRL(*this, "ID_QUEUE", wxCheckBox)->Hide(); if (!sites) XRCCTRL(*this, "ID_SITEMANAGER", wxCheckBox)->Hide(); if (!settings) XRCCTRL(*this, "ID_SETTINGS", wxCheckBox)->Hide(); Fit(); if (ShowModal() != wxID_OK) { delete xmlDocument; return; } if (queue && XRCCTRL(*this, "ID_QUEUE", wxCheckBox)->IsChecked()) { m_pQueueView->ImportQueue(fz3Root->FirstChildElement("Queue"), true); } if (sites && XRCCTRL(*this, "ID_SITEMANAGER", wxCheckBox)->IsChecked()) { ImportSites(fz3Root->FirstChildElement("Servers")); } if (settings && XRCCTRL(*this, "ID_SETTINGS", wxCheckBox)->IsChecked()) { COptions::Get()->Import(fz3Root->FirstChildElement("Settings")); wxMessageBox(_("The settings have been imported. You have to restart FileZilla for all settings to have effect."), _("Import successful"), wxOK, this); } wxMessageBox(_("The selected categories have been imported."), _("Import successful"), wxOK, this); delete xmlDocument; return; } } else if (fz2Root) { bool sites_fz2 = fz2Root->FirstChildElement("Sites") != 0; if (sites_fz2) { int res = wxMessageBox(_("The file you have selected contains site manager data from a previous version of FileZilla.\nDue to differences in the storage format, only host, port, username and password will be imported.\nContinue with the import?"), _("Import data from older version"), wxICON_QUESTION | wxYES_NO); if (res == wxYES) ImportLegacySites(fz2Root->FirstChildElement("Sites")); delete xmlDocument; return; } } delete xmlDocument; wxMessageBox(_("File does not contain any importable data."), _("Error importing"), wxICON_ERROR, m_parent); }
//****************************************************************************** // Public Interface //****************************************************************************** void PLAYER::Update(float DeltaTime) { if(Data == null) { Load(DataName); } }
void ae3d::Texture2D::LoadFromAtlas( const FileSystem::FileContentsData& atlasTextureData, const FileSystem::FileContentsData& atlasMetaData, const char* textureName, TextureWrap aWrap, TextureFilter aFilter, float aAnisotropy ) { Load( atlasTextureData, aWrap, aFilter, mipmaps, aAnisotropy ); const std::string metaStr = std::string( std::begin( atlasMetaData.data ), std::end( atlasMetaData.data ) ); std::stringstream metaStream( metaStr ); if (atlasMetaData.path.find( ".xml" ) == std::string::npos && atlasMetaData.path.find( ".XML" ) == std::string::npos) { System::Print("Atlas meta data path %s could not be opened!", atlasMetaData.path.c_str()); return; } std::string line; while (std::getline( metaStream, line )) { if (line.find( "<Image Name" ) == std::string::npos) { continue; } std::vector< std::string > tokens; Tokenize( line, tokens, "\"" ); bool found = false; for (std::size_t t = 0; t < tokens.size(); ++t) { if (tokens[ t ].find( "Name" ) != std::string::npos) { if (tokens[ t + 1 ] == textureName) { found = true; } } if (!found) { continue; } if (tokens[ t ].find( "XPos" ) != std::string::npos) { scaleOffset.z = std::stoi( tokens[ t + 1 ] ) / static_cast<float>(width); } else if (tokens[ t ].find( "YPos" ) != std::string::npos) { scaleOffset.w = std::stoi( tokens[ t + 1 ] ) / static_cast<float>(height); } else if (tokens[ t ].find( "Width" ) != std::string::npos) { const int w = std::stoi( tokens[ t + 1 ] ); scaleOffset.x = 1.0f / (static_cast<float>(width) / static_cast<float>(w)); width = w; } else if (tokens[ t ].find( "Height" ) != std::string::npos) { const int h = std::stoi( tokens[ t + 1 ] ); scaleOffset.y = 1.0f / (static_cast<float>(height) / static_cast<float>(h)); height = h; } } if (found) { return; } } }
//--------------------------------------------------------------------------- void Preferences::OnRejected() { Load(); }
void HiresTexture::Prefetch() { Common::SetCurrentThreadName("Prefetcher"); size_t size_sum = 0; size_t sys_mem = MemPhysical(); size_t recommended_min_mem = 2 * size_t(1024 * 1024 * 1024); // keep 2GB memory for system stability if system RAM is 4GB+ - use half of memory in other cases size_t max_mem = (sys_mem / 2 < recommended_min_mem) ? (sys_mem / 2) : (sys_mem - recommended_min_mem); u32 starttime = Common::Timer::GetTimeMs(); for (const auto& entry : s_textureMap) { const std::string& base_filename = entry.first; if (base_filename.find("_mip") == std::string::npos) { { // try to get this mutex first, so the video thread is allow to get the real mutex faster std::unique_lock<std::mutex> lk(s_textureCacheAquireMutex); } std::unique_lock<std::mutex> lk(s_textureCacheMutex); auto iter = s_textureCache.find(base_filename); if (iter == s_textureCache.end()) { // unlock while loading a texture. This may result in a race condition where we'll load a // texture twice, // but it reduces the stuttering a lot. Notice: The loading library _must_ be thread safe // now. // But bad luck, SOIL isn't, so TODO: remove SOIL usage here and use libpng directly // Also TODO: remove s_textureCacheAquireMutex afterwards. It won't be needed as the main // mutex will be locked rarely // lk.unlock(); std::unique_ptr<HiresTexture> texture = Load(base_filename, 0, 0); // lk.lock(); if (texture) { std::shared_ptr<HiresTexture> ptr(std::move(texture)); iter = s_textureCache.insert(iter, std::make_pair(base_filename, ptr)); } } if (iter != s_textureCache.end()) { for (const Level& l : iter->second->m_levels) { size_sum += l.data_size; } } } if (s_textureCacheAbortLoading.IsSet()) { return; } if (size_sum > max_mem) { g_Config.bCacheHiresTextures = false; OSD::AddMessage( StringFromFormat( "Custom Textures prefetching after %.1f MB aborted, not enough RAM available", size_sum / (1024.0 * 1024.0)), 10000); return; } } u32 stoptime = Common::Timer::GetTimeMs(); OSD::AddMessage(StringFromFormat("Custom Textures loaded, %.1f MB in %.1f s", size_sum / (1024.0 * 1024.0), (stoptime - starttime) / 1000.0), 10000); }
void VNCOptions::SetFromCommandLine(LPTSTR szCmdLine) { // We assume no quoting here. // Copy the command line - we don't know what might happen to the original int cmdlinelen = _tcslen(szCmdLine); if (cmdlinelen == 0) return; TCHAR *cmd = new TCHAR[cmdlinelen + 1]; _tcscpy(cmd, szCmdLine); // Count the number of spaces // This may be more than the number of arguments, but that doesn't matter. int nspaces = 0; TCHAR *p = cmd; TCHAR *pos = cmd; while ( ( pos = _tcschr(p, ' ') ) != NULL ) { nspaces ++; p = pos + 1; } // Create the array to hold pointers to each bit of string TCHAR **args = new LPTSTR[nspaces + 1]; // replace spaces with nulls and // create an array of TCHAR*'s which points to start of each bit. pos = cmd; int i = 0; args[i] = cmd; bool inquote=false; for (pos = cmd; *pos != 0; pos++) { // Arguments are normally separated by spaces, unless there's quoting if ((*pos == ' ') && !inquote) { *pos = '\0'; p = pos + 1; args[++i] = p; } if (*pos == '"') { if (!inquote) { // Are we starting a quoted argument? args[i] = ++pos; // It starts just after the quote } else { *pos = '\0'; // Finish a quoted argument? } inquote = !inquote; } } i++; bool hostGiven = false, portGiven = false; // take in order. for (int j = 0; j < i; j++) { if ( SwitchMatch(args[j], _T("help")) || SwitchMatch(args[j], _T("?")) || SwitchMatch(args[j], _T("h"))) { ShowUsage(); PostQuitMessage(1); } else if ( SwitchMatch(args[j], _T("listen"))) { m_listening = true; } else if ( SwitchMatch(args[j], _T("restricted"))) { m_restricted = true; } else if ( SwitchMatch(args[j], _T("viewonly"))) { m_ViewOnly = true; } else if ( SwitchMatch(args[j], _T("fullscreen"))) { m_FullScreen = true; } else if ( SwitchMatch(args[j], _T("8bit"))) { m_Use8Bit = true; } else if ( SwitchMatch(args[j], _T("shared"))) { m_Shared = true; } else if ( SwitchMatch(args[j], _T("swapmouse"))) { m_SwapMouse = true; } else if ( SwitchMatch(args[j], _T("nocursor"))) { m_localCursor = NOCURSOR; } else if ( SwitchMatch(args[j], _T("dotcursor"))) { m_localCursor = DOTCURSOR; } else if ( SwitchMatch(args[j], _T("normalcursor"))) { m_localCursor = NORMALCURSOR; } else if ( SwitchMatch(args[j], _T("belldeiconify") )) { m_DeiconifyOnBell = true; } else if ( SwitchMatch(args[j], _T("emulate3") )) { m_Emul3Buttons = true; } else if ( SwitchMatch(args[j], _T("noemulate3") )) { m_Emul3Buttons = false; } else if ( SwitchMatch(args[j], _T("scale") )) { if (++j == i) { ArgError(_T("No scaling factor specified")); continue; } int numscales = _stscanf(args[j], _T("%d/%d"), &m_scale_num, &m_scale_den); if (numscales < 1) { ArgError(_T("Invalid scaling specified")); continue; } if (numscales == 1) m_scale_den = 1; // needed if you're overriding a previous setting } else if ( SwitchMatch(args[j], _T("emulate3timeout") )) { if (++j == i) { ArgError(_T("No timeout specified")); continue; } if (_stscanf(args[j], _T("%d"), &m_Emul3Timeout) != 1) { ArgError(_T("Invalid timeout specified")); continue; } } else if ( SwitchMatch(args[j], _T("emulate3fuzz") )) { if (++j == i) { ArgError(_T("No fuzz specified")); continue; } if (_stscanf(args[j], _T("%d"), &m_Emul3Fuzz) != 1) { ArgError(_T("Invalid fuzz specified")); continue; } } else if ( SwitchMatch(args[j], _T("disableclipboard") )) { m_DisableClipboard = true; } #ifdef UNDER_CE // Manual setting of palm vs hpc aspect ratio for dialog boxes. else if ( SwitchMatch(args[j], _T("hpc") )) { m_palmpc = false; } else if ( SwitchMatch(args[j], _T("palm") )) { m_palmpc = true; } else if ( SwitchMatch(args[j], _T("slow") )) { m_slowgdi = true; } #endif else if ( SwitchMatch(args[j], _T("delay") )) { if (++j == i) { ArgError(_T("No delay specified")); continue; } if (_stscanf(args[j], _T("%d"), &m_delay) != 1) { ArgError(_T("Invalid delay specified")); continue; } } else if ( SwitchMatch(args[j], _T("loglevel") )) { if (++j == i) { ArgError(_T("No loglevel specified")); continue; } if (_stscanf(args[j], _T("%d"), &m_logLevel) != 1) { ArgError(_T("Invalid loglevel specified")); continue; } } else if ( SwitchMatch(args[j], _T("console") )) { m_logToConsole = true; } else if ( SwitchMatch(args[j], _T("logfile") )) { if (++j == i) { ArgError(_T("No logfile specified")); continue; } if (_stscanf(args[j], _T("%s"), &m_logFilename) != 1) { ArgError(_T("Invalid logfile specified")); continue; } else { m_logToFile = true; } } else if ( SwitchMatch(args[j], _T("config") )) { if (++j == i) { ArgError(_T("No config file specified")); continue; } // The GetPrivateProfile* stuff seems not to like some relative paths _fullpath(m_configFilename, args[j], _MAX_PATH); if (_access(m_configFilename, 04)) { ArgError(_T("Can't open specified config file for reading.")); PostQuitMessage(1); continue; } else { Load(m_configFilename); m_configSpecified = true; } } else if ( SwitchMatch(args[j], _T("register") )) { Register(); PostQuitMessage(0); } else { TCHAR phost[256]; if (!ParseDisplay(args[j], phost, 255, &m_port)) { ShowUsage(_T("Invalid VNC server specified.")); PostQuitMessage(1); } else { _tcscpy(m_host, phost); m_connectionSpecified = true; } } } if (m_scale_num != 1 || m_scale_den != 1) m_scaling = true; // reduce scaling factors by greatest common denominator if (m_scaling) { FixScaling(); } // tidy up delete [] cmd; delete [] args; }
Texture::Texture(uint width, uint height, uint bits) : m_Width(width), m_Height(height), m_Bits(24), m_FileName("NULL") { m_TID = Load(); }
bool CWelcomeDialog::Run(wxWindow* parent, bool force /*=false*/, bool delay /*=false*/) { const wxString ownVersion = CBuildInfo::GetVersion(); wxString greetingVersion = COptions::Get()->GetOption(OPTION_GREETINGVERSION); wxString const resources = COptions::Get()->GetOption(OPTION_GREETINGRESOURCES); COptions::Get()->SetOption(OPTION_GREETINGRESOURCES, _T("")); if (!force) { if (COptions::Get()->GetOptionVal(OPTION_DEFAULT_KIOSKMODE) == 2) { if (delay) delete this; return true; } if (!greetingVersion.empty() && CBuildInfo::ConvertToVersionNumber(ownVersion.c_str()) <= CBuildInfo::ConvertToVersionNumber(greetingVersion.c_str())) { // Been there done that if (delay) delete this; return true; } COptions::Get()->SetOption(OPTION_GREETINGVERSION, ownVersion.ToStdWstring()); if (greetingVersion.empty() && !COptions::Get()->GetOptionVal(OPTION_DEFAULT_KIOSKMODE)) COptions::Get()->SetOption(OPTION_PROMPTPASSWORDSAVE, 1); } if (!Load(parent, _T("ID_WELCOME"))) { if (delay) { delete this; } return false; } InitFooter(force ? wxString() : resources); xrc_call(*this, "ID_FZVERSION", &wxStaticText::SetLabel, _T("FileZilla ") + CBuildInfo::GetVersion()); wxString const url = _T("https://welcome.filezilla-project.org/welcome?type=client&category=%s&version=") + ownVersion; if (!greetingVersion.empty()) { xrc_call(*this, "ID_LINK_NEWS", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("news")) + _T("&oldversion=") + greetingVersion); xrc_call(*this, "ID_LINK_NEWS", &wxHyperlinkCtrl::SetLabel, wxString::Format(_("New features and improvements in %s"), CBuildInfo::GetVersion())); } else { xrc_call(*this, "ID_LINK_NEWS", &wxHyperlinkCtrl::Hide); xrc_call(*this, "ID_HEADING_NEWS", &wxStaticText::Hide); } xrc_call(*this, "ID_DOCUMENTATION_BASIC", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("documentation_basic"))); xrc_call(*this, "ID_DOCUMENTATION_NETWORK", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("documentation_network"))); xrc_call(*this, "ID_DOCUMENTATION_MORE", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("documentation_more"))); xrc_call(*this, "ID_SUPPORT_FORUM", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("support_forum"))); xrc_call(*this, "ID_SUPPORT_MORE", &wxHyperlinkCtrl::SetURL, wxString::Format(url, _T("support_more"))); #ifdef FZ_WINDOWS // Add phone support link in official Windows builds builds... if (CBuildInfo::GetBuildType() == _T("official")) { auto lang = wxGetLocale() ? wxGetLocale()->GetName() : wxString(); // but only in English... if (lang.StartsWith(_T("en"))) { auto const now = fz::datetime::now(); // while the build is fresh... if ((now - CBuildInfo::GetBuildDate()).get_days() < 60) { // and only for US and Canada, so limit by timezone auto ref = fz::datetime(now.format("%Y%m%d%H%M%S", fz::datetime::utc), fz::datetime::utc); auto offset = fz::datetime(ref.format("%Y%m%d%H%M%S", fz::datetime::utc), fz::datetime::local); auto diff = (ref - offset).get_hours(); if (diff >= -9 && diff <= -3) { auto sizer = xrc_call(*this, "ID_SUPPORT_MORE", &wxWindow::GetContainingSizer); if (sizer) { auto link = new wxHyperlinkCtrl(sizer->GetContainingWindow(), wxID_ANY, _T("Phone support"), _T("https://filezilla-project.org/phone_support.php")); sizer->Insert(0, link); } } } } } #endif Layout(); GetSizer()->Fit(this); if (delay) { m_delayedShowTimer.SetOwner(this); m_delayedShowTimer.Start(10, true); } else ShowModal(); return true; }
bool CSG_MetaData::Create(const CSG_String &File, const SG_Char *Extension) { return( Load(File, Extension) ); }
CCfgFile::CCfgFile(xst_castring& strFileName, xst_castring& strGroupName) : m_bLoaded ( false ), m_strFileName( strFileName ) { Load( strFileName, strGroupName ); }
CConfigFile::CConfigFile(const char* filename, IFileSystem& fs) { if (filename) { Load(filename, fs); } }
IFaceWin::IFaceWin( Window * pcParent, Interface * pcIFace, bool bReadOnly ):Window( Rect( 0, 0, 180, 180 ), "IFaceWin", "" ) { m_pcIFace = pcIFace; m_bReadOnly = bReadOnly; m_pcParent = pcParent; SetTitle( MSG_IFWIN_TITLE + " " + pcIFace->GetName() ); LayoutView *pcLayout; VLayoutNode *pcRoot; HLayoutNode *pcTypeRow; StringView *pcLblType; HLayoutNode *pcAddressRow; StringView *pcLblAddress; HLayoutNode *pcNetmaskRow; StringView *pcLblNetmask; HLayoutNode *pcGatewayRow; StringView *pcLblGateway; HLayoutNode *pcEnabledRow; StringView *pcLblEnabled; HLayoutNode *pcBtnRow; HLayoutSpacer *pcSpacer; Button *pcBtnApply; Button *pcBtnClose; pcRoot = new VLayoutNode( "pcRoot" ); pcLayout = new LayoutView( Rect( 0, 0, 180, 180 ), "pcLayout", pcRoot ); pcTypeRow = new HLayoutNode( "pcTypeRow" ); pcLblType = new StringView( Rect(), "pcLblType", MSG_IFWIN_TYPE ); m_pcDdmType = new DropdownMenu( Rect(), "m_pcDdmType" ); m_pcDdmType->SetReadOnly( true ); m_pcDdmType->AppendItem( MSG_IFWIN_TYPE_STATIC ); m_pcDdmType->AppendItem( MSG_IFWIN_TYPE_DHCP ); m_pcDdmType->SetSelectionMessage( new Message( ChangeType ) ); m_pcDdmType->SetTarget( this ); m_pcDdmType->SetTabOrder( 0 ); pcTypeRow->AddChild( pcLblType ); pcTypeRow->AddChild( m_pcDdmType ); pcTypeRow->LimitMaxSize( Point( INT_MAX, m_pcDdmType->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcTypeRow ); pcAddressRow = new HLayoutNode( "pcAddressRow" ); pcLblAddress = new StringView( Rect(), "pcLblAddress", MSG_IFWIN_ADDRESS ); m_pcTxtAddress = new TextView( Rect(), "m_pcTxtAddress", "" ); m_pcTxtAddress->SetMaxLength( 15 ); m_pcTxtAddress->SetTabOrder( 1 ); pcAddressRow->AddChild( pcLblAddress ); pcAddressRow->AddChild( m_pcTxtAddress ); pcAddressRow->LimitMaxSize( Point( INT_MAX, m_pcTxtAddress->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcAddressRow ); pcNetmaskRow = new HLayoutNode( "pcNetmaskRow" ); pcLblNetmask = new StringView( Rect(), "pcLblNetmask", MSG_IFWIN_NETMASK ); m_pcTxtNetmask = new TextView( Rect(), "m_pcTxtNetmask", "" ); m_pcTxtNetmask->SetMaxLength( 15 ); m_pcTxtNetmask->SetTabOrder( 2 ); pcNetmaskRow->AddChild( pcLblNetmask ); pcNetmaskRow->AddChild( m_pcTxtNetmask ); pcNetmaskRow->LimitMaxSize( Point( INT_MAX, m_pcTxtNetmask->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcNetmaskRow ); pcGatewayRow = new HLayoutNode( "pcGatewayRow" ); pcLblGateway = new StringView( Rect(), "pcLblGateway", MSG_IFWIN_GATEWAY ); m_pcTxtGateway = new TextView( Rect(), "m_pcTxtGateway", "" ); m_pcTxtGateway->SetMaxLength( 15 ); m_pcTxtGateway->SetTabOrder( 3 ); pcGatewayRow->AddChild( pcLblGateway ); pcGatewayRow->AddChild( m_pcTxtGateway ); pcGatewayRow->LimitMaxSize( Point( INT_MAX, m_pcTxtGateway->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcGatewayRow ); pcEnabledRow = new HLayoutNode( "pcEnabledRow" ); pcLblEnabled = new StringView( Rect(), "pcLblEnabled", MSG_IFWIN_ENABLED ); m_pcCbEnabled = new CheckBox( Rect(), "m_pcCbEnabled", "", new Message( ChangeEnabled ) ); m_pcCbEnabled->SetTabOrder( 4 ); pcEnabledRow->AddChild( pcLblEnabled ); pcEnabledRow->AddChild( m_pcCbEnabled ); pcEnabledRow->LimitMaxSize( Point( INT_MAX, m_pcCbEnabled->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcEnabledRow ); pcBtnRow = new HLayoutNode( "pcBtnRow" ); pcSpacer = new HLayoutSpacer( "pcSpacer" ); pcBtnApply = new Button( Rect(), "pcBtnApply", MSG_IFWIN_APPLY, new Message( Apply ) ); pcBtnApply->SetTabOrder( 5 ); pcBtnClose = new Button( Rect(), "pcBtnClose", MSG_IFWIN_CLOSE, new Message( Close ) ); pcBtnClose->SetTabOrder( 6 ); pcBtnRow->AddChild( pcSpacer ); pcBtnRow->AddChild( pcBtnApply ); pcBtnRow->AddChild( pcBtnClose ); pcBtnRow->LimitMaxSize( Point( INT_MAX, pcBtnApply->GetPreferredSize( false ).y ) ); pcRoot->AddChild( pcBtnRow ); pcRoot->SameWidth( "pcLblEnabled", "pcLblGateway", "pcLblNetmask", "pcLblAddress", "pcLblType", NULL ); pcRoot->SameWidth( "m_pcTxtGateway", "m_pcTxtNetmask", "m_pcTxtAddress", "m_pcDdmType", "m_pcCbEnabled", NULL ); pcRoot->SetBorders( Rect( 2, 2, 2, 2 ), "pcLblEnabled", "pcLblGateway", "pcLblNetmask", "pcLblAddress", "pcLblType", "m_pcTxtGateway", "m_pcTxtNetmask", "m_pcTxtAddress", "m_pcDdmType", "m_pcCbEnabled", "pcBtnApply", "pcBtnClose", NULL ); AddChild( pcLayout ); Load(); if( m_bReadOnly ) { m_pcDdmType->SetEnable( false ); m_pcTxtAddress->SetEnable( false ); m_pcTxtNetmask->SetEnable( false ); m_pcTxtGateway->SetEnable( false ); m_pcCbEnabled->SetEnable( false ); pcBtnApply->SetEnable( false ); } }
//Load the file containing WebCLIPS HTML helper functions and // deftemplates for ODBC queries and Screen Names int LoadHelper(void) { char szLoadHelper[4]; char szFileName[MAXNAMLEN + 1]; char szWCErrorCode[9]; int iErrCode; //First load the deftemplates, get the file path/name from // WebCLIPS.INI GetWebCLIPSSettings( "System", // section name "Deftemplates", // entry name "", // default value szFileName, // return value sizeof(szFileName), // max length g_szWebCLIPSINI ); iErrCode = Load(szFileName); if(iErrCode != LOAD_OK) { switch (iErrCode) { case LOAD_FILE_IO_ERROR : strcpy(szWCErrorCode, "DFTM0001"); break; case LOAD_PARSE_ERROR : strcpy(szWCErrorCode, "DFTM0004"); } ProcessErrorCode(szWCErrorCode, szFileName, 'n', 'n'); return(-1); } //Next, determine if screen wants it loaded GetWebCLIPSSettings( g_szScreenName, // section name "LoadHelper", // entry name "", // default value szLoadHelper, // return value sizeof(szLoadHelper), // max length g_szWebCLIPSINI ); //Helper not wanted, exit if(strcasecmp(szLoadHelper, "yes") != 0) return(0); //Get the name of theHTML helper file. GetWebCLIPSSettings( "System", // section name "HelperFileName", // entry name "", // default value szFileName, // return value sizeof(szFileName), // max length g_szWebCLIPSINI ); iErrCode = Load(szFileName); if(iErrCode != LOAD_OK) { switch (iErrCode) { case LOAD_FILE_IO_ERROR : strcpy(szWCErrorCode, "HTML0001"); break; case LOAD_PARSE_ERROR : strcpy(szWCErrorCode, "HTML0004"); break; } ProcessErrorCode(szWCErrorCode, szFileName, 'n', 'n'); return(-1); } return(0); }
static LRESULT wm_Command ( HWND hwnd, TPack_WindowData *pData, WORD wNotifyCode, WORD wID, HWND hwndCtl ) { switch (wID) { case ID_FILE_OPEN: Load(pData); return 0; case ID_FILE_SAVE: if (pData->Dirty) { if (pData->FileNameIsValid) Save(pData, pData->TXLFileName); else Save(pData, NULL); } return 0; case ID_FILE_SAVEAS: Save(pData, NULL); return 0; case ID_FILE_EXIT : case IDCANCEL : if (pData->Dirty) { int Result; Result = MessageBox(NULL, "Do you want to save changes before quitting?", "Texture Packer", MB_YESNOCANCEL); if (Result == IDCANCEL) return 0; if (Result == IDYES) { #pragma message("If we do a cancel in here, then we still shut down the app, and lose changes.") if (pData->FileNameIsValid) Save(pData, pData->TXLFileName); else Save(pData, NULL); } } DestroyWindow (hwnd); return 0; case IDC_TEXTURELIST: if (wNotifyCode == LBN_SELCHANGE) { SendMessage(pData->hwnd, MSG_SELECT_BITMAP, (WPARAM)0, (LPARAM)0); } return 0; // Extract all resource entries to individual BMP files. // Added DJT (see revision note - 4/18/99) case ID_OPTIONS_EXTRACTALL: { TPack_ExtractAll(pData); } return 0; // Extract the selected resource entry to BMP file. // Added DJT (see revision note - 4/18/99) case ID_OPTIONS_EXTRACTSELECTED: { TPack_ExtractSelected(pData); } return 0; } return 0; }
void HisBase::Save() { Load(); isnew = false; DoInternalSave(node); }
BuyoutManager::BuyoutManager(DataStore &data) : data_(data), save_needed_(false) { Load(); }
virtual bool Load(const wxURI& location, const wxURI& WXUNUSED(proxy)) { return Load(location); }
const JCharacter* JFSBindingList::Revert() { const JCharacter* userMsg = ""; // toss everything itsBindingList->CleanOut(); itsOverriddenList->CleanOut(); delete itsUserDefault; itsUserDefault = NULL; delete itsSystemDefault; itsSystemDefault = NULL; // read system bindings ifstream sysInput(kGlobalBindingsFile); if (sysInput.good()) { Load(sysInput, kJTrue); } sysInput.close(); // read user bindings JPrefsFile* file = NULL; if (!itsSignalFileName.IsEmpty() && (JPrefsFile::Create(kUserExtensionBindingRoot, &file, JFileArray::kDeleteIfWaitTimeout)).OK()) { if (file->IsEmpty()) { JString origUserFile; if (JExpandHomeDirShortcut(kOrigUserExtensionBindingFile, &origUserFile) && JFileReadable(origUserFile)) { ifstream userInput(origUserFile); if (userInput.good()) { Load(userInput, kJFalse); userMsg = JGetString("UpgradeFromVersion1::JFSBindingList"); } } } else { for (JFileVersion vers = kCurrentBindingVersion; kJTrue; vers--) { if (file->IDValid(vers)) { std::string data; file->GetData(vers, &data); std::istringstream input(data); Load(input, kJFalse); break; } if (vers == 0) { break; // check *before* decrement since unsigned } } } delete file; } if (IsEmpty()) // nothing loaded { #ifdef _J_OSX const JCharacter* data = JGetString("DefaultBindingList-OSX::JFSBindingList"); #else const JCharacter* data = JGetString("DefaultBindingList::JFSBindingList"); #endif const std::string s(data, strlen(data)); std::istringstream input(s); Load(input, kJFalse); } if (!itsSignalFileName.IsEmpty()) { JGetModificationTime(itsSignalFileName, &itsSignalModTime); } // ensure that GetDefaultCommand() will work if (itsUserDefault == NULL && itsSystemDefault == NULL) { SetDefaultCommand(kDefaultCmd, kDefaultCmdType, kDefaultSingleFile); } return userMsg; }