Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 14cc3e3

Browse files
committed
Initial experiments with import and export
1 parent 09743dc commit 14cc3e3

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

Localizations/Neuron_X-enUS.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ L["How to use"] = true
151151
L["Command"] = true
152152
L["Option"] = true
153153

154+
L["Import"] = true
155+
L["Export"] = true
156+
L["Import or Export the current profile"] = true
157+
L["Data import Failed"] = true
158+
154159
L["No bar selected or command invalid"] = true
155160

156161
L["Custom_Option"] = "For custom states, add a desired state string (/neuron state custom <state string>) where <state string> is a semicolon seperated list of state conditions"

Neuron-GUI.lua

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3875,6 +3875,42 @@ NeuronGUI.interfaceOptions = {
38753875
},
38763876
},
38773877

3878+
importexport={
3879+
name = L["Import"].."/"..L["Export"],
3880+
type = "group",
3881+
order = 1,
3882+
args={
3883+
TextBox = {
3884+
order = 1,
3885+
name = L["Import or Export the current profile"],
3886+
type = "input",
3887+
multiline = 30,
3888+
set = function(self, inpStr)
3889+
local result, newTable = Neuron:Deserialize(inpStr)
3890+
if result == true then
3891+
print("Test")
3892+
--[[StaticPopupDialogs["Import_Profile_Check"] = {
3893+
text = "Are you absolutely certain you wish to import this profile? The current profile will be overwritten.",
3894+
button1 = ACCEPT,
3895+
button2 = CANCEL,
3896+
timeout = 0,
3897+
whileDead = true,
3898+
OnAccept = function()
3899+
Neuron.db.profile = CopyTable(newTable)
3900+
ReloadUI()
3901+
end,
3902+
}]]
3903+
StaticPopup_Show("Import_Profile_Check")
3904+
else
3905+
print(L["Data import Failed"])
3906+
end
3907+
end,
3908+
get = function() return Neuron:Serialize(Neuron.db.profile) end,
3909+
width = "full",
3910+
},
3911+
},
3912+
},
3913+
38783914
changelog = {
38793915
name = L["Changelog"],
38803916
type = "group",

Neuron.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
---@class Neuron : AceAddon-3.0 @define The main addon object for the Neuron Action Bar addon
8-
Neuron = LibStub("AceAddon-3.0"):NewAddon(CreateFrame("Frame", nil, UIParent), "Neuron", "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0")
8+
Neuron = LibStub("AceAddon-3.0"):NewAddon(CreateFrame("Frame", nil, UIParent), "Neuron", "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0", "AceSerializer-3.0")
99

1010
local DB
1111

0 commit comments

Comments
 (0)