Keep the font size of 8 for the explorer property page
[TortoiseGit.git] / src / TortoiseProc / CheckForUpdatesDlg.h
blob101f542d8a7759c2fc7caec7748326b410820923
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2012-2014, 2016-2017 - 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 "VersioncheckParser.h"
26 #include "HyperLink.h"
27 #include "MenuButton.h"
28 #include "SciEdit.h"
30 /**
31 * \ingroup TortoiseProc
32 * Helper dialog class, which checks if there are updated version of TortoiseSVN
33 * available.
35 class CCheckForUpdatesDlg : public CResizableStandAloneDialog
37 DECLARE_DYNAMIC(CCheckForUpdatesDlg)
39 public:
40 CCheckForUpdatesDlg(CWnd* pParent = nullptr); // standard constructor
41 virtual ~CCheckForUpdatesDlg();
43 enum { IDD = IDD_CHECKFORUPDATES };
45 protected:
46 afx_msg void OnTimer(UINT_PTR nIDEvent);
47 afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
48 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
49 afx_msg void OnBnClickedButtonUpdate();
50 afx_msg void OnBnClickedDonotaskagain();
51 afx_msg LRESULT OnDisplayStatus(WPARAM, LPARAM lParam);
52 afx_msg LRESULT OnEndDownload(WPARAM, LPARAM lParam);
53 afx_msg LRESULT OnFillChangelog(WPARAM, LPARAM lParam);
54 afx_msg LRESULT OnTaskbarBtnCreated(WPARAM, LPARAM);
55 virtual void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support
56 virtual BOOL OnInitDialog() override;
57 afx_msg void OnDestroy();
58 afx_msg void OnSysColorChange();
59 virtual void OnOK() override;
60 virtual void OnCancel() override;
62 DECLARE_MESSAGE_MAP()
64 private:
65 static UINT CheckThreadEntry(LPVOID pVoid);
66 UINT CheckThread();
68 BOOL m_bThreadRunning;
70 public:
71 BOOL m_bShowInfo;
72 BOOL m_bForce;
74 private:
75 BOOL m_bVisible;
76 CProgressCtrl m_progress;
77 CComPtr<ITaskbarList3> m_pTaskbarList;
78 CEvent m_eventStop;
79 CWinThread *m_pDownloadThread;
80 CString m_sFilesURL;
82 static UINT DownloadThreadEntry(LPVOID pParam);
83 UINT DownloadThread();
84 bool Download(CString filename);
85 CUpdateDownloader* m_updateDownloader;
86 bool VerifyUpdateFile(const CString& filename, const CString& filenameSignature, const CString& reportingFilename);
88 CUpdateListCtrl m_ctrlFiles;
90 CString m_sUpdateDownloadLink; ///< Where to send a user looking to download a update
91 CString m_sUpdateChangeLogLink; ///< Where to send a user looking to change log
92 CHyperLink m_link;
93 CString GetDownloadsDirectory();
94 CMenuButton m_ctrlUpdate;
95 void FillDownloads(CVersioncheckParser& versionfile);
96 CSciEdit m_cLogMessage;
97 void FillChangelog(CVersioncheckParser& versionfile, bool official);
98 static CString GetWinINetError(DWORD err);
99 CString m_sErrors;
100 CString m_sNewVersionNumber;