Merge pull request #136 from vkbo/language_status

Language Info on Status Bar
This commit is contained in:
Veronica K. Berglyd Olsen
2019-11-08 20:43:41 +01:00
committed by GitHub
14 changed files with 421 additions and 40 deletions
+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.2"
width="20"
height="20"
viewBox="0 0 20 20"
id="svg856"
sodipodi:docname="globe-dark.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata862">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs860" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1013"
id="namedview858"
showgrid="false"
inkscape:zoom="33.875"
inkscape:cx="12.118081"
inkscape:cy="12"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg856" />
<path
d="m 8.932347,3.9995001 c 2.198072,0 3.985624,1.794056 3.985624,4.0001249 0,2.206069 -1.787552,4.000125 -3.985624,4.000125 -2.1960777,0 -3.9836298,-1.794056 -3.9836298,-4.000125 0,-2.2060689 1.7875521,-4.0001249 3.9836298,-4.0001249 m 0,-2.0000625 c -3.3020882,0 -5.9764414,2.6860839 -5.9764414,6.0001874 0,3.314104 2.6743532,6.000188 5.9764414,6.000188 3.300097,0 5.978436,-2.688084 5.978436,-6.000188 0,-3.3141035 -2.678339,-6.0001874 -5.978436,-6.0001874 z m 5.978436,16.0005004 h -3.985624 v -1.230039 c 1.635102,-0.371012 3.134693,-1.188037 4.347319,-2.406075 C 16.965371,12.664771 17.9,10.4037 17.9,8.000625 17.9,5.9335605 17.211483,3.9724992 15.939073,2.3814495 l 0.672574,-0.673021 c 0.389595,-0.3910122 0.389595,-1.023032 9.75e-4,-1.4150442 -0.390591,-0.3920123 -1.020319,-0.3900122 -1.409914,-0.001 l -2.044625,2.049064 0.705456,0.7080221 c 1.317248,1.3210413 2.043628,3.0800966 2.043628,4.9501546 0,1.870058 -0.72638,3.627113 -2.043628,4.949155 -1.317249,1.322041 -3.067934,2.051064 -4.931213,2.051064 -1.8632787,0 -3.6139637,-0.729023 -4.9312122,-2.051064 -0.3895946,-0.391013 -1.0193231,-0.391013 -1.4089178,0 -0.3895947,0.390012 -0.3895947,1.023032 0,1.414044 1.6928935,1.699053 3.9447707,2.637082 6.34013,2.637082 v 1.000032 H 4.9467244 c -0.5510125,0 -0.9964058,0.447013 -0.9964058,1.000031 C 3.9503186,19.552986 4.3957119,20 4.9467244,20 h 9.9640586 c 0.551012,0 0.996406,-0.447014 0.996406,-1.000031 0,-0.553018 -0.445394,-1.000031 -0.996406,-1.000031 z"
id="path854"
inkscape:connector-curvature="0"
style="stroke-width:0.99821687;fill:#aeaeae;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.2"
width="20"
height="20"
viewBox="0 0 20 20"
id="svg856"
sodipodi:docname="globe.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata862">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs860" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1013"
id="namedview858"
showgrid="false"
inkscape:zoom="33.875"
inkscape:cx="12.118081"
inkscape:cy="12"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg856" />
<path
d="m 8.932347,3.9995001 c 2.198072,0 3.985624,1.794056 3.985624,4.0001249 0,2.206069 -1.787552,4.000125 -3.985624,4.000125 -2.1960777,0 -3.9836298,-1.794056 -3.9836298,-4.000125 0,-2.2060689 1.7875521,-4.0001249 3.9836298,-4.0001249 m 0,-2.0000625 c -3.3020882,0 -5.9764414,2.6860839 -5.9764414,6.0001874 0,3.314104 2.6743532,6.000188 5.9764414,6.000188 3.300097,0 5.978436,-2.688084 5.978436,-6.000188 0,-3.3141035 -2.678339,-6.0001874 -5.978436,-6.0001874 z m 5.978436,16.0005004 h -3.985624 v -1.230039 c 1.635102,-0.371012 3.134693,-1.188037 4.347319,-2.406075 C 16.965371,12.664771 17.9,10.4037 17.9,8.000625 17.9,5.9335605 17.211483,3.9724992 15.939073,2.3814495 l 0.672574,-0.673021 c 0.389595,-0.3910122 0.389595,-1.023032 9.75e-4,-1.4150442 -0.390591,-0.3920123 -1.020319,-0.3900122 -1.409914,-0.001 l -2.044625,2.049064 0.705456,0.7080221 c 1.317248,1.3210413 2.043628,3.0800966 2.043628,4.9501546 0,1.870058 -0.72638,3.627113 -2.043628,4.949155 -1.317249,1.322041 -3.067934,2.051064 -4.931213,2.051064 -1.8632787,0 -3.6139637,-0.729023 -4.9312122,-2.051064 -0.3895946,-0.391013 -1.0193231,-0.391013 -1.4089178,0 -0.3895947,0.390012 -0.3895947,1.023032 0,1.414044 1.6928935,1.699053 3.9447707,2.637082 6.34013,2.637082 v 1.000032 H 4.9467244 c -0.5510125,0 -0.9964058,0.447013 -0.9964058,1.000031 C 3.9503186,19.552986 4.3957119,20 4.9467244,20 h 9.9640586 c 0.551012,0 0.996406,-0.447014 0.996406,-1.000031 0,-0.553018 -0.445394,-1.000031 -0.996406,-1.000031 z"
id="path854"
inkscape:connector-curvature="0"
style="stroke-width:0.99821687;fill:#000000;fill-opacity:0.78431374" />
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.2"
width="21"
height="21"
viewBox="0 0 21 21"
id="svg1039"
sodipodi:docname="time-dark.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata1045">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs1043" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1013"
id="namedview1041"
showgrid="false"
inkscape:zoom="27.812867"
inkscape:cx="6.903687"
inkscape:cy="11.89962"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg1039" />
<g
id="g1037"
transform="translate(-1.5,-2)"
style="fill:#aeaeae;fill-opacity:1">
<path
d="M 19.414,8.902 C 19.518,8.854 19.62,8.794 19.707,8.707 l 0.5,-0.5 c 0.391,-0.391 0.391,-1.023 0,-1.414 -0.391,-0.391 -1.023,-0.391 -1.414,0 l -0.5,0.5 -0.115,0.173 C 16.791,6.154 14.99,5.276 12.989,5.056 L 13,5 V 4 h 1 C 14.55,4 15,3.55 15,3 15,2.45 14.55,2 14,2 H 10 C 9.45,2 9,2.45 9,3 9,3.55 9.45,4 10,4 h 1 v 1 l 0.012,0.057 C 6.506,5.549 3,9.364 3,14 c 0,4.971 4.029,9 9,9 4.971,0 9,-4.029 9,-9 0,-1.894 -0.588,-3.648 -1.586,-5.098 z M 12,21 C 8.141,21 5,17.86 5,14 5,10.14 8.141,7 12,7 c 3.859,0 7,3.14 7,7 0,3.86 -3.141,7 -7,7 z m 1,-8 v -2 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 v 3 c 0,0.55 0.45,1 1,1 h 3 c 0.55,0 1,-0.45 1,-1 0,-0.55 -0.45,-1 -1,-1 z M 12,8 c -3.312,0 -6,2.688 -6,6 0,3.312 2.688,6 6,6 3.312,0 6,-2.688 6,-6 0,-3.312 -2.688,-6 -6,-6 z m 0,11 C 9.243,19 7,16.757 7,14 7,11.243 9.243,9 12,9 c 2.757,0 5,2.243 5,5 0,2.757 -2.243,5 -5,5 z"
id="path1035"
inkscape:connector-curvature="0"
style="fill:#aeaeae;fill-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.2"
width="21"
height="21"
viewBox="0 0 21 21"
id="svg1039"
sodipodi:docname="time.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata1045">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs1043" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1013"
id="namedview1041"
showgrid="false"
inkscape:zoom="27.812867"
inkscape:cx="6.903687"
inkscape:cy="11.89962"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg1039" />
<g
id="g1037"
transform="translate(-1.5,-2)"
style="fill:#000000;fill-opacity:0.78431374">
<path
d="M 19.414,8.902 C 19.518,8.854 19.62,8.794 19.707,8.707 l 0.5,-0.5 c 0.391,-0.391 0.391,-1.023 0,-1.414 -0.391,-0.391 -1.023,-0.391 -1.414,0 l -0.5,0.5 -0.115,0.173 C 16.791,6.154 14.99,5.276 12.989,5.056 L 13,5 V 4 h 1 C 14.55,4 15,3.55 15,3 15,2.45 14.55,2 14,2 H 10 C 9.45,2 9,2.45 9,3 9,3.55 9.45,4 10,4 h 1 v 1 l 0.012,0.057 C 6.506,5.549 3,9.364 3,14 c 0,4.971 4.029,9 9,9 4.971,0 9,-4.029 9,-9 0,-1.894 -0.588,-3.648 -1.586,-5.098 z M 12,21 C 8.141,21 5,17.86 5,14 5,10.14 8.141,7 12,7 c 3.859,0 7,3.14 7,7 0,3.86 -3.141,7 -7,7 z m 1,-8 v -2 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 v 3 c 0,0.55 0.45,1 1,1 h 3 c 0.55,0 1,-0.45 1,-1 0,-0.55 -0.45,-1 -1,-1 z M 12,8 c -3.312,0 -6,2.688 -6,6 0,3.312 2.688,6 6,6 3.312,0 6,-2.688 6,-6 0,-3.312 -2.688,-6 -6,-6 z m 0,11 C 9.243,19 7,16.757 7,14 7,11.243 9.243,9 12,9 c 2.757,0 5,2.243 5,5 0,2.757 -2.243,5 -5,5 z"
id="path1035"
inkscape:connector-curvature="0"
style="fill:#000000;fill-opacity:0.78431374" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

