// NoPython.cpp : implementation file
//

#include "stdafx.h"
#include "wincvs.h"
#include "NoPython.h"
#include "Persistent.h"
#include "Splash.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

static CPersistentBool gWarnPython("P_WarnPython", true);

/////////////////////////////////////////////////////////////////////////////
// CNoPython dialog


CNoPython::CNoPython(CWnd* pParent /*=NULL*/)
	: CDialog(CNoPython::IDD, pParent)
{
	//{{AFX_DATA_INIT(CNoPython)
	m_remind = TRUE;
	//}}AFX_DATA_INIT
}


void CNoPython::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNoPython)
	DDX_Control(pDX, IDC_PYTHONURL, m_url);
	DDX_Check(pDX, IDC_REMIND, m_remind);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CNoPython, CDialog)
	//{{AFX_MSG_MAP(CNoPython)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNoPython message handlers

BOOL CNoPython::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_url.SetURL(_T("http://www.python.org"));
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void WarnNoPython(void)
{
	if((bool)gWarnPython)
	{
		// because it conflicts
		CSplashWnd::CloseSplashScreen();

		CNoPython dlg;
		dlg.DoModal();
		if(!dlg.m_remind)
			gWarnPython = false;
	}
}
