@@ -442,6 +442,8 @@ def create_form(self, theme=None):
442
442
form .url .data = None
443
443
if "title" in theme :
444
444
form .title .data = theme ["title" ]
445
+ if "description" in theme :
446
+ form .description .data = theme ["description" ]
445
447
if "disabled" in theme :
446
448
form .disabled .data = theme ["disabled" ]
447
449
if "default" in theme :
@@ -453,18 +455,24 @@ def create_form(self, theme=None):
453
455
if "thumbnail" in theme :
454
456
form .thumbnail .data = theme ["thumbnail" ]
455
457
if "attribution" in theme :
456
- form .attribution .data = theme ["attribution" ]
457
- # TODO: FORM attributionUrl
458
- # if "attributionUrl" in theme:
459
- # form.attribution.data = theme["attributionUrl"]
458
+ form .attribution .data = theme ["attribution" ]
459
+ if "attributionUrl" in theme :
460
+ form .attributionUrl .data = theme ["attributionUrl" ]
460
461
if "format" in theme :
461
462
form .format .data = theme ["format" ]
462
463
if "mapCrs" in theme :
463
464
form .mapCrs .data = theme ["mapCrs" ]
465
+ if "extent" in theme :
466
+ form .extent .data = ", " .join (map (str , theme [
467
+ "extent" ]))
464
468
if "additionalMouseCrs" in theme :
465
469
form .additionalMouseCrs .data = theme ["additionalMouseCrs" ]
466
470
if "searchProviders" in theme :
467
471
form .searchProviders .data = theme ["searchProviders" ]
472
+ if "minSearchScaleDenom" in theme :
473
+ form .minSearchScaleDenom .data = theme ["minSearchScaleDenom" ]
474
+ if "tileSize" in theme :
475
+ form .tileSize .data = ", " .join (map (str , theme ["tileSize" ]))
468
476
if "scales" in theme :
469
477
form .scales .data = ", " .join (map (str , theme ["scales" ]))
470
478
if "printScales" in theme :
@@ -476,6 +484,24 @@ def create_form(self, theme=None):
476
484
if "printLabelBlacklist" in theme :
477
485
form .printLabelBlacklist .data = ", " .join (map (str , theme [
478
486
"printLabelBlacklist" ]))
487
+ if "extraPrintLayers" in theme :
488
+ form .extraPrintLayers .data = ", " .join (map (str , theme ["extraPrintLayers" ]))
489
+ if "flags" in theme :
490
+ form .flags .data = ", " .join (map (str , theme ["flags" ]))
491
+ if "layerTreeHiddenSublayers" in theme :
492
+ form .layerTreeHiddenSublayers .data = ", " .join (map (str , theme ["layerTreeHiddenSublayers" ]))
493
+ if "extraPrintParameters" in theme :
494
+ form .extraPrintParameters .data = ", " .join (theme ["extraPrintParameters" ].split ('&' ))
495
+ if "extraLegendParameters" in theme :
496
+ form .extraLegendParameters .data = ", " .join (theme ["extraLegendParameters" ].split ('&' ))
497
+ if "extraDxfParameters" in theme :
498
+ form .extraDxfParameters .data = ", " .join (theme ["extraDxfParameters" ].split ('&' ))
499
+ if "defaultPrintLayout" in theme :
500
+ form .defaultPrintLayout .data = theme ["defaultPrintLayout" ]
501
+ if "printLabelForSearchResult" in theme :
502
+ form .printLabelForSearchResult .data = theme ["printLabelForSearchResult" ]
503
+ if "printLabelForAttribution" in theme :
504
+ form .printLabelForAttribution .data = theme ["printLabelForAttribution" ]
479
505
if "skipEmptyFeatureAttributes" in theme :
480
506
form .skipEmptyFeatureAttributes .data = theme ["skipEmptyFeatureAttributes" ]
481
507
if "collapseLayerGroupsBelowLevel" in theme :
@@ -550,6 +576,10 @@ def create_or_update_theme(self, theme, form, tid=None, gid=None):
550
576
else :
551
577
if "title" in item : del item ["title" ]
552
578
579
+ item ["description" ] = ""
580
+ if form .description .data :
581
+ item ["description" ] = form .description .data
582
+
553
583
item ["disabled" ] = False
554
584
if form .disabled .data :
555
585
item ["disabled" ] = True
@@ -573,8 +603,9 @@ def create_or_update_theme(self, theme, form, tid=None, gid=None):
573
603
if form .attribution .data :
574
604
item ["attribution" ] = form .attribution .data
575
605
576
- # TODO: FORM attributionUrl
577
606
item ["attributionUrl" ] = ""
607
+ if form .attributionUrl .data :
608
+ item ["attributionUrl" ] = form .attributionUrl .data
578
609
579
610
if form .format .data :
580
611
item ["format" ] = form .format .data
@@ -586,6 +617,12 @@ def create_or_update_theme(self, theme, form, tid=None, gid=None):
586
617
else :
587
618
if item in "mapCrs" : del item ["mapCrs" ]
588
619
620
+ if form .extent .data :
621
+ item ["extent" ] = list (map (
622
+ float , form .extent .data .replace (" " , "" ).split ("," )))
623
+ else :
624
+ if "extent" in item : del item ["extent" ]
625
+
589
626
if form .additionalMouseCrs .data :
590
627
item ["additionalMouseCrs" ] = form .additionalMouseCrs .data
591
628
else :
@@ -612,6 +649,16 @@ def create_or_update_theme(self, theme, form, tid=None, gid=None):
612
649
if not form .qgisSearchProvider .data and not form .searchProviders .data :
613
650
if "searchProviders" in item : del item ["searchProviders" ]
614
651
652
+ item ["minSearchScaleDenom" ] = ""
653
+ if form .minSearchScaleDenom .data :
654
+ item ["minSearchScaleDenom" ] = form .minSearchScaleDenom .data
655
+
656
+ if form .tileSize .data :
657
+ item ["tileSize" ] = list (map (
658
+ int , form .tileSize .data .replace (" " , "" ).split ("," )))
659
+ else :
660
+ if "tileSize" in item : del item ["tileSize" ]
661
+
615
662
if form .scales .data :
616
663
item ["scales" ] = list (map (int , form .scales .data .replace (
617
664
" " , "" ).split ("," )))
@@ -637,6 +684,51 @@ def create_or_update_theme(self, theme, form, tid=None, gid=None):
637
684
else :
638
685
if "printLabelBlacklist" in item : del item ["printLabelBlacklist" ]
639
686
687
+ if form .extraPrintLayers .data :
688
+ item ["extraPrintLayers" ] = list (map (
689
+ str , form .extraPrintLayers .data .replace (" " , "" ).split ("," )))
690
+ else :
691
+ if "extraPrintLayers" in item : del item ["extraPrintLayers" ]
692
+
693
+ if form .flags .data :
694
+ item ["flags" ] = list (map (
695
+ str , form .flags .data .replace (" " , "" ).split ("," )))
696
+ else :
697
+ if "flags" in item : del item ["flags" ]
698
+
699
+ if form .layerTreeHiddenSublayers .data :
700
+ item ["layerTreeHiddenSublayers" ] = list (map (
701
+ str , form .layerTreeHiddenSublayers .data .replace (" " , "" ).split ("," )))
702
+ else :
703
+ if "layerTreeHiddenSublayers" in item : del item ["layerTreeHiddenSublayers" ]
704
+
705
+ item ["extraPrintParameters" ] = ""
706
+ if form .extraPrintParameters .data :
707
+ item ["extraPrintParameters" ] = "&" .join (list (map (
708
+ str , form .extraPrintParameters .data .replace (" " , "" ).split ("," ))))
709
+
710
+ item ["extraLegendParameters" ] = ""
711
+ if form .extraLegendParameters .data :
712
+ item ["extraLegendParameters" ] = "&" .join (list (map (
713
+ str , form .extraLegendParameters .data .replace (" " , "" ).split ("," ))))
714
+
715
+ item ["extraDxfParameters" ] = ""
716
+ if form .extraDxfParameters .data :
717
+ item ["extraDxfParameters" ] = "&" .join (list (map (
718
+ str , form .extraDxfParameters .data .replace (" " , "" ).split ("," ))))
719
+
720
+ item ["defaultPrintLayout" ] = ""
721
+ if form .defaultPrintLayout .data :
722
+ item ["defaultPrintLayout" ] = form .defaultPrintLayout .data
723
+
724
+ item ["printLabelForSearchResult" ] = ""
725
+ if form .printLabelForSearchResult .data :
726
+ item ["printLabelForSearchResult" ] = form .printLabelForSearchResult .data
727
+
728
+ item ["printLabelForAttribution" ] = ""
729
+ if form .printLabelForAttribution .data :
730
+ item ["printLabelForAttribution" ] = form .printLabelForAttribution .data
731
+
640
732
item ["skipEmptyFeatureAttributes" ] = False
641
733
if form .skipEmptyFeatureAttributes .data :
642
734
item ["skipEmptyFeatureAttributes" ] = True
0 commit comments