Allow to use Event Name/Date/Time from import file

This commit is contained in:
ONBcode 2024-04-12 11:37:51 -03:00
parent 68721b1833
commit 3e6433d4dd
4 changed files with 20 additions and 7 deletions

View File

@ -254,13 +254,21 @@ void TabCompetition::newCompetitionGuide(gdioutput &gdi, int step) {
gdi.addString("", fontMediumPlus, "Namn och tidpunkt");
gdi.dropLine(0.5);
gdi.addInput("Name", lang.tl("Ny tävling"), 34, 0, L"Tävlingens namn:");
gdi.pushX();
gdi.pushX(); // save start of line
gdi.fillRight();
InputInfo &date = gdi.addInput("Date", getLocalDate(), 16, NewGuideCB, L"Datum (för första start):");
gdi.addInput("Name", lang.tl("Ny tävling"), 34, 0, L"Tävlingens namn:");
gdi.dropLine(1.5);
auto xx = gdi.getCX(); // Save checkBox location
gdi.addCheckbox("UseFileEventName", L"NewCmp:FromFile", NewGuideCB, true, L"");
gdi.popX(); gdi.pushX(); // reset and re-save start of line
gdi.fillRight();
gdi.dropLine(2.0);
InputInfo &date = gdi.addInput("Date", getLocalDate(), 16, nullptr, L"Datum (för första start):");
gdi.addInput("FirstStart", L"07:00:00", 12, NewGuideCB, L"Första tillåtna starttid:");
gdi.dropLine(1.5);
gdi.setCX(xx); // line up under previous checkBox
gdi.addCheckbox("UseFileEventDate", L"NewCmp:FromFile", nullptr, true, L"");
gdi.popX();
gdi.fillDown();
@ -469,10 +477,12 @@ void TabCompetition::createCompetition(gdioutput &gdi) {
oe->setAnnotation(lang.tl(L"Baserad på X#" + oldName));
resetSaveTimer();
}
auto manualName = !gdi.isChecked("UseFileEventName");
auto manualDate = !gdi.isChecked("UseFileEventDate");
oe->setName(name, true);
oe->setDate(date, true);
oe->setZeroTime(formatTimeHMS(t), true);
oe->setName(name, manualName);
oe->setDate(date, manualDate);
oe->setZeroTime(formatTimeHMS(t), manualDate);
bool importHiredCard = true;
if (importHiredCard)

View File

@ -2811,3 +2811,4 @@ RunnerRankScore = Ranking (score)
Radera alla = Remove all
Vill du ta bort alla banor från tävlingen? = Do you want to remove all courses from the competition?
Tillåt klass med samma bana på stattid före/efter = Allow class with the same course before/after
NewCmp:FromFile = Use imported value

View File

@ -2699,3 +2699,4 @@ xml-data = données xml
åtta = huit
åttonde = huitième
övriga = autre
NewCmp:FromFile = Utiliser la valeur importée

View File

@ -2823,3 +2823,4 @@ RunnerRankScore = Ranking (poäng)
Radera alla = Radera alla
Vill du ta bort alla banor från tävlingen? = Vill du ta bort alla banor från tävlingen?
Tillåt klass med samma bana på stattid före/efter = Tillåt klass med samma bana på stattid före/efter
NewCmp:FromFile = Använd importerat värde