fix italian translation again

improve display of caller/callee in incall frame.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@653 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
smorlat 2009-09-14 08:30:51 +00:00
parent 118fb7b757
commit a06b35acf6
3 changed files with 70 additions and 30 deletions

View file

@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
#include "linphonecore.h"
#include <ctype.h>
static void sip_login_init_instance(SipSetupContext *ctx){
LinphoneProxyConfig *cfg=sip_setup_context_get_proxy_config(ctx);
@ -30,14 +30,47 @@ static void sip_login_init_instance(SipSetupContext *ctx){
linphone_proxy_config_enable_register(cfg,FALSE);
}
static void guess_display_name(osip_from_t *from){
char *dn=(char*)osip_malloc(strlen(from->url->username)+3);
char *it=from->url->username;
char *wptr=dn;
bool_t begin=TRUE;
bool_t surname=0;
for(it=from->url->username;*it!='\0';++it){
if (begin)
*wptr=toupper(*it);
else if (*it=='.'){
if (surname) break;
*wptr=' ';
begin=TRUE;
surname=TRUE;
}else *wptr=*it;
wptr++;
}
if (from->displayname!=NULL) osip_free(from->displayname);
from->displayname=dn;
}
static int sip_login_do_login(SipSetupContext * ctx, const char *uri, const char *passwd){
LinphoneProxyConfig *cfg=sip_setup_context_get_proxy_config(ctx);
LinphoneCore *lc=linphone_proxy_config_get_core(cfg);
LinphoneAuthInfo *auth=linphone_auth_info_new(ctx->username,NULL,passwd,NULL,NULL);
linphone_proxy_config_set_identity(cfg,uri);
LinphoneAuthInfo *auth;
osip_from_t *parsed_uri;
char *tmp;
osip_from_init(&parsed_uri);
osip_from_parse(parsed_uri,uri);
if (parsed_uri->displayname==NULL || strlen(parsed_uri->displayname)==0){
guess_display_name(parsed_uri);
}
osip_from_to_str(parsed_uri,&tmp);
linphone_proxy_config_set_identity(cfg,tmp);
auth=linphone_auth_info_new(parsed_uri->url->username,NULL,passwd,NULL,NULL);
linphone_core_add_auth_info(lc,auth);
linphone_proxy_config_enable_register(cfg,TRUE);
linphone_proxy_config_done(cfg);
osip_free(tmp);
osip_from_free(parsed_uri);
ms_message("SipLogin: done");
return 0;
}

View file

@ -28,6 +28,34 @@ void linphone_gtk_show_idle_view(void){
gtk_widget_hide(in_call_frame);
}
void display_peer_name_in_label(GtkWidget *label, const char *uri){
osip_from_t *from;
char *displayname=NULL,*id=NULL;
char *uri_label;
osip_from_init(&from);
if (osip_from_parse(from,uri)==0){
if (from->displayname!=NULL && strlen(from->displayname)>0)
displayname=osip_strdup(from->displayname);
if (from->displayname!=NULL){
osip_free(from->displayname);
from->displayname=NULL;
}
osip_from_to_str(from,&id);
}else id=osip_strdup(uri);
osip_from_free(from);
if (displayname!=NULL)
uri_label=g_markup_printf_escaped("<span size=\"large\">%s</span>\n<i>%s</i>",
displayname,id);
else
uri_label=g_markup_printf_escaped("<span size=\"large\"><i>%s</i></span>\n",id);
gtk_label_set_markup(GTK_LABEL(label),uri_label);
if (displayname!=NULL) osip_free(displayname);
osip_free(id);
g_free(uri_label);
}
void linphone_gtk_in_call_view_set_calling(const char *uri){
GtkWidget *main_window=linphone_gtk_get_main_window();
GtkWidget *status=linphone_gtk_get_widget(main_window,"in_call_status");
@ -36,13 +64,11 @@ void linphone_gtk_in_call_view_set_calling(const char *uri){
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
GdkPixbufAnimation *pbuf=create_pixbuf_animation("calling_anim.gif");
GtkWidget *terminate_button=linphone_gtk_get_widget(main_window,"in_call_terminate");
char *uri_label;
gtk_widget_set_sensitive(terminate_button,TRUE);
gtk_label_set_markup(GTK_LABEL(status),_("<b>Calling...</b>"));
uri_label=g_markup_printf_escaped("<span size=\"large\"><i>%s</i></span>", uri);
gtk_label_set_markup(GTK_LABEL(callee),uri_label);
g_free(uri_label);
display_peer_name_in_label(callee,uri);
gtk_label_set_text(GTK_LABEL(duration),"00:00:00");
if (pbuf!=NULL){
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
@ -56,35 +82,16 @@ void linphone_gtk_in_call_view_set_in_call(){
GtkWidget *status=linphone_gtk_get_widget(main_window,"in_call_status");
GtkWidget *callee=linphone_gtk_get_widget(main_window,"in_call_uri");
GtkWidget *duration=linphone_gtk_get_widget(main_window,"in_call_duration");
char *uri_label;
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
GtkWidget *terminate_button=linphone_gtk_get_widget(main_window,"in_call_terminate");
const char *uri=linphone_core_get_remote_uri(lc);
osip_from_t *from;
char *displayname=NULL,*id=NULL;
display_peer_name_in_label(callee,uri);
gtk_widget_set_sensitive(terminate_button,TRUE);
gtk_label_set_markup(GTK_LABEL(status),_("<b>In call with</b>"));
osip_from_init(&from);
osip_from_parse(from,uri);
if (from->displayname!=NULL && strlen(from->displayname)>0)
displayname=osip_strdup(from->displayname);
if (from->displayname!=NULL){
osip_free(from->displayname);
from->displayname=NULL;
}
osip_from_to_str(from,&id);
osip_from_free(from);
if (displayname!=NULL)
uri_label=g_markup_printf_escaped("<span size=\"large\">%s</span>\n<i>%s</i>",
displayname,id);
else
uri_label=g_markup_printf_escaped("<span size=\"large\"<i>%s</i></span>\n",id);
gtk_label_set_markup(GTK_LABEL(callee),uri_label);
g_free(uri_label);
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
if (pbuf!=NULL){
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);

View file

@ -625,7 +625,7 @@ msgstr "Prego inserire la password di dominio"
#: ../gtk-glade/call_logs.glade.h:1
msgid "Call history"
msgstr "Storico chiamate"
msgstr "Cronologia"
#: ../gtk-glade/sip_account.glade.h:1
msgid "Configure a SIP account"
@ -1044,7 +1044,7 @@ msgstr "Connessione"
#: ../coreapi/linphonecore.c:1793
msgid "Call ended"
msgstr "Chimata terminata"
msgstr "Chiamata terminata"
#: ../coreapi/linphonecore.c:2155
msgid "No nat/firewall address supplied !"