E.PopupDialogs.MODULE_COPY_CONFIRM.text=format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from |cff4beb2c\"%s\"|r profile to your current |cff4beb2c\"%s\"|r profile. Are you sure?"],Name,E.global.profileCopy.selected,ElvDB.profileKeys[E.mynameRealm])
E.PopupDialogs.MODULE_COPY_CONFIRM.text=format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from your current |cff4beb2c\"%s\"|r profile to |cff4beb2c\"%s\"|r profile. Are you sure?"],Name,ElvDB.profileKeys[E.mynameRealm],E.global.profileCopy.selected)
header=E.Libs.ACH:Header(L["On screen positions for different elements."],0),
spacer=E.Libs.ACH:Spacer(200),
import={
order=201,
type='execute',
name=L["Import Now"],
func=function()
E.PopupDialogs.MODULE_COPY_CONFIRM.text=format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from |cff4beb2c\"%s\"|r profile to your current |cff4beb2c\"%s\"|r profile. Are you sure?"],L["Movers"],E.global.profileCopy.selected,ElvDB.profileKeys[E.mynameRealm])
E.PopupDialogs.MODULE_COPY_CONFIRM.text=format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from your current |cff4beb2c\"%s\"|r profile to |cff4beb2c\"%s\"|r profile. Are you sure?"],L["Movers"],ElvDB.profileKeys[E.mynameRealm],E.global.profileCopy.selected)
ifmodule==trueor(type(module)=='table'and(module.general==nilor(notCopyTo.generalandmodule.general)))then--Some dark magic of a logic to figure out stuff
--This check is to see if the profile we are copying from has keys absent from defaults.
--If key exists, then copy. If not, then clear obsolite key from the profile.
ifCopyDefault[key]~=nilthen
CopyTo[key]=CopyFrom[key]orCopyDefault[key]
else
CopyFrom[key]=nil
end
end
else
ifmodule==truethen--Copy over entire section of profile subgroup
ifnotpluginSectionandMC.InternalOptions[section]thenerror(format('Section name could not be "%s". This name is reserved for internal setting'),section)end
ifpluginSectionand(MC.InternalOptions[pluginSection]andMC.InternalOptions[pluginSection][section])thenerror(format('Section name for plugin group "%s" could not be "%s". This name is reserved for internal setting'),pluginSection,section)end
ifnotpluginSectionandMC.InternalOptions[section]thenerror(format('Section name could not be "%s". This name is reserved for internal setting'),section)end
ifpluginSectionandMC.InternalOptions[pluginSection][section]thenerror(format('Section name for plugin group "%s" could not be "%s". This name is reserved for internal setting'),pluginSection,section)end
iftype(module)=='table'andnext(module)then--This module is not an empty table
MC:CopyTable(CopyFrom,CopyTo,CopyDefault,module)
elseiftype(module)=='boolean'then--Copy over entire section of profile subgroup
E:CopyTable(CopyTo,CopyDefault)
E:CopyTable(CopyTo,CopyFrom)
else
error(format('Provided section name "%s" does not have a valid copy template.',section))
end
end
functionMC:CopyMovers(mode)
ifnotE.db.moversthenE.db.movers={}end--Nothing was moved in cutrrent profile
ifnotElvDB.profiles[E.global.profileCopy.selected].moversthenElvDB.profiles[E.global.profileCopy.selected].movers={}end--Nothing was moved in selected profile