ui: 'Nyt run' spørger om navn først; forslag 'Run N' efter antal runs (v1.11.4.0)
This commit is contained in:
@@ -793,13 +793,25 @@ function SmartPickupFrame:onClickStartStop()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Nyt run: navnet vælges FØR run'et oprettes (annulleres dialogen, oprettes intet).
|
||||||
|
-- Forslaget tæller efter antal runs, ikke efter løbenummeret, så "Run 2" kan genbruges.
|
||||||
function SmartPickupFrame:onClickNew()
|
function SmartPickupFrame:onClickNew()
|
||||||
self:safe(function(frame)
|
self:safe(function(frame)
|
||||||
-- nextId er id'et det NYE run får; navnet skal matche det, ikke det forrige.
|
local suggestion = string.format(frame.i18n:getText("spu_newRunName"), #ADRunsController.store.runs + 1)
|
||||||
local run = ADRunsController.createRun(string.format(frame.i18n:getText("spu_newRunName"), ADRunsController.store.nextId))
|
TextInputDialog.show(SmartPickupFrame.onNewRunName, frame, suggestion, frame.i18n:getText("spu_renameTitle"), nil, 30, g_i18n:getText("button_ok"))
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function SmartPickupFrame:onNewRunName(value, clickOk)
|
||||||
|
self:safe(function(frame)
|
||||||
|
if not clickOk or value == nil or not value:match("%S") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local run = ADRunsController.createRun(value)
|
||||||
frame.selectedRunId = run.id
|
frame.selectedRunId = run.id
|
||||||
frame.statusOverride = nil
|
frame.statusOverride = nil
|
||||||
frame:requestRebuild()
|
frame.currentTab = SmartPickupFrame.TAB_RUNS
|
||||||
|
frame:switchTab(SmartPickupFrame.TAB_RUNS)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
<modDesc descVersion="107">
|
<modDesc descVersion="107">
|
||||||
<author>masterdraco</author>
|
<author>masterdraco</author>
|
||||||
<version>1.11.3.0</version>
|
<version>1.11.4.0</version>
|
||||||
<title>
|
<title>
|
||||||
<en>AD Smart Pickup</en>
|
<en>AD Smart Pickup</en>
|
||||||
</title>
|
</title>
|
||||||
|
|||||||
Reference in New Issue
Block a user