//-----------------------------------------------------------------------------
#include "DeviceConfigureFrame.h"
#include "DeviceHandler.h"

//-----------------------------------------------------------------------------
bool DeviceHandler::MessageToUser( const wxString& caption, const wxString& msg, bool boSilentMode, long style )
//-----------------------------------------------------------------------------
{
	bool boResult = false;
	if( boSilentMode )
	{
		if( pParent_ )
		{
			pParent_->WriteLogMessage( wxString::Format( wxT( "%s: %s\n"), caption.c_str(), msg.c_str() ) );
		}
		boResult = true;
	}
	else
	{
		wxMessageDialog dlg( pParent_, msg, caption, style );
		switch( dlg.ShowModal() )
		{
		case wxID_OK:
		case wxID_YES:
		case wxID_APPLY:
		case wxID_YESTOALL:
			boResult = true;
			break;
		default:
			break;
		}
	}
	return boResult;
}

//-----------------------------------------------------------------------------
int DeviceHandler::UpdateFirmware( bool /*boSilentMode*/ )
//-----------------------------------------------------------------------------
{
	if( pParent_ )
	{
		pParent_->WriteErrorMessage( wxT( "This device doesn't implement firmware updates\n") );
	}
	return urFeatureUnsupported;
}

//-----------------------------------------------------------------------------
int DeviceHandler::UpdateKernelDriver( bool /*boSilentMode*/ )
//-----------------------------------------------------------------------------
{
	if( pParent_ )
	{
		pParent_->WriteErrorMessage( wxT( "This device doesn't implement kernel driver updates\n") );
	}
	return urFeatureUnsupported;
}
