File: InitDlg.cpp

package info (click to toggle)
gcvs 1.0final-5sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 12,244 kB
  • ctags: 10,630
  • sloc: ansic: 71,709; cpp: 39,780; sh: 18,434; makefile: 1,912; yacc: 1,299; tcl: 1,283; perl: 910; lex: 249; csh: 185; lisp: 7
file content (117 lines) | stat: -rwxr-xr-x 2,882 bytes parent folder | download | duplicates (3)
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
/*
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 1, or (at your option)
** any later version.

** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.

** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/*
 * Author : Alexandre Parenteau <aubonbeurre@hotmail.com> --- June 1999
 */

/*
 * InitDlg.cpp : the cvs init dialog
 */

#include "stdafx.h"

#ifdef WIN32
#	include "wincvs.h"
#endif /* WIN32 */

#include "InitDlg.h"
#include "CvsPrefs.h"

#ifdef WIN32
#	include "GetPrefs.h"
#	include "PromptFiles.h"
#	ifdef _DEBUG
#	define new DEBUG_NEW
#	undef THIS_FILE
	static char THIS_FILE[] = __FILE__;
#	endif

/////////////////////////////////////////////////////////////////////////////
// CInit_MAIN dialog


CInit_MAIN::CInit_MAIN()
	: CPropertyPage(CInit_MAIN::IDD)
{
	//{{AFX_DATA_INIT(CInit_MAIN)
	m_forceroot = FALSE;
	m_helpinit = _T("");
	//}}AFX_DATA_INIT
}

CInit_MAIN::CInit_MAIN(bool forceRoot)
	: CPropertyPage(CInit_MAIN::IDD)
{
	m_forceroot = forceRoot;
	m_helpinit = _T("If the CVSROOT (see next tab) is set to ""local"", "
		"the CVSROOT should be a Windows path (i.e. c:\\cvsroot). "
		"If the CVSROOT points on a remote machine, the path should be a Unix path "
		"(i.e. /fscvs/cvsroot : make sure you got the relevant security rights in "
		"order to create such a directory on the remote machine.");
}

void CInit_MAIN::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInit_MAIN)
	DDX_Check(pDX, IDC_FORCEROOT, m_forceroot);
	DDX_Text(pDX, IDC_HELPINIT, m_helpinit);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CInit_MAIN, CPropertyPage)
	//{{AFX_MSG_MAP(CInit_MAIN)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

IMPLEMENT_DYNCREATE(CInit_MAIN, CPropertyPage)

/////////////////////////////////////////////////////////////////////////////
// CInit_MAIN message handlers
#endif

bool CompatGetInit(bool & forceCvsroot)
{
	bool userHitOK = false;

	forceCvsroot = true;
	
#ifdef WIN32
	CPropertySheet pages("Init settings");
	pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
	CInit_MAIN page1(forceCvsroot);
	CGetPrefs_CVSROOT page2;
	CGetPrefs_GLOBALS page3;
	pages.AddPage(&page1);
	pages.AddPage(&page2);
	pages.AddPage(&page3);
	if(pages.DoModal() == IDOK)
	{
		forceCvsroot = page1.m_forceroot == TRUE;

		page2.StoreValues();
		page3.StoreValues();
		userHitOK = true;
	}
#endif /* WIN32 */

	if(userHitOK)
	{
		gCvsPrefs.save();
	}
	return userHitOK;
}