📄 mainwin.cpp
字号:
void ecMainFrame::OnUpdateUserToolsPath(wxUpdateUIEvent& event){ event.Enable(wxGetApp().GetConfigToolDoc() != NULL);}void ecMainFrame::OnUpdateTemplates(wxUpdateUIEvent& event){ event.Enable(wxGetApp().GetConfigToolDoc() != NULL);}void ecMainFrame::OnUpdateAdmin(wxUpdateUIEvent& event){ event.Enable(wxGetApp().GetConfigToolDoc() != NULL);}void ecMainFrame::OnUpdatePackages(wxUpdateUIEvent& event){ event.Enable(wxGetApp().GetConfigToolDoc() != NULL);}void ecMainFrame::OnUpdateRunTests(wxUpdateUIEvent& event){ event.Enable(wxGetApp().GetConfigToolDoc() != NULL && !wxGetApp().GetConfigToolDoc()->GetInstallTree().IsEmpty() && (wxGetApp().m_pipedProcess == NULL));}void ecMainFrame::OnUpdateChooseRepository(wxUpdateUIEvent& event){ event.Enable(TRUE);}void ecMainFrame::OnWhatsThis(wxCommandEvent& event){ wxGetApp().OnWhatsThis(event);}void ecMainFrame::OnSaveOutput(wxCommandEvent& event){ ecOutputWindow* win = GetOutputWindow(); if (!win) return; wxFileDialog dialog(this, _("Choose a file for saving the output window contents"), wxT(""), wxT("output.txt"), wxT("*.txt"), wxSAVE|wxOVERWRITE_PROMPT); if (dialog.ShowModal() == wxID_OK) { if (!win->SaveFile(dialog.GetPath())) { wxMessageBox(_("Sorry, there was a problem saving the file."), wxGetApp().GetSettings().GetAppName(), wxICON_EXCLAMATION|wxID_OK); } }}void ecMainFrame::OnUpdateSelectAll(wxUpdateUIEvent& event){ wxWindow* win = wxWindow::FindFocus(); event.Enable (win && win->IsKindOf(CLASSINFO(wxTextCtrl)) );}void ecMainFrame::OnUpdateClear(wxUpdateUIEvent& event){ wxWindow* win = wxWindow::FindFocus(); event.Enable (win && win->IsKindOf(CLASSINFO(wxTextCtrl)) );}void ecMainFrame::OnImport(wxCommandEvent& event){ if (wxGetApp().GetConfigToolDoc()) { wxGetApp().GetConfigToolDoc()->ImportFile(); }}void ecMainFrame::OnExport(wxCommandEvent& event){ if (wxGetApp().GetConfigToolDoc()) { wxGetApp().GetConfigToolDoc()->ExportFile(); }}void ecMainFrame::OnUpdateImport(wxUpdateUIEvent& event){ event.Enable ( wxGetApp().GetConfigToolDoc() != NULL );}void ecMainFrame::OnUpdateExport(wxUpdateUIEvent& event){ event.Enable ( wxGetApp().GetConfigToolDoc() != NULL );}void ecMainFrame::OnWebRedHatHome(wxCommandEvent& event){ wxString strURL(wxT("http://www.redhat.com")); if (wxGetApp().GetConfigToolDoc()) wxGetApp().GetConfigToolDoc()->ShowURL(strURL);}void ecMainFrame::OnWebEcos(wxCommandEvent& event){ wxString strURL(wxT("http://www.redhat.com/products/ecos")); if (wxGetApp().GetConfigToolDoc()) wxGetApp().GetConfigToolDoc()->ShowURL(strURL);}void ecMainFrame::OnWebNetRelease(wxCommandEvent& event){ wxString strURL(wxT("http://sources.redhat.com/ecos")); if (wxGetApp().GetConfigToolDoc()) wxGetApp().GetConfigToolDoc()->ShowURL(strURL);}void ecMainFrame::OnWebUitron(wxCommandEvent& event){ wxString strURL(wxT("http://www.itron.gr.jp/")); if (wxGetApp().GetConfigToolDoc()) wxGetApp().GetConfigToolDoc()->ShowURL(strURL);}void ecMainFrame::OnBuildLibrary(wxCommandEvent& event){ // TODO: possibly add wxT("clean build") to ensure library is // cleanly built. No, can't do that because it would clean // out any user code too :-( bool regenerateBuildTree = FALSE; if (wxGetApp().GetSettings().m_editSaveFileOnly) { int ans = wxMessageBox(wxT("Running in --edit-only mode so there may not be an up-to-date build tree.\nBuild the tree now?"), wxGetApp().GetSettings().GetAppName(), wxICON_QUESTION|wxYES_NO|wxCANCEL); if (ans == wxYES) { regenerateBuildTree = TRUE; } else if (ans == wxCANCEL) return; } if (regenerateBuildTree) { ecConfigToolDoc* pDoc = wxGetApp().GetConfigToolDoc(); if (!pDoc) return; if (!pDoc->GenerateBuildTree()) return ; } wxGetApp().Build();}void ecMainFrame::OnBuildTests(wxCommandEvent& event){ bool regenerateBuildTree = FALSE; if (wxGetApp().GetSettings().m_editSaveFileOnly) { int ans = wxMessageBox(wxT("Running in --edit-only mode so there may not be an up-to-date build tree.\nBuild the tree now?"), wxGetApp().GetSettings().GetAppName(), wxICON_QUESTION|wxYES_NO|wxCANCEL); if (ans == wxYES) { regenerateBuildTree = TRUE; } else if (ans == wxCANCEL) return; } if (regenerateBuildTree) { ecConfigToolDoc* pDoc = wxGetApp().GetConfigToolDoc(); if (!pDoc) return; if (!pDoc->GenerateBuildTree()) return ; } wxGetApp().Build(wxT("tests"));}void ecMainFrame::OnStopBuild(wxCommandEvent& event){ if (wxGetApp().m_pipedProcess) { long pid = wxGetApp().m_pipedProcess->GetPid(); wxGetApp().m_pipedProcess->Detach(); wxProcessKiller pKiller(pid); pKiller.Kill(TRUE); }}void ecMainFrame::OnClean(wxCommandEvent& event){ wxGetApp().Build(wxT("clean"));}void ecMainFrame::OnShell(wxCommandEvent& event){ ecConfigToolDoc *pDoc=wxGetApp().GetConfigToolDoc(); if (!pDoc) return; wxString variableSettings; if (wxGetApp().PrepareEnvironment(TRUE, & variableSettings)) {#ifdef __WXMSW__ wxString currentDir = wxGetCwd(); wxSetWorkingDirectory(pDoc->GetBuildTree()); wxExecute("bash.exe"); if (!currentDir.IsEmpty()) // if the current directory was changed { wxSetWorkingDirectory(currentDir); // restore the previous current directory }#else wxString cmdLine = wxString(wxT("xterm")); // TODO: query an appropriate variable, and/or have a setting for this wxExecute(cmdLine);#endif }}void ecMainFrame::OnUpdateBuildLibrary(wxUpdateUIEvent& event){ event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && (wxGetApp().m_pipedProcess == NULL ));}void ecMainFrame::OnUpdateBuildTests(wxUpdateUIEvent& event){ event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && (wxGetApp().m_pipedProcess == NULL ));}void ecMainFrame::OnUpdateStopBuild(wxUpdateUIEvent& event){ event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && (wxGetApp().m_pipedProcess != NULL ));}void ecMainFrame::OnUpdateClean(wxUpdateUIEvent& event){ event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && (wxGetApp().m_pipedProcess == NULL ));}void ecMainFrame::OnRepositoryInfo(wxCommandEvent& event){ ecRepositoryInfoDialog dialog(this, ecID_REPOSITORY_INFO, _("Repository Information")); dialog.ShowModal();}void ecMainFrame::OnUpdateShell(wxUpdateUIEvent& event){ event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) );}void ecMainFrame::OnUpdateRepositoryInfo(wxUpdateUIEvent& event){ event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) );}void ecMainFrame::OnNewRegion(wxCommandEvent& event){#if ecUSE_MLT#endif}void ecMainFrame::OnNewSection(wxCommandEvent& event){#if ecUSE_MLT#endif}void ecMainFrame::OnDeleteRegionOrSection(wxCommandEvent& event){#if ecUSE_MLT#endif}void ecMainFrame::OnRegionOrSectionProperties(wxCommandEvent& event){#if ecUSE_MLT#endif}void ecMainFrame::OnUpdateNewRegion(wxUpdateUIEvent& event){#if ecUSE_MLT#else event.Enable( FALSE );#endif}void ecMainFrame::OnUpdateNewSection(wxUpdateUIEvent& event){#if ecUSE_MLT#else event.Enable( FALSE );#endif}void ecMainFrame::OnUpdateDeleteRegionOrSection(wxUpdateUIEvent& event){#if ecUSE_MLT#else event.Enable( FALSE );#endif}void ecMainFrame::OnUpdateRegionOrSectionProperties(wxUpdateUIEvent& event){#if ecUSE_MLT#else event.Enable( FALSE );#endif}void ecMainFrame::OnIndexDocs(wxCommandEvent& event){ ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc(); if (doc) { doc->RebuildHelpIndex(TRUE) ; }}void ecMainFrame::OnUpdateIndexDocs(wxUpdateUIEvent& event){ event.Enable( wxGetApp().GetConfigToolDoc() != NULL );}void ecMainFrame::OnGenerateBuildTree(wxCommandEvent& event){ if (wxGetApp().GetConfigToolDoc() && wxGetApp().GetConfigToolDoc()->CanGenerateBuildTree()) { if (!wxGetApp().GetConfigToolDoc()->GenerateBuildTree()) { // Error probably already reported } }}void ecMainFrame::OnUpdateGenerateBuildTree(wxUpdateUIEvent& event){ event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && wxGetApp().GetConfigToolDoc()->CanGenerateBuildTree());}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -