Skip to content

Commit

Permalink
Added history of command line parameters to the menu in the status bar (
Browse files Browse the repository at this point in the history
closes #665).
  • Loading branch information
pkulchenko committed Jul 16, 2016
1 parent 5a93c84 commit 6ca8474
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/editor/gui.lua
Expand Up @@ -62,7 +62,17 @@ local function createFrame()
local menu = ide:MakeMenu {
{ ID_COMMANDLINEPARAMETERS, TR("Command Line Parameters...")..KSC(ID_COMMANDLINEPARAMETERS) },
}
if menu then statusBar:PopupMenu(menu) end
local cmdargs = ide:GetPackage("core.project"):GetCmdLines()
if #cmdargs > 0 then menu:PrependSeparator() end
local function setParams(ev) ide:SetCommandLineParameters(menu:GetLabel(ev:GetId())) end
-- do in the reverse order as `Prepend` is used;
-- skip the first item as it's already selected
for i = #cmdargs, 2, -1 do
local id = ID("status.commandparameters."..i)
menu:Prepend(id, cmdargs[i])
menu:Connect(id, wx.wxEVT_COMMAND_MENU_SELECTED, setParams)
end
statusBar:PopupMenu(menu)
end
return
end
Expand Down

0 comments on commit 6ca8474

Please sign in to comment.