UIMyFrame1::UIMyFrame1(wxWindow* parent) :
		MyFrame1(parent) {

	wxString str = wxString::Format("Welcome to %s, running on %s",
	wxVERSION_STRING, wxGetOsDescription());
	m_staticText3->SetLabel(str);

	m_statusBar1->SetStatusText("This is status bar");

	m_staticText4->SetLabel(
			"wxWidgets is very easy to learn, it's C++ and fully OOP");

	m_staticText5->SetLabel(wxGetOsDescription());

}
Esempio n. 2
0
void AnalyticsSender::SendData(gd::String collection, SerializerElement & data)
{
    #if !defined(GD_NO_WX_GUI)
    //Check if we are allowed to send these data.
    bool sendInfo;
    wxConfigBase::Get()->Read("/Startup/SendInfo", &sendInfo, true);
    if (!sendInfo) return;

    data.SetAttribute("gdVersion", VersionWrapper::FullString());
    data.SetAttribute("os", gd::String(wxGetOsDescription()));
    data.SetAttribute("lang",
        gd::String(wxLocale::GetLanguageCanonicalName(LocaleManager::Get()->GetLanguage())));
    if (wxConfig::Get())
        data.SetAttribute("openingCount", wxConfig::Get()->ReadDouble("Startup/OpeningCount", 0));

    // Create request
    std::cout << "Sending analytics data..."; std::cout.flush();
    sf::Http Http;
    Http.setHost("http://api.keen.io");
    sf::Http::Request request;
    request.setMethod(sf::Http::Request::Post);
    request.setField("Content-Type", "application/json");
    request.setUri("/3.0/projects/"+projectId.ToLocale()+"/events/"+collection.ToLocale()+"?api_key="+writeKey.ToLocale());
    request.setBody(Serializer::ToJSON(data).ToSfString());

    // Send the request
    sf::Http::Response response = Http.sendRequest(request, sf::seconds(2));
    std::cout << "done (" << response.getStatus() << ")" << std::endl;
    #endif
}
Esempio n. 3
0
bool CaMuleExternalConnector::OnInit()
{
#ifndef __WINDOWS__ 
	#if wxUSE_ON_FATAL_EXCEPTION
		// catch fatal exceptions
		wxHandleFatalExceptions(true);
	#endif
#endif

	// If we didn't know that OnInit is called only once when creating the
	// object, it could cause a memory leak. The two pointers below should
	// be free()'d before assigning the new value.
	// cppcheck-suppress publicAllocationError
	m_strFullVersion = strdup((const char *)unicode2char(GetMuleVersion()));
	m_strOSDescription = strdup((const char *)unicode2char(wxGetOsDescription()));

	// Handle uncaught exceptions
	InstallMuleExceptionHandler();

	bool retval = wxApp::OnInit();
	OnInitCommandSet();
	InitCustomLanguages();
	SetLocale(m_language);
	return retval;
}
Esempio n. 4
0
void CCTestFrame::OnMenuAboutSelected(wxCommandEvent& /*event*/)
{
    wxString str;
    str.Printf(_("CCTest build with %s!\nRunning under %s."),
               wxVERSION_STRING, wxGetOsDescription().c_str());
    wxMessageBox(str, _("About CCTest"), wxOK | wxICON_INFORMATION, this);
}
Esempio n. 5
0
wxThread::ExitCode SendStatsThread::Entry()
{
	std::cout << m_url << std::endl;

	struct mg_mgr mgr;
	struct mg_connection *nc;

	mg_mgr_init(&mgr, this);

	std::string user_agent = "User-Agent: " + wxGetOsDescription().ToStdString() + "\r\n";
	std::cout << user_agent << std::endl;
	nc = mg_connect_http(&mgr, SendStatsThread::ev_handler, m_url.c_str(), user_agent.c_str(), NULL); // GET

    if (nc != nullptr)
    {
	    mg_set_protocol_http_websocket(nc);

	    time_t ts_start = time(NULL);
	    time_t ts_end = ts_start;
	    this->m_end = false;

	    while (!this->m_end)
	    {
		    if ((ts_end - ts_start) >= 1) // 1 sec
		    {
			    std::cout << "timeout" << std::endl;
			    break;
		    }
		    ts_end = mg_mgr_poll(&mgr, 1000);
	    }
    }
	mg_mgr_free(&mgr);

	return nullptr;
}
Esempio n. 6
0
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
      wxChar buf[300];
      wxString platform = wxGetOsDescription();
      wxSnprintf(buf, sizeof(buf), _T("Tex2RTF Version %.2f %s\nLaTeX to RTF, WinHelp, and HTML Conversion\n\n(c) Julian Smart, George Tasker and others, 1999-2005"), versionNo, platform.c_str());
      wxMessageBox(buf, _T("About Tex2RTF"));
}
Esempio n. 7
0
void wxPlatformInfo::InitForCurrentPlatform()
{
    m_initializedForCurrentPlatform = true;

    // autodetect all informations
    const wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
    if ( !traits )
    {
        wxFAIL_MSG( wxT("failed to initialize wxPlatformInfo") );

        m_port = wxPORT_UNKNOWN;
        m_usingUniversal = false;
        m_tkVersionMajor =
                m_tkVersionMinor = 0;
    }
    else
    {
        m_port = traits->GetToolkitVersion(&m_tkVersionMajor, &m_tkVersionMinor);
        m_usingUniversal = traits->IsUsingUniversalWidgets();
        m_desktopEnv = traits->GetDesktopEnvironment();
    }

    m_os = wxGetOsVersion(&m_osVersionMajor, &m_osVersionMinor);
    m_osDesc = wxGetOsDescription();
    m_endian = wxIsPlatformLittleEndian() ? wxENDIAN_LITTLE : wxENDIAN_BIG;
    m_arch = wxIsPlatform64Bit() ? wxARCH_64 : wxARCH_32;

#ifdef __LINUX__
    m_ldi = wxGetLinuxDistributionInfo();
#endif
    // else: leave m_ldi empty
}
Esempio n. 8
0
int GetSystem()
{
	wxString oslabel = wxGetOsDescription();
	if(oslabel.StartsWith("Windows")) return 1;
	if(oslabel.StartsWith("Mac") || oslabel.StartsWith("mac")) return 2;
	if(oslabel.StartsWith("Linux")) return 3;
	return 0;
}
/**
 * ヘルプを押した際のイベント
 */
