示例#1
0
void CFileDiffDlg::OnBnClickedRev2btn()
{
	if (m_bThreadRunning)
		return;	// do nothing as long as the thread is still running

	// show a dialog where the user can enter a revision
	CRevisionDlg dlg(this);
	dlg.AllowWCRevs(false);
	dlg.SetLogPath(m_path2, m_rev2);
	*((SVNRev*)&dlg) = m_rev2;

	if (dlg.DoModal() == IDOK)
	{
		m_rev2 = dlg;
		m_cRev2Btn.SetWindowText(m_rev2.ToString());
		m_cFileList.DeleteAllItems();
		// start a new thread to re-fetch the diff
		InterlockedExchange(&m_bThreadRunning, TRUE);
		if (AfxBeginThread(DiffThreadEntry, this)==NULL)
		{
			InterlockedExchange(&m_bThreadRunning, FALSE);
			OnCantStartThread();
		}
	}
}
示例#2
0
BOOL CDeleteUnversionedDlg::PreTranslateMessage(MSG* pMsg)
{
    if (pMsg->message == WM_KEYDOWN)
    {
        switch (pMsg->wParam)
        {
        case VK_RETURN:
            if(OnEnterPressed())
                return TRUE;
            break;
        case VK_F5:
            {
                if (!m_bThreadRunning)
                {
                    if (AfxBeginThread(StatusThreadEntry, this)==0)
                    {
                        OnCantStartThread();
                    }
                    else
                        InterlockedExchange(&m_bThreadRunning, TRUE);
                }
            }
            break;
        }
    }

    return CResizableStandAloneDialog::PreTranslateMessage(pMsg);
}
示例#3
0
LRESULT CDeleteUnversionedDlg::OnSVNStatusListCtrlNeedsRefresh(WPARAM, LPARAM)
{
    if (AfxBeginThread(StatusThreadEntry, this)==0)
    {
        OnCantStartThread();
    }
    return 0;
}
示例#4
0
void CLockDlg::Refresh()
{
    m_bBlock = TRUE;
    if (AfxBeginThread(StatusThreadEntry, this)==NULL)
    {
        OnCantStartThread();
    }
}
示例#5
0
LRESULT CRevertDlg::OnSVNStatusListCtrlNeedsRefresh(WPARAM, LPARAM)
{
    if (AfxBeginThread(RevertThreadEntry, this)==0)
    {
        OnCantStartThread();
    }
    return 0;
}
示例#6
0
LRESULT CUnlockDlg::OnSVNStatusListCtrlNeedsRefresh(WPARAM, LPARAM)
{
    if(AfxBeginThread(UnlockThreadEntry, this) == NULL)
    {
        OnCantStartThread();
    }
    return 0;
}
示例#7
0
LRESULT CCreatePatch::OnSVNStatusListCtrlNeedsRefresh(WPARAM, LPARAM)
{
    if(AfxBeginThread(PatchThreadEntry, this) == NULL)
    {
        OnCantStartThread();
    }
    return 0;
}
示例#8
0
BOOL CCreatePatch::OnInitDialog()
{
    CResizableStandAloneDialog::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

    ExtendFrameIntoClientArea(IDC_PATCHLIST, IDC_PATCHLIST, IDC_PATCHLIST, IDC_PATCHLIST);
    m_aeroControls.SubclassControl(this, IDC_SHOWUNVERSIONED);
    m_aeroControls.SubclassControl(this, IDC_SELECTALL);
    m_aeroControls.SubclassControl(this, IDC_DIFFOPTIONS);
    m_aeroControls.SubclassOkCancelHelp(this);

    m_regAddBeforeCommit = CRegDWORD(_T("Software\\TortoiseSVN\\AddBeforeCommit"), TRUE);
    m_bShowUnversioned = m_regAddBeforeCommit;
    UpdateData(FALSE);

    m_PatchList.Init(0, _T("CreatePatchDlg"), SVNSLC_POPALL ^ (SVNSLC_POPIGNORE|SVNSLC_POPCOMMIT|SVNSLC_POPCREATEPATCH|SVNSLC_POPRESTORE));
    m_PatchList.SetConfirmButton((CButton*)GetDlgItem(IDOK));
    m_PatchList.SetSelectButton(&m_SelectAll);
    m_PatchList.SetCancelBool(&m_bCancelled);
    m_PatchList.EnableFileDrop();
    m_PatchList.SetRevertMode(true);

    CString sWindowTitle;
    GetWindowText(sWindowTitle);
    CAppUtils::SetWindowTitle(m_hWnd, m_pathList.GetCommonRoot().GetUIPathString(), sWindowTitle);

    AdjustControlSize(IDC_SELECTALL);
    AdjustControlSize(IDC_SHOWUNVERSIONED);

    AddAnchor(IDC_PATCHLIST, TOP_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_SELECTALL, BOTTOM_LEFT);
    AddAnchor(IDC_SHOWUNVERSIONED, BOTTOM_LEFT);
    AddAnchor(IDC_DIFFOPTIONS, BOTTOM_LEFT);
    AddAnchor(IDOK, BOTTOM_RIGHT);
    AddAnchor(IDCANCEL, BOTTOM_RIGHT);
    AddAnchor(IDHELP, BOTTOM_RIGHT);
    if (GetExplorerHWND())
        CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
    EnableSaveRestore(_T("CreatePatchDlg"));

    // first start a thread to obtain the file list with the status without
    // blocking the dialog
    if(AfxBeginThread(PatchThreadEntry, this) == NULL)
    {
        OnCantStartThread();
    }
    InterlockedExchange(&m_bThreadRunning, TRUE);

    return TRUE;
}
示例#9
0
BOOL CRevertDlg::OnInitDialog()
{
    CResizableStandAloneDialog::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

    ExtendFrameIntoClientArea(IDC_REVERTLIST, IDC_REVERTLIST, IDC_REVERTLIST, IDC_REVERTLIST);
    m_aeroControls.SubclassControl(this, IDC_SELECTALL);
    m_aeroControls.SubclassControl(this, IDC_CLEARCHANGELISTS);
    m_aeroControls.SubclassControl(this, IDC_UNVERSIONEDITEMS);
    m_aeroControls.SubclassControl(this, IDC_DELUNVERSIONED);
    m_aeroControls.SubclassControl(this, ID_OK);
    m_aeroControls.SubclassOkCancelHelp(this);

    m_RevertList.Init(SVNSLC_COLEXT | SVNSLC_COLSTATUS | SVNSLC_COLPROPSTATUS, L"RevertDlg");
    m_RevertList.SetConfirmButton((CButton*)GetDlgItem(ID_OK));
    m_RevertList.SetSelectButton(&m_SelectAll);
    m_RevertList.SetCancelBool(&m_bCancelled);
    m_RevertList.SetBackgroundImage(IDI_REVERT_BKG);
    m_RevertList.EnableFileDrop();
    m_RevertList.SetRevertMode(true);

    GetWindowText(m_sWindowTitle);

    AdjustControlSize(IDC_SELECTALL);
    AdjustControlSize(IDC_CLEARCHANGELISTS);

    AddAnchor(IDC_REVERTLIST, TOP_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_SELECTALL, BOTTOM_LEFT);
    AddAnchor(IDC_CLEARCHANGELISTS, BOTTOM_LEFT);
    AddAnchor(IDC_UNVERSIONEDITEMS, BOTTOM_RIGHT);
    AddAnchor(IDC_DELUNVERSIONED, BOTTOM_LEFT);
    AddAnchor(ID_OK, BOTTOM_RIGHT);
    AddAnchor(IDCANCEL, BOTTOM_RIGHT);
    AddAnchor(IDHELP, BOTTOM_RIGHT);
    if (GetExplorerHWND())
        CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
    EnableSaveRestore(L"RevertDlg");

    // first start a thread to obtain the file list with the status without
    // blocking the dialog
    if (AfxBeginThread(RevertThreadEntry, this)==0)
    {
        OnCantStartThread();
    }
    InterlockedExchange(&m_bThreadRunning, TRUE);

    return TRUE;
}
示例#10
0
BOOL CAddDlg::OnInitDialog()
{
    CResizableStandAloneDialog::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

    ExtendFrameIntoClientArea(IDC_ADDLIST, IDC_ADDLIST, IDC_ADDLIST, IDC_ADDLIST);
    m_aeroControls.SubclassControl(this, IDC_SELECTALL);
    m_aeroControls.SubclassControl(this, IDC_USEAUTOPROPS);
    m_aeroControls.SubclassOkCancelHelp(this);

    // initialize the svn status list control
    m_addListCtrl.Init(SVNSLC_COLEXT, _T("AddDlg"), SVNSLC_POPALL ^ (SVNSLC_POPADD|SVNSLC_POPCOMMIT|SVNSLC_POPCHANGELISTS|SVNSLC_POPCREATEPATCH|SVNSLC_POPRESTORE)); // adding and committing is useless in the add dialog
    m_addListCtrl.SetIgnoreRemoveOnly();    // when ignoring, don't add the parent folder since we're in the add dialog
    m_addListCtrl.SetUnversionedRecurse(true);  // recurse into unversioned folders - user might want to add those too
    m_addListCtrl.SetSelectButton(&m_SelectAll);
    m_addListCtrl.SetConfirmButton((CButton*)GetDlgItem(IDOK));
    m_addListCtrl.SetEmptyString(IDS_ERR_NOTHINGTOADD);
    m_addListCtrl.SetCancelBool(&m_bCancelled);
    m_addListCtrl.SetBackgroundImage(IDI_ADD_BKG);
    m_addListCtrl.EnableFileDrop();

    CString sWindowTitle;
    GetWindowText(sWindowTitle);
    CAppUtils::SetWindowTitle(m_hWnd, m_pathList.GetCommonRoot().GetUIPathString(), sWindowTitle);

    AdjustControlSize(IDC_SELECTALL);

    AddAnchor(IDC_ADDLIST, TOP_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_SELECTALL, BOTTOM_LEFT);
    AddAnchor(IDC_USEAUTOPROPS, BOTTOM_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDOK, BOTTOM_RIGHT);
    AddAnchor(IDCANCEL, BOTTOM_RIGHT);
    AddAnchor(IDHELP, BOTTOM_RIGHT);
    if (GetExplorerHWND())
        CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
    EnableSaveRestore(_T("AddDlg"));

    //first start a thread to obtain the file list with the status without
    //blocking the dialog
    if(AfxBeginThread(AddThreadEntry, this) == NULL)
    {
        OnCantStartThread();
    }
    InterlockedExchange(&m_bThreadRunning, TRUE);

    return TRUE;
}
示例#11
0
BOOL CDeleteUnversionedDlg::OnInitDialog()
{
    CResizableStandAloneDialog::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

    ExtendFrameIntoClientArea(IDC_ITEMLIST, IDC_ITEMLIST, IDC_ITEMLIST, IDC_ITEMLIST);
    m_aeroControls.SubclassControl(this, IDC_SELECTALL);
    m_aeroControls.SubclassControl(this, IDC_USERECYCLEBIN);
    m_aeroControls.SubclassOkCancel(this);

    m_StatusList.Init(SVNSLC_COLEXT | SVNSLC_COLSTATUS, _T("DeleteUnversionedDlg"), 0, true);
    m_StatusList.SetUnversionedRecurse(true);
    m_StatusList.PutUnversionedLast(false);
    m_StatusList.CheckChildrenWithParent(true);
    m_StatusList.SetConfirmButton((CButton*)GetDlgItem(IDOK));
    m_StatusList.SetSelectButton(&m_SelectAll);
    m_StatusList.SetCancelBool(&m_bCancelled);
    m_StatusList.SetBackgroundImage(IDI_DELUNVERSIONED_BKG);

    GetWindowText(m_sWindowTitle);

    AdjustControlSize(IDC_SELECTALL);

    AddAnchor(IDC_ITEMLIST, TOP_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_SELECTALL, BOTTOM_LEFT);
    AddAnchor(IDC_USERECYCLEBIN, BOTTOM_LEFT);
    AddAnchor(IDOK, BOTTOM_RIGHT);
    AddAnchor(IDCANCEL, BOTTOM_RIGHT);
    if (GetExplorerHWND())
        CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
    EnableSaveRestore(_T("DeleteUnversionedDlg"));

    // first start a thread to obtain the file list with the status without
    // blocking the dialog
    if (AfxBeginThread(StatusThreadEntry, this)==0)
    {
        OnCantStartThread();
    }
    InterlockedExchange(&m_bThreadRunning, TRUE);

    return TRUE;
}
示例#12
0
BOOL CResolveDlg::OnInitDialog()
{
    CResizableStandAloneDialog::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

    ExtendFrameIntoClientArea(IDC_RESOLVELIST, IDC_RESOLVELIST, IDC_RESOLVELIST, IDC_RESOLVELIST);
    m_aeroControls.SubclassControl(this, IDC_SELECTALL);
    m_aeroControls.SubclassOkCancelHelp(this);

    m_resolveListCtrl.Init(SVNSLC_COLEXT | SVNSLC_COLSTATUS | SVNSLC_COLPROPSTATUS, L"ResolveDlg", SVNSLC_POPALL ^ (SVNSLC_POPIGNORE|SVNSLC_POPADD|SVNSLC_POPCOMMIT|SVNSLC_POPCREATEPATCH|SVNSLC_POPRESTORE));
    m_resolveListCtrl.SetConfirmButton((CButton*)GetDlgItem(IDOK));
    m_resolveListCtrl.SetSelectButton(&m_SelectAll);
    m_resolveListCtrl.SetCancelBool(&m_bCancelled);
    m_resolveListCtrl.SetBackgroundImage(IDI_RESOLVE_BKG);
    m_resolveListCtrl.EnableFileDrop();

    CString sWindowTitle;
    GetWindowText(sWindowTitle);
    CAppUtils::SetWindowTitle(m_hWnd, m_pathList.GetCommonRoot().GetUIPathString(), sWindowTitle);

    AdjustControlSize(IDC_SELECTALL);

    AddAnchor(IDC_RESOLVELIST, TOP_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_SELECTALL, BOTTOM_LEFT);
    AddAnchor(IDOK, BOTTOM_RIGHT);
    AddAnchor(IDCANCEL, BOTTOM_RIGHT);
    AddAnchor(IDHELP, BOTTOM_RIGHT);
    if (GetExplorerHWND())
        CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
    EnableSaveRestore(L"ResolveDlg");

    // first start a thread to obtain the file list with the status without
    // blocking the dialog
    if(AfxBeginThread(ResolveThreadEntry, this) == NULL)
    {
        OnCantStartThread();
    }
    InterlockedExchange(&m_bThreadRunning, TRUE);

    return TRUE;
}
示例#13
0
BOOL CUnlockDlg::OnInitDialog()
{
    CResizableStandAloneDialog::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

    // initialize the svn status list control
    m_unlockListCtrl.Init(0, _T("UnlockDlg"), SVNSLC_POPALL ^ SVNSLC_POPRESTORE);
    m_unlockListCtrl.SetIgnoreRemoveOnly(); // when ignoring, don't add the parent folder since we're in the unlock dialog
    m_unlockListCtrl.SetSelectButton(&m_SelectAll);
    m_unlockListCtrl.SetConfirmButton((CButton*)GetDlgItem(IDOK));
    m_unlockListCtrl.SetEmptyString(IDS_ERR_NOTHINGTOUNLOCK);
    m_unlockListCtrl.SetCancelBool(&m_bCancelled);
    m_unlockListCtrl.SetBackgroundImage(IDI_UNLOCK_BKG);
    m_unlockListCtrl.EnableFileDrop();

    AdjustControlSize(IDC_SELECTALL);

    AddAnchor(IDC_UNLOCKLIST, TOP_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_SELECTALL, BOTTOM_LEFT);
    AddAnchor(IDOK, BOTTOM_RIGHT);
    AddAnchor(IDCANCEL, BOTTOM_RIGHT);
    AddAnchor(IDHELP, BOTTOM_RIGHT);
    if (GetExplorerHWND())
        CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
    EnableSaveRestore(_T("UnlockDlg"));

    CString sWindowTitle;
    GetWindowText(sWindowTitle);
    CAppUtils::SetWindowTitle(m_hWnd, m_pathList.GetCommonRoot().GetUIPathString(), sWindowTitle);

    //first start a thread to obtain the file list with the status without
    //blocking the dialog
    if(AfxBeginThread(UnlockThreadEntry, this) == NULL)
    {
        OnCantStartThread();
    }
    InterlockedExchange(&m_bThreadRunning, TRUE);

    return TRUE;
}
示例#14
0
BOOL CCopyDlg::OnInitDialog()
{
    CResizableStandAloneDialog::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

    ExtendFrameIntoClientArea(IDC_EXTGROUP);
    m_aeroControls.SubclassControl(this, IDC_DOSWITCH);
    m_aeroControls.SubclassControl(this, IDC_MAKEPARENTS);
    m_aeroControls.SubclassOkCancelHelp(this);
    m_bCancelled = false;

    DWORD exStyle = LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_CHECKBOXES;
    m_ExtList.SetExtendedStyle(exStyle);
    SetWindowTheme(m_ExtList.GetSafeHwnd(), L"Explorer", NULL);
    m_ExtList.ShowText(CString(MAKEINTRESOURCE(IDS_COPY_WAITFOREXTERNALS)));

    AdjustControlSize(IDC_COPYHEAD);
    AdjustControlSize(IDC_COPYREV);
    AdjustControlSize(IDC_COPYWC);
    AdjustControlSize(IDC_DOSWITCH);
    AdjustControlSize(IDC_MAKEPARENTS);

    CTSVNPath path(m_path);
    CString sWindowTitle;
    GetWindowText(sWindowTitle);
    CAppUtils::SetWindowTitle(m_hWnd, path.GetUIPathString(), sWindowTitle);

    m_History.SetMaxHistoryItems((LONG)CRegDWORD(L"Software\\TortoiseSVN\\MaxHistoryItems", 25));

    SetRevision(m_CopyRev);

    m_tooltips.AddTool(IDC_HISTORY, IDS_COMMITDLG_HISTORY_TT);

    if (SVN::PathIsURL(path))
    {
        DialogEnableWindow(IDC_COPYWC, FALSE);
        DialogEnableWindow(IDC_DOSWITCH, FALSE);
        SetDlgItemText(IDC_COPYSTARTLABEL, CString(MAKEINTRESOURCE(IDS_COPYDLG_FROMURL)));
    }

    SVN svn;
    CString sUUID;
    m_repoRoot = svn.GetRepositoryRootAndUUID(path, true, sUUID);
    m_repoRoot.TrimRight('/');
    m_wcURL = svn.GetURLFromPath(path);
    if (m_wcURL.IsEmpty() || (!path.IsUrl() && !path.Exists()))
    {
        CString Wrong_URL=path.GetSVNPathString();
        CString temp;
        temp.Format(IDS_ERR_NOURLOFFILE, (LPCTSTR)Wrong_URL);
        ::MessageBox(this->m_hWnd, temp, L"TortoiseSVN", MB_ICONERROR);
        this->EndDialog(IDCANCEL);      //exit
    }
    m_URLCombo.LoadHistory(L"Software\\TortoiseSVN\\History\\repoPaths\\"+sUUID, L"url");
    m_URLCombo.SetCurSel(0);
    CString relPath = m_wcURL.Mid(m_repoRoot.GetLength());
    if (!m_URL.IsEmpty())
    {
        // allow the use of urls relative to the repo root
        if (m_URL[0] != '^')
            relPath = m_URL.Mid(m_repoRoot.GetLength());
        else
            relPath = m_URL.Mid(1);
    }
    CTSVNPath r = CTSVNPath(relPath);
    relPath = r.GetUIPathString();
    relPath.Replace('\\', '/');
    m_URLCombo.AddString(relPath, 0);
    m_URLCombo.SelectString(-1, relPath);
    m_URL = m_wcURL;
    SetDlgItemText(IDC_DESTURL, CPathUtils::CombineUrls(m_repoRoot, relPath));
    SetDlgItemText(IDC_FROMURL, m_wcURL);

    CString reg;
    reg.Format(L"Software\\TortoiseSVN\\History\\commit%s", (LPCTSTR)sUUID);
    m_History.Load(reg, L"logmsgs");

    m_ProjectProperties.ReadProps(m_path);
    if (CRegDWORD(L"Software\\TortoiseSVN\\AlwaysWarnIfNoIssue", FALSE))
        m_ProjectProperties.bWarnIfNoIssue = TRUE;

    m_cLogMessage.Init(m_ProjectProperties);
    m_cLogMessage.SetFont((CString)CRegString(L"Software\\TortoiseSVN\\LogFontName", L"Courier New"), (DWORD)CRegDWORD(L"Software\\TortoiseSVN\\LogFontSize", 8));

    GetDlgItem(IDC_BUGTRAQBUTTON)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_BUGTRAQBUTTON)->EnableWindow(FALSE);
    CBugTraqAssociations bugtraq_associations;
    bugtraq_associations.Load(m_ProjectProperties.GetProviderUUID(), m_ProjectProperties.sProviderParams);

    if (bugtraq_associations.FindProvider(CTSVNPathList(m_path), &m_bugtraq_association))
    {
        CComPtr<IBugTraqProvider> pProvider;
        HRESULT hr = pProvider.CoCreateInstance(m_bugtraq_association.GetProviderClass());
        if (SUCCEEDED(hr))
        {
            m_BugTraqProvider = pProvider;
            ATL::CComBSTR temp;
            ATL::CComBSTR parameters;
            parameters.Attach(m_bugtraq_association.GetParameters().AllocSysString());
            hr = pProvider->GetLinkText(GetSafeHwnd(), parameters, &temp);
            if (SUCCEEDED(hr))
            {
                SetDlgItemText(IDC_BUGTRAQBUTTON, temp == 0 ? L"" : temp);
                GetDlgItem(IDC_BUGTRAQBUTTON)->EnableWindow(TRUE);
                GetDlgItem(IDC_BUGTRAQBUTTON)->ShowWindow(SW_SHOW);
            }
        }

        GetDlgItem(IDC_LOGMESSAGE)->SetFocus();
    }
    if (m_ProjectProperties.sMessage.IsEmpty())
    {
        GetDlgItem(IDC_BUGID)->ShowWindow(SW_HIDE);
        GetDlgItem(IDC_BUGIDLABEL)->ShowWindow(SW_HIDE);
        GetDlgItem(IDC_LOGMESSAGE)->SetFocus();
    }
    else
    {
        GetDlgItem(IDC_BUGID)->ShowWindow(SW_SHOW);
        GetDlgItem(IDC_BUGIDLABEL)->ShowWindow(SW_SHOW);
        if (!m_ProjectProperties.sLabel.IsEmpty())
            SetDlgItemText(IDC_BUGIDLABEL, m_ProjectProperties.sLabel);
        GetDlgItem(IDC_BUGID)->SetFocus();
    }

    if (!m_sLogMessage.IsEmpty())
        m_cLogMessage.SetText(m_sLogMessage);
    else
        m_cLogMessage.SetText(m_ProjectProperties.GetLogMsgTemplate(PROJECTPROPNAME_LOGTEMPLATEBRANCH));

    OnEnChangeLogmessage();

    m_linkControl.ConvertStaticToLink(m_hWnd, IDC_CHECKALL);
    m_linkControl.ConvertStaticToLink(m_hWnd, IDC_CHECKNONE);

    // line up all controls and adjust their sizes.
