Skip to content

Commit 390fc20

Browse files
authored
Merge pull request siemens#93 from esaprykin/main
Error messages on opening "Settings" on a newly created project
2 parents f7637d6 + dba224d commit 390fc20

File tree

1 file changed

+36
-30
lines changed
  • WinCCOA_QualityChecks/panels/WinCCOA_QualityChecks/general

1 file changed

+36
-30
lines changed

WinCCOA_QualityChecks/panels/WinCCOA_QualityChecks/general/Settings.pnl

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,11 @@ string getBasePart(const string &id)
300300
}
301301

302302
" 0
303-
3
303+
4
304304
"CBRef" "1"
305305
"EClose" E
306306
"dpi" "120"
307+
"pdpi" "120"
307308
2 1 0 0 0 0 0
308309
""
309310
DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
@@ -327,7 +328,7 @@ LANG:10000 0
327328
"dashclr"N "_Transparent"
328329
"antiAliased" "0"
329330
"transformable" "0"
330-
E E 0 1 3 2 1 E 0.9988465974635842 0 1 -55.41061130365657 -9.5 0 E 77.5 29 511 60
331+
E E 0 1 3 2 1 E 0.9988465974635842 0 1 -55.41061130365657 -9.5 0 E 77.5 29 506 60
331332
0 2 2 "0s" 0 0 0 192 0 0 77.5 29 1
332333
2
333334
LANG:10001 26 Arial,-1,27,5,50,0,0,0,0,0
@@ -485,14 +486,14 @@ LANG:10000 26 Arial,-1,13,5,50,0,0,0,0,0
485486
editSettings(id);
486487
}"
487488
"main()
488-
{
489+
{
489490
initTree();
490491
fillWithData();
491492
this.expandAll();
492493
this.alternatingRowColors(true);
493494
}
494495

495-
void initTree()
496+
void initTree()
496497
{
497498
this.addColumn(\"Id\");
498499
this.addColumn(\"Description\");
@@ -509,79 +510,84 @@ void initTree()
509510
void fillWithData()
510511
{
511512
settings = QgSettings::getAllSettingsAsMapping();
512-
513+
513514
for (int i = 1; i <= dynlen(settings); i++)
514515
{
515516
mapping json_data = settings[i];
516-
517+
517518
if (mappingHasKey(json_data, \"settingsVersion\") == false ||
518519
mappingHasKey(json_data, \"checks\") == false )
519520
{
520521
continue;
521522
}
522-
523+
523524
//determine machting check for id
524525
dyn_mapping checks = json_data[\"checks\"];
525-
526-
526+
527+
527528
for (int j = 1; j <= dynlen(checks); j++)
528529
{
529-
mapping check = checks[j];
530-
530+
mapping check = checks[j];
531+
531532
if ( mappinglen(check) < 1 )
532533
{
533534
continue;
534-
}
535-
535+
}
536+
536537
Mapping map = Mapping(check);
537538
dyn_string id_parts = strsplit(map.getAt(\"id\"), \".\");
538539
string id = \"\";
539-
string parent_id = \"\";
540-
540+
string parent_id = \"\";
541+
541542
for (int z = 1; z <= dynlen(id_parts); z++)
542-
{
543+
{
543544
if (id != \"\")
544-
{
545+
{
545546
id += \".\";
546547
}
547-
548-
id += id_parts[z];
549-
548+
549+
id += id_parts[z];
550+
550551
if (z > 1)
551552
{
552553
if (parent_id != \"\")
553-
{
554+
{
554555
parent_id += \".\";
555556
}
556557
parent_id += id_parts[z-1];
557558
}
558-
559+
559560
if (!this.itemExists(id))
560561
{
561562
this.appendItem(parent_id, id, id_parts[z]);
562563
}
563-
}
564-
564+
}
565+
565566
//read settings depeding on the version
567+
OaLanguage lang = getActiveLangId();
568+
569+
string sLang = getLocale(lang, LOCALE_FORMAT_ISO).startsWith(\"de_\") ? \"de_AT.utf8\" : \"en_US.utf8\";
570+
566571
switch(json_data[\"settingsVersion\"])
567572
{
568573
case 0:
569574
default:
570-
571-
572-
this.setText(id, 1, map.getAt(\"description\")[getActiveLang()]);
573-
575+
576+
577+
this.setText(id, 1, map.getAt(\"description\")[sLang]);
578+
574579
setSettingsValue(id, 2, map.getAt(\"lowLimit\", -1), \"lowLimit\");
575580
setSettingsValue(id, 3, map.getAt(\"highLimit\", -1), \"highLimit\");
576581
setSettingsValue(id, 4, getReferenceValuesAsString(map.getAt(\"referenceValues\", makeDynMixed(\"-1\"))), \"referenceValues\");
577582
setSettingsValue(id, 5, map.getAt(\"scorePoints\", -1), \"scorePoints\");
578583
setSettingsValue(id, 6, map.getAt(\"enabled\", -1), \"enabled\");
579-
584+
580585
this.setText(id, 7, \"...\");
581586
}
582587
}
583588
}
584-
}" 0
589+
}
590+
" 0
585591
13 43
586592
"PUSH_BUTTON2"
587593
""

0 commit comments

Comments
 (0)