require( 'facebook/common/style.lua' );
dofile( "facebook/common/facebook_functions.lua" );

-----------------------------------------------------------
-- This is the STATUS dialog box that hopefully just says
-- 'Connecting to Facebook...'
-- and then shuts down
--
-- gDialogTable.facebook_ok_title is the above-the-line title
--
-----------------------------------------------------------

function OnFBResponseReceived()
	gReturnValue = 'facebook_success';
	PopModal('facebook_connecting');
end

function OnFBNetworkError()
	gReturnValue = 'facebook_networkerror';
	PopModal('facebook_connecting');
end

function OnFBProtocolError(errorCode)
	gReturnValue = 'facebook_protocolerror:'..errorCode;
	PopModal('facebook_connecting');
end


local removerequest = gDialogTable.removerequest;
if (removerequest == nil) then
	removerequest = true;
end

MakeDialog
{
	name='facebook_connecting', 
    Bitmap
    {
		image="facebook/common/fb_posted_bg_box",
		x=kCenter,
		y=kCenter,

		Window
		{
			x = 2,
			y = 2,
			w = kMax - 2,
			h = 36,
			Text
			{
				font = FacebookTitleFont,
				x = 32,
				y = 10,
				w = kMax,
				h = 36,
				label = gDialogTable.facebook_ok_title,
				-- label = 'Successfully Posted'
			},
		},

		Window
		{
			x = 2,
			y = 39,
			h = kMax - 2,
			w = kMax - 2,

			Text
			{
				font = FacebookBodyFont,
				w = kMax, h = kMax,
				flags = kHAlignCenter + kVAlignCenter,
				label = 'facebook_connecting',
			};
			FBUI_Response
			{
				w = 10, h = 10,
				requestid = gDialogTable.requestid;
				removerequest = removerequest;
			};
		},
    },

} -- MakeDialog


