diff --git a/sflphone-gtk/pixmaps/missed.svg b/sflphone-gtk/pixmaps/missed.svg index bde29eaa6f00b6b436fdce442803d79668a3d998..c35efb7abf490ff188eee8aa96429746ab49a3ed 100644 --- a/sflphone-gtk/pixmaps/missed.svg +++ b/sflphone-gtk/pixmaps/missed.svg @@ -23,27 +23,15 @@ id="defs4"> <linearGradient inkscape:collect="always" - id="linearGradient2670"> + id="linearGradient2500"> <stop style="stop-color:#800000;stop-opacity:1;" offset="0" - id="stop2672" /> + id="stop2502" /> <stop style="stop-color:#800000;stop-opacity:0;" offset="1" - id="stop2674" /> - </linearGradient> - <linearGradient - inkscape:collect="always" - id="linearGradient2662"> - <stop - style="stop-color:#800000;stop-opacity:1;" - offset="0" - id="stop2664" /> - <stop - style="stop-color:#800000;stop-opacity:0;" - offset="1" - id="stop2666" /> + id="stop2504" /> </linearGradient> <inkscape:perspective sodipodi:type="inkscape:persp3d" @@ -51,15 +39,28 @@ inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="24 : 12 : 1" inkscape:persp3d-origin="12 : 8 : 1" - id="perspective4177" /> + id="perspective127" /> + <linearGradient + id="linearGradient4357" + inkscape:collect="always"> + <stop + id="stop4359" + offset="0" + style="stop-color:#b00000;stop-opacity:1" /> + <stop + id="stop4361" + offset="1" + style="stop-color:#b02100;stop-opacity:0" /> + </linearGradient> <linearGradient + inkscape:collect="always" id="linearGradient4269"> <stop - style="stop-color:#26b000;stop-opacity:1;" + style="stop-color:#b00014;stop-opacity:1;" offset="0" id="stop4271" /> <stop - style="stop-color:#26b000;stop-opacity:0;" + style="stop-color:#b00014;stop-opacity:0;" offset="1" id="stop4273" /> </linearGradient> @@ -68,11 +69,11 @@ <stop id="stop4185" offset="0" - style="stop-color:#26b000;stop-opacity:1;" /> + style="stop-color:#b00014;stop-opacity:1;" /> <stop id="stop4187" offset="1" - style="stop-color:#145f00;stop-opacity:1;" /> + style="stop-color:#70000c;stop-opacity:1;" /> </linearGradient> <linearGradient id="linearGradient4167"> @@ -87,22 +88,668 @@ </linearGradient> <linearGradient inkscape:collect="always" - xlink:href="#linearGradient2662" - id="linearGradient2668" - x1="23.737026" - y1="0.97416615" - x2="2.6100044" - y2="4.2842951" + xlink:href="#linearGradient4167" + id="linearGradient4173" + x1="7.1249466" + y1="23.946518" + x2="20.06057" + y2="16.478132" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(6.313453e-2,-0.384275)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4357" + id="linearGradient4275" + x1="15.630395" + y1="22.874208" + x2="15.806232" + y2="6.6770978" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(9.8321849e-3,-1.1581503,1.1581503,9.8321849e-3,-9.5427776,27.711489)" /> + <linearGradient + id="linearGradient2278"> + <stop + style="stop-color:#ffffff;stop-opacity:0" + offset="0" + id="stop2280" /> + <stop + style="stop-color:#fefee7;stop-opacity:0.89308178" + offset="1" + id="stop2282" /> + </linearGradient> + <linearGradient + id="linearGradient2284"> + <stop + style="stop-color:#1db000;stop-opacity:1;" + offset="0" + id="stop2286" /> + <stop + style="stop-color:#1db000;stop-opacity:0;" + offset="1" + id="stop2288" /> + </linearGradient> + <linearGradient + id="linearGradient2290"> + <stop + id="stop2292" + offset="0" + style="stop-color:#1db000;stop-opacity:1;" /> + <stop + id="stop2294" + offset="1" + style="stop-color:#0f5f00;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient2392"> + <stop + style="stop-color:#80000e;stop-opacity:1;" + offset="0" + id="stop2394" /> + <stop + style="stop-color:#b00014;stop-opacity:0;" + offset="1" + id="stop2396" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2390" + x1="16.826796" + y1="6.7288713" + x2="27.5625" + y2="22.512505" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.875025,0,0,0.875025,0.666703,0.177907)" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2304" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + id="linearGradient2306" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + id="linearGradient2386" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + y2="12.535715" + x2="31.31678" + y1="12.535715" + x1="24.397505" + id="linearGradient2310" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + y2="12.825893" + x2="7.9239235" + y1="12.825893" + x1="1.0046476" + id="linearGradient2312" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2380"> + <stop + id="stop2316" + offset="0" + style="stop-color:#80000e;stop-opacity:1;" /> + <stop + id="stop2318" + offset="1" + style="stop-color:#b00014;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2376"> + <stop + style="stop-color:#26b000;stop-opacity:1;" + offset="0" + id="stop2322" /> + <stop + style="stop-color:#145f00;stop-opacity:1;" + offset="1" + id="stop2324" /> + </linearGradient> + <linearGradient + id="linearGradient2326"> + <stop + id="stop2328" + offset="0" + style="stop-color:#26b000;stop-opacity:1;" /> + <stop + id="stop2330" + offset="1" + style="stop-color:#26b000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2332" + gradientUnits="userSpaceOnUse" + x1="15.647213" + y1="2.7028866" + x2="14.013638" + y2="10.576721" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2334" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1.262691,-1.100752)" + x1="10.57493" + y1="12.115559" + x2="-0.68574232" + y2="12.115559" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient2336" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-0.947018,-0.885198)" + x1="31.692968" + y1="11.264216" + x2="23.888865" + y2="13.35532" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2338" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0.426158,-2.762136)" + x1="7.8517423" + y1="15.912388" + x2="7.1114841" + y2="11.597325" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2340" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4045" + id="radialGradient2342" + cx="19.285715" + cy="9.8571424" + fx="19.285715" + fy="9.8571424" + r="10.885714" + gradientUnits="userSpaceOnUse" + spreadMethod="reflect" + gradientTransform="matrix(0.418975,2.444023e-18,-2.444023e-18,0.418975,11.20548,5.727248)" /> + <linearGradient + gradientTransform="matrix(1.256521,0,0,-1.256521,-7.854319,28.773309)" + gradientUnits="userSpaceOnUse" + y2="8.5305319" + x2="15.630395" + y1="22.874208" + x1="15.630395" + id="linearGradient2444" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,31.179578,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2442" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(1.1362892,-2.762136)" + gradientUnits="userSpaceOnUse" + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + id="linearGradient2440" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + id="linearGradient2438" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(-1.9107675,-0.885198)" + gradientUnits="userSpaceOnUse" + y2="12.535715" + x2="31.31678" + y1="12.535715" + x1="24.397505" + id="linearGradient2436" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(1.9220986,-1.100752)" + gradientUnits="userSpaceOnUse" + y2="12.825893" + x2="7.9239235" + y1="12.825893" + x1="1.0046476" + id="linearGradient2434" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2428"> + <stop + id="stop2430" + offset="0" + style="stop-color:#80000e;stop-opacity:1;" /> + <stop + id="stop2432" + offset="1" + style="stop-color:#b00014;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2422"> + <stop + style="stop-color:#26b000;stop-opacity:1;" + offset="0" + id="stop2424" /> + <stop + style="stop-color:#145f00;stop-opacity:1;" + offset="1" + id="stop2426" /> + </linearGradient> + <linearGradient + id="linearGradient2416"> + <stop + id="stop2418" + offset="0" + style="stop-color:#26b000;stop-opacity:1;" /> + <stop + id="stop2420" + offset="1" + style="stop-color:#26b000;stop-opacity:0;" /> + </linearGradient> + <radialGradient + gradientTransform="matrix(0.418975,0,0,0.418975,11.20548,5.727248)" + spreadMethod="reflect" + gradientUnits="userSpaceOnUse" + r="10.885714" + fy="9.8571424" + fx="19.285715" + cy="9.8571424" + cx="19.285715" + id="radialGradient4051" + xlink:href="#linearGradient4045" + inkscape:collect="always" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient1414" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="11.597325" + x2="7.1114841" + y1="15.912388" + x1="7.8517423" + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + id="linearGradient1412" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + y2="13.35532" + x2="23.888865" + y1="11.264216" + x1="31.692968" + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + id="linearGradient1410" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="12.115559" + x2="-0.68574232" + y1="12.115559" + x1="10.57493" + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + id="linearGradient1408" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + gradientUnits="userSpaceOnUse" + id="linearGradient1406" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient1362"> + <stop + style="stop-color:#26b000;stop-opacity:1;" + offset="0" + id="stop1364" /> + <stop + style="stop-color:#26b000;stop-opacity:0;" + offset="1" + id="stop1366" /> + </linearGradient> + <linearGradient + id="linearGradient1368"> + <stop + id="stop1370" + offset="0" + style="stop-color:#26b000;stop-opacity:1;" /> + <stop + id="stop1372" + offset="1" + style="stop-color:#145f00;stop-opacity:1;" /> + </linearGradient> + <linearGradient + id="linearGradient1374"> + <stop + style="stop-color:#80000e;stop-opacity:1;" + offset="0" + id="stop1376" /> + <stop + style="stop-color:#b00014;stop-opacity:0;" + offset="1" + id="stop1378" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient1380" + x1="1.0046476" + y1="12.825893" + x2="7.9239235" + y2="12.825893" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1.262691,-1.100752)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient1382" + x1="24.397505" + y1="12.535715" + x2="31.31678" + y2="12.535715" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-0.947018,-0.885198)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4183" + id="linearGradient1384" + x1="15.647213" + y1="2.7028866" + x2="14.013638" + y2="10.576721" gradientUnits="userSpaceOnUse" /> <linearGradient inkscape:collect="always" - xlink:href="#linearGradient2670" - id="linearGradient2676" - x1="1.2374369" - y1="9.1507568" - x2="15.849421" - y2="9.5528402" + xlink:href="#linearGradient4269" + id="linearGradient1386" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0.426158,-2.762136)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient1388" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + x1="2.0651877" + y1="12.625902" + x2="6.8378897" + y2="13.920053" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4269" + id="linearGradient2325" + x1="15.630395" + y1="22.874208" + x2="15.806232" + y2="6.6770978" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.62913,0,0,-1.62913,-10.06608,39.71987)" /> + <linearGradient + gradientTransform="matrix(0.875025,0,0,0.875025,0.666703,0.177907)" + gradientUnits="userSpaceOnUse" + y2="22.512505" + x2="27.5625" + y1="6.7288713" + x1="16.826796" + id="linearGradient2224" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + y2="13.920053" + x2="6.8378897" + y1="12.625902" + x1="2.0651877" + gradientTransform="matrix(-1,0,0,1,32.04188,-2.86473)" + gradientUnits="userSpaceOnUse" + id="linearGradient2322" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(0.426158,-2.762136)" + gradientUnits="userSpaceOnUse" + y2="11.597325" + x2="7.1114841" + y1="15.912388" + x1="7.8517423" + id="linearGradient2320" + xlink:href="#linearGradient4269" + inkscape:collect="always" /> + <linearGradient + gradientUnits="userSpaceOnUse" + y2="10.576721" + x2="14.013638" + y1="2.7028866" + x1="15.647213" + id="linearGradient2318" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(-0.947018,-0.885198)" + gradientUnits="userSpaceOnUse" + y2="13.35532" + x2="23.888865" + y1="11.264216" + x1="31.692968" + id="linearGradient2316" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + gradientTransform="translate(1.262691,-1.100752)" + gradientUnits="userSpaceOnUse" + y2="12.115559" + x2="-0.68574232" + y1="12.115559" + x1="10.57493" + id="linearGradient2314" + xlink:href="#linearGradient4183" + inkscape:collect="always" /> + <linearGradient + id="linearGradient2308"> + <stop + id="stop2310" + offset="0" + style="stop-color:#80000e;stop-opacity:1;" /> + <stop + id="stop2312" + offset="1" + style="stop-color:#b00014;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient2302"> + <stop + style="stop-color:#1db000;stop-opacity:1;" + offset="0" + id="stop2304" /> + <stop + style="stop-color:#0f5f00;stop-opacity:1;" + offset="1" + id="stop2306" /> + </linearGradient> + <linearGradient + id="linearGradient2296"> + <stop + id="stop2298" + offset="0" + style="stop-color:#1db000;stop-opacity:1;" /> + <stop + id="stop2300" + offset="1" + style="stop-color:#1db000;stop-opacity:0;" /> + </linearGradient> + <linearGradient + id="linearGradient4045"> + <stop + id="stop4047" + offset="0" + style="stop-color:#ffffff;stop-opacity:0" /> + <stop + id="stop4049" + offset="1" + style="stop-color:#fcfbcb;stop-opacity:1" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient2506" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3931" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3933" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3935" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3937" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3939" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3941" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3943" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3945" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3947" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient2500" + id="linearGradient3949" + gradientUnits="userSpaceOnUse" + x1="4.9409747" + y1="16.528652" + x2="6.2092013" + y2="-3.3282857" /> </defs> <sodipodi:namedview id="base" @@ -111,20 +758,24 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="11.313708" - inkscape:cx="18.87396" - inkscape:cy="2.756874" + inkscape:zoom="22.4" + inkscape:cx="16.277456" + inkscape:cy="16.683708" inkscape:document-units="px" inkscape:current-layer="layer1" width="32px" height="32px" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="1331" - inkscape:window-height="922" - inkscape:window-x="169" - inkscape:window-y="24" + inkscape:window-width="1679" + inkscape:window-height="976" + inkscape:window-x="1" + inkscape:window-y="48" showgrid="false"> + <sodipodi:guide + orientation="horizontal" + position="8.0357143" + id="guide3144" /> <sodipodi:guide orientation="vertical" position="15.982143" @@ -146,38 +797,66 @@ inkscape:groupmode="layer" id="layer1"> <path - style="opacity:1;fill:url(#linearGradient2676);fill-opacity:1;stroke:none;stroke-width:0.62500000000000000;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 1.2259613,4.6445578 L 9.5484692,4.6445578 L 9.5484692,0.60013384 L 15.849421,9.5528402 L 9.5484692,18.505547 L 9.5484692,14.461122 L 1.2259613,14.461122 L 1.2259613,4.6445578 z" + style="opacity:1;fill:url(#linearGradient4275);fill-opacity:1;stroke:none;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M -3.0911512,13.758869 L 8.3817787,13.856269 L 8.3501307,17.584066 L 17.106315,9.4059846 L 8.4902397,1.0804202 L 8.4585927,4.8082179 L -3.0143372,4.7108178 L -3.0911512,13.758869 z" id="rect4262" /> <g - id="g4160" - transform="matrix(0.3274903,-0.8169208,-0.8169208,-0.3274903,19.715453,28.330727)" - style="fill:url(#linearGradient2668);fill-opacity:1"> - <path - sodipodi:nodetypes="cccsccsccsccc" - id="path3153" - d="M 16.100095,4.59375 C 10.946289,4.7477067 7.2256019,5.7999634 3.4220983,7.28125 L 3.2345983,10.227679 C 3.7846813,10.972881 5.0136533,11.508929 6.4220983,11.508929 C 7.7912983,11.508929 8.9758403,11.004648 9.5470983,10.290179 L 9.5470983,9.1875 C 11.968608,8.682612 12.862258,8.4375 16.125,8.4375 C 19.479577,8.4375001 20.38467,8.6842603 22.807982,9.15625 L 22.807982,10.165179 C 23.37924,10.879648 24.563781,11.383929 25.932982,11.383929 C 27.341427,11.383929 28.53915,10.847881 29.089232,10.102679 L 28.901732,7.15625 C 24.491586,5.413068 20.816266,4.6964725 16.100095,4.59375 z" - style="opacity:1;fill:url(#linearGradient2668);fill-opacity:1.0;stroke:#0f5600;stroke-width:0.62500000000000000;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path3161" - d="M 6.4075414,13.019293 C 7.7882612,13.019293 8.983936,12.610489 9.5600003,12.01696 L 9.5600003,10.430989 C 8.8231919,11.109285 7.789205,11.494948 6.4075414,11.494948 C 4.9854414,11.494948 3.9881276,11.13019 3.2127675,10.48174 L 3.2127675,11.966208 C 3.7674786,12.585269 4.9872465,13.019293 6.4075414,13.019293 z" - style="opacity:1;fill:url(#linearGradient2668);fill-opacity:1.0;stroke:#0f5600;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path4140" - d="M 25.967532,12.944669 C 27.348252,12.944669 28.543927,12.535865 29.119991,11.942336 L 29.119991,10.356365 C 28.383183,11.034661 27.349196,11.420324 25.967532,11.420324 C 24.545432,11.420324 23.548118,11.055566 22.772758,10.407116 L 22.772758,11.891584 C 23.327469,12.510645 24.547237,12.944669 25.967532,12.944669 z" - style="opacity:1;fill:url(#linearGradient2668);fill-opacity:1.0;stroke:#0f5600;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path4246" - d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.8978659,7.4805434 C 9.1610575,8.1588394 8.1270706,8.5445024 6.745407,8.5445024 C 5.323307,8.5445024 4.4996132,8.1797444 3.7242531,7.5312944 L 3.4874986,10.104833 C 4.0422097,10.723894 5.2619776,11.157918 6.6822725,11.157918 z" - style="opacity:1;fill:url(#linearGradient2668);fill-opacity:1.0;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <path - sodipodi:nodetypes="cccsccc" - id="path4258" - d="M 25.633599,11.055324 C 24.252879,11.055324 23.56228,10.630736 22.986216,10.037207 L 22.418005,7.3779497 C 23.154814,8.0562457 24.188801,8.4419087 25.570464,8.4419087 C 26.992564,8.4419087 27.816258,8.0771507 28.591618,7.4287007 L 28.828373,10.002239 C 28.273662,10.6213 27.053894,11.055324 25.633599,11.055324 z" - style="opacity:1;fill:url(#linearGradient2668);fill-opacity:1.0;stroke:none;stroke-width:0.57204323999999995;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + id="g2407" + inkscape:label="Calque 1" + transform="matrix(-0.5300637,-0.8479578,0.8479578,-0.5300637,12.117465,28.739892)" + style="fill:url(#linearGradient2506);fill-opacity:1"> + <g + transform="translate(14.730114,-3.4355522)" + inkscape:label="Calque 1" + id="g2364" + style="fill:url(#linearGradient3949);fill-opacity:1"> + <g + id="g2446" + inkscape:label="Calque 1" + transform="translate(7.9455775,4.2707653)" + style="fill:url(#linearGradient3947);fill-opacity:1"> + <g + style="fill:url(#linearGradient3933);fill-opacity:1;stroke:#000000;stroke-opacity:0.44968555" + transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)" + id="g2181"> + <path + sodipodi:nodetypes="csccczccsccccc" + id="path2183" + d="M 41.109694,-0.41817229 C 40.505298,0.20454826 39.040867,0.77635346 37.592239,0.77635106 C 36.102089,0.77635106 34.114653,0.15682998 33.532659,-0.49267807 L 33.569913,-2.0031726 L 33.569913,-3.0835065 C 31.027414,-3.5787101 30.997014,-3.8285637 27.525623,-3.8285643 C 24.054233,-3.8285649 23.830777,-3.5759718 21.29017,-3.0462535 L 21.29017,-0.3436665 C 20.685773,0.27905404 19.221343,0.87609843 17.772714,0.87609724 C 16.282564,0.87609724 14.623294,0.43325774 13.915083,-0.41817229 L 14.138601,-5.7646408 C 18.129172,-7.3187814 22.030595,-8.3970767 27.437882,-8.5586077 C 32.38601,-8.450833 36.259126,-7.7053161 40.886177,-5.8763994 L 41.109694,-0.41817229 z" + style="opacity:1;fill:url(#linearGradient3931);fill-opacity:1;stroke:#000000;stroke-width:0.65573961;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44968555" /> + </g> + <g + transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)" + id="g2451" + style="fill:url(#linearGradient3945);fill-opacity:1"> + <path + style="opacity:1;fill:url(#linearGradient3935);fill-opacity:1;stroke:#561500;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 16.100095,4.59375 C 10.946289,4.7477067 7.2256019,5.7999634 3.4220983,7.28125 L 3.2345983,10.227679 C 3.7846813,10.972881 5.0136533,11.508929 6.4220983,11.508929 C 7.7912983,11.508929 8.9758403,11.004648 9.5470983,10.290179 L 9.5470983,9.1875 C 11.968608,8.682612 12.862258,8.4375 16.125,8.4375 C 19.479577,8.4375001 20.38467,8.6842603 22.807982,9.15625 L 22.807982,10.165179 C 23.37924,10.879648 24.563781,11.383929 25.932982,11.383929 C 27.341427,11.383929 28.53915,10.847881 29.089232,10.102679 L 28.901732,7.15625 C 24.491586,5.413068 20.816266,4.6964725 16.100095,4.59375 z" + id="path2453" + sodipodi:nodetypes="cccsccsccsccc" /> + <path + style="opacity:1;fill:url(#linearGradient3937);fill-opacity:1;stroke:#561500;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 6.4075414,13.019293 C 7.7882612,13.019293 8.983936,12.610489 9.5600003,12.01696 L 9.5600003,10.430989 C 8.8231919,11.109285 7.789205,11.494948 6.4075414,11.494948 C 4.9854414,11.494948 3.9881276,11.13019 3.2127675,10.48174 L 3.2127675,11.966208 C 3.7674786,12.585269 4.9872465,13.019293 6.4075414,13.019293 z" + id="path2455" + sodipodi:nodetypes="cccsccc" /> + <path + style="opacity:1;fill:url(#linearGradient3939);fill-opacity:1;stroke:#561500;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 25.967532,12.944669 C 27.348252,12.944669 28.543927,12.535865 29.119991,11.942336 L 29.119991,10.356365 C 28.383183,11.034661 27.349196,11.420324 25.967532,11.420324 C 24.545432,11.420324 23.548118,11.055566 22.772758,10.407116 L 22.772758,11.891584 C 23.327469,12.510645 24.547237,12.944669 25.967532,12.944669 z" + id="path2457" + sodipodi:nodetypes="cccsccc" /> + <path + style="opacity:1;fill:url(#linearGradient3941);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 6.6822725,11.157918 C 8.0629923,11.157918 8.7535908,10.73333 9.3296551,10.139801 L 9.0644746,7.3100024 C 8.3276662,7.9882984 8.1270706,8.5445024 6.745407,8.5445024 C 5.323307,8.5445024 4.4996132,8.1797444 3.7242531,7.5312944 L 3.4874986,10.104833 C 4.0422097,10.723894 5.2619776,11.157918 6.6822725,11.157918 z" + id="path2459" + sodipodi:nodetypes="cccsccc" /> + <path + style="opacity:1;fill:url(#linearGradient3943);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 25.633599,11.055324 C 24.252879,11.055324 23.56228,10.630736 22.986216,10.037207 L 22.418005,7.3779497 C 23.154814,8.0562457 24.188801,8.4419087 25.570464,8.4419087 C 26.992564,8.4419087 27.816258,8.0771507 28.591618,7.4287007 L 28.828373,10.002239 C 28.273662,10.6213 27.053894,11.055324 25.633599,11.055324 z" + id="path2461" + sodipodi:nodetypes="cccsccc" /> + </g> + </g> + </g> </g> </g> </svg> diff --git a/sflphone-gtk/src/Makefile.am b/sflphone-gtk/src/Makefile.am index 271cbba67826a24d0deffe65d69e9350b6007dea..677c6b4052648e9e56e9fa4079329f90e10d32c3 100644 --- a/sflphone-gtk/src/Makefile.am +++ b/sflphone-gtk/src/Makefile.am @@ -28,11 +28,12 @@ sflphone_gtk_SOURCES = \ sliders.c \ $(STATUSICON_SOURCE) \ codeclist.c \ + timestamp.c \ MemManager.c noinst_HEADERS = actions.h dbus.h sflnotify.h mainwindow.h calllist.h dialpad.h codeclist.h assistant.h\ callmanager-glue.h errors.h sflphone_const.h configurationmanager-glue.h instance-glue.h menus.h calltab.h calltree.h configwindow.h \ - accountlist.h accountwindow.h marshaller.h sliders.h $(STATUSICON_HEADER) + accountlist.h accountwindow.h marshaller.h sliders.h $(STATUSICON_HEADER) timestamp.h EXTRA_DIST = marshaller.list sflphone_gtk_LDADD = $(DEPS_LIBS) -lnotify diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c index c09393ef406e6d3bea333d55a8d2ac317e0f935c..721574283f59c85369e5bd695089408104ac8fd2 100644 --- a/sflphone-gtk/src/actions.c +++ b/sflphone-gtk/src/actions.c @@ -217,6 +217,7 @@ void sflphone_hang_up() { call_t * selectedCall = call_get_selected(current_calls); + (void) time(&selectedCall->_stop); if(selectedCall) { switch(selectedCall->state) @@ -224,9 +225,13 @@ sflphone_hang_up() case CALL_STATE_DIALING: dbus_hang_up (selectedCall); break; + case CALL_STATE_RINGING: + dbus_hang_up (selectedCall); + selectedCall->state = CALL_STATE_DIALING; + selectedCall->_stop = 0; + break; case CALL_STATE_CURRENT: case CALL_STATE_HOLD: - case CALL_STATE_RINGING: case CALL_STATE_BUSY: case CALL_STATE_FAILURE: dbus_hang_up (selectedCall); @@ -245,6 +250,7 @@ sflphone_hang_up() break; } } + update_call_tree( history , selectedCall ); } @@ -343,6 +349,7 @@ sflphone_current( call_t * c ) c->state = CALL_STATE_CURRENT; update_call_tree(current_calls,c); update_menus(); + (void) time(&c->_start); } void @@ -468,6 +475,9 @@ sflphone_new_call() c->to = g_strdup(""); + c->_start = 0; + c->_stop = 0; + call_list_add(current_calls,c); update_call_tree_add(current_calls,c); update_menus(); @@ -494,6 +504,8 @@ sflphone_keypad( guint keyval, gchar * key) { case 65307: /* ESCAPE */ dbus_hang_up(c); + (void) time(&c->_stop); + update_call_tree( history , c ); break; default: // To play the dtmf when calling mail box for instance @@ -562,8 +574,10 @@ sflphone_keypad( guint keyval, gchar * key) switch (keyval) { case 65307: /* ESCAPE */ - dbus_hang_up(c); - break; + dbus_hang_up(c); + c->_stop = 0; + update_call_tree( history , c ); + break; } break; default: diff --git a/sflphone-gtk/src/calllist.h b/sflphone-gtk/src/calllist.h index 9a6736cb242de29b224bf5f78c3e6a7b9d219b55..503e88a51cb248dc9b720824c71fa208b3ad546e 100644 --- a/sflphone-gtk/src/calllist.h +++ b/sflphone-gtk/src/calllist.h @@ -79,6 +79,10 @@ typedef struct { call_state_t state; /** The history state */ history_state_t history_state; + + time_t _start; + time_t _stop; + } call_t; typedef struct { diff --git a/sflphone-gtk/src/calltree.c b/sflphone-gtk/src/calltree.c index f334978db66caef5c939f893f8393feaabc9e821..cb1542aac2ac47ab07ca6c311387d8ab415a2e6c 100644 --- a/sflphone-gtk/src/calltree.c +++ b/sflphone-gtk/src/calltree.c @@ -44,15 +44,15 @@ gboolean history_shown; /** * Show popup menu */ -static gboolean + static gboolean popup_menu (GtkWidget *widget, - gpointer user_data) + gpointer user_data) { show_popup_menu(widget, NULL); return TRUE; } - -static gboolean + + static gboolean button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data) { if (event->button == 3 && event->type == GDK_BUTTON_PRESS) @@ -65,271 +65,273 @@ button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data) /** * Make a call */ -static void + static void call_button( GtkWidget *widget, gpointer data ) { - call_t * selectedCall; - printf("Call button pressed\n"); - if(call_list_get_size(current_calls)>0) - sflphone_pick_up(); - else if(call_list_get_size(active_calltree) > 0){ - printf("Calling a called num\n"); - selectedCall = call_get_selected(active_calltree); - if(!selectedCall->to){ - selectedCall->to = call_get_number(selectedCall); - selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">",NULL); - } - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(historyButton), FALSE); - printf("call : from : %s to %s\n", selectedCall->from, selectedCall->to); - call_list_add(current_calls, selectedCall); - update_call_tree_add(current_calls, selectedCall); - sflphone_place_call(selectedCall); - }else - sflphone_new_call(); + call_t * selectedCall; + printf("Call button pressed\n"); + if(call_list_get_size(current_calls)>0) + sflphone_pick_up(); + else if(call_list_get_size(active_calltree) > 0){ + printf("Calling a called num\n"); + selectedCall = call_get_selected(active_calltree); + if(!selectedCall->to){ + selectedCall->to = call_get_number(selectedCall); + selectedCall->from = g_strconcat("\"\" <", selectedCall->to, ">",NULL); + } + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(historyButton), FALSE); + printf("call : from : %s to %s\n", selectedCall->from, selectedCall->to); + call_list_add(current_calls, selectedCall); + update_call_tree_add(current_calls, selectedCall); + sflphone_place_call(selectedCall); + }else + sflphone_new_call(); } /** * Hang up the line */ -static void + static void hang_up( GtkWidget *widget, gpointer data ) { - sflphone_hang_up(); + sflphone_hang_up(); } /** * Hold the line */ -static void + static void hold( GtkWidget *widget, gpointer data ) { - sflphone_on_hold(); + sflphone_on_hold(); } /** * Transfert the line */ -static void + static void transfert (GtkToggleToolButton *toggle_tool_button, - gpointer user_data) + gpointer user_data) { - gboolean up = gtk_toggle_tool_button_get_active(toggle_tool_button); - if(up) - { - sflphone_set_transfert(); - } - else - { - sflphone_unset_transfert(); - } + gboolean up = gtk_toggle_tool_button_get_active(toggle_tool_button); + if(up) + { + sflphone_set_transfert(); + } + else + { + sflphone_unset_transfert(); + } } /** * Unhold call */ -static void + static void unhold( GtkWidget *widget, gpointer data ) { - sflphone_off_hold(); + sflphone_off_hold(); } -static void + static void toggle_history(GtkToggleToolButton *toggle_tool_button, - gpointer user_data) + gpointer user_data) { - GtkTreeSelection *sel; - if(history_shown){ - active_calltree = current_calls; - gtk_widget_hide(history->tree); - gtk_widget_show(current_calls->tree); - history_shown = FALSE; - }else{ - active_calltree = history; - gtk_widget_hide(current_calls->tree); - gtk_widget_show(history->tree); - history_shown = TRUE; - } - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view)); - g_signal_emit_by_name(sel, "changed"); - toolbar_update_buttons(); + GtkTreeSelection *sel; + if(history_shown){ + active_calltree = current_calls; + gtk_widget_hide(history->tree); + gtk_widget_show(current_calls->tree); + history_shown = FALSE; + }else{ + active_calltree = history; + gtk_widget_hide(current_calls->tree); + gtk_widget_show(history->tree); + history_shown = TRUE; + } + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view)); + g_signal_emit_by_name(sel, "changed"); + toolbar_update_buttons(); } static void call_mailbox( GtkWidget* widget , gpointer data ) { - account_t* current = account_list_get_current(); - call_t* mailboxCall = g_new0( call_t , 1); - mailboxCall->state = CALL_STATE_DIALING; - mailboxCall->from = g_strconcat("\"\" <>", NULL); - mailboxCall->callID = g_new0(gchar, 30); - g_sprintf(mailboxCall->callID, "%d", rand()); - mailboxCall->to = g_strdup(g_hash_table_lookup(current->properties, ACCOUNT_MAILBOX)); - mailboxCall->accountID = g_strdup(current->accountID); - g_print("TO : %s\n" , mailboxCall->to); - call_list_add( current_calls , mailboxCall ); - update_call_tree_add( current_calls , mailboxCall ); - update_menus(); - sflphone_place_call( mailboxCall ); + account_t* current = account_list_get_current(); + if( current == NULL ) // Should not happens + return; + call_t* mailboxCall = g_new0( call_t , 1); + mailboxCall->state = CALL_STATE_DIALING; + mailboxCall->to = g_strdup(g_hash_table_lookup(current->properties, ACCOUNT_MAILBOX)); + //mailboxCall->from = g_strconcat("\"Voicemail Box\" <>", NULL); + mailboxCall->from = g_markup_printf_escaped("\"Voicemail\" <%s>", mailboxCall->to); + mailboxCall->callID = g_new0(gchar, 30); + g_sprintf(mailboxCall->callID, "%d", rand()); + mailboxCall->accountID = g_strdup(current->accountID); + mailboxCall->_start = 0; + mailboxCall->_stop = 0; + g_print("TO : %s\n" , mailboxCall->to); + call_list_add( current_calls , mailboxCall ); + update_call_tree_add( current_calls , mailboxCall ); + update_menus(); + sflphone_place_call( mailboxCall ); } -void + void toolbar_update_buttons () { - gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(holdButton), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton) , FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(holdButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton) , FALSE); + gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), FALSE); + g_object_ref(holdButton); + g_object_ref(unholdButton); + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(holdButton)); + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(unholdButton)); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), holdButton, 3); + g_object_ref(callButton); + g_object_ref(pickupButton); + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(pickupButton)); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), callButton, 0); + + + gtk_signal_handler_block(GTK_OBJECT(transfertButton),transfertButtonConnId); + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), FALSE); + gtk_signal_handler_unblock(transfertButton, transfertButtonConnId); + + call_t * selectedCall = call_get_selected(active_calltree); + if (selectedCall) + { + switch(selectedCall->state) + { + case CALL_STATE_INCOMING: + gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + g_object_ref(callButton); + gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), pickupButton, 0); + break; + case CALL_STATE_HOLD: + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); g_object_ref(holdButton); - g_object_ref(unholdButton); gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(holdButton)); - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(unholdButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), holdButton, 3); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), unholdButton, 3); + break; + case CALL_STATE_RINGING: + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); + break; + case CALL_STATE_DIALING: + if( active_calltree != history ) gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); g_object_ref(callButton); - g_object_ref(pickupButton); gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(pickupButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), callButton, 0); - - + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), pickupButton, 0); + break; + case CALL_STATE_CURRENT: + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); + break; + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + break; + case CALL_STATE_TRANSFERT: gtk_signal_handler_block(GTK_OBJECT(transfertButton),transfertButtonConnId); - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), FALSE); + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), TRUE); gtk_signal_handler_unblock(transfertButton, transfertButtonConnId); - - call_t * selectedCall = call_get_selected(active_calltree); - if (selectedCall) - { - switch(selectedCall->state) - { - case CALL_STATE_INCOMING: - gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - g_object_ref(callButton); - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), pickupButton, 0); - break; - case CALL_STATE_HOLD: - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(unholdButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); - g_object_ref(holdButton); - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(holdButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), unholdButton, 3); - break; - case CALL_STATE_RINGING: - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); - break; - case CALL_STATE_DIALING: - if( active_calltree != history ) gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(pickupButton), TRUE); - g_object_ref(callButton); - gtk_container_remove(GTK_CONTAINER(toolbar), GTK_WIDGET(callButton)); - gtk_toolbar_insert(GTK_TOOLBAR(toolbar), pickupButton, 0); - break; - case CALL_STATE_CURRENT: - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); - break; - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - break; - case CALL_STATE_TRANSFERT: - gtk_signal_handler_block(GTK_OBJECT(transfertButton),transfertButtonConnId); - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transfertButton), TRUE); - gtk_signal_handler_unblock(transfertButton, transfertButtonConnId); - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); - gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); - break; - default: - g_warning("Should not happen!"); - break; - } - } - else - { - if( account_list_get_size() > 0 ) - { - gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE ); - gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton), TRUE ); - } - else - { - gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); - } - } + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(hangupButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(holdButton), TRUE); + gtk_widget_set_sensitive( GTK_WIDGET(transfertButton), TRUE); + break; + default: + g_warning("Should not happen!"); + break; + } + } + else + { + if( account_list_get_size() > 0 ) + { + gtk_widget_set_sensitive( GTK_WIDGET(callButton), TRUE ); + gtk_widget_set_sensitive( GTK_WIDGET(mailboxButton), TRUE ); + } + else + { + gtk_widget_set_sensitive( GTK_WIDGET(callButton), FALSE); + } + } } /* Call back when the user click on a call in the list */ -static void + static void selected(GtkTreeSelection *sel, void* data) { - GtkTreeIter iter; - GValue val; - GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; + GtkTreeIter iter; + GValue val; + GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; - if (! gtk_tree_selection_get_selected (sel, &model, &iter)) - return; + if (! gtk_tree_selection_get_selected (sel, &model, &iter)) + return; - val.g_type = 0; - gtk_tree_model_get_value (model, &iter, 2, &val); + val.g_type = 0; + gtk_tree_model_get_value (model, &iter, 2, &val); - call_select(active_calltree, (call_t*) g_value_get_pointer(&val)); - g_value_unset(&val); + call_select(active_calltree, (call_t*) g_value_get_pointer(&val)); + g_value_unset(&val); - toolbar_update_buttons(); + toolbar_update_buttons(); } /* A row is activated when it is double clicked */ void row_activated(GtkTreeView *tree_view, - GtkTreePath *path, - GtkTreeViewColumn *column, - void * data) + GtkTreePath *path, + GtkTreeViewColumn *column, + void * data) { - call_t * selectedCall = call_get_selected(current_calls); - if (selectedCall) - { - switch(selectedCall->state) - { - case CALL_STATE_INCOMING: - dbus_accept(selectedCall); - break; - case CALL_STATE_HOLD: - dbus_unhold(selectedCall); - break; - case CALL_STATE_RINGING: - case CALL_STATE_CURRENT: - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - break; - case CALL_STATE_DIALING: - sflphone_place_call (selectedCall); - break; - default: - g_warning("Should not happen!"); - break; - } - } + call_t * selectedCall = call_get_selected(current_calls); + if (selectedCall) + { + switch(selectedCall->state) + { + case CALL_STATE_INCOMING: + dbus_accept(selectedCall); + break; + case CALL_STATE_HOLD: + dbus_unhold(selectedCall); + break; + case CALL_STATE_RINGING: + case CALL_STATE_CURRENT: + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + break; + case CALL_STATE_DIALING: + sflphone_place_call (selectedCall); + break; + default: + g_warning("Should not happen!"); + break; + } + } } -GtkWidget * + GtkWidget * create_toolbar () { - GtkWidget *ret; - GtkWidget *image; + GtkWidget *ret; + GtkWidget *image; - ret = gtk_toolbar_new(); - toolbar = ret; - - gtk_toolbar_set_orientation(GTK_TOOLBAR(ret), GTK_ORIENTATION_HORIZONTAL); - gtk_toolbar_set_style(GTK_TOOLBAR(ret), GTK_TOOLBAR_ICONS); + ret = gtk_toolbar_new(); + toolbar = ret; image = gtk_image_new_from_file( ICONS_DIR "/call.svg"); callButton = gtk_tool_button_new (image, _("Place a call")); @@ -339,6 +341,8 @@ create_toolbar () g_signal_connect (G_OBJECT (callButton), "clicked", G_CALLBACK (call_button), NULL); gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(callButton), -1); + gtk_toolbar_set_orientation(GTK_TOOLBAR(ret), GTK_ORIENTATION_HORIZONTAL); + gtk_toolbar_set_style(GTK_TOOLBAR(ret), GTK_TOOLBAR_ICONS); image = gtk_image_new_from_file( ICONS_DIR "/accept.svg"); pickupButton = gtk_tool_button_new(image, _("Pick up")); @@ -421,293 +425,304 @@ create_toolbar () } -void + void create_call_tree (calltab_t* tab) { - GtkWidget *sw; - GtkCellRenderer *rend; - GtkTreeViewColumn *col; - GtkTreeSelection *sel; + GtkWidget *sw; + GtkCellRenderer *rend; + GtkTreeViewColumn *col; + GtkTreeSelection *sel; + + tab->tree = gtk_vbox_new(FALSE, 10); - tab->tree = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER (tab->tree), 0); - gtk_container_set_border_width (GTK_CONTAINER (tab->tree), 0); + sw = gtk_scrolled_window_new( NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); - sw = gtk_scrolled_window_new( NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); + tab->store = gtk_list_store_new (3, + GDK_TYPE_PIXBUF,// Icon - tab->store = gtk_list_store_new (3, - GDK_TYPE_PIXBUF,// Icon - G_TYPE_STRING, // Description - G_TYPE_POINTER // Pointer to the Object - ); + G_TYPE_STRING, // Description + G_TYPE_POINTER // Pointer to the Object + ); - tab->view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(tab->store)); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(tab->view), FALSE); - g_signal_connect (G_OBJECT (tab->view), "row-activated", - G_CALLBACK (row_activated), - NULL); + tab->view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(tab->store)); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(tab->view), FALSE); + g_signal_connect (G_OBJECT (tab->view), "row-activated", + G_CALLBACK (row_activated), + NULL); // Connect the popup menu - g_signal_connect (G_OBJECT (tab->view), "popup-menu", - G_CALLBACK (popup_menu), - NULL); - g_signal_connect (G_OBJECT (tab->view), "button-press-event", - G_CALLBACK (button_pressed), - NULL); - - rend = gtk_cell_renderer_pixbuf_new(); - col = gtk_tree_view_column_new_with_attributes ("Icon", - rend, - "pixbuf", 0, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); - - rend = gtk_cell_renderer_text_new(); - col = gtk_tree_view_column_new_with_attributes ("Description", - rend, - "markup", 1, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); - g_object_unref(G_OBJECT(tab->store)); - gtk_container_add(GTK_CONTAINER(sw), tab->view); - - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tab->view)); - g_signal_connect (G_OBJECT (sel), "changed", - G_CALLBACK (selected), - NULL); - - gtk_box_pack_start(GTK_BOX(tab->tree), sw, TRUE, TRUE, 0); - - gtk_widget_show(tab->tree); - - //toolbar_update_buttons(); - + g_signal_connect (G_OBJECT (tab->view), "popup-menu", + G_CALLBACK (popup_menu), + NULL); + g_signal_connect (G_OBJECT (tab->view), "button-press-event", + G_CALLBACK (button_pressed), + NULL); + + rend = gtk_cell_renderer_pixbuf_new(); + col = gtk_tree_view_column_new_with_attributes ("Icon", + rend, + "pixbuf", 0, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); + + rend = gtk_cell_renderer_text_new(); + col = gtk_tree_view_column_new_with_attributes ("Description", + rend, + "markup", 1, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(tab->view), col); + + g_object_unref(G_OBJECT(tab->store)); + gtk_container_add(GTK_CONTAINER(sw), tab->view); + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tab->view)); + g_signal_connect (G_OBJECT (sel), "changed", + G_CALLBACK (selected), + NULL); + + gtk_box_pack_start(GTK_BOX(tab->tree), sw, TRUE, TRUE, 0); + + gtk_widget_show(tab->tree); + + //toolbar_update_buttons(); + } -void + void update_call_tree_remove (calltab_t* tab, call_t * c) { - GtkTreeIter iter; - GValue val; - call_t * iterCall; - GtkListStore* store = tab->store; - GtkWidget* view = tab->view; - - int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); - int i; - for( i = 0; i < nbChild; i++) - { - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i)) - { - val.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); - - iterCall = (call_t*) g_value_get_pointer(&val); - g_value_unset(&val); - - if(iterCall == c) - { - gtk_list_store_remove(store, &iter); - } - } - } - call_t * selectedCall = call_get_selected(tab); - if(selectedCall == c) - call_select(tab, NULL); - toolbar_update_buttons(); + GtkTreeIter iter; + GValue val; + call_t * iterCall; + GtkListStore* store = tab->store; + GtkWidget* view = tab->view; + + int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); + int i; + for( i = 0; i < nbChild; i++) + { + if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i)) + { + val.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); + + iterCall = (call_t*) g_value_get_pointer(&val); + g_value_unset(&val); + + if(iterCall == c) + { + gtk_list_store_remove(store, &iter); + } + } + } + call_t * selectedCall = call_get_selected(tab); + if(selectedCall == c) + call_select(tab, NULL); + toolbar_update_buttons(); } -void + void update_call_tree (calltab_t* tab, call_t * c) { - GdkPixbuf *pixbuf; - GtkTreeIter iter; - GValue val; - call_t * iterCall; - GtkListStore* store = tab->store; - GtkWidget* view = tab->view; - - int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); - int i; - for( i = 0; i < nbChild; i++) + GdkPixbuf *pixbuf; + GtkTreeIter iter; + GValue val; + call_t * iterCall; + GtkListStore* store = tab->store; + GtkWidget* view = tab->view; + + int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); + int i; + for( i = 0; i < nbChild; i++) + { + if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i)) + { + val.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); + + iterCall = (call_t*) g_value_get_pointer(&val); + g_value_unset(&val); + + if(iterCall == c) + { + // Existing call in the list + gchar * description; + gchar * date=""; + gchar * duration=""; + if(c->state == CALL_STATE_TRANSFERT) { - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i)) - { - val.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter, 2, &val); - - iterCall = (call_t*) g_value_get_pointer(&val); - g_value_unset(&val); - - if(iterCall == c) - { - // Existing call in the list - gchar * markup; - if(c->state == CALL_STATE_TRANSFERT) - { - markup = g_markup_printf_escaped("<b>%s</b>\n" - "%s\n<i>Transfert to:</i> %s", - call_get_name(c), - call_get_number(c), - c->to); - } - else - { - markup = g_markup_printf_escaped("<b>%s</b>\n" - "%s", - call_get_name(c), - call_get_number(c)); - } - - if( tab == current_calls ) - { - switch(c->state) - { - case CALL_STATE_HOLD: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL); - break; - case CALL_STATE_RINGING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - break; - case CALL_STATE_CURRENT: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); - break; - case CALL_STATE_DIALING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); - break; - case CALL_STATE_FAILURE: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL); - break; - case CALL_STATE_BUSY: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/busy.svg", NULL); - break; - case CALL_STATE_TRANSFERT: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/transfert.svg", NULL); - break; - default: - g_warning("Should not happen!"); - } - } - else - { - switch(c->history_state) - { - case OUTGOING: - g_print("Outgoing state\n"); - pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/outgoing.svg", NULL); - break; - case INCOMING: - g_print("Incoming state\n"); - pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/incoming.svg", NULL); - break; - case MISSED: - g_print("Missed state\n"); - pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/missed.svg", NULL); - break; - default: - g_print("No history state\n"); - break; - } - } - //Resize it - if(pixbuf) - { - if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) - { - pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); - } - } - g_print("MARKUP UPDATE = %s\n" , markup ); - gtk_list_store_set(store, &iter, - 0, pixbuf, // Icon - 1, markup, // Description - -1); - - if (pixbuf != NULL) - g_object_unref(G_OBJECT(pixbuf)); - - } - } - - } - toolbar_update_buttons(); -} - -void -update_call_tree_add (calltab_t* tab, call_t * c) -{ - if( tab == history && ( call_list_get_size( tab ) > dbus_get_max_calls() ) ) - return; - - GdkPixbuf *pixbuf; - GtkTreeIter iter; - GtkTreeSelection* sel; - //GtkListStore* store = tab->store; - //GtkWidget* view = tab->view; - - // New call in the list - gchar * markup; - markup = g_markup_printf_escaped("<b>%s</b>\n" - "%s", - call_get_name(c), - call_get_number(c)); - - gtk_list_store_prepend (tab->store, &iter); + description = g_markup_printf_escaped("<b>%s</b>\n" + "%s\n<i>Transfert to:</i> %s", + call_get_number(c), + call_get_name(c), + c->to); + } + else + { + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", + call_get_number(c), + call_get_name(c)); + } if( tab == current_calls ) { - switch(c->state) - { - case CALL_STATE_INCOMING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - break; - case CALL_STATE_DIALING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); - break; - case CALL_STATE_RINGING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); - break; - default: - g_warning("Should not happen!"); - } + switch(c->state) + { + case CALL_STATE_HOLD: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/hold.svg", NULL); + break; + case CALL_STATE_RINGING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); + break; + case CALL_STATE_CURRENT: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); + break; + case CALL_STATE_DIALING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); + break; + case CALL_STATE_FAILURE: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL); + break; + case CALL_STATE_BUSY: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/busy.svg", NULL); + break; + case CALL_STATE_TRANSFERT: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/transfert.svg", NULL); + break; + default: + g_warning("Should not happen!"); + } } - else{ + else + { switch(c->history_state) { - case INCOMING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/incoming.svg", NULL); - break; case OUTGOING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/outgoing.svg", NULL); + g_print("Outgoing state\n"); + pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/outgoing.svg", NULL); + break; + case INCOMING: + g_print("Incoming state\n"); + pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/incoming.svg", NULL); break; case MISSED: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/missed.svg", NULL); + g_print("Missed state\n"); + pixbuf = gdk_pixbuf_new_from_file( ICONS_DIR "/missed.svg", NULL); break; default: - g_warning("Should not happen!"); + g_print("No history state\n"); + break; } + date = timestamp_get_call_date(); + duration = process_call_duration(c); + description = g_strconcat( date , description , NULL); + description = g_strconcat( description, duration, NULL); } - //Resize it if(pixbuf) { - if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) - { - pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); - } + if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) + { + pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); + } } - gtk_list_store_set(tab->store, &iter, - 0, pixbuf, // Icon - 1, markup, // Description - 2, c, // Pointer - -1); + gtk_list_store_set(store, &iter, + 0, pixbuf, // Icon + 1, description, // Description + -1); if (pixbuf != NULL) - g_object_unref(G_OBJECT(pixbuf)); + g_object_unref(G_OBJECT(pixbuf)); + + } + } + + } + toolbar_update_buttons(); +} + + void +update_call_tree_add (calltab_t* tab, call_t * c) +{ + if( tab == history && ( call_list_get_size( tab ) > dbus_get_max_calls() ) ) + return; + + GdkPixbuf *pixbuf; + GtkTreeIter iter; + GtkTreeSelection* sel; - sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tab->view)); - gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter); - toolbar_update_buttons(); + // New call in the list + gchar * description; + gchar * date=""; + gchar * duration=""; + description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", + call_get_number(c), + call_get_name(c)); + + + gtk_list_store_prepend (tab->store, &iter); + + if( tab == current_calls ) + { + switch(c->state) + { + case CALL_STATE_INCOMING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); + break; + case CALL_STATE_DIALING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); + break; + case CALL_STATE_RINGING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/ring.svg", NULL); + break; + default: + g_warning("Should not happen!"); + } + } + else{ + switch(c->history_state) + { + case INCOMING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/incoming.svg", NULL); + break; + case OUTGOING: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/outgoing.svg", NULL); + break; + case MISSED: + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/missed.svg", NULL); + break; + default: + g_warning("Should not happen!"); + } + date = timestamp_get_call_date(); + + duration = process_call_duration(c); + //g_print("call duration = %s\n" , duration); + description = g_strconcat( date , description , NULL); + } + + //Resize it + if(pixbuf) + { + if(gdk_pixbuf_get_width(pixbuf) > 32 || gdk_pixbuf_get_height(pixbuf) > 32) + { + pixbuf = gdk_pixbuf_scale_simple(pixbuf, 32, 32, GDK_INTERP_BILINEAR); + } + } + gtk_list_store_set(tab->store, &iter, + 0, pixbuf, // Icon + 1, description, // Description + 2, c, // Pointer + -1); + + if (pixbuf != NULL) + g_object_unref(G_OBJECT(pixbuf)); + + sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tab->view)); + gtk_tree_selection_select_iter(GTK_TREE_SELECTION(sel), &iter); + toolbar_update_buttons(); } diff --git a/sflphone-gtk/src/calltree.h b/sflphone-gtk/src/calltree.h index c2bad5b661f1a0b75a8b993ee14375ec60975c17..fe7fc19635b4f753603b50c27cb79244ef67b122 100644 --- a/sflphone-gtk/src/calltree.h +++ b/sflphone-gtk/src/calltree.h @@ -21,8 +21,10 @@ #define __CALLTREE_H__ #include <gtk/gtk.h> + #include <calllist.h> #include <calltab.h> +#include <timestamp.h> /** @file calltree.h diff --git a/sflphone-gtk/src/dbus.c b/sflphone-gtk/src/dbus.c index 690542a84a370f3ff733b1a36abaa9b02fba0f9f..27975ca020b223cf75c5a3b87cd188b57d51e162 100644 --- a/sflphone-gtk/src/dbus.c +++ b/sflphone-gtk/src/dbus.c @@ -105,6 +105,12 @@ call_state_cb (DBusGProxy *proxy, { if ( strcmp(state, "HUNGUP") == 0 ) { + if(c->state==CALL_STATE_CURRENT) + { + // peer hung up, the conversation was established, so _start has been initialized with the current time value + (void) time(&c->_stop); + update_call_tree( history, c ); + } g_print("from dbus: "); stop_notification(); sflphone_hung_up (c); } diff --git a/sflphone-gtk/src/timestamp.c b/sflphone-gtk/src/timestamp.c new file mode 100644 index 0000000000000000000000000000000000000000..f619d82653ae7eedd037a4c5ed6d55c2c411d2d6 --- /dev/null +++ b/sflphone-gtk/src/timestamp.c @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2008 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <timestamp.h> + + gchar* +timestamp_get_call_date( void ) +{ + struct tm* ptr; + time_t lt; + + lt = time(NULL); + ptr = localtime(<); + + return (gchar*) asctime( ptr ) ; +} + + struct tm* +what_time_is_it( void ) +{ + time_t lt = time(NULL); + return localtime(<); +} + + gchar* +process_call_duration( call_t* c ) +{ + gchar * res; + g_print("Start = %i - Stop = %i - Call duration = %i\n", c->_start , c->_stop , (int)(c->_stop - c->_start)); + int duration = c->_stop - c->_start; + + if( duration / 60 == 0 ) + { + if( duration < 10 ) + res = g_markup_printf_escaped("\n00:0%i", duration); + else + res = g_markup_printf_escaped("\n00:%i", duration); + } + else + { + if( duration%60 < 10 ) + res = g_markup_printf_escaped("\n%i:0%i" , duration/60 , duration%60); + else + res = g_markup_printf_escaped("\n%i:%i" , duration/60 , duration%60); + } + return res; +} + + + + + + + + + + + + + + + + + + + + diff --git a/sflphone-gtk/src/timestamp.h b/sflphone-gtk/src/timestamp.h new file mode 100644 index 0000000000000000000000000000000000000000..07cecd7159ec99394906b3b26e195ce8ac13fd7b --- /dev/null +++ b/sflphone-gtk/src/timestamp.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef __TIMESTAMP_H__ +#define __TIMESTAMP_H__ + +/** @file timestamp.h + * @brief Introduces time notion in SFLphone, like call duration, call time, etc... + * Useful for the history + */ + +#include <time.h> +#include <gtk/gtk.h> + +#include <calllist.h> + +gchar* timestamp_get_call_date( void ); + +struct tm* what_time_is_it( void ); + +gchar* process_call_duration( call_t* c ); + +#endif