Skip to content

Commit

Permalink
Added saving of command line options per project.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkulchenko committed Jul 5, 2016
1 parent fec5711 commit 241a5b4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/editor/menu_project.lua
Expand Up @@ -477,14 +477,17 @@ frame:Connect(ID_COMMANDLINEPARAMETERS, wx.wxEVT_UPDATE_UI,

-- save and restore command line parameters
ide:AddPackage("core.project", {
onAppLoad = function(self, app)
onProjectLoad = function(self, project)
local settings = self:GetSettings()
if settings.arg then ide:SetConfig("arg.any", settings.arg, ide:GetProject()) end
if type(settings.arg) == "table" then
ide:SetConfig("arg.any", settings.arg[project], project)
end
end,
onAppClose = function(self, app)
onProjectClose = function(self, project)
local settings = self:GetSettings()
if settings.arg ~= ide.config.arg.any then
settings.arg = ide.config.arg.any
if type(settings.arg) ~= "table" then settings.arg = {} end
if settings.arg[project] ~= ide.config.arg.any then
settings.arg[project] = ide.config.arg.any
self:SetSettings(settings)
end
end,
Expand Down

0 comments on commit 241a5b4

Please sign in to comment.