@@ -0,0 +1,8 @@
# Default Dark Theme
## Icons
The following icons are from the typicons.font package on [GitHub](https://github.com/stephenhutchings/typicons.font):
* globe.svg
* time.svg
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.2"
width="20"
height="20"
viewBox="0 0 20 20"
id="svg856"
sodipodi:docname="globe.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata862">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs860" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1013"
id="namedview858"
showgrid="false"
inkscape:zoom="33.875"
inkscape:cx="12.118081"
inkscape:cy="12"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg856" />
<path
d="m 8.932347,3.9995001 c 2.198072,0 3.985624,1.794056 3.985624,4.0001249 0,2.206069 -1.787552,4.000125 -3.985624,4.000125 -2.1960777,0 -3.9836298,-1.794056 -3.9836298,-4.000125 0,-2.2060689 1.7875521,-4.0001249 3.9836298,-4.0001249 m 0,-2.0000625 c -3.3020882,0 -5.9764414,2.6860839 -5.9764414,6.0001874 0,3.314104 2.6743532,6.000188 5.9764414,6.000188 3.300097,0 5.978436,-2.688084 5.978436,-6.000188 0,-3.3141035 -2.678339,-6.0001874 -5.978436,-6.0001874 z m 5.978436,16.0005004 h -3.985624 v -1.230039 c 1.635102,-0.371012 3.134693,-1.188037 4.347319,-2.406075 C 16.965371,12.664771 17.9,10.4037 17.9,8.000625 17.9,5.9335605 17.211483,3.9724992 15.939073,2.3814495 l 0.672574,-0.673021 c 0.389595,-0.3910122 0.389595,-1.023032 9.75e-4,-1.4150442 -0.390591,-0.3920123 -1.020319,-0.3900122 -1.409914,-0.001 l -2.044625,2.049064 0.705456,0.7080221 c 1.317248,1.3210413 2.043628,3.0800966 2.043628,4.9501546 0,1.870058 -0.72638,3.627113 -2.043628,4.949155 -1.317249,1.322041 -3.067934,2.051064 -4.931213,2.051064 -1.8632787,0 -3.6139637,-0.729023 -4.9312122,-2.051064 -0.3895946,-0.391013 -1.0193231,-0.391013 -1.4089178,0 -0.3895947,0.390012 -0.3895947,1.023032 0,1.414044 1.6928935,1.699053 3.9447707,2.637082 6.34013,2.637082 v 1.000032 H 4.9467244 c -0.5510125,0 -0.9964058,0.447013 -0.9964058,1.000031 C 3.9503186,19.552986 4.3957119,20 4.9467244,20 h 9.9640586 c 0.551012,0 0.996406,-0.447014 0.996406,-1.000031 0,-0.553018 -0.445394,-1.000031 -0.996406,-1.000031 z"
id="path854"
inkscape:connector-curvature="0"
style="stroke-width:0.99821687;fill:#aeaeae;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.2"
width="21"
height="21"
viewBox="0 0 21 21"
id="svg1039"
sodipodi:docname="time-dark.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata1045">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs1043" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1013"
id="namedview1041"
showgrid="false"
inkscape:zoom="27.812867"
inkscape:cx="6.903687"
inkscape:cy="11.89962"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg1039" />
<g
id="g1037"
transform="translate(-1.5,-2)"
style="fill:#aeaeae;fill-opacity:1">
<path
d="M 19.414,8.902 C 19.518,8.854 19.62,8.794 19.707,8.707 l 0.5,-0.5 c 0.391,-0.391 0.391,-1.023 0,-1.414 -0.391,-0.391 -1.023,-0.391 -1.414,0 l -0.5,0.5 -0.115,0.173 C 16.791,6.154 14.99,5.276 12.989,5.056 L 13,5 V 4 h 1 C 14.55,4 15,3.55 15,3 15,2.45 14.55,2 14,2 H 10 C 9.45,2 9,2.45 9,3 9,3.55 9.45,4 10,4 h 1 v 1 l 0.012,0.057 C 6.506,5.549 3,9.364 3,14 c 0,4.971 4.029,9 9,9 4.971,0 9,-4.029 9,-9 0,-1.894 -0.588,-3.648 -1.586,-5.098 z M 12,21 C 8.141,21 5,17.86 5,14 5,10.14 8.141,7 12,7 c 3.859,0 7,3.14 7,7 0,3.86 -3.141,7 -7,7 z m 1,-8 v -2 c 0,-0.55 -0.45,-1 -1,-1 -0.55,0 -1,0.45 -1,1 v 3 c 0,0.55 0.45,1 1,1 h 3 c 0.55,0 1,-0.45 1,-1 0,-0.55 -0.45,-1 -1,-1 z M 12,8 c -3.312,0 -6,2.688 -6,6 0,3.312 2.688,6 6,6 3.312,0 6,-2.688 6,-6 0,-3.312 -2.688,-6 -6,-6 z m 0,11 C 9.243,19 7,16.757 7,14 7,11.243 9.243,9 12,9 c 2.757,0 5,2.243 5,5 0,2.757 -2.243,5 -5,5 z"
id="path1035"
inkscape:connector-curvature="0"
style="fill:#aeaeae;fill-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

+1
View File
@@ -280,6 +280,7 @@ class GuiDocEditor(QTextEdit):
def setDictionaries(self):
self.theDict.setLanguage(self.mainConf.spellLanguage, self.theProject.projDict)
self.theParent.statusBar.setLanguage(self.mainConf.spellLanguage)
return True
def setSpellCheck(self, theMode):
+7 -1
View File
@@ -17,7 +17,7 @@ from os import path
from PyQt5.QtCore import QSize
from PyQt5.QtSvg import QSvgWidget
from PyQt5.QtGui import QIcon
from PyQt5.QtGui import QIcon, QPixmap
logger = logging.getLogger(__name__)
@@ -41,6 +41,7 @@ class GuiIcons:
"search" : "edit-find",
"replace" : "edit-find-replace",
"time" : None,
"globe" : None,
}
DECO_MAP = {
@@ -96,6 +97,11 @@ class GuiIcons:
return self.qIcons[iconKey]
return QIcon()
def getPixmap(self, iconKey, iconSize):
if iconKey in self.qIcons:
return self.qIcons[iconKey].pixmap(iconSize[0], iconSize[1], QIcon.Normal)
return QPixmap()
##
# Internal Functions
##
+34 -14
View File
@@ -16,9 +16,11 @@ import nw
from time import time
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QIcon, QColor, QPixmap
from PyQt5.QtGui import QIcon, QColor, QPixmap, QFont
from PyQt5.QtWidgets import QStatusBar, QLabel, QFrame
from nw.tools import NWSpellCheck
logger = logging.getLogger(__name__)
class GuiMainStatus(QStatusBar):
@@ -28,14 +30,16 @@ class GuiMainStatus(QStatusBar):
logger.debug("Initialising MainStatus ...")
self.mainConf = nw.CONFIG
self.theParent = theParent
self.refTime = None
self.mainConf = nw.CONFIG
self.theParent = theParent
self.refTime = None
self.iconGrey = QPixmap(16,16)
self.iconYellow = QPixmap(16,16)
self.iconGreen = QPixmap(16,16)
self.monoFont = QFont("Monospace",10)
self.iconGrey.fill(QColor(*self.theParent.theTheme.statNone))
self.iconYellow.fill(QColor(*self.theParent.theTheme.statUnsaved))
self.iconGreen.fill(QColor(*self.theParent.theTheme.statSaved))
@@ -43,31 +47,43 @@ class GuiMainStatus(QStatusBar):
self.boxStats = QLabel()
self.boxStats.setToolTip("Project Word Count | Session Word Count")
self.boxTime = QLabel("")
self.boxTime.setToolTip("Session Time")
self.boxTime.setAlignment(Qt.AlignRight)
self.boxTime.setMinimumWidth(80)
self.timeBox = QLabel("")
self.timeBox.setToolTip("Session Time")
self.timeBox.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
self.timeBox.setFont(self.monoFont)
self.timeIcon = QLabel()
self.timeIcon.setPixmap(self.theParent.theTheme.getPixmap("time",(14,14)))
self.boxCounts = QLabel()
self.boxCounts.setToolTip("Document Character | Word | Paragraph Count")
self.projChanged = QLabel("")
self.projChanged.setFixedHeight(16)
self.projChanged.setFixedWidth(16)
self.projChanged.setFixedHeight(14)
self.projChanged.setFixedWidth(14)
self.projChanged.setToolTip("Project Changes Saved")
self.docChanged = QLabel("")
self.docChanged.setFixedHeight(16)
self.docChanged.setFixedWidth(16)
self.docChanged.setFixedHeight(14)
self.docChanged.setFixedWidth(14)
self.docChanged.setToolTip("Document Changes Saved")
self.langBox = QLabel("None")
self.langIcon = QLabel("")
self.langIcon.setPixmap(self.theParent.theTheme.getPixmap("globe",(14,14)))
# Add Them
self.addPermanentWidget(self.langIcon)
self.addPermanentWidget(self.langBox)
self.addPermanentWidget(QLabel(" "))
self.addPermanentWidget(self.docChanged)
self.addPermanentWidget(self.boxCounts)
self.addPermanentWidget(QLabel(" "))
self.addPermanentWidget(self.projChanged)
self.addPermanentWidget(self.boxStats)
self.addPermanentWidget(self.boxTime)
self.addPermanentWidget(QLabel(" "))
self.addPermanentWidget(self.timeIcon)
self.addPermanentWidget(self.timeBox)
self.setSizeGripEnabled(True)
@@ -99,6 +115,10 @@ class GuiMainStatus(QStatusBar):
self.showMessage(theMessage, int(timeOut*1000))
return
def setLanguage(self, theLanguage):
self.langBox.setText(NWSpellCheck.expandLanguage(theLanguage))
return
def setProjectStatus(self, isChanged):
if isChanged is None:
self.projChanged.setPixmap(self.iconGrey)
@@ -144,7 +164,7 @@ class GuiMainStatus(QStatusBar):
tM = tM - tH*60
tS = tS - tM*60 - tH*3600
theTime = "%02d:%02d:%02d" % (tH,tM,tS)
self.boxTime.setText(theTime)
self.timeBox.setText(theTime)
return
# END Class GuiMainStatus
+4 -3
View File
@@ -17,7 +17,7 @@ import nw
from os import path, listdir
from PyQt5.QtWidgets import qApp
from PyQt5.QtGui import QPalette, QColor, QIcon
from PyQt5.QtGui import QPalette, QColor, QIcon, QPixmap
from nw.constants import nwAlert
from nw.gui.icons import GuiIcons
@@ -91,6 +91,7 @@ class GuiTheme:
self.updateTheme()
self.getIcon = self.theIcons.getIcon
self.getPixmap = self.theIcons.getPixmap
self.loadDecoration = self.theIcons.loadDecoration
return
@@ -233,7 +234,7 @@ class GuiTheme:
try:
confParser.read_file(open(themeConf, mode="r", encoding="utf8"))
except Exception as e:
self.theParent.makeAlert(["Could not load theme config file",str(e)],nwAlert.ERROR)
self.theParent.makeAlert(["Could not load theme config file.",str(e)],nwAlert.ERROR)
continue
themeName = ""
if confParser.has_section("Main"):
@@ -261,7 +262,7 @@ class GuiTheme:
try:
confParser.read_file(open(syntaxPath, mode="r", encoding="utf8"))
except Exception as e:
self.theParent.makeAlert(["Could not load syntax file",str(e)],nwAlert.ERROR)
self.theParent.makeAlert(["Could not load syntax file.",str(e)],nwAlert.ERROR)
return []
syntaxName = ""
if confParser.has_section("Main"):
+13
View File
@@ -13,6 +13,8 @@
import logging
import nw
from nw.constants import isoLanguage
logger = logging.getLogger(__name__)
class NWSpellCheck():
@@ -54,6 +56,17 @@ class NWSpellCheck():
def listDictionaries(self):
return []
@staticmethod
def expandLanguage(spTag):
spBits = spTag.split("_")
if spBits[0] in isoLanguage.ISO_639_1:
spLang = isoLanguage.ISO_639_1[spBits[0]]
else:
spLang = spBits[0]
if len(spBits) > 1:
spLang += " (%s)" % spBits[1]
return spLang
##
# Internal Functions
##
+1 -10
View File
@@ -15,7 +15,6 @@ import enchant
import nw
from nw.tools.spellcheck import NWSpellCheck
from nw.constants import isoLanguage
logger = logging.getLogger(__name__)
@@ -58,15 +57,7 @@ class NWSpellEnchant(NWSpellCheck):
def listDictionaries(self):
retList = []
for spTag, spProvider in enchant.list_dicts():
spList = []
if spTag[:2] in isoLanguage.ISO_639_1:
spList.append(isoLanguage.ISO_639_1[spTag[:2]])
else:
spList.append(spTag[:2])
if len(spTag) > 3:
spList.append("(%s)" % spTag[3:])
spList.append("[%s]" % spProvider.name)
spName = " ".join(spList)
spName = "%s [%s]" % (self.expandLanguage(spTag), spProvider.name)
retList.append((spTag, spName))
return retList
+2 -12
View File
@@ -19,7 +19,6 @@ from difflib import get_close_matches
logger = logging.getLogger(__name__)
from nw.tools.spellcheck import NWSpellCheck
from nw.constants import isoLanguage
class NWSpellSimple(NWSpellCheck):
@@ -105,17 +104,8 @@ class NWSpellSimple(NWSpellCheck):
if theBits[1] != ".dict":
continue
spTag = theBits[0]
spList = []
if spTag[:2] in isoLanguage.ISO_639_1:
spList.append(isoLanguage.ISO_639_1[spTag[:2]])
else:
spList.append(spTag[:2])
if len(spTag) > 3:
spList.append("(%s)" % spTag[3:])
spList.append("[internal]")
spName = " ".join(spList)
retList.append((spTag, spName))
spName = "%s [nternal]" % self.expandLanguage(theBits[0])
retList.append((theBits[0], spName))
return retList