Fixed issue #2219: "add cherry picked from" is not applied when squashing/editing...
[TortoiseGit.git] / src / TortoiseProc / CheckForUpdatesDlg.h
blob8ec5f5fc471b28e7ac0328571160bd565527e5a9
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2012-2014 - TortoiseGit
4 // Copyright (C) 2003-2008 - Stefan Kueng
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
22 #include "StandAloneDlg.h"
23 #include "UpdateListCtrl.h"
24 #include "UpdateDownloader.h"
25 #include "HyperLink.h"
26 #include "MenuButton.h"
27 #include "SciEdit.h"
29 /**
30 * \ingroup TortoiseProc
31 * Helper dialog class, which checks if there are updated version of TortoiseSVN
32 * available.
34 class CCheckForUpdatesDlg : public CStandAloneDialog
36 DECLARE_DYNAMIC(CCheckForUpdatesDlg)
38 public:
39 CCheckForUpdatesDlg(CWnd* pParent = NULL); // standard constructor
40 virtual ~CCheckForUpdatesDlg();
42 enum { IDD = IDD_CHECKFORUPDATES };
44 protected:
45 afx_msg void OnTimer(UINT_PTR nIDEvent);
46 afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
47 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
48 afx_msg void OnBnClickedButtonUpdate();
49 afx_msg LRESULT OnDisplayStatus(WPARAM, LPARAM lParam);
50 afx_msg LRESULT OnEndDownload(WPARAM, LPARAM lParam);
51 afx_msg LRESULT OnFillChangelog(WPARAM, LPARAM lParam);
52 afx_msg LRESULT OnTaskbarBtnCreated(WPARAM, LPARAM);
53 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
54 virtual BOOL OnInitDialog();
55 afx_msg void OnDestroy();
56 virtual void OnOK();
57 virtual void OnCancel();
59 DECLARE_MESSAGE_MAP()
61 private:
62 static UINT CheckThreadEntry(LPVOID pVoid);
63 UINT CheckThread();
65 BOOL m_bThreadRunning;
67 public:
68 BOOL m_bShowInfo;
69 BOOL m_bForce;
71 private:
72 BOOL m_bVisible;
73 CProgressCtrl m_progress;
74 CComPtr<ITaskbarList3> m_pTaskbarList;
75 CEvent m_eventStop;
76 CWinThread *m_pDownloadThread;
77 CString m_sFilesURL;
79 static UINT DownloadThreadEntry(LPVOID pParam);
80 UINT DownloadThread();
81 bool Download(CString filename);
82 CUpdateDownloader* m_updateDownloader;
84 CUpdateListCtrl m_ctrlFiles;
86 CString m_sUpdateDownloadLink; ///< Where to send a user looking to download a update
87 CString m_sUpdateChangeLogLink; ///< Where to send a user looking to change log
88 CHyperLink m_link;
89 CString GetDownloadsDirectory();
90 CMenuButton m_ctrlUpdate;
91 BOOL VerifySignature(CString fileName);
92 void FillDownloads(CStdioFile &file, CString version);
93 CSciEdit m_cLogMessage;
94 void FillChangelog(CStdioFile &file);