summaryrefslogtreecommitdiff
path: root/utils/modelcheckin/modelcheckindlg.h
blob: bdacd48d3f75d8d72bf0b372a5a1b287cd8515bd (plain) (blame)
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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//
// ModelCheckInDlg.h : header file
//

#if !defined(AFX_MODELCHECKINDLG_H__75541530_E85C_4FAB_8C76_6EE68353E2E2__INCLUDED_)
#define AFX_MODELCHECKINDLG_H__75541530_E85C_4FAB_8C76_6EE68353E2E2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CModelCheckInDlg dialog

class CModelCheckInDlg : public CDialog
{
// Construction
public:
	CModelCheckInDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CModelCheckInDlg)
	enum { IDD = IDD_MODELCHECKIN_DIALOG };
	CString	m_HL2GameDirectory;
	CString	m_TF2GameDirectory;
	CString	m_UserName;
	int		m_HL2Radio;
	int		m_TF2Radio;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CModelCheckInDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CModelCheckInDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	//}}AFX_MSG

	afx_msg  void OnFileCheckIn();
	afx_msg  void OnFileCheckOut();
	afx_msg  void OnFileExit();

	DECLARE_MESSAGE_MAP()

private:
	enum ProjectType_t
	{
		PROJECT_ERROR = -1,
		PROJECT_HL2 = 0,
		PROJECT_TF2
	};

	bool CheckInfo();
	bool SetCurrentSSProject( ProjectType_t project, char const* pRelativeDir );
	ProjectType_t ComputeRelativeFileName( char const* pInFile, char* pRelativeFile );

	void StoreStateIntoRegistry( );
	void RestoreStateFromRegistry( );

	ProjectType_t GetFileNames( char const* pTitle, char*& pRelativePath,
									char*& pFileName, char*& pDestPath );

	void ResetDirectoryEntry( CString &fullPath, char *pRegEntry );
	void PerformCheckoutCommand( ProjectType_t project, 
		char const* pRelativeDir, char const* pDestPath, char const* pFileName );
	void PerformCheckinCommand( ProjectType_t project, 
		char const* pRelativeDir, char const* pDestPath, char const* pFileName );
};

//-----------------------------------------------------------------------------
// registry info
//-----------------------------------------------------------------------------

#define  MDL_CHECKOUT_REG_CLASS "HKEY_CURRENT_USER\\SOFTWARE\\Valve\\MDLCheckOut"
#define  MDL_CHECKOUT_REG_LAST_PATH "Path"
#define  MDL_CHECKOUT_REG_USER		"User"
#define  MDL_CHECKOUT_REG_HL2_PATH	"HL2"
#define  MDL_CHECKOUT_REG_TF2_PATH	"TF2"


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MODELCHECKINDLG_H__75541530_E85C_4FAB_8C76_6EE68353E2E2__INCLUDED_)