Can also refresh Rebase dialog by double clicking to delete conflict file
[TortoiseGit.git] / src / TortoiseProc / CheckForUpdatesDlg.h
bloba47f9d5b0114f2c07e88271431a73aabcd16975f
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2012 - 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 "HyperLink.h"
25 #include "MenuButton.h"
26 #include "SciEdit.h"
28 /**
29 * \ingroup TortoiseProc
30 * Helper dialog class, which checks if there are updated version of TortoiseSVN
31 * available.
33 class CCheckForUpdatesDlg : public CStandAloneDialog
35 DECLARE_DYNAMIC(CCheckForUpdatesDlg)
37 public:
38 CCheckForUpdatesDlg(CWnd* pParent = NULL); // standard constructor
39 virtual ~CCheckForUpdatesDlg();
41 enum { IDD = IDD_CHECKFORUPDATES };
43 struct DOWNLOADSTATUS
45 ULONG ulProgress;
46 ULONG ulProgressMax;
49 protected:
50 afx_msg void OnStnClickedCheckresult();
51 afx_msg void OnTimer(UINT_PTR nIDEvent);
52 afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
53 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
54 afx_msg void OnBnClickedButtonUpdate();
55 afx_msg LRESULT OnDisplayStatus(WPARAM, LPARAM lParam);
56 afx_msg LRESULT OnEndDownload(WPARAM, LPARAM lParam);
57 afx_msg LRESULT OnFillChangelog(WPARAM, LPARAM lParam);
58 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
59 virtual BOOL OnInitDialog();
60 virtual void OnOK();
61 virtual void OnCancel();
63 DECLARE_MESSAGE_MAP()
65 private:
66 static UINT CheckThreadEntry(LPVOID pVoid);
67 UINT CheckThread();
69 BOOL m_bThreadRunning;
71 public:
72 BOOL m_bShowInfo;
74 private:
75 BOOL m_bVisible;
76 CProgressCtrl m_progress;
77 CEvent m_eventStop;
78 CWinThread *m_pDownloadThread;
79 CString m_sFilesURL;
81 static UINT DownloadThreadEntry(LPVOID pParam);
82 UINT DownloadThread();
83 bool Download(CString filename);
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(CStdioFile &file, CString version);
94 CSciEdit m_cLogMessage;
95 void FillChangelog(CStdioFile &file);
98 class CBSCallbackImpl : public IBindStatusCallback
100 public:
101 CBSCallbackImpl(HWND hWnd, HANDLE hEventStop);
103 // IUnknown methods
104 STDMETHOD(QueryInterface)(REFIID riid, void **ppvObject);
105 STDMETHOD_(ULONG, AddRef)();
106 STDMETHOD_(ULONG, Release)();
108 // IBindStatusCallback methods
109 STDMETHOD(OnStartBinding)(DWORD, IBinding *);
110 STDMETHOD(GetPriority)(LONG *);
111 STDMETHOD(OnLowResource)(DWORD);
112 STDMETHOD(OnProgress)(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText);
113 STDMETHOD(OnStopBinding)(HRESULT, LPCWSTR);
114 STDMETHOD(GetBindInfo)(DWORD *, BINDINFO *);
115 STDMETHOD(OnDataAvailable)(DWORD, DWORD, FORMATETC *, STGMEDIUM *);
116 STDMETHOD(OnObjectAvailable)(REFIID, IUnknown *);
118 protected:
119 ULONG m_ulObjRefCount;
121 private:
122 HWND m_hWnd;
123 HANDLE m_hEventStop;