void HelloWorld::OnAbout(wxCommandEvent& event) {

     wxString message = wxVERSION_STRING;
     message += wxT("にようこそ!\n\nこれはwxWidgetsの最小アプリです\n");
     message += wxGetOsDescription();
     message += wxT("環境で動作しています\n\n");
     message += wxGetHomeDir();

     wxMessageBox(message, wxT("このアプリケーションについて"), wxOK | wxICON_INFORMATION, this);
}
Esempio n. 10
0
// about window for the frame
void OPJFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
#ifdef OPJ_HTMLABOUT
#include "about_htm.h"
#include "opj_logo.xpm"

    wxBoxSizer *topsizer;
    wxHtmlWindow *html;
    wxDialog dlg(this, wxID_ANY, wxString(_("About")));

    wxMemoryFSHandler::AddFile(wxT("opj_logo.xpm"), wxBitmap(opj_logo), wxBITMAP_TYPE_XPM);

    topsizer = new wxBoxSizer(wxVERTICAL);

    html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(320, 250), wxHW_SCROLLBAR_NEVER);
    html->SetBorders(0);
    //html->LoadPage(wxT("about/about.htm"));
	//html->SetPage("<html><body>Hello, world!</body></html>");
	html->SetPage(htmlaboutpage);
    html->SetSize(html->GetInternalRepresentation()->GetWidth(),
                    html->GetInternalRepresentation()->GetHeight());

    topsizer->Add(html, 1, wxALL, 10);

    topsizer->Add(new wxStaticLine(&dlg, wxID_ANY), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);

    wxButton *bu1 = new wxButton(&dlg, wxID_OK, wxT("OK"));
    bu1->SetDefault();

    topsizer->Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15);

    dlg.SetSizer(topsizer);
    topsizer->Fit(&dlg);

    dlg.ShowModal();

#else

	wxMessageBox(wxString::Format(OPJ_APPLICATION_TITLEBAR
								  wxT("\n\n")
								  wxT("Built with %s and OpenJPEG ")
								  wxT(OPENJPEG_VERSION)
								  wxT("\non ") wxT(__DATE__) wxT(", ") wxT(__TIME__)
								  wxT("\nRunning under %s\n\n")
								  OPJ_APPLICATION_COPYRIGHT,
								  wxVERSION_STRING,
								  wxGetOsDescription().c_str()),
				 wxT("About ") OPJ_APPLICATION_NAME,
				 wxOK | wxICON_INFORMATION,
				 this
				 );

