diff --git a/sflphone-client-gnome/src/config/configwindow.c b/sflphone-client-gnome/src/config/configwindow.c index 7093d12354d661f193ad4b73abfc36ae71ae333b..6117837739e39e9204fc27f8cf5cd130876389f9 100644 --- a/sflphone-client-gnome/src/config/configwindow.c +++ b/sflphone-client-gnome/src/config/configwindow.c @@ -695,12 +695,8 @@ record_path_changed( GtkFileChooser *chooser , GtkLabel *label UNUSED) { gchar* path; - // path = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( chooser ) ); - // g_filename_from_uri () - path = gtk_file_chooser_get_uri( GTK_FILE_CHOOSER( chooser ) ); - // DEBUG("Problem with the path: %s", g_filename_to_utf8(path, -1, NULL, NULL, NULL)); - DEBUG("Problem with the path: %s", path); - // dbus_set_record_path( g_filename_to_utf8(path, -1, NULL, NULL, NULL) ); + path = gtk_file_chooser_get_uri( GTK_FILE_CHOOSER( chooser )); + path = g_strndup (path + 7, strlen(path) - 7); dbus_set_record_path( path ); } diff --git a/sflphone-client-kde/cmake/TargetDistclean.cmake b/sflphone-client-kde/cmake/TargetDistclean.cmake index 35a68f877d4894004cbe1c399e5924e2aa91d292..719618a0865f91851bd0b2a566091ebcdeefe7c3 100644 --- a/sflphone-client-kde/cmake/TargetDistclean.cmake +++ b/sflphone-client-kde/cmake/TargetDistclean.cmake @@ -60,6 +60,8 @@ IF (UNIX) src/sflphone-client-kde src/sflphone-client-kde.shell src/*.moc + src/kcfg_*.cpp + src/kcfg_*.h po/*.cmake po/Makefile po/CMakeFiles diff --git a/sflphone-client-kde/data/CMakeLists.txt b/sflphone-client-kde/data/CMakeLists.txt index c7fb198d7e1bface2b84ab5c33074c2bf52a3af3..99e05c78c1279021a50ae6f5353146244484aa83 100644 --- a/sflphone-client-kde/data/CMakeLists.txt +++ b/sflphone-client-kde/data/CMakeLists.txt @@ -1,4 +1,6 @@ +add_subdirectory(icons) + INSTALL( FILES sflphone-client-kde.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) INSTALL( FILES sflphone-client-kdeui.rc DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde ) diff --git a/sflphone-client-kde/data/icons/CMakeLists.txt b/sflphone-client-kde/data/icons/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..106884f432c1d1e0b0584959af854c79ede4ea6d --- /dev/null +++ b/sflphone-client-kde/data/icons/CMakeLists.txt @@ -0,0 +1 @@ +kde4_install_icons( ${ICON_INSTALL_DIR} ) diff --git a/sflphone-client-kde/data/icons/hi128-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi128-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..0766c5015c37940a5bbb5a98373dde11b6fd3684 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi128-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi16-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi16-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..a11d421fcee468f74620fab0855c9d0308be40e6 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi16-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi22-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi22-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..2000c5fe0e6eeac4fa1414ebf55ad6159e89f3a1 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi22-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi32-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi32-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..611b982155f5e83662fa5404d1473dbfa9cd8d4a Binary files /dev/null and b/sflphone-client-kde/data/icons/hi32-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi48-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi48-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..c643513125209fa828c79b9e8d30d34558aff8c0 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi48-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hi64-apps-sflphone-client-kde.png b/sflphone-client-kde/data/icons/hi64-apps-sflphone-client-kde.png new file mode 100644 index 0000000000000000000000000000000000000000..9ffd3ca53c30493b08dc80fcfbd879ec7e4fa8f0 Binary files /dev/null and b/sflphone-client-kde/data/icons/hi64-apps-sflphone-client-kde.png differ diff --git a/sflphone-client-kde/data/icons/hisc-apps-sflphone-client-kde.svgz b/sflphone-client-kde/data/icons/hisc-apps-sflphone-client-kde.svgz new file mode 100644 index 0000000000000000000000000000000000000000..53105ea7c77c3ad52bd9f04e508febbd9f50a464 Binary files /dev/null and b/sflphone-client-kde/data/icons/hisc-apps-sflphone-client-kde.svgz differ diff --git a/sflphone-client-kde/data/icons/small/hi16-apps-sflphone-client-kde.svgz b/sflphone-client-kde/data/icons/small/hi16-apps-sflphone-client-kde.svgz new file mode 100644 index 0000000000000000000000000000000000000000..cb77652079d1223c0043b797d4ff391047f0c032 Binary files /dev/null and b/sflphone-client-kde/data/icons/small/hi16-apps-sflphone-client-kde.svgz differ diff --git a/sflphone-client-kde/data/icons/small/hi32-apps-sflphone-client-kde.svg b/sflphone-client-kde/data/icons/small/hi32-apps-sflphone-client-kde.svg new file mode 100644 index 0000000000000000000000000000000000000000..6a20cae05ad29065321ee5c4727c027468f64c1b --- /dev/null +++ b/sflphone-client-kde/data/icons/small/hi32-apps-sflphone-client-kde.svg @@ -0,0 +1,781 @@ +<?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="16" + height="16" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.46" + version="1.0" + sodipodi:docbase="/home/david/oxygen/trunk/scalable/apps/small/16x16" + sodipodi:docname="hi32-apps-sflphone-client-kde.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + inkscape:export-filename="/home/david/graphics-document-viewer.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient4999"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop5001" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop5003" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4999" + id="linearGradient5299" + gradientUnits="userSpaceOnUse" + x1="698.38525" + y1="245.5472" + x2="702.81964" + y2="977.78302" /> + <linearGradient + inkscape:collect="always" + id="linearGradient4991"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop4993" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop4995" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4991" + id="radialGradient5297" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.8097086,0,99.14184)" + cx="736.5" + cy="640.93073" + fx="736.5" + fy="640.93073" + r="91.964203" /> + <linearGradient + inkscape:collect="always" + id="linearGradient4684"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop4686" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop4688" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4684" + id="linearGradient5308" + gradientUnits="userSpaceOnUse" + x1="52.987782" + y1="-84.148399" + x2="127.02813" + y2="99.500687" + gradientTransform="matrix(0.173669,0,0,0.174326,5.746764e-4,-16.089201)" /> + <linearGradient + inkscape:collect="always" + id="linearGradient3803"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop3805" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop3807" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3803" + id="linearGradient3809" + x1="12.663443" + y1="8.5301828" + x2="41.858654" + y2="57.533279" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.2705584,0,0,0.2715818,-0.2334952,-16.324153)" /> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 8 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="16 : 8 : 1" + inkscape:persp3d-origin="8 : 5.3333333 : 1" + id="perspective2966" /> + <linearGradient + inkscape:collect="always" + id="linearGradient3491"> + <stop + style="stop-color:#000000;stop-opacity:1;" + offset="0" + id="stop3493" /> + <stop + style="stop-color:#000000;stop-opacity:0;" + offset="1" + id="stop3495" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3491" + id="linearGradient3497" + x1="9.4819469" + y1="-13.32653" + x2="10.666382" + y2="-14.316705" + gradientUnits="userSpaceOnUse" /> + <linearGradient + y2="723.96979" + x2="-2309.3169" + y1="122.62138" + x1="-2325.3611" + gradientUnits="userSpaceOnUse" + id="linearGradient7282" + xlink:href="#linearGradient3794" + inkscape:collect="always" /> + <linearGradient + y2="344.25839" + x2="-2305.0696" + y1="275.5253" + x1="-2282.2617" + gradientUnits="userSpaceOnUse" + id="linearGradient7280" + xlink:href="#linearGradient3794" + inkscape:collect="always" /> + <linearGradient + y2="-39.337055" + x2="-2266.7681" + y1="568.77667" + x1="-2266.7681" + gradientUnits="userSpaceOnUse" + id="linearGradient7278" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="-39.337055" + x2="-2266.7681" + y1="568.77667" + x1="-2266.7681" + gradientUnits="userSpaceOnUse" + id="linearGradient7276" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="428.47058" + x2="-2255.8958" + y1="169.81215" + x1="-2255.8958" + gradientUnits="userSpaceOnUse" + id="linearGradient7274" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="323.11444" + x2="-2255.8958" + y1="169.81215" + x1="-2255.8958" + gradientUnits="userSpaceOnUse" + id="linearGradient7272" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="723.96979" + x2="-2309.3169" + y1="122.62138" + x1="-2325.3611" + gradientUnits="userSpaceOnUse" + id="linearGradient7270" + xlink:href="#linearGradient3794" + inkscape:collect="always" /> + <linearGradient + y2="344.25839" + x2="-2305.0696" + y1="275.5253" + x1="-2282.2617" + gradientUnits="userSpaceOnUse" + id="linearGradient7268" + xlink:href="#linearGradient3794" + inkscape:collect="always" /> + <linearGradient + y2="-39.337055" + x2="-2266.7681" + y1="568.77667" + x1="-2266.7681" + gradientUnits="userSpaceOnUse" + id="linearGradient7266" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="-39.337055" + x2="-2266.7681" + y1="568.77667" + x1="-2266.7681" + gradientUnits="userSpaceOnUse" + id="linearGradient7264" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="428.47058" + x2="-2255.8958" + y1="169.81215" + x1="-2255.8958" + gradientUnits="userSpaceOnUse" + id="linearGradient7262" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="323.11444" + x2="-2255.8958" + y1="169.81215" + x1="-2255.8958" + gradientUnits="userSpaceOnUse" + id="linearGradient7260" + xlink:href="#linearGradient2948" + inkscape:collect="always" /> + <linearGradient + y2="924.16333" + x2="-4511.1455" + y1="890.18469" + x1="-1898.5033" + gradientUnits="userSpaceOnUse" + id="linearGradient7258" + xlink:href="#linearGradient3091" + inkscape:collect="always" /> + <linearGradient + y2="1340.8041" + x2="-2050.8284" + y1="515.37079" + x1="-3230.7649" + gradientUnits="userSpaceOnUse" + id="linearGradient7256" + xlink:href="#linearGradient3091" + inkscape:collect="always" /> + <linearGradient + id="linearGradient5934"> + <stop + style="stop-color:#18689a;stop-opacity:1;" + offset="0" + id="stop5936" /> + <stop + style="stop-color:#3ba1e1;stop-opacity:1;" + offset="1" + id="stop5938" /> + </linearGradient> + <linearGradient + id="linearGradient2870"> + <stop + id="stop2872" + offset="0" + style="stop-color:#e2e2e2;stop-opacity:1;" /> + <stop + id="stop2874" + offset="1" + style="stop-color:#212121;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient2886"> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="0" + id="stop2888" /> + <stop + id="stop3000" + offset="0.69" + style="stop-color:#c0c0c0;stop-opacity:1;" /> + <stop + style="stop-color:#d8d8d8;stop-opacity:1;" + offset="1" + id="stop2890" /> + </linearGradient> + <linearGradient + id="linearGradient2948" + inkscape:collect="always"> + <stop + id="stop2950" + offset="0" + style="stop-color:#000000;stop-opacity:1;" /> + <stop + id="stop2952" + offset="1" + style="stop-color:#000000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient3091" + inkscape:collect="always"> + <stop + id="stop3093" + offset="0" + style="stop-color:#fefefe;stop-opacity:1;" /> + <stop + id="stop3095" + offset="1" + style="stop-color:#fefefe;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient3137"> + <stop + id="stop3139" + offset="0" + style="stop-color:#fefefe;stop-opacity:1;" /> + <stop + id="stop3141" + offset="1" + style="stop-color:#a2a2a2;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient3794" + inkscape:collect="always"> + <stop + id="stop3796" + offset="0" + style="stop-color:#000000;stop-opacity:1;" /> + <stop + id="stop3798" + offset="1" + style="stop-color:#000000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient4162"> + <stop + id="stop4164" + offset="0" + style="stop-color:#000000;stop-opacity:0.28;" /> + <stop + id="stop4166" + offset="1" + style="stop-color:#000000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient4534" + inkscape:collect="always"> + <stop + id="stop4536" + offset="0" + style="stop-color:#ffffff;stop-opacity:1;" /> + <stop + id="stop4538" + offset="1" + style="stop-color:#ffffff;stop-opacity:0;" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4162" + id="linearGradient2814" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0833333,0,0,1.2956349,1053.8042,-153.14233)" + x1="-2180.8767" + y1="-260.6424" + x2="-1234.0055" + y2="686.2287" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3091" + id="linearGradient2816" + gradientUnits="userSpaceOnUse" + x1="-3230.7649" + y1="515.37079" + x2="-2050.8284" + y2="1340.8041" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2818" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,5.4112362e-7,-2.012705e-7,0.3719492,6.6810889e-5,208.48054)" + cx="-1732.9094" + cy="331.94702" + fx="-1732.9094" + fy="331.94702" + r="143.2121" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3137" + id="linearGradient2820" + gradientUnits="userSpaceOnUse" + x1="-1893.7939" + y1="331.26584" + x2="-1876.7727" + y2="350.78738" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3091" + id="linearGradient2822" + gradientUnits="userSpaceOnUse" + x1="-1898.5033" + y1="890.18469" + x2="-4511.1455" + y2="924.16333" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2824" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.5862344,0,152.49099)" + spreadMethod="reflect" + cx="-1629.0024" + cy="98.046616" + fx="-1629.0024" + fy="98.046616" + r="341.55664" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2826" + gradientUnits="userSpaceOnUse" + x1="-2255.8958" + y1="169.81215" + x2="-2255.8958" + y2="323.11444" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2828" + gradientUnits="userSpaceOnUse" + x1="-2255.8958" + y1="169.81215" + x2="-2255.8958" + y2="428.47058" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2830" + gradientUnits="userSpaceOnUse" + x1="-2266.7681" + y1="568.77667" + x2="-2266.7681" + y2="-39.337055" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2832" + gradientUnits="userSpaceOnUse" + x1="-2266.7681" + y1="568.77667" + x2="-2266.7681" + y2="-39.337055" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2834" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,2.6562553e-7,-2.2224032e-6,8.3666767,7.0294537e-4,-2330.077)" + cx="-1915.2924" + cy="316.29968" + fx="-1915.2924" + fy="316.29968" + r="43.099361" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3794" + id="linearGradient2836" + gradientUnits="userSpaceOnUse" + x1="-2282.2617" + y1="275.5253" + x2="-2305.0696" + y2="344.25839" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3794" + id="linearGradient2838" + gradientUnits="userSpaceOnUse" + x1="-2325.3611" + y1="122.62138" + x2="-2309.3169" + y2="723.96979" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2840" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,5.4112362e-7,-2.012705e-7,0.3719492,6.6810889e-5,208.48054)" + cx="-1732.9094" + cy="331.94702" + fx="-1732.9094" + fy="331.94702" + r="143.2121" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3137" + id="linearGradient2842" + gradientUnits="userSpaceOnUse" + x1="-1893.7939" + y1="331.26584" + x2="-1876.7727" + y2="350.78738" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2844" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,0.5862344,-2188.8406,152.49099)" + spreadMethod="reflect" + cx="-1629.0024" + cy="98.046616" + fx="-1629.0024" + fy="98.046616" + r="341.55664" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2846" + gradientUnits="userSpaceOnUse" + x1="-2255.8958" + y1="169.81215" + x2="-2255.8958" + y2="323.11444" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2848" + gradientUnits="userSpaceOnUse" + x1="-2255.8958" + y1="169.81215" + x2="-2255.8958" + y2="428.47058" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2850" + gradientUnits="userSpaceOnUse" + x1="-2266.7681" + y1="568.77667" + x2="-2266.7681" + y2="-39.337055" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2948" + id="linearGradient2852" + gradientUnits="userSpaceOnUse" + x1="-2266.7681" + y1="568.77667" + x2="-2266.7681" + y2="-39.337055" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2886" + id="radialGradient2854" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,2.6562553e-7,2.2224032e-6,8.3666767,-2188.8413,-2330.077)" + cx="-1915.2924" + cy="316.29968" + fx="-1915.2924" + fy="316.29968" + r="43.099361" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3794" + id="linearGradient2856" + gradientUnits="userSpaceOnUse" + x1="-2282.2617" + y1="275.5253" + x2="-2305.0696" + y2="344.25839" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3794" + id="linearGradient2858" + gradientUnits="userSpaceOnUse" + x1="-2325.3611" + y1="122.62138" + x2="-2309.3169" + y2="723.96979" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient3137" + id="radialGradient2860" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,3.781366e-7,-3.2292777e-7,0.8539977,8.9288564e-5,37.369658)" + cx="-1092.8789" + cy="276.49725" + fx="-1092.8789" + fy="276.49725" + r="127.73754" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient2870" + id="radialGradient2862" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.7746364,0.4472365,-0.4660621,0.8072432,-144.92805,587.20425)" + cx="-1093.5826" + cy="217.83733" + fx="-1093.5826" + fy="217.83733" + r="123.63598" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4162" + id="linearGradient2864" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.7247709,2807.0235,194.64859)" + x1="-3887.8772" + y1="877.09351" + x2="-3887.8772" + y2="63.463501" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4162" + id="linearGradient2866" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.7247709,2807.0235,194.64859)" + x1="-3887.8772" + y1="746.12317" + x2="-3887.8772" + y2="587.34491" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4534" + id="linearGradient2868" + gradientUnits="userSpaceOnUse" + x1="-2180.8767" + y1="-260.6424" + x2="-1234.0055" + y2="686.2287" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4534" + id="linearGradient2871" + gradientUnits="userSpaceOnUse" + x1="-2160.2458" + y1="-240.01169" + x2="-1234.0055" + y2="686.2287" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4162" + id="linearGradient2873" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0833333,0,0,1.2956349,149.4705,-161.14233)" + x1="-2180.8767" + y1="-260.6424" + x2="-1234.0055" + y2="686.2287" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="2.4960938" + inkscape:cx="8" + inkscape:cy="8" + inkscape:document-units="px" + inkscape:current-layer="layer1" + width="16px" + height="16px" + showgrid="false" + showborder="false" + inkscape:grid-points="true" + inkscape:window-width="748" + inkscape:window-height="774" + inkscape:window-x="0" + inkscape:window-y="58" + inkscape:showpageshadow="false"> + <inkscape:grid + id="GridFromPre046Settings" + type="xygrid" + originx="0px" + originy="0px" + spacingx="1px" + spacingy="1px" + color="#0000ff" + empcolor="#0000ff" + opacity="0.2" + empopacity="0.4" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <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 + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <g + style="display:inline" + id="g5868" + transform="matrix(0.173669,0,0,0.174326,-72.419415,-92.051412)"> + <path + transform="matrix(0.9959566,0,0,1.2202117,1.6861043,-136.53125)" + d="M 602,544.5 A 92.5,75.5 0 1 1 417,544.5 A 92.5,75.5 0 1 1 602,544.5 z" + sodipodi:ry="75.5" + sodipodi:rx="92.5" + sodipodi:cy="544.5" + sodipodi:cx="509.5" + id="path4987" + style="fill:#00252b;fill-opacity:1;fill-rule:evenodd" + sodipodi:type="arc" /> + <path + transform="matrix(0.9200853,0,0,1.1406537,-168.51683,-66.406557)" + d="M 827,521 A 90.5,73 0 1 1 646,521 A 90.5,73 0 1 1 827,521 z" + sodipodi:ry="73" + sodipodi:rx="90.5" + sodipodi:cy="521" + sodipodi:cx="736.5" + id="path4989" + style="opacity:0.83064515;fill:url(#radialGradient5297);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient5299);stroke-width:2.92839932;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" /> + </g> + <path + style="opacity:1;fill:#006f82;fill-opacity:0;fill-rule:evenodd;stroke:#006f82;stroke-width:0.28191236;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" + d="M 2.6069946,0.54910198 L 2.6055771,-0.099666752 L 2.8164858,0.95425507 L 2.8141804,-0.099991964 L 3.1640995,0.9266844 L 3.1614423,-0.28975618 L 3.4429478,1.2506338 L 3.5073405,-1.1012556 L 3.72239,1.8449054 L 4.0622041,-1.7508906 L 4.1411304,2.5470893 L 4.4118271,-0.85937424 L 4.625631,1.5191149 L 4.7599147,-0.67069203 L 4.9741304,1.8970225 L 5.1048093,-1.9417329 L 5.5330088,3.0855654 L 5.3800527,-3.2667341 L 6.1615382,4.3280635 L 5.9364518,-3.2135349 L 6.5790389,4.4625735 L 6.2835316,-3.4843962 L 6.7141524,2.6512146 L 6.8446533,-1.2686398 L 7.0617062,2.5966102 L 7.3293879,-2.1884838 L 7.3382512,1.8663126 L 7.6747002,-3.2703033 L 7.6184571,2.8120031 L 7.9542564,-2.6219686 L 8.1085081,4.3250342 L 8.5077563,-3.8933365 L 8.5967296,5.0000787 L 8.9229558,-4.8130735 L 9.0847112,5.5669907 L 9.338687,-5.4895219 L 9.5028098,5.9718155 L 9.685593,-5.8414779 L 10.060561,6.6467546 L 10.036104,-4.5444835 L 10.336396,5.5920776 L 10.45609,-3.2746295 L 10.681472,4.4021287 L 10.806596,-1.9776351 L 11.166795,3.7526023 L 11.224395,-1.707965 L 11.444757,3.6710755 L 11.642254,-1.4112613 L 11.930022,2.9945221 L 11.781738,-1.222254 L 12.346758,2.777615 L 12.200187,-0.65522999 L 12.621295,1.1282304 L 12.726505,-7.1420034 L 13.107918,1.0734102 L 13.151581,-8.3581575 L 13.386175,1.1270414 L 13.779937,-7.1953276 L 13.824553,5.9976764 L 14.19602,-7.7102185 L 14.371253,6.4287067 L 14.488228,-8.4961904 L 14.990198,8.1010368 L 14.899761,-8.6860537 L 15.40361,8.7716012 L 15.439011,-9.2556758 L 15.768486,9.4188537 L 15.727256,-9.4461407 L 16.181738,10.015608 L 16.144465,-9.4467907 L 16.814173,10.636994 L 16.853223,-3.3116119 L 17.106022,9.6883621 L 17.063895,-2.3658164 L 17.712155,10.312643 L 17.412337,-2.0149402 L 17.679509,10.338299 L 17.257021,-9.4485207 L 18.352565,9.7676773 L 17.53587,-9.1245694 L 18.704673,9.3877306 L 18.18338,-8.827906 L 19.324689,9.1430032 L 19.205411,-8.8027822 C 19.205411,-8.8027822 19.664499,10.362247 19.803275,10.226868 C 19.942045,10.091493 20.109774,-8.614964 20.109774,-8.614964 L 20.148701,9.1961009 L 20.458454,-8.1559615 L 20.501159,8.9788209 L 20.80648,-7.9943089 L 20.848069,8.6286114 L 21.295173,-7.1030104 L 21.39787,8.0724425 L 21.852572,-6.5902698 L 21.886678,6.6078305 L 22.212483,-5.8059473 L 22.504428,2.9197299 L 22.7703,-5.1030285 L 22.990522,2.6208277 L 23.531987,-4.1572975 L 23.824944,5.0285534 L 23.956542,-3.2072384 L 24.321023,4.485083 L 24.433579,-2.8322256 L 24.805704,3.5383642 L 24.931729,-2.4278376 L 25.483376,2.6738694 L 25.425746,-1.5091968 L 25.917074,2.9964681 L 25.982971,-1.0772321 L 26.723408,2.1864728 L 26.748315,-0.86375092 L 27.305164,2.322313 L 27.326534,-0.45933052 L 27.794625,1.1558416 L 27.901769,-1.4107869 L 28.100138,1.643531 L 28.284214,0.05104591 C 28.284214,0.05104591 28.580257,1.0188261 28.579961,0.88366608 C 28.579663,0.74850806 28.985357,0.29229348 28.915281,0.049112065 C 28.845218,-0.1940655 29.210562,0.66832968 29.210562,0.66832968" + id="path4922" + sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccscccccccccccccccccccccccccccccccccccc" /> + <path + style="opacity:0.07000002;fill:url(#linearGradient5308);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:12.29699993;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" + d="M 15.685059,-14.171613 C 8.1008684,-13.978526 2.0086222,-7.7375854 2.0086222,-0.078445316 C 2.0086222,2.2206366 2.5597288,4.3882408 3.5336546,6.3062426 C 3.2949782,5.2768126 3.1700337,4.205026 3.1700337,3.1030039 C 3.1700337,-4.6777095 9.458699,-10.995611 17.21009,-10.995611 C 22.670274,-10.995611 27.40266,-7.8590901 29.725114,-3.2871341 C 28.27676,-9.5232827 22.700358,-14.171613 16.048678,-14.171613 C 15.927562,-14.171613 15.805442,-14.174678 15.685059,-14.171613 z" + id="path4679" /> + <path + id="path3760" + d="M 23.691842,9.2006092 C 23.598484,9.4475433 22.631394,10.365494 22.180179,10.635462 L 21.681377,10.933903 L 19.629076,8.2492422 L 17.576776,5.5645855 L 17.930036,5.1970172 C 18.275752,4.8372965 19.313091,4.1385288 19.650303,4.0382177 C 19.796709,3.9946677 20.09174,4.342695 21.774869,6.5444334 C 22.849871,7.9506633 23.71251,9.1459453 23.691842,9.2006092 z M 13.419661,-4.1930503 C 13.342524,-3.9890191 12.122128,-2.9446885 11.724398,-2.7423592 L 11.363046,-2.5585401 L 9.3403065,-5.2522454 L 7.3175634,-7.9459547 L 8.0140105,-8.5225982 C 8.3970575,-8.8397544 8.8993669,-9.1775161 9.1302536,-9.2731827 L 9.5500496,-9.4471218 L 11.509157,-6.8843692 C 12.822708,-5.1660854 13.452253,-4.2792527 13.419661,-4.1930503 z M 21.318362,11.183854 C 21.305384,11.218124 21.079254,11.355997 20.815851,11.49024 C 18.745871,12.545229 15.418963,11.303354 12.286903,8.3065443 C 11.178311,7.245823 8.8914692,4.4043332 7.9880622,2.9650658 C 6.2446713,0.18757893 5.4248053,-2.1442783 5.44897,-4.2565999 C 5.4640515,-5.5748644 5.8950782,-6.6871677 6.6679963,-7.4024174 L 6.9330208,-7.6476703 L 8.9660248,-5.0279638 L 10.999033,-2.4082574 L 10.834604,-2.1223744 C 10.607486,-1.7275008 10.648568,-1.2096042 10.969518,-0.42161547 C 11.372323,0.5673418 14.568096,4.7456921 15.425468,5.4043706 C 16.099223,5.9219821 16.513712,6.0730931 17.011879,5.9827268 L 17.364643,5.9187361 L 19.3533,8.5201446 C 20.447064,9.9509184 21.331342,11.149586 21.318362,11.183854 z" + style="opacity:0.32000002;fill:#000000;fill-opacity:1;display:inline" /> + <path + style="fill:#dfdfdf;fill-opacity:1;display:inline" + d="M 24.663582,8.2251927 C 24.570224,8.4721247 23.603134,9.390077 23.15192,9.6600453 L 22.653118,9.9584864 L 20.600817,7.2738257 L 18.548516,4.589169 L 18.901776,4.2216007 C 19.247492,3.8618796 20.284832,3.1631133 20.622045,3.0628036 C 20.768451,3.0192502 21.06348,3.3672797 22.746609,5.5690169 C 23.821611,6.9752489 24.68425,8.1705288 24.663582,8.2251927 z M 14.391401,-5.1684676 C 14.314264,-4.9644364 13.093866,-3.9201038 12.696138,-3.7177744 L 12.334786,-3.5339554 L 10.312045,-6.2276625 L 8.2893038,-8.92137 L 8.9857509,-9.4980155 C 9.368798,-9.8151695 9.8711073,-10.152931 10.101994,-10.2486 L 10.52179,-10.422539 L 12.480899,-7.8597847 C 13.794448,-6.1415027 14.423991,-5.254668 14.391401,-5.1684676 z M 22.290102,10.208438 C 22.277124,10.242707 22.050994,10.380579 21.787591,10.514826 C 19.717611,11.569813 16.390703,10.327935 13.258643,7.3311278 C 12.150052,6.2704065 9.8632076,3.4289175 8.9598007,1.9896506 C 7.2164098,-0.78783838 6.3965457,-3.1196934 6.4207105,-5.232015 C 6.4357919,-6.5502815 6.8668187,-7.6625832 7.6397367,-8.3778347 L 7.9047612,-8.6230856 L 9.9377653,-6.003379 L 11.970774,-3.3836725 L 11.806345,-3.0977895 C 11.579227,-2.7029182 11.620308,-2.1850215 11.941258,-1.3970328 C 12.344063,-0.40807349 15.539837,3.7702768 16.39721,4.4289541 C 17.070963,4.9465676 17.485453,5.0976766 17.983619,5.0073103 L 18.336384,4.9433196 L 20.325041,7.5447281 C 21.418804,8.9755039 22.303082,10.17417 22.290102,10.208438 z" + id="path3218" /> + <g + transform="matrix(0.1619567,0,0,0.1625693,-28.880339,-84.45656)" + id="g3787" + style="fill:#ffffff;fill-opacity:0;display:inline"> + <path + id="path3789" + d="M 324.6064,576.10592 C 324.02996,577.62486 318.05867,583.27138 315.27265,584.93202 L 312.1928,586.7678 L 299.5209,570.25386 L 286.84899,553.73994 L 289.03019,551.47895 C 291.16481,549.26622 297.56985,544.96795 299.65197,544.35092 C 300.55595,544.08302 302.37761,546.22382 312.77007,559.7672 C 319.40765,568.41724 324.73401,575.76967 324.6064,576.10592 z M 261.18093,493.71856 C 260.70464,494.9736 253.16932,501.39752 250.71354,502.64209 L 248.48238,503.7728 L 235.99299,487.20322 L 223.50359,470.63363 L 227.80379,467.08656 C 230.16891,465.13567 233.27042,463.05802 234.69603,462.46955 L 237.28805,461.39961 L 249.38455,477.16367 C 257.49505,487.73321 261.38216,493.18832 261.18093,493.71856 z M 309.95137,588.3053 C 309.87124,588.51609 308.475,589.36418 306.84862,590.18996 C 294.06756,596.67941 273.5256,589.04036 254.18672,570.60633 C 247.34174,564.0816 233.22165,546.60297 227.64357,537.74972 C 216.87902,520.66478 211.81677,506.32102 211.96598,493.32766 C 212.0591,485.21872 214.72047,478.3767 219.49284,473.97704 L 221.12923,472.46844 L 233.682,488.58283 L 246.23478,504.69722 L 245.21952,506.45575 C 243.81718,508.8847 244.07084,512.0704 246.05254,516.91749 C 248.53966,523.00079 268.27193,548.70275 273.56577,552.75442 C 277.72586,555.93837 280.28512,556.86788 283.36104,556.31202 L 285.53918,555.9184 L 297.81812,571.92023 C 304.57154,580.72124 310.03151,588.09451 309.95137,588.3053 z" + style="opacity:0.32000002;fill:#ffffff;fill-opacity:0" /> + <path + style="fill:#ffffff;fill-opacity:0" + d="M 330.6064,570.10592 C 330.02996,571.62486 324.05867,577.27138 321.27265,578.93202 L 318.1928,580.7678 L 305.5209,564.25386 L 292.84899,547.73994 L 295.03019,545.47895 C 297.16481,543.26622 303.56985,538.96795 305.65197,538.35092 C 306.55595,538.08302 308.37761,540.22382 318.77007,553.7672 C 325.40765,562.41724 330.73401,569.76967 330.6064,570.10592 z M 267.18093,487.71856 C 266.70464,488.9736 259.16932,495.39752 256.71354,496.64209 L 254.48238,497.7728 L 241.99299,481.20322 L 229.50359,464.63363 L 233.80379,461.08656 C 236.16891,459.13567 239.27042,457.05802 240.69603,456.46955 L 243.28805,455.39961 L 255.38455,471.16367 C 263.49505,481.73321 267.38216,487.18832 267.18093,487.71856 z M 315.95137,582.3053 C 315.87124,582.51609 314.475,583.36418 312.84862,584.18996 C 300.06756,590.67941 279.5256,583.04036 260.18672,564.60633 C 253.34174,558.0816 239.22165,540.60297 233.64357,531.74972 C 222.87902,514.66478 217.81677,500.32102 217.96598,487.32766 C 218.0591,479.21872 220.72047,472.3767 225.49284,467.97704 L 227.12923,466.46844 L 239.682,482.58283 L 252.23478,498.69722 L 251.21952,500.45575 C 249.81718,502.8847 250.07084,506.0704 252.05254,510.91749 C 254.53966,517.00079 274.27193,542.70275 279.56577,546.75442 C 283.72586,549.93837 286.28512,550.86788 289.36104,550.31202 L 291.53918,549.9184 L 303.81812,565.92023 C 310.57154,574.72124 316.03151,582.09451 315.95137,582.3053 z" + id="path3791" /> + </g> + <path + style="fill:url(#linearGradient3809);fill-opacity:1;stroke:none;display:inline" + d="M 10.521198,-10.425737 L 10.098451,-10.247512 C 9.8675644,-10.151843 9.365445,-9.8178162 8.9823979,-9.5006622 L 8.2890919,-8.9235502 L 10.309825,-6.224705 L 11.383604,-4.7989016 C 11.832076,-5.6704481 12.373307,-6.4725964 12.981588,-7.2007037 C 12.819168,-7.4158626 12.674145,-7.6123132 12.482746,-7.8626837 L 10.521198,-10.425737 z M 7.9086201,-8.6265075 L 7.6380613,-8.3803866 C 6.8651432,-7.6651369 6.4356299,-6.5499989 6.4205485,-5.2317344 C 6.3963837,-3.1194127 7.2136425,-0.78684309 8.9570336,1.9906438 C 9.1957939,2.3710265 9.5361637,2.8480184 9.9208964,3.3655274 C 9.8637975,2.8392407 9.8278923,2.3051816 9.8278923,1.761497 C 9.8278923,-0.46148867 10.314124,-2.5591336 11.180684,-4.3915277 L 9.9378073,-6.0040451 L 7.9086201,-8.6265075 z" + id="path3798" /> + </g> +</svg> diff --git a/sflphone-client-kde/data/sflphone-client-kdeui.rc b/sflphone-client-kde/data/sflphone-client-kdeui.rc index ac092044e6ee36bc6e3034fc4ea95fb08f319b71..a9111dba1061b649b2f2ba81eed118ba4deef20a 100644 --- a/sflphone-client-kde/data/sflphone-client-kdeui.rc +++ b/sflphone-client-kde/data/sflphone-client-kdeui.rc @@ -32,8 +32,8 @@ <Action name="action_displayVolumeControls" /> <Action name="action_displayDialpad" /> <Separator /> - <Action name="action_configureAccounts" /> - <Action name="action_configureAudio" /> +<!-- <Action name="action_configureAccounts" /> --> +<!-- <Action name="action_configureAudio" /> --> <Action name="action_configureSflPhone" /> <Separator /> <Action name="action_accountCreationWizard" /> diff --git a/sflphone-client-kde/po/update.sh b/sflphone-client-kde/po/update.sh index 4c0188296d9194b1343e761e27b9e63f5cdb9ead..3fe757660a4535a2639e9a29ef876d5e5c3a91c4 100755 --- a/sflphone-client-kde/po/update.sh +++ b/sflphone-client-kde/po/update.sh @@ -1,4 +1,4 @@ -xgettext --c++ --kde -ktr2i18n -kki18nc:2c,1 -kki18n -o sflphone-client-kde.pot ../src/*.cpp ../src/*.h ../build/src/*.h ../build/src/*.cpp +xgettext --from-code=utf-8 --c++ --kde -ktr2i18n -kki18nc:1c,2 -kki18n -ki18n -ki18nc:1c,2 -o sflphone-client-kde.pot ../src/*.cpp ../src/*.h ../src/conf/*.h ../src/conf/*.cpp ../build/src/*.h ../build/src/*.cpp for fichier in `find . -name *.po ` do diff --git a/sflphone-client-kde/src/Account.cpp b/sflphone-client-kde/src/Account.cpp index 927c94fffa851c770cac13c736420608e2580f79..e4cbead64c0b1c1c68c0b23bfaacdca60de756b1 100644 --- a/sflphone-client-kde/src/Account.cpp +++ b/sflphone-client-kde/src/Account.cpp @@ -22,6 +22,7 @@ #include "Account.h" #include <QtGui/QApplication> +#include <klocale.h> #include "sflphone_const.h" #include "configurationmanager_interface_singleton.h" @@ -30,24 +31,24 @@ const QString account_state_name(QString & s) { if(s == QString(ACCOUNT_STATE_REGISTERED)) - return QApplication::translate("ConfigurationDialog", "Registered", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Registered" ); if(s == QString(ACCOUNT_STATE_UNREGISTERED)) - return QApplication::translate("ConfigurationDialog", "Not Registered", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Not Registered"); if(s == QString(ACCOUNT_STATE_TRYING)) - return QApplication::translate("ConfigurationDialog", "Trying...", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Trying..."); if(s == QString(ACCOUNT_STATE_ERROR)) - return QApplication::translate("ConfigurationDialog", "Error", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Error"); if(s == QString(ACCOUNT_STATE_ERROR_AUTH)) - return QApplication::translate("ConfigurationDialog", "Bad authentification", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Bad authentification"); if(s == QString(ACCOUNT_STATE_ERROR_NETWORK)) - return QApplication::translate("ConfigurationDialog", "Network unreachable", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Network unreachable"); if(s == QString(ACCOUNT_STATE_ERROR_HOST)) - return QApplication::translate("ConfigurationDialog", "Host unreachable", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Host unreachable"); if(s == QString(ACCOUNT_STATE_ERROR_CONF_STUN)) - return QApplication::translate("ConfigurationDialog", "Stun configuration error", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Stun configuration error"); if(s == QString(ACCOUNT_STATE_ERROR_EXIST_STUN)) - return QApplication::translate("ConfigurationDialog", "Stun server invalid", 0, QApplication::UnicodeUTF8); - return QApplication::translate("ConfigurationDialog", "Invalid", 0, QApplication::UnicodeUTF8); + return i18nc("account state", "Stun server invalid"); + return i18nc("account state", "Invalid"); } //Constructors diff --git a/sflphone-client-kde/src/AccountList.cpp b/sflphone-client-kde/src/AccountList.cpp index f40b7d8ad12ec9ba72448291637c4e4ef9ef8597..d940b6fef495683d8b835cb2477c8598ff2482f5 100644 --- a/sflphone-client-kde/src/AccountList.cpp +++ b/sflphone-client-kde/src/AccountList.cpp @@ -24,7 +24,6 @@ #include "configurationmanager_interface_singleton.h" -QString AccountList::firstAccount = QString(); //Constructors @@ -39,6 +38,7 @@ AccountList::AccountList(QStringList & _accountIds) AccountList::AccountList() { + qDebug() << "AccountList()"; // firstAccount = QString(); ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); //ask for the list of accounts ids to the configurationManager @@ -65,6 +65,18 @@ void AccountList::update() } } +void AccountList::updateAccounts() +{ + qDebug() << "updateAccounts"; + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + QStringList accountIds = configurationManager.getAccountList().value(); + accounts = new QVector<Account *>(); + for (int i = 0; i < accountIds.size(); ++i){ + (*accounts) += Account::buildExistingAccountFromId(accountIds[i]); + } + emit accountListUpdated(); +} + void AccountList::upAccount(int index) { if(index <= 0 || index >= size()) @@ -118,11 +130,6 @@ QVector<Account *> AccountList::registeredAccounts() const Account * AccountList::firstRegisteredAccount() const { - Account * first = getAccountById(firstAccount); - if(first && (first->getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)) - { - return first; - } Account * current; for (int i = 0; i < accounts->count(); ++i){ current = (*accounts)[i]; @@ -134,10 +141,6 @@ Account * AccountList::firstRegisteredAccount() const return NULL; } -void AccountList::setAccountFirst(Account * account) -{ - firstAccount = account->getAccountId(); -} AccountList::~AccountList() { @@ -162,6 +165,8 @@ Account & AccountList::getAccount (int i) Account * AccountList::getAccountById(const QString & id) const { + if(id.isEmpty()) + { return NULL; } for (int i = 0; i < accounts->size(); ++i) { if (!(*accounts)[i]->isNew() && (*accounts)[i]->getAccountId() == id) @@ -181,12 +186,8 @@ QVector<Account *> AccountList::getAccountByState(QString & state) } return v; } -/* -Account AccountList::getAccountByRow(int row) -{ - -} -*/ + + Account * AccountList::getAccountByItem(QListWidgetItem * item) { for (int i = 0; i < accounts->size(); ++i){ @@ -202,12 +203,6 @@ int AccountList::size() } //Setters -/* -void AccountList::addAccount(Account & account) -{ - accounts->add(account); -} -*/ Account * AccountList::addAccount(QString & alias) { Account * a = Account::buildNewAccountFromAlias(alias); diff --git a/sflphone-client-kde/src/AccountList.h b/sflphone-client-kde/src/AccountList.h index e7250b39e32942f1d685c8043c5844e0095af787..8d195f26860ba0571387d3d74fd395075e989e25 100644 --- a/sflphone-client-kde/src/AccountList.h +++ b/sflphone-client-kde/src/AccountList.h @@ -27,12 +27,13 @@ #include "Account.h" -class AccountList{ +class AccountList : public QObject{ + + Q_OBJECT private: QVector<Account *> * accounts; - static QString firstAccount; public: @@ -56,7 +57,6 @@ public: Account * addAccount(QString & alias); void removeAccount(Account * account); void removeAccount(QListWidgetItem * item); - void setAccountFirst(Account * account); void upAccount(int index); void downAccount(int index); @@ -64,7 +64,19 @@ public: Account & operator[] (int i); const Account & operator[] (int i) const; QVector<Account *> registeredAccounts() const; + +public slots: + /** + * updates the list of accounts (removed, added, order...) with the configurationManager's list + */ void update(); + /** + * updates the list and the details of accounts with the configurationManager's list + */ + void updateAccounts(); + +signals: + void accountListUpdated(); }; diff --git a/sflphone-client-kde/src/AccountWizard.cpp b/sflphone-client-kde/src/AccountWizard.cpp index 1ca56329662187c27637d477bb4bbd813fea162d..ad55bc97dff472c0f7638209e76b9a0a77866fcf 100644 --- a/sflphone-client-kde/src/AccountWizard.cpp +++ b/sflphone-client-kde/src/AccountWizard.cpp @@ -3,12 +3,12 @@ * Author : Jérémy Quentin * * jeremy.quentin@savoirfairelinux.com * * * - * This program is free software; you can redistr2i18nibute it and/or modify * + * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * - * This program is distr2i18nibuted in the hope that it will be useful, * + * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * @@ -158,7 +158,7 @@ AccountWizard::AccountWizard(QWidget * parent) setPage(Page_Conclusion, new WizardAccountConclusionPage); setStartId(Page_Intro); - setWindowTitle(tr2i18n("Account Creation Wizard")); + setWindowTitle(i18n("Account Creation Wizard")); setWindowIcon(QIcon(ICON_SFLPHONE)); setMinimumHeight(350); // setPixmap(QWizard::LogoPixmap, QPixmap(ICON_SFLPHONE)); @@ -197,7 +197,7 @@ void AccountWizard::accept() rest_account acc = get_rest_account(SFL_ACCOUNT_HOST, charEmailAddress); if(acc.success) { - ret += tr2i18n("Creation of account succeed with these parameters") + " :\n"; + ret += i18n("Creation of account succeed with these parameters") + " :\n"; alias = QString(acc.user) + "@" + SFL_ACCOUNT_HOST; server = QString(SFL_ACCOUNT_HOST); user = QString(acc.user); @@ -208,13 +208,13 @@ void AccountWizard::accept() } else { - ret += tr2i18n("Creation of account has failed for the reason") + " :\n"; + ret += i18n("Creation of account has failed for the reason") + " :\n"; ret += acc.reason; } } else { - ret += tr2i18n("Register of account succeed with these parameters") + " :\n"; + ret += i18n("Register of account succeed with these parameters") + " :\n"; bool SIPAccount = field(FIELD_SIP_ACCOUNT).toBool(); if(SIPAccount) { @@ -250,12 +250,12 @@ void AccountWizard::accept() if(enableStun != configurationManager.isStunEnabled()) configurationManager.enableStun(); if(enableStun) configurationManager.setStunServer(stunServer); } - ret += tr2i18n("Alias") + " : " + alias + "\n"; - ret += tr2i18n("Server") + " : " + server + "\n"; - ret += tr2i18n("User") + " : " + user + "\n"; - ret += tr2i18n("Password") + " : " + password + "\n"; - ret += tr2i18n("Protocol") + " : " + protocol + "\n"; - ret += tr2i18n("Mailbox") + " : " + mailbox + "\n"; + ret += i18n("Alias") + " : " + alias + "\n"; + ret += i18n("Server") + " : " + server + "\n"; + ret += i18n("User") + " : " + user + "\n"; + ret += i18n("Password") + " : " + password + "\n"; + ret += i18n("Protocol") + " : " + protocol + "\n"; + ret += i18n("Mailbox") + " : " + mailbox + "\n"; } qDebug() << ret; QDialog::accept(); @@ -266,16 +266,16 @@ void AccountWizard::accept() /*************************************************************************** * Class WizardIntroPage * - * Widget of the intr2i18noduction page of the wizard * + * Widget of the introduction page of the wizard * ***************************************************************************/ WizardIntroPage::WizardIntroPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Account Creation Wizard")); - setSubTitle(tr2i18n("Welcome to the Account creation wizard of SFLPhone")); + setTitle(i18n("Account Creation Wizard")); + setSubTitle(i18n("Welcome to the Account creation wizard of SFLPhone")); - introLabel = new QLabel(tr2i18n("This wizard will help you setting up an account.")); + introLabel = new QLabel(i18n("This wizard will help you setting up an account.")); introLabel->setWordWrap(true); QVBoxLayout *layout = new QVBoxLayout; @@ -303,11 +303,11 @@ int WizardIntroPage::nextId() const WizardAccountAutoManualPage::WizardAccountAutoManualPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Accounts")); - setSubTitle(tr2i18n("Please choose between those options :")); + setTitle(i18n("Accounts")); + setSubTitle(i18n("Please choose between those options :")); - radioButton_SFL = new QRadioButton(tr2i18n("Create a free SIP/IAX2 account on sflphone.org")); - radioButton_manual = new QRadioButton(tr2i18n("Register an existing SIP/IAX2 account")); + radioButton_SFL = new QRadioButton(i18n("Create a free SIP/IAX2 account on sflphone.org")); + radioButton_manual = new QRadioButton(i18n("Register an existing SIP/IAX2 account")); radioButton_SFL->setChecked(true); registerField(FIELD_SFL_ACCOUNT, radioButton_SFL); @@ -346,11 +346,11 @@ int WizardAccountAutoManualPage::nextId() const WizardAccountTypePage::WizardAccountTypePage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("VoIP Protocols")); - setSubTitle(tr2i18n("Choose the account type") + " :"); + setTitle(i18n("VoIP Protocols")); + setSubTitle(i18n("Choose the account type") + " :"); - radioButton_SIP = new QRadioButton(tr2i18n("Register a SIP (Session Initiation Protocol) account")); - radioButton_IAX = new QRadioButton(tr2i18n("Register a IAX2 (InterAsterisk eXchange) account")); + radioButton_SIP = new QRadioButton(i18n("Register a SIP (Session Initiation Protocol) account")); + radioButton_IAX = new QRadioButton(i18n("Register a IAX2 (InterAsterisk eXchange) account")); radioButton_SIP->setChecked(true); registerField(FIELD_SIP_ACCOUNT, radioButton_SIP); @@ -389,10 +389,10 @@ int WizardAccountTypePage::nextId() const WizardAccountEmailAddressPage::WizardAccountEmailAddressPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Optionnal Email Address")); - setSubTitle(tr2i18n("This email address will be used to send your voicemail messages.")); + setTitle(i18n("Optionnal Email Address")); + setSubTitle(i18n("This email address will be used to send your voicemail messages.")); - label_emailAddress = new QLabel(tr2i18n("Email address")); + label_emailAddress = new QLabel(i18n("Email address")); lineEdit_emailAddress = new QLineEdit(); registerField(FIELD_EMAIL_ADDRESS, lineEdit_emailAddress); @@ -426,18 +426,18 @@ WizardAccountFormPage::WizardAccountFormPage(int type, QWidget *parent) this->type = type; if(type == SIP) { - setTitle(tr2i18n("SIP Account Settings")); + setTitle(i18n("SIP Account Settings")); } else { - setTitle(tr2i18n("IAX2 Account Settings")); + setTitle(i18n("IAX2 Account Settings")); } - setSubTitle(tr2i18n("Please full these settings fields.")); + setSubTitle(i18n("Please full these settings fields.")); - label_alias = new QLabel(tr2i18n("Alias") + " *"); - label_server = new QLabel(tr2i18n("Server") + " *"); - label_user = new QLabel(tr2i18n("User") + " *"); - label_password = new QLabel(tr2i18n("Password") + " *"); + label_alias = new QLabel(i18n("Alias") + " *"); + label_server = new QLabel(i18n("Server") + " *"); + label_user = new QLabel(i18n("User") + " *"); + label_password = new QLabel(i18n("Password") + " *"); lineEdit_alias = new QLineEdit; lineEdit_server = new QLineEdit; @@ -509,11 +509,11 @@ int WizardAccountFormPage::nextId() const WizardAccountStunPage::WizardAccountStunPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Network Address Translation (NAT)")); - setSubTitle(tr2i18n("You should probably enable this option if you're placed under a firewall")); + setTitle(i18n("Network Address Translation (NAT)")); + setSubTitle(i18n("You should probably enable this option if you're placed under a firewall")); - checkBox_enableStun = new QCheckBox(tr2i18n("Enable STUN")); - label_StunServer = new QLabel(tr2i18n("Stun Server")); + checkBox_enableStun = new QCheckBox(i18n("Enable STUN")); + label_StunServer = new QLabel(i18n("Stun Server")); lineEdit_StunServer = new QLineEdit(); registerField(FIELD_ENABLE_STUN, checkBox_enableStun); @@ -547,8 +547,8 @@ int WizardAccountStunPage::nextId() const WizardAccountConclusionPage::WizardAccountConclusionPage(QWidget *parent) : QWizardPage(parent) { - setTitle(tr2i18n("Account Definition Finished")); - setSubTitle(tr2i18n("After checking the settings you chose, click \"Finish\" to create the account.")); + setTitle(i18n("Account Definition Finished")); + setSubTitle(i18n("After checking the settings you chose, click \"Finish\" to create the account.")); QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); diff --git a/sflphone-client-kde/src/CMakeLists.txt b/sflphone-client-kde/src/CMakeLists.txt index 30d13caeb6968c943fcfac956522c2d9c616484a..32540e27410f48052ba8ab62a9999a14b5ae47a6 100644 --- a/sflphone-client-kde/src/CMakeLists.txt +++ b/sflphone-client-kde/src/CMakeLists.txt @@ -1,6 +1,12 @@ -ADD_DEFINITIONS(${KDE4_DEFINITIONS} ${QT_DEFINITIONS} -fexceptions -DDATA_INSTALL_DIR="\\\"${DATA_INSTALL_DIR}\\\"" ) +ADD_DEFINITIONS( + ${KDE4_DEFINITIONS} + ${QT_DEFINITIONS} + -fexceptions + -DDATA_INSTALL_DIR="\\\"${DATA_INSTALL_DIR}\\\"" + -DSHARE_INSTALL_PREFIX="\\\"${SHARE_INSTALL_PREFIX}\\\"" +) # add_definitions ( -DKDE_DEFAULT_DEBUG_AREA=9000 ) @@ -21,11 +27,9 @@ ENDIF(${CMAKE_BUILD_TYPE} MATCHES Release) SET ( KDE4_KABC_LIBS -lkabc ) -SET( - sflphone_client_kde_SRCS +SET( sflphone_client_kde_SRCS sflphone_kdeview.cpp SFLPhone.cpp - ConfigDialog.cpp main.cpp sflphone_const.h Account.cpp @@ -42,7 +46,14 @@ SET( ContactItemWidget.cpp conf/ConfigurationDialog.cpp conf/dlggeneral.cpp + conf/dlgdisplay.cpp + conf/dlgaccounts.cpp + conf/dlgaudio.cpp + conf/dlgrecord.cpp + conf/dlgaddressbook.cpp + conf/dlghooks.cpp conf/ConfigurationSkeleton.cpp + Dialpad.cpp ) @@ -98,11 +109,20 @@ QT4_ADD_DBUS_INTERFACE( # kde4_automoc(${sflphone_client_kde_SRCS}) +SET( config_ui_files + conf/dlggeneralbase.ui + conf/dlgdisplaybase.ui + conf/dlgaccountsbase.ui + conf/dlgaudiobase.ui + conf/dlgrecordbase.ui + conf/dlgaddressbookbase.ui + conf/dlghooksbase.ui +) -KDE4_ADD_UI_FILES(sflphone_client_kde_SRCS ui/sflphone_kdeview_base.ui ui/ConfigDialog.ui conf/dlggeneralbase.ui) +KDE4_ADD_UI_FILES(sflphone_client_kde_SRCS ui/sflphone_kdeview_base.ui ${config_ui_files} ) -KDE4_ADD_KCFG_FILES(sflphone_client_kde_SRCS kcfg/settings.kcfgc) -INSTALL(FILES kcfg/sflphone-client-kde.kcfg DESTINATION ${KCFG_INSTALL_DIR}) +KDE4_ADD_KCFG_FILES(sflphone_client_kde_SRCS conf/kcfg_settings.kcfgc) +INSTALL(FILES conf/sflphone-client-kde.kcfg DESTINATION ${KCFG_INSTALL_DIR}) KDE4_ADD_EXECUTABLE(sflphone-client-kde ${sflphone_client_kde_SRCS} ${QtApp_RCC_SRCS}) diff --git a/sflphone-client-kde/src/Call.cpp b/sflphone-client-kde/src/Call.cpp index 873c4de3f44d100ff4835431d21413d74b13fec1..e5f2e94c1f6cad8eee3ad25a3f2a25f44867b283 100644 --- a/sflphone-client-kde/src/Call.cpp +++ b/sflphone-client-kde/src/Call.cpp @@ -113,7 +113,7 @@ void Call::initCallItem() labelIcon = new QLabel(); qDebug() << "labelIcon : " << labelIcon; labelCallNumber = new QLabel(peerPhoneNumber); - labelTransferPrefix = new QLabel(tr2i18n("Transfer to : ")); + labelTransferPrefix = new QLabel(i18n("Transfer to : ")); labelTransferNumber = new QLabel(); QSpacerItem * horizontalSpacer = new QSpacerItem(16777215, 20, QSizePolicy::Preferred, QSizePolicy::Minimum); @@ -424,13 +424,6 @@ QWidget * Call::getHistoryItemWidget() return historyItemWidget; } -/* -layout->addWidget(labelIcon, 0, 0, 2, 1); - layout->addWidget(labelCallNumber, 0, 1, 1, 2); - layout->addWidget(labelTransferPrefix, 1, 1, 1, 1); - layout->addWidget(labelTransferNumber, 1, 2, 1, 2); - layout->addItem(horizontalSpacer, 0, 3, 1, 3); -*/ call_state Call::getState() const { return currentState; @@ -441,6 +434,11 @@ history_state Call::getHistoryState() const return historyState; } +bool Call::isHistory() const +{ + return (getState() == CALL_STATE_OVER); +} + call_state Call::stateChanged(const QString & newStateName) { call_state previousState = currentState; @@ -575,7 +573,7 @@ void Call::call() if(account.isEmpty()) { qDebug() << "account is empty"; - this->account = sflphone_kdeView::firstAccountId(); + this->account = sflphone_kdeView::firstRegisteredAccount()->getAccountId(); } if(!account.isEmpty()) { diff --git a/sflphone-client-kde/src/Call.h b/sflphone-client-kde/src/Call.h index 65f6aec0d950aae92cfb76f541b6d970f11d0232..143c0cb4ebfa5075e9cedeb6951bffe468a832ef 100644 --- a/sflphone-client-kde/src/Call.h +++ b/sflphone-client-kde/src/Call.h @@ -204,6 +204,7 @@ public: history_state getHistoryState() const; bool getRecording() const; QString getAccountId() const; + bool isHistory() const; //Automate calls call_state stateChanged(const QString & newState); diff --git a/sflphone-client-kde/src/CallList.cpp b/sflphone-client-kde/src/CallList.cpp index 11a13e37195cc192792a30897bf7d1799a57d82f..ca189dee7763918ddb9e57d6b23890d990d74bab 100644 --- a/sflphone-client-kde/src/CallList.cpp +++ b/sflphone-client-kde/src/CallList.cpp @@ -158,4 +158,17 @@ Call * CallList::addRingingCall(const QString & callId) Call * call = Call::buildRingingCall(callId); calls->append(call); return call; -} \ No newline at end of file +} + +void CallList::clearHistory() +{ + qDebug() << "clearHistory"; + Call * call; + QMutableVectorIterator<Call *> i(*calls); + while (i.hasNext()) + { + call = i.next(); + if (call->isHistory()) + { i.remove(); } + } +} diff --git a/sflphone-client-kde/src/CallList.h b/sflphone-client-kde/src/CallList.h index 16e3d89d807d9fc53bb4aa812b5c345ce275d0b3..2ca3dd10b1f0d304b276bbc1db4df9c7acdda67a 100644 --- a/sflphone-client-kde/src/CallList.h +++ b/sflphone-client-kde/src/CallList.h @@ -28,8 +28,10 @@ #include "Call.h" -class CallList +class CallList : public QObject { +Q_OBJECT + private: QVector<Call *> * calls; @@ -58,7 +60,8 @@ public: //GSetter QString getAndIncCallId(); - +public slots: + void clearHistory(); }; diff --git a/sflphone-client-kde/src/ConfigDialog.cpp b/sflphone-client-kde/src/ConfigDialog.cpp deleted file mode 100644 index 349c5dcc40edf2455a762a5d5d9386786b43b19d..0000000000000000000000000000000000000000 --- a/sflphone-client-kde/src/ConfigDialog.cpp +++ /dev/null @@ -1,856 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Savoir-Faire Linux * - * Author : Jérémy Quentin * - * jeremy.quentin@savoirfairelinux.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - #include "ConfigDialog.h" - -#include <QtGui/QStyle> -#include <QErrorMessage> -#include <QtGui/QAbstractItemView> -#include <QtGui/QInputDialog> -#include <QtGui/QHeaderView> - - - -#include "sflphone_const.h" -#include "typedefs.h" -#include "configurationmanager_interface_singleton.h" - - -AccountList * ConfigurationDialog::accountList; - -ConfigurationDialog::ConfigurationDialog(sflphone_kdeView *parent) : QDialog(parent) -{ - //configuration qt designer - setupUi(this); - - //configuration complémentaire - QStyle * style = QApplication::style(); - errorWindow = new QErrorMessage(this); - horizontalSlider_historyCapacity->setMaximum(MAX_HISTORY_CAPACITY); - label_WarningSIP->setVisible(false); - for(int i = 0 ; i < list_options->count() ; i++) - { - list_options->item(i)->setTextAlignment(Qt::AlignHCenter); - } - button_accountUp->setIcon(style->standardIcon(QStyle::SP_ArrowUp)); - button_accountDown->setIcon(style->standardIcon(QStyle::SP_ArrowDown)); - toolButton_codecUp->setIcon(style->standardIcon(QStyle::SP_ArrowUp)); - toolButton_codecDown->setIcon(style->standardIcon(QStyle::SP_ArrowDown)); - tableWidget_codecs->verticalHeader()->hide(); - tableWidget_codecs->setSelectionBehavior(QAbstractItemView::SelectRows); - - - - //TODO ajouter les items de l'interface audio ici avec les constantes - - -// accountsChangedEnableWarning = true; - - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - connect(&configurationManager, SIGNAL(accountsChanged()), - this, SLOT(on1_accountsChanged())); - - connect(edit1_alias, SIGNAL(textEdited(const QString &)), - this, SLOT(changedAccountList())); - connect(edit2_protocol, SIGNAL(currentIndexChanged(int)), - this, SLOT(changedAccountList())); - connect(edit3_server, SIGNAL(textEdited(const QString &)), - this, SLOT(changedAccountList())); - connect(edit4_user, SIGNAL(textEdited(const QString &)), - this, SLOT(changedAccountList())); - connect(edit5_password, SIGNAL(textEdited(const QString &)), - this, SLOT(changedAccountList())); - connect(edit6_mailbox, SIGNAL(textEdited(const QString &)), - this, SLOT(changedAccountList())); - connect(button_accountUp, SIGNAL(clicked()), - this, SLOT(changedAccountList())); - connect(button_accountDown, SIGNAL(clicked()), - this, SLOT(changedAccountList())); - connect(button_accountAdd, SIGNAL(clicked()), - this, SLOT(changedAccountList())); - connect(button_accountRemove, SIGNAL(clicked()), - this, SLOT(changedAccountList())); - - - loadOptions(); - -} - -ConfigurationDialog::~ConfigurationDialog() -{ - delete accountList; - delete errorWindow; -} - -void ConfigurationDialog::connectAccountsChangedSignal() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - connect(&configurationManager, SIGNAL(accountsChanged()), - this, SLOT(on1_accountsChanged())); -} - -void ConfigurationDialog::disconnectAccountsChangedSignal() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - disconnect(&configurationManager, SIGNAL(accountsChanged()), - this, SLOT(on1_accountsChanged())); -} - -void ConfigurationDialog::changedAccountList() -{ - toolButton_accountsApply->setEnabled(true); -} - -AccountList * ConfigurationDialog::getAccountList() -{ - return accountList; -} - -void ConfigurationDialog::loadOptions() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - - //////////////////////// - ////General settings//// - //////////////////////// - - //Call history settings - spinBox_historyCapacity->setValue(configurationManager.getHistoryLimit()); - - //SIP port settings - int sipPort = configurationManager.getSipPort(); - if(sipPort<1025){ - spinBox_SIPPort->setMinimum(sipPort); - label_WarningSIP->setText(tr2i18n("Attention : SIP port must be over 1024 !")); - label_WarningSIP->setVisible(true); - } - if(sipPort>65535){ - spinBox_SIPPort->setMaximum(sipPort); - label_WarningSIP->setText(tr2i18n("Attention : SIP port must be under 65536 !")); - label_WarningSIP->setVisible(true); - } - spinBox_SIPPort->setValue(configurationManager.getSipPort()); - - //////////////////////// - ////Display settings//// - //////////////////////// - - //Notification settings - checkBox1_notifOnCalls->setCheckState(configurationManager.getNotify() ? Qt::Checked : Qt::Unchecked); - checkBox2_notifOnMessages->setCheckState(configurationManager.getMailNotify() ? Qt::Checked : Qt::Unchecked); - - //Window display settings - checkBox1_displayOnStart->setCheckState(configurationManager.isStartHidden() ? Qt::Unchecked : Qt::Checked); - checkBox2_displayOnCalls->setCheckState(configurationManager.popupMode() ? Qt::Checked : Qt::Unchecked); - - ///////////////////////// - ////Accounts settings//// - ///////////////////////// - - loadAccountList(); - - //Stun settings - checkBox_stun->setCheckState(configurationManager.isStunEnabled() ? Qt::Checked : Qt::Unchecked); - lineEdit_stun->setText(QString(configurationManager.getStunServer())); - - ////////////////////// - ////Audio settings//// - ////////////////////// - - //Audio Interface settings - int audioManager = configurationManager.getAudioManager(); - comboBox_interface->setCurrentIndex(audioManager); - stackedWidget_interfaceSpecificSettings->setCurrentIndex(audioManager); - - //ringtones settings - checkBox_ringtones->setCheckState(configurationManager.isRingtoneEnabled() ? Qt::Checked : Qt::Unchecked); - urlComboRequester_ringtone->setUrl(KUrl::fromPath(configurationManager.getRingtoneChoice())); - - //codecs settings - loadCodecs(); - - // - //alsa settings - comboBox1_alsaPlugin->clear(); - QStringList pluginList = configurationManager.getOutputAudioPluginList(); - comboBox1_alsaPlugin->addItems(pluginList); - comboBox1_alsaPlugin->setCurrentIndex(comboBox1_alsaPlugin->findText(configurationManager.getCurrentAudioOutputPlugin())); - - - comboBox2_in->clear(); - comboBox3_out->clear(); - - if(audioManager == ALSA) - { - QStringList devices = configurationManager.getCurrentAudioDevicesIndex(); - bool ok; - qDebug() << "inputDevice = " << devices[1]; - int inputDevice = devices[1].toInt(& ok); - if(!ok) qDebug() << "inputDevice is not a number"; - QStringList inputDeviceList = configurationManager.getAudioInputDeviceList(); - comboBox2_in->addItems(inputDeviceList); - comboBox2_in->setCurrentIndex(inputDevice); - - qDebug() << "outputDevice = " << devices[0]; - int outputDevice = devices[0].toInt(& ok); - if(!ok) qDebug() << "outputDevice is not a number"; - QStringList outputDeviceList = configurationManager.getAudioOutputDeviceList(); - comboBox3_out->addItems(outputDeviceList); - comboBox3_out->setCurrentIndex(outputDevice); - } - - //pulseaudio settings - checkBox_pulseAudioVolumeAlter->setCheckState(configurationManager.getPulseAppVolumeControl() ? Qt::Checked : Qt::Unchecked); - - /////////////////////// - ////Record settings//// - /////////////////////// - - urlcomborequester_destinationFolder->setUrl(KUrl::fromPath(configurationManager.getRecordPath())); - - - ///////////////////////////// - ////Address book settings//// - ///////////////////////////// - - MapStringInt addressBookSettings = configurationManager.getAddressbookSettings().value(); - qDebug() << "getAddressbookSettings() : " << addressBookSettings; - spinBox_maxResults->setValue(addressBookSettings[ADDRESSBOOK_MAX_RESULTS]); - checkBox_displayPhoto->setChecked(addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO]); - checkBox_business->setChecked(addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS]); - checkBox_mobile->setChecked(addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE]); - checkBox_home->setChecked(addressBookSettings[ADDRESSBOOK_DISPLAY_HOME]); - - ///////////////////////////// - ///////Hooks settings//////// - ///////////////////////////// - - MapStringString hooksSettings = configurationManager.getHookSettings().value(); - qDebug() << "getHooksSettings() : " << hooksSettings; - checkBox_addPrefix->setChecked(hooksSettings[HOOKS_ENABLED]=="1"); - lineEdit_prepend->setText(hooksSettings[HOOKS_ADD_PREFIX]); - checkBox_hooksSIP->setChecked(hooksSettings[HOOKS_SIP_ENABLED]=="1"); - checkBox_hooksIAX->setChecked(hooksSettings[HOOKS_IAX2_ENABLED]=="1"); - lineEdit_SIPHeader->setText(hooksSettings[HOOKS_SIP_FIELD]); - lineEdit_command->setText(hooksSettings[HOOKS_COMMAND]); - - - -} - - -void ConfigurationDialog::saveOptions() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - - accountsChangedEnableWarning = false; - //////////////////////// - ////General settings//// - //////////////////////// - - //Call history settings - configurationManager.setHistoryLimit(spinBox_historyCapacity->value()); - - //SIP port settings - int sipPort = spinBox_SIPPort->value(); - - if(sipPort<1025){ - errorWindow->showMessage(tr2i18n("Attention : SIP port must be over 1024 !")); - } - if(sipPort>65535){ - errorWindow->showMessage(tr2i18n("Attention : SIP port must be under 65536 !")); - } - configurationManager.setSipPort(sipPort); - - //////////////////////// - ////Display settings//// - //////////////////////// - - //Notification settings - if(checkBox1_notifOnCalls->checkState() != (configurationManager.getNotify() ? Qt::Checked : Qt::Unchecked)) configurationManager.setNotify(); - if(checkBox2_notifOnMessages->checkState() != (configurationManager.getMailNotify() ? Qt::Checked : Qt::Unchecked)) configurationManager.setMailNotify(); - - //Window display settings - //WARNING états inversés - if(checkBox1_displayOnStart->checkState() != (configurationManager.isStartHidden() ? Qt::Unchecked : Qt::Checked)) configurationManager.startHidden(); - if(checkBox2_displayOnCalls->checkState() != (configurationManager.popupMode() ? Qt::Checked : Qt::Unchecked)) configurationManager.switchPopupMode(); - - ///////////////////////// - ////Accounts settings//// - ///////////////////////// - - saveAccountList(); - - //Stun settings - if(checkBox_stun->checkState() != (configurationManager.isStunEnabled() ? Qt::Checked : Qt::Unchecked)) configurationManager.enableStun(); - configurationManager.setStunServer(lineEdit_stun->text()); - - ////////////////////// - ////Audio settings//// - ////////////////////// - - //Audio Interface settings - qDebug() << "setting audio manager"; - int manager = comboBox_interface->currentIndex(); - configurationManager.setAudioManager(manager); - - //ringtones settings - qDebug() << "setting ringtone options"; - if(checkBox_ringtones->checkState() != (configurationManager.isRingtoneEnabled() ? Qt::Checked : Qt::Unchecked)) configurationManager.ringtoneEnabled(); - configurationManager.setRingtoneChoice(urlComboRequester_ringtone->url().url()); - - //codecs settings - qDebug() << "saving codecs"; - saveCodecs(); - - //alsa settings - if(manager == ALSA) - { - qDebug() << "setting alsa settings"; - configurationManager.setOutputAudioPlugin(comboBox1_alsaPlugin->currentText()); - int audioInputDevice = comboBox2_in->currentIndex(); - if( audioInputDevice != -1) - { - configurationManager.setAudioInputDevice(audioInputDevice); - } - int audioOutputDevice = comboBox3_out->currentIndex(); - if( audioOutputDevice != -1) - { - configurationManager.setAudioOutputDevice(audioOutputDevice); - } - } - //pulseaudio settings - if(manager == PULSEAUDIO) - { - qDebug() << "setting pulseaudio settings"; - if(checkBox_pulseAudioVolumeAlter->checkState() != (configurationManager.getPulseAppVolumeControl() ? Qt::Checked : Qt::Unchecked)) configurationManager.setPulseAppVolumeControl(); - } - - /////////////////////// - ////Record settings//// - /////////////////////// - - configurationManager.setRecordPath(urlcomborequester_destinationFolder->url().url()); - - ///////////////////////////// - ////Address Book settings//// - ///////////////////////////// - - MapStringInt addressBookSettings = MapStringInt(); - addressBookSettings[ADDRESSBOOK_MAX_RESULTS] = spinBox_maxResults->value(); - addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO] = checkBox_displayPhoto->isChecked(); - addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS] = checkBox_business->isChecked(); - addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE] = checkBox_mobile->isChecked(); - addressBookSettings[ADDRESSBOOK_DISPLAY_HOME] = checkBox_home->isChecked(); - configurationManager.setAddressbookSettings(addressBookSettings); - - ///////////////////////////// - ///////Hooks settings//////// - ///////////////////////////// - - MapStringString hooksSettings = MapStringString(); - hooksSettings[HOOKS_ENABLED] = checkBox_addPrefix->isChecked() ? "1" : "0"; - hooksSettings[HOOKS_ADD_PREFIX] = lineEdit_prepend->text(); - hooksSettings[HOOKS_SIP_ENABLED] = checkBox_hooksSIP->isChecked() ? "1" : "0"; - hooksSettings[HOOKS_IAX2_ENABLED] = checkBox_hooksIAX->isChecked() ? "1" : "0"; - hooksSettings[HOOKS_SIP_FIELD] = lineEdit_SIPHeader->text(); - hooksSettings[HOOKS_COMMAND] = lineEdit_command->text(); - configurationManager.setHookSettings(hooksSettings); - -// accountsChangedEnableWarning = true; -} - - -void ConfigurationDialog::loadAccountList() -{ - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - //ask for the list of accounts ids to the configurationManager - QStringList accountIds = configurationManager.getAccountList().value(); - //create the AccountList object with the ids - accountList = new AccountList(accountIds); - //initialize the QListWidget object with the AccountList - listWidget_accountList->clear(); - for (int i = 0; i < accountList->size(); ++i){ - addAccountToAccountList(&(*accountList)[i]); - } - if (listWidget_accountList->count() > 0 && listWidget_accountList->currentItem() == NULL) - listWidget_accountList->setCurrentRow(0); - else - frame2_editAccounts->setEnabled(false); -} - - -void ConfigurationDialog::saveAccountList() -{ - //get the configurationManager instance - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - disconnectAccountsChangedSignal(); - //save the account being edited - if(listWidget_accountList->currentItem()) - saveAccount(listWidget_accountList->currentItem()); - //ask for the list of accounts ids to the configurationManager - QStringList accountIds= QStringList(configurationManager.getAccountList().value()); - //create or update each account from accountList - for (int i = 0; i < accountList->size(); i++){ - Account & current = (*accountList)[i]; - QString currentId; - //if the account has no instanciated id, it has just been created in the client - if(current.isNew()) - { - MapStringString details = current.getAccountDetails(); - currentId = configurationManager.addAccount(details); - current.setAccountId(currentId); - } - //if the account has an instanciated id but it's not in configurationManager - else{ - if(! accountIds.contains(current.getAccountId())) - { - qDebug() << "The account with id " << current.getAccountId() << " doesn't exist. It might have been removed by another SFLPhone client."; - currentId = QString(); - } - else - { - configurationManager.setAccountDetails(current.getAccountId(), current.getAccountDetails()); - currentId = QString(current.getAccountId()); - } - } - qDebug() << currentId << " : " << current.isChecked(); - configurationManager.sendRegister(currentId, current.isChecked() ? 1 : 0 ); - } - //remove accounts that are in the configurationManager but not in the client - for (int i = 0; i < accountIds.size(); i++) - { - if(! accountList->getAccountById(accountIds[i])) - { - qDebug() << "remove account " << accountIds[i]; - configurationManager.removeAccount(accountIds[i]); - } - } - configurationManager.setAccountsOrder(accountList->getOrderedList()); - connectAccountsChangedSignal(); -} - -void ConfigurationDialog::loadAccount(QListWidgetItem * item) -{ - if(! item ) { qDebug() << "Attempting to load details of an account from a NULL item"; return; } - - Account * account = accountList->getAccountByItem(item); - if(! account ) { qDebug() << "Attempting to load details of an unexisting account"; return; } - - edit1_alias->setText( account->getAccountDetail(ACCOUNT_ALIAS)); - - QString protocolsTab[] = ACCOUNT_TYPES_TAB; - QList<QString> * protocolsList = new QList<QString>(); - for(int i = 0 ; i < (int) (sizeof(protocolsTab) / sizeof(QString)) ; i++) - { - protocolsList->append(protocolsTab[i]); - } - QString accountName = account->getAccountDetail(ACCOUNT_TYPE); - int protocolIndex = protocolsList->indexOf(accountName); - delete protocolsList; - - edit2_protocol->setCurrentIndex( (protocolIndex < 0) ? 0 : protocolIndex ); - edit3_server->setText( account->getAccountDetail(ACCOUNT_HOSTNAME)); - edit4_user->setText( account->getAccountDetail(ACCOUNT_USERNAME)); - edit5_password->setText( account->getAccountDetail(ACCOUNT_PASSWORD)); - edit6_mailbox->setText( account->getAccountDetail(ACCOUNT_MAILBOX)); - QString status = account->getAccountDetail(ACCOUNT_STATUS); - edit7_state->setText( "<FONT COLOR=\"" + account->getStateColorName() + "\">" + status + "</FONT>" ); - -} - - -void ConfigurationDialog::saveAccount(QListWidgetItem * item) -{ - if(! item) { qDebug() << "Attempting to save details of an account from a NULL item"; return; } - - Account * account = accountList->getAccountByItem(item); - if(! account) { qDebug() << "Attempting to save details of an unexisting account : " << item->text(); return; } - - account->setAccountDetail(ACCOUNT_ALIAS, edit1_alias->text()); - QString protocolsTab[] = ACCOUNT_TYPES_TAB; - account->setAccountDetail(ACCOUNT_TYPE, protocolsTab[edit2_protocol->currentIndex()]); - account->setAccountDetail(ACCOUNT_HOSTNAME, edit3_server->text()); - account->setAccountDetail(ACCOUNT_USERNAME, edit4_user->text()); - account->setAccountDetail(ACCOUNT_PASSWORD, edit5_password->text()); - account->setAccountDetail(ACCOUNT_MAILBOX, edit6_mailbox->text()); - account->setAccountDetail(ACCOUNT_ENABLED, account->isChecked() ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE); -} - -void ConfigurationDialog::addAccountToAccountList(Account * account) -{ - qDebug() << "addAccountToAccountList"; - QListWidgetItem * item = account->getItem(); - QWidget * widget = account->getItemWidget(); - connect(widget, SIGNAL(checkStateChanged()), - this, SLOT(changedAccountList())); - listWidget_accountList->addItem(item); - listWidget_accountList->setItemWidget(item, widget); -} - -void ConfigurationDialog::loadCodecs() -{ - qDebug() << "loadCodecs"; - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - QStringList codecList = configurationManager.getCodecList(); - QStringList activeCodecList = configurationManager.getActiveCodecList(); - #if QT_VERSION >= 0x040500 - activeCodecList.removeDuplicates(); - #else - for (int i = 0 ; i < activeCodecList.size() ; i++) - { - if(activeCodecList.lastIndexOf(activeCodecList[i]) != i) - { - activeCodecList.removeAt(i); - i--; - } - } - #endif - - for (int i=0 ; i<activeCodecList.size() ; i++) - { - if(! codecList.contains(activeCodecList[i])) - { - activeCodecList.removeAt(i); - i--; - } - } - QStringList codecListToDisplay = activeCodecList; - for (int i=0 ; i<codecList.size() ; i++) - { - if(! activeCodecList.contains(codecList[i])) - { - codecListToDisplay << codecList[i]; - } - } - qDebug() << "codecList = " << codecList; - qDebug() << "activeCodecList" << activeCodecList; - qDebug() << "codecListToDisplay" << codecListToDisplay; - tableWidget_codecs->setRowCount(0); - for(int i=0 ; i<codecListToDisplay.size() ; i++) - { - bool ok; - qDebug() << codecListToDisplay[i]; - QString payloadStr = QString(codecListToDisplay[i]); - int payload = payloadStr.toInt(&ok); - if(!ok) - qDebug() << "The codec's payload sent by the configurationManager is not a number : " << codecListToDisplay[i]; - else - { - QStringList details = configurationManager.getCodecDetails(payload); - tableWidget_codecs->insertRow(i); - tableWidget_codecs->setVerticalHeaderItem (i, new QTableWidgetItem()); - tableWidget_codecs->verticalHeaderItem (i)->setText(payloadStr); - tableWidget_codecs->setItem(i,0,new QTableWidgetItem("")); - tableWidget_codecs->setItem(i,1,new QTableWidgetItem(details[CODEC_NAME])); - tableWidget_codecs->setItem(i,2,new QTableWidgetItem(details[CODEC_SAMPLE_RATE])); - tableWidget_codecs->setItem(i,3,new QTableWidgetItem(details[CODEC_BIT_RATE])); - tableWidget_codecs->setItem(i,4,new QTableWidgetItem(details[CODEC_BANDWIDTH])); - tableWidget_codecs->item(i,0)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); - tableWidget_codecs->item(i,0)->setCheckState(activeCodecList.contains(codecListToDisplay[i]) ? Qt::Checked : Qt::Unchecked); - tableWidget_codecs->item(i,1)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); - tableWidget_codecs->item(i,2)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); - tableWidget_codecs->item(i,3)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); - tableWidget_codecs->item(i,4)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); - - qDebug() << "Added to codecs : " << payloadStr << " , " << details[CODEC_NAME]; - } - } - tableWidget_codecs->resizeColumnsToContents(); - tableWidget_codecs->resizeRowsToContents(); -} - - -void ConfigurationDialog::saveCodecs() -{ - qDebug() << "saveCodecs"; - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - QStringList activeCodecs; - for(int i = 0 ; i < tableWidget_codecs->rowCount() ; i++) - { - if(tableWidget_codecs->item(i,0)->checkState() == Qt::Checked) - { - activeCodecs << tableWidget_codecs->verticalHeaderItem(i)->text(); - } - } - qDebug() << "Calling setActiveCodecList with list : " << activeCodecs ; - configurationManager.setActiveCodecList(activeCodecs); -} - -void ConfigurationDialog::setPage(int page) -{ - stackedWidget_options->setCurrentIndex(page); - list_options->setCurrentRow(page); -} - -void ConfigurationDialog::updateAccountListCommands() -{ - bool buttonsEnabled[4] = {true,true,true,true}; - if(! listWidget_accountList->currentItem()) - { - buttonsEnabled[0] = false; - buttonsEnabled[1] = false; - buttonsEnabled[3] = false; - } - else if(listWidget_accountList->currentRow() == 0) - { - buttonsEnabled[0] = false; - } - else if(listWidget_accountList->currentRow() == listWidget_accountList->count() - 1) - { - buttonsEnabled[1] = false; - } - button_accountUp->setEnabled(buttonsEnabled[0]); - button_accountDown->setEnabled(buttonsEnabled[1]); - button_accountAdd->setEnabled(buttonsEnabled[2]); - button_accountRemove->setEnabled(buttonsEnabled[3]); -} - -void ConfigurationDialog::updateCodecListCommands() -{ - bool buttonsEnabled[2] = {true,true}; - if(! tableWidget_codecs->currentItem()) - { - buttonsEnabled[0] = false; - buttonsEnabled[1] = false; - } - else if(tableWidget_codecs->currentRow() == 0) - { - buttonsEnabled[0] = false; - } - else if(tableWidget_codecs->currentRow() == tableWidget_codecs->rowCount() - 1) - { - buttonsEnabled[1] = false; - } - toolButton_codecUp->setEnabled(buttonsEnabled[0]); - toolButton_codecDown->setEnabled(buttonsEnabled[1]); -} - -void ConfigurationDialog::on_edit1_alias_textChanged(const QString & text) -{ - qDebug() << "on_edit1_alias_textChanged"; - AccountItemWidget * widget = (AccountItemWidget *) listWidget_accountList->itemWidget(listWidget_accountList->currentItem()); - widget->setAccountText(text); - changedAccountList(); -} - - -void ConfigurationDialog::on_spinBox_SIPPort_valueChanged ( int value ) -{ - qDebug() << "on_spinBox_SIPPort_valueChanged"; - if(value>1024 && value<65536) - label_WarningSIP->setVisible(false); - else - label_WarningSIP->setVisible(true); -} - - -void ConfigurationDialog::on_toolButton_codecUp_clicked() -{ - qDebug() << "on_toolButton_codecUp_clicked"; - int currentCol = tableWidget_codecs->currentColumn(); - int currentRow = tableWidget_codecs->currentRow(); - int nbCol = tableWidget_codecs->columnCount(); - for(int i = 0 ; i < nbCol ; i++) - { - QTableWidgetItem * item1 = tableWidget_codecs->takeItem(currentRow, i); - QTableWidgetItem * item2 = tableWidget_codecs->takeItem(currentRow - 1, i); - tableWidget_codecs->setItem(currentRow - 1, i , item1); - tableWidget_codecs->setItem(currentRow, i , item2); - } - QTableWidgetItem * item1 = tableWidget_codecs->takeVerticalHeaderItem(currentRow); - QTableWidgetItem * item2 = tableWidget_codecs->takeVerticalHeaderItem(currentRow - 1); - tableWidget_codecs->setVerticalHeaderItem(currentRow - 1, item1); - tableWidget_codecs->setVerticalHeaderItem(currentRow, item2); - tableWidget_codecs->setCurrentCell(currentRow - 1, currentCol); -} - -void ConfigurationDialog::on_toolButton_codecDown_clicked() -{ - qDebug() << "on_toolButton_codecDown_clicked"; - int currentCol = tableWidget_codecs->currentColumn(); - int currentRow = tableWidget_codecs->currentRow(); - int nbCol = tableWidget_codecs->columnCount(); - for(int i = 0 ; i < nbCol ; i++) - { - QTableWidgetItem * item1 = tableWidget_codecs->takeItem(currentRow, i); - QTableWidgetItem * item2 = tableWidget_codecs->takeItem(currentRow + 1, i); - tableWidget_codecs->setItem(currentRow + 1, i , item1); - tableWidget_codecs->setItem(currentRow, i , item2); - } - QTableWidgetItem * item1 = tableWidget_codecs->takeVerticalHeaderItem(currentRow); - QTableWidgetItem * item2 = tableWidget_codecs->takeVerticalHeaderItem(currentRow + 1); - tableWidget_codecs->setVerticalHeaderItem(currentRow + 1, item1); - tableWidget_codecs->setVerticalHeaderItem(currentRow, item2); - tableWidget_codecs->setCurrentCell(currentRow + 1, currentCol); -} - -void ConfigurationDialog::on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ) -{ - qDebug() << "on_listWidget_accountList_currentItemChanged : " << ((accountList->getAccountByItem(current) != NULL) ? accountList->getAccountByItem(current)->getAlias() : "null"); - if(previous) - saveAccount(previous); - if(current) - loadAccount(current); - updateAccountListCommands(); -} - -void ConfigurationDialog::on_button_accountUp_clicked() -{ - qDebug() << "on_button_accountUp_clicked"; - int currentRow = listWidget_accountList->currentRow(); - QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); - Account * account = accountList->getAccountByItem(prevItem); - //we need to build a new item to set the itemWidget back - account->initAccountItem(); - QListWidgetItem * item = account->getItem(); - AccountItemWidget * widget = account->getItemWidget(); - accountList->upAccount(currentRow); - listWidget_accountList->insertItem(currentRow - 1 , item); - listWidget_accountList->setItemWidget(item, widget); - listWidget_accountList->setCurrentItem(item); -// changedAccountList(); -} - -void ConfigurationDialog::on_button_accountDown_clicked() -{ - qDebug() << "on_button_accountDown_clicked"; - int currentRow = listWidget_accountList->currentRow(); - QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); - Account * account = accountList->getAccountByItem(prevItem); - //we need to build a new item to set the itemWidget back - account->initAccountItem(); - QListWidgetItem * item = account->getItem(); - AccountItemWidget * widget = account->getItemWidget(); - accountList->downAccount(currentRow); - listWidget_accountList->insertItem(currentRow + 1 , item); - listWidget_accountList->setItemWidget(item, widget); - listWidget_accountList->setCurrentItem(item); -// changedAccountList(); -} - -void ConfigurationDialog::on_button_accountAdd_clicked() -{ - qDebug() << "on_button_accountAdd_clicked"; - QString itemName = QInputDialog::getText(this, "New account", "Enter new account's alias"); - itemName = itemName.simplified(); - if (!itemName.isEmpty()) { - Account * account = accountList->addAccount(itemName); - addAccountToAccountList(account); - int r = listWidget_accountList->count() - 1; - listWidget_accountList->setCurrentRow(r); - frame2_editAccounts->setEnabled(true); - } -// changedAccountList(); -} - -void ConfigurationDialog::on_button_accountRemove_clicked() -{ - qDebug() << "on_button_accountRemove_clicked"; - int r = listWidget_accountList->currentRow(); - QListWidgetItem * item = listWidget_accountList->takeItem(r); - accountList->removeAccount(item); - listWidget_accountList->setCurrentRow( (r >= listWidget_accountList->count()) ? r-1 : r ); -// changedAccountList(); -} - -void ConfigurationDialog::on_toolButton_accountsApply_clicked() -{ - qDebug() << "on_toolButton_accountsApply_clicked"; - toolButton_accountsApply->setEnabled(false); - saveAccountList(); - loadAccountList(); -} - - -void ConfigurationDialog::on_buttonBoxDialog_clicked(QAbstractButton * button) -{ - qDebug() << "on_buttonBoxDialog_clicked"; - if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Apply) - { - this->saveOptions(); - this->loadOptions(); - } - if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::RestoreDefaults) - { - this->loadOptions(); - } - if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Ok) - { - this->saveOptions(); - this->setVisible(false); - } - if(buttonBoxDialog->standardButton(button) == QDialogButtonBox::Cancel) - { - this->setVisible(false); - } -} - -void ConfigurationDialog::on_tableWidget_codecs_currentCellChanged(int currentRow) -{ - qDebug() << "on_tableWidget_codecs_currentCellChanged"; - int nbCol = tableWidget_codecs->columnCount(); - for(int i = 0 ; i < nbCol ; i++) - { - tableWidget_codecs->setRangeSelected(QTableWidgetSelectionRange(currentRow, 0, currentRow, nbCol - 1), true); - } - updateCodecListCommands(); -} - -void ConfigurationDialog::updateAccountStates() -{ - for (int i = 0; i < accountList->size(); i++) - { - Account & current = accountList->getAccount(i); - current.updateState(); - } -} - -void ConfigurationDialog::on1_accountsChanged() -{ - qDebug() << "on1_accountsChanged"; - updateAccountStates(); -// ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); -// disconnect(&configurationManager, SIGNAL(accountsChanged()), -// this, SLOT(on1_accountsChanged())); -// accountList->update(); -// loadAccountList(); -// connect(&configurationManager, SIGNAL(accountsChanged()), -// this, SLOT(on1_accountsChanged())); -// if(isVisible() && accountsChangedEnableWarning) -// { -// errorWindow->showMessage(tr2i18n("Accounts changed : another client may be changing accounts or an account is unstable. \nIf another client is changing the settings, you may cancel your changes to avoid overwriting one's changes.")); -// } - if(! isVisible()) - { - loadAccountList(); - } -} - -void ConfigurationDialog::on1_parametersChanged() -{ - qDebug() << "on1_parametersChanged"; -} - -void ConfigurationDialog::on1_errorAlert(int code) -{ - qDebug() << "on1_errorAlert code : " << code ; -} diff --git a/sflphone-client-kde/src/Dialpad.cpp b/sflphone-client-kde/src/Dialpad.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ce98484b4c1c4781ed07d8ac6ce15b3dbf90dec6 --- /dev/null +++ b/sflphone-client-kde/src/Dialpad.cpp @@ -0,0 +1,134 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "Dialpad.h" + +#include <QLabel> +#include <QDebug> + +Dialpad::Dialpad(QWidget *parent) + : QWidget(parent) +{ + gridLayout = new QGridLayout(this); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + + pushButton_0 = new QPushButton(this); + pushButton_1 = new QPushButton(this); + pushButton_2 = new QPushButton(this); + pushButton_3 = new QPushButton(this); + pushButton_4 = new QPushButton(this); + pushButton_5 = new QPushButton(this); + pushButton_6 = new QPushButton(this); + pushButton_7 = new QPushButton(this); + pushButton_8 = new QPushButton(this); + pushButton_9 = new QPushButton(this); + pushButton_diese = new QPushButton(this); + pushButton_etoile = new QPushButton(this); + + pushButton_0->setObjectName(QString::fromUtf8("pushButton_0")); + pushButton_1->setObjectName(QString::fromUtf8("pushButton_1")); + pushButton_2->setObjectName(QString::fromUtf8("pushButton_2")); + pushButton_3->setObjectName(QString::fromUtf8("pushButton_3")); + pushButton_4->setObjectName(QString::fromUtf8("pushButton_4")); + pushButton_5->setObjectName(QString::fromUtf8("pushButton_5")); + pushButton_6->setObjectName(QString::fromUtf8("pushButton_6")); + pushButton_7->setObjectName(QString::fromUtf8("pushButton_7")); + pushButton_8->setObjectName(QString::fromUtf8("pushButton_8")); + pushButton_9->setObjectName(QString::fromUtf8("pushButton_9")); + pushButton_diese->setObjectName(QString::fromUtf8("pushButton_diese")); + pushButton_etoile->setObjectName(QString::fromUtf8("pushButton_etoile")); + + gridLayout->addWidget(pushButton_1, 0, 0); + gridLayout->addWidget(pushButton_2, 0, 1); + gridLayout->addWidget(pushButton_3, 0, 2); + gridLayout->addWidget(pushButton_4, 1, 0); + gridLayout->addWidget(pushButton_5, 1, 1); + gridLayout->addWidget(pushButton_6, 1, 2); + gridLayout->addWidget(pushButton_7, 2, 0); + gridLayout->addWidget(pushButton_8, 2, 1); + gridLayout->addWidget(pushButton_9, 2, 2); + gridLayout->addWidget(pushButton_diese, 3, 0); + gridLayout->addWidget(pushButton_0, 3, 1); + gridLayout->addWidget(pushButton_etoile, 3, 2); + + fillButtons(); + + QMetaObject::connectSlotsByName(this); +} + + +void Dialpad::fillButtons() +{ + QHBoxLayout * layout; + QLabel * number; + QLabel * text; + int spacing = 5; + int numberSize = 14; + int textSize = 8; + + QPushButton * buttons[12] = + {pushButton_1, pushButton_2, pushButton_3, + pushButton_4, pushButton_5, pushButton_6, + pushButton_7, pushButton_8, pushButton_9, + pushButton_etoile, pushButton_0, pushButton_diese}; + + QString numbers[12] = + {"1", "2", "3", + "4", "5", "6", + "7", "8", "9", + "*", "0", "#"}; + + QString texts[12] = + { "" , "abc", "def" , + "ghi" , "jkl", "mno" , + "pqrs", "tuv", "wxyz", + "" , "" , "" }; + + for(int i = 0 ; i < 12 ; i++) + { + layout = new QHBoxLayout(); + layout->setSpacing(spacing); + number = new QLabel(numbers[i]); + number->setFont(QFont("", numberSize)); + layout->addWidget(number); + number->setAlignment(Qt::AlignRight | Qt::AlignVCenter); + text = new QLabel(texts[i]); + text->setFont(QFont("", textSize)); + layout->addWidget(text); + buttons[i]->setLayout(layout); + buttons[i]->setMinimumHeight(30); + buttons[i]->setText(""); + } +} + + + +void Dialpad::on_pushButton_1_clicked() { emit typed("1"); } +void Dialpad::on_pushButton_2_clicked() { emit typed("2"); } +void Dialpad::on_pushButton_3_clicked() { emit typed("3"); } +void Dialpad::on_pushButton_4_clicked() { emit typed("4"); } +void Dialpad::on_pushButton_5_clicked() { emit typed("5"); } +void Dialpad::on_pushButton_6_clicked() { emit typed("6"); } +void Dialpad::on_pushButton_7_clicked() { emit typed("7"); } +void Dialpad::on_pushButton_8_clicked() { emit typed("8"); } +void Dialpad::on_pushButton_9_clicked() { emit typed("9"); } +void Dialpad::on_pushButton_0_clicked() { emit typed("0"); } +void Dialpad::on_pushButton_diese_clicked() { emit typed("#"); } +void Dialpad::on_pushButton_etoile_clicked() { emit typed("*"); } diff --git a/sflphone-client-kde/src/Dialpad.h b/sflphone-client-kde/src/Dialpad.h new file mode 100644 index 0000000000000000000000000000000000000000..3d7cc25714690c48b1e5dbcf4d61abeda9d2d0de --- /dev/null +++ b/sflphone-client-kde/src/Dialpad.h @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DIALPAD_H +#define DIALPAD_H + +#include <QWidget> +#include <QPushButton> +#include <QGridLayout> + +/** +A widget that represents a phone dialpad, with numbers and letters associated. + + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class Dialpad : public QWidget +{ +Q_OBJECT + +private: + QGridLayout * gridLayout; + QPushButton * pushButton_0; + QPushButton * pushButton_1; + QPushButton * pushButton_2; + QPushButton * pushButton_3; + QPushButton * pushButton_4; + QPushButton * pushButton_5; + QPushButton * pushButton_6; + QPushButton * pushButton_7; + QPushButton * pushButton_8; + QPushButton * pushButton_9; + QPushButton * pushButton_diese; + QPushButton * pushButton_etoile; + +public: + Dialpad(QWidget *parent = 0); + +// ~Dialpad(); + +private: + void fillButtons(); + +private slots: + void on_pushButton_1_clicked(); + void on_pushButton_2_clicked(); + void on_pushButton_3_clicked(); + void on_pushButton_4_clicked(); + void on_pushButton_5_clicked(); + void on_pushButton_6_clicked(); + void on_pushButton_7_clicked(); + void on_pushButton_8_clicked(); + void on_pushButton_9_clicked(); + void on_pushButton_0_clicked(); + void on_pushButton_diese_clicked(); + void on_pushButton_etoile_clicked(); + +signals: + /** + * This signal is emitted when the user types a button of the dialpad. + * @param text the text of the button typed by the user. + */ + void typed(QString text); +}; + +#endif diff --git a/sflphone-client-kde/src/SFLPhone.cpp b/sflphone-client-kde/src/SFLPhone.cpp index 1e8d18f591374c9ad629c9b86958d949f604038b..4ca4a7b3d74cd2514b9d48eb6f01fdd85c775adb 100644 --- a/sflphone-client-kde/src/SFLPhone.cpp +++ b/sflphone-client-kde/src/SFLPhone.cpp @@ -57,7 +57,7 @@ SFLPhone::SFLPhone(QWidget *parent) setWindowIcon(QIcon(ICON_SFLPHONE)); - setWindowTitle(tr2i18n("SFLPhone")); + setWindowTitle(i18n("SFLPhone")); setupActions(); @@ -145,6 +145,11 @@ void SFLPhone::setupActions() } +sflphone_kdeView * SFLPhone::getView() +{ + return view; +} + bool SFLPhone::queryClose() { qDebug() << "queryClose"; @@ -159,7 +164,7 @@ void SFLPhone::quitButton() if(view->listWidget_callList->count() > 0 && instance.getRegistrationCount() <= 1) { qDebug() << "Attempting to quit when still having some calls open."; - view->getErrorWindow()->showMessage(tr2i18n("You still have some calls open. Please close all calls before quitting.", 0)); + view->getErrorWindow()->showMessage(i18n("You still have some calls open. Please close all calls before quitting.")); } instance.Unregister(getpid()); qApp->quit(); @@ -187,8 +192,8 @@ void SFLPhone::trayIconSignal() void SFLPhone::sendNotif(QString caller) { trayIcon->showMessage( - tr2i18n("Incoming call"), - tr2i18n("You have an incoming call from") + " " + caller + ".\n" + tr2i18n("Click to accept or refuse it."), + i18n("Incoming call"), + i18n("You have an incoming call from") + " " + caller + ".\n" + i18n("Click to accept or refuse it."), QSystemTrayIcon::Warning, 20000); } diff --git a/sflphone-client-kde/src/SFLPhone.h b/sflphone-client-kde/src/SFLPhone.h index a262533c5f56d93ac646631ef4a11147376b8487..c85f58c1e6435db64338482a4e310e4b240ec4a0 100644 --- a/sflphone-client-kde/src/SFLPhone.h +++ b/sflphone-client-kde/src/SFLPhone.h @@ -32,14 +32,12 @@ #include <KXmlGuiWindow> #include "ui_sflphone_kdeview_base.h" -#include "ConfigDialog.h" #include "CallList.h" #include "AccountWizard.h" #include "Contact.h" #include "sflphone_kdeview.h" -class ConfigurationDialog; class sflphone_kdeView; class SFLPhone : public KXmlGuiWindow @@ -69,6 +67,7 @@ public: void sendNotif(QString caller); void putForeground(); void trayIconSignal(); + sflphone_kdeView * getView(); private slots: diff --git a/sflphone-client-kde/src/conf/ConfigurationDialog.cpp b/sflphone-client-kde/src/conf/ConfigurationDialog.cpp index 8d9e26aa38e1b881e288455a707b2e8c2222ff47..afa92ed9f40a1c353c78f31a064acbc6d4136e0a 100644 --- a/sflphone-client-kde/src/conf/ConfigurationDialog.cpp +++ b/sflphone-client-kde/src/conf/ConfigurationDialog.cpp @@ -23,12 +23,43 @@ #include "conf/ConfigurationSkeleton.h" #include "dlggeneral.h" +#include "dlgdisplay.h" +#include "dlgaccounts.h" +#include "dlgaudio.h" +#include "dlgaddressbook.h" +#include "dlgrecord.h" +#include "dlghooks.h" -ConfigurationDialogKDE::ConfigurationDialogKDE(QWidget *parent) - : KConfigDialog(parent, SETTINGS_NAME, new ConfigurationSkeleton()) +#include "sflphone_const.h" + +ConfigurationDialogKDE::ConfigurationDialogKDE(sflphone_kdeView *parent) + :KConfigDialog(parent, SETTINGS_NAME, ConfigurationSkeleton::self()) { - DlgGeneral * dlgGeneral = new DlgGeneral(this); - addPage( dlgGeneral, i18n("General"), "example" ); + this->setWindowIcon(QIcon(ICON_SFLPHONE)); + + dlgGeneral = new DlgGeneral(this); + dlgDisplay = new DlgDisplay(this); + dlgAccounts = new DlgAccounts(this); + dlgAudio = new DlgAudio(this); + dlgAddressBook = new DlgAddressBook(this); + dlgRecord = new DlgRecord(this); + dlgHooks = new DlgHooks(this); + + addPage( dlgGeneral , i18n("General") , "sflphone-client-kde" ); + addPage( dlgDisplay , i18n("Display") , "applications-graphics" ); + addPage( dlgAccounts , i18n("Accounts") , "personal" ); + addPage( dlgAudio , i18n("Audio") , "voicecall" ); + addPage( dlgAddressBook , i18n("Address Book") , "x-office-address-book" ); + addPage( dlgRecord , i18n("Record") , "media-record" ); + addPage( dlgHooks , i18n("Hooks") , "insert-link" ); + connect(this, SIGNAL(applyClicked()), dlgAudio, SLOT(updateAlsaSettings())); + connect(this, SIGNAL(okClicked()), dlgAudio, SLOT(updateAlsaSettings())); + connect(this, SIGNAL(applyClicked()), this, SLOT(applyCustomSettings())); + connect(this, SIGNAL(okClicked()), this, SLOT(applyCustomSettings())); + + connect(dlgGeneral, SIGNAL(clearCallHistoryAsked()), this, SIGNAL(clearCallHistoryAsked())); +// connect(this, SIGNAL(settingsChanged(const QString&)), this, SLOT(slot())); +// connect(this, SIGNAL(widgetModified()), this, SLOT(slot())); } @@ -36,4 +67,50 @@ ConfigurationDialogKDE::~ConfigurationDialogKDE() { } +void ConfigurationDialogKDE::slot() +{ + qDebug() << "slot"; +} + +void ConfigurationDialogKDE::updateWidgets() +{ + qDebug() << "updateWidgets"; + dlgAudio->updateWidgets(); +} + +void ConfigurationDialogKDE::updateSettings() +{ + qDebug() << "updateSettings"; + dlgAudio->updateSettings(); + qDebug() << "yo " << ConfigurationSkeleton::self()->alsaPlugin(); +} + +bool ConfigurationDialogKDE::hasChanged() +{ + qDebug() << "hasChanged"; + return dlgAudio->hasChanged() || dlgAccounts->hasChanged(); +} + +void ConfigurationDialogKDE::updateButtons() +{ + qDebug() << "updateButtons"; + enableButtonApply( hasChanged() ); +} +void ConfigurationDialogKDE::applyCustomSettings() +{ + qDebug() << "applyCustomSettings"; + dlgAccounts->applyCustomSettings(); +// if(hasChanged()) +// { + ConfigurationSkeleton::self()->writeConfig(); +// } + updateButtons(); +} + +void ConfigurationDialogKDE::reload() +{ + qDebug() << "reload"; + ConfigurationSkeleton::self()->readConfig(); + updateWidgets(); +} diff --git a/sflphone-client-kde/src/conf/ConfigurationDialog.h b/sflphone-client-kde/src/conf/ConfigurationDialog.h index e9b47927bdc54f6b8d92dd6e2ff228fc992c4bc0..02ac0fe0dc4b1477a9675a0651c708e21b883f6c 100644 --- a/sflphone-client-kde/src/conf/ConfigurationDialog.h +++ b/sflphone-client-kde/src/conf/ConfigurationDialog.h @@ -24,11 +24,21 @@ #include <kconfigdialog.h> -#include "settings.h" +#include "kcfg_settings.h" +#include "sflphone_kdeview.h" + #define SETTINGS_NAME "settings" class DlgGeneral; +class DlgDisplay; +class DlgAccounts; +class DlgAudio; +class DlgAddressBook; +class DlgRecord; +class DlgHooks; + +class sflphone_kdeView; /** @author Jérémy Quentin <jeremy.quentin@gmail.com> @@ -36,11 +46,64 @@ class DlgGeneral; class ConfigurationDialogKDE : public KConfigDialog { Q_OBJECT +private: + + + DlgGeneral * dlgGeneral; + DlgDisplay * dlgDisplay; + DlgAccounts * dlgAccounts; + DlgAudio * dlgAudio; + DlgAddressBook * dlgAddressBook; + DlgRecord * dlgRecord; + DlgHooks * dlgHooks; + public: - ConfigurationDialogKDE(QWidget *parent = 0); + ConfigurationDialogKDE(sflphone_kdeView *parent = 0); + + ~ConfigurationDialogKDE(); + + +public slots: + void slot(); + /** + * Reimplements KConfigDialog + */ + void updateWidgets(); + /** + * Reimplements KConfigDialog + */ + void updateSettings(); + /** + * Should be implemented in KConfigDialog but for no reason, is not. + * For the moment it is here but has to be removed if implemented in KConfigDialog + * because causes problems for a few cases (item managed by kconfig switched, item not managed + * switched and then switched back, apply becomes disabled). + * Can't be resolved without a method to know if items managed by kconfig have changed. + * Disable/Enable Apply Button according to hasChanged() result + */ + void updateButtons(); + /** + * Same as updateButtons, should be implemented in KConfigDialog. + * @return whether any custom widget has changed in the dialog. + */ + bool hasChanged(); + + /** + * reloads the informations before showing it. + */ + void reload(); + +private slots: + /** + * Apply settings not managed by kconfig (accounts) + * Should be removed when accounts are managed by kconfig. + */ + void applyCustomSettings(); - ~ConfigurationDialogKDE(); +signals: + void clearCallHistoryAsked(); + }; #endif diff --git a/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp b/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp index 8acd550e4ff4f317a03b9079d7be447405314c0f..c8860eb71badc5516af835f02d2b14e3e3604bc9 100644 --- a/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp +++ b/sflphone-client-kde/src/conf/ConfigurationSkeleton.cpp @@ -20,10 +20,24 @@ ***************************************************************************/ #include "ConfigurationSkeleton.h" +#include "configurationmanager_interface_singleton.h" +#include "sflphone_const.h" + ConfigurationSkeleton::ConfigurationSkeleton() : ConfigurationSkeletonBase() { qDebug() << "Yoooooooouuuuupppppppiiiiii"; + readConfig(); + isImmutable( QString::fromLatin1 ( "alsaPlugin" ) ); +} + +ConfigurationSkeleton * ConfigurationSkeleton::instance = NULL; + +ConfigurationSkeleton * ConfigurationSkeleton::self() +{ + if(instance == NULL) + { instance = new ConfigurationSkeleton(); } + return instance; } @@ -31,4 +45,242 @@ ConfigurationSkeleton::~ConfigurationSkeleton() { } +void ConfigurationSkeleton::readConfig() +{ + qDebug() << "\nReading config"; + + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + +// qDebug() << "configurationManager.getAudioManager4() = " << configurationManager.getAudioManager(); + //////////////////////// + ////General settings//// + //////////////////////// + + //Call history settings + setHistoryMax(configurationManager.getHistoryLimit()); + + //SIP port settings + setSIPPort(configurationManager.getSipPort()); + + //////////////////////// + ////Display settings//// + //////////////////////// + + //Notification settings + setNotifOnCalls(configurationManager.getNotify()); + setNotifOnMessages(configurationManager.getMailNotify()); + + //Window display settings + setDisplayOnStart(! configurationManager.isStartHidden()); + setDisplayOnCalls(configurationManager.popupMode()); + + ///////////////////////// + ////Accounts settings//// + ///////////////////////// + +// loadAccountList(); + + + //Stun settings + setEnableStun(configurationManager.isStunEnabled()); + setStunServer(configurationManager.getStunServer()); + + + ////////////////////// + ////Audio settings//// + ////////////////////// + + //Audio Interface settings + int audioManager = configurationManager.getAudioManager(); + qDebug() << "audioManager = " << audioManager; + setInterface(audioManager); + + //ringtones settings + setEnableRingtones(configurationManager.isRingtoneEnabled()); + QString ringtone = configurationManager.getRingtoneChoice(); + if(ringtone.isEmpty()) + { + setRingtone(QString(SHARE_INSTALL_PREFIX) + "sflphone/ringtones/konga.ul"); + } + else + { + setRingtone(ringtone); + } + + //codecs settings + setActiveCodecList(configurationManager.getActiveCodecList()); + + qDebug() << "configurationManager.getCurrentAudioOutputPlugin() = " << configurationManager.getCurrentAudioOutputPlugin(); + setAlsaPlugin(configurationManager.getCurrentAudioOutputPlugin()); + bool ok; + QStringList devices = configurationManager.getCurrentAudioDevicesIndex(); + qDebug() << "inputDevice = " << devices[1]; + int inputDevice = devices[1].toInt(& ok); + if(!ok) qDebug() << "inputDevice is not a number"; + setAlsaInputDevice(inputDevice); + + qDebug() << "outputDevice = " << devices[0]; + int outputDevice = devices[0].toInt(& ok); + if(!ok) qDebug() << "outputDevice is not a number"; + setAlsaOutputDevice(outputDevice); + + + //pulseaudio settings + setPulseAudioVolumeAlter(configurationManager.getPulseAppVolumeControl()); + + /////////////////////// + ////Record settings//// + /////////////////////// + + QString recordPath = configurationManager.getRecordPath(); + if(! recordPath.isEmpty()) + { + setDestinationFolder(recordPath); + } + else + { + setDestinationFolder(QDir::home().path()); + } + + + + ///////////////////////////// + ////Address book settings//// + ///////////////////////////// + + MapStringInt addressBookSettings = configurationManager.getAddressbookSettings().value(); + qDebug() << "getAddressbookSettings() : " << addressBookSettings; + setMaxResults(addressBookSettings[ADDRESSBOOK_MAX_RESULTS]); + setDisplayPhoto(addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO]); + setBusiness(addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS]); + setMobile(addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE]); + setHome(addressBookSettings[ADDRESSBOOK_DISPLAY_HOME]); + + ///////////////////////////// + ///////Hooks settings//////// + ///////////////////////////// + + MapStringString hooksSettings = configurationManager.getHookSettings().value(); + qDebug() << "getHooksSettings() : " << hooksSettings; + setAddPrefix(hooksSettings[HOOKS_ENABLED]=="1"); + setPrepend(hooksSettings[HOOKS_ADD_PREFIX]); + setEnableHooksSIP(hooksSettings[HOOKS_SIP_ENABLED]=="1"); + setEnableHooksIAX(hooksSettings[HOOKS_IAX2_ENABLED]=="1"); + setHooksSIPHeader(hooksSettings[HOOKS_SIP_FIELD]); + setHooksCommand(hooksSettings[HOOKS_COMMAND]); +} + +void ConfigurationSkeleton::writeConfig() +{ + qDebug() << "\nWriting config"; + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + + + //////////////////////// + ////General settings//// + //////////////////////// + + //Call history settings + configurationManager.setHistoryLimit(historyMax()); + //SIP port settings + configurationManager.setSipPort(sIPPort()); + + + //////////////////////// + ////Display settings//// + //////////////////////// + + //Notification settings + if(notifOnCalls() != configurationManager.getNotify()) configurationManager.setNotify(); + if(notifOnMessages() != configurationManager.getMailNotify()) configurationManager.setMailNotify(); + + //Window display settings + //WARNING états inversés + if(displayOnStart() == configurationManager.isStartHidden()) configurationManager.startHidden(); + if(displayOnCalls() != configurationManager.popupMode()) configurationManager.switchPopupMode(); + + ///////////////////////// + ////Accounts settings//// + ///////////////////////// + +// saveAccountList(); + + + //Stun settings + if(enableStun() != configurationManager.isStunEnabled()) configurationManager.enableStun(); + configurationManager.setStunServer(stunServer()); + + ////////////////////// + ////Audio settings//// + ////////////////////// + + //Audio Interface settings + int prevManager = configurationManager.getAudioManager(); + int newManager = interface(); + if(prevManager != newManager) + { + configurationManager.setAudioManager(newManager); + } + + //ringtones settings + if(enableRingtones() != configurationManager.isRingtoneEnabled()) configurationManager.ringtoneEnabled(); + configurationManager.setRingtoneChoice(ringtone()); + + //codecs settings + configurationManager.setActiveCodecList(activeCodecList()); + + + //alsa settings + if(prevManager == CONST_ALSA && newManager == EnumInterface::ALSA) + { + qDebug() << "setting alsa settings"; + configurationManager.setOutputAudioPlugin(alsaPlugin()); + configurationManager.setAudioInputDevice(alsaInputDevice()); + configurationManager.setAudioOutputDevice(alsaOutputDevice()); + } + //pulseaudio settings + if(newManager == EnumInterface::PulseAudio) + { + qDebug() << "setting pulseaudio settings"; + if(pulseAudioVolumeAlter() != configurationManager.getPulseAppVolumeControl()) configurationManager.setPulseAppVolumeControl(); + } + + + /////////////////////// + ////Record settings//// + /////////////////////// + + QString destination = destinationFolder(); + qDebug() << destination ; + configurationManager.setRecordPath(destination); + + + ///////////////////////////// + ////Address Book settings//// + ///////////////////////////// + + MapStringInt addressBookSettings = MapStringInt(); + addressBookSettings[ADDRESSBOOK_MAX_RESULTS] = maxResults(); + addressBookSettings[ADDRESSBOOK_DISPLAY_CONTACT_PHOTO] = displayPhoto(); + addressBookSettings[ADDRESSBOOK_DISPLAY_BUSINESS] = business(); + addressBookSettings[ADDRESSBOOK_DISPLAY_MOBILE] = mobile(); + addressBookSettings[ADDRESSBOOK_DISPLAY_HOME] = home(); + configurationManager.setAddressbookSettings(addressBookSettings); + + ///////////////////////////// + ///////Hooks settings//////// + ///////////////////////////// + + MapStringString hooksSettings = MapStringString(); + hooksSettings[HOOKS_ENABLED] = addPrefix() ? "1" : "0"; + hooksSettings[HOOKS_ADD_PREFIX] = prepend(); + hooksSettings[HOOKS_SIP_ENABLED] = enableHooksSIP() ? "1" : "0"; + hooksSettings[HOOKS_IAX2_ENABLED] = enableHooksIAX() ? "1" : "0"; + hooksSettings[HOOKS_SIP_FIELD] = hooksSIPHeader(); + hooksSettings[HOOKS_COMMAND] = hooksCommand(); + configurationManager.setHookSettings(hooksSettings); + + readConfig(); +} + diff --git a/sflphone-client-kde/src/conf/ConfigurationSkeleton.h b/sflphone-client-kde/src/conf/ConfigurationSkeleton.h index f89fe6223759f9683f2e93736c27fa73554486c6..a7f31d68b405aac9198aba9312aa939291bebc32 100644 --- a/sflphone-client-kde/src/conf/ConfigurationSkeleton.h +++ b/sflphone-client-kde/src/conf/ConfigurationSkeleton.h @@ -23,7 +23,7 @@ #include <QWidget> -#include "settings.h" +#include "kcfg_settings.h" /** @author Jérémy Quentin <jeremy.quentin@gmail.com> @@ -31,10 +31,28 @@ class ConfigurationSkeleton : public ConfigurationSkeletonBase { Q_OBJECT + +private: + static ConfigurationSkeleton * instance; + public: - ConfigurationSkeleton(); + ConfigurationSkeleton(); + + ~ConfigurationSkeleton(); + + virtual void readConfig(); + + virtual void writeConfig(); + + + static ConfigurationSkeleton * self(); + + +// protected: + +// virtual void usrReadConfig(); + - ~ConfigurationSkeleton(); }; diff --git a/sflphone-client-kde/src/conf/dlgaccounts.cpp b/sflphone-client-kde/src/conf/dlgaccounts.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4efd6a81a18c8ac572e20bd3c58a5becc2b52273 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaccounts.cpp @@ -0,0 +1,358 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgaccounts.h" + +#include <QtGui/QInputDialog> + +#include "configurationmanager_interface_singleton.h" +#include "sflphone_kdeview.h" +#include "sflphone_const.h" +#include "conf/ConfigurationDialog.h" + +DlgAccounts::DlgAccounts(KConfigDialog *parent) + : QWidget(parent) +{ + setupUi(this); + + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + QStyle * style = QApplication::style(); + button_accountUp->setIcon(style->standardIcon(QStyle::SP_ArrowUp)); + button_accountDown->setIcon(style->standardIcon(QStyle::SP_ArrowDown)); + loadAccountList(); + accountListHasChanged = false; + toolButton_accountsApply->setEnabled(false); + + connect(edit1_alias, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(edit2_protocol, SIGNAL(currentIndexChanged(int)), + this, SLOT(changedAccountList())); + connect(edit3_server, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(edit4_user, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(edit5_password, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(edit6_mailbox, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); + connect(button_accountUp, SIGNAL(clicked()), + this, SLOT(changedAccountList())); + connect(button_accountDown, SIGNAL(clicked()), + this, SLOT(changedAccountList())); + connect(button_accountAdd, SIGNAL(clicked()), + this, SLOT(changedAccountList())); + connect(button_accountRemove, SIGNAL(clicked()), + this, SLOT(changedAccountList())); + + connect(&configurationManager, SIGNAL(accountsChanged()), + this, SLOT(updateAccountStates())); + + + connect(this, SIGNAL(updateButtons()), parent, SLOT(updateButtons())); +} + + +DlgAccounts::~DlgAccounts() +{ +} + +void DlgAccounts::saveAccountList() +{ + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + disconnectAccountsChangedSignal(); + //save the account being edited + if(listWidget_accountList->currentItem()) + saveAccount(listWidget_accountList->currentItem()); + QStringList accountIds= QStringList(configurationManager.getAccountList().value()); + //create or update each account from accountList + for (int i = 0; i < accountList->size(); i++){ + Account & current = (*accountList)[i]; + QString currentId; + //if the account has no instanciated id, it has just been created in the client + if(current.isNew()) + { + MapStringString details = current.getAccountDetails(); + currentId = configurationManager.addAccount(details); + current.setAccountId(currentId); + } + //if the account has an instanciated id but it's not in configurationManager + else{ + if(! accountIds.contains(current.getAccountId())) + { + qDebug() << "The account with id " << current.getAccountId() << " doesn't exist. It might have been removed by another SFLPhone client."; + currentId = QString(); + } + else + { + configurationManager.setAccountDetails(current.getAccountId(), current.getAccountDetails()); + currentId = QString(current.getAccountId()); + } + } + qDebug() << currentId << " : " << current.isChecked(); + configurationManager.sendRegister(currentId, current.isChecked() ? 1 : 0 ); + } + //remove accounts that are in the configurationManager but not in the client + for (int i = 0; i < accountIds.size(); i++) + { + if(! accountList->getAccountById(accountIds[i])) + { + qDebug() << "remove account " << accountIds[i]; + configurationManager.removeAccount(accountIds[i]); + } + } + configurationManager.setAccountsOrder(accountList->getOrderedList()); + connectAccountsChangedSignal(); +} + +void DlgAccounts::connectAccountsChangedSignal() +{ + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + connect(&configurationManager, SIGNAL(accountsChanged()), + this, SLOT(on1_accountsChanged())); +} + +void DlgAccounts::disconnectAccountsChangedSignal() +{ + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + disconnect(&configurationManager, SIGNAL(accountsChanged()), + this, SLOT(on1_accountsChanged())); +} + + +void DlgAccounts::saveAccount(QListWidgetItem * item) +{ + if(! item) { qDebug() << "Attempting to save details of an account from a NULL item"; return; } + + Account * account = accountList->getAccountByItem(item); + if(! account) { qDebug() << "Attempting to save details of an unexisting account : " << item->text(); return; } + + account->setAccountDetail(ACCOUNT_ALIAS, edit1_alias->text()); + QString protocolsTab[] = ACCOUNT_TYPES_TAB; + account->setAccountDetail(ACCOUNT_TYPE, protocolsTab[edit2_protocol->currentIndex()]); + account->setAccountDetail(ACCOUNT_HOSTNAME, edit3_server->text()); + account->setAccountDetail(ACCOUNT_USERNAME, edit4_user->text()); + account->setAccountDetail(ACCOUNT_PASSWORD, edit5_password->text()); + account->setAccountDetail(ACCOUNT_MAILBOX, edit6_mailbox->text()); + account->setAccountDetail(ACCOUNT_ENABLED, account->isChecked() ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE); +} + +void DlgAccounts::loadAccount(QListWidgetItem * item) +{ + if(! item ) { qDebug() << "Attempting to load details of an account from a NULL item"; return; } + + Account * account = accountList->getAccountByItem(item); + if(! account ) { qDebug() << "Attempting to load details of an unexisting account"; return; } + + edit1_alias->setText( account->getAccountDetail(ACCOUNT_ALIAS)); + + QString protocolsTab[] = ACCOUNT_TYPES_TAB; + QList<QString> * protocolsList = new QList<QString>(); + for(int i = 0 ; i < (int) (sizeof(protocolsTab) / sizeof(QString)) ; i++) + { + protocolsList->append(protocolsTab[i]); + } + QString accountName = account->getAccountDetail(ACCOUNT_TYPE); + int protocolIndex = protocolsList->indexOf(accountName); + delete protocolsList; + + edit2_protocol->setCurrentIndex( (protocolIndex < 0) ? 0 : protocolIndex ); + edit3_server->setText( account->getAccountDetail(ACCOUNT_HOSTNAME)); + edit4_user->setText( account->getAccountDetail(ACCOUNT_USERNAME)); + edit5_password->setText( account->getAccountDetail(ACCOUNT_PASSWORD)); + edit6_mailbox->setText( account->getAccountDetail(ACCOUNT_MAILBOX)); + QString status = account->getAccountDetail(ACCOUNT_STATUS); + edit7_state->setText( "<FONT COLOR=\"" + account->getStateColorName() + "\">" + status + "</FONT>" ); + +} + +void DlgAccounts::loadAccountList() +{ + qDebug() << "loadAccountList"; + accountList = new AccountList(); + //initialize the QListWidget object with the AccountList + listWidget_accountList->clear(); + for (int i = 0; i < accountList->size(); ++i){ + addAccountToAccountList(&(*accountList)[i]); + } + if (listWidget_accountList->count() > 0 && listWidget_accountList->currentItem() == NULL) + listWidget_accountList->setCurrentRow(0); + else + frame2_editAccounts->setEnabled(false); +} + +void DlgAccounts::addAccountToAccountList(Account * account) +{ + qDebug() << "addAccountToAccountList"; + QListWidgetItem * item = account->getItem(); + QWidget * widget = account->getItemWidget(); + connect(widget, SIGNAL(checkStateChanged()), + this, SLOT(changedAccountList())); + qDebug() << "item->isHidden()" << item->isHidden(); + listWidget_accountList->addItem(item); + qDebug() << "addAccountToAccountList2"; + listWidget_accountList->setItemWidget(item, widget); +} + +void DlgAccounts::changedAccountList() +{ + accountListHasChanged = true; +// ((ConfigurationDialogKDE *)parent())->updateButtons(); + emit updateButtons(); + toolButton_accountsApply->setEnabled(hasChanged()); +} + + + +void DlgAccounts::on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ) +{ + qDebug() << "on_listWidget_accountList_currentItemChanged"; + if(previous) + saveAccount(previous); + if(current) + loadAccount(current); + updateAccountListCommands(); +} + +void DlgAccounts::on_button_accountUp_clicked() +{ + qDebug() << "on_button_accountUp_clicked"; + int currentRow = listWidget_accountList->currentRow(); + QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); + Account * account = accountList->getAccountByItem(prevItem); + //we need to build a new item to set the itemWidget back + account->initAccountItem(); + QListWidgetItem * item = account->getItem(); + AccountItemWidget * widget = account->getItemWidget(); + accountList->upAccount(currentRow); + listWidget_accountList->insertItem(currentRow - 1 , item); + listWidget_accountList->setItemWidget(item, widget); + listWidget_accountList->setCurrentItem(item); +// changedAccountList(); +} + +void DlgAccounts::on_button_accountDown_clicked() +{ + qDebug() << "on_button_accountDown_clicked"; + int currentRow = listWidget_accountList->currentRow(); + QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); + Account * account = accountList->getAccountByItem(prevItem); + //we need to build a new item to set the itemWidget back + account->initAccountItem(); + QListWidgetItem * item = account->getItem(); + AccountItemWidget * widget = account->getItemWidget(); + accountList->downAccount(currentRow); + listWidget_accountList->insertItem(currentRow + 1 , item); + listWidget_accountList->setItemWidget(item, widget); + listWidget_accountList->setCurrentItem(item); +// changedAccountList(); +} + +void DlgAccounts::on_button_accountAdd_clicked() +{ + qDebug() << "on_button_accountAdd_clicked"; + QString itemName = QInputDialog::getText(this, "New account", "Enter new account's alias"); + itemName = itemName.simplified(); + if (!itemName.isEmpty()) { + Account * account = accountList->addAccount(itemName); + addAccountToAccountList(account); + int r = listWidget_accountList->count() - 1; + listWidget_accountList->setCurrentRow(r); + frame2_editAccounts->setEnabled(true); + } +// changedAccountList(); +} + +void DlgAccounts::on_button_accountRemove_clicked() +{ + qDebug() << "on_button_accountRemove_clicked"; + int r = listWidget_accountList->currentRow(); + QListWidgetItem * item = listWidget_accountList->takeItem(r); + accountList->removeAccount(item); + listWidget_accountList->setCurrentRow( (r >= listWidget_accountList->count()) ? r-1 : r ); +// changedAccountList(); +} + +void DlgAccounts::on_toolButton_accountsApply_clicked() +{ + qDebug() << "on_toolButton_accountsApply_clicked"; + applyCustomSettings(); +} + +void DlgAccounts::applyCustomSettings() +{ + qDebug() << "applyCustomSettings"; + if(hasChanged()) + { + toolButton_accountsApply->setEnabled(false); + saveAccountList(); + loadAccountList(); + accountListHasChanged = false; + } +} + +void DlgAccounts::on_edit1_alias_textChanged(const QString & text) +{ + qDebug() << "on_edit1_alias_textChanged"; + AccountItemWidget * widget = (AccountItemWidget *) listWidget_accountList->itemWidget(listWidget_accountList->currentItem()); + widget->setAccountText(text); +} + +void DlgAccounts::updateAccountListCommands() +{ + bool buttonsEnabled[4] = {true,true,true,true}; + if(! listWidget_accountList->currentItem()) + { + buttonsEnabled[0] = false; + buttonsEnabled[1] = false; + buttonsEnabled[3] = false; + } + else if(listWidget_accountList->currentRow() == 0) + { + buttonsEnabled[0] = false; + } + else if(listWidget_accountList->currentRow() == listWidget_accountList->count() - 1) + { + buttonsEnabled[1] = false; + } + button_accountUp->setEnabled(buttonsEnabled[0]); + button_accountDown->setEnabled(buttonsEnabled[1]); + button_accountAdd->setEnabled(buttonsEnabled[2]); + button_accountRemove->setEnabled(buttonsEnabled[3]); +} + +void DlgAccounts::updateAccountStates() +{ + qDebug() << "updateAccountStates"; + qDebug() << accountList->size(); + for (int i = 0; i < accountList->size(); i++) + { + Account & current = accountList->getAccount(i); + current.updateState(); + } + qDebug() << accountList->size(); +} + + +bool DlgAccounts::hasChanged() +{ +// qDebug() << "DlgAudio::hasChanged"; + return accountListHasChanged; +} + diff --git a/sflphone-client-kde/src/ConfigDialog.h b/sflphone-client-kde/src/conf/dlgaccounts.h similarity index 66% rename from sflphone-client-kde/src/ConfigDialog.h rename to sflphone-client-kde/src/conf/dlgaccounts.h index a0c0b500f35b14285e46be85e01d84daee78fe52..d0d09e0585d09f2fb48dcf2e7753414293899c66 100644 --- a/sflphone-client-kde/src/ConfigDialog.h +++ b/sflphone-client-kde/src/conf/dlgaccounts.h @@ -18,84 +18,59 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - -#ifndef HEADER_CONFIGDIALOG -#define HEADER_CONFIGDIALOG +#ifndef DLGACCOUNTS_H +#define DLGACCOUNTS_H -#include <QtGui/QTableWidgetItem> -#include <QtGui/QListWidgetItem> -#include <QtCore/QString> -#include <QtGui/QAbstractButton> -#include <QErrorMessage> +#include <QWidget> +#include <kconfigdialog.h> -#include "ui_ConfigDialog.h" +#include "ui_dlgaccountsbase.h" +#include "Account.h" #include "AccountList.h" -#include "sflphone_kdeview.h" -class sflphone_kdeView; - -class ConfigurationDialog : public QDialog, private Ui::ConfigurationDialog +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgAccounts : public QWidget, public Ui_DlgAccountsBase { - Q_OBJECT - -private: - static AccountList * accountList; - QErrorMessage * errorWindow; - bool accountsChangedEnableWarning; - - +Q_OBJECT public: + DlgAccounts(KConfigDialog *parent = 0); - //Constructors & Destructors - ConfigurationDialog(sflphone_kdeView * parent); - ~ConfigurationDialog(); - - //Getters - static AccountList * getAccountList(); - - //Setters - void setPage(int page); - void addAccountToAccountList(Account * account); - - void loadAccount(QListWidgetItem * item); + ~DlgAccounts(); void saveAccount(QListWidgetItem * item); + void loadAccount(QListWidgetItem * item); + +private: + AccountList * accountList; + bool accountListHasChanged; - void loadAccountList(); +public slots: void saveAccountList(); + void loadAccountList(); + void applyCustomSettings(); - void loadCodecs(); - void saveCodecs(); - - void loadOptions(); - void saveOptions(); + bool hasChanged(); - //Updates - void updateCodecListCommands(); - void updateAccountListCommands(); - void updateAccountStates(); - private slots: void changedAccountList(); void connectAccountsChangedSignal(); void disconnectAccountsChangedSignal(); - - void on_toolButton_codecUp_clicked(); - void on_toolButton_codecDown_clicked(); void on_button_accountUp_clicked(); void on_button_accountDown_clicked(); void on_button_accountAdd_clicked(); void on_button_accountRemove_clicked(); void on_edit1_alias_textChanged(const QString & text); void on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ); - void on_spinBox_SIPPort_valueChanged ( int value ); - void on_buttonBoxDialog_clicked(QAbstractButton * button); - void on_tableWidget_codecs_currentCellChanged(int currentRow); void on_toolButton_accountsApply_clicked(); + void updateAccountStates(); + void addAccountToAccountList(Account * account); + void updateAccountListCommands(); - void on1_accountsChanged(); - void on1_parametersChanged(); - void on1_errorAlert(int code); +signals: + void updateButtons(); + }; -#endif +#endif diff --git a/sflphone-client-kde/src/conf/dlgaccountsbase.ui b/sflphone-client-kde/src/conf/dlgaccountsbase.ui new file mode 100644 index 0000000000000000000000000000000000000000..03ada7350fff9d6ca4b2cd9f6a553ca878244cc2 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaccountsbase.ui @@ -0,0 +1,405 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgAccountsBase</class> + <widget class="QWidget" name="DlgAccountsBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>603</width> + <height>307</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QWidget" name="widget1_configAccounts" native="true"> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="sizeConstraint"> + <enum>QLayout::SetDefaultConstraint</enum> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QFrame" name="frame1_accountList"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <widget class="QListWidget" name="listWidget_accountList"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="dragEnabled"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_accountListHandle"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>16777215</height> + </size> + </property> + <property name="layoutDirection"> + <enum>Qt::RightToLeft</enum> + </property> + <property name="title"> + <string/> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="sizeConstraint"> + <enum>QLayout::SetNoConstraint</enum> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="button_accountRemove"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Remove this account</string> + </property> + <property name="icon"> + <iconset resource="../qrc/resources.qrc"> + <normaloff>:/images/icons/remove.png</normaloff>:/images/icons/remove.png</iconset> + </property> + <property name="shortcut"> + <string>Backspace, Return</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="button_accountAdd"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="sizeIncrement"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Add a new account</string> + </property> + <property name="icon"> + <iconset resource="../qrc/resources.qrc"> + <normaloff>:/images/icons/add.png</normaloff>:/images/icons/add.png</iconset> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="button_accountDown"> + <property name="text"> + <string>Down</string> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="button_accountUp"> + <property name="text"> + <string>Up</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QToolButton" name="toolButton_accountsApply"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string>Apply</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QFrame" name="frame2_editAccounts"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QFormLayout" name="formLayout_2"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label1_alias"> + <property name="text"> + <string>&Alias</string> + </property> + <property name="buddy"> + <cstring>edit1_alias</cstring> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="edit1_alias"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label2_protocol"> + <property name="text"> + <string>&Protocol</string> + </property> + <property name="buddy"> + <cstring>edit2_protocol</cstring> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QComboBox" name="edit2_protocol"> + <item> + <property name="text"> + <string>SIP</string> + </property> + </item> + <item> + <property name="text"> + <string>IAX</string> + </property> + </item> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label3_server"> + <property name="text"> + <string>&Server</string> + </property> + <property name="buddy"> + <cstring>edit3_server</cstring> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLineEdit" name="edit3_server"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label4_user"> + <property name="text"> + <string>&User</string> + </property> + <property name="buddy"> + <cstring>edit4_user</cstring> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLineEdit" name="edit4_user"/> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label5_password"> + <property name="text"> + <string>Pass&word</string> + </property> + <property name="buddy"> + <cstring>edit5_password</cstring> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QLineEdit" name="edit5_password"> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label6_mailbox"> + <property name="text"> + <string>&Mailbox</string> + </property> + <property name="buddy"> + <cstring>edit6_mailbox</cstring> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLineEdit" name="edit6_mailbox"/> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label7_state"> + <property name="text"> + <string>State</string> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QLabel" name="edit7_state"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_commonSettings"> + <property name="title"> + <string/> + </property> + <layout class="QVBoxLayout" name="verticalLayout_10"> + <item> + <widget class="QLabel" name="label_commonSettings"> + <property name="text"> + <string>Stun settings will be applied on each account</string> + </property> + </widget> + </item> + <item> + <layout class="QFormLayout" name="formLayout_commonSettings"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QCheckBox" name="kcfg_enableStun"> + <property name="text"> + <string>Enable Stun</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLineEdit" name="kcfg_stunServer"> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <resources> + <include location="../qrc/resources.qrc"/> + </resources> + <connections> + <connection> + <sender>kcfg_enableStun</sender> + <signal>toggled(bool)</signal> + <receiver>kcfg_stunServer</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>75</x> + <y>274</y> + </hint> + <hint type="destinationlabel"> + <x>145</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/sflphone-client-kde/src/conf/dlgaddressbook.cpp b/sflphone-client-kde/src/conf/dlgaddressbook.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e9f69d967a9daca2c3a6024d052b89a5cf3e1c29 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaddressbook.cpp @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgaddressbook.h" + +DlgAddressBook::DlgAddressBook(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); +} + + +DlgAddressBook::~DlgAddressBook() +{ +} + + diff --git a/sflphone-client-kde/src/conf/dlgaddressbook.h b/sflphone-client-kde/src/conf/dlgaddressbook.h new file mode 100644 index 0000000000000000000000000000000000000000..6a6852f6e64a9fef0a9bbe85b2c29b1d8447e983 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaddressbook.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGADDRESSBOOK_H +#define DLGADDRESSBOOK_H + +#include <QWidget> + +#include "ui_dlgaddressbookbase.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgAddressBook : public QWidget, public Ui_DlgAddressBookBase +{ +Q_OBJECT +public: + DlgAddressBook(QWidget *parent = 0); + + ~DlgAddressBook(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlgaddressbookbase.ui b/sflphone-client-kde/src/conf/dlgaddressbookbase.ui new file mode 100644 index 0000000000000000000000000000000000000000..0048b161954c45f5831794baff6ecf528c610c0f --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaddressbookbase.ui @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgAddressBookBase</class> + <widget class="QWidget" name="DlgAddressBookBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>350</width> + <height>250</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QWidget" name="widget_configAddressBookGeneral" native="true"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QWidget" name="widget_maxResults" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="spacing"> + <number>-1</number> + </property> + <property name="margin"> + <number>5</number> + </property> + <item> + <widget class="QLabel" name="label_maxResults"> + <property name="text"> + <string>Maximum &results</string> + </property> + <property name="buddy"> + <cstring>horizontalSlider_maxResults</cstring> + </property> + </widget> + </item> + <item> + <widget class="QSlider" name="horizontalSlider_maxResults"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>25</number> + </property> + <property name="maximum"> + <number>50</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="KIntSpinBox" name="kcfg_maxResults"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_displayPhoto"> + <property name="text"> + <string>Display &photo if available</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_displayTypes"> + <property name="title"> + <string>Display phone numbers of these &types :</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_7"> + <item> + <widget class="QCheckBox" name="kcfg_business"> + <property name="text"> + <string>&Work</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_mobile"> + <property name="text"> + <string>&Mobile</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_home"> + <property name="text"> + <string>&Home</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_configAddressBook"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>72</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KIntSpinBox</class> + <extends>QSpinBox</extends> + <header>knuminput.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections> + <connection> + <sender>horizontalSlider_maxResults</sender> + <signal>valueChanged(int)</signal> + <receiver>kcfg_maxResults</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>223</x> + <y>35</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>33</y> + </hint> + </hints> + </connection> + <connection> + <sender>kcfg_maxResults</sender> + <signal>valueChanged(int)</signal> + <receiver>horizontalSlider_maxResults</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>294</x> + <y>36</y> + </hint> + <hint type="destinationlabel"> + <x>215</x> + <y>33</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/sflphone-client-kde/src/conf/dlgaudio.cpp b/sflphone-client-kde/src/conf/dlgaudio.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a95a03ea3d6a16a8e3458f95617ea8d13f557b8c --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaudio.cpp @@ -0,0 +1,287 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgaudio.h" + +#include <KLineEdit> +#include "configurationmanager_interface_singleton.h" +#include "conf/ConfigurationSkeleton.h" +#include "conf/ConfigurationDialog.h" + +#include "sflphone_const.h" + +DlgAudio::DlgAudio(KConfigDialog *parent) + : QWidget(parent) +{ + setupUi(this); + + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + QStyle * style = QApplication::style(); + + KUrl url = KUrl(SHARE_INSTALL_PREFIX); + url.cd("sflphone/ringtones"); + KUrlRequester_ringtone->setUrl(url); + KUrlRequester_ringtone->lineEdit()->setObjectName("kcfg_ringtone"); + + codecTableHasChanged = false; + toolButton_codecUp->setIcon(style->standardIcon(QStyle::SP_ArrowUp)); + toolButton_codecDown->setIcon(style->standardIcon(QStyle::SP_ArrowDown)); + tableWidget_codecs->verticalHeader()->hide(); + tableWidget_codecs->setSelectionBehavior(QAbstractItemView::SelectRows); + + updateAlsaSettings(); + connect(box_alsaPlugin, SIGNAL(currentIndexChanged(int)), parent, SLOT(updateButtons())); + connect(tableWidget_codecs, SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(codecTableChanged())); + connect(toolButton_codecUp, SIGNAL(clicked()), this, SLOT(codecTableChanged())); + connect(toolButton_codecDown, SIGNAL(clicked()), this, SLOT(codecTableChanged())); + + connect(this, SIGNAL(updateButtons()), parent, SLOT(updateButtons())); +} + + +DlgAudio::~DlgAudio() +{ +} + +void DlgAudio::updateWidgets() +{ +// qDebug() << "DlgAudio::updateWidgets"; + //alsa Plugin + ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); + box_alsaPlugin->setCurrentIndex(box_alsaPlugin->findText(skeleton->alsaPlugin())); + + //codecList + qDebug() << "loadCodecs"; + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + QStringList codecList = configurationManager.getCodecList(); + QStringList activeCodecList = skeleton->activeCodecList(); + #if QT_VERSION >= 0x040500 + activeCodecList.removeDuplicates(); + #else + for (int i = 0 ; i < activeCodecList.size() ; i++) + { + if(activeCodecList.lastIndexOf(activeCodecList[i]) != i) + { + activeCodecList.removeAt(i); + i--; + } + } + #endif + + for (int i=0 ; i<activeCodecList.size() ; i++) + { + if(! codecList.contains(activeCodecList[i])) + { + activeCodecList.removeAt(i); + i--; + } + } + QStringList codecListToDisplay = activeCodecList; + for (int i=0 ; i<codecList.size() ; i++) + { + if(! activeCodecList.contains(codecList[i])) + { + codecListToDisplay << codecList[i]; + } + } + qDebug() << "codecList = " << codecList; + qDebug() << "activeCodecList" << activeCodecList; + qDebug() << "codecListToDisplay" << codecListToDisplay; + tableWidget_codecs->setRowCount(0); + for(int i=0 ; i<codecListToDisplay.size() ; i++) + { + bool ok; + qDebug() << codecListToDisplay[i]; + QString payloadStr = QString(codecListToDisplay[i]); + int payload = payloadStr.toInt(&ok); + if(!ok) + qDebug() << "The codec's payload sent by the configurationManager is not a number : " << codecListToDisplay[i]; + else + { + QStringList details = configurationManager.getCodecDetails(payload); + tableWidget_codecs->insertRow(i); + tableWidget_codecs->setVerticalHeaderItem (i, new QTableWidgetItem()); + tableWidget_codecs->verticalHeaderItem (i)->setText(payloadStr); + tableWidget_codecs->setItem(i,0,new QTableWidgetItem("")); + tableWidget_codecs->setItem(i,1,new QTableWidgetItem(details[CODEC_NAME])); + tableWidget_codecs->setItem(i,2,new QTableWidgetItem(details[CODEC_SAMPLE_RATE])); + tableWidget_codecs->setItem(i,3,new QTableWidgetItem(details[CODEC_BIT_RATE])); + tableWidget_codecs->setItem(i,4,new QTableWidgetItem(details[CODEC_BANDWIDTH])); + tableWidget_codecs->item(i,0)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled); + tableWidget_codecs->item(i,0)->setCheckState(activeCodecList.contains(codecListToDisplay[i]) ? Qt::Checked : Qt::Unchecked); + tableWidget_codecs->item(i,1)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + tableWidget_codecs->item(i,2)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + tableWidget_codecs->item(i,3)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + tableWidget_codecs->item(i,4)->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); + + qDebug() << "Added to codecs : " << payloadStr << " , " << details[CODEC_NAME]; + } + } + tableWidget_codecs->resizeColumnsToContents(); + tableWidget_codecs->resizeRowsToContents(); + codecTableHasChanged = false; +} + + +void DlgAudio::updateSettings() +{ +// qDebug() << "DlgAudio::updateSettings"; + //alsaPlugin + ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); + skeleton->setAlsaPlugin(box_alsaPlugin->currentText()); + + //codecList + QStringList activeCodecs; + for(int i = 0 ; i < tableWidget_codecs->rowCount() ; i++) + { + if(tableWidget_codecs->item(i,0)->checkState() == Qt::Checked) + { + activeCodecs << tableWidget_codecs->verticalHeaderItem(i)->text(); + } + } + qDebug() << "Calling setActiveCodecList with list : " << activeCodecs ; + skeleton->setActiveCodecList(activeCodecs); + codecTableHasChanged = false; +} + +bool DlgAudio::hasChanged() +{ +// qDebug() << "DlgAudio::hasChanged"; + ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); + qDebug() << "skeleton->alsaPlugin() = " << skeleton->alsaPlugin(); + qDebug() << "box_alsaPlugin->currentText() = " << box_alsaPlugin->currentText(); + bool alsaPluginHasChanged = + skeleton->interface() == ConfigurationSkeleton::EnumInterface::ALSA + && skeleton->alsaPlugin() != box_alsaPlugin->currentText(); + return alsaPluginHasChanged || codecTableHasChanged; +} + +void DlgAudio::updateAlsaSettings() +{ + qDebug() << "DlgAudio::updateAlsaSettings"; + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + if(configurationManager.getAudioManager() == ConfigurationSkeleton::EnumInterface::ALSA) + { + ConfigurationSkeleton * skeleton = ConfigurationSkeleton::self(); + + QStringList pluginList = configurationManager.getOutputAudioPluginList(); + box_alsaPlugin->clear(); + box_alsaPlugin->addItems(pluginList); + int index = box_alsaPlugin->findText(skeleton->alsaPlugin()); + if(index < 0) index = 0; + box_alsaPlugin->setCurrentIndex(index); + + QStringList inputDeviceList = configurationManager.getAudioInputDeviceList(); + kcfg_alsaInputDevice->clear(); + kcfg_alsaInputDevice->addItems(inputDeviceList); + kcfg_alsaInputDevice->setCurrentIndex(skeleton->alsaInputDevice()); + + QStringList outputDeviceList = configurationManager.getAudioOutputDeviceList(); + kcfg_alsaOutputDevice->clear(); + kcfg_alsaOutputDevice->addItems(outputDeviceList); + kcfg_alsaOutputDevice->setCurrentIndex(skeleton->alsaOutputDevice()); + groupBox_alsa->setEnabled(true); + } + else + { +// box_alsaPlugin->clear(); +// kcfg_alsaInputDevice->clear(); +// kcfg_alsaOutputDevice->clear(); + groupBox_alsa->setEnabled(false); + } +} + +void DlgAudio::updateCodecListCommands() +{ + bool buttonsEnabled[2] = {true,true}; + if(! tableWidget_codecs->currentItem()) + { + buttonsEnabled[0] = false; + buttonsEnabled[1] = false; + } + else if(tableWidget_codecs->currentRow() == 0) + { + buttonsEnabled[0] = false; + } + else if(tableWidget_codecs->currentRow() == tableWidget_codecs->rowCount() - 1) + { + buttonsEnabled[1] = false; + } + toolButton_codecUp->setEnabled(buttonsEnabled[0]); + toolButton_codecDown->setEnabled(buttonsEnabled[1]); +} + +void DlgAudio::on_tableWidget_codecs_currentCellChanged(int currentRow) +{ + qDebug() << "on_tableWidget_codecs_currentCellChanged"; + int nbCol = tableWidget_codecs->columnCount(); + for(int i = 0 ; i < nbCol ; i++) + { + tableWidget_codecs->setRangeSelected(QTableWidgetSelectionRange(currentRow, 0, currentRow, nbCol - 1), true); + } + updateCodecListCommands(); +} + +void DlgAudio::on_toolButton_codecUp_clicked() +{ + qDebug() << "on_toolButton_codecUp_clicked"; + int currentCol = tableWidget_codecs->currentColumn(); + int currentRow = tableWidget_codecs->currentRow(); + int nbCol = tableWidget_codecs->columnCount(); + for(int i = 0 ; i < nbCol ; i++) + { + QTableWidgetItem * item1 = tableWidget_codecs->takeItem(currentRow, i); + QTableWidgetItem * item2 = tableWidget_codecs->takeItem(currentRow - 1, i); + tableWidget_codecs->setItem(currentRow - 1, i , item1); + tableWidget_codecs->setItem(currentRow, i , item2); + } + QTableWidgetItem * item1 = tableWidget_codecs->takeVerticalHeaderItem(currentRow); + QTableWidgetItem * item2 = tableWidget_codecs->takeVerticalHeaderItem(currentRow - 1); + tableWidget_codecs->setVerticalHeaderItem(currentRow - 1, item1); + tableWidget_codecs->setVerticalHeaderItem(currentRow, item2); + tableWidget_codecs->setCurrentCell(currentRow - 1, currentCol); +} + +void DlgAudio::on_toolButton_codecDown_clicked() +{ + qDebug() << "on_toolButton_codecDown_clicked"; + int currentCol = tableWidget_codecs->currentColumn(); + int currentRow = tableWidget_codecs->currentRow(); + int nbCol = tableWidget_codecs->columnCount(); + for(int i = 0 ; i < nbCol ; i++) + { + QTableWidgetItem * item1 = tableWidget_codecs->takeItem(currentRow, i); + QTableWidgetItem * item2 = tableWidget_codecs->takeItem(currentRow + 1, i); + tableWidget_codecs->setItem(currentRow + 1, i , item1); + tableWidget_codecs->setItem(currentRow, i , item2); + } + QTableWidgetItem * item1 = tableWidget_codecs->takeVerticalHeaderItem(currentRow); + QTableWidgetItem * item2 = tableWidget_codecs->takeVerticalHeaderItem(currentRow + 1); + tableWidget_codecs->setVerticalHeaderItem(currentRow + 1, item1); + tableWidget_codecs->setVerticalHeaderItem(currentRow, item2); + tableWidget_codecs->setCurrentCell(currentRow + 1, currentCol); +} + + +void DlgAudio::codecTableChanged() +{ + codecTableHasChanged = true; + emit updateButtons(); +} \ No newline at end of file diff --git a/sflphone-client-kde/src/conf/dlgaudio.h b/sflphone-client-kde/src/conf/dlgaudio.h new file mode 100644 index 0000000000000000000000000000000000000000..15c1f8f70b26d0d6dbaf22772282e9ccd9d651b8 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaudio.h @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGAUDIO_H +#define DLGAUDIO_H + +#include <QWidget> +#include <kconfigdialog.h> + +#include "ui_dlgaudiobase.h" +#include "conf/ConfigurationSkeleton.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgAudio : public QWidget, public Ui_DlgAudioBase +{ +Q_OBJECT +public: + DlgAudio(KConfigDialog *parent = 0); + + ~DlgAudio(); + +private: + bool codecTableHasChanged; + +public slots: + void updateWidgets(); + void updateSettings(); + bool hasChanged(); + void updateAlsaSettings(); + +private slots: + void updateCodecListCommands(); + void on_tableWidget_codecs_currentCellChanged(int currentRow); + void on_toolButton_codecUp_clicked(); + void on_toolButton_codecDown_clicked(); + void codecTableChanged(); + +signals: + void updateButtons(); +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlgaudiobase.ui b/sflphone-client-kde/src/conf/dlgaudiobase.ui new file mode 100644 index 0000000000000000000000000000000000000000..20738390f888bc42304bd9e23207e312346b3a10 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgaudiobase.ui @@ -0,0 +1,318 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgAudioBase</class> + <widget class="QWidget" name="DlgAudioBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>467</width> + <height>437</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox1_audio"> + <property name="mouseTracking"> + <bool>false</bool> + </property> + <property name="title"> + <string/> + </property> + <layout class="QFormLayout" name="formLayout_3"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::AllNonFixedFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label_interface"> + <property name="text"> + <string>Audio device</string> + </property> + <property name="buddy"> + <cstring>kcfg_interface</cstring> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QCheckBox" name="kcfg_enableRingtones"> + <property name="text"> + <string>Enable ringtones</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KComboBox" name="kcfg_interface"> + <item> + <property name="text"> + <string>ALSA</string> + </property> + </item> + <item> + <property name="text"> + <string>PulseAudio</string> + </property> + </item> + </widget> + </item> + <item row="2" column="1"> + <widget class="KUrlRequester" name="KUrlRequester_ringtone"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox2_codecs"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>&Codecs</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="spacing"> + <number>-1</number> + </property> + <property name="leftMargin"> + <number>5</number> + </property> + <property name="topMargin"> + <number>2</number> + </property> + <property name="rightMargin"> + <number>5</number> + </property> + <property name="bottomMargin"> + <number>2</number> + </property> + <item> + <widget class="QTableWidget" name="tableWidget_codecs"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>100</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAsNeeded</enum> + </property> + <property name="textElideMode"> + <enum>Qt::ElideRight</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + <property name="horizontalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + <column> + <property name="text"> + <string>Active</string> + </property> + </column> + <column> + <property name="text"> + <string>Name</string> + </property> + </column> + <column> + <property name="text"> + <string>Frequency</string> + </property> + </column> + <column> + <property name="text"> + <string>Bitrate</string> + </property> + </column> + <column> + <property name="text"> + <string>Bandwidth</string> + </property> + </column> + </widget> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_codecsOrder"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <item> + <widget class="QToolButton" name="toolButton_codecUp"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="toolButton_codecDown"> + <property name="text"> + <string/> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QStackedWidget" name="stackedWidget_interfaceSpecificSettings"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="page1_alsa"> + <layout class="QVBoxLayout" name="verticalLayout_20"> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QGroupBox" name="groupBox_alsa"> + <property name="title"> + <string>ALSA settings</string> + </property> + <layout class="QFormLayout" name="formLayout_4"> + <property name="verticalSpacing"> + <number>5</number> + </property> + <property name="leftMargin"> + <number>9</number> + </property> + <item row="3" column="0"> + <widget class="QLabel" name="label2_in"> + <property name="text"> + <string>&In</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label3_out"> + <property name="text"> + <string>&Out</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label1_alsaPugin"> + <property name="text"> + <string>ALSA &plugin</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KComboBox" name="box_alsaPlugin"> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="KComboBox" name="kcfg_alsaInputDevice"> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="KComboBox" name="kcfg_alsaOutputDevice"> + <property name="sizeAdjustPolicy"> + <enum>QComboBox::AdjustToContents</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="page2_pulseAudio"> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <item> + <widget class="QGroupBox" name="groupBox_pulseAudio"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>PulseAudio settings</string> + </property> + <layout class="QFormLayout" name="formLayout_11"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QCheckBox" name="kcfg_pulseAudioVolumeAlter"> + <property name="text"> + <string>Mute other applications during a call</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KComboBox</class> + <extends>QComboBox</extends> + <header>kcombobox.h</header> + </customwidget> + <customwidget> + <class>KUrlRequester</class> + <extends>QFrame</extends> + <header>kurlrequester.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections> + <connection> + <sender>kcfg_interface</sender> + <signal>currentIndexChanged(int)</signal> + <receiver>stackedWidget_interfaceSpecificSettings</receiver> + <slot>setCurrentIndex(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>215</x> + <y>31</y> + </hint> + <hint type="destinationlabel"> + <x>442</x> + <y>337</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/sflphone-client-kde/src/conf/dlgdisplay.cpp b/sflphone-client-kde/src/conf/dlgdisplay.cpp new file mode 100644 index 0000000000000000000000000000000000000000..128bb9fc72a138f8e0f1e43087b3c246011af839 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgdisplay.cpp @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgdisplay.h" + +DlgDisplay::DlgDisplay(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); +} + + +DlgDisplay::~DlgDisplay() +{ +} + + diff --git a/sflphone-client-kde/src/conf/dlgdisplay.h b/sflphone-client-kde/src/conf/dlgdisplay.h new file mode 100644 index 0000000000000000000000000000000000000000..c1e8627f488aaad184a93aad281ce53faa918de4 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgdisplay.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGDISPLAY_H +#define DLGDISPLAY_H + +#include <QWidget> + +#include "ui_dlgdisplaybase.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgDisplay : public QWidget, public Ui_DlgDisplayBase +{ +Q_OBJECT +public: + DlgDisplay(QWidget *parent = 0); + + ~DlgDisplay(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlgdisplaybase.ui b/sflphone-client-kde/src/conf/dlgdisplaybase.ui new file mode 100644 index 0000000000000000000000000000000000000000..ef8cd7ed9f56816af22f11d42b5a1eee76e85a6c --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgdisplaybase.ui @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgDisplayBase</class> + <widget class="QWidget" name="DlgDisplayBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>373</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label1_notifications"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Enable notifications</string> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="widget1_notifications" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <item> + <widget class="QCheckBox" name="kcfg_notifOnCalls"> + <property name="text"> + <string>On incoming &calls</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_notifOnMessages"> + <property name="text"> + <string>On &messages</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QLabel" name="label2_displayMainWindow"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Show main window</string> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="widget_displayMainWindow" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <item> + <widget class="QCheckBox" name="kcfg_displayOnStart"> + <property name="text"> + <string>On &start</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_displayOnCalls"> + <property name="text"> + <string>On &incoming calls</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_configDisplay"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>16777215</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/sflphone-client-kde/src/conf/dlggeneral.cpp b/sflphone-client-kde/src/conf/dlggeneral.cpp index 5de22eeb36544207c1e9259ef2b83f1d707318d6..6350bde5af3286f135410f62cfb22c1eda2df962 100644 --- a/sflphone-client-kde/src/conf/dlggeneral.cpp +++ b/sflphone-client-kde/src/conf/dlggeneral.cpp @@ -19,12 +19,16 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "dlggeneral.h" - +#include <QDebug> +#include <QToolButton> +#include <QAction> DlgGeneral::DlgGeneral(QWidget *parent) : QWidget(parent) { setupUi(this); + + connect(toolButton_historyClear, SIGNAL(clicked()), this, SIGNAL(clearCallHistoryAsked())); } @@ -32,4 +36,3 @@ DlgGeneral::~DlgGeneral() { } - diff --git a/sflphone-client-kde/src/conf/dlggeneral.h b/sflphone-client-kde/src/conf/dlggeneral.h index 98ce258d4ea86fa6f4a63221060b6dd61ab81604..610a776d36099854645405f63d01a8d9963e4d03 100644 --- a/sflphone-client-kde/src/conf/dlggeneral.h +++ b/sflphone-client-kde/src/conf/dlggeneral.h @@ -25,7 +25,6 @@ #include "ui_dlggeneralbase.h" - /** @author Jérémy Quentin <jeremy.quentin@gmail.com> */ @@ -37,6 +36,9 @@ public: ~DlgGeneral(); +signals: + void clearCallHistoryAsked(); + }; #endif diff --git a/sflphone-client-kde/src/conf/dlggeneralbase.ui b/sflphone-client-kde/src/conf/dlggeneralbase.ui index 972bc8f518ac0dc5bcb14b5caea395c63f9b933c..b22c4ee948695bacee0d847c22d2126cac9a584e 100644 --- a/sflphone-client-kde/src/conf/dlggeneralbase.ui +++ b/sflphone-client-kde/src/conf/dlggeneralbase.ui @@ -35,7 +35,7 @@ <string>&Capacity</string> </property> <property name="buddy"> - <cstring>horizontalSlider_historyCapacity</cstring> + <cstring>horizontalSlider_historyCapacity_2</cstring> </property> </widget> </item> @@ -50,13 +50,17 @@ </widget> </item> <item> - <widget class="QSpinBox" name="spinBox_historyCapacity_2"/> + <widget class="KIntSpinBox" name="kcfg_historyMax"> + <property name="minimum"> + <number>-8</number> + </property> + </widget> </item> </layout> </widget> </item> <item> - <widget class="QToolButton" name="toolButton_historyClear_2"> + <widget class="QToolButton" name="toolButton_historyClear"> <property name="text"> <string>C&lear history</string> </property> @@ -86,7 +90,7 @@ <string>SIP &Port</string> </property> <property name="buddy"> - <cstring>spinBox_SIPPort</cstring> + <cstring>kcfg_SIPPort</cstring> </property> </widget> </item> @@ -103,20 +107,7 @@ <number>0</number> </property> <item> - <widget class="QSpinBox" name="spinBox_SIPPort_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimum"> - <number>1025</number> - </property> - <property name="maximum"> - <number>65536</number> - </property> - </widget> + <widget class="KIntSpinBox" name="kcfg_SIPPort"/> </item> <item> <widget class="QLabel" name="label_WarningSIP_2"> @@ -149,8 +140,48 @@ </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>KIntSpinBox</class> + <extends>QSpinBox</extends> + <header>knuminput.h</header> + </customwidget> + </customwidgets> <resources> <include location="../qrc/resources.qrc"/> </resources> - <connections/> + <connections> + <connection> + <sender>horizontalSlider_historyCapacity_2</sender> + <signal>valueChanged(int)</signal> + <receiver>kcfg_historyMax</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>393</x> + <y>57</y> + </hint> + <hint type="destinationlabel"> + <x>469</x> + <y>54</y> + </hint> + </hints> + </connection> + <connection> + <sender>kcfg_historyMax</sender> + <signal>valueChanged(int)</signal> + <receiver>horizontalSlider_historyCapacity_2</receiver> + <slot>setValue(int)</slot> + <hints> + <hint type="sourcelabel"> + <x>464</x> + <y>52</y> + </hint> + <hint type="destinationlabel"> + <x>393</x> + <y>61</y> + </hint> + </hints> + </connection> + </connections> </ui> diff --git a/sflphone-client-kde/src/conf/dlghooks.cpp b/sflphone-client-kde/src/conf/dlghooks.cpp new file mode 100644 index 0000000000000000000000000000000000000000..adea033ed25b208d2e79282e58e712000eeb4564 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlghooks.cpp @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlghooks.h" + +DlgHooks::DlgHooks(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); +} + + +DlgHooks::~DlgHooks() +{ +} + + diff --git a/sflphone-client-kde/src/conf/dlghooks.h b/sflphone-client-kde/src/conf/dlghooks.h new file mode 100644 index 0000000000000000000000000000000000000000..80800e2b09671eeaed275c1bf6f00b084ddeb604 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlghooks.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGHOOKS_H +#define DLGHOOKS_H + +#include <QWidget> + +#include "ui_dlghooksbase.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgHooks : public QWidget, public Ui_DlgHooksBase +{ +Q_OBJECT +public: + DlgHooks(QWidget *parent = 0); + + ~DlgHooks(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlghooksbase.ui b/sflphone-client-kde/src/conf/dlghooksbase.ui new file mode 100644 index 0000000000000000000000000000000000000000..3313fccf8711dff2f010a14f33f29bebf82b8d5e --- /dev/null +++ b/sflphone-client-kde/src/conf/dlghooksbase.ui @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgHooksBase</class> + <widget class="QWidget" name="DlgHooksBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>520</width> + <height>407</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox_urlArgument"> + <property name="title"> + <string>URL Argument</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_12"> + <item> + <widget class="QWidget" name="widget_protocols" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_8"> + <property name="margin"> + <number>4</number> + </property> + <item> + <widget class="QCheckBox" name="kcfg_enableHooksSIP"> + <property name="text"> + <string>SIP Protocol</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="kcfg_enableHooksIAX"> + <property name="text"> + <string>IAX2 Protocol</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="widget_urlArgumentForm" native="true"> + <layout class="QFormLayout" name="formLayout_6"> + <item row="1" column="0"> + <widget class="QLabel" name="label_SIPHeader"> + <property name="text"> + <string>SIP Header</string> + </property> + <property name="buddy"> + <cstring>kcfg_hooksSIPHeader</cstring> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_command"> + <property name="text"> + <string>Command</string> + </property> + <property name="buddy"> + <cstring>kcfg_hooksCommand</cstring> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="KLineEdit" name="kcfg_hooksSIPHeader"/> + </item> + <item row="3" column="1"> + <widget class="KLineEdit" name="kcfg_hooksCommand"/> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_phoneNumberFormatting"> + <property name="title"> + <string>Phone number formatting</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_13"> + <item> + <widget class="QCheckBox" name="kcfg_addPrefix"> + <property name="text"> + <string>Add phone number prefix</string> + </property> + </widget> + </item> + <item> + <widget class="QWidget" name="widget_phoneNumberFormattingForm" native="true"> + <layout class="QFormLayout" name="formLayout_7"> + <item row="1" column="0"> + <widget class="QLabel" name="label_prepend"> + <property name="text"> + <string>Prepend</string> + </property> + <property name="buddy"> + <cstring>kcfg_prepend</cstring> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="KLineEdit" name="kcfg_prepend"/> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_configHooks"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>499</width> + <height>96</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KLineEdit</class> + <extends>QLineEdit</extends> + <header>klineedit.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/sflphone-client-kde/src/conf/dlgrecord.cpp b/sflphone-client-kde/src/conf/dlgrecord.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3c97898f5cd30bd11aca1a278a9a2bd93482cfff --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgrecord.cpp @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "dlgrecord.h" + +#include <KLineEdit> + +DlgRecord::DlgRecord(QWidget *parent) + : QWidget(parent) +{ + setupUi(this); + KUrlRequester_destinationFolder->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly); + KUrlRequester_destinationFolder->setUrl(KUrl(QDir::home().path())); + KUrlRequester_destinationFolder->lineEdit()->setObjectName("kcfg_destinationFolder"); +} + + +DlgRecord::~DlgRecord() +{ +} + + diff --git a/sflphone-client-kde/src/conf/dlgrecord.h b/sflphone-client-kde/src/conf/dlgrecord.h new file mode 100644 index 0000000000000000000000000000000000000000..3212034591e03de8f9dacf53a291e4d86017fec1 --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgrecord.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DLGRECORD_H +#define DLGRECORD_H + +#include <QWidget> + +#include "ui_dlgrecordbase.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class DlgRecord : public QWidget, public Ui_DlgRecordBase +{ +Q_OBJECT +public: + DlgRecord(QWidget *parent = 0); + + ~DlgRecord(); + +}; + +#endif diff --git a/sflphone-client-kde/src/conf/dlgrecordbase.ui b/sflphone-client-kde/src/conf/dlgrecordbase.ui new file mode 100644 index 0000000000000000000000000000000000000000..429884c3d3db057cd60548dc28bfc7e30bb332af --- /dev/null +++ b/sflphone-client-kde/src/conf/dlgrecordbase.ui @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>DlgRecordBase</class> + <widget class="QWidget" name="DlgRecordBase"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>520</width> + <height>263</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox1_recordGeneral"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>General</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label_destinationFolderd"> + <property name="text"> + <string>Destination folder</string> + </property> + <property name="buddy"> + <cstring>KUrlRequester_destinationFolder</cstring> + </property> + </widget> + </item> + <item> + <widget class="KUrlRequester" name="KUrlRequester_destinationFolder"/> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer_configRecord"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>499</width> + <height>214</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>KUrlRequester</class> + <extends>QFrame</extends> + <header>kurlrequester.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/sflphone-client-kde/src/kcfg/settings.kcfgc b/sflphone-client-kde/src/conf/kcfg_settings.kcfgc similarity index 100% rename from sflphone-client-kde/src/kcfg/settings.kcfgc rename to sflphone-client-kde/src/conf/kcfg_settings.kcfgc diff --git a/sflphone-client-kde/src/conf/sflphone-client-kde.kcfg b/sflphone-client-kde/src/conf/sflphone-client-kde.kcfg new file mode 100644 index 0000000000000000000000000000000000000000..80a4d5a201e5bb74345ddfb14978503d938ba99c --- /dev/null +++ b/sflphone-client-kde/src/conf/sflphone-client-kde.kcfg @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd"> +<kcfg> + <kcfgfile name="ConfigDialogKDE" /> + <group name="main"> + <!-- + <entry name="SplitterSizes" type="IntList"> + <label>How the main window is divided.</label> + </entry> + --> + <entry name="SIPPort" type="Int"> + <label>Defines the port that will be used for SIP communication.</label> + <min> 1025 </min> + <max> 65536 </max> + <default> 1025 </default> + </entry> + <entry name="historyMax" type="Int"> + <label>Defines the number of days the history has to be kept.</label> + <min> 1 </min> + <max> 99 </max> + <default> 30 </default> + </entry> + <entry name="notifOnCalls" type="Bool"> + <label>Defines whether user should be notified when receiving a call.</label> + </entry> + <entry name="notifOnMessages" type="Bool"> + <label>Defines whether user should be notified when receiving a message.</label> + </entry> + <entry name="displayOnStart" type="Bool"> + <label>Defines whether the main window should be displayed on start.</label> + </entry> + <entry name="displayOnCalls" type="Bool"> + <label>Defines whether the main window should be displayed when receiving a message.</label> + </entry> + <!-- + <entry name="accountList" type="StringList"> + <label>Defines the list of accounts to register, in order of preference (first registered used by default).</label> + </entry> + --> + <entry name="enableStun" type="Bool"> + <label>Defines the SIP accounts must use Stun.</label> + </entry> + <entry name="stunServer" type="String"> + <label>Defines the Stun server to use.</label> + </entry> + <entry name="interface" type="Enum"> + <label>Defines the Stun server to use.</label> + <choices> + <choice name="ALSA" /> + <choice name="PulseAudio" /> + </choices> + </entry> + <entry name="enableRingtones" type="Bool"> + <label>Defines whether ringtones are enabled.</label> + </entry> + <entry name="ringtone" type="Path"> + <label>Defines which ringtone is used.</label> + </entry> + <entry name="activeCodecList" type="StringList"> + <label>Defines which ALSA plugin to use.</label> + </entry> + <entry name="alsaPlugin" type="String"> + <label>Defines which ALSA plugin to use.</label> + </entry> + <entry name="alsaInputDevice" type="Int"> + <label>Defines which ALSA Input device to use.</label> + </entry> + <entry name="alsaOutputDevice" type="Int"> + <label>Defines which ALSA Output device to use.</label> + </entry> + <entry name="pulseAudioVolumeAlter" type="Bool"> + <label>Defines whether pulse audio can mute other applications during a call.</label> + </entry> + <entry name="maxResults" type="Int"> + <label>Defines the max number of contacts to display during a search in address book.</label> + </entry> + <entry name="displayPhoto" type="Bool"> + <label>Defines whether to display contacts photos.</label> + </entry> + <entry name="business" type="Bool"> + <label>Defines whether to display professionnal phone numbers.</label> + </entry> + <entry name="mobile" type="Bool"> + <label>Defines whether to display mobile phone numbers.</label> + </entry> + <entry name="home" type="Bool"> + <label>Defines whether to display personnal phone numbers.</label> + </entry> + <entry name="destinationFolder" type="Path"> + <label>Defines the destination directory for call recordings.</label> + </entry> + <entry name="enableHooksSIP" type="Bool"> + <label>Defines whether to enable hooks for SIP accounts.</label> + </entry> + <entry name="enableHooksIAX" type="Bool"> + <label>Defines whether to enable hooks for IAX accounts.</label> + </entry> + <entry name="hooksSIPHeader" type="String"> + <label>Defines which header to catch for SIP accounts hooks.</label> + </entry> + <entry name="hooksCommand" type="String"> + <label>Defines which command to execute.</label> + </entry> + <entry name="addPrefix" type="Bool"> + <label>Defines whether to add a prefix for outgoing calls.</label> + </entry> + <entry name="prepend" type="String"> + <label>Defines the prefix to add.</label> + </entry> + + + <!-- + <entry name="Height" type="Int"> + <label>Height of the main window.</label> + <default>400</default> + </entry> + <entry name="OpenBooks" type="StringList"> + <label>All books that are opened.</label> + </entry> + <entry name="CurrentBook" type="String"> + <label>The book currently opened.</label> + </entry> + <entry name="Font" type="Font"> + <label>The font used to display the contents of books.</label> + <default code="true">KGlobalSettings::generalFont()</default> + </entry> + --> + </group> +</kcfg> diff --git a/sflphone-client-kde/src/kcfg/sflphone-client-kde.kcfg b/sflphone-client-kde/src/kcfg/sflphone-client-kde.kcfg deleted file mode 100644 index 8e00a65bfc1d896c196a77286020159617236cb9..0000000000000000000000000000000000000000 --- a/sflphone-client-kde/src/kcfg/sflphone-client-kde.kcfg +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd"> -<kcfg> - <kcfgfile name="ConfigDialogKDE"/> - <group name="kjots"> - <!-- - <entry name="SplitterSizes" type="IntList"> - <label>How the main window is divided.</label> - </entry> - --> - <entry name="Width" type="Int"> - <label>Width of the main window.</label> - <default>600</default> - </entry> - <!-- - <entry name="Height" type="Int"> - <label>Height of the main window.</label> - <default>400</default> - </entry> - <entry name="OpenBooks" type="StringList"> - <label>All books that are opened.</label> - </entry> - <entry name="CurrentBook" type="String"> - <label>The book currently opened.</label> - </entry> - <entry name="Font" type="Font"> - <label>The font used to display the contents of books.</label> - <default code="true">KGlobalSettings::generalFont()</default> - </entry> - --> - </group> -</kcfg> diff --git a/sflphone-client-kde/src/main.cpp b/sflphone-client-kde/src/main.cpp index e0cb4b3b1450f6a71ffcace74cf754d6822afc37..97b1ef6bebe45069d52618cba9f8a165a5fe8ad3 100644 --- a/sflphone-client-kde/src/main.cpp +++ b/sflphone-client-kde/src/main.cpp @@ -10,7 +10,6 @@ #include <kaboutdata.h> #include <klocale.h> -#include "ConfigDialog.h" #include "SFLPhone.h" #include "AccountWizard.h" #include "instance_interface_singleton.h" @@ -19,7 +18,7 @@ #include "conf/ConfigurationDialog.h" -static const char description[] = I18N_NOOP("A KDE 4 Client for SFLphone"); +static const char description[] = "A KDE 4 Client for SFLphone"; static const char version[] = "0.9.5"; @@ -29,8 +28,6 @@ int main(int argc, char **argv) try { KLocale::setMainCatalog("sflphone-client-kde"); - qDebug() << KLocale::defaultLanguage(); - qDebug() << KLocale::defaultCountry(); KAboutData about( "sflphone-client-kde", @@ -47,7 +44,6 @@ int main(int argc, char **argv) about.addAuthor( ki18n("Jérémy Quentin"), KLocalizedString(), "jeremy.quentin@savoirfairelinux.com" ); about.setProgramIconName(ICON_SFLPHONE); about.setTranslator( ki18nc("NAME OF TRANSLATORS","Your names"), ki18nc("EMAIL OF TRANSLATORS","Your emails") ); - KCmdLineArgs::init(argc, argv, &about); KCmdLineOptions options; //options.add("+[URL]", ki18n( "Document to open" )); @@ -55,8 +51,6 @@ int main(int argc, char **argv) KApplication app; - qDebug() << KGlobal::locale()->language(); - qDebug() << KGlobal::locale()->country(); //configuration dbus registerCommTypes(); @@ -68,14 +62,14 @@ int main(int argc, char **argv) InstanceInterface & instance = InstanceInterfaceSingleton::getInstance(); instance.Register(getpid(), APP_NAME); - -// ConfigurationDialogKDE * dlg = new ConfigurationDialogKDE(); -// dlg->show(); + SFLPhone * fenetre = new SFLPhone(); - fenetre->move(QCursor::pos().x() - fenetre->geometry().width()/2, QCursor::pos().y() - fenetre->geometry().height()/2); fenetre->show(); + +// ConfigurationDialogKDE * dlg = new ConfigurationDialogKDE(fenetre->getView()); +// dlg->show(); return app.exec(); } diff --git a/sflphone-client-kde/src/sflphone_const.h b/sflphone-client-kde/src/sflphone_const.h index 074f06fae906f8b27674e95773c361fd1cccc525..339613bea710f93b9dfe095464a067fa7660ffa8 100644 --- a/sflphone-client-kde/src/sflphone_const.h +++ b/sflphone-client-kde/src/sflphone_const.h @@ -53,17 +53,17 @@ #define CONFIG_FILE_PATH "/.sflphone/sflphonedrc" -#define ACTION_LABEL_CALL tr2i18n("Call") -#define ACTION_LABEL_HANG_UP tr2i18n("Hang up") -#define ACTION_LABEL_HOLD tr2i18n("Hold") -#define ACTION_LABEL_TRANSFER tr2i18n("Transfer") -#define ACTION_LABEL_RECORD tr2i18n("Record") -#define ACTION_LABEL_ACCEPT tr2i18n("Accept") -#define ACTION_LABEL_REFUSE tr2i18n("Refuse") -#define ACTION_LABEL_UNHOLD tr2i18n("Unhold") -#define ACTION_LABEL_GIVE_UP_TRANSF tr2i18n("Give up transfer") -#define ACTION_LABEL_CALL_BACK tr2i18n("Call back") -#define ACTION_LABEL_GIVE_UP_SEARCH tr2i18n("Give up search") +#define ACTION_LABEL_CALL i18n("Call") +#define ACTION_LABEL_HANG_UP i18n("Hang up") +#define ACTION_LABEL_HOLD i18n("Hold") +#define ACTION_LABEL_TRANSFER i18n("Transfer") +#define ACTION_LABEL_RECORD i18n("Record") +#define ACTION_LABEL_ACCEPT i18n("Accept") +#define ACTION_LABEL_REFUSE i18n("Refuse") +#define ACTION_LABEL_UNHOLD i18n("Unhold") +#define ACTION_LABEL_GIVE_UP_TRANSF i18n("Give up transfer") +#define ACTION_LABEL_CALL_BACK i18n("Call back") +#define ACTION_LABEL_GIVE_UP_SEARCH i18n("Give up search") #define ICON_INCOMING ":/images/icons/ring.svg" @@ -201,8 +201,8 @@ #define CODEC_BANDWIDTH 3 /** Audio Managers */ -#define ALSA 0 -#define PULSEAUDIO 1 +#define CONST_ALSA 0 +#define CONST_PULSEAUDIO 1 diff --git a/sflphone-client-kde/src/sflphone_kdeview.cpp b/sflphone-client-kde/src/sflphone_kdeview.cpp index 3f2ff56fbc9f838f01d503364a1c3bc9f9456b9c..ac5a90be9f351a9f28c8173fd1832e9b2793c94a 100644 --- a/sflphone-client-kde/src/sflphone_kdeview.cpp +++ b/sflphone-client-kde/src/sflphone_kdeview.cpp @@ -45,17 +45,23 @@ #include "ContactItemWidget.h" #include "SFLPhone.h" #include "typedefs.h" +#include "Dialpad.h" using namespace KABC; -ConfigurationDialog * sflphone_kdeView::configDialog; +ConfigurationDialogKDE * sflphone_kdeView::configDialog; +AccountList * sflphone_kdeView::accountList; +QString sflphone_kdeView::priorAccountId; sflphone_kdeView::sflphone_kdeView(QWidget *parent) : QWidget(parent) { setupUi(this); + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); + errorWindow = new QErrorMessage(this); callList = new CallList(); for(int i = 0 ; i < callList->size() ; i++) @@ -71,13 +77,15 @@ sflphone_kdeView::sflphone_kdeView(QWidget *parent) } } - configDialog = new ConfigurationDialog(this); + accountList = new AccountList(); + + configDialog = new ConfigurationDialogKDE(this); + configDialog->setObjectName("configDialog"); configDialog->setModal(true); wizard = new AccountWizard(this); wizard->setModal(false); - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); connect(&callManager, SIGNAL(callStateChanged(const QString &, const QString &)), this, SLOT(on1_callStateChanged(const QString &, const QString &))); connect(&callManager, SIGNAL(incomingCall(const QString &, const QString &, const QString &)), @@ -88,10 +96,12 @@ sflphone_kdeView::sflphone_kdeView(QWidget *parent) this, SLOT(on1_voiceMailNotify(const QString &, int))); connect(&callManager, SIGNAL(volumeChanged(const QString &, double)), this, SLOT(on1_volumeChanged(const QString &, double))); - - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + connect(&configurationManager, SIGNAL(accountsChanged()), - this, SLOT(updateStatusMessage())); + accountList, SLOT(updateAccounts())); + + connect(configDialog, SIGNAL(clearCallHistoryAsked()), + callList, SLOT(clearHistory())); QPalette pal = QPalette(palette()); pal.setColor(QPalette::AlternateBase, Qt::lightGray); @@ -115,50 +125,12 @@ sflphone_kdeView::~sflphone_kdeView() delete errorWindow; } - -void sflphone_kdeView::buildDialPad() -{ - QHBoxLayout * layout; - QLabel * number; - QLabel * text; - int spacing = 5; - int numberSize = 14; - int textSize = 8; - - QPushButton * buttons[12] = - {pushButton_1, pushButton_2, pushButton_3, - pushButton_4, pushButton_5, pushButton_6, - pushButton_7, pushButton_8, pushButton_9, - pushButton_etoile, pushButton_0, pushButton_diese}; - - QString numbers[12] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "0", "#"}; - - QString texts[12] = {"", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz", "", "", ""}; - - for(int i = 0 ; i < 12 ; i++) - { - layout = new QHBoxLayout(); - layout->setSpacing(spacing); - number = new QLabel(numbers[i]); - number->setFont(QFont("", numberSize)); - layout->addWidget(number); - number->setAlignment(Qt::AlignRight | Qt::AlignVCenter); - text = new QLabel(texts[i]); - text->setFont(QFont("", textSize)); - layout->addWidget(text); - buttons[i]->setLayout(layout); - buttons[i]->setMinimumHeight(30); - buttons[i]->setText(""); - } -} - void sflphone_kdeView::loadWindow() { qDebug() << "loadWindow"; ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); action_displayVolumeControls->setChecked(configurationManager.getVolumeControls()); action_displayDialpad->setChecked(configurationManager.getDialpad()); - buildDialPad(); updateWindowCallState(); updateRecordButton(); updateVolumeButton(); @@ -169,29 +141,28 @@ void sflphone_kdeView::loadWindow() updateSearchHistory(); } -QString sflphone_kdeView::firstAccountId() -{ - Account * firstAccount = getAccountList()->firstRegisteredAccount(); - if(firstAccount == NULL) - { - return QString(); - } - return firstAccount->getAccountId(); -} QVector<Account *> sflphone_kdeView::registeredAccounts() { - return getAccountList()->registeredAccounts(); + return accountList->registeredAccounts(); } Account * sflphone_kdeView::firstRegisteredAccount() { - return getAccountList()->firstRegisteredAccount(); + Account * priorAccount = accountList->getAccountById(priorAccountId); + if(priorAccount && priorAccount->getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED ) + { + return priorAccount; + } + else + { + return accountList->firstRegisteredAccount(); + } } AccountList * sflphone_kdeView::getAccountList() { - return configDialog->getAccountList(); + return accountList; } QErrorMessage * sflphone_kdeView::getErrorWindow() @@ -753,11 +724,7 @@ QVector<Contact *> sflphone_kdeView::findContactsInKAddressBook(QString textSear return results; } -/** - * - * @return the integer resulting to the flags of the types chosen to be displayed in SFLPhone configuration. - * useful to sort contacts according to their types. - */ + int sflphone_kdeView::phoneNumberTypesDisplayed() { ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); @@ -888,15 +855,16 @@ void sflphone_kdeView::updateStatusMessage() Account * account = firstRegisteredAccount(); if(account == NULL) { - emit statusMessageChanged(tr2i18n("No account registered")); + emit statusMessageChanged(i18n("No account registered")); } else { - emit statusMessageChanged(tr2i18n("Using account") + " \'" + account->getAlias() + "\' (" + account->getAccountDetail(ACCOUNT_TYPE) + ")") ; + emit statusMessageChanged(i18n("Using account") + " \'" + account->getAlias() + "\' (" + account->getAccountDetail(ACCOUNT_TYPE) + ")") ; } } + /************************************************************ ************ Autoconnect ************* ************************************************************/ @@ -916,18 +884,9 @@ void sflphone_kdeView::on_action_displayDialpad_triggered() updateVolumeControls(); } -void sflphone_kdeView::on_pushButton_1_clicked() { typeString("1"); } -void sflphone_kdeView::on_pushButton_2_clicked() { typeString("2"); } -void sflphone_kdeView::on_pushButton_3_clicked() { typeString("3"); } -void sflphone_kdeView::on_pushButton_4_clicked() { typeString("4"); } -void sflphone_kdeView::on_pushButton_5_clicked() { typeString("5"); } -void sflphone_kdeView::on_pushButton_6_clicked() { typeString("6"); } -void sflphone_kdeView::on_pushButton_7_clicked() { typeString("7"); } -void sflphone_kdeView::on_pushButton_8_clicked() { typeString("8"); } -void sflphone_kdeView::on_pushButton_9_clicked() { typeString("9"); } -void sflphone_kdeView::on_pushButton_0_clicked() { typeString("0"); } -void sflphone_kdeView::on_pushButton_diese_clicked() { typeString("#"); } -void sflphone_kdeView::on_pushButton_etoile_clicked() { typeString("*"); } + +void sflphone_kdeView::on_widget_dialpad_typed(QString text) { typeString(text); } + void sflphone_kdeView::on_lineEdit_searchHistory_textChanged() { @@ -1079,17 +1038,17 @@ void sflphone_kdeView::on_stackedWidget_screen_currentChanged(int index) { case 0: qDebug() << "Switched to call list screen."; - window->setWindowTitle(tr2i18n("SFLPhone") + " - " + tr2i18n("Main screen")); + window->setWindowTitle(i18n("SFLPhone") + " - " + i18n("Main screen")); break; case 1: qDebug() << "Switched to call history screen."; updateCallHistory(); - window->setWindowTitle(tr2i18n("SFLPhone") + " - " + tr2i18n("Call history")); + window->setWindowTitle(i18n("SFLPhone") + " - " + i18n("Call history")); break; case 2: qDebug() << "Switched to address book screen."; updateAddressBook(); - window->setWindowTitle(tr2i18n("SFLPhone") + " - " + tr2i18n("Address book")); + window->setWindowTitle(i18n("SFLPhone") + " - " + i18n("Address book")); break; default: qDebug() << "Error : reached an unknown index \"" << index << "\" with stackedWidget_screen."; @@ -1103,7 +1062,7 @@ void sflphone_kdeView::contextMenuEvent(QContextMenuEvent *event) if(stackedWidget_screen->currentWidget() == page_callHistory || stackedWidget_screen->currentWidget() == page_addressBook) { QAction * action_edit = new QAction(&menu); - action_edit->setText(tr2i18n("Edit before call")); + action_edit->setText(i18n("Edit before call")); connect(action_edit, SIGNAL(triggered()), this , SLOT(editBeforeCall())); menu.addAction(action_edit); @@ -1118,6 +1077,7 @@ void sflphone_kdeView::contextMenuEvent(QContextMenuEvent *event) QVector<Account *> accounts = registeredAccounts(); for (int i = 0 ; i < accounts.size() ; i++) { + qDebug() << i; Account * account = accounts.at(i); QAction * action = new ActionSetAccountFirst(account, &menu); action->setCheckable(true); @@ -1159,7 +1119,7 @@ void sflphone_kdeView::editBeforeCall() number = w->getContactNumber(); } } - QString newNumber = QInputDialog::getText(this, tr2i18n("Edit before call"), QString(), QLineEdit::Normal, number); + QString newNumber = QInputDialog::getText(this, i18n("Edit before call"), QString(), QLineEdit::Normal, number); action_history->setChecked(false); action_addressBook->setChecked(false); @@ -1174,7 +1134,8 @@ void sflphone_kdeView::editBeforeCall() void sflphone_kdeView::setAccountFirst(Account * account) { qDebug() << "setAccountFirst : " << account->getAlias(); - getAccountList()->setAccountFirst(account); +// getAccountList()->setAccountFirst(account); + priorAccountId = account->getAccountId(); updateStatusMessage(); } @@ -1190,24 +1151,23 @@ void sflphone_kdeView::on_listWidget_addressBook_currentItemChanged() updateWindowCallState(); } -void sflphone_kdeView::on_action_configureAccounts_triggered() -{ - configDialog->loadOptions(); - configDialog->setPage(PAGE_ACCOUNTS); - configDialog->show(); -} +// void sflphone_kdeView::on_action_configureAccounts_triggered() +// { +// configDialog->readSettings(); +// configDialog->setPage(PAGE_ACCOUNTS); +// configDialog->show(); +// } -void sflphone_kdeView::on_action_configureAudio_triggered() -{ - configDialog->loadOptions(); - configDialog->setPage(PAGE_AUDIO); - configDialog->show(); -} +// void sflphone_kdeView::on_action_configureAudio_triggered() +// { +// configDialog->readSettings(); +// configDialog->setPage(PAGE_AUDIO); +// configDialog->show(); +// } void sflphone_kdeView::on_action_configureSflPhone_triggered() { - sflphone_kdeView::configDialog->loadOptions(); - configDialog->setPage(PAGE_GENERAL); + configDialog->reload(); configDialog->show(); } @@ -1374,13 +1334,13 @@ void sflphone_kdeView::on_action_addressBook_triggered(bool checked) void sflphone_kdeView::on_action_mailBox_triggered() { ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - QString account = firstAccountId(); - QString mailBoxNumber = configurationManager.getAccountDetails(account).value()[ACCOUNT_MAILBOX]; - Call * call = callList->addDialingCall(); - call->appendItemText(mailBoxNumber); - addCallToCallList(call); - listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); - actionb(call, CALL_ACTION_ACCEPT); + Account * account = firstRegisteredAccount(); + QString mailBoxNumber = account->getAccountDetail(ACCOUNT_MAILBOX); + Call * call = callList->addDialingCall(); + call->appendItemText(mailBoxNumber); + addCallToCallList(call); + listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); + actionb(call, CALL_ACTION_ACCEPT); } void sflphone_kdeView::on1_callStateChanged(const QString &callID, const QString &state) @@ -1453,5 +1413,4 @@ void sflphone_kdeView::on1_volumeChanged(const QString &device, double value) - #include "sflphone_kdeview.moc" diff --git a/sflphone-client-kde/src/sflphone_kdeview.h b/sflphone-client-kde/src/sflphone_kdeview.h index 419899e97b1140bde41aa0e38d96b0d702138d75..71ce8fc9fdf3010f1db16ee24b195c127298ea06 100644 --- a/sflphone-client-kde/src/sflphone_kdeview.h +++ b/sflphone-client-kde/src/sflphone_kdeview.h @@ -32,15 +32,18 @@ #include <KXmlGuiWindow> #include "ui_sflphone_kdeview_base.h" -#include "ConfigDialog.h" +#include "conf/ConfigurationDialog.h" #include "CallList.h" #include "AccountWizard.h" #include "Contact.h" #include "sflphone_kdeview.h" +#include "AccountList.h" #include "ui_sflphone_kdeview_base.h" -class ConfigurationDialog; +class ConfigurationDialogKDE; + + /** * This is the main view class for sflphone-client-kde. Most of the non-menu, * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go @@ -50,18 +53,21 @@ class ConfigurationDialog; * @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> * @version 0.1 */ - - class sflphone_kdeView : public QWidget, public Ui::SFLPhone_view { - Q_OBJECT + Q_OBJECT private: - static ConfigurationDialog * configDialog; + static ConfigurationDialogKDE * configDialog; + static AccountList * accountList; AccountWizard * wizard; + //List of calls in the window, and past ones. + //Handles both current calls (dialing, ringing...) and history. CallList * callList; QErrorMessage * errorWindow; + //Account used prioritary if defined and registered. If not, the first registered account in accountList is used. + static QString priorAccountId; protected: @@ -76,19 +82,35 @@ public: sflphone_kdeView(QWidget *parent); virtual ~sflphone_kdeView(); /** - * + * Called at construction. Updates all the display + * according to the settings. */ void loadWindow(); - void buildDialPad(); //Getters - static QString firstAccountId(); + /** + * Seeks the account to use. + * If priorAccountId is defined and the corresponding + * account exists and is registered, uses this one, else, + * asks the first registered of accountList. + * If there is no account registered, returns NULL. + * @return the account to use if an outgoing call is placed. + */ static Account * firstRegisteredAccount(); + /** + * + * @return the list of registered accounts in accountList + */ static QVector<Account *> registeredAccounts(); static AccountList * getAccountList(); QErrorMessage * getErrorWindow(); //Daemon getters + /** + * Useful to sort contacts according to their types with Kabc. + * @return the integer resulting to the flags of the types + * chosen to be displayed in SFLPhone configuration. + */ int phoneNumberTypesDisplayed(); //Updates @@ -150,8 +172,8 @@ public slots: void on_action_displayVolumeControls_triggered(); void on_action_displayDialpad_triggered(); - void on_action_configureAccounts_triggered(); - void on_action_configureAudio_triggered(); +// void on_action_configureAccounts_triggered(); +// void on_action_configureAudio_triggered(); void on_action_configureSflPhone_triggered(); void on_action_accountCreationWizard_triggered(); void on_action_accept_triggered(); @@ -163,18 +185,7 @@ public slots: void on_action_addressBook_triggered(bool checked); void on_action_mailBox_triggered(); - void on_pushButton_1_clicked(); - void on_pushButton_2_clicked(); - void on_pushButton_3_clicked(); - void on_pushButton_4_clicked(); - void on_pushButton_5_clicked(); - void on_pushButton_6_clicked(); - void on_pushButton_7_clicked(); - void on_pushButton_8_clicked(); - void on_pushButton_9_clicked(); - void on_pushButton_0_clicked(); - void on_pushButton_diese_clicked(); - void on_pushButton_etoile_clicked(); + void on_widget_dialpad_typed(QString text); void on_lineEdit_searchHistory_textChanged(); void on_lineEdit_addressBook_textChanged(); diff --git a/sflphone-client-kde/src/ui/ConfigDialog.ui b/sflphone-client-kde/src/ui/ConfigDialog.ui deleted file mode 100644 index fc14a19593276aa99b30b83abda50dd594995c8d..0000000000000000000000000000000000000000 --- a/sflphone-client-kde/src/ui/ConfigDialog.ui +++ /dev/null @@ -1,1676 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <author>Jérémy Quentin</author> - <class>ConfigurationDialog</class> - <widget class="QDialog" name="ConfigurationDialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>747</width> - <height>476</height> - </rect> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="windowTitle"> - <string>Configuration Dialog</string> - </property> - <property name="windowIcon"> - <iconset resource="../qrc/resources.qrc"> - <normaloff>:/images/icons/sflphone.svg</normaloff>:/images/icons/sflphone.svg</iconset> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="margin"> - <number>1</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayoutDialog"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <item> - <widget class="QListWidget" name="list_options"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>100</width> - <height>300</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>200</width> - <height>16777215</height> - </size> - </property> - <property name="sizeIncrement"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="mouseTracking"> - <bool>false</bool> - </property> - <property name="contextMenuPolicy"> - <enum>Qt::DefaultContextMenu</enum> - </property> - <property name="acceptDrops"> - <bool>false</bool> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="autoFillBackground"> - <bool>true</bool> - </property> - <property name="autoScrollMargin"> - <number>16</number> - </property> - <property name="editTriggers"> - <set>QAbstractItemView::AllEditTriggers</set> - </property> - <property name="dragEnabled"> - <bool>true</bool> - </property> - <property name="iconSize"> - <size> - <width>200</width> - <height>200</height> - </size> - </property> - <property name="textElideMode"> - <enum>Qt::ElideMiddle</enum> - </property> - <property name="verticalScrollMode"> - <enum>QAbstractItemView::ScrollPerItem</enum> - </property> - <property name="horizontalScrollMode"> - <enum>QAbstractItemView::ScrollPerItem</enum> - </property> - <property name="movement"> - <enum>QListView::Static</enum> - </property> - <property name="flow"> - <enum>QListView::TopToBottom</enum> - </property> - <property name="resizeMode"> - <enum>QListView::Adjust</enum> - </property> - <property name="layoutMode"> - <enum>QListView::SinglePass</enum> - </property> - <property name="viewMode"> - <enum>QListView::IconMode</enum> - </property> - <property name="modelColumn"> - <number>0</number> - </property> - <property name="uniformItemSizes"> - <bool>false</bool> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - <property name="sortingEnabled"> - <bool>false</bool> - </property> - <item> - <property name="text"> - <string>General</string> - </property> - </item> - <item> - <property name="text"> - <string>Display</string> - </property> - </item> - <item> - <property name="text"> - <string>Accounts</string> - </property> - </item> - <item> - <property name="text"> - <string>Audio</string> - </property> - </item> - <item> - <property name="text"> - <string comment="config page name">Record</string> - </property> - </item> - <item> - <property name="text"> - <string>Address Book</string> - </property> - </item> - <item> - <property name="text"> - <string>Hooks</string> - </property> - </item> - </widget> - </item> - <item> - <widget class="Line" name="line_ConfigGeneral_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_options"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - </widget> - </item> - <item> - <widget class="QStackedWidget" name="stackedWidget_options"> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="page_general"> - <layout class="QVBoxLayout" name="verticalLayout_18"> - <property name="leftMargin"> - <number>4</number> - </property> - <item> - <widget class="QLabel" name="label_configGeneral"> - <property name="text"> - <string>Configure general settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configGeneral"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox1_history"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Call history</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_19"> - <item> - <widget class="QWidget" name="widget_historyCapacity" native="true"> - <layout class="QHBoxLayout" name="horizontalLayout_10"> - <item> - <widget class="QLabel" name="label_historyCapacity"> - <property name="text"> - <string>&Capacity</string> - </property> - <property name="buddy"> - <cstring>horizontalSlider_historyCapacity</cstring> - </property> - </widget> - </item> - <item> - <widget class="QSlider" name="horizontalSlider_historyCapacity"> - <property name="maximum"> - <number>100</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_historyCapacity"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QToolButton" name="toolButton_historyClear"> - <property name="text"> - <string>C&lear history</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox2_connection"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Connection</string> - </property> - <layout class="QFormLayout" name="formLayout_12"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label_SIPPort"> - <property name="text"> - <string>SIP &Port</string> - </property> - <property name="buddy"> - <cstring>spinBox_SIPPort</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QWidget" name="widget_SIPPort" native="true"> - <property name="minimumSize"> - <size> - <width>50</width> - <height>0</height> - </size> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QSpinBox" name="spinBox_SIPPort"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimum"> - <number>1025</number> - </property> - <property name="maximum"> - <number>65536</number> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_WarningSIP"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Attention </string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configGeneral"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>16777215</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_display"> - <layout class="QVBoxLayout" name="verticalLayout_9"> - <item> - <widget class="QLabel" name="label_configDisplay"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Configure display</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configDisplay"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QFrame" name="frame_display"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <item> - <widget class="QLabel" name="label1_notifications"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Enable notifications</string> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget1_notifications" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <widget class="QCheckBox" name="checkBox1_notifOnCalls"> - <property name="text"> - <string>On incoming &calls</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox2_notifOnMessages"> - <property name="text"> - <string>On &messages</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QLabel" name="label2_displayMainWindow"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Show main window</string> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget_displayMainWindow" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QCheckBox" name="checkBox1_displayOnStart"> - <property name="text"> - <string>On &start</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox2_displayOnCalls"> - <property name="text"> - <string>On &incoming calls</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configDisplay"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>16777215</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_accounts"> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QLabel" name="label_configAccounts"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Configure user accounts</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configAccounts"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget1_configAccounts" native="true"> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QFrame" name="frame1_accountList"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QListWidget" name="listWidget_accountList"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>150</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="dragEnabled"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_accountListHandle"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="layoutDirection"> - <enum>Qt::RightToLeft</enum> - </property> - <property name="title"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="spacing"> - <number>0</number> - </property> - <property name="sizeConstraint"> - <enum>QLayout::SetNoConstraint</enum> - </property> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QToolButton" name="button_accountRemove"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Remove this account</string> - </property> - <property name="icon"> - <iconset resource="../qrc/resources.qrc"> - <normaloff>:/images/icons/remove.png</normaloff>:/images/icons/remove.png</iconset> - </property> - <property name="shortcut"> - <string>Backspace, Return</string> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="button_accountAdd"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="sizeIncrement"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Add a new account</string> - </property> - <property name="icon"> - <iconset resource="../qrc/resources.qrc"> - <normaloff>:/images/icons/add.png</normaloff>:/images/icons/add.png</iconset> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="button_accountDown"> - <property name="text"> - <string>Down</string> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="button_accountUp"> - <property name="text"> - <string>Up</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QToolButton" name="toolButton_accountsApply"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="text"> - <string>Apply</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frame2_editAccounts"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QFormLayout" name="formLayout_2"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label1_alias"> - <property name="text"> - <string>&Alias</string> - </property> - <property name="buddy"> - <cstring>edit1_alias</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="edit1_alias"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label2_protocol"> - <property name="text"> - <string>&Protocol</string> - </property> - <property name="buddy"> - <cstring>edit2_protocol</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QComboBox" name="edit2_protocol"> - <item> - <property name="text"> - <string>SIP</string> - </property> - </item> - <item> - <property name="text"> - <string>IAX</string> - </property> - </item> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label3_server"> - <property name="text"> - <string>&Server</string> - </property> - <property name="buddy"> - <cstring>edit3_server</cstring> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="edit3_server"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label4_user"> - <property name="text"> - <string>&User</string> - </property> - <property name="buddy"> - <cstring>edit4_user</cstring> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="edit4_user"/> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="label5_password"> - <property name="text"> - <string>Pass&word</string> - </property> - <property name="buddy"> - <cstring>edit5_password</cstring> - </property> - </widget> - </item> - <item row="4" column="1"> - <widget class="QLineEdit" name="edit5_password"> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="label6_mailbox"> - <property name="text"> - <string>&Mailbox</string> - </property> - <property name="buddy"> - <cstring>edit6_mailbox</cstring> - </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="QLineEdit" name="edit6_mailbox"/> - </item> - <item row="6" column="0"> - <widget class="QLabel" name="label7_state"> - <property name="text"> - <string>State</string> - </property> - </widget> - </item> - <item row="6" column="1"> - <widget class="QLabel" name="edit7_state"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_commonSettings"> - <property name="title"> - <string/> - </property> - <layout class="QVBoxLayout" name="verticalLayout_10"> - <item> - <widget class="QLabel" name="label_commonSettings"> - <property name="text"> - <string>Stun settings will be applied on each account</string> - </property> - </widget> - </item> - <item> - <layout class="QFormLayout" name="formLayout_commonSettings"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QCheckBox" name="checkBox_stun"> - <property name="text"> - <string>&Enable Stun</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="lineEdit_stun"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_audio"> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <widget class="QLabel" name="label_configAudio"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Configure audio settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configAudio"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox1_audio"> - <property name="mouseTracking"> - <bool>false</bool> - </property> - <property name="title"> - <string/> - </property> - <layout class="QFormLayout" name="formLayout_3"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label_interface"> - <property name="text"> - <string>Audio &device</string> - </property> - <property name="buddy"> - <cstring>comboBox_interface</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QComboBox" name="comboBox_interface"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <item> - <property name="text"> - <string>ALSA</string> - </property> - </item> - <item> - <property name="text"> - <string>PulseAudio</string> - </property> - </item> - </widget> - </item> - <item row="1" column="0"> - <widget class="QCheckBox" name="checkBox_ringtones"> - <property name="text"> - <string>&Enable ringtones</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="KUrlComboRequester" name="urlComboRequester_ringtone"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox2_codecs"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>&Codecs</string> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="2"> - <layout class="QVBoxLayout" name="verticalLayout_codecsOrder"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <item> - <widget class="QToolButton" name="toolButton_codecUp"> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="toolButton_codecDown"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="0"> - <widget class="QTableWidget" name="tableWidget_codecs"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>100</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> - <property name="verticalScrollBarPolicy"> - <enum>Qt::ScrollBarAsNeeded</enum> - </property> - <property name="textElideMode"> - <enum>Qt::ElideRight</enum> - </property> - <property name="verticalScrollMode"> - <enum>QAbstractItemView::ScrollPerPixel</enum> - </property> - <property name="horizontalScrollMode"> - <enum>QAbstractItemView::ScrollPerPixel</enum> - </property> - <column> - <property name="text"> - <string>Active</string> - </property> - </column> - <column> - <property name="text"> - <string>Name</string> - </property> - </column> - <column> - <property name="text"> - <string>Frequency</string> - </property> - </column> - <column> - <property name="text"> - <string>Bitrate</string> - </property> - </column> - <column> - <property name="text"> - <string>Bandwidth</string> - </property> - </column> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QStackedWidget" name="stackedWidget_interfaceSpecificSettings"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="currentIndex"> - <number>1</number> - </property> - <widget class="QWidget" name="page1_alsa"> - <layout class="QVBoxLayout" name="verticalLayout_20"> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QGroupBox" name="groupBox_alsa"> - <property name="title"> - <string>ALSA settings</string> - </property> - <layout class="QFormLayout" name="formLayout_4"> - <item row="2" column="1"> - <widget class="QComboBox" name="comboBox2_in"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label2_in"> - <property name="text"> - <string>&In</string> - </property> - <property name="buddy"> - <cstring>comboBox2_in</cstring> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label3_out"> - <property name="text"> - <string>&Out</string> - </property> - <property name="buddy"> - <cstring>comboBox3_out</cstring> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QComboBox" name="comboBox3_out"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label1_alsaPugin"> - <property name="text"> - <string>ALSA &plugin</string> - </property> - <property name="buddy"> - <cstring>comboBox1_alsaPlugin</cstring> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QComboBox" name="comboBox1_alsaPlugin"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page2_pulseAudio"> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <item> - <widget class="QGroupBox" name="groupBox_pulseAudio"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>PulseAudio settings</string> - </property> - <layout class="QFormLayout" name="formLayout_11"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QCheckBox" name="checkBox_pulseAudioVolumeAlter"> - <property name="text"> - <string>Mute other applications during a call</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_record"> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QLabel" name="label_configRecord"> - <property name="text"> - <string>Configure record settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configRecord"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox1_recordGeneral"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>General</string> - </property> - <layout class="QFormLayout" name="formLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label_destinationFolder"> - <property name="text"> - <string>Destination folder</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="KUrlComboRequester" name="urlcomborequester_destinationFolder"/> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configRecord"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>16777215</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_addressBook"> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <widget class="QLabel" name="label_configAddressBook"> - <property name="text"> - <string>Configure address book settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configAddressBook"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget_configAddressBookGeneral" native="true"> - <layout class="QFormLayout" name="formLayout_5"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="1" column="0"> - <widget class="QLabel" name="label_maxResults"> - <property name="text"> - <string>Maximum &results</string> - </property> - <property name="buddy"> - <cstring>horizontalSlider_maxResults</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QWidget" name="widget_maxResults" native="true"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <property name="spacing"> - <number>0</number> - </property> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QSlider" name="horizontalSlider_maxResults"> - <property name="minimum"> - <number>25</number> - </property> - <property name="maximum"> - <number>50</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_maxResults"> - <property name="minimum"> - <number>25</number> - </property> - <property name="maximum"> - <number>50</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="2" column="0"> - <widget class="QCheckBox" name="checkBox_displayPhoto"> - <property name="text"> - <string>Display &photo if available</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_displayTypes"> - <property name="title"> - <string>Display phone numbers of these &types :</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <widget class="QCheckBox" name="checkBox_business"> - <property name="text"> - <string>&Work</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_mobile"> - <property name="text"> - <string>&Mobile</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_home"> - <property name="text"> - <string>&Home</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configAddressBook"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>229</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QWidget" name="page_hooks"> - <layout class="QVBoxLayout" name="verticalLayout_11"> - <item> - <widget class="QLabel" name="label_configHooks"> - <property name="text"> - <string>Configure hooks settings</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_configHooks"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_urlArgument"> - <property name="title"> - <string>URL Argument</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_12"> - <item> - <widget class="QWidget" name="widget_protocols" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>10</width> - <height>10</height> - </size> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QCheckBox" name="checkBox_hooksSIP"> - <property name="text"> - <string>SIP Protocol</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkBox_hooksIAX"> - <property name="text"> - <string>IAX2 Protocol</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QWidget" name="widget_urlArgumentForm" native="true"> - <layout class="QFormLayout" name="formLayout_6"> - <item row="1" column="0"> - <widget class="QLabel" name="label_SIPHeader"> - <property name="text"> - <string>SIP Header</string> - </property> - <property name="buddy"> - <cstring>lineEdit_SIPHeader</cstring> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_command"> - <property name="text"> - <string>Command</string> - </property> - <property name="buddy"> - <cstring>lineEdit_command</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="lineEdit_SIPHeader"/> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="lineEdit_command"/> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_phoneNumberFormatting"> - <property name="title"> - <string>Phone number formatting</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_13"> - <item> - <widget class="QCheckBox" name="checkBox_addPrefix"> - <property name="text"> - <string>Add phone number prefix</string> - </property> - </widget> - </item> - <item> - <widget class="QWidget" name="widget_phoneNumberFormattingForm" native="true"> - <layout class="QFormLayout" name="formLayout_7"> - <item row="1" column="0"> - <widget class="QLabel" name="label_prepend"> - <property name="text"> - <string>Prepend</string> - </property> - <property name="buddy"> - <cstring>lineEdit_prepend</cstring> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="lineEdit_prepend"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_configHooks"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="lineDialog"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBoxDialog"> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set> - </property> - <property name="centerButtons"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - <action name="actionAbout"> - <property name="text"> - <string>about</string> - </property> - </action> - </widget> - <layoutdefault spacing="4" margin="4"/> - <customwidgets> - <customwidget> - <class>KUrlComboRequester</class> - <extends>KUrlRequester</extends> - <header>kurlrequester.h</header> - </customwidget> - </customwidgets> - <resources> - <include location="../qrc/resources.qrc"/> - </resources> - <connections> - <connection> - <sender>buttonBoxDialog</sender> - <signal>rejected()</signal> - <receiver>ConfigurationDialog</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel"> - <x>301</x> - <y>474</y> - </hint> - <hint type="destinationlabel"> - <x>286</x> - <y>274</y> - </hint> - </hints> - </connection> - <connection> - <sender>list_options</sender> - <signal>currentRowChanged(int)</signal> - <receiver>stackedWidget_options</receiver> - <slot>setCurrentIndex(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>73</x> - <y>92</y> - </hint> - <hint type="destinationlabel"> - <x>191</x> - <y>82</y> - </hint> - </hints> - </connection> - <connection> - <sender>checkBox_stun</sender> - <signal>toggled(bool)</signal> - <receiver>lineEdit_stun</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>130</x> - <y>29</y> - </hint> - <hint type="destinationlabel"> - <x>202</x> - <y>31</y> - </hint> - </hints> - </connection> - <connection> - <sender>comboBox_interface</sender> - <signal>currentIndexChanged(int)</signal> - <receiver>stackedWidget_interfaceSpecificSettings</receiver> - <slot>setCurrentIndex(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>488</x> - <y>64</y> - </hint> - <hint type="destinationlabel"> - <x>446</x> - <y>433</y> - </hint> - </hints> - </connection> - <connection> - <sender>horizontalSlider_historyCapacity</sender> - <signal>valueChanged(int)</signal> - <receiver>spinBox_historyCapacity</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>352</x> - <y>89</y> - </hint> - <hint type="destinationlabel"> - <x>688</x> - <y>95</y> - </hint> - </hints> - </connection> - <connection> - <sender>spinBox_historyCapacity</sender> - <signal>valueChanged(int)</signal> - <receiver>horizontalSlider_historyCapacity</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>688</x> - <y>95</y> - </hint> - <hint type="destinationlabel"> - <x>352</x> - <y>89</y> - </hint> - </hints> - </connection> - <connection> - <sender>horizontalSlider_maxResults</sender> - <signal>valueChanged(int)</signal> - <receiver>spinBox_maxResults</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>599</x> - <y>52</y> - </hint> - <hint type="destinationlabel"> - <x>661</x> - <y>55</y> - </hint> - </hints> - </connection> - <connection> - <sender>spinBox_maxResults</sender> - <signal>valueChanged(int)</signal> - <receiver>horizontalSlider_maxResults</receiver> - <slot>setValue(int)</slot> - <hints> - <hint type="sourcelabel"> - <x>650</x> - <y>59</y> - </hint> - <hint type="destinationlabel"> - <x>585</x> - <y>56</y> - </hint> - </hints> - </connection> - <connection> - <sender>checkBox_addPrefix</sender> - <signal>toggled(bool)</signal> - <receiver>lineEdit_prepend</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>167</x> - <y>224</y> - </hint> - <hint type="destinationlabel"> - <x>231</x> - <y>259</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/sflphone-client-kde/src/ui/sflphone_kdeview_base.ui b/sflphone-client-kde/src/ui/sflphone_kdeview_base.ui index 77cb92490b2ee720e2d791ed43a76911660095d5..be5d81a75d2c1dbf151a696219296111e84363a4 100644 --- a/sflphone-client-kde/src/ui/sflphone_kdeview_base.ui +++ b/sflphone-client-kde/src/ui/sflphone_kdeview_base.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>337</width> - <height>416</height> + <height>420</height> </rect> </property> <property name="windowTitle"> @@ -68,6 +68,9 @@ <property name="text"> <string>Attention:number of results exceeds max displayed.</string> </property> + <property name="wordWrap"> + <bool>true</bool> + </property> </widget> </item> </layout> @@ -88,9 +91,9 @@ <height>160</height> </size> </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <layout class="QHBoxLayout" name="horizontalLayout_dialpadAndControls"> <property name="spacing"> - <number>0</number> + <number>1</number> </property> <property name="margin"> <number>0</number> @@ -159,182 +162,16 @@ </widget> </item> </layout> - <zorder>toolButton_recVol</zorder> - <zorder>slider_recVol</zorder> </widget> </item> <item> - <widget class="QWidget" name="widget_dialpad" native="true"> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="1"> - <widget class="QPushButton" name="pushButton_1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QPushButton" name="pushButton_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QPushButton" name="pushButton_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QPushButton" name="pushButton_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QPushButton" name="pushButton_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QPushButton" name="pushButton_6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QPushButton" name="pushButton_7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QPushButton" name="pushButton_8"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QPushButton" name="pushButton_9"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QPushButton" name="pushButton_etoile"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QPushButton" name="pushButton_0"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item row="3" column="3"> - <widget class="QPushButton" name="pushButton_diese"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> + <widget class="Dialpad" name="widget_dialpad" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> </widget> </item> <item> @@ -622,6 +459,14 @@ </property> </action> </widget> + <customwidgets> + <customwidget> + <class>Dialpad</class> + <extends>QWidget</extends> + <header>Dialpad.h</header> + <container>1</container> + </customwidget> + </customwidgets> <resources> <include location="../qrc/resources.qrc"/> </resources> diff --git a/sflphone-common/src/dbus/configurationmanager.cpp b/sflphone-common/src/dbus/configurationmanager.cpp index c42f61750d8d7c86c7b142e4cce9b2dfbb00c38c..4681011f2f63e2342545984f7a3a0decb5553dc8 100644 --- a/sflphone-common/src/dbus/configurationmanager.cpp +++ b/sflphone-common/src/dbus/configurationmanager.cpp @@ -332,24 +332,28 @@ int32_t ConfigurationManager::getHistoryEnabled (void) void ConfigurationManager::startHidden( void ) { + _debug("Manager received startHidden\n"); Manager::instance().startHidden( ); } int32_t ConfigurationManager::isStartHidden( void ) { + _debug("Manager received isStartHidden\n"); return Manager::instance().isStartHidden( ); } void ConfigurationManager::switchPopupMode( void ) { + _debug("Manager received switchPopupMode\n"); Manager::instance().switchPopupMode( ); } int32_t ConfigurationManager::popupMode( void ) { + _debug("Manager received popupMode\n"); return Manager::instance().popupMode( ); } @@ -422,21 +426,25 @@ ConfigurationManager::setSipPort( const int32_t& portNum ) std::string ConfigurationManager::getStunServer( void ) { + _debug("Manager received getStunServer\n") ; return Manager::instance().getStunServer(); } void ConfigurationManager::setStunServer( const std::string& server ) { + _debug("Manager received setStunServer\n") ; Manager::instance().setStunServer( server ); } void ConfigurationManager::enableStun (void) { + _debug("Manager received enableStun\n") ; Manager::instance().enableStun(); } int32_t ConfigurationManager::isStunEnabled (void) { + _debug("Manager received isStunEnabled\n") ; return Manager::instance().isStunEnabled(); } @@ -453,7 +461,7 @@ std::vector< std::string > ConfigurationManager::getAddressbookList ( void ) { } void ConfigurationManager::setAddressbookList( const std::vector< std::string >& list ) { - _debug("Manager received setAddressbookList") ; + _debug("Manager received setAddressbookList\n") ; Manager::instance().setAddressbookList(list); } diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 27ef3e4e079c7f1d9ac06a6a5c1c8e1d4477eea1..d4f6720b44c7ee8ae20704d4fff7c0fc910706da 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -1650,7 +1650,8 @@ ManagerImpl::getRecordPath( void ) void ManagerImpl::setRecordPath( const std::string& recPath) { - setConfig( AUDIO, RECORD_PATH, recPath.substr(7)); + _debug("ManagerImpl::setRecordPath(%s)! \n", recPath.c_str()); + setConfig( AUDIO, RECORD_PATH, recPath); } int