Ejemplo n.º 1
0
wxString wxFormBuilder::GetWxFBPath()
{
	// Launch wxFB
	ConfFormBuilder confData;
	m_mgr->GetConfigTool()->ReadObject(wxT("wxFormBuilder"), &confData);
	wxString fbpath = confData.GetFbPath();

#ifdef __WXGTK__
	if (fbpath.IsEmpty()) {
		// try to locate the file at '/usr/bin' or '/usr/local/bin'
		if (wxFileName::FileExists(wxT("/usr/local/bin/wxformbuilder"))) {
			fbpath = wxT("/usr/local/bin/wxformbuilder");
		} else if (wxFileName::FileExists(wxT("/usr/bin/wxformbuilder"))) {
			fbpath = wxT("/usr/bin/wxformbuilder");
		}
	}
#endif

#ifdef __WXMSW__
	if (fbpath.IsEmpty()) {
		// try to locate the file at '/usr/bin' or '/usr/local/bin'
		if (wxFileName::FileExists(wxT("C:\\Program Files\\wxFormBuilder\\wxFormBuilder.exe"))) {
			fbpath = wxT("C:\\Program Files\\wxFormBuilder\\wxFormBuilder.exe");
		}
	}
#endif
	return fbpath;
}
Ejemplo n.º 2
0
void wxFormBuilder::DoLaunchWxFB(const wxString& file)
{
	wxString fbpath = GetWxFBPath();
	if (fbpath.IsEmpty()) {
		wxMessageBox(_("Failed to launch wxFormBuilder, no path specified\nPlease set wxFormBuilder path from Plugins -> wxFormBuilder -> Settings..."),
		             wxT("EmbeddedLite"), wxOK|wxCENTER|wxICON_WARNING);
		return;
	}
	ConfFormBuilder confData;
	m_mgr->GetConfigTool()->ReadObject(wxT("wxFormBuilder"), &confData);
	wxString cmd = confData.GetCommand();
	cmd.Replace(wxT("$(wxfb)"), fbpath);
	cmd.Replace(wxT("$(wxfb_project)"), wxString::Format(wxT("\"%s\""), file.c_str()));

	// Launch !
	wxExecute(cmd);
}
Ejemplo n.º 3
0
void wxFormBuilder::DoLaunchWxFB(const wxString& file)
{
    wxString fbpath = GetWxFBPath();
    //	if (fbpath.IsEmpty()) {
    //		wxMessageBox(_("Failed to launch wxFormBuilder, no path specified\nPlease set wxFormBuilder path from
    // Plugins
    //-> wxFormBuilder -> Settings..."),
    //		             _("CodeLite"), wxOK|wxCENTER|wxICON_WARNING);
    //		return;
    //	}
    ConfFormBuilder confData;
    m_mgr->GetConfigTool()->ReadObject(wxT("wxFormBuilder"), &confData);
    wxString cmd = confData.GetCommand();
    cmd.Replace(wxT("$(wxfb)"), fbpath);
    cmd.Replace(wxT("$(wxfb_project)"), wxString::Format(wxT("\"%s\""), file.c_str()));

    WrapInShell(cmd);
    CreateAsyncProcess(this, cmd, IProcessCreateWithHiddenConsole);
}