-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUploadDialog.h
executable file
·153 lines (137 loc) · 4.74 KB
/
UploadDialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#pragma once
#include "resource.h"
#include "afxcmn.h"
#include "afxwin.h"
#include ".\progressbar.h"
#include ".\infopanel.h"
#include ".\imagepreview.h"
#include ".\detailsEditDialog.h"
#include ".\prettybutton.h"
#include ".\PhotoReference.h"
#include ".\DialogControlTarget.h"
#include ".\ShareDialog.h"
// CUploadDialog dialog
class CUploadDialog : public CDialog
{
DECLARE_DYNAMIC(CUploadDialog)
class MenuListView : public CListCtrl
{
public:
MenuListView()
{
menu = NULL;
menuHandler = NULL;
}
DECLARE_MESSAGE_MAP()
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
public:
CPoint mousePos;
CMenu* menu;
CWnd* menuHandler;
int clickedItem;
afx_msg void OnNMRclick(NMHDR *pNMHDR, LRESULT *pResult);
};
public:
CUploadDialog(CWnd* pParent = NULL);
virtual ~CUploadDialog();
// Dialog Data
enum { IDD = IDD_UPLOAD_DLG };
protected:
virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();
virtual void OnOK();
virtual void OnCancel();
virtual BOOL PreTranslateMessage(MSG* pMsg);
private:
ULONG_PTR m_gdiplusToken;
MenuListView m_FolderImages;
MenuListView queuedImages;
CImageList imageList;
bool m_bFinished;
bool m_bUploadInProgress;
bool closing; //set when the user wants to close the window, and it is waiting for UploadManager.Abort to finish.
bool updatingLast;
CStatic m_TopImage;
CProgressBar m_ProgressBar;
int logoheight;
int logowidth;
CInfoPanel infoPanel;
CInfoPanel infoGetStartedTip;
CInfoPanel infoPanelMisc;
CImagePreview imagePreview;
CPrettyButton m_btnFound2Queue;
CPrettyButton m_btnFound2QueueAll;
CPrettyButton m_btnQueue2Found;
CPrettyButton m_btnQueue2FoundAll;
CPrettyButton m_btnQueueHelp;
CPrettyButton btnShare;
DetailsEditDialog detailsEditDialog;
CMapStringToPtr loadedPaths;
CMenu mainContextMenu;
CMenu folderContextMenu;
CMenu queueContextMenu;
HACCEL accel;
CDialogControlTarget controlTarget;
ShareSettings shareSettings;
static const int PreviewSize = 128;
public:
bool IsFinished() { return m_bFinished; }
int AddFile(CString path, PhotoReference** ref=0);
protected:
DECLARE_MESSAGE_MAP()
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnClose();
afx_msg void OnDropFiles(HDROP hDropInfo);
afx_msg void OnBnClickedFound2queue();
afx_msg void OnBnClickedQueue2found();
afx_msg void OnPaint();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnGetItemDetails(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnItemDetailsUpdated(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnItemDetailsScroll(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnNMDblclkFolderImages(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnDestroy();
afx_msg void OnBnClickedFound2queueAll();
afx_msg void OnBnClickedQueue2foundAll();
afx_msg LRESULT OnUploadProgressed(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnUploadFinished(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnUploadLock(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnUploadUnlock(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnUploadItemFinished(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnUploadGetDirtyPhotos(WPARAM wParam, LPARAM);
afx_msg void OnLvnKeydownQueuedImages(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnStyleGreen();
afx_msg void OnStyleBlue();
afx_msg LRESULT OnStyleInstalled(WPARAM wParam, LPARAM lParam);
afx_msg void OnBnClickedQueuehelp();
afx_msg void OnLvnBegindragFolderImages(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg LRESULT OnRequireLogin(WPARAM, LPARAM);
afx_msg LRESULT OnOldClient(WPARAM, LPARAM);
afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
private:
void OnAbortUploadClicked();
void OnOpenMyPhotosFolder();
void OnGetStartedTipOk();
void OnProgressBarClicked();
void StartUpload();
void ResetUploadState();
void MoveSelected(CListCtrl& from, CListCtrl& to, BOOL all=FALSE);
void OnEscape();
void OnReturn();
void GetDirtyPhotos(CArray<PhotoReference*>* dirtyPhotos, bool lock=true);
void Save();
void Load();
public:
CString instanceName;
static bool StaticSetTargetCategory(const CString& instanceName, const CString& categoryName);
static bool StaticSetQuota(const CString& instanceName, UINT quota);
static bool StaticSetUsedQuota(const CString& instanceName, UINT usedQuota);
static bool StaticBringWindowToTop(const CString& instanceName);
afx_msg void OnClearFolderlist();
afx_msg void OnRemoveFolderitem();
afx_msg void OnClearFinished();
afx_msg void OnClearQueue();
afx_msg void OnQueueDeleteitem();
afx_msg void OnBnClickedBtnsharesettings();
};