#endif

}
Esempio n. 11
0
int main(int argc,char **argv)
{
	wxPuts(wxGetHomeDir());
	wxPuts(wxGetOsDescription());
	wxPuts(wxGetUserName());
	wxPuts(wxGetFullHostName());

	long mem = wxGetFreeMemory().ToLong();
	wxPrintf(wxT("Memory: %d\n"),mem);
	return 0;
}
Esempio n. 12
0
void cCLFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
	wxMessageBox(wxString::Format(
		_T("This is the ComLaser App\n")
		_T("running under %s."),
		wxGetOsDescription().c_str()
		),
		_T("About ComLaser"),
		wxOK | wxICON_INFORMATION,
		this);
}
Esempio n. 13
0
void DecisionLogicFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
    wxMessageBox(wxString::Format(
        _T("This is DecisionLogic v")
		_T(VERSION)
        _T(" running under %s.\nCoded by Eric D. Schmidt\n(c) 2008 - 2015 DigiRule Solutions LLC"),
        wxGetOsDescription().c_str()
     ),
     _T("About DecisionLogic"),
     wxOK | wxICON_INFORMATION,
     this);
}
Esempio n. 14
0
int t04()
{
    wxPuts(wxGetHomeDir());
    wxPuts(wxGetOsDescription());
    wxPuts(wxGetUserName());
    wxPuts(wxGetFullHostName());

    wxMemorySize mem = wxGetFreeMemory();

    wxPrintf(wxT("Memory: %s\n"), mem.ToString());
    return EXIT_SUCCESS;
}
Esempio n. 15
0
void FrontEnd::OnAbout(wxCommandEvent& WXUNUSED(event))
{
    wxMessageBox(wxString::Format(
                    _T("VOD System Client\n")
                    _T("Using wxWidget %s\n")
                    _T("Now running under %s."),
                    wxVERSION_STRING,
                    wxGetOsDescription().c_str()
                 ),
                 _T("About this program"),
                 wxOK | wxICON_INFORMATION,
                 this);
}
Esempio n. 16
0
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
    wxMessageBox(wxString::Format(
                    _T("Welcome to %s!\n")
                    _T("\n")
                    _T("This is the minimal wxWidgets sample\n")
                    _T("running under %s."),
                    wxVERSION_STRING,
                    wxGetOsDescription().c_str()
                 ),
                 _T("About wxWidgets minimal sample"),
                 wxOK | wxICON_INFORMATION,
                 this);
}
Esempio n. 17
0
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
    wxMessageBox(wxString::Format(
                    wxT("Welcome to %s!\n")
                    wxT("\n")
                    wxT("This is the wxWidgets wxComboCtrl and wxOwnerDrawnComboBox sample\n")
                    wxT("running under %s."),
                    wxVERSION_STRING,
                    wxGetOsDescription().c_str()
                 ),
                 wxT("About wxComboCtrl sample"),
                 wxOK | wxICON_INFORMATION,
                 this);
}
Esempio n. 18
0
SpringDebugReport::SpringDebugReport()
	: NetDebugReport( "http://infologs.springrts.com/upload" )
{
	wxString tmp_filename = wxPathOnly( wxFileName::CreateTempFileName(_T("dummy")) ) + wxFileName::GetPathSeparator() + _T("settings.txt");
	wxCopyFile(TowxString(SlPaths::GetSpringConfigFilePath()), tmp_filename );
	AddFile( tmp_filename, _T("Settings") );

	AddVFSFile( _T("infolog.txt"),		_T("Infolog") );
	AddVFSFile( _T("script.txt"),		_T("Script") );
	AddVFSFile( _T("ext.txt"),			_T("Extensions") );
	AddVFSFile( _T("unitsync.log"),		_T("unitsync") );

	wxString info;
	info << wxGetOsDescription() << ( wxIsPlatform64Bit() ? _T(" 64bit\n") : _T(" 32bit\n") );
	AddText( _T("platform.txt"), info, _T("Platform") );
	AddText( _T("client.txt"), _T( "SpringLobby " ) + TowxString(GetSpringLobbyVersion()), _T("Client") );
	AddText( _T("appname.txt"), TowxString(getSpringlobbyName()), _T("Application Name"));
}
Esempio n. 19
0
void InteractiveOutputTestCase::TestOsInfo()
{
#ifdef TEST_INFO_FUNCTIONS
    wxPuts(wxT("*** Testing OS info functions ***\n"));

    int major, minor;
    wxGetOsVersion(&major, &minor);
    wxPrintf(wxT("Running under: %s, version %d.%d\n"),
            wxGetOsDescription().c_str(), major, minor);

    wxPrintf(wxT("%ld free bytes of memory left.\n"), wxGetFreeMemory().ToLong());

    wxPrintf(wxT("Host name is %s (%s).\n"),
           wxGetHostName().c_str(), wxGetFullHostName().c_str());

    wxPuts(wxEmptyString);
#endif // TEST_INFO_FUNCTIONS
}
Esempio n. 20
0
int main( int argc, char** argv )
{
    // initialize wxWidgets
    wxInitializer init;

    wxPrintf( wxT("Hello in wxWidgets World!\n\n") );

    // print some system info...
    wxPuts(wxGetHomeDir());
    wxPuts(wxGetOsDescription());
    wxPuts(wxGetUserName());
    wxPuts(wxGetFullHostName());

    long mem = wxGetFreeMemory().ToLong();
    wxPrintf(wxT("Memory: %ld\n"), mem);

    return 0;
}
Esempio n. 21
0
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
    wxMessageBox(wxString::Format(
                    _T("Welcome to biwoo client!\n")
                    _T("\n")
                    _T("This is the open source enterprise communication application \n")
                    _T("running under %s.\n")
                    _T("\n")
					_T("Version 1.0.4\n")
					_T("Copyright (C)2009-2010 [email protected]\n")
					_T("All rights reserved.\n")
                    _T("\n")
					_T("http://code.google.com/p/biwoo/ \n"),
                    wxGetOsDescription().c_str()
                 ),
                 _T("About biwoo client"),
                 wxOK | wxICON_INFORMATION,
                 this);
}
Esempio n. 22
0
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;
}
Esempio n. 23
0
bool wxDebugReport::DoAddSystemInfo(wxXmlNode *nodeSystemInfo)
{
    nodeSystemInfo->AddAttribute(wxT("description"), wxGetOsDescription());

    return true;
}
Esempio n. 24
0
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();
}
Esempio n. 25
0
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;
}
Esempio n. 26
0
void creeperFrame::OnAbout(wxCommandEvent &event)/*{{{*/
{
    wxString msg = _("Creeper for 8comic!\nYour sys:\t") + wxGetOsDescription();
    wxMessageBox(msg, _("Welcome to..."));
}/*}}}*/
Esempio n. 27
0
bool wxGISApplication::SetupLog(const wxString &sLogPath, const wxString &sNamePrefix)
{
	if(sLogPath.IsEmpty())
	{
		wxLogError(_("wxGISApplication: Failed to get log folder"));
        return false;
	}

	if(!wxDirExists(sLogPath))
		wxFileName::Mkdir(sLogPath, 0777, wxPATH_MKDIR_FULL);


	wxDateTime dt(wxDateTime::Now());
	wxString logfilename = sLogPath + wxFileName::GetPathSeparator() + wxString::Format(wxT("%slog_%.4d%.2d%.2d.log"),sNamePrefix.c_str(), dt.GetYear(), dt.GetMonth() + 1, dt.GetDay());

    if(m_LogFile.IsOpened())
        m_LogFile.Close();

	if(!m_LogFile.Open(logfilename.GetData(), wxT("a+")))
		wxLogError(_("wxGISApplication: Failed to open log file %s"), logfilename.c_str());

	wxLog::SetActiveTarget(new wxLogStderr(m_LogFile.fp()));

#ifdef WXGISPORTABLE
	wxLogMessage(wxT("Portable"));
#endif
	wxLogMessage(wxT(" "));
	wxLogMessage(wxT("####################################################################"));
	wxLogMessage(wxT("##                    %s                    ##"),wxNow().c_str());
	wxLogMessage(wxT("####################################################################"));
    wxLongLong nFreeMem = wxGetFreeMemory();
    wxString sFreeMem = wxFileName::GetHumanReadableSize(wxULongLong(nFreeMem.GetHi(), nFreeMem.GetLo()));
//	long dFreeMem =  wxMemorySize(wxGetFreeMemory() / 1048576).ToLong();
	wxLogMessage(_("HOST '%s': OS desc - %s, free memory - %s"), wxGetFullHostName().c_str(), wxGetOsDescription().c_str(), sFreeMem.c_str());
	wxLogMessage(_("wxGISApplication: %s %s is initializing..."), GetAppName().c_str(), GetAppVersionString().c_str());
	wxLogMessage(_("wxGISApplication: Log file: %s"), logfilename.c_str());

    return true;
}
Esempio n. 28
0
void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent&  event )
{
    if( !wxTheClipboard->Open() )
    {
        wxMessageBox( _( "Could not open clipboard to write version information." ),
                      _( "Clipboard Error" ), wxOK | wxICON_EXCLAMATION, this );
        return;
    }

    wxString tmp;
    wxPlatformInfo info;

    tmp = wxT( "Application: " ) + Pgm().App().GetAppName() + wxT( "\n" );
    tmp << wxT( "Version: " ) << GetBuildVersion()
#ifdef DEBUG
        << wxT( " Debug" )
#else
        << wxT( " Release" )
#endif
        << wxT( " build\n" );
    tmp << wxT( "wxWidgets: Version " ) << FROM_UTF8( wxVERSION_NUM_DOT_STRING )
        << FROM_UTF8( KICAD_BUILD_OPTIONS_SIGNATURE() ) << wxT( "\n" )
        << wxT( "Platform: " ) << wxGetOsDescription() << wxT( ", " )
        << info.GetArchName() << wxT( ", " ) << info.GetEndiannessName() << wxT( ", " )
        << info.GetPortIdName() << wxT( "\n" );

    // Just in case someone builds KiCad with the platform native of Boost instead of
    // the version included with the KiCad source.
    tmp << wxT( "Boost version: " ) << ( BOOST_VERSION / 100000 ) << wxT( "." )
        << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." ) << ( BOOST_VERSION % 100 ) << wxT( "\n" );

    tmp << wxT( "         USE_WX_GRAPHICS_CONTEXT=" );
#ifdef USE_WX_GRAPHICS_CONTEXT
    tmp << wxT( "ON\n" );
#else
    tmp << wxT( "OFF\n" );
#endif

    tmp << wxT( "         USE_WX_OVERLAY=" );
#ifdef USE_WX_OVERLAY
    tmp << wxT( "ON\n" );
#else
    tmp << wxT( "OFF\n" );
#endif

    tmp << wxT( "         KICAD_SCRIPTING=" );
#ifdef KICAD_SCRIPTING
    tmp << wxT( "ON\n" );
#else
    tmp << wxT( "OFF\n" );
#endif

    tmp << wxT( "         KICAD_SCRIPTING_MODULES=" );
#ifdef KICAD_SCRIPTING_MODULES
    tmp << wxT( "ON\n" );
#else
    tmp << wxT( "OFF\n" );
#endif

    tmp << wxT( "         KICAD_SCRIPTING_WXPYTHON=" );
#ifdef KICAD_SCRIPTING_WXPYTHON
    tmp << wxT( "ON\n" );
#else
    tmp << wxT( "OFF\n" );
#endif

    tmp << wxT( "         USE_FP_LIB_TABLE=HARD_CODED_ON\n" );

    tmp << wxT( "         BUILD_GITHUB_PLUGIN=" );
#ifdef BUILD_GITHUB_PLUGIN
    tmp << wxT( "ON\n" );
#else
    tmp << wxT( "OFF\n" );
#endif

    wxMessageBox( tmp, _("Version Information (copied to the clipboard)") );

    wxTheClipboard->SetData( new wxTextDataObject( tmp ) );
    wxTheClipboard->Close();
}
Esempio n. 29
0
void dbUpgrade::SqlFileDebug(wxSQLite3Database * db)
{
    wxFileDialog fileDlgLoad(nullptr,_("Load debug file"),"","","MMDBG Files(*.mmdbg) | *.mmdbg", wxFD_OPEN | wxFD_FILE_MUST_EXIST);
    if (fileDlgLoad.ShowModal() != wxID_OK)
        return;

    wxString filePath = fileDlgLoad.GetPath();
    if (wxFileName(filePath).GetExt().MakeLower() != "mmdbg")
    {
        wxMessageBox(_("Wrong file type!"), _("MMEX debug error"), wxOK | wxICON_ERROR);
        return;
    }

    wxTextFile txtFile;
    txtFile.Open(filePath);

    if (txtFile.GetFirstLine().Contains("-- MMEX Debug SQL - Read --"))
    {
        wxString txtLine, txtLog = "";

        txtLog << wxString::Format("MMEX Version: %s", mmex::version::string) + wxTextFile::GetEOL();
        txtLog << wxString::Format("DB Version: %i", dbUpgrade::GetCurrentVersion(db)) + wxTextFile::GetEOL();
        txtLog << wxString::Format("Operating System: %s", wxGetOsDescription()) + wxTextFile::GetEOL() + wxTextFile::GetEOL();

        for (txtLine = txtFile.GetNextLine(); !txtFile.Eof(); txtLine = txtFile.GetNextLine())
        {
            txtLog << wxTextFile::GetEOL() << "=== Query ===" << wxTextFile::GetEOL() << txtLine << wxTextFile::GetEOL();

            wxSQLite3Statement stmt = db->PrepareStatement(txtLine);
            if (stmt.IsReadOnly())
            {
                try
                {
                    wxSQLite3ResultSet rs = stmt.ExecuteQuery();
                    int columnCount = rs.GetColumnCount();
                    txtLog << "=== Result ===" << wxTextFile::GetEOL();
                    while (rs.NextRow())
                    {
                        wxString strRow = "";
                        for (int i = 0; i < columnCount; ++i)
                            strRow << "'" + rs.GetAsString(i) + "'   ";
                        txtLog << strRow + wxTextFile::GetEOL();
                    }
                }
                catch (const wxSQLite3Exception& e)
                {
                    wxMessageBox(_("Query error, please contact MMEX support!") + "\n\n" + e.GetMessage(), _("MMEX debug error"), wxOK | wxICON_ERROR);
                    return;
                }
                
            }
            else
            {
                wxMessageBox(_("Invalid file content, please contact MMEX support!"), _("MMEX debug error"), wxOK | wxICON_ERROR);
                return;
            }
        }

        txtLog << wxTextFile::GetEOL() << wxTextFile::GetEOL() << wxTextFile::GetEOL() << mmex::getProgramDescription();

        wxTextEntryDialog dlg(nullptr, _("Send this log to MMEX support team:\npress OK to save to file or Cancel to exit"),
            _("MMEX debug"), txtLog, wxOK | wxCANCEL | wxCENTRE | wxTE_MULTILINE);
        if (dlg.ShowModal() == wxID_OK)
        {
            wxFileDialog fileDlgSave(nullptr, _("Save debug file"), "", "", "*.txt", wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
            if (fileDlgSave.ShowModal() == wxID_OK)
            {
                wxFile file(fileDlgSave.GetPath(), wxFile::write);
                if (file.IsOpened())
                {
                    file.Write(txtLog);
                    file.Close();
                }
            }
        }
    }
    else if (txtFile.GetFirstLine().Contains("-- MMEX Debug SQL - Update --"))
    {
        db->Savepoint("MMEX_Debug");
        wxString txtLine;
        for (txtLine = txtFile.GetNextLine(); !txtFile.Eof(); txtLine = txtFile.GetNextLine())
        {
            try
            {
                wxSQLite3Statement stmt = db->PrepareStatement(txtLine);
                stmt.ExecuteUpdate();
            }
            catch (const wxSQLite3Exception& e)
            {
                wxMessageBox(_("Query error, please contact MMEX support!") + "\n\n" + e.GetMessage(), _("MMEX debug error"), wxOK | wxICON_ERROR);
                db->Rollback("MMEX_Debug");
                return;
            }
        }
        db->ReleaseSavepoint("MMEX_Debug");
        wxMessageBox(_("DB maintenance completed, please close and re-open MMEX!"), _("MMEX debug"), wxOK | wxICON_INFORMATION);
    }
    else
    {
        wxMessageBox(_("Invalid file content, please contact MMEX support!"), _("MMEX debug error"), wxOK | wxICON_ERROR);
        return;
    }
}
Esempio n. 30
0
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();
}