



function WhatsNext:ShowNamePromptFrame(initialName,confirmFunction,cancelFunction)
	print(1)
	if not self.namePromptFrame then
		local frame = self.AceGUI:Create("Window")
		frame:PauseLayout()
		_G["WhatsNext_NamePromptFrame"] = frame
		WhatsNext_AddOptionsScreen(frame.frame)
		tinsert(UISpecialFrames, "WhatsNext_NamePromptFrame") 
		self.namePromptFrame = frame;
		frame:SetWidth(230)
		frame:SetHeight(114)
		frame:SetTitle("What's Next? - Name Prompt")
		frame:SetStatusText("")
		frame:EnableResize(false);
		frame:SetCallback("OnClose", cancelFunction)
		frame:SetLayout("Flow")
		frame:SetAutoAdjustHeight(false)	

		
		local errorLabel = WhatsNext.AceGUI:Create('Label');
		errorLabel:SetText(" ");
		errorLabel:SetFullWidth(true)
		errorLabel.label:SetTextColor(1,0,0,1)
		errorLabel.label:SetJustifyH("CENTER")
		errorLabel.label:SetJustifyV("CENTER")
		frame:AddChild(errorLabel)
		
		
		local label = WhatsNext.AceGUI:Create('Label');
		label:SetText("Rotation Name:");
		label:SetWidth(85)
		frame:AddChild(label)
		
		
		local nameField = WhatsNext.AceGUI:Create('EditBox');
		nameField:SetText(initialName or "");
		nameField:SetMaxLetters(30);
		nameField:SetWidth(120)
		nameField:DisableButton(true);
		frame:AddChild(nameField)
		
		local okButton = WhatsNext.AceGUI:Create('Button');
		okButton:SetWidth(103);
		okButton:SetText('Okay');
		okButton:SetCallback('OnClick', function() 
			local success,errorMessage = confirmFunction(nameField:GetText())
			if success then
				frame.frame:Hide()
			else
				errorLabel:SetText(errorMessage);
			end
		end);
		frame:AddChild(okButton)
		
		local cancelButton = WhatsNext.AceGUI:Create('Button');
		cancelButton:SetWidth(103);
		cancelButton:SetText('Cancel');
		cancelButton:SetCallback('OnClick', cancelFunction);
		frame:AddChild(cancelButton)
			
		frame:ResumeLayout()
		frame:DoLayout()
	end
end