Fixed issue #2271: "Check For Updates" dialog should be resizable
[TortoiseGit.git] / src / TortoiseProc / CheckForUpdatesDlg.h
blobf2a499e576c73e4882b5830d04d046d094a9f5c5
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2012-2014, 2016 - 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 CResizableStandAloneDialog
36 DECLARE_DYNAMIC(CCheckForUpdatesDlg)
38 public:
39 CCheckForUpdatesDlg(CWnd* pParent = nullptr); // 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 void OnBnClickedDonotaskagain();
50 afx_msg LRESULT OnDisplayStatus(WPARAM, LPARAM lParam);
51 afx_msg LRESULT OnEndDownload(WPARAM, LPARAM lParam);
52 afx_msg LRESULT OnFillChangelog(WPARAM, LPARAM lParam);
53 afx_msg LRESULT OnTaskbarBtnCreated(WPARAM, LPARAM);
54 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
55 virtual BOOL OnInitDialog();
56 afx_msg void OnDestroy();
57 virtual void OnOK();
58 virtual void OnCancel();
60 DECLARE_MESSAGE_MAP()
62 private:
63 static UINT CheckThreadEntry(LPVOID pVoid);
64 UINT CheckThread();
66 BOOL m_bThreadRunning;
68 public:
69 BOOL m_bShowInfo;
70 BOOL m_bForce;
72 private:
73 BOOL m_bVisible;
74 CProgressCtrl m_progress;
75 CComPtr<ITaskbarList3> m_pTaskbarList;
76 CEvent m_eventStop;
77 CWinThread *m_pDownloadThread;
78 CString m_sFilesURL;
80 static UINT DownloadThreadEntry(LPVOID pParam);
81 UINT DownloadThread();
82 bool Download(CString filename);
83 CUpdateDownloader* m_updateDownloader;
85 CUpdateListCtrl m_ctrlFiles;
87 CString m_sUpdateDownloadLink; ///< Where to send a user looking to download a update
88 CString m_sUpdateChangeLogLink; ///< Where to send a user looking to change log
89 CHyperLink m_link;
90 CString GetDownloadsDirectory();
91 CMenuButton m_ctrlUpdate;
92 BOOL VerifySignature(CString fileName);
93 void FillDownloads(CAutoConfig& versionfile, const CString version);
94 CSciEdit m_cLogMessage;
95 void FillChangelog(CAutoConfig& versionfile, bool official);
96 static CString GetWinINetError(DWORD err);
97 CString m_sErrors;