From c57134d21df97c5e5c0b8518ac01c5a18a84c797 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 1 Oct 2011 04:59:23 +0200 Subject: [PATCH] drop revisiondlg Signed-off-by: Sven Strickroth --- src/Resources/TortoiseProcENG.rc | 47 ----------- src/TortoiseProc/FileDiffDlg.cpp | 24 ------ src/TortoiseProc/RevisionDlg.cpp | 109 ------------------------ src/TortoiseProc/RevisionDlg.h | 51 ------------ src/TortoiseProc/RevisionRangeDlg.cpp | 150 ---------------------------------- src/TortoiseProc/RevisionRangeDlg.h | 88 -------------------- src/TortoiseProc/resource.h | 7 -- 7 files changed, 476 deletions(-) delete mode 100644 src/TortoiseProc/RevisionDlg.cpp delete mode 100644 src/TortoiseProc/RevisionDlg.h delete mode 100644 src/TortoiseProc/RevisionRangeDlg.cpp delete mode 100644 src/TortoiseProc/RevisionRangeDlg.h diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index b6db2163c..79483a8d6 100644 --- a/src/Resources/TortoiseProcENG.rc +++ b/src/Resources/TortoiseProcENG.rc @@ -530,19 +530,6 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,326,58,50,14 END -IDD_REVISION DIALOGEX 0, 0, 203, 94 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Select Revision" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Revision",IDC_STATIC,7,7,189,51 - CONTROL "&HEAD revision",IDC_NEWEST,"Button",BS_AUTORADIOBUTTON,13,21,106,10 - CONTROL "&Revision",IDC_REVISION_N,"Button",BS_AUTORADIOBUTTON,13,37,85,10 - EDITTEXT IDC_REVNUM,105,36,85,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,89,73,50,14 - PUSHBUTTON "Cancel",IDCANCEL,146,73,50,14 -END - IDD_CHECKFORUPDATES DIALOGEX 0, 0, 203, 147 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Check For Updates" @@ -883,23 +870,6 @@ BEGIN PUSHBUTTON "Help",IDHELP,167,148,50,14 END -IDD_REVISIONRANGE DIALOGEX 0, 0, 203, 146 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Revision Range" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - GROUPBOX "Start Revision",IDC_STATIC,7,7,189,51 - CONTROL "&HEAD revision",IDC_NEWEST,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,21,106,10 - CONTROL "&Revision",IDC_REVISION_N,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,37,85,10 - EDITTEXT IDC_REVNUM,105,36,85,14,ES_AUTOHSCROLL - GROUPBOX "End Revision",IDC_STATIC,7,66,189,51 - CONTROL "&HEAD revision",IDC_NEWEST2,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,80,106,10 - CONTROL "&Revision",IDC_REVISION_N2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,96,85,10 - EDITTEXT IDC_REVNUM2,105,95,85,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,84,125,50,14 - PUSHBUTTON "Cancel",IDCANCEL,146,125,50,14 -END - IDD_SETTINGSHOOKS DIALOGEX 0, 0, 300, 217 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Hook Scripts" @@ -1940,15 +1910,6 @@ BEGIN BOTTOMMARGIN, 72 END - IDD_REVISION, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 196 - VERTGUIDE, 139 - TOPMARGIN, 7 - BOTTOMMARGIN, 87 - END - IDD_CHECKFORUPDATES, DIALOG BEGIN LEFTMARGIN, 7 @@ -2137,14 +2098,6 @@ BEGIN BOTTOMMARGIN, 162 END - IDD_REVISIONRANGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 196 - TOPMARGIN, 7 - BOTTOMMARGIN, 139 - END - IDD_SETTINGSHOOKS, DIALOG BEGIN LEFTMARGIN, 7 diff --git a/src/TortoiseProc/FileDiffDlg.cpp b/src/TortoiseProc/FileDiffDlg.cpp index cc4980fa3..10abd8f7a 100644 --- a/src/TortoiseProc/FileDiffDlg.cpp +++ b/src/TortoiseProc/FileDiffDlg.cpp @@ -30,7 +30,6 @@ #include "StringUtils.h" #include "PathUtils.h" #include "BrowseFolder.h" -#include "RevisionDlg.h" #include ".\filediffdlg.h" #include "gitdiff.h" #include "CommonResource.h" @@ -1278,29 +1277,6 @@ void CFileDiffDlg::ClickRevButton(CMenuButton *button, GitRev *rev, CACEdit *edi void CFileDiffDlg::OnBnClickedRev2btn() { ClickRevButton(&this->m_cRev2Btn,&this->m_rev2, &this->m_ctrRev2Edit); -#if 0 - 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); - *((GitRev*)&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); - CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR); - } - } -#endif } LRESULT CFileDiffDlg::OnClickedCancelFilter(WPARAM /*wParam*/, LPARAM /*lParam*/) diff --git a/src/TortoiseProc/RevisionDlg.cpp b/src/TortoiseProc/RevisionDlg.cpp deleted file mode 100644 index c4d6ed61f..000000000 --- a/src/TortoiseProc/RevisionDlg.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// TortoiseSVN - a Windows shell extension for easy version control - -// Copyright (C) 2003-2008 - TortoiseSVN - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// -#include "stdafx.h" -#include "TortoiseProc.h" -#include "RevisionDlg.h" -#include "Balloon.h" - - -IMPLEMENT_DYNAMIC(CRevisionDlg, CDialog) -CRevisionDlg::CRevisionDlg(CWnd* pParent /*=NULL*/) - : CDialog(CRevisionDlg::IDD, pParent) - //, GitRev(_T("HEAD")) - , m_bAllowWCRevs(true) -{ -} - -CRevisionDlg::~CRevisionDlg() -{ -} - -void CRevisionDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - DDX_Text(pDX, IDC_REVNUM, m_sRevision); -} - - -BEGIN_MESSAGE_MAP(CRevisionDlg, CDialog) - ON_EN_CHANGE(IDC_REVNUM, OnEnChangeRevnum) -END_MESSAGE_MAP() - -BOOL CRevisionDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - if (IsHead()) - { - CheckRadioButton(IDC_NEWEST, IDC_REVISION_N, IDC_NEWEST); - } - else - { - CheckRadioButton(IDC_NEWEST, IDC_REVISION_N, IDC_REVISION_N); - CString sRev; - if (IsDate()) - sRev = GetDateString(); - else - sRev.Format(_T("%ld"), (LONG)(*this)); - SetDlgItemText(IDC_REVNUM, sRev); - } - if ((m_pParentWnd==NULL)&&(hWndExplorer)) - CenterWindow(CWnd::FromHandle(hWndExplorer)); - GetDlgItem(IDC_REVNUM)->SetFocus(); - return FALSE; -} - -void CRevisionDlg::OnOK() -{ - if (!UpdateData(TRUE)) - return; // don't dismiss dialog (error message already shown by MFC framework) - - SVNRev::Create(m_sRevision); - // if head revision, set revision as -1 - if (GetCheckedRadioButton(IDC_NEWEST, IDC_REVISION_N) == IDC_NEWEST) - { - SVNRev::Create(_T("HEAD")); - m_sRevision = _T("HEAD"); - } - if ((!IsValid())||((!m_bAllowWCRevs)&&(IsPrev() || IsCommitted() || IsBase()))) - { - CBalloon::ShowBalloon( - this, CBalloon::GetCtrlCentre(this, IDC_REVNUM), - m_bAllowWCRevs ? IDS_ERR_INVALIDREV : IDS_ERR_INVALIDREVNOWC, TRUE, IDI_EXCLAMATION); - return; - } - - UpdateData(FALSE); - - CDialog::OnOK(); -} - -void CRevisionDlg::OnEnChangeRevnum() -{ - CString sText; - GetDlgItemText(IDC_REVNUM, sText); - if (sText.IsEmpty()) - { - CheckRadioButton(IDC_NEWEST, IDC_REVISION_N, IDC_NEWEST); - } - else - { - CheckRadioButton(IDC_NEWEST, IDC_REVISION_N, IDC_REVISION_N); - } -} diff --git a/src/TortoiseProc/RevisionDlg.h b/src/TortoiseProc/RevisionDlg.h deleted file mode 100644 index 643cbd15d..000000000 --- a/src/TortoiseProc/RevisionDlg.h +++ /dev/null @@ -1,51 +0,0 @@ -// TortoiseGit - a Windows shell extension for easy version control - -// Copyright (C) 2003-2006 - Stefan Kueng - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// -#pragma once - - -// For base class -#include "GitRev.h" - -/** - * \ingroup TortoiseProc - * A simple dialog box asking the user for a revision number. - */ -class CRevisionDlg : public CDialog, public GitRev -{ - DECLARE_DYNAMIC(CRevisionDlg) - -public: - CRevisionDlg(CWnd* pParent = NULL); - virtual ~CRevisionDlg(); - - enum { IDD = IDD_REVISION }; - - CString GetEnteredRevisionString() {return m_sRevision;} - void AllowWCRevs(bool bAllowWCRevs = true) {m_bAllowWCRevs = bAllowWCRevs;} -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - virtual void OnOK(); - afx_msg void OnEnChangeRevnum(); - - DECLARE_MESSAGE_MAP() - - CString m_sRevision; - bool m_bAllowWCRevs; -}; diff --git a/src/TortoiseProc/RevisionRangeDlg.cpp b/src/TortoiseProc/RevisionRangeDlg.cpp deleted file mode 100644 index 1779fea67..000000000 --- a/src/TortoiseProc/RevisionRangeDlg.cpp +++ /dev/null @@ -1,150 +0,0 @@ -// TortoiseSVN - a Windows shell extension for easy version control - -// Copyright (C) 2003-2008 - TortoiseSVN - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// -#include "stdafx.h" -#include "TortoiseProc.h" -#include "RevisionRangeDlg.h" - - -IMPLEMENT_DYNAMIC(CRevisionRangeDlg, CStandAloneDialog) - -CRevisionRangeDlg::CRevisionRangeDlg(CWnd* pParent /*=NULL*/) - : CStandAloneDialog(CRevisionRangeDlg::IDD, pParent) - , m_bAllowWCRevs(true) - , m_StartRev(_T("HEAD")) - , m_EndRev(_T("HEAD")) -{ -} - -CRevisionRangeDlg::~CRevisionRangeDlg() -{ -} - -void CRevisionRangeDlg::DoDataExchange(CDataExchange* pDX) -{ - CStandAloneDialog::DoDataExchange(pDX); - DDX_Text(pDX, IDC_REVNUM, m_sStartRevision); - DDX_Text(pDX, IDC_REVNUM2, m_sEndRevision); -} - - -BEGIN_MESSAGE_MAP(CRevisionRangeDlg, CStandAloneDialog) - ON_EN_CHANGE(IDC_REVNUM, OnEnChangeRevnum) - ON_EN_CHANGE(IDC_REVNUM2, OnEnChangeRevnum2) -END_MESSAGE_MAP() - -BOOL CRevisionRangeDlg::OnInitDialog() -{ - CStandAloneDialog::OnInitDialog(); - - if (m_StartRev.IsHead()) - { - CheckRadioButton(IDC_NEWEST, IDC_REVISION_N, IDC_NEWEST); - } - else - { - CheckRadioButton(IDC_NEWEST, IDC_REVISION_N, IDC_REVISION_N); - CString sRev; - if (m_StartRev.IsDate()) - sRev = m_StartRev.GetDateString(); - else - sRev.Format(_T("%ld"), (LONG)(m_StartRev)); - SetDlgItemText(IDC_REVNUM, sRev); - } - if (m_EndRev.IsHead()) - { - CheckRadioButton(IDC_NEWEST2, IDC_REVISION_N2, IDC_NEWEST2); - } - else - { - CheckRadioButton(IDC_NEWEST2, IDC_REVISION_N2, IDC_REVISION_N2); - CString sRev; - if (m_EndRev.IsDate()) - sRev = m_EndRev.GetDateString(); - else - sRev.Format(_T("%ld"), (LONG)(m_EndRev)); - SetDlgItemText(IDC_REVNUM2, sRev); - } - - if ((m_pParentWnd==NULL)&&(hWndExplorer)) - CenterWindow(CWnd::FromHandle(hWndExplorer)); - GetDlgItem(IDC_REVNUM)->SetFocus(); - return FALSE; -} - -void CRevisionRangeDlg::OnOK() -{ - if (!UpdateData(TRUE)) - return; // don't dismiss dialog (error message already shown by MFC framework) - - m_StartRev = SVNRev(m_sStartRevision); - if (GetCheckedRadioButton(IDC_NEWEST, IDC_REVISION_N) == IDC_NEWEST) - { - m_StartRev = SVNRev(_T("HEAD")); - m_sStartRevision = _T("HEAD"); - } - if ((!m_StartRev.IsValid())||((!m_bAllowWCRevs)&&(m_StartRev.IsPrev() || m_StartRev.IsCommitted() || m_StartRev.IsBase()))) - { - ShowBalloon(IDC_REVNUM, m_bAllowWCRevs ? IDS_ERR_INVALIDREV : IDS_ERR_INVALIDREVNOWC); - return; - } - - m_EndRev = SVNRev(m_sEndRevision); - if (GetCheckedRadioButton(IDC_NEWEST2, IDC_REVISION_N2) == IDC_NEWEST2) - { - m_EndRev = SVNRev(_T("HEAD")); - m_sEndRevision = _T("HEAD"); - } - if ((!m_EndRev.IsValid())||((!m_bAllowWCRevs)&&(m_EndRev.IsPrev() || m_EndRev.IsCommitted() || m_EndRev.IsBase()))) - { - ShowBalloon(IDC_REVNUM2, m_bAllowWCRevs ? IDS_ERR_INVALIDREV : IDS_ERR_INVALIDREVNOWC); - return; - } - - UpdateData(FALSE); - - CStandAloneDialog::OnOK(); -} - -void CRevisionRangeDlg::OnEnChangeRevnum() -{ - CString sText; - GetDlgItemText(IDC_REVNUM, sText); - if (sText.IsEmpty()) - { - CheckRadioButton(IDC_NEWEST, IDC_REVISION_N, IDC_NEWEST); - } - else - { - CheckRadioButton(IDC_NEWEST, IDC_REVISION_N, IDC_REVISION_N); - } -} - -void CRevisionRangeDlg::OnEnChangeRevnum2() -{ - CString sText; - GetDlgItemText(IDC_REVNUM2, sText); - if (sText.IsEmpty()) - { - CheckRadioButton(IDC_NEWEST2, IDC_REVISION_N2, IDC_NEWEST2); - } - else - { - CheckRadioButton(IDC_NEWEST2, IDC_REVISION_N2, IDC_REVISION_N2); - } -} diff --git a/src/TortoiseProc/RevisionRangeDlg.h b/src/TortoiseProc/RevisionRangeDlg.h deleted file mode 100644 index ca9a78bc1..000000000 --- a/src/TortoiseProc/RevisionRangeDlg.h +++ /dev/null @@ -1,88 +0,0 @@ -// TortoiseSVN - a Windows shell extension for easy version control - -// Copyright (C) 2003-2006 - Stefan Kueng - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software Foundation, -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// -#pragma once - -#include "SVNRev.h" -#include "StandAloneDlg.h" - -/** - * \ingroup TortoiseProc - * A dialog to select a revision range. - */ -class CRevisionRangeDlg : public CStandAloneDialog -{ - DECLARE_DYNAMIC(CRevisionRangeDlg) - -public: - CRevisionRangeDlg(CWnd* pParent = NULL); - virtual ~CRevisionRangeDlg(); - - enum { IDD = IDD_REVISIONRANGE }; - - /** - * Returns the string entered in the start revision edit box. - */ - CString GetEnteredStartRevisionString() const {return m_sStartRevision;} - - /** - * Returns the string entered in the end revision edit box. - */ - CString GetEnteredEndRevisionString() const {return m_sEndRevision;} - - /** - * Returns the entered start revision. - */ - SVNRev GetStartRevision() const {return m_StartRev;} - - /** - * Returns the entered end revision. - */ - SVNRev GetEndRevision() const {return m_EndRev;} - - /** - * Sets the start revision to fill in when the dialog shows up. - */ - void SetStartRevision(const SVNRev& rev) {m_StartRev = rev;} - - /** - * Sets the end revision to fill in when the dialog shows up. - */ - void SetEndRevision(const SVNRev& rev) {m_EndRev = rev;} - - /** - * If set to \a true, then working copy revisions like BASE, WC, PREV are allowed. - * Otherwise, an error balloon is shown when the user tries to enter such revisions. - */ - void AllowWCRevs(bool bAllowWCRevs = true) {m_bAllowWCRevs = bAllowWCRevs;} -protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); - virtual void OnOK(); - afx_msg void OnEnChangeRevnum(); - afx_msg void OnEnChangeRevnum2(); - - DECLARE_MESSAGE_MAP() - -protected: - CString m_sStartRevision; - CString m_sEndRevision; - SVNRev m_StartRev; - SVNRev m_EndRev; - bool m_bAllowWCRevs; -}; diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index f8bd20d73..0040a215d 100644 --- a/src/TortoiseProc/resource.h +++ b/src/TortoiseProc/resource.h @@ -39,7 +39,6 @@ #define IDB_TTF_BMP 169 #define IDD_SETTINGSPROGSADV 170 #define IDD_TOOLASSOC 171 -#define IDD_REVISION 173 #define IDD_CHECKFORUPDATES 174 #define IDD_REVERT 175 #define IDD_PROPERTIES 177 @@ -75,7 +74,6 @@ #define IDI_SAVEDDATA 225 #define IDD_EDITPROPERTIES 226 #define IDD_EDITPROPERTYVALUE 227 -#define IDD_REVISIONRANGE 228 #define IDI_GRAPHBAR 229 #define IDI_GRAPHBARSTACKED 230 #define IDI_GRAPHLINE 231 @@ -200,7 +198,6 @@ #define IDC_DIFFVIEWER 1017 #define IDS_LOG_PUSH 1017 #define IDS_FILEDIFF_LOG 1018 -#define IDC_NEWEST 1019 #define IDS_PROC_TASKS 1019 #define IDC_EXTDIFFBROWSE 1021 #define IDC_EXTMERGEBROWSE 1022 @@ -209,11 +206,9 @@ #define IDC_ENABLE 1023 #define IDC_SAVECHECK 1023 #define IDC_NAME 1027 -#define IDC_REVNUM 1027 #define IDC_SERVERADDRESS 1027 #define IDC_REVISON_START 1027 #define IDC_USEREDIT 1027 -#define IDC_REVNUM2 1028 #define IDC_URLCOMBO 1029 #define IDC_FONTNAMES 1030 #define IDC_LOGBUTTON 1031 @@ -223,8 +218,6 @@ #define IDC_REVISION_HEAD 1032 #define IDC_REVISION_N 1033 #define IDC_REVISION_NUM 1034 -#define IDC_NEWEST2 1034 -#define IDC_REVISION_N2 1035 #define IDC_BROWSE 1035 #define IDC_CHECKOUTDIRECTORY_BROWSE 1036 #define IDC_INCLUDEPATHS 1036 -- 2.11.4.GIT