Commit bffaeae9 authored by smorlat's avatar smorlat
Browse files

implement mute button logic.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@688 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent b572a1fd
......@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "linphone.h"
gboolean linphone_gtk_use_in_call_view(){
static int val=-1;
if (val==-1) val=linphone_gtk_get_ui_config_int("use_incall_view",1);
......@@ -125,6 +126,8 @@ void linphone_gtk_in_call_view_set_in_call(){
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
g_object_unref(G_OBJECT(pbuf));
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_INFO,GTK_ICON_SIZE_DIALOG);
linphone_gtk_enable_mute_button(
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"incall_mute")),TRUE);
}
void linphone_gtk_in_call_view_update_duration(int duration){
......@@ -162,10 +165,30 @@ void linphone_gtk_in_call_view_terminate(const char *error_msg){
gtk_image_set_from_pixbuf(GTK_IMAGE(animation),pbuf);
g_object_unref(G_OBJECT(pbuf));
}
linphone_gtk_enable_mute_button(
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"incall_mute")),FALSE);
g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,NULL);
}
void linphone_gtk_draw_mute_button(GtkToggleButton *button, gboolean active){
if (active){
GtkWidget *image=create_pixmap("mic_muted.png");
gtk_button_set_label(GTK_BUTTON(button),_("Unmute"));
if (image!=NULL) gtk_button_set_image(GTK_BUTTON(button),image);
}else{
GtkWidget *image=create_pixmap("mic_active.png");
gtk_button_set_label(GTK_BUTTON(button),_("Mute"));
if (image!=NULL) gtk_button_set_image(GTK_BUTTON(button),image);
}
}
void linphone_gtk_mute_toggled(GtkToggleButton *button){
linphone_core_mute_mic(linphone_gtk_get_core(),
gtk_toggle_button_get_active(button));
gboolean active=gtk_toggle_button_get_active(button);
linphone_core_mute_mic(linphone_gtk_get_core(),active);
linphone_gtk_draw_mute_button(button,active);
}
void linphone_gtk_enable_mute_button(GtkToggleButton *button, gboolean sensitive){
gtk_widget_set_sensitive(GTK_WIDGET(button),sensitive);
linphone_gtk_draw_mute_button(button,FALSE);
}
......@@ -42,6 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
GdkPixbuf * create_pixbuf(const gchar *filename);
GdkPixbufAnimation *create_pixbuf_animation(const gchar *filename);
void add_pixmap_directory(const gchar *directory);
GtkWidget*create_pixmap(const gchar *filename);
GtkWidget *linphone_gtk_create_window(const char *window_name);
GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name);
LinphoneCore *linphone_gtk_get_core(void);
......@@ -86,4 +87,7 @@ void linphone_gtk_in_call_view_set_calling(const char *uri);
void linphone_gtk_in_call_view_set_in_call(void);
void linphone_gtk_in_call_view_update_duration(int duration);
void linphone_gtk_in_call_view_terminate(const char *error_msg);
void linphone_gtk_enable_mute_button(GtkToggleButton *button, gboolean sensitive);
void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg);
......@@ -521,6 +521,7 @@ void linphone_gtk_call_terminated(const char *error){
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),FALSE);
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"start_call"),TRUE);
gtk_widget_hide_all(linphone_gtk_get_widget(mw,"go_to_call_view_box"));
linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(mw,"main_mute")),FALSE);
if (linphone_gtk_use_in_call_view())
linphone_gtk_in_call_view_terminate(error);
update_video_title();
......@@ -603,6 +604,9 @@ void linphone_gtk_accept_call(GtkWidget *button){
linphone_gtk_in_call_view_set_in_call();
linphone_gtk_show_in_call_view();
}
linphone_gtk_enable_mute_button(
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"main_mute"))
,TRUE);
}
static gboolean linphone_gtk_auto_answer(GtkWidget *incall_window){
......@@ -810,6 +814,9 @@ static void linphone_gtk_general_state(LinphoneCore *lc, LinphoneGeneralState *g
case GSTATE_CALL_IN_CONNECTED:
if (linphone_gtk_use_in_call_view())
linphone_gtk_in_call_view_set_in_call();
linphone_gtk_enable_mute_button(
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"main_mute")),
TRUE);
break;
case GSTATE_CALL_ERROR:
linphone_gtk_call_terminated(gstate->message);
......@@ -1025,6 +1032,10 @@ static void linphone_gtk_init_main_window(){
linphone_gtk_show_friends();
linphone_gtk_connect_digits();
linphone_gtk_check_menu_items();
linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(linphone_gtk_get_main_window(),
"main_mute")),FALSE);
linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(linphone_gtk_get_main_window(),
"incall_mute")),FALSE);
if (linphone_core_in_call(linphone_gtk_get_core())) linphone_gtk_call_started(
linphone_gtk_get_main_window());/*hide the call button, show terminate button*/
}
......
......@@ -514,14 +514,24 @@ Online users</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="main_mute">
<property name="label" translatable="yes">Mute</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="linphone_gtk_mute_toggled"/>
<widget class="GtkHBox" id="hbox7">
<property name="visible">True</property>
<child>
<widget class="GtkToggleButton" id="main_mute">
<property name="label" translatable="yes">Mute</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</widget>
<packing>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
......@@ -1052,22 +1062,6 @@ Fiber Channel</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="incall_mute">
<property name="label" translatable="yes">Mute</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="linphone_gtk_mute_toggled"/>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</widget>
</child>
<child>
......@@ -1086,6 +1080,30 @@ Fiber Channel</property>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox4">
<property name="visible">True</property>
<child>
<widget class="GtkToggleButton" id="incall_mute">
<property name="label" translatable="yes">Mute</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
......@@ -1131,7 +1149,7 @@ Fiber Channel</property>
</widget>
<packing>
<property name="padding">8</property>
<property name="position">3</property>
<property name="position">4</property>
</packing>
</child>
<child>
......@@ -1180,7 +1198,7 @@ Fiber Channel</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
<property name="position">5</property>
</packing>
</child>
</widget>
......
......@@ -622,7 +622,7 @@ static LangCodes supported_langs[]={
{ "sv" , N_("Swedish") },
{ "it" , N_("Italian") },
{ "es" , N_("Spanish") },
{ "pt_BR" , N_("Bresilian") },
{ "pt_BR" , N_("Brazilian Portugese") },
{ "pl" , N_("Polish") },
{ "de" , N_("German") },
{ "ru" , N_("Russian") },
......@@ -630,7 +630,7 @@ static LangCodes supported_langs[]={
{ "nl" , N_("Dutch") },
{ "hu" , N_("Hungarian") },
{ "cs" , N_("Czech") },
{ "zh_CN" , N_("Chineese") },
{ "zh_CN" , N_("Chinese") },
{ NULL , NULL }
};
......
......@@ -34,8 +34,7 @@ find_pixmap_file (const gchar *filename)
/* This is an internally used function to create pixmaps. */
GtkWidget*
create_pixmap (GtkWidget *widget,
const gchar *filename)
create_pixmap (const gchar *filename)
{
gchar *pathname = NULL;
GtkWidget *pixmap;
......
......@@ -10,16 +10,16 @@
<projectname>linphone</projectname>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description></description>
<defaultencoding></defaultencoding>
<description/>
<defaultencoding/>
</general>
<kdevcustomproject>
<run>
<directoryradio>executable</directoryradio>
<mainprogram>gtk-glade/linphone-3</mainprogram>
<programargs></programargs>
<globaldebugarguments></globaldebugarguments>
<globalcwd></globalcwd>
<programargs/>
<globaldebugarguments/>
<globalcwd/>
<useglobalprogram>false</useglobalprogram>
<terminal>false</terminal>
<autocompile>false</autocompile>
......@@ -391,13 +391,13 @@
</blacklist>
<build>
<buildtool>make</buildtool>
<builddir></builddir>
<builddir/>
</build>
<other>
<prio>0</prio>
<otherbin></otherbin>
<defaulttarget></defaulttarget>
<otheroptions></otheroptions>
<otherbin/>
<defaulttarget/>
<otheroptions/>
<selectedenvironment>default</selectedenvironment>
<environments>
<default/>
......@@ -408,9 +408,9 @@
<numberofjobs>0</numberofjobs>
<prio>0</prio>
<dontact>false</dontact>
<makebin></makebin>
<defaulttarget></defaulttarget>
<makeoptions></makeoptions>
<makebin/>
<defaulttarget/>
<makeoptions/>
<selectedenvironment>default</selectedenvironment>
<environments>
<default/>
......@@ -419,11 +419,11 @@
</kdevcustomproject>
<kdevdebugger>
<general>
<dbgshell></dbgshell>
<gdbpath></gdbpath>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
<dbgshell/>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
......@@ -526,7 +526,7 @@
<includePaths>.;</includePaths>
</codecompletion>
<creategettersetter>
<prefixGet></prefixGet>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
......
......@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: linphone-3.2.0-r659\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2009-09-21 21:44+0200\n"
"Last-Translator: Petr Pisar <petr.pisar@atlas.cz>\n"
"Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n"
......@@ -186,8 +186,8 @@ msgid "Spanish"
msgstr "španělština"
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgstr "brazilská portugalština"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
msgid "Polish"
......@@ -218,7 +218,7 @@ msgid "Czech"
msgstr "čeština"
#: ../gtk-glade/propertybox.c:633
msgid "Chineese"
msgid "Chinese"
msgstr ""
#: ../gtk-glade/propertybox.c:690
......@@ -1556,6 +1556,9 @@ msgstr "Parametrický ekvalizér zvuku."
msgid "A webcam grabber based on directshow."
msgstr "Snímač kamer postavený na directshow."
#~ msgid "Bresilian"
#~ msgstr "brazilská portugalština"
#~ msgid "Homepage"
#~ msgstr "Domovská stránka"
......
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: linphone 0.7.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2003-05-23 17:51-0400\n"
"Last-Translator: Jean-Jacques Sarton <jj.sarton@t-online.de>, Ursula Herles-"
"Hartz <UAHartz@t-online.de>\n"
......@@ -178,7 +178,7 @@ msgid "Spanish"
msgstr ""
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
......@@ -210,7 +210,7 @@ msgid "Czech"
msgstr ""
#: ../gtk-glade/propertybox.c:633
msgid "Chineese"
msgid "Chinese"
msgstr ""
#: ../gtk-glade/propertybox.c:690
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Linphone 0.9.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2002-10-15 HO:MI+ZONE\n"
"Last-Translator: Nelson Benitez <gnelson@inMail.sk>\n"
"Language-Team: es <es@li.org>\n"
......@@ -179,7 +179,7 @@ msgid "Spanish"
msgstr ""
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
......@@ -211,7 +211,7 @@ msgid "Czech"
msgstr ""
#: ../gtk-glade/propertybox.c:633
msgid "Chineese"
msgid "Chinese"
msgstr ""
#: ../gtk-glade/propertybox.c:690
......
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Linphone 0.9.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2002-12-06 17:33+0100\n"
"Last-Translator: Simon Morlat <simon.morlat@linphone.org>\n"
"Language-Team: french <fr@li.org>\n"
......@@ -177,7 +177,7 @@ msgid "Spanish"
msgstr ""
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
......@@ -194,7 +194,7 @@ msgstr ""
#: ../gtk-glade/propertybox.c:629
msgid "Japanese"
msgstr ""
msgstr "日本語"
#: ../gtk-glade/propertybox.c:630
msgid "Dutch"
......@@ -209,8 +209,8 @@ msgid "Czech"
msgstr ""
#: ../gtk-glade/propertybox.c:633
msgid "Chineese"
msgstr ""
msgid "Chinese"
msgstr "简体中文"
#: ../gtk-glade/propertybox.c:690
msgid ""
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2007-12-14 11:12+0100\n"
"Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -178,7 +178,7 @@ msgid "Spanish"
msgstr ""
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
......@@ -210,7 +210,7 @@ msgid "Czech"
msgstr ""
#: ../gtk-glade/propertybox.c:633
msgid "Chineese"
msgid "Chinese"
msgstr ""
#: ../gtk-glade/propertybox.c:690
......
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Linphone 3.2.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2002-10-15 HO:MI+ZONE\n"
"Last-Translator: Matteo Piazza <matteo.piazza@trentinonetwork.it>\n"
"Language-Team: it <it@li.org>\n"
......@@ -180,8 +180,8 @@ msgid "Spanish"
msgstr "Spagnolo"
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgstr "Brasiliano"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
msgid "Polish"
......@@ -212,7 +212,7 @@ msgid "Czech"
msgstr "Ceco"
#: ../gtk-glade/propertybox.c:633
msgid "Chineese"
msgid "Chinese"
msgstr ""
#: ../gtk-glade/propertybox.c:690
......@@ -1528,3 +1528,6 @@ msgstr "Equalizzatore di suono."
#: ../mediastreamer2/src/msdscap-mingw.cc:1003
msgid "A webcam grabber based on directshow."
msgstr "Un webcam grabber basato su directshow."
#~ msgid "Bresilian"
#~ msgstr "Brasiliano"
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: linphone 0.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2003-01-21 00:05+9000\n"
"Last-Translator: YAMAGUCHI YOSHIYA <yushiya@anet.ne.jp>\n"
"Language-Team: <ja@li.org>\n"
......@@ -165,7 +165,7 @@ msgstr ""
#: ../gtk-glade/propertybox.c:621
msgid "French"
msgstr ""
msgstr "Français"
#: ../gtk-glade/propertybox.c:622
msgid "Swedish"
......@@ -180,7 +180,7 @@ msgid "Spanish"
msgstr ""
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
......@@ -197,7 +197,7 @@ msgstr ""
#: ../gtk-glade/propertybox.c:629
msgid "Japanese"
msgstr ""
msgstr "日本語"
#: ../gtk-glade/propertybox.c:630
msgid "Dutch"
......@@ -205,15 +205,15 @@ msgstr ""
#: ../gtk-glade/propertybox.c:631
msgid "Hungarian"
msgstr ""
msgstr "Magyar"
#: ../gtk-glade/propertybox.c:632
msgid "Czech"
msgstr ""
msgstr "čeština"
#: ../gtk-glade/propertybox.c:633
msgid "Chineese"
msgstr ""
msgid "Chinese"
msgstr "简体中文"
#: ../gtk-glade/propertybox.c:690
msgid ""
......
......@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: nl\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2007-09-05 10:40+0200\n"
"Last-Translator: Hendrik-Jan Heins <hjheins@gmail.com>\n"
"Language-Team: Nederlands <vertaling@nl.linux.org>\n"
......@@ -181,7 +181,7 @@ msgid "Spanish"
msgstr ""
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
......@@ -213,7 +213,7 @@ msgid "Czech"
msgstr ""
#: ../gtk-glade/propertybox.c:633
msgid "Chineese"
msgid "Chinese"
msgstr ""
#: ../gtk-glade/propertybox.c:690
......
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: linphone 0.7.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2003-08-22 12:50+0200\n"
"Last-Translator: Robert Nasiadek <darkone@darkone.pl>\n"
"Language-Team: Polski <pl@li.org>\n"
......@@ -178,7 +178,7 @@ msgid "Spanish"
msgstr ""
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
......@@ -210,7 +210,7 @@ msgid "Czech"
msgstr ""
#: ../gtk-glade/propertybox.c:633
msgid "Chineese"
msgid "Chinese"
msgstr ""
#: ../gtk-glade/propertybox.c:690
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: linphone-1.1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-28 15:30+0200\n"
"POT-Creation-Date: 2009-09-29 11:24+0200\n"
"PO-Revision-Date: 2006-07-11 23:30+0200\n"
"Last-Translator: Rafael Caesar Lenzi <rc_lenzi@yahoo.com.br>\n"
"Language-Team: pt_BR <pt_BR@li.org>\n"
......@@ -180,7 +180,7 @@ msgid "Spanish"
msgstr ""
#: ../gtk-glade/propertybox.c:625
msgid "Bresilian"
msgid "Brasilian Portugese"
msgstr ""
#: ../gtk-glade/propertybox.c:626
......@@ -212,7 +212,7 @@ msgid "Czech"
msgstr ""