void DisplayVariableDlg::HideDialog() { DoCleanUp(); //asm("int3"); wxPopupWindow::Hide(); m_mousePosTimer->Stop(); }
void wxApp::CleanUp() { wxMacAutoreleasePool autoreleasepool; #if wxUSE_TOOLTIPS wxToolTip::RemoveToolTips() ; #endif DoCleanUp(); wxAppBase::CleanUp(); }
bool CleanupCommand::Execute() { bool bRet = false; CCleanTypeDlg dlg; dlg.m_pathList = pathList; if (dlg.DoModal() == IDOK) { bRet = DoCleanUp(pathList, dlg.m_CleanType, dlg.m_bDir == BST_CHECKED, dlg.m_bSubmodules == BST_CHECKED, dlg.m_bDryRun == BST_CHECKED, dlg.m_bNoRecycleBin == BST_CHECKED); CShellUpdater::Instance().Flush(); } return bRet; }
int main(int argc, const char * argv[]) { bool keepRunning = true; char userInput[11]; while(keepRunning == true) { printf("Type NEW, LIST, or QUIT:\n> "); scanf( "%10s", userInput); fpurge(stdin); if( strcmp( userInput, "NEW") == 0) DoNewCommand(); else if( strcmp( userInput, "LIST" ) == 0 ) DoListCommand(); else if( strcmp( userInput, "QUIT" ) == 0 ) keepRunning = false; //This will end the program. else printf("ERROR: Unknown Command \"%s\"!\n\n", userInput); } DoCleanUp(); return 0; }
void ClangCodeCompletion::CancelCodeComplete() { CHECK_CLANG_ENABLED_RET(); DoCleanUp(); }
void DisplayVariableDlg::OnCloseEvent(wxCloseEvent& e) { DoCleanUp(); e.Skip(); }
void DisplayVariableDlg::OnBtnCancel(wxCommandEvent& e) { DoCleanUp(); e.Skip(); }
static bool DoCleanUp(const CTGitPathList& pathList, int cleanType, bool bDir, bool bSubmodules, bool bDryRun, bool bNoRecycleBin) { CString cmd; cmd.Format(_T("git.exe clean")); if (bDryRun || !bNoRecycleBin) cmd += _T(" -n "); if (bDir) cmd += _T(" -d "); switch (cleanType) { case 0: cmd += _T(" -fx"); break; case 1: cmd += _T(" -f"); break; case 2: cmd += _T(" -fX"); break; } STRING_VECTOR submoduleList; if (bSubmodules) { SubmodulePayload payload(submoduleList); payload.basePath = CTGitPath(g_Git.m_CurrentDir).GetGitPathString(); if (pathList.GetCount() != 1 || pathList.GetCount() == 1 && !pathList[0].IsEmpty()) { for (int i = 0; i < pathList.GetCount(); ++i) { CString path; if (pathList[i].IsDirectory()) payload.prefixList.push_back(pathList[i].GetGitPathString()); else payload.prefixList.push_back(pathList[i].GetContainingDirectory().GetGitPathString()); } } if (!GetSubmodulePathList(payload)) return false; std::sort(submoduleList.begin(), submoduleList.end()); } if (bDryRun || bNoRecycleBin) { CProgressDlg progress; for (int i = 0; i < pathList.GetCount(); ++i) { CString path; if (pathList[i].IsDirectory()) path = pathList[i].GetGitPathString(); else path = pathList[i].GetContainingDirectory().GetGitPathString(); progress.m_GitDirList.push_back(g_Git.m_CurrentDir); progress.m_GitCmdList.push_back(cmd + _T(" -- \"") + path + _T("\"")); } for (CString dir : submoduleList) { progress.m_GitDirList.push_back(CTGitPath(dir).GetWinPathString()); progress.m_GitCmdList.push_back(cmd); } progress.m_PostCmdCallback = [&](DWORD status, PostCmdList& postCmdList) { if (status) postCmdList.push_back(PostCmd(IDS_MSGBOX_RETRY, [&] { DoCleanUp(pathList, cleanType, bDir, bSubmodules, bDryRun, bNoRecycleBin); })); if (status || !bDryRun) return; if (bNoRecycleBin) { postCmdList.push_back(PostCmd(IDS_CLEAN_NO_RECYCLEBIN, [&] { DoCleanUp(pathList, cleanType, bDir, bSubmodules, FALSE, TRUE); })); postCmdList.push_back(PostCmd(IDS_CLEAN_TO_RECYCLEBIN, [&] { DoCleanUp(pathList, cleanType, bDir, bSubmodules, FALSE, FALSE); })); } else { postCmdList.push_back(PostCmd(IDS_CLEAN_TO_RECYCLEBIN, [&] { DoCleanUp(pathList, cleanType, bDir, bSubmodules, FALSE, FALSE); })); postCmdList.push_back(PostCmd(IDS_CLEAN_NO_RECYCLEBIN, [&] { DoCleanUp(pathList, cleanType, bDir, bSubmodules, FALSE, TRUE); })); } }; INT_PTR result = progress.DoModal(); return result == IDOK; } else { CSysProgressDlg sysProgressDlg; sysProgressDlg.SetAnimation(IDR_CLEANUPANI); sysProgressDlg.SetTitle(CString(MAKEINTRESOURCE(IDS_APPNAME))); sysProgressDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_PROC_CLEANUP_INFO1))); sysProgressDlg.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROGRESSWAIT))); sysProgressDlg.SetShowProgressBar(false); sysProgressDlg.ShowModeless((HWND)NULL, true); bool quotepath = g_Git.GetConfigValueBool(_T("core.quotepath")); CTGitPathList delList; for (int i = 0; i < pathList.GetCount(); ++i) { CString path; if (pathList[i].IsDirectory()) path = pathList[i].GetGitPathString(); else path = pathList[i].GetContainingDirectory().GetGitPathString(); if (!GetFilesToCleanUp(delList, cmd, &g_Git, path, quotepath, sysProgressDlg)) return false; } for (CString dir : submoduleList) { CGit git; git.m_CurrentDir = dir; if (!GetFilesToCleanUp(delList, cmd, &git, _T(""), quotepath, sysProgressDlg)) return false; } delList.DeleteAllFiles(true, false, true); sysProgressDlg.Stop(); } return true; }
bool _HYParameterTable::_ProcessMenuSelection (long msel) { _HYTable* table = (_HYTable*)GetCellObject(HY_PARAMETER_TABLE_TABLE_ROW,0); bool res = false; switch (msel) { case HY_WINDOW_MENU_ID_FILE+1: // save { DoSave (); res = true; break; } case HY_WINDOW_MENU_ID_FILE+2: // print { _SimpleList columns, sel; columns << 0; columns << 1; columns << 2; columns << 3; table->GetSelection (sel); char resp = 3; if (sel.lLength) { _String pr ("Would you like to print only the selected cells? (Click \"No\" to print the entire table)."); resp = YesNoCancelPrompt (pr); } if (resp == 3) table->_PrintTable(columns,(_HYTable*)GetCellObject(HY_PARAMETER_TABLE_TABLE_ROW-1,0)); else if (resp == 1) { _SimpleList rows; for (long k = 0; k < sel.lLength; k+=4) rows << sel.lData[k]/4; table->_PrintTable(columns,rows,(_HYTable*)GetCellObject(HY_PARAMETER_TABLE_TABLE_ROW-1,0)); } res = true; break; } case HY_WINDOW_MENU_ID_EDIT: // undo { UndoCommand(); _UpdateUndoMenu (nil,nil); res = true; break; } case HY_WINDOW_MENU_ID_EDIT+5: // undo { SelectAll(); res = true; break; } case HY_PT_WIN32_MENU_BASE+10: case HY_PT_WIN32_MENU_BASE+11: case HY_PT_WIN32_MENU_BASE+12: case HY_PT_WIN32_MENU_BASE+13: { res = true; char toggleFlag; GtkWidget * checkMI = gtk_item_factory_get_widget_by_action(menu_items,msel); msel -= HY_PT_WIN32_MENU_BASE+10; switch (msel) { case 0: toggleFlag = HY_PARAMETER_TABLE_VIEW_LOCAL; break; case 1: toggleFlag = HY_PARAMETER_TABLE_VIEW_GLOBAL; break; case 2: toggleFlag = HY_PARAMETER_TABLE_VIEW_CONSTRAINED; break; case 3: toggleFlag = HY_PARAMETER_TABLE_VIEW_CATEGORY; break; } if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM(checkMI)) != (bool)viewOptions&toggleFlag) { if (viewOptions&toggleFlag) { if (viewOptions-toggleFlag) viewOptions-=toggleFlag; else break; } else viewOptions+=toggleFlag; gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(checkMI), viewOptions&toggleFlag); ConstructTheTable(); SetWindowRectangle (top,left,bottom,right); } break; } case HY_PT_WIN32_MENU_BASE+1: OptimizeLikelihoodFunction(); res = true; break; case HY_PT_WIN32_MENU_BASE+2: DoEnterConstraint (); res = true; break; case HY_PT_WIN32_MENU_BASE+3: DoCleanUp (); res = true; break; case HY_PT_WIN32_MENU_BASE+4: HandleVarianceEstimates (); res = true; break; case HY_PT_WIN32_MENU_BASE+5: HandleProfilePlot (); res = true; break; case HY_PT_WIN32_MENU_BASE+6: HandleCategories (); res = true; break; case HY_PT_WIN32_MENU_BASE+7: HandleSelectParameters (); res = true; break; case HY_PT_WIN32_MENU_BASE+8: HandleOpenInChart (); res = true; break; } if (!res) res = _HYTWindow::_ProcessMenuSelection(msel); return res; }