The branch, build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d has been updated via c9c0d31051ce335870cdb5119ae91896fb741d5d (commit) from 2ba7c2a657c8d62f3ee8975b46830dbc541d0eb9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: .../{pyhoca-trayicon.png => pyhoca-session.png} | Bin 19982 -> 19982 bytes .../{pyhoca-trayicon.png => pyhoca-session.png} | Bin 1099 -> 1099 bytes icons/PyHoca/16x16/system-search.png | Bin 0 -> 885 bytes .../{pyhoca-trayicon.png => pyhoca-session.png} | Bin 1519 -> 1519 bytes .../32x32/{auth_error.png => profile_error.png} | 0 .../{pyhoca-trayicon.png => pyhoca-session.png} | Bin 2621 -> 2621 bytes .../{pyhoca-trayicon.png => pyhoca-session.png} | Bin 5073 -> 5073 bytes .../{pyhoca-trayicon.png => pyhoca-session.png} | Bin 7923 -> 7923 bytes .../{pyhoca-trayicon.svg => pyhoca-session.svg} | 0 icons/PyHoca/scalable/system-search.svg | 430 +++++++ pyhoca/wxgui/frontend.py | 86 +- pyhoca/wxgui/logon.py | 12 +- pyhoca/wxgui/menus_taskbar.py | 3 +- pyhoca/wxgui/notify.py | 1 + pyhoca/wxgui/profilemanager.py | 1234 ++++++++++++++------ 15 files changed, 1325 insertions(+), 441 deletions(-) copy icons/PyHoca/128x128/{pyhoca-trayicon.png => pyhoca-session.png} (100%) copy icons/PyHoca/16x16/{pyhoca-trayicon.png => pyhoca-session.png} (100%) create mode 100644 icons/PyHoca/16x16/system-search.png copy icons/PyHoca/22x22/{pyhoca-trayicon.png => pyhoca-session.png} (100%) copy icons/PyHoca/32x32/{auth_error.png => profile_error.png} (100%) copy icons/PyHoca/32x32/{pyhoca-trayicon.png => pyhoca-session.png} (100%) copy icons/PyHoca/48x48/{pyhoca-trayicon.png => pyhoca-session.png} (100%) copy icons/PyHoca/64x64/{pyhoca-trayicon.png => pyhoca-session.png} (100%) copy icons/PyHoca/scalable/{pyhoca-trayicon.svg => pyhoca-session.svg} (100%) create mode 100644 icons/PyHoca/scalable/system-search.svg The diff of changes is: diff --git a/icons/PyHoca/128x128/pyhoca-trayicon.png b/icons/PyHoca/128x128/pyhoca-session.png similarity index 100% copy from icons/PyHoca/128x128/pyhoca-trayicon.png copy to icons/PyHoca/128x128/pyhoca-session.png diff --git a/icons/PyHoca/16x16/pyhoca-trayicon.png b/icons/PyHoca/16x16/pyhoca-session.png similarity index 100% copy from icons/PyHoca/16x16/pyhoca-trayicon.png copy to icons/PyHoca/16x16/pyhoca-session.png diff --git a/icons/PyHoca/16x16/system-search.png b/icons/PyHoca/16x16/system-search.png new file mode 100644 index 0000000..1400155 Binary files /dev/null and b/icons/PyHoca/16x16/system-search.png differ diff --git a/icons/PyHoca/22x22/pyhoca-trayicon.png b/icons/PyHoca/22x22/pyhoca-session.png similarity index 100% copy from icons/PyHoca/22x22/pyhoca-trayicon.png copy to icons/PyHoca/22x22/pyhoca-session.png diff --git a/icons/PyHoca/32x32/auth_error.png b/icons/PyHoca/32x32/profile_error.png similarity index 100% copy from icons/PyHoca/32x32/auth_error.png copy to icons/PyHoca/32x32/profile_error.png diff --git a/icons/PyHoca/32x32/pyhoca-trayicon.png b/icons/PyHoca/32x32/pyhoca-session.png similarity index 100% copy from icons/PyHoca/32x32/pyhoca-trayicon.png copy to icons/PyHoca/32x32/pyhoca-session.png diff --git a/icons/PyHoca/48x48/pyhoca-trayicon.png b/icons/PyHoca/48x48/pyhoca-session.png similarity index 100% copy from icons/PyHoca/48x48/pyhoca-trayicon.png copy to icons/PyHoca/48x48/pyhoca-session.png diff --git a/icons/PyHoca/64x64/pyhoca-trayicon.png b/icons/PyHoca/64x64/pyhoca-session.png similarity index 100% copy from icons/PyHoca/64x64/pyhoca-trayicon.png copy to icons/PyHoca/64x64/pyhoca-session.png diff --git a/icons/PyHoca/scalable/pyhoca-trayicon.svg b/icons/PyHoca/scalable/pyhoca-session.svg similarity index 100% copy from icons/PyHoca/scalable/pyhoca-trayicon.svg copy to icons/PyHoca/scalable/pyhoca-session.svg diff --git a/icons/PyHoca/scalable/system-search.svg b/icons/PyHoca/scalable/system-search.svg new file mode 100644 index 0000000..ed08f02 --- /dev/null +++ b/icons/PyHoca/scalable/system-search.svg @@ -0,0 +1,430 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<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:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="48px" + height="48px" + id="svg7233" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="search48.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs7235"> + <linearGradient + id="linearGradient4467"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop4469" /> + <stop + style="stop-color:#ffffff;stop-opacity:0.24761905;" + offset="1.0000000" + id="stop4471" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4467" + id="radialGradient4473" + cx="15.414371" + cy="13.078408" + fx="15.414371" + fy="13.078408" + r="6.6562500" + gradientTransform="matrix(2.789229,0,0,2.4225698,-25.723775,-20.247482)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4454"> + <stop + style="stop-color:#729fcf;stop-opacity:0.20784314;" + offset="0.0000000" + id="stop4456" /> + <stop + style="stop-color:#729fcf;stop-opacity:0.67619050;" + offset="1.0000000" + id="stop4458" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4454" + id="radialGradient4460" + cx="18.240929" + cy="21.817987" + fx="18.240929" + fy="21.817987" + r="8.3085051" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + id="linearGradient4931"> + <stop + style="stop-color:#babdb6;stop-opacity:1;" + offset="0" + id="stop4933" /> + <stop + style="stop-color:#888a85" + offset="1" + id="stop4935" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4931" + id="linearGradient4937" + x1="54.1129" + y1="12.846775" + x2="50.079948" + y2="-3.8813655" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + id="linearGradient23434"> + <stop + style="stop-color:#888a85;stop-opacity:1" + offset="0" + id="stop23436" /> + <stop + style="stop-color:#babdb6;stop-opacity:1" + offset="1" + id="stop23438" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient23434" + id="linearGradient23440" + x1="55.878288" + y1="12.472493" + x2="52.5" + y2="-4.6213989" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + id="linearGradient3904"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop3906" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop3908" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3904" + id="linearGradient7863" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.9999494,0,0,1.0000027,11.137591,10.721751)" + x1="21.397852" + y1="20.653446" + x2="23.475424" + y2="22.873726" /> + <linearGradient + id="linearGradient2609" + inkscape:collect="always"> + <stop + id="stop2611" + offset="0" + style="stop-color:#ffffff;stop-opacity:1" /> + <stop + id="stop2613" + offset="1" + style="stop-color:#eeeeec" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2609" + id="radialGradient1409" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0,1.143443,-1.247217,-1.248581e-6,41.735,-54.25682)" + cx="45.094624" + cy="-2.6936908" + fx="45.094624" + fy="-2.6936908" + r="10.498367" /> + <linearGradient + inkscape:collect="always" + id="linearGradient19914"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop19916" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop19918" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient19914" + id="linearGradient19920" + x1="33.985317" + y1="32.045906" + x2="37.211494" + y2="35.272079" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-0.9999995,2.5184337e-4)" /> + <linearGradient + inkscape:collect="always" + id="linearGradient19900"> + <stop + style="stop-color:#d3d7cf;stop-opacity:0.2" + offset="0" + id="stop19902" /> + <stop + style="stop-color:#d3d7cf" + offset="1" + id="stop19904" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient19900" + id="linearGradient19906" + x1="40.25" + y1="41" + x2="43.0625" + y2="38.434578" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-0.9999995,2.52e-4)" /> + <linearGradient + id="linearGradient2690" + inkscape:collect="always"> + <stop + id="stop2692" + offset="0" + style="stop-color:#2e3436" /> + <stop + id="stop2694" + offset="1" + style="stop-color:#555753" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2690" + id="linearGradient1423" + gradientUnits="userSpaceOnUse" + x1="81.096306" + y1="57.148193" + x2="83.629295" + y2="54.615208" /> + <linearGradient + id="linearGradient2698"> + <stop + id="stop2700" + offset="0" + style="stop-color:#888a85;stop-opacity:1" /> + <stop + style="stop-color:#a3a5a2;stop-opacity:1;" + offset="0.70238096" + id="stop2706" /> + <stop + id="stop2702" + offset="1" + style="stop-color:#888a85" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2698" + id="linearGradient1421" + gradientUnits="userSpaceOnUse" + x1="81.332451" + y1="55.106758" + x2="82.919647" + y2="53.511261" /> + <linearGradient + id="linearGradient2617"> + <stop + id="stop2619" + offset="0" + style="stop-color:#fbfbfa;stop-opacity:1;" /> + <stop + id="stop2621" + offset="1" + style="stop-color:#d3d7cf" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2617" + id="radialGradient8419" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0,-1.686609,1.66336,0,41.65431,111.7396)" + cx="59.787472" + cy="10.901535" + fx="59.787472" + fy="10.901535" + r="10.55559" /> + <filter + inkscape:collect="always" + id="filter3268" + x="-0.088636374" + width="1.1772727" + y="-0.38360636" + height="1.7672127"> + <feGaussianBlur + inkscape:collect="always" + stdDeviation="1.5983598" + id="feGaussianBlur3270" /> + </filter> + <linearGradient + id="linearGradient3244"> + <stop + style="stop-color:#000000;stop-opacity:0" + offset="0" + id="stop3246" /> + <stop + id="stop3274" + offset="0.0807889" + style="stop-color:#000000;stop-opacity:0;" /> + <stop + style="stop-color:#000000;stop-opacity:0.24705882;" + offset="0.61539668" + id="stop3276" /> + <stop + id="stop3272" + offset="0.74850917" + style="stop-color:#000000;stop-opacity:0.49803922;" /> + <stop + style="stop-color:#000000;stop-opacity:1" + offset="1" + id="stop3248" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3244" + id="linearGradient3250" + x1="3.5" + y1="35.742943" + x2="46.77866" + y2="45.742943" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="7" + inkscape:cx="24" + inkscape:cy="24" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:grid-bbox="true" + inkscape:document-units="px" + inkscape:window-width="641" + inkscape:window-height="688" + inkscape:window-x="276" + inkscape:window-y="123" /> + <metadata + id="metadata7238"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:label="Layer 1" + inkscape:groupmode="layer"> + <g + transform="translate(-12.26513,47.500242)" + style="display:inline" + inkscape:label="base" + id="g2637" /> + <path + style="opacity:0.6;fill:url(#linearGradient3250);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.67653471;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter3268)" + d="M 21,35.742942 C 11.34,35.742942 3.5,37.555955 3.5,39.789845 C 3.5,42.023736 11.34,43.836748 21,43.836748 C 25.496436,43.836748 29.586827,43.441342 32.6875,42.796116 L 33.5,43.742802 C 33.525278,43.764 33.586841,43.785509 33.65625,43.800615 L 41.625,45.657855 C 41.981813,45.740449 42.507656,45.759155 43.15625,45.730121 C 43.804844,45.701087 44.567815,45.60604 45.375,45.419377 C 46.175523,45.234255 46.580812,45.069505 46.71875,44.92074 C 46.856687,44.771976 46.758027,44.640759 46.40625,44.55941 L 38.375,42.716623 C 38.29626,42.698751 38.203146,42.684259 38.09375,42.68049 L 34,42.492598 C 36.790145,41.775563 38.5,40.829653 38.5,39.789845 C 38.5,37.555955 30.66,35.742942 21,35.742942 z" + id="path2462" + transform="matrix(1.0166673,0,0,0.9,-0.5583355,4.3316038)" /> + <path + transform="matrix(1.5085714,0,0,1.5085715,-58.199999,12.211681)" + d="M 62.5,4.5 A 10,10 0 1 1 42.5,4.5 A 10,10 0 1 1 62.5,4.5 z" + sodipodi:ry="10" + sodipodi:rx="10" + sodipodi:cy="4.5" + sodipodi:cx="52.5" + id="path2607" + style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#radialGradient8419);stroke-width:1.87499988;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + sodipodi:type="arc" /> + <g + style="display:inline" + transform="matrix(1.544052,0,0,1.536016,-85.57756,-44.444898)" + id="g2708"> + <path + style="fill:url(#linearGradient1421);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient1423);stroke-width:0.67653471;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + d="M 74.853412,50.354391 L 77.443998,53.023634 L 82.625171,58.237128 C 82.817674,58.430832 83.596641,58.55743 84.56811,57.580878 C 85.53958,56.604326 85.463684,55.876998 85.215757,55.627773 L 80.034584,50.419494 L 77.443998,47.815355 L 74.853412,50.354391 z" + id="path2682" + sodipodi:nodetypes="cczzzccc" /> + </g> + <path + sodipodi:nodetypes="cczzzccc" + id="path17267" + d="M 31.453125,32.922127 L 34.90721,36.480066 L 42.406806,44.028842 C 42.77564,44.400095 43.340655,44.246748 44.274502,43.3129 C 45.208352,42.379052 45.449128,41.911605 44.985457,41.445202 L 37.485862,33.901412 L 34.0625,30.500252 L 31.453125,32.922127 z" + style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient19906);stroke-width:0.99999934;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /> + <path + style="opacity:0.15294118;fill:url(#linearGradient19920);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.67653471;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + d="M 32.550678,31.195018 C 32.29085,31.282527 30.033957,33.133188 30.103541,33.39715 L 33.50745,37.107952 C 33.532728,37.199617 33.582796,37.282629 33.652205,37.347954 L 41.613723,45.364038 C 41.970537,45.7212 42.509181,45.825593 43.157775,45.700041 C 43.80637,45.574489 44.570165,45.163213 45.37735,44.356027 C 46.177873,43.555506 46.590458,42.839306 46.728396,42.196005 C 46.866334,41.552703 46.742411,40.963765 46.390634,40.611988 L 38.380865,32.643905 C 38.302123,32.566621 38.200751,32.516199 38.091355,32.499904 L 34.340187,29.132518 C 34.245612,29.105383 32.645253,31.167883 32.550678,31.195018 z" + id="path19908" + sodipodi:nodetypes="cccccsssccccc" /> + <path + transform="matrix(1.5500015,0,0,1.5500015,-60.375079,12.025245)" + d="M 62.5,4.5 A 10,10 0 1 1 42.5,4.5 A 10,10 0 1 1 62.5,4.5 z" + sodipodi:ry="10" + sodipodi:rx="10" + sodipodi:cy="4.5" + sodipodi:cx="52.5" + id="path2605" + style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#radialGradient1409);stroke-width:0.6451413;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + sodipodi:type="arc" /> + <path + style="opacity:0.36936939;fill:url(#linearGradient7863);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.67653471;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + d="M 32.571456,31.340596 C 32.398245,31.398935 30.441228,32.522909 30.487615,32.698884 L 33.370692,35.607487 C 33.387543,35.668598 33.42092,35.723939 33.467191,35.767489 L 36.754802,32.468631 C 36.702309,32.417109 36.618546,32.320669 36.545618,32.309805 L 34.028798,29.731957 C 33.983608,29.606724 32.634502,31.322506 32.571456,31.340596 z" + id="path7861" + sodipodi:nodetypes="cccccccc" /> + <path + transform="matrix(1.6500024,0,0,1.6500024,-65.653719,11.575241)" + d="M 62.5,4.5 A 10,10 0 1 1 42.5,4.5 A 10,10 0 1 1 62.5,4.5 z" + sodipodi:ry="10" + sodipodi:rx="10" + sodipodi:cy="4.5" + sodipodi:cx="52.5" + id="path2599" + style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient23440);stroke-width:0.60603064;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + sodipodi:type="arc" /> + <path + transform="matrix(1.3500044,0,0,1.3500044,-49.875231,12.925232)" + d="M 62.5,4.5 A 10,10 0 1 1 42.5,4.5 A 10,10 0 1 1 62.5,4.5 z" + sodipodi:ry="10" + sodipodi:rx="10" + sodipodi:cy="4.5" + sodipodi:cx="52.5" + id="path4927" + style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient4937);stroke-width:0.74067366;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + sodipodi:type="arc" /> + <path + sodipodi:type="arc" + style="fill:url(#radialGradient4460);fill-opacity:1;fill-rule:evenodd;stroke:#3063a3;stroke-width:0.66473687;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline" + id="path4452" + sodipodi:cx="17.589281" + sodipodi:cy="18.478292" + sodipodi:rx="8.3085051" + sodipodi:ry="8.3085051" + d="M 25.897786,18.478292 A 8.3085051,8.3085051 0 1 1 9.280776,18.478292 A 8.3085051,8.3085051 0 1 1 25.897786,18.478292 z" + transform="matrix(1.5044775,0,0,1.5044776,-5.4626775,-8.7999259)" /> + <path + style="opacity:0.83422457;fill:url(#radialGradient4473);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" + d="M 20.764036,8.0837588 C 15.162274,8.0837588 10.626128,12.619905 10.626128,18.221665 C 10.626128,19.839479 11.078249,21.328019 11.752561,22.685682 C 13.099737,23.182235 14.530813,23.520079 16.0497,23.520079 C 22.687746,23.520079 27.989107,18.290454 28.398756,11.755099 C 26.536772,9.5547378 23.870051,8.0837588 20.764036,8.0837588 z" + id="path4462" /> + </g> +</svg> diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py index f305587..ba61743 100644 --- a/pyhoca/wxgui/frontend.py +++ b/pyhoca/wxgui/frontend.py @@ -105,6 +105,10 @@ class PyHocaGUI(wx.App, x2go.X2goClient): wx.Yield() _x2goclient_kwargs = { + 'use_listsessions_cache': True, + 'auto_update_listsessions_cache': True, + 'auto_update_sessionregistry': True, + 'auto_register_sessions': True, 'logger': self._pyhoca_liblogger, } if self.args.backend_controlsession is not None: @@ -191,8 +195,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient): if self.args.auto_connect: - for s in self._X2goClient__client_registered_sessions: - session_uuid = s.get_uuid() + for session_uuid in self._X2goClient__client_registered_sessions: self._pyhoca_logger('auto-connecting to %s session profile' % s.get_profile_name(), loglevel=x2go.log.loglevel_NOTICE) gevent.spawn(self._auto_connect, session_uuid) @@ -210,7 +213,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient): if self.args.session_profile: for profile_name in self.args.session_profile.split(','): - if not self._X2goClient__client_registered_sessions_of_name(profile_name): + if not self._X2goClient__client_registered_sessions_of_profile_name(profile_name): continue _dummy_id = wx.NewId() self._eventid_profilenames_map[_dummy_id] = profile_name @@ -324,9 +327,12 @@ class PyHocaGUI(wx.App, x2go.X2goClient): except gevent.socket.error, e: self.notifier.send('%s - connect error' % profile_name, '%s!' % e.strerror, icon='auth_error', timeout=4000) self._temp_disabled_profile_names.remove(profile_name) - except: - self.notifier.send('%s - connect error' % profile_name, 'An unknown error occurred during authentication!', icon='auth_error', timeout=4000) + except EOFError, e: + self.notifier.send('%s - connect error' % profile_name, 'Communication for authentication incomplete! Try again...', icon='auth_error', timeout=4000) self._temp_disabled_profile_names.remove(profile_name) + #except: + # self.notifier.send('%s - connect error' % profile_name, 'An unknown error occurred during authentication!', icon='auth_error', timeout=4000) + # self._temp_disabled_profile_names.remove(profile_name) self.taskbar.SetIconIdle() @@ -347,11 +353,10 @@ class PyHocaGUI(wx.App, x2go.X2goClient): """ self.current_profile_name = self._eventid_profilenames_map[evt.GetId()] - _query_session = self._X2goClient__client_registered_sessions_of_name(self.current_profile_name)[0] + _query_session = self._X2goClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0] session_uuid = self._X2goClient__register_session(profile_name=self.current_profile_name) if self._X2goClient__server_is_alive(session_uuid): gevent.spawn(self._X2goClient__start_session, session_uuid) - self.notifier.send(self.current_profile_name, 'New X2go session starting up...', icon='session_start', timeout=10000) _dummy = self._X2goClient__list_sessions(session_uuid, refresh_cache=True) def OnSessionResume(self, evt): @@ -360,60 +365,33 @@ class PyHocaGUI(wx.App, x2go.X2goClient): """ self.current_profile_name = self._eventid_profilenames_map[evt.GetId()] - _control_session = self._X2goClient__client_registered_sessions_of_name(self.current_profile_name)[0] - session_uuid = _control_session.get_uuid() + session_uuid = self._X2goClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0] session_name = self._eventid_sessionnames_map[evt.GetId()] if self._X2goClient__server_is_alive(session_uuid): - gevent.spawn(self._X2goClient__resume_session, session_uuid, session_name=session_name) - self.notifier.send(self.current_profile_name, 'Resuming X2go session...\n%s' % session_name, icon='session_resume', timeout=10000) + gevent.spawn(self._X2goClient__resume_session, session_name=session_name) _dummy = self._X2goClient__list_sessions(session_uuid, refresh_cache=True) self._eventid_sessionnames_map = {} - - def _do_suspend(self, evt, session_uuid, session_name): - profile_name = self.current_profile_name - self._X2goClient__suspend_session(session_uuid, session_name=session_name) - if self._X2goClient__server_is_alive(session_uuid): - i=0 - while not self._X2goClient__is_session_suspended(session_uuid, session_name) and i <= 10: - i +=1 - gevent.sleep(1) - self.notifier.send(profile_name, 'X2go session has been suspended...\n%s' % session_name, icon='session_suspend', timeout=8000) - _dummy = self._X2goClient__list_sessions(session_uuid, refresh_cache=True) - def OnSessionSuspend(self, evt): """\ STILL UNDOCUMENTED """ self.current_profile_name = self._eventid_profilenames_map[evt.GetId()] - _control_session = self._X2goClient__client_registered_sessions_of_name(self.current_profile_name)[0] - session_uuid = _control_session.get_uuid() + session_uuid = self._X2goClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0] session_name = self._eventid_sessionnames_map[evt.GetId()] - gevent.spawn(self._do_suspend, evt, session_uuid, session_name) + gevent.spawn(self._X2goClient__suspend_session, session_uuid, session_name=session_name) self._eventid_sessionnames_map = {} - def _do_terminate(self, evt, session_uuid, session_name): - profile_name = self.current_profile_name - self._X2goClient__terminate_session(session_uuid, session_name=session_name) - if self._X2goClient__server_is_alive(session_uuid): - i=0 - while not self._X2goClient__has_session_terminated(session_uuid, session_name) and i <= 10: - i +=1 - gevent.sleep(1) - self.notifier.send(profile_name, 'X2go session has terminated...\n%s' % session_name, icon='session_terminate', timeout=8000) - _dummy = self._X2goClient__list_sessions(session_uuid, refresh_cache=True) - def OnSessionTerminate(self, evt): """\ STILL UNDOCUMENTED """ self.current_profile_name = self._eventid_profilenames_map[evt.GetId()] - _control_session = self._X2goClient__client_registered_sessions_of_name(self.current_profile_name)[0] - session_uuid = _control_session.get_uuid() + session_uuid = self._X2goClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0] session_name = self._eventid_sessionnames_map[evt.GetId()] - gevent.spawn(self._do_terminate, evt, session_uuid, session_name) + gevent.spawn(self._X2goClient__terminate_session, session_uuid, session_name=session_name) self._eventid_sessionnames_map = {} def OnCleanSessions(self, evt): @@ -422,8 +400,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient): """ self.current_profile_name = self._eventid_profilenames_map[evt.GetId()] - _control_session = self._X2goClient__client_registered_sessions_of_name(self.current_profile_name)[0] - session_uuid = _control_session.get_uuid() + session_uuid = self._X2goClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0] session_names = self._X2goClient__server_running_sessions(session_uuid) + self._X2goClient__server_suspended_sessions(session_uuid) if self._X2goClient__server_is_alive(session_uuid): if session_names: @@ -439,9 +416,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient): """ self.current_profile_name = self._eventid_profilenames_map[evt.GetId()] - _control_session = self._X2goClient__client_registered_sessions_of_name(self.current_profile_name)[0] - session_uuid = _control_session.get_uuid() - + session_uuid = self._X2goClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0] # disconnect all profile sessions if self._X2goClient__server_is_alive(session_uuid): self._X2goClient__disconnect_profile(self.current_profile_name) @@ -473,7 +448,11 @@ class PyHocaGUI(wx.App, x2go.X2goClient): """ self.current_profile_name = self._eventid_profilenames_map[evt.GetId()] self._pyhoca_logger('deleting session profile %s' % self.current_profile_name, loglevel=x2go.log.loglevel_INFO, ) - profilemanager.PyHocaGUI_ProfileManager(self, 'DELETE', profile_name=self.current_profile_name) + try: + self.session_profiles.delete_profile(self.current_profile_name) + self.notifier.send(title='%s - profile deleted' % self.current_profile_name, text='The session profile has been deleted.', icon='profile_delete') + except: + pass def OnListSessions(self, evt): """\ @@ -510,7 +489,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient): # this hook gets called from Python X2go classes if profile_name's control session has died... def HOOK_on_control_session_death(self, profile_name): - self.notifier.send('%s - channel error' % profile_name, 'Lost connection to server %s unexpectedly! Try to re-connect to the server...' % profile_name, icon='session_warning', timeout=10000) + self.notifier.send('%s - channel error' % profile_name, 'Lost connection to server %s unexpectedly! Try to re-authenticate to the server...' % profile_name, icon='session_warning', timeout=10000) # this hook gets called from Python X2go classes if a print job is coming in and the print action is ,,DIALOG''... def HOOK_open_print_dialog(self, filename, profile_name='UNKNOWN', session_name='UNKNOWN'): @@ -534,3 +513,16 @@ class PyHocaGUI(wx.App, x2go.X2goClient): #print 8 ##_p.Show(True) #print 9 + + def HOOK_on_session_has_started_by_me(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + self.notifier.send(profile_name, 'New X2go session starting up...\n%s' % session_name, icon='session_start', timeout=5000) + def HOOK_on_session_has_started_by_other(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + self.notifier.send(profile_name, 'Another client started X2go session\n%s' % session_name, icon='session_start', timeout=5000) + def HOOK_on_session_has_resumed_by_me(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + self.notifier.send(profile_name, 'Resuming X2go session...\n%s' % session_name, icon='session_resume', timeout=5000) + def HOOK_on_session_has_resumed_by_other(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + self.notifier.send(profile_name, 'Another client resumed X2go session\n%s' % session_name, icon='session_resume', timeout=5000) + def HOOK_on_session_has_been_suspended(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + self.notifier.send(profile_name, 'X2go Session has been suspended\n%s' % session_name, icon='session_suspend', timeout=5000) + def HOOK_on_session_has_terminated(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + self.notifier.send(profile_name, 'X2go Session has terminated\n%s' % session_name, icon='session_terminate', timeout=5000) diff --git a/pyhoca/wxgui/logon.py b/pyhoca/wxgui/logon.py index 5b2b5b9..45ba78c 100644 --- a/pyhoca/wxgui/logon.py +++ b/pyhoca/wxgui/logon.py @@ -116,22 +116,23 @@ class PyHocaGUI_DialogBoxPassword(wx.Dialog): self.passwordTxt = wx.TextCtrl(self, wx.ID_ANY, '', style=wx.TE_PROCESS_ENTER|wx.TE_PASSWORD) self.passwordTxt.SetFocus() loginBtn = wx.Button(self, wx.ID_OK, 'Authenticate') + loginBtn.SetDefault() cancelBtn = wx.Button(self, wx.ID_CANCEL, 'Cancel') self.Bind(wx.EVT_BUTTON, self.OnLogin, loginBtn) self.Bind(wx.EVT_TEXT_ENTER, self.OnLogin, self.userTxt) self.Bind(wx.EVT_TEXT_ENTER, self.OnLogin, self.passwordTxt) self.Bind(wx.EVT_BUTTON, self.OnCancel, cancelBtn) - + # sizer / layout userSizer = wx.BoxSizer(wx.HORIZONTAL) passwordSizer = wx.BoxSizer(wx.HORIZONTAL) btnSizer = wx.BoxSizer(wx.HORIZONTAL) mainSizer = wx.BoxSizer(wx.VERTICAL) - userSizer.Add(userLbl, 0, wx.ALL, 5) + userSizer.Add(userLbl, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 5) userSizer.Add(self.userTxt, 0, wx.ALL, 5) - passwordSizer.Add(passwordLbl, 0, wx.LEFT|wx.RIGHT, 5) - passwordSizer.Add(self.passwordTxt, 0, wx.LEFT, 5) + passwordSizer.Add(passwordLbl, 0, wx.LEFT|wx.ALIGN_CENTER_VERTICAL, 5) + passwordSizer.Add(self.passwordTxt, 0, wx.ALL, 5) btnSizer.Add(loginBtn, 0, wx.ALL, 5) btnSizer.Add(cancelBtn, 0, wx.ALL, 5) mainSizer.Add(userSizer, 0, wx.ALL, 0) @@ -156,7 +157,6 @@ class PyHocaGUI_DialogBoxPassword(wx.Dialog): elif x2go.X2GOCLIENT_OS == 'Windows': self.Move((maxX-225,maxY-160)) - loginBtn.SetDefault() self.Show() def OnLogin(self, evt): @@ -171,7 +171,7 @@ class PyHocaGUI_DialogBoxPassword(wx.Dialog): if len(password) == 0: return - session_uuid = self._PyHocaGUI._X2goClient__client_registered_sessions_of_name(self.current_profile_name)[0].get_uuid() + session_uuid = self._PyHocaGUI._X2goClient__client_registered_sessions_of_profile_name(self.current_profile_name)[0] try: wx.BeginBusyCursor() self._PyHocaGUI._X2goClient__connect_session(session_uuid, username=username, password=password, force_password_auth=True) diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py index 1bf930c..e067127 100644 --- a/pyhoca/wxgui/menus_taskbar.py +++ b/pyhoca/wxgui/menus_taskbar.py @@ -172,7 +172,7 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu): self.Append(id=ID_SESSIONSTART, text="Start &new Session") - _query_session_uuid = self._PyHocaGUI.client_connected_sessions_of_name(profile_name)[0] + _query_session_uuid = self._PyHocaGUI.client_connected_sessions_of_profile_name(profile_name)[0] _session_list = self._PyHocaGUI.list_sessions(_query_session_uuid) if _session_list: @@ -247,7 +247,6 @@ class PyHocaGUI_Menu_TaskbarProfileNames(wx.Menu): if not _profile_names: _dummy = self.Append(text='No session profiles defined', id=wx.NewId()) _dummy.Enable(False) - def OnUpdateUI(self, evt): profile_name = self._PyHocaGUI._eventid_profilenames_map[evt.GetId()] diff --git a/pyhoca/wxgui/notify.py b/pyhoca/wxgui/notify.py index 1631a59..b9c6429 100644 --- a/pyhoca/wxgui/notify.py +++ b/pyhoca/wxgui/notify.py @@ -135,6 +135,7 @@ class notificationmessage_NotifierPopup(object): 'profile_delete': wx.ICON_INFORMATION, 'profile_edit': wx.ICON_INFORMATION, 'profile_save': wx.ICON_INFORMATION, + 'profile_error': wx.ICON_ERROR, 'session_cleanall': wx.ICON_INFORMATION, 'session_error': wx.ICON_ERROR, 'session_pause': wx.ICON_INFORMATION, diff --git a/pyhoca/wxgui/profilemanager.py b/pyhoca/wxgui/profilemanager.py index 35c06f5..84cb4df 100644 --- a/pyhoca/wxgui/profilemanager.py +++ b/pyhoca/wxgui/profilemanager.py @@ -20,14 +20,19 @@ import wx import os +import copy import x2go.log as log from x2go import X2GOCLIENT_OS -# begin wxGlade: extracode -# end wxGlade +from x2go import defaults -class PyHocaGUI_ProfileManager(wx.Frame): +import notify +import basepath + +_icons_location = basepath.icons_basepath + +class PyHocaGUI_ProfileManager(wx.Dialog): """\ STILL UNDOCUMENTED @@ -42,13 +47,36 @@ class PyHocaGUI_ProfileManager(wx.Frame): self._pyhoca_logger('starting profile manager, action is: %s' % action, loglevel=log.loglevel_INFO) - self.sessionChoicesText = ["KDE", "GNOME", "LXDE", "Connect to Windows Terminal server", "Custom desktop", "Single application"] - self.sessionChoices = ["KDE", "GNOME", "LXDE", "TerminalServer", "Custom", "application"] - self.applicationListText = ["Internet browser", "Email client", "Openoffice.org", "Terminal", "xterm", "Server side programlist"] - self.applicationList = ['WWWBROWSER', 'MAILCLIENT', 'OFFICE', 'TERMINAL','TERMINAL','x2go-auth'] + self.profileManagerDefaults = defaults.X2GO_SESSIONPROFILE_DEFAULTS + self.success = False - self.linkText = ['MODEM','ISDN','ADSL','WAN','LAN'] - self.compText = ["4k-jpeg", "32k-jpeg", "64k-jpeg", "256k-jpeg", "2m-jpeg", "16m-jpeg"] + self.sessionChoices = { + 'GNOME': 'GNOME Desktop (GNOME)', + 'KDE': 'K Desktop Environment (KDE)', + 'LXDE': 'Lightweight X Desktop (LXDE)', + 'EMBEDDED_MENU': 'Embedded Application Menu', + 'RDP': 'Windows Terminal Server (RDP-proxy)', + 'DirectRDP': 'Windows Terminal Server (RDP-direct)', + 'APPLICATION': 'Single Application', + 'CUSTOM': 'Custom command', + } + self.applicationChoices = { + 'WWWBROWSER': 'Internet Browser', + 'MAILCLIENT': 'Email Client', + 'OFFICE': 'Openoffice.org', + 'TERMINAL': 'Terminal', + } + self.linkChoices = { + 0: 'MODEM', + 1: 'ISDN', + 2: 'ADSL', + 3: 'WAN', + 4: 'LAN', + } + _compressions = ["4k-jpeg", "32k-jpeg", "64k-jpeg", "256k-jpeg", "2m-jpeg", "16m-jpeg"] + self.compressionChoices = {} + for _comp in _compressions: + self.compressionChoices[_comp] = _comp self.session_profiles = self._PyHocaGUI.session_profiles self.action = action @@ -58,217 +86,576 @@ class PyHocaGUI_ProfileManager(wx.Frame): self.profile_id = profile_id elif profile_name is not None: self.profile_id = self.session_profiles.check_profile_id_or_name(profile_name) + self.profile_config = self.session_profiles.get_profile_config(self.profile_id) if self.action == 'ADD': - # this will create a default session profile - self.profile_id = self.session_profiles.add_profile() + self.profile_config = self.session_profiles.default_profile_config() - self.profile_config = self.session_profiles.get_profile_config(self.profile_id) + # we create a backup dict of our profile_config immediately (for being able to reset erroneously made changes) + self.profile_config_bak = copy.deepcopy(self.profile_config) - wx.Frame.__init__(self, None, -1, style=wx.DEFAULT_FRAME_STYLE, size=wx.Size(400,400)) + wx.Dialog.__init__(self, None, -1, style=wx.DEFAULT_DIALOG_STYLE, size=wx.Size(400,400)) self.CentreOnScreen() + self.X2goTabs = wx.Notebook(self, -1, style=0) - self.X2goTabs_pane_4 = wx.Panel(self.X2goTabs, -1) - self.X2goSettingsTab = wx.Panel(self.X2goTabs, -1) - self.X2goConnectionTab = wx.Panel(self.X2goTabs, -1) - self.sizer_2_staticbox = wx.StaticBox(self.X2goConnectionTab, -1, "Server") - self.sizer_3_staticbox = wx.StaticBox(self.X2goConnectionTab, -1, "Session type") - self.ConnSpeedSizer_staticbox = wx.StaticBox(self.X2goConnectionTab, -1, "Connection speed") - self.sizer_4_staticbox = wx.StaticBox(self.X2goConnectionTab, -1, "Compression") - self.sizer_6_staticbox = wx.StaticBox(self.X2goSettingsTab, -1, "Display") - self.sizer_8_staticbox = wx.StaticBox(self.X2goSettingsTab, -1, "Keyboard") - self.sizer_9_staticbox = wx.StaticBox(self.X2goSettingsTab, -1, "Sound") - self.sizer_10_staticbox = wx.StaticBox(self.X2goSettingsTab, -1, "Printing") - self.sizer_11_staticbox = wx.StaticBox(self.X2goTabs_pane_4, -1, "Folders") - self.X2goSessionTab = wx.Panel(self.X2goTabs, -1) - self.ProfileLabel = wx.StaticText(self.X2goSessionTab, -1, "Profile name") - self.ProfileName = wx.TextCtrl(self.X2goSessionTab, -1, "", size=wx.Size(200,20)) + self.tab_Session = wx.Panel(self.X2goTabs, -1) + self.tab_Connection = wx.Panel(self.X2goTabs, -1) + self.tab_Settings = wx.Panel(self.X2goTabs, -1) + self.tab_SharedFolders = wx.Panel(self.X2goTabs, -1) + + # boxes for all tabs + self.staticbox_Profile = wx.StaticBox(self.tab_Session, -1, '') + self.staticbox_SessionType = wx.StaticBox(self.tab_Session, -1, '') + self.staticbox_Server = wx.StaticBox(self.tab_Connection, -1, "Server") + self.staticbox_LinkSpeed = wx.StaticBox(self.tab_Connection, -1, "Connection link speed") + self.staticbox_Compression = wx.StaticBox(self.tab_Connection, -1, "Compression") + self.staticbox_Display = wx.StaticBox(self.tab_Settings, -1, "Display") + self.staticbox_Keyboard = wx.StaticBox(self.tab_Settings, -1, "Keyboard") + self.staticbox_Sound = wx.StaticBox(self.tab_Settings, -1, "Sound") + self.staticbox_Printing = wx.StaticBox(self.tab_Settings, -1, "Printing") + self.staticbox_FolderSharing = wx.StaticBox(self.tab_SharedFolders, -1, "") + + ### + ### widgets for the SESSION tab + ### + self.ProfileNameLabel = wx.StaticText(self.tab_Session, -1, "Profile name:") + self.ProfileName = wx.TextCtrl(self.tab_Session, -1, "", size=wx.Size(200,20)) + _share_location = os.path.split(_icons_location)[0] if 'icon' in self.profile_config: - if X2GOCLIENT_OS == 'Windows': - path_to_icon = self.profile_config['icon'].replace(':','/usr/share/') - elif X2GOCLIENT_OS == 'Linux': - path_to_icon = self.profile_config['icon'].replace(':','/usr/share/') - elif X2GOCLIENT_OS == 'Mac': - path_to_icon = self.profile_config['icon'].replace(':','/usr/share/') - self.IconButton = wx.BitmapButton(self.X2goSessionTab, -1, wx.Bitmap(path_to_icon, wx.BITMAP_TYPE_ANY)) - self.IconLabel = wx.StaticText(self.X2goSessionTab, -1, "<< Change Icon") - self.HostLabel = wx.StaticText(self.X2goSessionTab, -1, "Host:") - self.hostname = wx.TextCtrl(self.X2goSessionTab, -1, "", size=wx.Size(200,20)) - self.UserLabel = wx.StaticText(self.X2goSessionTab, -1, "User:") - self.username = wx.TextCtrl(self.X2goSessionTab, -1, "", size=wx.Size(200,20)) - self.LoginLabel = wx.StaticText(self.X2goConnectionTab, -1, "Login") - self.sshport = wx.SpinCtrl(self.X2goConnectionTab, -1, "0", min=22, max=64000) - self.SSHkeyLabel = wx.StaticText(self.X2goConnectionTab, -1, "RSA/DSA key") - self.sshkeylocation = wx.StaticText(self.X2goConnectionTab, -1, "") - self.fileFindButton = wx.BitmapButton(self.X2goConnectionTab, -1, wx.Bitmap("/usr/share/icons/ikons/22x22/actions/filefind.png", wx.BITMAP_TYPE_ANY)) - self.SessionTypeLabel = wx.StaticText(self.X2goConnectionTab, -1, "Type") - self.SessionType = wx.ComboBox(self.X2goConnectionTab, -1, choices=self.sessionChoices, style=wx.CB_DROPDOWN|wx.CB_READONLY) - self.CommandLabel = wx.StaticText(self.X2goConnectionTab, -1, "Command:") - self.Command = wx.ComboBox(self.X2goConnectionTab, -1, choices=self.applicationListText, style=wx.CB_DROPDOWN|wx.CB_READONLY) - self.connectionSpeed = wx.Slider(self.X2goConnectionTab, -1, 0, 0, 10) - self.ModemLabel = wx.StaticText(self.X2goConnectionTab, -1, "|\nModem") - self.ISDNLabel = wx.StaticText(self.X2goConnectionTab, -1, " |\nISDN", style=wx.ALIGN_CENTRE) - self.ADSLLabel = wx.StaticText(self.X2goConnectionTab, -1, "|\nADSL", style=wx.ALIGN_CENTRE) - self.WanLabel = wx.StaticText(self.X2goConnectionTab, -1, "|\nWAN", style=wx.ALIGN_CENTRE) - self.LanLabel = wx.StaticText(self.X2goConnectionTab, -1, "|\nLAN", style=wx.ALIGN_RIGHT) - self.MethodLabel = wx.StaticText(self.X2goConnectionTab, -1, "Method") - self.Compression = wx.ComboBox(self.X2goConnectionTab, -1, choices=self.compText, style=wx.CB_DROPDOWN) - self.ImageQualityLabel = wx.StaticText(self.X2goConnectionTab, -1, "Image quality:") - self.ImageQuality = wx.SpinCtrl(self.X2goConnectionTab, -1, "9", min=0, max=9) - self.DisplayTypeFullScreen = wx.RadioButton(self.X2goSettingsTab, -1, "Fullscreen", style=wx.RB_GROUP) - self.DisplayTypeCustom = wx.RadioButton(self.X2goSettingsTab, -1, "Custom") - self.WidthLabel = wx.StaticText(self.X2goSettingsTab, -1, "Width") - self.ScrnWidth = wx.SpinCtrl(self.X2goSettingsTab, -1, "800", min=400, max=3000) - self.HeightLabel = wx.StaticText(self.X2goSettingsTab, -1, "Height") - self.ScrnHeight = wx.SpinCtrl(self.X2goSettingsTab, -1, "600", min=500, max=3000) - self.SetDisplayDPI = wx.CheckBox(self.X2goSettingsTab, -1, "Set display DPI") - self.CurrentKeyBoard = wx.CheckBox(self.X2goSettingsTab, -1, "Keep current keyboard settings") - self.KeyboardLayoutLabel = wx.StaticText(self.X2goSettingsTab, -1, "Keyboard layout") - self.KeyboardLayout = wx.TextCtrl(self.X2goSettingsTab, -1, "") - self.KeyboardModelLabel = wx.StaticText(self.X2goSettingsTab, -1, "Keyboard model:") - self.Keyboardmodel = wx.TextCtrl(self.X2goSettingsTab, -1, "") - self.EnableSound = wx.CheckBox(self.X2goSettingsTab, -1, "Enable sound support") - self.PulseAudio = wx.RadioButton(self.X2goSettingsTab, -1, "Pulse Audio", style=wx.RB_GROUP) - self.soundtunnel = wx.CheckBox(self.X2goSettingsTab, -1, "Use SSH port forwarding to tunnel sound system connections through firewall") - self.Arts = wx.RadioButton(self.X2goSettingsTab, -1, "Arts") - self.DefaultSoundPort = wx.CheckBox(self.X2goSettingsTab, -1, "Use default sound port") - self.esd = wx.RadioButton(self.X2goSettingsTab, -1, "esd") - self.SoundPortLabel = wx.StaticText(self.X2goSettingsTab, -1, "Sound Port") - self.SoundPort = wx.SpinCtrl(self.X2goSettingsTab, -1, "4713", min=23, max=64889) - self.ClientSidePrinting = wx.CheckBox(self.X2goSettingsTab, -1, "Client Side printing") - self.PathLabel = wx.StaticText(self.X2goTabs_pane_4, -1, "Path") - self.Path = wx.TextCtrl(self.X2goTabs_pane_4, -1, "") - self.SharedFilesPath = wx.BitmapButton(self.X2goTabs_pane_4, -1, wx.Bitmap("/usr/share/icons/ikons/22x22/actions/filefind.png", wx.BITMAP_TYPE_ANY)) - self.AddFolderButton = wx.Button(self.X2goTabs_pane_4, -1, "Add") - self.SharedFilesList = wx.ListCtrl(self.X2goTabs_pane_4, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER) - self.DeleteButton = wx.Button(self.X2goTabs_pane_4, -1, "Delete") - self.SSHPortforwarding = wx.CheckBox(self.X2goTabs_pane_4, -1, "Use ssh port forwarding to tunnel file system connections through firewalls") - self.OKButton = wx.Button(self, -1, "OK") + path_to_icon = self.profile_config['icon'].replace(':','%s/' % _share_location) + else: + path_to_icon = '%s/icons/PyHoca/128x128/pyhoca-session.png' % _share_location + self.IconPath = path_to_icon + path_to_icon = path_to_icon.replace('icons/128x128/x2gosession.png', 'icons/PyHoca/128x128/pyhoca-session.png') + self.IconLabel = wx.StaticText(self.tab_Session, -1, "Profile icon:") + self.IconButton = wx.BitmapButton(self.tab_Session, -1, wx.Bitmap(path_to_icon, wx.BITMAP_TYPE_ANY)) + self.SessionTypeLabel = wx.StaticText(self.tab_Session, -1, "Session type:") + self.SessionType = wx.ComboBox(self.tab_Session, -1, choices=self.sessionChoices.values(), style=wx.CB_DROPDOWN|wx.CB_READONLY) + self.ApplicationLabel = wx.StaticText(self.tab_Session, -1, "Application:") + self.Application = wx.ComboBox(self.tab_Session, -1, choices=self.applicationChoices.values(), style=wx.CB_DROPDOWN|wx.CB_READONLY) + self.CommandLabel = wx.StaticText(self.tab_Session, -1, "Custom command:") + self.Command = wx.TextCtrl(self.tab_Session, -1, "", size=wx.Size(200,20)) + self.RDPSettingsLabel = wx.StaticText(self.tab_Session, -1, "RDP settings:") + self.RDPServerLabel = wx.StaticText(self.tab_Session, -1, "RDP server:") + self.RDPServer = wx.TextCtrl(self.tab_Session, -1, "", size=wx.Size(160,20)) + self.RDPOptionsLabel = wx.StaticText(self.tab_Session, -1, "RDP options:") + self.RDPOptions = wx.TextCtrl(self.tab_Session, -1, "", size=wx.Size(160,20)) + + ### + ### widgets for the CONNECTION tab + ### + self.UserNameLabel = wx.StaticText(self.tab_Connection, -1, "User:") + self.UserName = wx.TextCtrl(self.tab_Connection, -1, "", size=wx.Size(200,20)) + self.HostLabel = wx.StaticText(self.tab_Connection, -1, "Host:") + self.Host = wx.TextCtrl(self.tab_Connection, -1, "", size=wx.Size(200,20)) + self.SSHPortLabel = wx.StaticText(self.tab_Connection, -1, "Port:") + self.SSHPort = wx.SpinCtrl(self.tab_Connection, -1, "0", min=22, max=64000) + self.SSHKeyFileLabel = wx.StaticText(self.tab_Connection, -1, "RSA/DSA private key:") + self.SSHKeyFile = wx.TextCtrl(self.tab_Connection, -1, style=wx.TE_PROCESS_ENTER) + self.SSHKeyFileBrowseButton = wx.BitmapButton(self.tab_Connection, -1, wx.Bitmap('/%s/PyHoca/16x16/system-search.png' % _icons_location, wx.BITMAP_TYPE_ANY)) + self.UseSSHProxy = wx.CheckBox(self.tab_Connection, -1, "Use SSH proxy to connect to server") + self.SSHProxyLabel = wx.StaticText(self.tab_Connection, -1, "SSH Proxy:") + self.SSHProxyFromHost = wx.TextCtrl(self.tab_Connection, -1, "", size=wx.Size(200,20)) + self.SSHProxyFromPort = wx.SpinCtrl(self.tab_Connection, -1, "0", min=22, max=64000) + self.SSHProxyBetweenLabel = wx.StaticText(self.tab_Connection, -1, " -> ") + self.SSHProxyToHost = wx.TextCtrl(self.tab_Connection, -1, "", size=wx.Size(200,20)) + self.SSHProxyToPort = wx.SpinCtrl(self.tab_Connection, -1, "0", min=22, max=64000) + + self.LinkSpeed = wx.Slider(self.tab_Connection, -1, 0, 0, 4) + self.ModemLabel = wx.StaticText(self.tab_Connection, -1, " |\nModem", style=wx.ALIGN_LEFT) + self.ISDNLabel = wx.StaticText(self.tab_Connection, -1, " |\nISDN", style=wx.ALIGN_LEFT) + self.ADSLLabel = wx.StaticText(self.tab_Connection, -1, " |\nADSL", style=wx.ALIGN_LEFT) + self.WANLabel = wx.StaticText(self.tab_Connection, -1, " |\nWAN", style=wx.ALIGN_LEFT) + self.LANLabel = wx.StaticText(self.tab_Connection, -1, "| \nLAN", style=wx.ALIGN_RIGHT) + + self.CompressionLabel = wx.StaticText(self.tab_Connection, -1, "Method:") + self.Compression = wx.ComboBox(self.tab_Connection, -1, choices=self.compressionChoices.values(), style=wx.CB_DROPDOWN) + self.ImageQualityLabel = wx.StaticText(self.tab_Connection, -1, "Image quality:") + self.ImageQuality = wx.SpinCtrl(self.tab_Connection, -1, "9", min=0, max=9) + + ### + ### wigdets for the SETTINGS tab + ### + self.DisplayTypeFullscreen = wx.RadioButton(self.tab_Settings, -1, "Fullscreen", style=wx.RB_GROUP) + self.DisplayTypeCustom = wx.RadioButton(self.tab_Settings, -1, "Custom Size:") + self.ScreenWidthLabel = wx.StaticText(self.tab_Settings, -1, '') + self.ScreenWidth = wx.SpinCtrl(self.tab_Settings, -1, "800", min=400, max=3000) + self.ScreenHeightLabel = wx.StaticText(self.tab_Settings, -1, "x") + self.ScreenHeight = wx.SpinCtrl(self.tab_Settings, -1, "600", min=500, max=3000) + self.SetDisplayDPI = wx.CheckBox(self.tab_Settings, -1, "Set display DPI:") + self.DisplayDPI = wx.SpinCtrl(self.tab_Settings, -1, "96", min=32, max=512) + self.CurrentKeyBoard = wx.CheckBox(self.tab_Settings, -1, "Keep current keyboard settings") + self.KeyboardLayoutLabel = wx.StaticText(self.tab_Settings, -1, "Keyboard layout:") + self.KeyboardLayout = wx.TextCtrl(self.tab_Settings, -1, "") + self.KeyboardModelLabel = wx.StaticText(self.tab_Settings, -1, "Keyboard model:") + self.KeyboardModel = wx.TextCtrl(self.tab_Settings, -1, "") + self.EnableSound = wx.CheckBox(self.tab_Settings, -1, "Enable sound support") + self.PulseAudio = wx.RadioButton(self.tab_Settings, -1, "Pulse Audio", style=wx.RB_GROUP) + self.Arts = wx.RadioButton(self.tab_Settings, -1, "Arts") + self.esd = wx.RadioButton(self.tab_Settings, -1, "esd") + self.SoundTunnel = wx.CheckBox(self.tab_Settings, -1, "Use SSH port forwarding to tunnel sound system\nconnections through firewall") + self.DefaultSoundPort = wx.CheckBox(self.tab_Settings, -1, "Use default sound port") + self.SoundPortLabel = wx.StaticText(self.tab_Settings, -1, "Custom sound port:") + self.SoundPort = wx.SpinCtrl(self.tab_Settings, -1, "4713", min=23, max=64889) + self.ClientSidePrinting = wx.CheckBox(self.tab_Settings, -1, "Client Side printing") + + self.SharedFolderPathLabel = wx.StaticText(self.tab_SharedFolders, -1, "Path:") + self.SharedFolderPath = wx.TextCtrl(self.tab_SharedFolders, -1, "") + self.SharedFolderPathBrowseButton = wx.BitmapButton(self.tab_SharedFolders, -1, wx.Bitmap('%s/PyHoca/16x16/system-search.png' % _icons_location, wx.BITMAP_TYPE_ANY)) + self.AddSharedFolderPathButton = wx.Button(self.tab_SharedFolders, -1, "Add") + self.SharedFoldersList = wx.ListCtrl(self.tab_SharedFolders, -1, style=wx.LC_LIST|wx.SUNKEN_BORDER|wx.LC_SINGLE_SEL|wx.LC_VRULES) + self.DeleteSharedFolderPathButton = wx.Button(self.tab_SharedFolders, -1, "Delete") + self.SSHFSPortForwarding = wx.CheckBox(self.tab_SharedFolders, -1, "Use ssh port forwarding to tunnel file system connections through firewalls") + if self.action == 'ADD': + self.OKButton = wx.Button(self, -1, "Add") + self.DefaultButton = wx.Button(self, -1, 'Defaults') + else: + self.OKButton = wx.Button(self, -1, "Save") + self.DefaultButton = wx.Button(self, -1, 'Reset') self.CancelButton = wx.Button(self, -1, "Cancel") - self.DefaultButton = wx.Button(self, -1, "Defaults") self.__set_properties() - self.__updFields() + self.__update_fields() self.__do_layout() - self.Bind(wx.EVT_BUTTON, self.onIconChange, self.IconButton) - self.Bind(wx.EVT_BUTTON, self.onFindKey, self.fileFindButton) - self.Bind(wx.EVT_CHECKBOX, self.onSetDPI, self.SetDisplayDPI) - self.Bind(wx.EVT_CHECKBOX, self.onKeepKeyboard, self.CurrentKeyBoard) - self.Bind(wx.EVT_CHECKBOX, self.onSoundEnable, self.EnableSound) - self.Bind(wx.EVT_CHECKBOX, self.onSoundPort, self.DefaultSoundPort) - self.Bind(wx.EVT_BUTTON, self.onAddFolder, self.AddFolderButton) - self.Bind(wx.EVT_BUTTON, self.onOKButton, self.OKButton) - self.Bind(wx.EVT_BUTTON, self.onCancel, self.CancelButton) - self.Bind(wx.EVT_BUTTON, self.onDefault, self.DefaultButton) - # end wxGlade + self.Bind(wx.EVT_BUTTON, self.OnIconChange, self.IconButton) + self.Bind(wx.EVT_COMBOBOX, self.OnSessionTypeSelected, self.SessionType) + self.Bind(wx.EVT_BUTTON, self.OnSSHPublicKeyBrowse, self.SSHKeyFileBrowseButton) + self.Bind(wx.EVT_CHECKBOX, self.OnUseSSHProxy, self.UseSSHProxy) + self.Bind(wx.EVT_RADIOBUTTON, self.OnSetDisplayFullscreen, self.DisplayTypeFullscreen) + self.Bind(wx.EVT_RADIOBUTTON, self.OnSetDisplayCustom, self.DisplayTypeCustom) + self.Bind(wx.EVT_CHECKBOX, self.OnSetDisplayDPI, self.SetDisplayDPI) + self.Bind(wx.EVT_CHECKBOX, self.OnKeepKeyboard, self.CurrentKeyBoard) + self.Bind(wx.EVT_CHECKBOX, self.OnSoundEnable, self.EnableSound) + self.Bind(wx.EVT_CHECKBOX, self.OnSoundPort, self.DefaultSoundPort) + self.Bind(wx.EVT_BUTTON, self.OnSelectSharedFolderPath, self.SharedFolderPathBrowseButton) + self.Bind(wx.EVT_BUTTON, self.OnAddSharedFolderPath, self.AddSharedFolderPathButton) + self.Bind(wx.EVT_BUTTON, self.OnDeleteSharedFolderPath, self.DeleteSharedFolderPathButton) + self.Bind(wx.EVT_BUTTON, self.OnOKButton, self.OKButton) + self.Bind(wx.EVT_BUTTON, self.OnCancel, self.CancelButton) + self.Bind(wx.EVT_BUTTON, self.OnDefault, self.DefaultButton) self.SetSize(self.GetBestSize()) self.Show(True) def __set_properties(self): - # begin wxGlade: X2goMaintProfile.__set_properties - self.SetTitle("Maintain the profile") + self.SetTitle("PyHoca-GUI Profile Manager") self.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) - self.ProfileLabel.SetMinSize((200, 15)) - self.ProfileName.SetMinSize((180, 23)) + _textfield_height = self.SSHKeyFileBrowseButton.GetBestSize().GetHeight()-2 + self.ProfileNameLabel.SetMinSize((120, 16)) + self.ProfileName.SetMinSize((180, _textfield_height)) self.IconButton.SetSize(self.IconButton.GetBestSize()) - self.HostLabel.SetMinSize((200, 15)) - self.hostname.SetMinSize((180, 23)) - self.UserLabel.SetMinSize((200, 15)) - self.username.SetMinSize((180, 23)) - self.LoginLabel.SetMinSize((200, 15)) - self.SSHkeyLabel.SetMinSize((200, 15)) - self.sshkeylocation.SetMinSize((220, 15)) - self.fileFindButton.SetSize(self.fileFindButton.GetBestSize()) - self.SessionTypeLabel.SetMinSize((200, 15)) + self.SessionTypeLabel.SetMinSize((120, 16)) self.SessionType.SetSelection(5) - self.CommandLabel.SetMinSize((200, 15)) - self.Command.SetMinSize((230, 25)) - self.Command.SetSelection(0) + self.ApplicationLabel.SetMinSize((120, 16)) + self.Application.SetMinSize((230, _textfield_height)) + self.Application.SetSelection(0) + self.Command.SetMinSize((230, _textfield_height)) + self.RDPSettingsLabel.SetMinSize((120, 16)) + self.RDPServerLabel.SetMinSize((120, 16)) + self.RDPServer.SetMinSize((160, _textfield_height)) + self.RDPOptionsLabel.SetMinSize((120, 16)) + self.RDPOptions.SetMinSize((160, _textfield_height)) + self.HostLabel.SetMinSize((120, 16)) + self.Host.SetMinSize((180, _textfield_height)) + self.UserNameLabel.SetMinSize((120, 16)) + self.UserName.SetMinSize((180, _textfield_height)) + self.SSHPortLabel.SetMinSize((120, 16)) + self.SSHPort.SetMinSize((80, _textfield_height)) + self.SSHKeyFileLabel.SetMinSize((120, 16)) + self.SSHKeyFile.SetMinSize((152, _textfield_height)) + self.SSHKeyFileBrowseButton.SetSize(self.SSHKeyFileBrowseButton.GetBestSize()) + self.SSHProxyLabel.SetMinSize((120, 16)) + self.SSHProxyFromPort.SetMinSize((60, _textfield_height)) + self.SSHProxyToPort.SetMinSize((60, _textfield_height)) + self.SSHProxyFromHost.SetMinSize((120, _textfield_height)) + self.SSHProxyToHost.SetMinSize((120, _textfield_height)) + self.LinkSpeed.SetMinSize((454, _textfield_height)) self.ModemLabel.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.ISDNLabel.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) self.ADSLLabel.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) - self.WanLabel.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) - self.LanLabel.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) - self.MethodLabel.SetMinSize((200, 15)) + self.WANLabel.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) + self.LANLabel.SetFont(wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) + self.CompressionLabel.SetMinSize((120, 16)) + self.Compression.SetMinSize((180, _textfield_height)) self.Compression.SetSelection(0) - self.ImageQualityLabel.SetMinSize((200, 15)) - self.DisplayTypeFullScreen.SetMinSize((200, 21)) + self.ImageQualityLabel.SetMinSize((120, 16)) + self.ImageQuality.SetMinSize((180, _textfield_height)) + self.DisplayTypeFullscreen.SetMinSize((120, _textfield_height)) self.DisplayTypeCustom.SetValue(1) - self.ScrnWidth.SetMinSize((60, 23)) - self.ScrnHeight.SetMinSize((60, 23)) - self.SetDisplayDPI.SetMinSize((200, 21)) - self.KeyboardLayoutLabel.SetMinSize((200, 15)) - self.KeyboardLayout.SetMinSize((200, 23)) - self.KeyboardModelLabel.SetMinSize((200, 15)) - self.Keyboardmodel.SetMinSize((200, 23)) + self.ScreenWidth.SetMinSize((60, _textfield_height)) + self.ScreenHeight.SetMinSize((60, _textfield_height)) + self.SetDisplayDPI.SetMinSize((120, _textfield_height)) + self.DisplayDPI.SetMinSize((60, _textfield_height)) + self.KeyboardLayoutLabel.SetMinSize((120, 16)) + self.KeyboardLayout.SetMinSize((120, _textfield_height)) + self.KeyboardModelLabel.SetMinSize((120, 16)) + self.KeyboardModel.SetMinSize((120, _textfield_height)) self.EnableSound.SetValue(1) - self.PulseAudio.SetMinSize((200, 21)) + self.PulseAudio.SetMinSize((120, _textfield_height)) self.PulseAudio.SetValue(1) - self.soundtunnel.SetValue(1) - self.Arts.SetMinSize((200, 21)) + self.SoundTunnel.SetValue(1) + self.Arts.SetMinSize((120, _textfield_height)) self.DefaultSoundPort.SetValue(1) - self.esd.SetMinSize((200, 21)) - self.SoundPortLabel.SetMinSize((100, 15)) - self.ClientSidePrinting.SetMinSize((143, 21)) + self.esd.SetMinSize((120, 21)) + self.ClientSidePrinting.SetMinSize((143, _textfield_height)) self.ClientSidePrinting.SetValue(1) - self.Path.SetMinSize((220, 23)) - self.SharedFilesPath.SetSize(self.SharedFilesPath.GetBestSize()) - self.SharedFilesList.SetMinSize((303, 300)) - self.SSHPortforwarding.SetValue(1) + self.SharedFolderPath.SetMinSize((220, _textfield_height)) + self.SharedFolderPathBrowseButton.SetSize(self.SharedFolderPathBrowseButton.GetBestSize()) + self.SharedFoldersList.SetMinSize((303, 300)) + self.SSHFSPortForwarding.SetValue(1) self.OKButton.SetMinSize((60, 30)) self.CancelButton.SetMinSize((60, 30)) self.DefaultButton.SetMinSize((60, 30)) - # end wxGlade - def __updFields(self): + def __do_layout(self): + + # SESSION TAB + sizer_1 = wx.BoxSizer(wx.VERTICAL) + sizer_1_1 = wx.StaticBoxSizer(self.staticbox_Profile, wx.VERTICAL) + sizer_1_1_1 = wx.FlexGridSizer(1, 2, 7, 9) + sizer_1_1_1.Add(self.ProfileNameLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_1_1_1.Add(self.ProfileName, 0, 0, 0) + sizer_1_1_1.Add(self.IconLabel, 0, wx.TOP, 0) + sizer_1_1_1.Add(self.IconButton, 0, 0, 0) + sizer_1_1.Add(sizer_1_1_1, 0, wx.EXPAND, 0) + + sizer_1_2 = wx.StaticBoxSizer(self.staticbox_SessionType, wx.VERTICAL) + sizer_1_2_1 = wx.FlexGridSizer(1, 2, 7, 9) + sizer_1_2_1.Add(self.SessionTypeLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_1_2_1.Add(self.SessionType, 0, 0, 0) + sizer_1_2_1.Add(self.ApplicationLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_1_2_1.Add(self.Application, 0, 0, 0) + sizer_1_2_1.Add(self.CommandLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_1_2_1.Add(self.Command, 0, 0, 0) + sizer_1_2_2 = wx.FlexGridSizer(1, 3, 2, 9) + sizer_1_2_2.Add((0,23)) + sizer_1_2_2.Add(self.RDPServerLabel, 0, wx.ALIGN_BOTTOM, 0) + sizer_1_2_2.Add(self.RDPOptionsLabel, 0, wx.ALIGN_BOTTOM, 0) + sizer_1_2_2.Add(self.RDPSettingsLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_1_2_2.Add(self.RDPServer, 0, 0, 0) + sizer_1_2_2.Add(self.RDPOptions, 0, 0, 0) + sizer_1_2.Add(sizer_1_2_1, 0, wx.EXPAND, 0) + sizer_1_2.Add(sizer_1_2_2, 0, wx.EXPAND, 0) + + sizer_1.Add(sizer_1_1, 1, wx.EXPAND, 0) + sizer_1.Add(sizer_1_2, 1, wx.EXPAND, 0) + self.tab_Session.SetSizer(sizer_1) + + ## CONNECTION TAB + sizer_2 = wx.BoxSizer(wx.VERTICAL) + sizer_2_1 = wx.StaticBoxSizer(self.staticbox_Server, wx.VERTICAL) + sizer_2_1_1 = wx.BoxSizer(wx.HORIZONTAL) + sizer_2_1_1.Add(self.UserNameLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1_1.Add(self.UserName, 0, 0, 0) + sizer_2_1_1.Add((0,32)) + sizer_2_1_2 = wx.BoxSizer(wx.HORIZONTAL) + sizer_2_1_2.Add(self.HostLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1_2.Add(self.Host, 0, 0, 0) + sizer_2_1_2.Add((0,32)) + sizer_2_1_3 = wx.BoxSizer(wx.HORIZONTAL) + sizer_2_1_3.Add(self.SSHPortLabel, 0, wx.ALIGN_CENTRE_VERTICAL|wx.RIGHT, 0) + sizer_2_1_3.Add(self.SSHPort, 0, 0, 0) + sizer_2_1_3.Add((0,32)) + sizer_2_1_4 = wx.BoxSizer(wx.HORIZONTAL) + sizer_2_1_4.Add(self.SSHKeyFileLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1_4.Add(self.SSHKeyFile, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1_4.Add(self.SSHKeyFileBrowseButton, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1_4.Add((0,32)) + sizer_2_1_5 = wx.BoxSizer(wx.HORIZONTAL) + sizer_2_1_5.Add(self.UseSSHProxy, 0, wx.ALIGN_BOTTOM, 0) + sizer_2_1_5.Add((0,32)) + sizer_2_1_6 = wx.BoxSizer(wx.HORIZONTAL) + sizer_2_1_6.Add(self.SSHProxyLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1_6.Add(self.SSHProxyFromHost, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1_6.Add((4, 0)) + sizer_2_1_6.Add(self.SSHProxyFromPort, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1_6.Add((8, 0)) + sizer_2_1_6.Add(self.SSHProxyBetweenLabel, 0, wx.ALIGN_CENTRE_VERTICAL|wx.ALIGN_CENTRE_HORIZONTAL, 0) + sizer_2_1_6.Add((8, 0)) + sizer_2_1_6.Add(self.SSHProxyToHost, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1_6.Add((4, 0)) + sizer_2_1_6.Add(self.SSHProxyToPort, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_1.Add(sizer_2_1_1, 0, wx.EXPAND, 0) + sizer_2_1.Add(sizer_2_1_2, 0, wx.EXPAND, 0) + sizer_2_1.Add(sizer_2_1_3, 0, wx.EXPAND, 0) + sizer_2_1.Add(sizer_2_1_4, 0, wx.EXPAND, 0) + sizer_2_1.Add(sizer_2_1_5, 0, wx.EXPAND, 0) + sizer_2_1.Add(sizer_2_1_6, 0, wx.EXPAND, 0) + + sizer_2_2 = wx.StaticBoxSizer(self.staticbox_LinkSpeed, wx.VERTICAL) + sizer_2_2_1 = wx.BoxSizer(wx.VERTICAL) + sizer_2_2_1.Add(self.LinkSpeed, 0, 0, 0) + sizer_2_2_2 = wx.FlexGridSizer(1,5,0,0) + sizer_2_2_2.AddGrowableCol(0) + sizer_2_2_2.AddGrowableCol(1) + sizer_2_2_2.AddGrowableCol(2) + sizer_2_2_2.AddGrowableCol(3) + sizer_2_2_2.AddGrowableCol(4) + sizer_2_2_2.Add(self.ModemLabel, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0) + sizer_2_2_2.Add(self.ISDNLabel, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0) + sizer_2_2_2.Add(self.ADSLLabel, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0) + sizer_2_2_2.Add(self.WANLabel, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0) + sizer_2_2_2.Add(self.LANLabel, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0) + sizer_2_2.Add(sizer_2_2_1, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0) + sizer_2_2.Add(sizer_2_2_2, 0, wx.EXPAND|wx.ALIGN_CENTRE_HORIZONTAL, 0) + + sizer_2_3 = wx.StaticBoxSizer(self.staticbox_Compression, wx.VERTICAL) + sizer_2_3_1 = wx.BoxSizer(wx.HORIZONTAL) + sizer_2_3_1.Add(self.CompressionLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_3_1.Add(self.Compression, 0, 0, 0) + sizer_2_3_1.Add((0,32)) + sizer_2_3_2 = wx.BoxSizer(wx.HORIZONTAL) + sizer_2_3_2.Add(self.ImageQualityLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_2_3_2.Add(self.ImageQuality, 0, 0, 0) + sizer_2_3.Add(sizer_2_3_1, 1, wx.EXPAND, 0) + sizer_2_3.Add(sizer_2_3_2, 1, wx.EXPAND, 0) + + sizer_2.Add(sizer_2_1, 0, wx.EXPAND, 0) + sizer_2.Add(sizer_2_2, 1, wx.EXPAND, 0) + sizer_2.Add(sizer_2_3, 0, wx.EXPAND, 0) + self.tab_Connection.SetSizer(sizer_2) + + ## SETTINGS TAB + sizer_3 = wx.BoxSizer(wx.VERTICAL) + sizer_3_1 = wx.StaticBoxSizer(self.staticbox_Display, wx.VERTICAL) + sizer_3_1_1 = wx.BoxSizer(wx.HORIZONTAL) + sizer_3_1_1.Add(self.DisplayTypeFullscreen, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_3_1_1.Add(self.DisplayTypeCustom, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_3_1_1.Add(self.ScreenWidthLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_3_1_1.Add((16,0)) + sizer_3_1_1.Add(self.ScreenWidth, 0, 0, 0) + sizer_3_1_1.Add((16,0)) + sizer_3_1_1.Add(self.ScreenHeightLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_3_1_1.Add((16,0)) + sizer_3_1_1.Add(self.ScreenHeight, 0, 0, 0) + sizer_3_1_2 = wx.BoxSizer(wx.HORIZONTAL) + sizer_3_1_2.Add((0,24)) + sizer_3_1_2.Add(self.SetDisplayDPI, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_3_1_2.Add(self.DisplayDPI, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_3_1.Add(sizer_3_1_1, 0, 0, 0) + sizer_3_1.Add(sizer_3_1_2, 0, 0, 0) + + sizer_3_2 = wx.StaticBoxSizer(self.staticbox_Keyboard, wx.VERTICAL) + sizer_3_2_1 = wx.BoxSizer(wx.HORIZONTAL) + sizer_3_2_1.Add(self.CurrentKeyBoard, 0, wx.ALIGN_TOP, 0) + sizer_3_2_1.Add((0, 32)) + sizer_3_2_2 = wx.BoxSizer(wx.HORIZONTAL) + sizer_3_2_2.Add((32,0)) + sizer_3_2_2_1 = wx.BoxSizer(wx.VERTICAL) + sizer_3_2_2_1.Add(self.KeyboardLayoutLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_3_2_2_1.Add(self.KeyboardLayout, 0, wx.EXPAND, 0) + sizer_3_2_2_2 = wx.BoxSizer(wx.VERTICAL) + sizer_3_2_2_2.Add(self.KeyboardModelLabel, 0, 0, 0) + sizer_3_2_2_2.Add(self.KeyboardModel, 0, wx.EXPAND, 0) + sizer_3_2_2.Add(sizer_3_2_2_1, 0, 0, 0) + sizer_3_2_2.Add((32,0)) + sizer_3_2_2.Add(sizer_3_2_2_2, 0, 0, 0) + sizer_3_2.Add(sizer_3_2_1, 0, 0, 0) + sizer_3_2.Add(sizer_3_2_2, 0, 0, 0) + + sizer_3_3 = wx.StaticBoxSizer(self.staticbox_Sound, wx.VERTICAL) + sizer_3_3_1 = wx.BoxSizer(wx.VERTICAL) + sizer_3_3_1.Add(self.EnableSound, 0, 0, 0) + sizer_3_3_2 = wx.BoxSizer(wx.HORIZONTAL) + sizer_3_3_2_1 = wx.BoxSizer(wx.VERTICAL) + sizer_3_3_2_1.Add(self.PulseAudio, 0, 0, 0) + sizer_3_3_2_1.Add(self.Arts, 0, 0, 0) + sizer_3_3_2_1.Add(self.esd, 0, 0, 0) + sizer_3_3_2.Add(sizer_3_3_2_1, 0, 0, 0) + sizer_3_3_2_2 = wx.BoxSizer(wx.VERTICAL) + sizer_3_3_2_2.Add(self.SoundTunnel, 0, 0, 0) + sizer_3_3_2_2.Add(self.DefaultSoundPort, 0, 0, 0) + sizer_3_3_2_2_1 = wx.BoxSizer(wx.HORIZONTAL) + sizer_3_3_2_2_1.Add(self.SoundPortLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_3_3_2_2_1.Add((16,0)) + sizer_3_3_2_2_1.Add(self.SoundPort, 0, 0, 0) + sizer_3_3_2_2.Add(sizer_3_3_2_2_1, 0, 0, 0) + sizer_3_3_2.Add(sizer_3_3_2_2, 0, 0, 0) + sizer_3_3.Add(sizer_3_3_1, 0, 0, 0) + sizer_3_3.Add(sizer_3_3_2, 0, 0, 0) + + sizer_3_4 = wx.StaticBoxSizer(self.staticbox_Printing, wx.VERTICAL) + sizer_3_4.Add(self.ClientSidePrinting, 0, 0, 0) + + sizer_3.Add(sizer_3_1, 0, wx.EXPAND, 0) + sizer_3.Add(sizer_3_2, 1, wx.EXPAND, 0) + sizer_3.Add(sizer_3_3, 1, wx.EXPAND, 0) + sizer_3.Add(sizer_3_4, 0, wx.EXPAND, 0) + self.tab_Settings.SetSizer(sizer_3) + + # FOLDERSHARING TAB + sizer_4 = wx.BoxSizer(wx.VERTICAL) + sizer_4_1 = wx.StaticBoxSizer(self.staticbox_FolderSharing, wx.VERTICAL) + sizer_4_1_1 = wx.FlexGridSizer(1, 2, 0, 0) + sizer_4_1_1_1 = wx.BoxSizer(wx.HORIZONTAL) + sizer_4_1_1_1.Add(self.SharedFolderPathLabel, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_4_1_1_1.Add(self.SharedFolderPath, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_4_1_1_1.Add(self.SharedFolderPathBrowseButton, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_4_1_1_2 = wx.BoxSizer(wx.HORIZONTAL) + sizer_4_1_1_2.Add(self.AddSharedFolderPathButton, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_4_1_1.Add(sizer_4_1_1_1, 0, wx.LEFT, 0, 0) + sizer_4_1_1.Add(sizer_4_1_1_2, 0, wx.RIGHT, 0, 0) + sizer_4_1_2 = wx.BoxSizer(wx.HORIZONTAL) + sizer_4_1_2.Add(self.SharedFoldersList, 1, wx.EXPAND, 0) + sizer_4_1_3 = wx.BoxSizer(wx.HORIZONTAL) + sizer_4_1_3.Add(self.DeleteSharedFolderPathButton, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_4_1_3.Add(self.SSHFSPortForwarding, 0, wx.ALIGN_CENTRE_VERTICAL, 0) + sizer_4_1.Add(sizer_4_1_1, 0, 0, 0) + sizer_4_1.Add(sizer_4_1_2, 0, wx.EXPAND, 0) + sizer_4_1.Add(sizer_4_1_3, 0, wx.EXPAND, 0) + sizer_4.Add(sizer_4_1, 0, wx.EXPAND, 0) + self.tab_SharedFolders.SetSizer(sizer_4) + + self.X2goTabs.AddPage(self.tab_Session, "Session Profile") + self.X2goTabs.AddPage(self.tab_Connection, "Connection") + self.X2goTabs.AddPage(self.tab_Settings, "Settings") + self.X2goTabs.AddPage(self.tab_SharedFolders, "Shared Folders") + + # the bottom area with OK, Defaults and Cancel buttons + sizer_B = wx.BoxSizer(wx.HORIZONTAL) + sizer_B_1 = wx.FlexGridSizer(1, 0, 7, 14) + sizer_B_1.Add(self.OKButton, 0, 0, 0) + sizer_B_1.Add(self.DefaultButton, 0, 0, 0) + sizer_B_1.Add(self.CancelButton, 0, 0, 0) + sizer_B.Add(sizer_B_1, 1, wx.EXPAND, 0) + + # put it all together... + MainSizer = wx.BoxSizer(wx.VERTICAL) + MainSizer.Add(self.X2goTabs, 1, wx.EXPAND|wx.FIXED_MINSIZE, 0) + MainSizer.Add(sizer_B, 0, wx.ALIGN_RIGHT, 0) + self.SetSizer(MainSizer) + self.Fit() + self.SetSizeHints(550,440) + self.SetAutoLayout(True) + self.Layout() + + def __update_fields(self): self.ProfileName.SetValue(self.profile_config['name']) - self.hostname.SetValue(self.profile_config['host']) - self.username.SetValue(self.profile_config['user']) - self.sshport.SetValue(self.profile_config['sshport']) - self.sshkeylocation.SetLabel(self.profile_config['key']) + self.Host.SetValue(self.profile_config['host']) + self.UserName.SetValue(self.profile_config['user']) + self.SSHPort.SetValue(self.profile_config['sshport']) + self.SSHKeyFile.SetValue(self.profile_config['key']) + self.UseSSHProxy.SetValue(self.profile_config['usesshproxy']) - try: - sessionType = self.sessionChoices.index(self.profile_config['session_type']) - except ValueError: - sessionType = 0 - self.SessionType.SetValue(self.sessionChoicesText[sessionType]) + _ssh_proxy = self.profile_config['usesshproxy'] + if self.profile_config['sshproxy'].count(':') == 2: + _from_port, _to_host, _to_port = self.profile_config['sshproxy'].split(':') + _from_host = 'localhost' + elif self.profile_config['sshproxy'].count(':') == 3: + _from_host, _from_port, _to_host, _to_port = self.profile_config['sshproxy'].split(':') - try: - commandNr = self.applicationList.index(self.profile_config['command']) - except ValueError: - commandNr = 3 - self.Command.SetValue(self.applicationListText[commandNr]) + if _ssh_proxy: + self.SSHProxyFromHost.SetValue(_from_host) + self.SSHProxyFromPort.SetValue(int(_from_port)) + self.SSHProxyToHost.SetValue(_to_host) + self.SSHProxyToPort.SetValue(int(_to_port)) + self.SSHProxyLabel.Enable(True) + self.SSHProxyFromHost.Enable(True) + self.SSHProxyFromPort.Enable(True) + self.SSHProxyBetweenLabel.Enable(True) + self.SSHProxyToHost.Enable(True) + self.SSHProxyToPort.Enable(True) + else: + self.SSHProxyLabel.Enable(False) + self.SSHProxyFromHost.Enable(False) + self.SSHProxyFromPort.Enable(False) + self.SSHProxyBetweenLabel.Enable(False) + self.SSHProxyToHost.Enable(False) + self.SSHProxyToPort.Enable(False) + + _command = self.profile_config['command'] + + # disable all command relevant widgets first + self.ApplicationLabel.Enable(False) + self.Application.Enable(False) + self.CommandLabel.Enable(False) + self.Command.Enable(False) + + if _command in self.sessionChoices.keys(): + self.SessionType.SetValue(self.sessionChoices[_command]) + self.Application.SetValue('') + self.Command.SetValue('') + elif _command in self.applicationChoices.keys(): + self.SessionType.SetValue(self.sessionChoices['APPLICATION']) + self.ApplicationLabel.Enable(True) + self.Application.Enable(True) + self.Application.SetValue(self.applicationChoices[_command]) + self.Command.SetValue('') + else: + self.SessionTyp.SetValue(self.sessionChoices['CUSTOM']) + self.Command.Enable(True) + self.Command.SetValue(_command) + + if _command in ('RDP', 'DirectRDP'): + self.RDPSettingsLabel.Enable(True) + self.RDPServerLabel.Enable(True) + self.RDPServer.Enable(True) + self.RDPOptionsLabel.Enable(True) + self.RDPOptions.Enable(True) + else: + self.RDPSettingsLabel.Enable(False) + self.RDPServerLabel.Enable(False) + self.RDPServer.Enable(False) + self.RDPOptionsLabel.Enable(False) + self.RDPOptions.Enable(False) + + if _command == 'DirectRDP': + self.enable_DirectRDP() + else: + self.disable_DirectRDP() + + self.RDPServer.SetValue(self.profile_config['rdpserver']) + self.RDPOptions.SetValue(self.profile_config['rdpoptions']) try: - speedNr = self.linkText.index(self.profile_config['link']) - except ValueError: - speedNr = 2 - self.connectionSpeed.SetValue(speedNr) + _link_speed = self.linkChoices[self.profile_config['link']] + except KeyError: + _link_speed = self.profileManagerDefaults['link'] + + for e in self.linkChoices.items(): + if e[1] == _link_speed: + self.LinkSpeed.SetValue(e[0]) + break self.Compression.SetValue(self.profile_config['pack']) self.ImageQuality.SetValue(self.profile_config['quality']) - self.DisplayTypeFullScreen.SetValue(self.profile_config['fullscreen']) + self.DisplayTypeFullscreen.SetValue(self.profile_config['fullscreen']) self.DisplayTypeCustom.SetValue(not self.profile_config['fullscreen']) - self.ScrnWidth.SetValue(self.profile_config['width']) - self.ScrnHeight.SetValue(self.profile_config['height']) + self.ScreenWidth.SetValue(self.profile_config['width']) + self.ScreenHeight.SetValue(self.profile_config['height']) if self.profile_config['fullscreen']: - self.ScrnWidth.Enable(False) - self.ScrnHeight.Enable(False) + self.ScreenWidth.Enable(False) + self.ScreenHeight.Enable(False) + else: + self.ScreenWidth.Enable(True) + self.ScreenHeight.Enable(True) self.SetDisplayDPI.SetValue(self.profile_config['setdpi']) + self.DisplayDPI.SetValue(self.profile_config['dpi']) + if not self.profile_config['setdpi']: + self.DisplayDPI.Enable(False) + else: + self.DisplayDPI.Enable(True) + # TODO Fill in the actual DPI self.CurrentKeyBoard.SetValue(self.profile_config['usekbd']) self.KeyboardLayout.SetValue(self.profile_config['layout']) - self.Keyboardmodel.SetValue(self.profile_config['type']) + self.KeyboardModel.SetValue(self.profile_config['type']) if self.profile_config['usekbd']: + self.KeyboardLayoutLabel.Enable(False) + self.KeyboardModelLabel.Enable(False) self.KeyboardLayout.Enable(False) - self.Keyboardmodel.Enable(False) + self.KeyboardModel.Enable(False) + else: + self.KeyboardLayoutLabel.Enable(True) + self.KeyboardModelLabel.Enable(True) + self.KeyboardLayout.Enable(True) + self.KeyboardModel.Enable(True) self.EnableSound.SetValue(self.profile_config['sound']) - self.soundtunnel.SetValue(self.profile_config['soundtunnel']) + self.SoundTunnel.SetValue(self.profile_config['soundtunnel']) self.DefaultSoundPort.SetValue(self.profile_config['defsndport']) self.SoundPort.SetValue(self.profile_config['sndport']) if self.profile_config['soundsystem'] == 'pulse': @@ -277,57 +664,90 @@ class PyHocaGUI_ProfileManager(wx.Frame): self.Arts.SetValue(True) elif self.profile_config['soundsystem'] == 'esd': self.esd.SetValue(True) - if not self.profile_config['sound']: + if self.profile_config['sound']: + self.PulseAudio.Enable(True) + self.SoundTunnel.Enable(True) + self.Arts.Enable(True) + self.esd.Enable(True) + self.DefaultSoundPort.Enable(True) + if not self.profile_config['defsndport']: + self.SoundPortLabel.Enable(True) + self.SoundPort.Enable(True) + else: + self.SoundPortLabel.Enable(False) + self.SoundPort.Enable(False) + else: self.PulseAudio.Enable(False) - self.soundtunnel.Enable(False) + self.SoundTunnel.Enable(False) self.Arts.Enable(False) self.esd.Enable(False) self.DefaultSoundPort.Enable(False) + self.SoundPortLabel.Enable(False) self.SoundPort.Enable(False) - elif not self.profile_config['defsndport']: - self.SoundPort.Enable(False) - self.ClientSidePrinting.SetValue(self.profile_config['printing']) - self.SSHPortforwarding.SetValue(self.profile_config['fstunnel']) + self.ClientSidePrinting.SetValue(self.profile_config['print']) + self.SSHFSPortForwarding.SetValue(self.profile_config['fstunnel']) + + self.SharedFoldersList.DeleteAllItems() + _shared_folders = self.profile_config['export'].strip().strip(',').strip() + for _shared_folder_path in [ sf.strip() for sf in _shared_folders.split(',') ]: + if self.SharedFoldersList.FindItem(0, _shared_folder_path) == -1: + _item = wx.ListItem() + _item.SetData(wx.NewId()) + _item.SetText(_shared_folder_path) + self.SharedFoldersList.InsertItem(_item) - def __updateFromScreen(self): + def __update_from_screen(self): self.profile_config['name'] = self.ProfileName.GetValue() - self.profile_config['host'] = self.hostname.GetValue() - self.profile_config['user'] = self.username.GetValue() - self.profile_config['default'] = self.Default.GetValue() - self.profile_config['sshport'] = self.sshport.GetValue() - self.profile_config['key'] = self.sshkeylocation.GetLabel() - sessionText = self.SessionType.GetValue() - try: - sessionNr = self.sessionChoicesText.index(sessionText) - except ValueError: - sessionNr = 0 - self.profile_config['session_type'] = self.sessionChoices[sessionNr] + self.profile_config['icon'] = self.IconPath + self.profile_config['host'] = self.Host.GetValue() + self.profile_config['user'] = self.UserName.GetValue() + self.profile_config['sshport'] = self.SSHPort.GetValue() + self.profile_config['key'] = self.SSHKeyFile.GetValue() + if self.UseSSHProxy.GetValue(): + self.profile_config['usesshproxy'] = True + else: + self.profile_config['usesshproxy'] = False + self.profile_config['sshproxy'] = '%s:%s:%s:%s' % (self.SSHProxyFromHost.GetValue(), + self.SSHProxyFromPort.GetValue(), + self.SSHProxyToHost.GetValue(), + self.SSHProxyToPort.GetValue(), + ) - commandText = self.Command.GetValue() - try: - commandNr = self.applicationListText.index(commandText) - except ValueError: - commandNr = 3 - self.profile_config['command'] = self.applicationList[commandNr] + _session_type = [ s for s in self.sessionChoices.keys() if self.sessionChoices[s] == self.SessionType.GetValue() ][0] + if _session_type == 'APPLICATION': + _command = [ a for a in self.applicationChoices.keys() if self.applicationChoices[a] == self.Application.GetValue() ][0] + self.profile_config['rootless'] = True + elif _session_type == 'CUSTOM': + _command = self.Command.GetValue() + self.profile_config['rootless'] = True + elif _session_type in ('RDP', 'EMBEDDED_MENU'): + _command = _session_type + self.profile_config['rootless'] = True + else: + _command = _session_type + self.profile_config['command'] = _command + self.profile_config['rdpserver'] = self.RDPServer.GetValue() + self.profile_config['rdpoptions'] = self.RDPOptions.GetValue() - speedNr = self.connectionSpeed.GetValue() - self.profile_config['link'] = self.linkText[speedNr] + _link_idx = self.LinkSpeed.GetValue() + self.profile_config['link'] = self.linkChoices[_link_idx] self.profile_config['pack'] = self.Compression.GetValue() self.profile_config['quality'] = self.ImageQuality.GetValue() - self.profile_config['fullscreen'] = self.DisplayTypeFullScreen.GetValue() - self.profile_config['width'] = self.ScrnWidth.GetValue() - self.profile_config['height'] = self.ScrnHeight.GetValue() + self.profile_config['fullscreen'] = self.DisplayTypeFullscreen.GetValue() + self.profile_config['width'] = self.ScreenWidth.GetValue() + self.profile_config['height'] = self.ScreenHeight.GetValue() self.profile_config['setdpi'] = self.SetDisplayDPI.GetValue() - # TODO Fill in the actual DPI + self.profile_config['dpi'] = self.DisplayDPI.GetValue() + self.profile_config['usekbd'] = self.CurrentKeyBoard.GetValue() - self.profile_config['kbdlayout'] = self.KeyboardLayout.GetValue() - self.profile_config['kbdtype'] = self.Keyboardmodel.GetValue() + self.profile_config['layout'] = self.KeyboardLayout.GetValue() + self.profile_config['type'] = self.KeyboardModel.GetValue() self.profile_config['sound'] = self.EnableSound.GetValue() - self.profile_config['soundtunnel'] = self.soundtunnel.GetValue() + self.profile_config['soundtunnel'] = self.SoundTunnel.GetValue() self.profile_config['defsndport'] = self.DefaultSoundPort.GetValue() self.profile_config['sndport'] = self.SoundPort.GetValue() if self.PulseAudio.GetValue(): @@ -337,230 +757,272 @@ class PyHocaGUI_ProfileManager(wx.Frame): elif self.esd.GetValue(): self.profile_config['soundsystem'] = 'esd' - self.profile_config['printing'] = self.ClientSidePrinting.GetValue() - self.profile_config['fstunnel'] = self.SSHPortforwarding.GetValue() + self.profile_config['print'] = self.ClientSidePrinting.GetValue() + self.profile_config['fstunnel'] = self.SSHFSPortForwarding.GetValue() - def __validate(self): - validateOk = True - if len(self.profile_config['name'].strip()) == 0: - Message(self,6) - validateOk = False - return validateOk + _shared_folders = [] + _item_id = self.SharedFoldersList.GetTopItem() + while _item_id != -1: + _item = self.SharedFoldersList.GetItem(_item_id) + _shared_folders.append(_item.GetText()) + _item_id = self.SharedFoldersList.GetNextItem(_item_id) + self.profile_config['export'] = ','.join(_shared_folders) - def __do_layout(self): - # begin wxGlade: X2goMaintProfile.__do_layout - MainSizer = wx.BoxSizer(wx.VERTICAL) - bottomsizer = wx.BoxSizer(wx.HORIZONTAL) - grid_sizer_4 = wx.FlexGridSizer(1, 3, 0, 14) - sizer_11 = wx.StaticBoxSizer(self.sizer_11_staticbox, wx.VERTICAL) - grid_sizer_16 = wx.FlexGridSizer(3, 1, 0, 0) - grid_sizer_18 = wx.FlexGridSizer(1, 2, 3, 9) - grid_sizer_17 = wx.FlexGridSizer(1, 4, 2, 9) - sizer_5 = wx.BoxSizer(wx.VERTICAL) - sizer_10 = wx.StaticBoxSizer(self.sizer_10_staticbox, wx.HORIZONTAL) - sizer_9 = wx.StaticBoxSizer(self.sizer_9_staticbox, wx.VERTICAL) - grid_sizer_15 = wx.FlexGridSizer(1, 3, 0, 9) - grid_sizer_14 = wx.FlexGridSizer(1, 2, 0, 9) - grid_sizer_13 = wx.FlexGridSizer(1, 2, 0, 9) - sizer_8 = wx.StaticBoxSizer(self.sizer_8_staticbox, wx.VERTICAL) - grid_sizer_12 = wx.FlexGridSizer(1, 2, 0, 9) - grid_sizer_11 = wx.FlexGridSizer(1, 2, 0, 9) - sizer_6 = wx.StaticBoxSizer(self.sizer_6_staticbox, wx.VERTICAL) - sizer_7 = wx.BoxSizer(wx.VERTICAL) - grid_sizer_10 = wx.FlexGridSizer(1, 3, 0, 9) - grid_sizer_9 = wx.FlexGridSizer(2, 6, 0, 9) - sizer_1 = wx.BoxSizer(wx.VERTICAL) - sizer_4 = wx.StaticBoxSizer(self.sizer_4_staticbox, wx.VERTICAL) - grid_sizer_8 = wx.FlexGridSizer(1, 2, 0, 9) - grid_sizer_7 = wx.FlexGridSizer(1, 2, 0, 9) - ConnSpeedSizer = wx.StaticBoxSizer(self.ConnSpeedSizer_staticbox, wx.VERTICAL) - grid_sizer_6 = wx.FlexGridSizer(1, 5, 0, 6) - sizer_3 = wx.StaticBoxSizer(self.sizer_3_staticbox, wx.VERTICAL) - grid_sizer_5 = wx.FlexGridSizer(2, 2, 0, 10) - sizer_2 = wx.StaticBoxSizer(self.sizer_2_staticbox, wx.VERTICAL) - grid_sizer_3 = wx.FlexGridSizer(1, 3, 0, 3) - grid_sizer_2 = wx.FlexGridSizer(1, 2, 0, 0) - grid_sizer_1 = wx.FlexGridSizer(11, 2, 0, 0) - grid_sizer_1.Add(self.ProfileLabel, 0, wx.FIXED_MINSIZE, 0) - grid_sizer_1.Add(self.ProfileName, 2, wx.FIXED_MINSIZE, 0) - grid_sizer_1.Add(self.IconButton, 0, 0, 0) - grid_sizer_1.Add(self.IconLabel, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_1.Add(self.HostLabel, 0, 0, 0) - grid_sizer_1.Add(self.hostname, 0, wx.FIXED_MINSIZE, 0) - grid_sizer_1.Add(self.UserLabel, 0, 0, 0) - grid_sizer_1.Add(self.username, 0, wx.FIXED_MINSIZE, 0) - self.X2goSessionTab.SetSizer(grid_sizer_1) - grid_sizer_1.AddGrowableCol(0) - grid_sizer_1.AddGrowableCol(1) - grid_sizer_2.Add(self.LoginLabel, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_2.Add(self.sshport, 0, 0, 0) - sizer_2.Add(grid_sizer_2, 1, wx.EXPAND, 0) - grid_sizer_3.Add(self.SSHkeyLabel, 0, wx.ALIGN_CENTER_VERTICAL|wx.FIXED_MINSIZE, 0) - grid_sizer_3.Add(self.sshkeylocation, 0, wx.ALIGN_CENTER_VERTICAL|wx.FIXED_MINSIZE, 0) - grid_sizer_3.Add(self.fileFindButton, 0, 0, 0) - sizer_2.Add(grid_sizer_3, 1, wx.EXPAND, 0) - sizer_1.Add(sizer_2, 1, wx.EXPAND, 0) - grid_sizer_5.Add(self.SessionTypeLabel, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_5.Add(self.SessionType, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_5.Add(self.CommandLabel, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_5.Add(self.Command, 0, 0, 0) - sizer_3.Add(grid_sizer_5, 1, wx.EXPAND, 0) - sizer_1.Add(sizer_3, 1, wx.EXPAND, 0) - ConnSpeedSizer.Add(self.connectionSpeed, 0, wx.EXPAND, 0) - grid_sizer_6.Add(self.ModemLabel, 0, wx.LEFT|wx.EXPAND, 0) - grid_sizer_6.Add(self.ISDNLabel, 0, wx.EXPAND, 0) - grid_sizer_6.Add(self.ADSLLabel, 0, wx.EXPAND, 0) - grid_sizer_6.Add(self.WanLabel, 0, wx.RIGHT|wx.EXPAND, 0) - grid_sizer_6.Add(self.LanLabel, 0, wx.RIGHT|wx.EXPAND, 0) - grid_sizer_6.AddGrowableCol(0) - grid_sizer_6.AddGrowableCol(1) - grid_sizer_6.AddGrowableCol(2) - grid_sizer_6.AddGrowableCol(3) - grid_sizer_6.AddGrowableCol(4) - ConnSpeedSizer.Add(grid_sizer_6, 1, wx.EXPAND, 1) - sizer_1.Add(ConnSpeedSizer, 1, wx.EXPAND, 0) - grid_sizer_7.Add(self.MethodLabel, 0, 0, 0) - grid_sizer_7.Add(self.Compression, 0, 0, 0) - sizer_4.Add(grid_sizer_7, 1, wx.EXPAND, 0) - grid_sizer_8.Add(self.ImageQualityLabel, 0, 0, 0) - grid_sizer_8.Add(self.ImageQuality, 0, 0, 0) - sizer_4.Add(grid_sizer_8, 1, wx.EXPAND, 0) - sizer_1.Add(sizer_4, 1, wx.EXPAND, 0) - self.X2goConnectionTab.SetSizer(sizer_1) - grid_sizer_9.Add(self.DisplayTypeFullScreen, 0, 0, 0) - grid_sizer_9.Add(self.DisplayTypeCustom, 0, 0, 0) - grid_sizer_9.Add(self.WidthLabel, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_9.Add(self.ScrnWidth, 0, 0, 0) - grid_sizer_9.Add(self.HeightLabel, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_9.Add(self.ScrnHeight, 0, 0, 0) - sizer_7.Add(grid_sizer_9, 1, wx.EXPAND, 0) - grid_sizer_10.Add(self.SetDisplayDPI, 0, 0, 0) - sizer_7.Add(grid_sizer_10, 1, wx.EXPAND, 0) - sizer_6.Add(sizer_7, 1, wx.EXPAND, 0) - sizer_5.Add(sizer_6, 1, wx.EXPAND, 0) - sizer_8.Add(self.CurrentKeyBoard, 0, 0, 0) - grid_sizer_11.Add(self.KeyboardLayoutLabel, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_11.Add(self.KeyboardLayout, 0, wx.EXPAND, 0) - sizer_8.Add(grid_sizer_11, 1, wx.EXPAND, 0) - grid_sizer_12.Add(self.KeyboardModelLabel, 0, 0, 0) - grid_sizer_12.Add(self.Keyboardmodel, 0, wx.EXPAND, 0) - sizer_8.Add(grid_sizer_12, 1, wx.EXPAND, 0) - sizer_5.Add(sizer_8, 1, wx.EXPAND, 0) - sizer_9.Add(self.EnableSound, 0, 0, 0) - grid_sizer_13.Add(self.PulseAudio, 0, 0, 0) - grid_sizer_13.Add(self.soundtunnel, 0, 0, 0) - sizer_9.Add(grid_sizer_13, 1, wx.EXPAND, 0) - grid_sizer_14.Add(self.Arts, 0, 0, 0) - grid_sizer_14.Add(self.DefaultSoundPort, 0, 0, 0) - sizer_9.Add(grid_sizer_14, 1, wx.EXPAND, 0) - grid_sizer_15.Add(self.esd, 0, 0, 0) - grid_sizer_15.Add(self.SoundPortLabel, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_15.Add(self.SoundPort, 0, 0, 0) - sizer_9.Add(grid_sizer_15, 1, wx.EXPAND, 0) - sizer_5.Add(sizer_9, 1, wx.EXPAND, 0) - sizer_10.Add(self.ClientSidePrinting, 0, 0, 0) - sizer_5.Add(sizer_10, 1, wx.EXPAND, 0) - self.X2goSettingsTab.SetSizer(sizer_5) - grid_sizer_17.Add(self.PathLabel, 0, 0, 0) - grid_sizer_17.Add(self.Path, 0, 0, 0) - grid_sizer_17.Add(self.SharedFilesPath, 0, 0, 0) - grid_sizer_17.Add(self.AddFolderButton, 0, 0, 0) - grid_sizer_16.Add(grid_sizer_17, 1, wx.EXPAND, 0) - grid_sizer_18.Add(self.SharedFilesList, 1, wx.EXPAND, 0) - grid_sizer_18.Add(self.DeleteButton, 0, wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer_16.Add(grid_sizer_18, 1, wx.EXPAND, 0) - grid_sizer_16.Add(self.SSHPortforwarding, 0, 0, 0) - sizer_11.Add(grid_sizer_16, 1, wx.EXPAND, 0) - self.X2goTabs_pane_4.SetSizer(sizer_11) - self.X2goTabs.AddPage(self.X2goSessionTab, "Session") - self.X2goTabs.AddPage(self.X2goConnectionTab, "Connection") - self.X2goTabs.AddPage(self.X2goSettingsTab, "Settings") - self.X2goTabs.AddPage(self.X2goTabs_pane_4, "Shared Folders") - MainSizer.Add(self.X2goTabs, 1, wx.EXPAND|wx.FIXED_MINSIZE, 0) - grid_sizer_4.Add(self.OKButton, 0, 0, 0) - grid_sizer_4.Add(self.CancelButton, 0, 0, 0) - grid_sizer_4.Add(self.DefaultButton, 0, 0, 0) - bottomsizer.Add(grid_sizer_4, 1, wx.EXPAND, 0) - MainSizer.Add(bottomsizer, 0, wx.EXPAND, 0) - self.SetSizer(MainSizer) - #MainSizer.Fit(self) - MainSizer.SetSizeHints(self) - self.SetAutoLayout(True) - self.Layout() - # end wxGlade + def OnIconChange(self, event): + _share_location = os.path.split(_icons_location)[0] + iconsdir = _icons_location + if not os.path.exists(iconsdir): + iconsdir = os.getcwd() + wildcard = "Icon Files (*.png)|*.png|" \ + "All files (*.*)|*" + dlg = wx.FileDialog( + self, message="Choose an icon for this session profile", defaultDir=iconsdir, + defaultFile="", wildcard=wildcard, style=wx.OPEN | wx.CHANGE_DIR ) + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + if dlg.ShowModal() == wx.ID_OK: + # This returns a Python list of files that were selected. + path_to_icon = dlg.GetPath() + self.IconButton.SetBitmapLabel(wx.Bitmap(path_to_icon, wx.BITMAP_TYPE_ANY)) + rel_path = path_to_icon.replace('%s/' % _share_location, ':') + rel_path = rel_path.replace( 'icons/PyHoca/128x128/pyhoca-session.png', 'icons/128x128/x2gosession.png') + self.IconPath = rel_path - def onOKButton(self, event): # wxGlade: X2goMaintProfile.<event_handler> - self.__updateFromScreen() - if self.__validate(): - self.session_profiles.write() + def enable_DirectRDP(self): + self.HostLabel.Enable(False) + self.Host.Enable(False) + self.SSHPortLabel.Enable(False) + self.SSHPort.Enable(False) + self.SSHKeyFileLabel.Enable(False) + self.SSHKeyFile.Enable(False) + self.staticbox_LinkSpeed.Enable(False) + self.LinkSpeed.Enable(False) + self.ModemLabel.Enable(False) + self.ISDNLabel.Enable(False) + self.ADSLLabel.Enable(False) + self.WANLabel.Enable(False) + self.LANLabel.Enable(False) + self.staticbox_Compression.Enable(False) + self.CompressionLabel.Enable(False) + self.Compression.Enable(False) + self.ImageQualityLabel.Enable(False) + self.ImageQuality.Enable(False) + self.tab_Settings.Enable(False) + self.tab_SharedFolders.Enable(False) - def onCancel(self, event): # wxGlade: X2goMaintProfile.<event_handler> - self.Close() - self.Destroy() + def disable_DirectRDP(self): + self.HostLabel.Enable(True) + self.Host.Enable(True) + self.SSHPortLabel.Enable(True) + self.SSHPort.Enable(True) + self.SSHKeyFileLabel.Enable(True) + self.SSHKeyFile.Enable(True) + self.staticbox_LinkSpeed.Enable(True) + self.LinkSpeed.Enable(True) + self.ModemLabel.Enable(True) + self.ISDNLabel.Enable(True) + self.ADSLLabel.Enable(True) + self.WANLabel.Enable(True) + self.LANLabel.Enable(True) + self.staticbox_Compression.Enable(True) + self.CompressionLabel.Enable(True) + self.Compression.Enable(True) + self.ImageQualityLabel.Enable(True) + self.ImageQuality.Enable(True) + self.tab_Settings.Enable(True) + self.tab_SharedFolders.Enable(True) + + def OnSessionTypeSelected(self, event): + _session_type = [ i for i in self.sessionChoices.keys() if self.sessionChoices[i] == self.SessionType.GetValue() ][0] + if _session_type == 'APPLICATION': + self.ApplicationLabel.Enable(True) + self.Application.Enable(True) + if not self.Application.GetValue(): + self.Application.SetValue('TERMINAL') + else: + self.ApplicationLabel.Enable(False) + self.Application.Enable(False) - def onDefaults(self, event): # wxGlade: X2goMaintProfile.<event_handler> - self.resetValues() + if _session_type == 'CUSTOM': + self.CommandLabel.Enable(True) + self.Command.Enable(True) + if not self.Command.GetValue(): + self.Command.SetValue('xterm') + else: + self.CommandLabel.Enable(False) + self.Command.Enable(False) + + if _session_type in ('RDP', 'DirectRDP', ): + self.RDPSettingsLabel.Enable(True) + self.RDPServerLabel.Enable(True) + self.RDPServer.Enable(True) + self.RDPOptionsLabel.Enable(True) + self.RDPOptions.Enable(True) + else: + self.RDPSettingsLabel.Enable(False) + self.RDPServerLabel.Enable(False) + self.RDPServer.Enable(False) + self.RDPOptionsLabel.Enable(False) + self.RDPOptions.Enable(False) - def onIconChange(self, event): # wxGlade: X2goMaintProfile.<event_handler> - print "Event handler `onIconChange' not implemented" - event.Skip() + if _session_type == 'DirectRDP': + self.enable_DirectRDP() + else: + self.disable_DirectRDP() - def onFindKey(self, event): # wxGlade: X2goMaintProfile.<event_handler> - wildcard = "Public keys (*.pub)|*.pub|" \ - "All files (*.*)|*.*" + def OnSSHPublicKeyBrowse(self, event): sshdir = os.path.expanduser('~/.ssh') if not os.path.exists(sshdir): sshdir = os.getcwd() + wildcard = "All files (*.*)|*" dlg = wx.FileDialog( - self, message="Choose a public key", defaultDir=startdir, + self, message="Choose a public SSH key", defaultDir=sshdir, defaultFile="", wildcard=wildcard, style=wx.OPEN | wx.CHANGE_DIR ) # Show the dialog and retrieve the user response. If it is the OK response, # process the data. if dlg.ShowModal() == wx.ID_OK: # This returns a Python list of files that were selected. path = dlg.GetPath() + self.SSHKeyFile.SetValue(path) - def onSetDPI(self, event): # wxGlade: X2goMaintProfile.<event_handler> - print "Event handler `onSetDPI' not implemented" - event.Skip() + def OnUseSSHProxy(self, event): + if self.UseSSHProxy.GetValue(): + self.SSHProxyLabel.Enable(True) + self.SSHProxyFromHost.Enable(True) + self.SSHProxyBetweenLabel.Enable(True) + self.SSHProxyFromPort.Enable(True) + self.SSHProxyToHost.Enable(True) + self.SSHProxyToPort.Enable(True) + else: + self.SSHProxyLabel.Enable(False) + self.SSHProxyFromHost.Enable(False) + self.SSHProxyFromPort.Enable(False) + self.SSHProxyBetweenLabel.Enable(False) + self.SSHProxyToHost.Enable(False) + self.SSHProxyToPort.Enable(False) - def onKeepKeyboard(self, event): # wxGlade: X2goMaintProfile.<event_handler> + def OnKeepKeyboard(self, event): if self.CurrentKeyBoard.GetValue(): + self.KeyboardLayoutLabel.Enable(False) + self.KeyboardModelLabel.Enable(False) self.KeyboardLayout.Enable(False) - self.Keyboardmodel.Enable(False) + self.KeyboardModel.Enable(False) else: + self.KeyboardLayoutLabel.Enable(True) + self.KeyboardModelLabel.Enable(True) self.KeyboardLayout.Enable(True) - self.Keyboardmodel.Enable(True) + self.KeyboardModel.Enable(True) - def onSoundEnable(self, event): # wxGlade: X2goMaintProfile.<event_handler> + def OnSoundEnable(self, event): # wxGlade: X2goMaintProfile.<event_handler> if self.EnableSound.GetValue(): self.PulseAudio.Enable(True) - self.soundtunnel.Enable(True) self.Arts.Enable(True) self.esd.Enable(True) + self.SoundTunnel.Enable(True) + self.DefaultSoundPort.Enable(True) if self.DefaultSoundPort.GetValue() is False: + self.SoundPortLabel.Enable(True) self.SoundPort.Enable(True) else: self.PulseAudio.Enable(False) - self.soundtunnel.Enable(False) self.Arts.Enable(False) self.esd.Enable(False) - self.SoundPort.Enable(False) + self.SoundTunnel.Enable(False) self.DefaultSoundPort.Enable(False) + self.SoundPortLabel.Enable(False) + self.SoundPort.Enable(False) + + def OnSoundPort(self, event): + if not self.DefaultSoundPort.GetValue(): + self.SoundPortLabel.Enable(True) + self.SoundPort.Enable(True) + else: + self.SoundPortLabel.Enable(False) + self.SoundPort.Enable(False) + + def OnSetDisplayFullscreen(self, event): + self.ScreenWidthLabel.Enable(False) + self.ScreenWidth.Enable(False) + self.ScreenHeightLabel.Enable(False) + self.ScreenHeight.Enable(False) - def onSoundPort(self, event): - pass + def OnSetDisplayCustom(self, event): + self.ScreenWidthLabel.Enable(True) + self.ScreenWidth.Enable(True) + self.ScreenHeightLabel.Enable(True) + self.ScreenHeight.Enable(True) - def onAddFolder(self, event): # wxGlade: X2goMaintProfile.<event_handler> - print "Event handler `onAddFolder' not implemented" - event.Skip() + def OnSetDisplayDPI(self, event): + if self.SetDisplayDPI.GetValue(): + self.DisplayDPI.Enable(True) + else: + self.DisplayDPI.Enable(False) + + def OnSelectSharedFolderPath(self, event): + shared_folder = os.path.expanduser('~') + if not os.path.exists(shared_folder): + shared_folder = os.getcwd() + dlg = wx.DirDialog( + self, message="Choose a folder to share within a session", style=1, defaultPath=shared_folder) + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + if dlg.ShowModal() == wx.ID_OK: + # This returns a Python list of files that were selected. + self.SharedFolderPath.SetValue(dlg.GetPath()) - def onOK(self, event): # wxGlade: X2goMaintProfile.<event_handler> - print "Event handler `onOK' not implemented" - event.Skip() + def OnAddSharedFolderPath(self, event): + _shared_folder_path = self.SharedFolderPath.GetValue() + if _shared_folder_path and (self.SharedFoldersList.FindItem(0, _shared_folder_path) == -1): + _item = wx.ListItem() + _item.SetData(wx.NewId()) + _item.SetText(_shared_folder_path) + self.SharedFoldersList.InsertItem(_item) - def onDefault(self, event): # wxGlade: X2goMaintProfile.<event_handler> - print "Event handler `onDefault' not implemented" - event.Skip() + def OnDeleteSharedFolderPath(self, event): + _item = self.SharedFoldersList.GetFocusedItem() + self.SharedFoldersList.DeleteItem(_item) + + def __validate(self): + validateOk = True + if len(self.profile_config['name'].strip()) == 0: + validateOk = False + self._PyHocaGUI.notifier.send(title='Profile Manager', text='Profile name is missing, profile unusable!!!', icon='profile_error') + return validateOk + + def OnOKButton(self, event): + self.__update_from_screen() + if self.__validate(): + + if self.profile_config != self.profile_config_bak: + + if self.action == 'ADD': + self.profile_id = self.session_profiles.add_profile() + + for k in self.profile_config.keys(): + self.session_profiles.update_value(self.profile_id, k, self.profile_config[k]) + + self.session_profiles.write_user_config = True + self.session_profiles.write() + + if self.action == 'ADD': + self._PyHocaGUI.notifier.send(title='%s - profile added' % self.profile_config['name'], + text='A new session profile has been added.', + icon='profile_add', + ) + elif self.action == 'EDIT': + self._PyHocaGUI.notifier.send(title='%s - modified' % self.profile_config['name'], + text='Changes to profile have been saved.', + icon='profile_save', + ) + + self.Close() + self.Destroy() + + def OnCancel(self, event): + self.Close() + self.Destroy() + def OnDefault(self, event): + self.profile_config = copy.deepcopy(self.profile_config_bak) + self.__update_fields() hooks/post-receive -- pyhoca-gui.git (Python X2Go Client (wxPython GUI)) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "pyhoca-gui.git" (Python X2Go Client (wxPython GUI)).