void NodeJSDebugger::OnDebugStart(clDebugEvent& event)
{
    event.Skip();
    CHECK_COND_RET(NodeJSWorkspace::Get()->IsOpen());

    // Our to handle
    event.Skip(false);
    if(m_socket && m_socket->IsConnected()) {
        Continue();
        return;
    };

    NodeJSDebuggerDlg dlg(EventNotifier::Get()->TopFrame(), NodeJSDebuggerDlg::kDebug);
    if(dlg.ShowModal() != wxID_OK) {
        return;
    }

    wxString command = dlg.GetCommand();

    if(!m_node.ExecuteConsole(command, "", false, command)) {
        ::wxMessageBox(_("Failed to start NodeJS application"), "CodeLite", wxOK | wxICON_ERROR | wxCENTER);
        m_socket.Reset(NULL);
    }

    // already connected?
    m_socket.Reset(new NodeJSSocket(this));
    NodeJSWorkspaceUser userConf(NodeJSWorkspace::Get()->GetFilename().GetFullPath());
    userConf.Load();
    m_socket->Connect("127.0.0.1", userConf.GetDebuggerPort());
}
Exemple #2
0
void ZDLInterface::importCurrentConfig(){
	LOGDATAO() << "Asking if they'd really like to import" << endl;
	QString text("Are you sure you'd like to <b>replace</b> the current <b>global</b> configurationw with the one currently loaded?");
	QMessageBox::StandardButton btnrc = QMessageBox::warning(this, ZDL_ENGINE_NAME, text, QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
	if(btnrc != QMessageBox::Yes){
		LOGDATAO() << "They said no, bailing" << endl;
		return;
	}
	ZDLConfiguration *conf = ZDLConfigurationManager::getConfiguration();
	ZDLConf *zconf = ZDLConfigurationManager::getActiveConfiguration();
	QString userConfPath = conf->getPath(ZDLConfiguration::CONF_USER);
	QFileInfo userConf(userConfPath);
	if(!userConf.exists()){
		LOGDATAO() << "File " << userConfPath << " doesn't exist" << endl;
		QDir dir = userConf.dir();
		if(!dir.exists()){
			LOGDATAO() << "Nor does it's path" << endl;
			if(!dir.mkpath(dir.absolutePath())){
				LOGDATAO() << "Couldn't create the path, bailing" << endl;
				QMessageBox::critical(this, ZDL_ENGINE_NAME, QString("Unable to create the directories for a global user configuration at ")+dir.absolutePath());
				return;
			}
		}
	}
	LOGDATAO() << "Triggering write" << endl;
	mw->writeConfig();
	if(zconf->writeINI(userConfPath) != 0){
		LOGDATAO() << "Couldn't write to configuration file " << userConfPath << endl;
		QMessageBox::critical(this, ZDL_ENGINE_NAME, QString("Unable to write the configuration file at ")+userConfPath);
		return;
	}
	ZDLConfigurationManager::setConfigFileName(userConfPath);
	LOGDATAO() << "Triggering read" << endl;
	mw->startRead();
}
void NodeJSBptManager::OnWorkspaceOpened(wxCommandEvent& event)
{
    event.Skip();
    m_workspaceFile.Clear();
    
    wxFileName fileName = event.GetString();
    if(FileExtManager::GetType(fileName.GetFullPath()) == FileExtManager::TypeWorkspaceNodeJS) {
        m_workspaceFile = fileName;
        NodeJSWorkspaceUser userConf(m_workspaceFile.GetFullPath());
        m_breakpoints = userConf.Load().GetBreakpoints();
    }
}
Exemple #4
0
void NodeJSDebugger::StartDebugger(const wxString& command, const wxString& workingDirectory)
{
    if(!m_node.ExecuteConsole(command, workingDirectory, true, command)) {
        ::wxMessageBox(_("Failed to start NodeJS application"), "CodeLite", wxOK | wxICON_ERROR | wxCENTER);
        m_socket.Reset(NULL);
    }

    // already connected?
    m_socket.Reset(new NodeJSSocket(this));
    NodeJSWorkspaceUser userConf(NodeJSWorkspace::Get()->GetFilename().GetFullPath());
    userConf.Load();
    m_socket->Connect("127.0.0.1", userConf.GetDebuggerPort());
}