BOOL CExportDlg::OnInitDialog() { CHorizontalResizableStandAloneDialog::OnInitDialog(); CAppUtils::MarkWindowAsUnpinnable(m_hWnd); if (g_Git.m_CurrentDir == m_orgPath.GetWinPathString()) { GetDlgItem(IDC_WHOLE_PROJECT)->EnableWindow(FALSE); ((CButton *)GetDlgItem(IDC_WHOLE_PROJECT))->SetCheck(TRUE); } AddAnchor(IDC_REPOGROUP, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_EXPORTFILE_LABEL, TOP_LEFT); AddAnchor(IDC_EXPORTFILE_BROWSE, TOP_RIGHT); AddAnchor(IDC_EXPORTFILE, TOP_LEFT, TOP_RIGHT); AddAnchor(IDOK, BOTTOM_RIGHT); AddAnchor(IDCANCEL, BOTTOM_RIGHT); AddAnchor(IDHELP, BOTTOM_RIGHT); AdjustControlSize(IDC_RADIO_BRANCH); AdjustControlSize(IDC_RADIO_TAGS); AdjustControlSize(IDC_RADIO_VERSION); SetDlgTitle(); CHOOSE_VERSION_ADDANCHOR; this->AddOthersToAnchor(); InitChooseVersion(); if (m_initialRefName.IsEmpty() || m_initialRefName == _T("HEAD")) { SetDefaultChoose(IDC_RADIO_HEAD); } else if (m_initialRefName.Left(10) == _T("refs/tags/")) SetDefaultChoose(IDC_RADIO_TAGS); CWnd* pHead = GetDlgItem(IDC_RADIO_HEAD); CString headText; pHead->GetWindowText(headText); pHead->SetWindowText(headText + " (" + g_Git.GetCurrentBranch() + ")"); AdjustControlSize(IDC_RADIO_HEAD); m_tooltips.AddTool(IDC_EXPORTFILE, IDS_EXPORTFILE_TT); SHAutoComplete(GetDlgItem(IDC_EXPORTFILE)->m_hWnd, SHACF_FILESYSTEM); if ((m_pParentWnd==NULL)&&(hWndExplorer)) CenterWindow(CWnd::FromHandle(hWndExplorer)); EnableSaveRestore(_T("ExportDlg")); return TRUE; }
BOOL CGitSwitchDlg::OnInitDialog() { CHorizontalResizableStandAloneDialog::OnInitDialog(); CAppUtils::MarkWindowAsUnpinnable(m_hWnd); AdjustControlSize(IDC_RADIO_BRANCH); AdjustControlSize(IDC_RADIO_TAGS); AdjustControlSize(IDC_RADIO_VERSION); AdjustControlSize(IDC_CHECK_BRANCH); AdjustControlSize(IDC_CHECK_FORCE); AdjustControlSize(IDC_CHECK_MERGE); AdjustControlSize(IDC_CHECK_TRACK); AdjustControlSize(IDC_CHECK_BRANCHOVERRIDE); AddAnchor(IDC_GROUP_OPTION, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_EDIT_BRANCH, TOP_LEFT, TOP_RIGHT); AddAnchor(IDOK,BOTTOM_RIGHT); AddAnchor(IDCANCEL,BOTTOM_RIGHT); AddAnchor(IDHELP,BOTTOM_RIGHT); CHOOSE_VERSION_ADDANCHOR; this->AddOthersToAnchor(); EnableSaveRestore(L"SwitchDlg"); CString sWindowTitle; GetWindowText(sWindowTitle); CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle); InitChooseVersion(true); SetDefaultChoose(IDC_RADIO_BRANCH); GetDlgItem(IDC_CHECK_BRANCH)->SetFocus(); this->GetDlgItem(IDC_CHECK_TRACK)->EnableWindow(FALSE); m_tooltips.AddTool(GetDlgItem(IDC_CHECK_BRANCHOVERRIDE), CString(MAKEINTRESOURCE(IDS_PROC_NEWBRANCHTAG_FORCE_TT))); m_tooltips.AddTool(GetDlgItem(IDC_CHECK_MERGE), CString(MAKEINTRESOURCE(IDS_PROC_SWITCH_MERGE_TT))); m_tooltips.AddTool(GetDlgItem(IDC_CHECK_TRACK), CString(MAKEINTRESOURCE(IDS_PROC_NEWBRANCHTAG_TRACK_TT))); m_tooltips.Activate(TRUE); return FALSE; }
// 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; }
BOOL CMergeDlg::OnInitDialog() { CResizableStandAloneDialog::OnInitDialog(); CAppUtils::MarkWindowAsUnpinnable(m_hWnd); CHOOSE_VERSION_ADDANCHOR; AddAnchor(IDC_GROUP_OPTION, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_STATIC_MERGE_MESSAGE,TOP_LEFT,BOTTOM_RIGHT); AddAnchor(IDC_LOGMESSAGE,TOP_LEFT,BOTTOM_RIGHT); AddAnchor(IDOK,BOTTOM_RIGHT); AddAnchor(IDCANCEL,BOTTOM_RIGHT); AddAnchor(IDHELP, BOTTOM_RIGHT); this->AddOthersToAnchor(); AdjustControlSize(IDC_RADIO_BRANCH); AdjustControlSize(IDC_RADIO_TAGS); AdjustControlSize(IDC_RADIO_VERSION); AdjustControlSize(IDC_CHECK_SQUASH); AdjustControlSize(IDC_CHECK_NOFF); AdjustControlSize(IDC_CHECK_NOCOMMIT); AdjustControlSize(IDC_CHECK_MERGE_LOG); CheckRadioButton(IDC_RADIO_BRANCH,IDC_RADIO_VERSION,IDC_RADIO_BRANCH); this->SetDefaultChoose(IDC_RADIO_BRANCH); CString sWindowTitle; GetWindowText(sWindowTitle); CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle); m_ProjectProperties.ReadProps(); m_cLogMessage.Init(m_ProjectProperties); m_cLogMessage.SetFont(CAppUtils::GetLogFontName(), CAppUtils::GetLogFontSize()); m_cLogMessage.RegisterContextMenuHandler(this); m_cLogMessage.SetText(m_pDefaultText); m_cLogMessage.EnableWindow(!m_bSquash); if (m_bSquash) m_cLogMessage.SetAStyle(STYLE_DEFAULT, ::GetSysColor(COLOR_GRAYTEXT), ::GetSysColor(COLOR_BTNFACE)); m_History.SetMaxHistoryItems((LONG)CRegDWORD(L"Software\\TortoiseGit\\MaxHistoryItems", 25)); ReloadHistoryEntries(); ((CComboBox*)GetDlgItem(IDC_COMBO_MERGESTRATEGY))->AddString(L"resolve"); ((CComboBox*)GetDlgItem(IDC_COMBO_MERGESTRATEGY))->AddString(L"recursive"); ((CComboBox*)GetDlgItem(IDC_COMBO_MERGESTRATEGY))->AddString(L"ours"); ((CComboBox*)GetDlgItem(IDC_COMBO_MERGESTRATEGY))->AddString(L"subtree"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"ours"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"theirs"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"patience"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"ignore-space-change"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"ignore-all-space"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"ignore-space-at-eol"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"renormalize"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"no-renormalize"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"rename-threshold"); ((CComboBox*)GetDlgItem(IDC_COMBO_STRATEGYOPTION))->AddString(L"subtree"); EnableSaveRestore(L"MergeDlg"); GetDlgItem(IDOK)->SetFocus(); InitChooseVersion(true); return FALSE; }
BOOL CCreateBranchTagDlg::OnInitDialog() { CResizableStandAloneDialog::OnInitDialog(); CAppUtils::MarkWindowAsUnpinnable(m_hWnd); CHOOSE_VERSION_ADDANCHOR; AddAnchor(IDC_GROUP_BRANCH, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_GROUP_OPTION, TOP_LEFT, TOP_RIGHT); AddAnchor(IDOK,BOTTOM_RIGHT); AddAnchor(IDCANCEL,BOTTOM_RIGHT); AddAnchor(IDHELP, BOTTOM_RIGHT); AddAnchor(IDC_GROUP_MESSAGE,TOP_LEFT,BOTTOM_RIGHT); AddAnchor(IDC_EDIT_MESSAGE,TOP_LEFT,BOTTOM_RIGHT); this->AddOthersToAnchor(); AdjustControlSize(IDC_RADIO_BRANCH); AdjustControlSize(IDC_RADIO_TAGS); AdjustControlSize(IDC_RADIO_VERSION); AdjustControlSize(IDC_CHECK_TRACK); AdjustControlSize(IDC_CHECK_FORCE); AdjustControlSize(IDC_CHECK_SWITCH); AdjustControlSize(IDC_CHECK_SIGN); this->SetDefaultChoose(IDC_RADIO_HEAD); InitChooseVersion(); this->GetDlgItem(IDC_CHECK_TRACK)->EnableWindow(FALSE); CString sWindowTitle; if(this->m_bIsTag) { sWindowTitle = CString(MAKEINTRESOURCE(IDS_PROGS_TITLE_CREATETAG)); this->GetDlgItem(IDC_LABEL_BRANCH)->SetWindowText(CString(MAKEINTRESOURCE(IDS_PROC_TAG))); this->GetDlgItem(IDC_CHECK_SIGN)->EnableWindow(!g_Git.GetConfigValue(_T("user.signingkey")).IsEmpty()); } else { sWindowTitle = CString(MAKEINTRESOURCE(IDS_PROGS_TITLE_CREATEBRANCH)); this->GetDlgItem(IDC_LABEL_BRANCH)->SetWindowText(CString(MAKEINTRESOURCE(IDS_PROC_BRANCH))); this->GetDlgItem(IDC_EDIT_MESSAGE)->EnableWindow(FALSE); this->GetDlgItem(IDC_CHECK_SIGN)->ShowWindow(SW_HIDE); } CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle); // show the switch checkbox if we are a create branch dialog this->GetDlgItem(IDC_CHECK_SWITCH)->ShowWindow(!m_bIsTag && !GitAdminDir::IsBareRepo(g_Git.m_CurrentDir)); CWnd* pHead = GetDlgItem(IDC_RADIO_HEAD); CString HeadText; pHead->GetWindowText( HeadText ); pHead->SetWindowText( HeadText + " (" + g_Git.GetCurrentBranch() + ")"); AdjustControlSize(IDC_RADIO_HEAD); EnableSaveRestore(_T("BranchTagDlg")); m_tooltips.AddTool(GetDlgItem(IDC_CHECK_FORCE), CString(MAKEINTRESOURCE(IDS_PROC_NEWBRANCHTAG_FORCE_TT))); m_tooltips.AddTool(GetDlgItem(IDC_CHECK_SIGN), CString(MAKEINTRESOURCE(IDS_PROC_NEWBRANCHTAG_SIGN_TT))); m_tooltips.AddTool(GetDlgItem(IDC_CHECK_TRACK), CString(MAKEINTRESOURCE(IDS_PROC_NEWBRANCHTAG_TRACK_TT))); m_tooltips.Activate(TRUE); OnCbnSelchangeComboboxexBranch(); return TRUE; }