#define LINKSPACING 9
    RECT rc = AdjustControlSize(IDC_SELECTLABEL);
    rc.right -= 15; // AdjustControlSize() adds 20 pixels for the checkbox/radio button bitmap, but this is a label...
    rc = AdjustStaticSize(IDC_CHECKALL, rc, LINKSPACING);
    rc = AdjustStaticSize(IDC_CHECKNONE, rc, LINKSPACING);

    CAppUtils::SetAccProperty(m_cLogMessage.GetSafeHwnd(), PROPID_ACC_ROLE, ROLE_SYSTEM_TEXT);
    CAppUtils::SetAccProperty(m_cLogMessage.GetSafeHwnd(), PROPID_ACC_HELP, CString(MAKEINTRESOURCE(IDS_INPUT_ENTERLOG)));
    CAppUtils::SetAccProperty(m_cLogMessage.GetSafeHwnd(), PROPID_ACC_KEYBOARDSHORTCUT, L"Alt+"+CString(CAppUtils::FindAcceleratorKey(this, IDC_INVISIBLE)));

    CAppUtils::SetAccProperty(GetDlgItem(IDC_CHECKALL)->GetSafeHwnd(), PROPID_ACC_ROLE, ROLE_SYSTEM_LINK);
    CAppUtils::SetAccProperty(GetDlgItem(IDC_CHECKNONE)->GetSafeHwnd(), PROPID_ACC_ROLE, ROLE_SYSTEM_LINK);

    CAppUtils::SetAccProperty(m_URLCombo.GetSafeHwnd(), PROPID_ACC_KEYBOARDSHORTCUT, L"Alt+"+CString(CAppUtils::FindAcceleratorKey(this, IDC_TOURLLABEL)));
    CAppUtils::SetAccProperty(GetDlgItem(IDC_FROMURL)->GetSafeHwnd(), PROPID_ACC_KEYBOARDSHORTCUT, L"Alt+"+CString(CAppUtils::FindAcceleratorKey(this, IDC_COPYSTARTLABEL)));
    CAppUtils::SetAccProperty(GetDlgItem(IDC_DESTURL)->GetSafeHwnd(), PROPID_ACC_KEYBOARDSHORTCUT, L"Alt+"+CString(CAppUtils::FindAcceleratorKey(this, IDC_DESTLABEL)));

    AddAnchor(IDC_REPOGROUP, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_COPYSTARTLABEL, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_FROMURL, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_TOURLLABEL, TOP_LEFT);
    AddAnchor(IDC_URLCOMBO, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_BROWSE, TOP_RIGHT);
    AddAnchor(IDC_DESTLABEL, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_DESTURL, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_MSGGROUP, TOP_LEFT, MIDDLE_RIGHT);
    AddAnchor(IDC_HISTORY, TOP_LEFT);
    AddAnchor(IDC_BUGTRAQBUTTON, TOP_LEFT);
    AddAnchor(IDC_BUGIDLABEL, TOP_RIGHT);
    AddAnchor(IDC_BUGID, TOP_RIGHT);
    AddAnchor(IDC_INVISIBLE, TOP_RIGHT);
    AddAnchor(IDC_LOGMESSAGE, TOP_LEFT, MIDDLE_RIGHT);
    AddAnchor(IDC_FROMGROUP, MIDDLE_LEFT, MIDDLE_RIGHT);
    AddAnchor(IDC_COPYHEAD, MIDDLE_LEFT);
    AddAnchor(IDC_COPYREV, MIDDLE_LEFT);
    AddAnchor(IDC_COPYREVTEXT, MIDDLE_RIGHT);
    AddAnchor(IDC_BROWSEFROM, MIDDLE_RIGHT);
    AddAnchor(IDC_COPYWC, MIDDLE_LEFT);
    AddAnchor(IDC_EXTGROUP, MIDDLE_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_SELECTLABEL, MIDDLE_LEFT);
    AddAnchor(IDC_CHECKALL, MIDDLE_LEFT);
    AddAnchor(IDC_CHECKNONE, MIDDLE_LEFT);
    AddAnchor(IDC_EXTERNALSLIST, MIDDLE_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_DOSWITCH, BOTTOM_LEFT);
    AddAnchor(IDC_MAKEPARENTS, BOTTOM_LEFT);
    AddAnchor(IDOK, BOTTOM_RIGHT);
    AddAnchor(IDCANCEL, BOTTOM_RIGHT);
    AddAnchor(IDHELP, BOTTOM_RIGHT);

    if ((m_pParentWnd==NULL)&&(GetExplorerHWND()))
        CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
    EnableSaveRestore(L"CopyDlg");

    m_bSettingChanged = false;
    if (!m_path.IsUrl())
    {
        // start a thread to obtain the highest revision number of the working copy
        // without blocking the dialog
        if ((m_pThread = AfxBeginThread(FindRevThreadEntry, this))==NULL)
        {
            OnCantStartThread();
        }
    }

    return TRUE;
}
示例#15
0
BOOL CLockDlg::OnInitDialog()
{
    CResizableStandAloneDialog::OnInitDialog();
    CAppUtils::MarkWindowAsUnpinnable(m_hWnd);

    ExtendFrameIntoClientArea(IDC_FILELIST);
    m_aeroControls.SubclassControl(this, IDC_SELECTALL);
    m_aeroControls.SubclassControl(this, IDC_STEALLOCKS);
    m_aeroControls.SubclassOkCancelHelp(this);

    m_History.SetMaxHistoryItems((LONG)CRegDWORD(L"Software\\TortoiseSVN\\MaxHistoryItems", 25));
    m_History.Load(L"Software\\TortoiseSVN\\History\\commit", L"logmsgs");

    m_cFileList.Init(SVNSLC_COLEXT | SVNSLC_COLLOCK, L"LockDlg");
    m_cFileList.SetSelectButton(&m_SelectAll);
    m_cFileList.SetConfirmButton((CButton*)GetDlgItem(IDOK));
    m_cFileList.SetCancelBool(&m_bCancelled);
    m_cFileList.EnableFileDrop();
    m_cFileList.SetBackgroundImage(IDI_LOCK_BKG);
    if (m_ProjectProperties)
        m_cEdit.Init(*m_ProjectProperties);
    else
        m_cEdit.Init();
    m_cEdit.SetFont((CString)CRegString(L"Software\\TortoiseSVN\\LogFontName", L"Courier New"), (DWORD)CRegDWORD(L"Software\\TortoiseSVN\\LogFontSize", 8));

    if (!m_sLockMessage.IsEmpty())
        m_cEdit.SetText(m_sLockMessage);
    else if (m_ProjectProperties)
        m_cEdit.SetText(m_ProjectProperties->GetLogMsgTemplate(PROJECTPROPNAME_LOGTEMPLATELOCK));

    CAppUtils::SetAccProperty(m_cEdit.GetSafeHwnd(), PROPID_ACC_ROLE, ROLE_SYSTEM_TEXT);
    CAppUtils::SetAccProperty(m_cEdit.GetSafeHwnd(), PROPID_ACC_HELP, CString(MAKEINTRESOURCE(IDS_INPUT_ENTERLOG)));

    m_SelectAll.SetCheck(BST_INDETERMINATE);

    CString sWindowTitle;
    GetWindowText(sWindowTitle);
    CAppUtils::SetWindowTitle(m_hWnd, m_pathList.GetCommonRoot().GetUIPathString(), sWindowTitle);

    OnEnChangeLockmessage();

    AdjustControlSize(IDC_STEALLOCKS);
    AdjustControlSize(IDC_SELECTALL);

    AddAnchor(IDC_HISTORY, TOP_LEFT);
    AddAnchor(IDC_LOCKTITLELABEL, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_LOCKMESSAGE, TOP_LEFT, TOP_RIGHT);
    AddAnchor(IDC_FILELIST, TOP_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_STEALLOCKS, BOTTOM_LEFT);
    AddAnchor(IDC_SELECTALL, BOTTOM_LEFT);
    AddAnchor(IDOK, BOTTOM_RIGHT);
    AddAnchor(IDCANCEL, BOTTOM_RIGHT);
    AddAnchor(IDHELP, BOTTOM_RIGHT);

    if (GetExplorerHWND())
        CenterWindow(CWnd::FromHandle(GetExplorerHWND()));
    EnableSaveRestore(L"LockDlg");

    // start a thread to obtain the file list with the status without
    // blocking the dialog
    m_pThread = AfxBeginThread(StatusThreadEntry, this, THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);
    if (m_pThread==NULL)
    {
        OnCantStartThread();
    }
    else
    {
        m_pThread->m_bAutoDelete = FALSE;
        m_pThread->ResumeThread();
    }
    m_bBlock = TRUE;

    GetDlgItem(IDC_LOCKMESSAGE)->SetFocus();
    return FALSE;
}
示例#16
0
void CFileDiffDlg::OnContextMenu(CWnd* pWnd, CPoint point)
{
	if ((pWnd==0)||(pWnd != &m_cFileList))
		return;
	if (m_cFileList.GetSelectedCount() == 0)
		return;
	// if the context menu is invoked through the keyboard, we have to use
	// a calculated position on where to anchor the menu on
	if ((point.x == -1) && (point.y == -1))
	{
		CRect rect;
		m_cFileList.GetItemRect(m_cFileList.GetSelectionMark(), &rect, LVIR_LABEL);
		m_cFileList.ClientToScreen(&rect);
		point = rect.CenterPoint();
	}
	CIconMenu popup;
	if (!popup.CreatePopupMenu())
		return;

	popup.AppendMenuIcon(ID_COMPARE, IDS_LOG_POPUP_COMPARETWO, IDI_DIFF);
	popup.AppendMenuIcon(ID_UNIFIEDDIFF, IDS_LOG_POPUP_GNUDIFF, IDI_DIFF);
	popup.AppendMenuIcon(ID_BLAME, IDS_FILEDIFF_POPBLAME, IDI_BLAME);
	popup.AppendMenu(MF_SEPARATOR, NULL);
	popup.AppendMenuIcon(ID_SAVEAS, IDS_FILEDIFF_POPSAVELIST, IDI_SAVEAS);
	popup.AppendMenuIcon(ID_CLIPBOARD, IDS_FILEDIFF_POPCLIPBOARD, IDI_COPYCLIP);
	popup.AppendMenuIcon(ID_EXPORT, IDS_FILEDIFF_POPEXPORT, IDI_EXPORT);
	int cmd = popup.TrackPopupMenu(TPM_RETURNCMD | TPM_LEFTALIGN | TPM_NONOTIFY, point.x, point.y, this, 0);
	m_bCancelled = false;
	switch (cmd)
	{
	case ID_COMPARE:
		{
			POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
			while (pos)
			{
				int index = m_cFileList.GetNextSelectedItem(pos);
				DoDiff(index, false);
			}					
		}
		break;
	case ID_UNIFIEDDIFF:
		{
			CTSVNPath diffFile = CTempFiles::Instance().GetTempFilePath(false);
			POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
			while (pos)
			{
				int index = m_cFileList.GetNextSelectedItem(pos);
				CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
				CTSVNPath url1 = CTSVNPath(m_path1.GetSVNPathString() + _T("/") + fd.path.GetSVNPathString());
				CTSVNPath url2 = m_bDoPegDiff ? url1 : CTSVNPath(m_path2.GetSVNPathString() + _T("/") + fd.path.GetSVNPathString());
				
				if (m_bDoPegDiff)
				{
					PegDiff(url1, m_peg, m_rev1, m_rev2, CTSVNPath(), m_depth, m_bIgnoreancestry, false, true, CString(), true, diffFile);
				}
				else
				{
					Diff(url1, m_rev1, url2, m_rev2, CTSVNPath(), m_depth, m_bIgnoreancestry, false, true, CString(), true, diffFile);
				}
			}
			CAppUtils::StartUnifiedDiffViewer(diffFile, CString(), false);
		}
		break;
	case ID_BLAME:
		{
			POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
			while (pos)
			{
				int index = m_cFileList.GetNextSelectedItem(pos);
				DoDiff(index, true);
			}					
		}
		break;
	case ID_SAVEAS:
		if (m_cFileList.GetSelectedCount() > 0)
		{
			CTSVNPath savePath;
			CString pathSave;
			if (!CAppUtils::FileOpenSave(pathSave, NULL, IDS_REPOBROWSE_SAVEAS, IDS_COMMONFILEFILTER, false, m_hWnd))
			{
				break;
			}
			savePath = CTSVNPath(pathSave);

			// now open the selected file for writing
			try
			{
				CStdioFile file(savePath.GetWinPathString(), CFile::typeBinary | CFile::modeReadWrite | CFile::modeCreate);
				CString temp;
				temp.FormatMessage(IDS_FILEDIFF_CHANGEDLISTINTRO, (LPCTSTR)m_path1.GetSVNPathString(), (LPCTSTR)m_rev1.ToString(), (LPCTSTR)m_path2.GetSVNPathString(), (LPCTSTR)m_rev2.ToString());
				file.WriteString(temp + _T("\n"));
				POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
				while (pos)
				{
					int index = m_cFileList.GetNextSelectedItem(pos);
					FileDiff fd = m_arFilteredList[index];
					file.WriteString(fd.path.GetSVNPathString());
					file.WriteString(_T("\n"));
				}
				file.Close();
			} 
			catch (CFileException* pE)
			{
				pE->ReportError();
				pE->Delete();
			}
		}
		break;
	case ID_CLIPBOARD:
		CopySelectionToClipboard();
		break;
	case ID_EXPORT:
		{
			// export all changed files to a folder
			CBrowseFolder browseFolder;
			browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
			if (browseFolder.Show(GetSafeHwnd(), m_strExportDir) == CBrowseFolder::OK) 
			{
				m_arSelectedFileList.RemoveAll();
				POSITION pos = m_cFileList.GetFirstSelectedItemPosition();
				while (pos)
				{
					int index = m_cFileList.GetNextSelectedItem(pos);
					CFileDiffDlg::FileDiff fd = m_arFilteredList[index];
					m_arSelectedFileList.Add(fd);
				}
				m_pProgDlg = new CProgressDlg();
				InterlockedExchange(&m_bThreadRunning, TRUE);
				if (AfxBeginThread(ExportThreadEntry, this)==NULL)
				{
					InterlockedExchange(&m_bThreadRunning, FALSE);
					OnCantStartThread();
				}
			}
		}
		break;
	}
}