class 'ExtraScreensaversBase' (ExtraCollectionPageBase)

function ExtraScreensaversBase:__init(extraScreen, order)
	ExtraCollectionPageBase.__init(self, extraScreen, 'screensaversPage', order)
	
	self.previewFileFormat	= 'Data/ExtraContent/Textures/Screens/Extra/Screensavers/Previews/preview_%s.png'
	self.previewNameFormat	= 'screensaver_%s'

	self.sourceFileFormat	= 'Data/ExtraContent/Textures/Screens/Extra/Screensavers/screensaver - %s'
	self.ids				= {}
end
-------------------------------------------------------------------------------

function ExtraScreensaversBase:getPreviewName(index)
	local id = self.ids[ index ]
	return string.format(self.previewNameFormat, id)
end
-------------------------------------------------------------------------------

function ExtraScreensaversBase:getPreviewFilePath(index)
	local id = self.ids[ index ]
	return string.format(self.previewFileFormat, id)
end
-------------------------------------------------------------------------------

function ExtraScreensaversBase:getSourceFileName()
	local id = self.ids[self.index]
	return string.format(self.sourceFileFormat, id)
end
-------------------------------------------------------------------------------

function ExtraScreensaversBase:set()
	createYesNoScreen('CE_SET_SCREENSAVER_CONFIRMATION', bind(self.onSettingConfirmed, self), bind(self.onSettingCanceled,  self), false)
end
-------------------------------------------------------------------------------

function ExtraScreensaversBase:onSettingConfirmed()
	local sourcefileName = self:getSourceFileName()
	setSystemScreensaver(sourcefileName)
end
-------------------------------------------------------------------------------

function ExtraScreensaversBase:onSettingCanceled()
end
-------------------------------------------------------------------------------