void PhpPlugin::OnFileSaved(clCommandEvent& e) { e.Skip(); // Check to see if we got a remote-upload setup SSHWorkspaceSettings settings; settings.Load(); if(settings.IsRemoteUploadSet() && settings.IsRemoteUploadEnabled()) { // Post an event to the SFTP plugin and ask it to save our file wxFileName fnLocalFile(e.GetString()); fnLocalFile.MakeRelativeTo(PHPWorkspace::Get()->GetFilename().GetPath()); fnLocalFile.MakeAbsolute(wxFileName(settings.GetRemoteFolder(), "", wxPATH_UNIX).GetPath()); wxString remoteFile = fnLocalFile.GetFullPath(wxPATH_UNIX); wxString localFile = e.GetString(); JSONRoot root(cJSON_Object); root.toElement().addProperty("account", settings.GetAccount()); root.toElement().addProperty("local_file", localFile); root.toElement().addProperty("remote_file", remoteFile); clCommandEvent eventSave(XRCID("wxEVT_SFTP_SAVE_FILE")); eventSave.SetString(root.toElement().format()); EventNotifier::Get()->AddPendingEvent(eventSave); } }
void WorkspacePane::OnToggleWorkspaceTab(clCommandEvent& event) { // Handle the core tabs if(m_tabs.count(event.GetString()) == 0) { event.Skip(); return; } const Tab& t = m_tabs.find(event.GetString())->second; if(event.IsSelected()) { // Insert the page int where = clTabTogglerHelper::IsTabInNotebook(GetNotebook(), t.m_label); if(where == wxNOT_FOUND) { GetNotebook()->AddPage(t.m_window, t.m_label, false, t.m_bmp); } else { GetNotebook()->SetSelection(where); } } else { // hide the tab int where = GetNotebook()->GetPageIndex(t.m_label); if(where != wxNOT_FOUND) { GetNotebook()->RemovePage(where); } } }
void NodeJSDebugger::OnNodeOutput(clCommandEvent& event) { wxUnusedVar(event); CL_DEBUG("Node debugger:\n%s", event.GetString()); clDebugEvent eventLog(wxEVT_NODEJS_DEBUGGER_CONSOLE_LOG); eventLog.SetString(event.GetString()); EventNotifier::Get()->AddPendingEvent(eventLog); }
void NodeJSWorkspace::OnNewWorkspace(clCommandEvent& e) { e.Skip(); if(e.GetString() == GetWorkspaceType()) { e.Skip(false); // Create a new NodeJS workspace NodeJSNewWorkspaceDlg dlg(NULL); if(dlg.ShowModal() != wxID_OK) return; wxFileName workspaceFile = dlg.GetWorkspaceFilename(); if(!workspaceFile.GetDirCount()) { ::wxMessageBox( _("Can not create workspace in the root folder"), _("New Workspace"), wxICON_ERROR | wxOK | wxCENTER); return; } // Ensure that the path the workspace exists workspaceFile.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL); if(!Create(workspaceFile)) { ::wxMessageBox(_("Failed to create workspace\nWorkspace already exists"), _("New Workspace"), wxICON_ERROR | wxOK | wxCENTER); return; } Open(workspaceFile); } }
void NodeJSSocket::OnSocketConnectError(clCommandEvent& event) { CL_DEBUG("CodeLite >>>> connect error"); m_errorString = event.GetString(); m_debugger->CallAfter(&NodeJSDebugger::ConnectError, m_errorString); Destroy(); }
void NodeJSSocket::OnSocketInput(clCommandEvent& event) { CL_DEBUG("CodeLite >>>> Got something on the socket..."); m_inBuffer << event.GetString(); CL_DEBUG("Node.js <<<< %s", m_inBuffer); ProcessInputBuffer(); }
void NodeJSSocket::OnSocketError(clCommandEvent& event) { m_errorString = event.GetString(); CL_DEBUG("Socket error: %s", m_errorString); Destroy(); m_debugger->CallAfter(&NodeJSDebugger::ConnectionLost, m_errorString); }
void clTabTogglerHelper::OnToggleWorkspaceTab(clCommandEvent& event) { if(event.GetString() != m_workspaceTabName) { event.Skip(); return; } Notebook* book = clGetManager()->GetWorkspacePaneNotebook(); if(event.IsSelected()) { // show it int where = IsTabInNotebook(book, m_workspaceTabName); if(where == wxNOT_FOUND) { // Only show it if it does not exists in the notebook clGetManager()->GetWorkspacePaneNotebook()->AddPage(m_workspaceTab, m_workspaceTabName, false, m_workspaceTabBmp); } else { // The tab already in the notebook, just select it clGetManager()->GetWorkspacePaneNotebook()->SetSelection(where); } } else { int where = clGetManager()->GetWorkspacePaneNotebook()->GetPageIndex(m_workspaceTabName); if(where != wxNOT_FOUND) { clGetManager()->GetWorkspacePaneNotebook()->RemovePage(where); } } }
void PHPWorkspace::OnProjectSyncEnd(clCommandEvent& event) { const wxString& name = event.GetString(); if(m_inSyncProjects.count(name) == 0) { clWARNING() << "PHPWorkspace::OnProjectSyncEnd: unable to find project '" << name << "' in the workspace..." << clEndl; return; } clDEBUG() << "PHPWorkspace::OnProjectSyncEnd: project" << name << "completed sync" << clEndl; m_inSyncProjects.erase(name); // Load the project PHPProject::Ptr_t pProj = GetProject(name); CHECK_PTR_RET(pProj); // Update the project files pProj->SetFiles(event.GetStrings()); if(m_inSyncProjects.empty()) { clDEBUG() << "PHPWorkspace::OnProjectSyncEnd: all projects completed sync" << clEndl; if(m_projectSyncOwner) { clCommandEvent endEvent(wxEVT_PHP_WORKSPACE_FILES_SYNC_END); m_projectSyncOwner->AddPendingEvent(endEvent); } } }
void PhpPlugin::OnFindInFilesDismissed(clCommandEvent& e) { e.Skip(); if(PHPWorkspace::Get()->IsOpen()) { // store the find in files mask PHPConfigurationData conf; conf.Load().SetFindInFilesMask(e.GetString()).Save(); } }
void ZoomNavigator::OnFileSaved(clCommandEvent& e) { e.Skip(); if(e.GetString() == m_curfile) { // Update the file content m_curfile.Clear(); DoUpdate(); } }
void SFTP::OnFileSaved(clCommandEvent& e) { e.Skip(); // -------------------------------------- // Sanity // -------------------------------------- wxString local_file = e.GetString(); local_file.Trim().Trim(false); DoFileSaved(local_file); }
void WorkspaceTab::OnProjectAdded(clCommandEvent& e) { e.Skip(); const wxString& projName = e.GetString(); m_fileView->BuildTree(); if(!projName.IsEmpty()) { m_fileView->ExpandToPath(projName, wxFileName()); } DoUpdateChoiceWithProjects(); SendCmdEvent(wxEVT_FILE_VIEW_REFRESHED); }
void OutputPane::OnToggleTab(clCommandEvent& event) { // Handle the core tabs if(m_tabs.count(event.GetString()) == 0) { event.Skip(); return; } const Tab& t = m_tabs.find(event.GetString())->second; if(event.IsSelected()) { // Insert the page GetNotebook()->InsertPage(0, t.m_window, t.m_label, true, t.m_bmp); } else { // hide the tab int where = GetNotebook()->GetPageIndex(t.m_label); if(where != wxNOT_FOUND) { GetNotebook()->RemovePage(where); } } }
void WebUpdateJob::OnSocketInput(clCommandEvent& e) { m_dataRead << e.GetString(); int where = m_dataRead.Find("\r\n\r\n"); if(where != wxNOT_FOUND) { wxString headers = m_dataRead.Mid(0, where); m_dataRead = m_dataRead.Mid(where + 4); ParseFile(); Clear(); } }
void TerminalEmulatorUI::OnProcessOutput(clCommandEvent& e) { e.Skip(); m_stc->SetReadOnly(false); m_stc->AppendText(e.GetString()); m_stc->SetReadOnly(true); int lastPos = m_stc->GetLastPosition(); m_stc->SetCurrentPos(lastPos); m_stc->SetSelectionStart(lastPos); m_stc->SetSelectionEnd(lastPos); m_stc->ScrollToEnd(); }
void PhpPlugin::OnNewWorkspace(clCommandEvent& e) { e.Skip(); if(e.GetString() == PHPWorkspace::Get()->GetWorkspaceType()) { e.Skip(false); // Create a PHP workspace NewPHPWorkspaceDlg newWspDlg(m_mgr->GetTheApp()->GetTopWindow()); if(newWspDlg.ShowModal() == wxID_OK) { PHPWorkspace::Get()->Create(newWspDlg.GetWorkspacePath()); DoOpenWorkspace(newWspDlg.GetWorkspacePath(), false /* create if missing */, newWspDlg.IsCreateProject()); } } }
void DatabaseExplorer::OnToggleTab(clCommandEvent& event) { if(event.GetString() != _("DbExplorer")) { event.Skip(); return; } if(event.IsSelected()) { // show it clGetManager()->GetWorkspacePaneNotebook()->AddPage(m_dbViewerPanel, _("DbExplorer"), true); } else { int where = m_mgr->GetWorkspacePaneNotebook()->GetPageIndex(_("DbExplorer")); if(where != wxNOT_FOUND) { clGetManager()->GetWorkspacePaneNotebook()->RemovePage(where); } } }
void SymbolViewPlugin::OnToggleTab(clCommandEvent& event) { if(event.GetString() != _("Outline")) { event.Skip(); return; } if(event.IsSelected()) { // show it m_mgr->GetWorkspacePaneNotebook()->AddPage(m_view, _("Outline"), true); } else { int where = m_mgr->GetWorkspacePaneNotebook()->GetPageIndex(_("Outline")); if(where != wxNOT_FOUND) { m_mgr->GetWorkspacePaneNotebook()->RemovePage(where); } } }
void CMakePlugin::OnFileRemoved(clCommandEvent& event) { event.Skip(); CHECK_COND_RET(clCxxWorkspaceST::Get()->IsOpen()); // The affected project is passed in the string member of the event ProjectPtr p = clCxxWorkspaceST::Get()->GetProject(event.GetString()); CHECK_PTR_RET(p); BuildConfigPtr buildConf = p->GetBuildConfiguration(); CHECK_COND_RET(buildConf); // Ensure we are a CMake project CHECK_COND_RET(buildConf->GetBuilder()->GetName() == "CMake"); DoRunCMake(p); }
void ZoomNavigator::OnToggleTab(clCommandEvent& event) { if(event.GetString() != ZOOM_PANE_TITLE) { event.Skip(); return; } if(event.IsSelected()) { // show it m_mgr->GetWorkspacePaneNotebook()->InsertPage(0, zoompane, ZOOM_PANE_TITLE, true); } else { int where = m_mgr->GetWorkspacePaneNotebook()->GetPageIndex(ZOOM_PANE_TITLE); if(where != wxNOT_FOUND) { m_mgr->GetWorkspacePaneNotebook()->RemovePage(where); } } }
void CMakePlugin::OnToggleHelpTab(clCommandEvent& event) { if(event.GetString() != HELP_TAB_NAME) { event.Skip(); return; } if(event.IsSelected()) { // show it cmakeImages images; const wxBitmap& bmp = images.Bitmap("cmake_16"); m_mgr->GetWorkspacePaneNotebook()->InsertPage(0, m_helpTab, HELP_TAB_NAME, true, bmp); } else { int where = m_mgr->GetWorkspacePaneNotebook()->GetPageIndex(HELP_TAB_NAME); if(where != wxNOT_FOUND) { m_mgr->GetWorkspacePaneNotebook()->RemovePage(where); } } }
void NavBar::OnFileSaved(clCommandEvent& e) { e.Skip(); // sanity if(!ManagerST::Get()->IsWorkspaceOpen()) return; // get the active editor LEditor* editor = clMainFrame::Get()->GetMainBook()->GetActiveEditor(); if(!editor) return; // is this the current file? wxFileName fn(e.GetString()); if(fn != editor->GetFileName()) { return; } // The save was for the active file, re-popuplate the tags in the navigation bar DoPopulateTags(fn); }
void PhpPlugin::OnNewWorkspace(clCommandEvent& e) { e.Skip(); if(e.GetString() == PHPWorkspace::Get()->GetWorkspaceType()) { e.Skip(false); // Create a PHP workspace NewPHPWorkspaceDlg newWspDlg(m_mgr->GetTheApp()->GetTopWindow()); if(newWspDlg.ShowModal() == wxID_OK) { // Ensure that the workspace path exists wxFileName workspaceFile(newWspDlg.GetWorkspacePath()); if(!workspaceFile.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL)) { ::wxMessageBox(wxString::Format(_("Could not create workspace folder:\n%s"), workspaceFile.GetPath()), "CodeLite", wxICON_ERROR | wxOK | wxCENTER); return; } PHPWorkspace::Get()->Create(newWspDlg.GetWorkspacePath()); DoOpenWorkspace(newWspDlg.GetWorkspacePath(), false /* create if missing */, newWspDlg.IsCreateProject()); } } }
void PhpPlugin::OnFileSaved(clCommandEvent& e) { e.Skip(); if(PHPWorkspace::Get()->IsOpen()) { DoSyncFileWithRemote(e.GetString()); } // Run php lint IEditor* editor = m_mgr->GetActiveEditor(); CHECK_PTR_RET(editor); PHPConfigurationData conf; conf.Load(); if(::IsPHPFile(editor) && conf.IsRunLint()) { if(m_mgr->GetActiveEditor()) { m_mgr->GetActiveEditor()->DelAllCompilerMarkers(); } m_lint->CheckCode(e.GetFileName()); } }
void NewBuildTab::OnBuildAddLine(clCommandEvent& e) { e.Skip(); // Allways call skip.. m_output << e.GetString(); DoProcessOutput(false, false); }
void MemCheckPlugin::OnProcessOutput(clCommandEvent& event) { m_mgr->AppendOutputTabText(kOutputTab_Output, event.GetString()); }
void NodeJSWorkspace::OnProcessOutput(clCommandEvent& event) { clGetManager()->AppendOutputTabText(kOutputTab_Output, event.GetString()); }
void SSHTerminal::OnSshOutput(clCommandEvent& event) { AppendText(event.GetString()); m_textCtrl1->CallAfter(&wxTextCtrl::SetFocus); }
void SSHTerminal::OnSshCommandDoneWithError(clCommandEvent& event) { AppendText(event.GetString()); }