LRESULT CGitProgressDlg::OnCmdStart(WPARAM /*wParam*/, LPARAM /*lParam*/) { DialogEnableWindow(IDOK, FALSE); DialogEnableWindow(IDCANCEL, TRUE); return 0; }
void CEditPropExternals::OnLvnItemchangedExternalslist(NMHDR * /*pNMHDR*/, LRESULT *pResult) { //LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR); DialogEnableWindow(IDC_REMOVE, m_ExtList.GetSelectedCount()); DialogEnableWindow(IDC_EDIT, m_ExtList.GetSelectedCount() == 1); *pResult = 0; }
LRESULT CGitProgressDlg::OnCmdEnd(WPARAM wParam, LPARAM /*lParam*/) { DialogEnableWindow(IDCANCEL, FALSE); DialogEnableWindow(IDOK, TRUE); switch(wParam) { case CGitProgressList::GitProgress_Add: case CGitProgressList::GitProgress_Revert: if (DidErrorsOccur()) break; this->GetDlgItem(IDC_LOGBUTTON)->SetWindowText(CString(MAKEINTRESOURCE(IDS_COMMITBUTTON))); this->GetDlgItem(IDC_LOGBUTTON)->ShowWindow(SW_SHOW); break; } CWnd * pWndOk = GetDlgItem(IDOK); if (pWndOk && ::IsWindow(pWndOk->GetSafeHwnd())) { SendMessage(DM_SETDEFID, IDOK); GetDlgItem(IDOK)->SetFocus(); } return 0; }
void CSettingsProgsDiff::OnBnClickedExtdiffpropsOff() { m_iExtDiffProps = 0; SetModified(); DialogEnableWindow(IDC_EXTDIFFPROPS, false); DialogEnableWindow(IDC_EXTDIFFPROPSBROWSE, false); CheckProgCommentProps(); }
void CInputLogDlg::UpdateOKButton() { CString sTemp = m_cInput.GetText(); if (!m_pProjectProperties || sTemp.GetLength() >= m_pProjectProperties->nMinLogSize) DialogEnableWindow(IDOK, TRUE); else DialogEnableWindow(IDOK, FALSE); }
void CSettingsProgsDiff::OnBnClickedExtdiffOff() { m_iExtDiff = 0; SetModified(); DialogEnableWindow(IDC_EXTDIFF, false); DialogEnableWindow(IDC_EXTDIFFBROWSE, false); CheckProgComment(); }
void CSettingsProgsDiff::OnBnClickedDiffviewerOff() { m_iDiffViewer = 0; SetModified(); DialogEnableWindow(IDC_DIFFVIEWER, false); DialogEnableWindow(IDC_DIFFVIEWERBROWSE, false); CheckProgComment(); }
void CSettingsProgsDiff::OnBnClickedExtdiffpropsOn() { m_iExtDiffProps = 1; SetModified(); DialogEnableWindow(IDC_EXTDIFFPROPS, true); DialogEnableWindow(IDC_EXTDIFFPROPSBROWSE, true); GetDlgItem(IDC_EXTDIFFPROPS)->SetFocus(); CheckProgCommentProps(); }
void CSettingsProgsDiff::OnBnClickedExtdiffOn() { m_iExtDiff = 1; SetModified(); DialogEnableWindow(IDC_EXTDIFF, true); DialogEnableWindow(IDC_EXTDIFFBROWSE, true); GetDlgItem(IDC_EXTDIFF)->SetFocus(); CheckProgComment(); }
void CSettingsProgsDiff::OnBnClickedDiffviewerOn() { m_iDiffViewer = 1; SetModified(); DialogEnableWindow(IDC_DIFFVIEWER, true); DialogEnableWindow(IDC_DIFFVIEWERBROWSE, true); GetDlgItem(IDC_DIFFVIEWER)->SetFocus(); CheckProgComment(); }
BOOL CSetMainPage::OnInitDialog() { CMFCFontComboBox::m_bDrawUsingFont = true; CPropertyPage::OnInitDialog(); m_bBackup = m_regBackup; m_bFirstDiffOnLoad = m_regFirstDiffOnLoad; m_bFirstConflictOnLoad = m_regFirstConflictOnLoad; m_nTabSize = m_regTabSize; m_bIgnoreEOL = m_regIgnoreEOL; m_bOnePane = m_regOnePane; m_sFontName = m_regFontName; m_dwFontSize = m_regFontSize; m_bViewLinenumbers = m_regViewLinenumbers; m_bCaseInsensitive = m_regCaseInsensitive; m_bUTF8Default = m_regUTF8Default; m_bAutoAdd = m_regAutoAdd; m_nMaxInline = m_regMaxInline; m_bUseRibbons = m_regUseRibbons; m_bUseTaskDialog = m_regUseTaskDialog; DialogEnableWindow(IDC_FIRSTCONFLICTONLOAD, m_bFirstDiffOnLoad); DialogEnableWindow(IDC_USETASKDIALOG, CTaskDialog::IsSupported()); CString temp; int count = 0; for (int i=6; i<32; i=i+2) { temp.Format(_T("%d"), i); m_cFontSizes.AddString(temp); m_cFontSizes.SetItemData(count++, i); } BOOL foundfont = FALSE; for (int i=0; i<m_cFontSizes.GetCount(); i++) { if (m_cFontSizes.GetItemData(i) == m_dwFontSize) { m_cFontSizes.SetCurSel(i); foundfont = TRUE; } } if (!foundfont) { temp.Format(_T("%d"), m_dwFontSize); m_cFontSizes.SetWindowText(temp); } m_cFontNames.Setup(DEVICE_FONTTYPE|RASTER_FONTTYPE|TRUETYPE_FONTTYPE, 1, FIXED_PITCH); m_cFontNames.SelectFont(m_sFontName); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CInputDlg::OnEnChangeLogmessage() { CString sTemp = m_cInput.GetText(); if ((!m_bUseLogWidth)||((m_pProjectProperties==NULL)||(sTemp.GetLength() >= m_pProjectProperties->nMinLogSize))) { DialogEnableWindow(IDOK, TRUE); } else { DialogEnableWindow(IDOK, FALSE); } }
void CLockDlg::OnEnChangeLockmessage() { CString sTemp; GetDlgItemText(IDC_LOCKMESSAGE, sTemp); if ((m_ProjectProperties == NULL)||((m_ProjectProperties)&&(sTemp.GetLength() >= m_ProjectProperties->nMinLockMsgSize))) { if (!m_bBlock) DialogEnableWindow(IDOK, TRUE); } else { DialogEnableWindow(IDOK, FALSE); } }
UINT CChangedDlg::ChangedStatusThread() { InterlockedExchange(&m_bBlock, TRUE); g_Git.RefreshGitIndex(); m_bCanceled = false; SetDlgItemText(IDOK, CString(MAKEINTRESOURCE(IDS_MSGBOX_CANCEL))); DialogEnableWindow(IDC_REFRESH, FALSE); DialogEnableWindow(IDC_SHOWUNVERSIONED, FALSE); DialogEnableWindow(IDC_SHOWUNMODIFIED, FALSE); DialogEnableWindow(IDC_SHOWIGNORED, FALSE); DialogEnableWindow(IDC_SHOWUSERPROPS, FALSE); CString temp; m_FileListCtrl.Clear(); if (!m_FileListCtrl.GetStatus(&m_pathList, m_bRemote, m_bShowIgnored != FALSE, m_bShowUnversioned != FALSE)) { if (!m_FileListCtrl.GetLastErrorMessage().IsEmpty()) m_FileListCtrl.SetEmptyString(m_FileListCtrl.GetLastErrorMessage()); } unsigned int dwShow = GITSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALS | GITSLC_SHOWLOCKS | GITSLC_SHOWSWITCHED | GITSLC_SHOWINCHANGELIST; dwShow |= m_bShowUnversioned ? GITSLC_SHOWUNVERSIONED : 0; dwShow |= m_iShowUnmodified ? GITSLC_SHOWNORMAL : 0; dwShow |= m_bShowIgnored ? GITSLC_SHOWIGNORED : 0; dwShow |= m_bShowExternals ? GITSLC_SHOWEXTERNAL | GITSLC_SHOWINEXTERNALS | GITSLC_SHOWEXTERNALFROMDIFFERENTREPO : 0; m_FileListCtrl.Show(dwShow); UpdateStatistics(); bool bIsDirectory = false; CTGitPath commonDir = m_FileListCtrl.GetCommonDirectory(false); if (m_pathList.GetCount() == 1) { if (m_pathList[0].IsEmpty()) CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, m_sTitle); else CAppUtils::SetWindowTitle(m_hWnd, (g_Git.m_CurrentDir + _T("\\") + m_pathList[0].GetWinPathString()).TrimRight('\\'), m_sTitle); bIsDirectory = m_pathList[0].IsDirectory() || m_pathList[0].IsEmpty(); // if it is empty it is g_Git.m_CurrentDir which is a directory } else CAppUtils::SetWindowTitle(m_hWnd, commonDir.GetWinPathString(), m_sTitle); SetDlgItemText(IDOK, CString(MAKEINTRESOURCE(IDS_MSGBOX_OK))); DialogEnableWindow(IDC_REFRESH, TRUE); DialogEnableWindow(IDC_SHOWUNVERSIONED, bIsDirectory); //DialogEnableWindow(IDC_SHOWUNMODIFIED, bIsDirectory); DialogEnableWindow(IDC_SHOWIGNORED, bIsDirectory); DialogEnableWindow(IDC_SHOWUSERPROPS, TRUE); InterlockedExchange(&m_bBlock, FALSE); // revert the remote flag back to the default m_bRemote = !!(DWORD)CRegDWORD(_T("Software\\TortoiseGit\\CheckRepo"), FALSE); RefreshCursor(); return 0; }
void CInputLogDlg::UpdateOKButton() { CString sTemp = m_cInput.GetText(); int minsize = 0; if (m_pProjectProperties) minsize = m_bLock ? m_pProjectProperties->nMinLockMsgSize : m_pProjectProperties->nMinLogSize; if (sTemp.GetLength() >= minsize) { DialogEnableWindow(IDOK, TRUE); } else { DialogEnableWindow(IDOK, FALSE); } }
BOOL CPromptDlg::OnInitDialog() { CStandAloneDialog::OnInitDialog(); ExtendFrameIntoClientArea(IDC_PASSEDIT); m_aeroControls.SubclassControl(this, IDC_SAVECHECK); m_aeroControls.SubclassOkCancel(this); BOOL bAllowAuthSave = (BOOL)(DWORD)CRegDWORD(L"Software\\TortoiseSVN\\AllowAuthSave", TRUE); DialogEnableWindow(IDC_SAVECHECK, bAllowAuthSave); if (bAllowAuthSave) CheckDlgButton(IDC_SAVECHECK, SVNConfig::Instance().ConfigGetBool(SVN_CONFIG_SECTION_AUTH, SVN_CONFIG_OPTION_STORE_PASSWORDS, true) ? BST_CHECKED : BST_UNCHECKED); if (m_hide) { m_pass.SetPasswordChar('*'); GetDlgItem(IDC_SAVECHECK)->ShowWindow(SW_SHOW); } else { m_pass.SetPasswordChar('\0'); GetDlgItem(IDC_SAVECHECK)->ShowWindow(SW_HIDE); } m_pass.SetFocus(); if ((m_hParentWnd==NULL)&&(GetExplorerHWND())) CenterWindow(CWnd::FromHandle(m_hParentWnd)); return FALSE; }
BOOL CUpdateDlg::OnInitDialog() { CStandAloneDialog::OnInitDialog(); CAppUtils::MarkWindowAsUnpinnable(m_hWnd); ExtendFrameIntoClientArea(IDC_GROUPMISC); m_aeroControls.SubclassOkCancel(this); AdjustControlSize(IDC_REVISION_HEAD); AdjustControlSize(IDC_REVISION_N); AdjustControlSize(IDC_NOEXTERNALS); m_depthCombo.AddString(CString(MAKEINTRESOURCE(IDS_SVN_DEPTH_WORKING))); m_depthCombo.AddString(CString(MAKEINTRESOURCE(IDS_SVN_DEPTH_INFINITE))); m_depthCombo.AddString(CString(MAKEINTRESOURCE(IDS_SVN_DEPTH_IMMEDIATE))); m_depthCombo.AddString(CString(MAKEINTRESOURCE(IDS_SVN_DEPTH_FILES))); m_depthCombo.AddString(CString(MAKEINTRESOURCE(IDS_SVN_DEPTH_EMPTY))); if (m_wcPath.Exists()) m_depthCombo.AddString(CString(MAKEINTRESOURCE(IDS_SVN_DEPTH_EXCLUDE))); m_depthCombo.SetCurSel(0); CheckRadioButton(IDC_REVISION_HEAD, IDC_REVISION_N, IDC_REVISION_HEAD); CString sWindowTitle; GetWindowText(sWindowTitle); CAppUtils::SetWindowTitle(m_hWnd, m_wcPath.GetUIPathString(), sWindowTitle); DialogEnableWindow(IDC_SPARSE, m_wcPath.Exists() && m_wcPath.IsDirectory()); GetDlgItem(IDC_REVNUM)->SetFocus(); if ((m_pParentWnd==NULL)&&(GetExplorerHWND())) CenterWindow(CWnd::FromHandle(GetExplorerHWND())); return FALSE; }
BOOL CSetOverlayPage::OnInitDialog() { ISettingsPropPage::OnInitDialog(); switch (m_dwCacheType) { case 0: CheckRadioButton(IDC_CACHEDEFAULT, IDC_CACHENONE, IDC_CACHENONE); break; default: case 1: CheckRadioButton(IDC_CACHEDEFAULT, IDC_CACHENONE, IDC_CACHEDEFAULT); break; case 2: CheckRadioButton(IDC_CACHEDEFAULT, IDC_CACHENONE, IDC_CACHESHELL); break; } DialogEnableWindow(IDC_UNVERSIONEDASMODIFIED, m_dwCacheType == 1); m_tooltips.Create(this); m_tooltips.AddTool(IDC_ONLYEXPLORER, IDS_SETTINGS_ONLYEXPLORER_TT); m_tooltips.AddTool(IDC_EXCLUDEPATHSLABEL, IDS_SETTINGS_EXCLUDELIST_TT); m_tooltips.AddTool(IDC_EXCLUDEPATHS, IDS_SETTINGS_EXCLUDELIST_TT); m_tooltips.AddTool(IDC_INCLUDEPATHSLABEL, IDS_SETTINGS_INCLUDELIST_TT); m_tooltips.AddTool(IDC_INCLUDEPATHS, IDS_SETTINGS_INCLUDELIST_TT); m_tooltips.AddTool(IDC_CACHEDEFAULT, IDS_SETTINGS_CACHEDEFAULT_TT); m_tooltips.AddTool(IDC_CACHESHELL, IDS_SETTINGS_CACHESHELL_TT); m_tooltips.AddTool(IDC_CACHENONE, IDS_SETTINGS_CACHENONE_TT); m_tooltips.AddTool(IDC_UNVERSIONEDASMODIFIED, IDS_SETTINGS_UNVERSIONEDASMODIFIED_TT); m_tooltips.AddTool(IDC_SHOWEXCLUDEDASNORMAL, IDS_SETTINGS_SHOWEXCLUDEDASNORMAL_TT); UpdateData(FALSE); return TRUE; }
UINT CRevertDlg::RevertThread() { // get the status of all selected file/folders recursively // and show the ones which can be reverted to the user // in a list control. DialogEnableWindow(IDOK, false); m_bCancelled = false; m_RevertList.Clear(); if (!m_RevertList.GetStatus(&m_pathList)) { m_RevertList.SetEmptyString(m_RevertList.GetLastErrorMessage()); } m_RevertList.Show(GITSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALSFROMDIFFERENTREPOS | GITSLC_SHOWDIRECTFILES | GITSLC_SHOWEXTERNALFROMDIFFERENTREPO, // do not select all files, only the ones the user has selected directly GITSLC_SHOWDIRECTFILES|GITSLC_SHOWADDED); if (m_RevertList.HasUnversionedItems()) { if (DWORD(CRegStdDWORD(_T("Software\\TortoiseGit\\UnversionedAsModified"), FALSE))) { GetDlgItem(IDC_UNVERSIONEDITEMS)->ShowWindow(SW_SHOW); } else GetDlgItem(IDC_UNVERSIONEDITEMS)->ShowWindow(SW_HIDE); } else GetDlgItem(IDC_UNVERSIONEDITEMS)->ShowWindow(SW_HIDE); InterlockedExchange(&m_bThreadRunning, FALSE); RefreshCursor(); return 0; }
BOOL CCheckForUpdatesDlg::OnInitDialog() { CStandAloneDialog::OnInitDialog(); CAppUtils::MarkWindowAsUnpinnable(m_hWnd); ExtendFrameIntoClientArea(0, 0, 0, 0); m_aeroControls.SubclassControl(this, IDC_INFO); m_aeroControls.SubclassControl(this, IDC_YOURVERSION); m_aeroControls.SubclassControl(this, IDC_CURRENTVERSION); m_aeroControls.SubclassControl(this, IDC_CHECKRESULT); m_aeroControls.SubclassControl(this, IDC_LINK); m_aeroControls.SubclassControl(this, IDOK); CString temp; temp.Format(IDS_CHECKNEWER_YOURVERSION, TSVN_VERMAJOR, TSVN_VERMINOR, TSVN_VERMICRO, TSVN_VERBUILD); SetDlgItemText(IDC_YOURVERSION, temp); DialogEnableWindow(IDOK, FALSE); if (AfxBeginThread(CheckThreadEntry, this)==NULL) { TaskDialog(this->m_hWnd, AfxGetResourceHandle(), MAKEINTRESOURCE(IDS_APPNAME), MAKEINTRESOURCE(IDS_ERR_ERROROCCURED), MAKEINTRESOURCE(IDS_ERR_THREADSTARTFAILED), TDCBF_OK_BUTTON, TD_ERROR_ICON, NULL); } SetTimer(100, 1000, NULL); return TRUE; }
void CDeleteRemoteTagDlg::Refresh() { m_ctrlTags.DeleteAllItems(); m_SelectAll.SetCheck(BST_UNCHECKED); m_taglist.clear(); CSysProgressDlg sysProgressDlg; sysProgressDlg.SetTitle(CString(MAKEINTRESOURCE(IDS_APPNAME))); sysProgressDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_LOADING))); sysProgressDlg.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROGRESSWAIT))); sysProgressDlg.SetShowProgressBar(false); sysProgressDlg.ShowModal(this, true); if (g_Git.GetRemoteTags(m_sRemote, m_taglist)) { sysProgressDlg.Stop(); MessageBox(g_Git.GetGitLastErr(L"Could not retrieve remote tags.", CGit::GIT_CMD_FETCH), L"TortoiseGit", MB_ICONERROR); } sysProgressDlg.Stop(); BringWindowToTop(); for (int i = 0; i < (int)m_taglist.size(); ++i) m_ctrlTags.InsertItem(i, m_taglist[i]); DialogEnableWindow(IDOK, FALSE); }
BOOL CSubmoduleUpdateDlg::OnInitDialog() { CResizableStandAloneDialog::OnInitDialog(); CAppUtils::MarkWindowAsUnpinnable(m_hWnd); AdjustControlSize(IDC_CHECK_SUBMODULE_INIT); AdjustControlSize(IDC_CHECK_SUBMODULE_RECURSIVE); AdjustControlSize(IDC_CHECK_SUBMODULE_NOFETCH); AdjustControlSize(IDC_CHECK_SUBMODULE_MERGE); AdjustControlSize(IDC_CHECK_SUBMODULE_REBASE); AddAnchor(IDOK, BOTTOM_RIGHT); AddAnchor(IDCANCEL, BOTTOM_RIGHT); AddAnchor(IDHELP, BOTTOM_RIGHT); AddAnchor((UINT)IDC_STATIC, TOP_LEFT); AddAnchor(IDC_LIST_PATH, TOP_LEFT, BOTTOM_RIGHT); AddAnchor(IDC_SELECTALL, BOTTOM_LEFT); AddAnchor(IDC_WHOLE_PROJECT, BOTTOM_LEFT); AddAnchor(IDC_GROUP_INFO, BOTTOM_LEFT, BOTTOM_RIGHT); AddAnchor(IDC_CHECK_SUBMODULE_INIT, BOTTOM_LEFT); AddAnchor(IDC_CHECK_SUBMODULE_RECURSIVE, BOTTOM_LEFT); AddAnchor(IDC_FORCE, BOTTOM_LEFT); AddAnchor(IDC_CHECK_SUBMODULE_REMOTE, BOTTOM_LEFT); AddAnchor(IDC_CHECK_SUBMODULE_NOFETCH, BOTTOM_RIGHT); AddAnchor(IDC_CHECK_SUBMODULE_MERGE, BOTTOM_RIGHT); AddAnchor(IDC_CHECK_SUBMODULE_REBASE, BOTTOM_RIGHT); CString str(g_Git.m_CurrentDir); str.Replace(L':', L'_'); m_regShowWholeProject = CRegDWORD(L"Software\\TortoiseGit\\TortoiseProc\\ShowWholeProject\\" + str, FALSE); m_bWholeProject = m_regShowWholeProject; m_regInit = CRegDWORD(L"Software\\TortoiseGit\\TortoiseProc\\SubmoduleUpdate\\" + str + L"\\init", TRUE); m_bInit = m_regInit; m_regRecursive = CRegDWORD(L"Software\\TortoiseGit\\TortoiseProc\\SubmoduleUpdate\\" + str + L"\\recursive", FALSE); m_bRecursive = m_regRecursive; m_regForce = CRegDWORD(L"Software\\TortoiseGit\\TortoiseProc\\SubmoduleUpdate\\" + str + L"\\force", FALSE); m_bForce = m_regForce; m_regRemote = CRegDWORD(L"Software\\TortoiseGit\\TortoiseProc\\SubmoduleUpdate\\" + str + L"\\remote", FALSE); m_bRemote = m_regRemote; m_regNoFetch = CRegDWORD(L"Software\\TortoiseGit\\TortoiseProc\\SubmoduleUpdate\\" + str + L"\\nofetch", FALSE); m_bNoFetch = m_regNoFetch; m_regMerge = CRegDWORD(L"Software\\TortoiseGit\\TortoiseProc\\SubmoduleUpdate\\" + str + L"\\merge", FALSE); m_bMerge = m_regMerge; m_regRebase = CRegDWORD(L"Software\\TortoiseGit\\TortoiseProc\\SubmoduleUpdate\\" + str + L"\\rebase", FALSE); m_bRebase = m_regRebase; DialogEnableWindow(IDC_WHOLE_PROJECT, !(m_PathFilterList.empty() || (m_PathFilterList.size() == 1 && m_PathFilterList[0].IsEmpty()))); SetDlgTitle(); EnableSaveRestore(L"SubmoduleUpdateDlg"); Refresh(); UpdateData(FALSE); return TRUE; }
void CDeleteRemoteTagDlg::OnSelchangeTags(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/) { DialogEnableWindow(IDOK, m_ctrlTags.GetSelectedCount() > 0); if (m_ctrlTags.GetSelectedCount() == 0) m_SelectAll.SetCheck(BST_UNCHECKED); else if ((int)m_ctrlTags.GetSelectedCount() < m_ctrlTags.GetItemCount()) m_SelectAll.SetCheck(BST_INDETERMINATE); else m_SelectAll.SetCheck(BST_CHECKED); }
LRESULT CGitProgressDlg::OnCmdEnd(WPARAM /*wParam*/, LPARAM /*lParam*/) { RefreshCursor(); DialogEnableWindow(IDCANCEL, FALSE); DialogEnableWindow(IDOK, TRUE); m_PostCmdList.clear(); if (m_ProgList.m_Command->m_PostCmdCallback) m_ProgList.m_Command->m_PostCmdCallback(m_ProgList.DidErrorsOccur() ? 1 : 0, m_PostCmdList); if (!m_PostCmdList.empty()) { int i = 0; for (const auto& entry : m_PostCmdList) { ++i; m_cMenuButton.AddEntry(entry.icon, entry.label); TCHAR accellerator = CStringUtils::GetAccellerator(entry.label); if (accellerator == L'\0') continue; ++m_accellerators[accellerator].cnt; if (m_accellerators[accellerator].cnt > 1) m_accellerators[accellerator].id = -1; else m_accellerators[accellerator].id = i - 1; } if (m_accellerators.size()) { LPACCEL lpaccelNew = (LPACCEL)LocalAlloc(LPTR, m_accellerators.size() * sizeof(ACCEL)); SCOPE_EXIT { LocalFree(lpaccelNew); }; i = 0; for (auto& entry : m_accellerators) { lpaccelNew[i].cmd = (WORD)(WM_USER + 1 + entry.second.id); lpaccelNew[i].fVirt = FVIRTKEY | FALT; lpaccelNew[i].key = entry.first; entry.second.wmid = lpaccelNew[i].cmd; ++i; } m_hAccel = CreateAcceleratorTable(lpaccelNew, (int)m_accellerators.size()); }
// CResetDlg message handlers BOOL CResetDlg::OnInitDialog() { CHorizontalResizableStandAloneDialog::OnInitDialog(); CAppUtils::MarkWindowAsUnpinnable(m_hWnd); AddAnchor(IDC_SHOW_MODIFIED_FILES, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_GROUP_RESET_TYPE, TOP_LEFT, TOP_RIGHT); AddAnchor(IDOK, BOTTOM_RIGHT); AddAnchor(IDCANCEL, BOTTOM_RIGHT); AddAnchor(IDHELP, BOTTOM_RIGHT); CHOOSE_VERSION_ADDANCHOR; this->AddOthersToAnchor(); AdjustControlSize(IDC_RADIO_BRANCH); AdjustControlSize(IDC_RADIO_TAGS); AdjustControlSize(IDC_RADIO_VERSION); AdjustControlSize(IDC_RADIO_RESET_SOFT); AdjustControlSize(IDC_RADIO_RESET_MIXED); AdjustControlSize(IDC_RADIO_RESET_HARD); EnableSaveRestore(_T("ResetDlg")); CString resetTo; CString currentBranch = g_Git.GetCurrentBranch(); resetTo.Format(IDS_PROC_RESETBRANCH, currentBranch); GetDlgItem(IDC_GROUP_BASEON)->SetWindowTextW(resetTo); if (g_GitAdminDir.IsBareRepo(g_Git.m_CurrentDir)) { m_ResetType = 0; DialogEnableWindow(IDC_RADIO_RESET_MIXED, FALSE); DialogEnableWindow(IDC_RADIO_RESET_HARD, FALSE); } this->CheckRadioButton(IDC_RADIO_RESET_SOFT,IDC_RADIO_RESET_HARD,IDC_RADIO_RESET_SOFT+m_ResetType); InitChooseVersion(); SetDefaultChoose(IDC_RADIO_BRANCH); GetDlgItem(IDC_RADIO_RESET_SOFT + m_ResetType)->SetFocus(); return FALSE; }
void CExportDlg::OnCbnEditchangeUrlcombo() { // find out what to use as the checkout directory name UpdateData(); m_URLCombo.GetWindowText(m_URL); if (m_URL.IsEmpty()) { DialogEnableWindow(IDC_BROWSE, FALSE); return; } DialogEnableWindow(IDC_BROWSE, TRUE); if (!m_bAutoCreateTargetName) return; if ((m_sExportDirOrig.IsEmpty())||(m_blockPathAdjustments)) return; CString name = CAppUtils::GetProjectNameFromURL(m_URL); m_strExportDirectory = m_sExportDirOrig+'\\'+name; m_strExportDirectory.Replace(L":\\\\", L":\\"); UpdateData(FALSE); }
UINT CCreatePatch::PatchThread() { // get the status of all selected file/folders recursively // and show the ones which can be included in a patch (i.e. the versioned and not-normal ones) DialogEnableWindow(IDOK, false); DialogEnableWindow(IDC_SHOWUNVERSIONED, false); m_bCancelled = false; if (!m_PatchList.GetStatus(m_pathList)) { m_PatchList.SetEmptyString(m_PatchList.GetLastErrorMessage()); } m_PatchList.Show( ShowMask(), CTSVNPathList(), SVNSLC_SHOWDIRECTFILES | SVNSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALSFROMDIFFERENTREPOS, true, true); DialogEnableWindow(IDC_SHOWUNVERSIONED, true); InterlockedExchange(&m_bThreadRunning, FALSE); return 0; }
UINT CChangedDlg::ChangedStatusThread() { InterlockedExchange(&m_bBlock, TRUE); g_Git.RefreshGitIndex(); m_bCanceled = false; SetDlgItemText(IDOK, CString(MAKEINTRESOURCE(IDS_MSGBOX_CANCEL))); DialogEnableWindow(IDC_REFRESH, FALSE); DialogEnableWindow(IDC_SHOWUNVERSIONED, FALSE); DialogEnableWindow(IDC_SHOWUNMODIFIED, FALSE); DialogEnableWindow(IDC_SHOWIGNORED, FALSE); DialogEnableWindow(IDC_SHOWLOCALCHANGESIGNORED, FALSE); CString temp; m_FileListCtrl.Clear(); if (!m_FileListCtrl.GetStatus(m_bWholeProject ? nullptr : &m_pathList, m_bRemote, m_bShowIgnored != FALSE, m_bShowUnversioned != FALSE, m_bShowLocalChangesIgnored != FALSE)) { if (!m_FileListCtrl.GetLastErrorMessage().IsEmpty()) m_FileListCtrl.SetEmptyString(m_FileListCtrl.GetLastErrorMessage()); } unsigned int dwShow = GITSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALS | GITSLC_SHOWLOCKS | GITSLC_SHOWSWITCHED | GITSLC_SHOWINCHANGELIST; dwShow |= m_bShowUnversioned ? GITSLC_SHOWUNVERSIONED : 0; dwShow |= m_iShowUnmodified ? GITSLC_SHOWNORMAL : 0; dwShow |= m_bShowIgnored ? GITSLC_SHOWIGNORED : 0; dwShow |= m_bShowLocalChangesIgnored ? GITSLC_SHOWASSUMEVALID | GITSLC_SHOWSKIPWORKTREE : 0; m_FileListCtrl.Show(dwShow); UpdateStatistics(); SetDlgTitle(); bool bIsDirectory = false; if (m_pathList.GetCount() == 1) bIsDirectory = m_pathList[0].IsDirectory() || m_pathList[0].IsEmpty(); // if it is empty it is g_Git.m_CurrentDir which is a directory SetDlgItemText(IDOK, CString(MAKEINTRESOURCE(IDS_MSGBOX_OK))); DialogEnableWindow(IDC_REFRESH, TRUE); DialogEnableWindow(IDC_SHOWUNVERSIONED, bIsDirectory); //DialogEnableWindow(IDC_SHOWUNMODIFIED, bIsDirectory); DialogEnableWindow(IDC_SHOWIGNORED, bIsDirectory); DialogEnableWindow(IDC_SHOWLOCALCHANGESIGNORED, TRUE); InterlockedExchange(&m_bBlock, FALSE); // revert the remote flag back to the default m_bRemote = !!(DWORD)CRegDWORD(_T("Software\\TortoiseGit\\CheckRepo"), FALSE); RefreshCursor(); return 0; }
BOOL CCheckForUpdatesDlg::OnInitDialog() { CStandAloneDialog::OnInitDialog(); CAppUtils::MarkWindowAsUnpinnable(m_hWnd); CString temp; temp.Format(IDS_CHECKNEWER_YOURVERSION, TGIT_VERMAJOR, TGIT_VERMINOR, TGIT_VERMICRO, TGIT_VERBUILD); SetDlgItemText(IDC_YOURVERSION, temp); DialogEnableWindow(IDOK, FALSE); m_pTaskbarList.Release(); if (FAILED(m_pTaskbarList.CoCreateInstance(CLSID_TaskbarList))) m_pTaskbarList = nullptr; // hide download controls m_ctrlFiles.ShowWindow(SW_HIDE); GetDlgItem(IDC_GROUP_DOWNLOADS)->ShowWindow(SW_HIDE); RECT rectWindow, rectGroupDownloads, rectOKButton; GetWindowRect(&rectWindow); GetDlgItem(IDC_GROUP_DOWNLOADS)->GetWindowRect(&rectGroupDownloads); GetDlgItem(IDOK)->GetWindowRect(&rectOKButton); LONG bottomDistance = rectWindow.bottom - rectOKButton.bottom; OffsetRect(&rectOKButton, 0, rectGroupDownloads.top - rectOKButton.top); rectWindow.bottom = rectOKButton.bottom + bottomDistance; MoveWindow(&rectWindow); ::MapWindowPoints(nullptr, GetSafeHwnd(), (LPPOINT)&rectOKButton, 2); GetDlgItem(IDOK)->MoveWindow(&rectOKButton); temp.LoadString(IDS_STATUSLIST_COLFILE); m_ctrlFiles.InsertColumn(0, temp, 0, -1); m_ctrlFiles.InsertColumn(1, temp, 0, -1); m_ctrlFiles.SetExtendedStyle(LVS_EX_DOUBLEBUFFER | LVS_EX_CHECKBOXES); m_ctrlFiles.SetColumnWidth(0, 350); m_ctrlFiles.SetColumnWidth(1, 200); m_cLogMessage.Init(-1); m_cLogMessage.SetFont((CString)CRegString(_T("Software\\TortoiseGit\\LogFontName"), _T("Courier New")), (DWORD)CRegDWORD(_T("Software\\TortoiseGit\\LogFontSize"), 8)); m_cLogMessage.Call(SCI_SETREADONLY, TRUE); m_updateDownloader = new CUpdateDownloader(GetSafeHwnd(), m_bForce == TRUE, WM_USER_DISPLAYSTATUS, &m_eventStop); if (!AfxBeginThread(CheckThreadEntry, this)) { CMessageBox::Show(nullptr, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR); } SetTimer(100, 1000, nullptr); return TRUE; }
void CPullFetchDlg::OnBnClickedRd() { if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_REMOTE_RD) { m_Remote.EnableWindow(TRUE); m_Other.EnableWindow(FALSE); DialogEnableWindow(IDC_CHECK_REBASE, TRUE); m_bRebase = m_bRebaseActivatedInConfigForPull; UpdateData(FALSE); if(!m_IsPull) m_RemoteBranch.EnableWindow(FALSE); } if( GetCheckedRadioButton(IDC_REMOTE_RD,IDC_OTHER_RD) == IDC_OTHER_RD) { CString clippath = CAppUtils::GetClipboardLink(m_IsPull ? _T("git pull") : _T("git fetch"), 1); if (clippath.IsEmpty()) m_Other.SetCurSel(0); else { int argSeparator = clippath.Find(' '); if (argSeparator > 1 && clippath.GetLength() > argSeparator + 2) { m_Other.SetWindowText(clippath.Left(argSeparator)); m_RemoteBranch.SetWindowText(clippath.Mid(argSeparator + 1)); } else m_Other.SetWindowText(clippath); } m_Remote.EnableWindow(FALSE); m_Other.EnableWindow(TRUE);; DialogEnableWindow(IDC_CHECK_REBASE, FALSE); m_bRebase = FALSE; UpdateData(FALSE); if(!m_IsPull) m_RemoteBranch.EnableWindow(TRUE); } }