Commit 633d5bb5 authored by Emmanuel Milou's avatar Emmanuel Milou

[#1663] Voicemail icon reflects voice messages

parent 48de8f50
<?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#"
......@@ -13,9 +14,8 @@
height="24"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.46"
inkscape:version="0.47pre4 r22446"
version="1.0"
sodipodi:docbase="/home/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps"
sodipodi:docname="incoming.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
sodipodi:modified="true">
......@@ -143,7 +143,7 @@
x2="-3.8121746"
y2="9.3760633"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-0.8262245,0,0,1.1530286,21.450158,0.7307096)" />
gradientTransform="matrix(-1.1171976,0,0,1.3356755,20.340918,-0.49566383)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2772"
......@@ -171,10 +171,11 @@
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="1920"
inkscape:window-height="1123"
inkscape:window-height="1125"
inkscape:window-x="0"
inkscape:window-y="25"
showgrid="false">
showgrid="false"
inkscape:window-maximized="1">
<sodipodi:guide
orientation="vertical"
position="16.970563,9.4575536"
......@@ -196,57 +197,8 @@
inkscape:groupmode="layer"
id="layer1">
<path
style="opacity:1;fill:url(#linearGradient2511);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 24.599869,5.8821885 L 14.31552,5.8821885 L 14.31552,1.2188523 L 6.5292625,11.541578 L 14.31552,21.864303 L 14.31552,17.200965 L 24.599869,17.200965 L 24.599869,5.8821885 z"
style="fill:url(#linearGradient2511);fill-opacity:1;stroke:none"
d="m 24.599869,5.4718417 -13.906209,0 0,-5.40203797 L 0.16530119,12.027714 10.69366,23.985623 l 0,-5.40204 13.906209,0 0,-13.1117413 z"
id="rect4262" />
<g
id="g2364"
inkscape:label="Calque 1"
transform="matrix(0.7988192,0.4342103,-0.432441,0.795564,14.187414,0.5419157)">
<g
transform="translate(7.9455775,4.2707653)"
inkscape:label="Calque 1"
id="g2446">
<g
id="g2181"
transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)"
style="fill:none;stroke:#000000;stroke-opacity:0.44968555">
<path
style="opacity:1;fill:none;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"
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"
id="path2183"
sodipodi:nodetypes="csccczccsccccc" />
</g>
<g
id="g2451"
transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)">
<path
sodipodi:nodetypes="cccsccsccsccc"
id="path2453"
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(#linearGradient2483);fill-opacity:1;stroke:#0f5600;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccsccc"
id="path2455"
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(#linearGradient2485);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccsccc"
id="path2457"
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(#linearGradient2487);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccsccc"
id="path2459"
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"
style="opacity:1;fill:url(#linearGradient2489);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccsccc"
id="path2461"
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(#linearGradient2491);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</g>
</g>
</svg>
<?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#"
......@@ -13,10 +14,9 @@
height="24"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.46"
inkscape:version="0.47pre4 r22446"
version="1.0"
sodipodi:docbase="/home/plbeaudoin/SFLPhone/sflphone/sflphone-gtk/pixmaps"
sodipodi:docname="outgoing.svg"
sodipodi:docname="incoming.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
sodipodi:modified="true">
<defs
......@@ -72,27 +72,27 @@
inkscape:collect="always" />
<linearGradient
inkscape:collect="always"
id="linearGradient3003">
id="linearGradient2772">
<stop
style="stop-color:#008000;stop-opacity:1;"
offset="0"
id="stop3005" />
id="stop2774" />
<stop
style="stop-color:#008000;stop-opacity:0;"
offset="1"
id="stop3007" />
id="stop2776" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient2607">
id="linearGradient2505">
<stop
style="stop-color:#008000;stop-opacity:1;"
offset="0"
id="stop2609" />
id="stop2507" />
<stop
style="stop-color:#008000;stop-opacity:0;"
offset="1"
id="stop2611" />
id="stop2509" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
......@@ -136,22 +136,22 @@
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2607"
id="linearGradient2613"
x1="8.7504473"
y1="9.6810875"
x2="26.544411"
y2="9.906394"
xlink:href="#linearGradient2505"
id="linearGradient2511"
x1="17.620802"
y1="9.4159222"
x2="-3.8121746"
y2="9.3760633"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.8560405,0,0,1.1184736,0.9045039,6.3789889e-2)" />
gradientTransform="matrix(1.1171849,-0.00531668,-0.0063564,-1.3356604,3.7768335,24.412045)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3003"
id="linearGradient3009"
x1="29.820433"
y1="2.1517653"
x2="-5.1534119"
y2="5.9291029"
xlink:href="#linearGradient2772"
id="linearGradient2778"
x1="26.420586"
y1="3.4565225"
x2="20.291727"
y2="-5.2758617"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
......@@ -163,21 +163,22 @@
inkscape:pageshadow="2"
inkscape:zoom="11.313708"
inkscape:cx="18.87396"
inkscape:cy="2.756874"
inkscape:cy="2.5800973"
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-width="1920"
inkscape:window-height="1125"
inkscape:window-x="0"
inkscape:window-y="25"
showgrid="false">
showgrid="false"
inkscape:window-maximized="1">
<sodipodi:guide
orientation="vertical"
position="15.982143"
position="16.970563,9.4575536"
id="guide3146" />
</sodipodi:namedview>
<metadata
......@@ -188,6 +189,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
......@@ -196,57 +198,8 @@
inkscape:groupmode="layer"
id="layer1">
<path
style="opacity:1;fill:url(#linearGradient2613);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 8.3854173,5.6540458 L 17.06005,5.6540458 L 17.06005,1.1304639 L 23.627595,11.14383 L 17.06005,21.157198 L 17.06005,16.633614 L 8.3854173,16.633614 L 8.3854173,5.6540458 z"
style="fill:url(#linearGradient2511);fill-opacity:1;stroke:none"
d="m -0.51046827,18.464875 13.90605127,-0.06618 0.02571,5.401977 10.471333,-12.007879 -10.585147,-11.90766905 0.02571,5.40197885 -13.90605127,0.066179 0.062398,13.1115924 z"
id="rect4262" />
<g
id="g2364"
inkscape:label="Calque 1"
transform="matrix(0.8084692,0.4159668,-0.4142718,0.8051747,13.838027,0.5188541)">
<g
transform="translate(7.9455775,4.2707653)"
inkscape:label="Calque 1"
id="g2446">
<g
id="g2181"
transform="matrix(-0.4376782,-0.758081,0.7581751,-0.4377326,3.5952686,30.820492)"
style="fill:none;stroke:#000000;stroke-opacity:0.44968555">
<path
style="opacity:1;fill:none;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"
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"
id="path2183"
sodipodi:nodetypes="csccczccsccccc" />
</g>
<g
id="g2451"
transform="matrix(-0.4400595,-0.7622054,0.7622054,-0.4400595,-10.917299,27.830684)">
<path
sodipodi:nodetypes="cccsccsccsccc"
id="path2453"
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(#linearGradient2483);fill-opacity:1;stroke:#0f5600;stroke-width:0.625;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccsccc"
id="path2455"
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(#linearGradient2485);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccsccc"
id="path2457"
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(#linearGradient2487);fill-opacity:1;stroke:#0f5600;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccsccc"
id="path2459"
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"
style="opacity:1;fill:url(#linearGradient2489);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccsccc"
id="path2461"
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(#linearGradient2491);fill-opacity:1;stroke:none;stroke-width:0.57204324;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
</g>
</g>
</svg>
......@@ -328,7 +328,7 @@ guint account_list_get_position (account_t *account)
return -1;
}
gboolean account_list_current_account_has_mailbox (void)
gboolean current_account_has_mailbox (void)
{
account_t *current;
......@@ -345,3 +345,38 @@ gboolean account_list_current_account_has_mailbox (void)
return FALSE;
}
void current_account_set_message_number (guint nb)
{
account_t *current;
current = account_list_get_current ();
if (current)
{
current->_messages_number = nb;
}
}
guint current_account_get_message_number (void)
{
account_t *current;
current = account_list_get_current ();
if (current)
{
return current->_messages_number;
}
else
return 0;
}
gboolean current_account_has_new_message (void)
{
account_t *current;
current = account_list_get_current ();
if (current)
{
return (current->_messages_number > 0);
}
return FALSE;
}
......@@ -70,6 +70,9 @@ typedef struct {
guint protocol_state_code;
GHashTable * properties;
GPtrArray * credential_information;
guint _messages_number;
} account_t;
......@@ -192,4 +195,10 @@ guint account_list_get_position (account_t *account);
gboolean account_list_current_account_has_mailbox (void);
guint current_account_get_message_number (void);
void current_account_set_message_number (guint nb);
gboolean current_account_has_new_message (void);
#endif
......@@ -31,37 +31,31 @@
#include <sys/types.h>
#include <unistd.h>
guint voice_mails;
GHashTable * ip2ip_profile=NULL;
void
sflphone_notify_voice_mail ( const gchar* accountID , guint count )
sflphone_notify_voice_mail (const gchar* accountID , guint count)
{
gchar *id;
gchar *current;
gchar *current_id;
account_t *current;
// We want to notify only for the default current account; ie the first in the list
id = g_strdup( accountID );
current = account_list_get_current_id();
if( strcmp( id, current ) != 0 )
// We want to notify only the current account; ie the first in the list
id = g_strdup (accountID);
current_id = account_list_get_current_id ();
if (g_strcasecmp (id, current_id) != 0 || account_list_get_size() == 0)
return;
voice_mails = count ;
// Set the number of voice messages for the current account
current_account_set_message_number (count);
current = account_list_get_current ();
if(count > 0)
{
gchar * message = g_strdup_printf(n_("%d voice mail", "%d voice mails", count), count);
statusbar_push_message(message, __MSG_VOICE_MAILS);
g_free(message);
}
// Update the voicemail tool button
update_voicemail_status ();
// TODO: add ifdef
if( account_list_get_size() > 0 )
{
account_t* acc = account_list_get_by_id( id );
if( acc != NULL )
notify_voice_mails( count , acc );
}
if (current)
notify_voice_mails (count, current);
}
void
......@@ -157,6 +151,9 @@ sflphone_fill_account_list(gboolean toolbarInitialized)
gchar** array;
gchar** accountID;
unsigned int i;
int count;
count = current_account_get_message_number ();
account_list_clear ( );
......@@ -251,6 +248,9 @@ sflphone_fill_account_list(gboolean toolbarInitialized)
a->protocol_state_description = g_hash_table_lookup(details, REGISTRATION_STATE_DESCRIPTION);
}
// Reset the current account message number
current_account_set_message_number (count);
// Prevent update being called when toolbar is not yet initialized
if(toolbarInitialized)
update_actions ();
......@@ -635,7 +635,7 @@ sflphone_new_call()
// Play a tone when creating a new call
if( calllist_get_size(current_calls) == 0 )
dbus_start_tone( TRUE , ( voice_mails > 0 )? TONE_WITH_MESSAGE : TONE_WITHOUT_MESSAGE) ;
dbus_start_tone( TRUE , (current_account_has_new_message () > 0)? TONE_WITH_MESSAGE : TONE_WITHOUT_MESSAGE) ;
peer_number = g_strdup("");
peer_name = g_strdup ("");
......
......@@ -52,8 +52,6 @@ GtkWidget * status;
static int history_limit;
static gboolean history_enabled = TRUE;
// Mail notification
GtkWidget * widg;
GHashTable * directIpCallsProperties = NULL;
......@@ -87,20 +85,6 @@ set_popup_mode( void )
set_notif_level( )
{
dbus_set_notify();
if (dbus_get_notify())
gtk_widget_set_sensitive(widg, TRUE);
else {
gtk_widget_set_sensitive(widg, FALSE);
if (dbus_get_mail_notify())
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(widg), FALSE);
}
}
void
set_mail_notif( )
{
dbus_set_mail_notify( );
}
static void history_limit_cb (GtkSpinButton *button, void *ptr)
......@@ -326,18 +310,6 @@ create_general_settings ()
g_signal_connect(G_OBJECT( notifAll ) , "clicked" , G_CALLBACK( set_notif_level ) , NULL );
gtk_table_attach( GTK_TABLE(table), notifAll, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5);
// Notification
widg = gtk_check_button_new_with_mnemonic( _("Enable voicemail _notifications"));
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(widg), dbus_get_mail_notify() );
g_signal_connect(G_OBJECT( widg ) , "clicked" , G_CALLBACK( set_mail_notif ) , NULL);
gtk_table_attach( GTK_TABLE(table), widg, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5);
if (dbus_get_notify())
gtk_widget_set_sensitive(widg, TRUE);
else
gtk_widget_set_sensitive(widg, FALSE);
// System Tray option frame
gnome_main_section_new_with_table (_("System Tray Icon"), &frame, &table, 3, 1);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
......
......@@ -2022,38 +2022,6 @@ dbus_get_notify( void )
}
}
void
dbus_set_mail_notify( void )
{
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_mail_notify(
configurationManagerProxy,
&error);
if(error)
{
g_error_free(error);
}
}
guint
dbus_get_mail_notify( void )
{
gint level;
GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_mail_notify(
configurationManagerProxy,
&level,
&error);
if(error)
{
ERROR("Error calling dbus_get_mail_notif_level");
g_error_free(error);
}
return (guint)level;
}
void
dbus_set_audio_manager( int api )
{
......
......@@ -464,18 +464,6 @@ guint dbus_get_notify( void );
*/
void dbus_set_notify( void );
/**
* ConfigurationManager - Configure the mail notification level
* @return int 0 disable
* 1 enable
*/
guint dbus_get_mail_notify( void );
/**
* ConfigurationManager - Configure the mail notification level
*/
void dbus_set_mail_notify( void );
/**
* ConfigurationManager - Start a tone when a new call is open and no numbers have been dialed
* @param start 1 to start
......
......@@ -223,40 +223,27 @@ void update_actions()
}
}
else if(selectedConf)
{
/*
switch(selectedConf->_state)
{
case CONFERENCE_STATE_ACTIVE_ATACHED:
gtk_action_set_sensitive( GTK_ACTION(recordAction), FALSE);
break;
case CONFERENCE_STATE_ACTIVE_DETACHED:
gtk_action_set_sensitive( GTK_ACTION(recordAction), FALSE);
break;
case CONFERENCE_STATE_RECORD:
gtk_action_set_sensitive( GTK_ACTION(recordAction), FALSE);
break;
case CONFERENCE_STATE_HOLD:
gtk_action_set_sensitive( GTK_ACTION(recordAction), FALSE);
break;
default:
break;
}
*/
}
else
{
if( account_list_get_size() > 0 )
if( account_list_get_size() > 0 && current_account_has_mailbox ())
{
//gtk_widget_set_sensitive (GTK_WIDGET(callButton), TRUE);
if (account_list_current_account_has_mailbox ())
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (voicemailToolbar), -2);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (voicemailToolbar), -2);
update_voicemail_status ();
}
}
}
void update_voicemail_status (void)
{
gchar *messages = "";
messages = g_markup_printf_escaped (_("Voicemail (%i)"), current_account_get_message_number ());
(current_account_has_new_message ()) ?
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (voicemailToolbar), "mail-message-new"):
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (voicemailToolbar), "mail-read");
gtk_tool_button_set_label (GTK_TOOL_BUTTON (voicemailToolbar), messages);
g_free (messages);
}
static void volume_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data)
{
gboolean toggled = gtk_toggle_action_get_active (togglemenuitem);
......@@ -615,29 +602,6 @@ static void clear_history (void)
}
}
/*
static void calltree_switch_cb (GtkRadioAction *action, GtkRadioAction *current)
{
gint value = gtk_radio_action_get_current_value (current);
switch (value)
{
case CALLTREE_CALLS:
calltree_display (current_calls);
break;
case CALLTREE_HISTORY:
calltree_display (history);
break;
case CALLTREE_CONTACTS:
calltree_display (contacts);
break;
default:
calltree_display (current_calls);
break;