CSkinInfo::CSkinInfo(const cp_extension_t *ext) : CAddon(ext), m_version("") { ELEMENTS elements; if (CAddonMgr::Get().GetExtElements(ext->configuration, "res", elements)) { for (ELEMENTS::iterator i = elements.begin(); i != elements.end(); ++i) { int width = atoi(CAddonMgr::Get().GetExtValue(*i, "@width").c_str()); int height = atoi(CAddonMgr::Get().GetExtValue(*i, "@height").c_str()); bool defRes = CAddonMgr::Get().GetExtValue(*i, "@default") == "true"; std::string folder = CAddonMgr::Get().GetExtValue(*i, "@folder"); float aspect = 0; std::string strAspect = CAddonMgr::Get().GetExtValue(*i, "@aspect"); vector<string> fracs = StringUtils::Split(strAspect, ":"); if (fracs.size() == 2) aspect = (float)(atof(fracs[0].c_str())/atof(fracs[1].c_str())); if (width > 0 && height > 0) { RESOLUTION_INFO res(width, height, aspect, folder); res.strId = strAspect; // for skin usage, store aspect string in strId if (defRes) m_defaultRes = res; m_resolutions.push_back(res); } } } else { // no resolutions specified -> backward compatibility std::string defaultWide = CAddonMgr::Get().GetExtValue(ext->configuration, "@defaultwideresolution"); if (defaultWide.empty()) defaultWide = CAddonMgr::Get().GetExtValue(ext->configuration, "@defaultresolution"); TranslateResolution(defaultWide, m_defaultRes); } std::string str = CAddonMgr::Get().GetExtValue(ext->configuration, "@effectslowdown"); if (!str.empty()) m_effectsSlowDown = (float)atof(str.c_str()); else m_effectsSlowDown = 1.f; str = CAddonMgr::Get().GetExtValue(ext->configuration, "@debugging"); m_debugging = !strcmp(str.c_str(), "true"); LoadStartupWindows(ext); // figure out the version m_version = GetDependencyVersion("xbmc.gui"); }
void CAboutDialog::OnCopy(wxCommandEvent& event) { wxString text = _T("FileZilla Client\n"); text += _T("----------------\n\n"); text += _T("Version: ") + CBuildInfo::GetVersion(); if (CBuildInfo::GetBuildType() == _T("nightly")) text += _T("-nightly"); text += '\n'; text += _T("\nBuild information:\n"); wxString host = CBuildInfo::GetHostname(); if (!host.empty()) text += _T(" Compiled for: ") + host + _T("\n"); wxString build = CBuildInfo::GetBuildSystem(); if (!build.empty()) text += _T(" Compiled on: ") + build + _T("\n"); text += _T(" Build date: ") + CBuildInfo::GetBuildDateString() + _T("\n"); text += _T(" Compiled with: ") + CBuildInfo::GetCompiler() + _T("\n"); wxString compilerFlags = CBuildInfo::GetCompilerFlags(); if (!compilerFlags.empty()) text += _T(" Compiler flags: ") + compilerFlags + _T("\n"); text += _T("\nLinked against:\n wxWidgets: ") + wxString(wxVERSION_NUM_DOT_STRING_T) + _T("\n"); text += _T(" GnuTLS: ") + GetDependencyVersion(dependency_gnutls) + _T("\n"); #ifdef __WXMSW__ text.Replace(_T("\n"), _T("\r\n")); #endif if (!wxTheClipboard->Open()) { wxMessageBox(_("Could not open clipboard"), _("Could not copy data"), wxICON_EXCLAMATION); return; } wxTheClipboard->SetData(new wxTextDataObject(text)); wxTheClipboard->Flush(); wxTheClipboard->Close(); }
void CAboutDialog::OnCopy(wxCommandEvent& event) { wxString text = _T("FileZilla Client\n"); text += _T("----------------\n\n"); text += _T("Version: ") + CBuildInfo::GetVersion(); if (CBuildInfo::GetBuildType() == _T("nightly")) text += _T("-nightly"); text += '\n'; text += _T("\nBuild information:\n"); wxString host = CBuildInfo::GetHostname(); if (!host.empty()) text += _T(" Compiled for: ") + host + _T("\n"); wxString build = CBuildInfo::GetBuildSystem(); if (!build.empty()) text += _T(" Compiled on: ") + build + _T("\n"); text += _T(" Build date: ") + CBuildInfo::GetBuildDateString() + _T("\n"); text += _T(" Compiled with: ") + CBuildInfo::GetCompiler() + _T("\n"); wxString compilerFlags = CBuildInfo::GetCompilerFlags(); if (!compilerFlags.empty()) text += _T(" Compiler flags: ") + compilerFlags + _T("\n"); text += _T("\nLinked against:\n"); for (int i = 0; i < dependency::count; ++i) { text += wxString::Format(_T(" % -15s %s\n"), (GetDependencyName(dependency::type(i)) + _T(":")).c_str(), GetDependencyVersion(dependency::type(i)).c_str()); } text += _T("\nOperating system:\n"); wxString os = wxGetOsDescription(); if (!os.empty()) text += _T(" Name: ") + os + _T("\n"); int major, minor; if (wxGetOsVersion(&major, &minor) != wxOS_UNKNOWN) text += wxString::Format(_T(" Version: %d.%d\n"), major, minor); #if defined(__WXMSW__) if (::wxIsPlatform64Bit()) text += _T(" Platform: 64 bit system\n"); else text += _T(" Platform: 32 bit system\n"); #endif #ifdef __WXMSW__ text.Replace(_T("\n"), _T("\r\n")); #endif if (!wxTheClipboard->Open()) { wxMessageBox(_("Could not open clipboard"), _("Could not copy data"), wxICON_EXCLAMATION); return; } wxTheClipboard->SetData(new wxTextDataObject(text)); wxTheClipboard->Flush(); wxTheClipboard->Close(); }
bool CAboutDialog::Create(wxWindow* parent) { if (!Load(parent, _T("ID_ABOUT"))) return false; XRCCTRL(*this, "ID_URL", wxHyperlinkCtrl)->SetLabel(_T("https://filezilla-project.org")); XRCCTRL(*this, "ID_COPYRIGHT", wxStaticText)->SetLabel(_T("Copyright (C) 2004-2013 Tim Kosse")); wxString version = CBuildInfo::GetVersion(); if (CBuildInfo::GetBuildType() == _T("nightly")) version += _T("-nightly"); if (!SetLabel(XRCID("ID_VERSION"), version)) return false; wxStaticText* pHost = XRCCTRL(*this, "ID_HOST", wxStaticText); if (!pHost) return false; wxStaticText* pHostDesc = XRCCTRL(*this, "ID_HOST_DESC", wxStaticText); if (!pHostDesc) return false; wxString host = CBuildInfo::GetHostname(); if (host == _T("")) { pHost->Hide(); pHostDesc->Hide(); } else pHost->SetLabel(host); wxStaticText* pBuild = XRCCTRL(*this, "ID_BUILD", wxStaticText); if (!pBuild) return false; wxStaticText* pBuildDesc = XRCCTRL(*this, "ID_BUILD_DESC", wxStaticText); if (!pBuildDesc) return false; wxString build = CBuildInfo::GetBuildSystem(); if (build == _T("")) { pBuild->Hide(); pBuildDesc->Hide(); } else pBuild->SetLabel(build); if (!SetLabel(XRCID("ID_BUILDDATE"), CBuildInfo::GetBuildDateString())) return false; if (!SetLabel(XRCID("ID_COMPILEDWITH"), CBuildInfo::GetCompiler(), 200)) return false; wxStaticText* pCompilerFlags = XRCCTRL(*this, "ID_CFLAGS", wxStaticText); if (!pCompilerFlags) return false; wxStaticText* pCompilerFlagsDesc = XRCCTRL(*this, "ID_CFLAGS_DESC", wxStaticText); if (!pCompilerFlagsDesc) return false; wxString compilerFlags = CBuildInfo::GetCompilerFlags(); if (compilerFlags == _T("")) { pCompilerFlags->Hide(); pCompilerFlagsDesc->Hide(); } else { WrapText(this, compilerFlags, 200); pCompilerFlags->SetLabel(compilerFlags); } wxStaticText* pVer_wx = XRCCTRL(*this, "ID_VER_WX", wxStaticText); if (pVer_wx) pVer_wx->SetLabel(GetDependencyVersion(dependency::wxwidgets)); wxStaticText* pVer_gnutls = XRCCTRL(*this, "ID_VER_GNUTLS", wxStaticText); if (pVer_gnutls) pVer_gnutls->SetLabel(GetDependencyVersion(dependency::gnutls)); wxStaticText* pVer_sqlite = XRCCTRL(*this, "ID_VER_SQLITE", wxStaticText); if (pVer_sqlite) pVer_sqlite->SetLabel(GetDependencyVersion(dependency::sqlite)); wxStaticText* pSystemName = XRCCTRL(*this, "ID_SYSTEM_NAME", wxStaticText); if (!pSystemName) return false; wxStaticText* pSystemNameDesc = XRCCTRL(*this, "ID_SYSTEM_NAME_DESC", wxStaticText); if (!pSystemNameDesc) return false; wxString os = wxGetOsDescription(); if (os.empty()) { pSystemName->Hide(); pSystemNameDesc->Hide(); } else pSystemName->SetLabel(os); wxStaticText* pSystemVersion = XRCCTRL(*this, "ID_SYSTEM_VER", wxStaticText); if (!pSystemVersion) return false; wxStaticText* pSystemVersionDesc = XRCCTRL(*this, "ID_SYSTEM_VER_DESC", wxStaticText); if (!pSystemVersionDesc) return false; int major, minor; if (wxGetOsVersion(&major, &minor) != wxOS_UNKNOWN) { wxString version = wxString::Format(_T("%d.%d"), major, minor); pSystemVersion->SetLabel(version); } else { pSystemVersionDesc->Hide(); pSystemVersion->Hide(); } wxStaticText* pSystemPlatform = XRCCTRL(*this, "ID_SYSTEM_PLATFORM", wxStaticText); if (!pSystemPlatform) return false; wxStaticText* pSystemPlatformDesc = XRCCTRL(*this, "ID_SYSTEM_PLATFORM_DESC", wxStaticText); if (!pSystemPlatformDesc) return false; #if defined(__WXMSW__) if (::wxIsPlatform64Bit()) pSystemPlatform->SetLabel(_("64 bit system")); else pSystemPlatform->SetLabel(_("32 bit system")); #else pSystemPlatform->Hide(); pSystemPlatformDesc->Hide(); #endif GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); return true; }
bool CAboutDialog::Create(wxWindow* parent) { if (!Load(parent, _T("ID_ABOUT"))) { return false; } wxBitmap bmp = CThemeProvider::Get()->CreateBitmap("ART_FILEZILLA", wxString(), CThemeProvider::GetIconSize(iconSizeLarge)); xrc_call(*this, "ID_FILEZILLA_LOGO", &wxStaticBitmap::SetBitmap, bmp); xrc_call(*this, "ID_URL", &wxHyperlinkCtrl::SetLabel, _T("https://filezilla-project.org/")); xrc_call(*this, "ID_COPYRIGHT", &wxStaticText::SetLabel, _T("Copyright (C) 2004-2016 Tim Kosse")); wxString version = CBuildInfo::GetVersion(); if (CBuildInfo::GetBuildType() == _T("nightly")) version += _T("-nightly"); if (!SetChildLabel(XRCID("ID_VERSION"), version)) return false; wxString const host = CBuildInfo::GetHostname(); if (host.empty()) { xrc_call(*this, "ID_HOST", &wxStaticText::Hide); xrc_call(*this, "ID_HOST_DESC", &wxStaticText::Hide); } else { xrc_call(*this, "ID_HOST", &wxStaticText::SetLabel, host); } wxString const build = CBuildInfo::GetBuildSystem(); if (build.empty()) { xrc_call(*this, "ID_BUILD", &wxStaticText::Hide); xrc_call(*this, "ID_BUILD_DESC", &wxStaticText::Hide); } else { xrc_call(*this, "ID_BUILD", &wxStaticText::SetLabel, build); } if (!SetChildLabel(XRCID("ID_BUILDDATE"), CBuildInfo::GetBuildDateString())) return false; if (!SetChildLabel(XRCID("ID_COMPILEDWITH"), CBuildInfo::GetCompiler(), 200)) return false; wxString compilerFlags = CBuildInfo::GetCompilerFlags(); if (compilerFlags.empty()) { xrc_call(*this, "ID_CFLAGS", &wxStaticText::Hide); xrc_call(*this, "ID_CFLAGS_DESC", &wxStaticText::Hide); } else { WrapText(this, compilerFlags, 250); xrc_call(*this, "ID_CFLAGS", &wxStaticText::SetLabel, compilerFlags); } xrc_call(*this, "ID_VER_WX", &wxStaticText::SetLabel, GetDependencyVersion(lib_dependency::wxwidgets)); xrc_call(*this, "ID_VER_GNUTLS", &wxStaticText::SetLabel, GetDependencyVersion(lib_dependency::gnutls)); xrc_call(*this, "ID_VER_SQLITE", &wxStaticText::SetLabel, GetDependencyVersion(lib_dependency::sqlite)); wxString const os = wxGetOsDescription(); if (os.empty()) { xrc_call(*this, "ID_SYSTEM_NAME", &wxStaticText::Hide); xrc_call(*this, "ID_SYSTEM_NAME_DESC", &wxStaticText::Hide); } else { xrc_call(*this, "ID_SYSTEM_NAME", &wxStaticText::SetLabel, os); } int major, minor; if (GetRealOsVersion(major, minor)) { wxString osVersion = wxString::Format(_T("%d.%d"), major, minor); int fakeMajor, fakeMinor; if (wxGetOsVersion(&fakeMajor, &fakeMinor) != wxOS_UNKNOWN && (fakeMajor != major || fakeMinor != minor)) { osVersion += _T(" "); osVersion += wxString::Format(_("(app-compat is set to %d.%d)"), fakeMajor, fakeMinor); } xrc_call(*this, "ID_SYSTEM_VER", &wxStaticText::SetLabel, osVersion); } else { xrc_call(*this, "ID_SYSTEM_VER", &wxStaticText::Hide); xrc_call(*this, "ID_SYSTEM_VER_DESC", &wxStaticText::Hide); } #ifdef __WXMSW__ if (::wxIsPlatform64Bit()) xrc_call(*this, "ID_SYSTEM_PLATFORM", &wxStaticText::SetLabel, _("64-bit system")); else xrc_call(*this, "ID_SYSTEM_PLATFORM", &wxStaticText::SetLabel, _("32-bit system")); #else xrc_call(*this, "ID_SYSTEM_PLATFORM", &wxStaticText::Hide); xrc_call(*this, "ID_SYSTEM_PLATFORM_DESC", &wxStaticText::Hide); #endif wxString cpuCaps = CBuildInfo::GetCPUCaps(' '); if (!cpuCaps.empty()) { WrapText(this, cpuCaps, 250); xrc_call(*this, "ID_SYSTEM_CPU", &wxStaticText::SetLabel, cpuCaps); } else { xrc_call(*this, "ID_SYSTEM_CPU_DESC", &wxStaticText::Hide); xrc_call(*this, "ID_SYSTEM_CPU", &wxStaticText::Hide); } xrc_call(*this, "ID_SYSTEM_SETTINGS_DIR", &wxStaticText::SetLabel, COptions::Get()->GetOption(OPTION_DEFAULT_SETTINGSDIR)); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); return true; }
void CAboutDialog::OnCopy(wxCommandEvent&) { wxString text = _T("FileZilla Client\n"); text += _T("----------------\n\n"); text += _T("Version: ") + CBuildInfo::GetVersion(); if (CBuildInfo::GetBuildType() == _T("nightly")) text += _T("-nightly"); text += '\n'; text += _T("\nBuild information:\n"); wxString host = CBuildInfo::GetHostname(); if (!host.empty()) text += _T(" Compiled for: ") + host + _T("\n"); wxString build = CBuildInfo::GetBuildSystem(); if (!build.empty()) text += _T(" Compiled on: ") + build + _T("\n"); text += _T(" Build date: ") + CBuildInfo::GetBuildDateString() + _T("\n"); text += _T(" Compiled with: ") + CBuildInfo::GetCompiler() + _T("\n"); wxString compilerFlags = CBuildInfo::GetCompilerFlags(); if (!compilerFlags.empty()) text += _T(" Compiler flags: ") + compilerFlags + _T("\n"); text += _T("\nLinked against:\n"); for (int i = 0; i < static_cast<int>(lib_dependency::count); ++i) { text += wxString::Format(_T(" % -15s %s\n"), GetDependencyName(lib_dependency(i)) + _T(":"), GetDependencyVersion(lib_dependency(i))); } text += _T("\nOperating system:\n"); wxString os = wxGetOsDescription(); if (!os.empty()) text += _T(" Name: ") + os + _T("\n"); int major, minor; if (GetRealOsVersion(major, minor)) { wxString version = wxString::Format(_T("%d.%d"), major, minor); int fakeMajor, fakeMinor; if (wxGetOsVersion(&fakeMajor, &fakeMinor) != wxOS_UNKNOWN && (fakeMajor != major || fakeMinor != minor)) { version += _T(" "); version += wxString::Format(_("(app-compat is set to %d.%d)"), fakeMajor, fakeMinor); } text += wxString::Format(_T(" Version: %s\n"), version); } #ifdef __WXMSW__ if (::wxIsPlatform64Bit()) text += _T(" Platform: 64-bit system\n"); else text += _T(" Platform: 32-bit system\n"); #endif wxString cpuCaps = CBuildInfo::GetCPUCaps(' '); if (!cpuCaps.empty()) { text += _T(" CPU features: ") + cpuCaps + _T("\n"); } text += _T(" Settings dir: ") + COptions::Get()->GetOption(OPTION_DEFAULT_SETTINGSDIR) + _T("\n"); #ifdef __WXMSW__ text.Replace(_T("\n"), _T("\r\n")); #endif if (!wxTheClipboard->Open()) { wxMessageBoxEx(_("Could not open clipboard"), _("Could not copy data"), wxICON_EXCLAMATION); return; } wxTheClipboard->SetData(new wxTextDataObject(text)); wxTheClipboard->Flush(); wxTheClipboard->Close(); }
bool CAboutDialog::Create(wxWindow* parent) { if (!Load(parent, _T("ID_ABOUT"))) return false; XRCCTRL(*this, "ID_URL", wxHyperlinkCtrl)->SetLabel(_T("http://filezilla-project.org")); XRCCTRL(*this, "ID_COPYRIGHT", wxStaticText)->SetLabel(_T("Copyright (C) 2004-2009 Tim Kosse")); wxString version = CBuildInfo::GetVersion(); if (CBuildInfo::GetBuildType() == _T("nightly")) version += _T("-nightly"); if (!SetLabel(XRCID("ID_VERSION"), version)) return false; wxStaticText* pHost = XRCCTRL(*this, "ID_HOST", wxStaticText); if (!pHost) return false; wxStaticText* pHostDesc = XRCCTRL(*this, "ID_HOST_DESC", wxStaticText); if (!pHostDesc) return false; wxString host = CBuildInfo::GetHostname(); if (host == _T("")) { pHost->Hide(); pHostDesc->Hide(); } else pHost->SetLabel(host); wxStaticText* pBuild = XRCCTRL(*this, "ID_BUILD", wxStaticText); if (!pBuild) return false; wxStaticText* pBuildDesc = XRCCTRL(*this, "ID_BUILD_DESC", wxStaticText); if (!pBuildDesc) return false; wxString build = CBuildInfo::GetBuildSystem(); if (build == _T("")) { pBuild->Hide(); pBuildDesc->Hide(); } else pBuild->SetLabel(build); if (!SetLabel(XRCID("ID_BUILDDATE"), CBuildInfo::GetBuildDateString())) return false; if (!SetLabel(XRCID("ID_COMPILEDWITH"), CBuildInfo::GetCompiler(), 200)) return false; wxStaticText* pCompilerFlags = XRCCTRL(*this, "ID_CFLAGS", wxStaticText); if (!pCompilerFlags) return false; wxStaticText* pCompilerFlagsDesc = XRCCTRL(*this, "ID_CFLAGS_DESC", wxStaticText); if (!pCompilerFlagsDesc) return false; wxString compilerFlags = CBuildInfo::GetCompilerFlags(); if (compilerFlags == _T("")) { pCompilerFlags->Hide(); pCompilerFlagsDesc->Hide(); } else { WrapText(this, compilerFlags, 200); pCompilerFlags->SetLabel(compilerFlags); } wxStaticText* pVer_wx = XRCCTRL(*this, "ID_VER_WX", wxStaticText); if (pVer_wx) pVer_wx->SetLabel(wxVERSION_NUM_DOT_STRING_T); wxStaticText* pVer_gnutls = XRCCTRL(*this, "ID_VER_GNUTLS", wxStaticText); if (pVer_gnutls) pVer_gnutls->SetLabel(GetDependencyVersion(dependency_gnutls)); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); return true; }