Commit 4d09f9af authored by Simon Morlat's avatar Simon Morlat

merge patch from myjoice

- sv translation
- advanced ui toggle button
- ui appearance changes.
parent b88fb9a0
......@@ -193,7 +193,7 @@ static int lookup_buddy(SipSetupContext *ctx, BLReq *req){
LpConfig *config=linphone_core_get_config(lc);
const char *identity=linphone_proxy_config_get_identity(cfg);
const char *url=lp_config_get_string(config,"BuddyLookup","url",NULL);
LinphoneAuthInfo *aa;
const LinphoneAuthInfo *aa;
SoupMessage *sm;
LinphoneAddress *from;
......
......@@ -70,6 +70,7 @@ void linphone_gtk_buddy_info_updated(LinphoneCore *lc, LinphoneFriend *lf);
const gchar *linphone_gtk_get_ui_config(const char *key, const char *def);
int linphone_gtk_get_ui_config_int(const char *key, int def);
void linphone_gtk_set_ui_config_int(const char *key , int val);
void linphone_gtk_visibility_set(const char *hiddens, const char *window_name, GtkWidget *w, gboolean show);
void linphone_gtk_open_browser(const char *url);
void linphone_gtk_check_for_new_version(void);
......
......@@ -224,46 +224,6 @@ GtkWidget *linphone_gtk_get_main_window(){
return the_ui;
}
static void parse_item(const char *item, const char *window_name, GtkWidget *w, gboolean show){
char tmp[64];
char *dot;
strcpy(tmp,item);
dot=strchr(tmp,'.');
if (dot){
*dot='\0';
dot++;
if (strcmp(window_name,tmp)==0){
GtkWidget *wd=linphone_gtk_get_widget(w,dot);
if (wd) {
if (!show) gtk_widget_hide(wd);
else gtk_widget_show(wd);
}
}
}
}
static void parse_widgets(const char *hiddens, const char *window_name, GtkWidget *w, gboolean show){
char item[64];
const char *i;
const char *b;
int len;
for(b=i=hiddens;*i!='\0';++i){
if (*i==' '){
len=MIN(i-b,sizeof(item)-1);
strncpy(item,b,len);
item[len]='\0';
b=i+1;
parse_item(item,window_name,w,show);
}
}
len=MIN(i-b,sizeof(item)-1);
if (len>0){
strncpy(item,b,len);
item[len]='\0';
parse_item(item,window_name,w,show);
}
}
static void linphone_gtk_configure_window(GtkWidget *w, const char *window_name){
static const char *icon_path=NULL;
static const char *hiddens=NULL;
......@@ -277,9 +237,9 @@ static void linphone_gtk_configure_window(GtkWidget *w, const char *window_name)
config_loaded=TRUE;
}
if (hiddens)
parse_widgets(hiddens,window_name,w,FALSE);
linphone_gtk_visibility_set(hiddens,window_name,w,FALSE);
if (shown)
parse_widgets(shown,window_name,w,TRUE);
linphone_gtk_visibility_set(shown,window_name,w,TRUE);
if (icon_path) {
GdkPixbuf *pbuf=create_pixbuf(icon_path);
gtk_window_set_icon(GTK_WINDOW(w),pbuf);
......@@ -1075,6 +1035,7 @@ static void linphone_gtk_configure_main_window(){
static const char *home;
static const char *start_call_icon;
static const char *stop_call_icon;
static const char *search_icon;
static gboolean update_check_menu;
GtkWidget *w=linphone_gtk_get_main_window();
if (!config_loaded){
......@@ -1082,6 +1043,7 @@ static void linphone_gtk_configure_main_window(){
home=linphone_gtk_get_ui_config("home","http://www.linphone.org");
start_call_icon=linphone_gtk_get_ui_config("start_call_icon","green.png");
stop_call_icon=linphone_gtk_get_ui_config("stop_call_icon","red.png");
search_icon=linphone_gtk_get_ui_config("directory_search_icon",NULL);
update_check_menu=linphone_gtk_get_ui_config_int("update_check_menu",0);
config_loaded=TRUE;
}
......@@ -1103,6 +1065,11 @@ static void linphone_gtk_configure_main_window(){
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"in_call_terminate_icon")),pbuf);
g_object_unref(G_OBJECT(pbuf));
}
if (search_icon){
GdkPixbuf *pbuf=create_pixbuf(search_icon);
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"directory_search_button_icon")),pbuf);
g_object_unref(G_OBJECT(pbuf));
}
if (home){
gchar *tmp;
GtkWidget *menu_item=linphone_gtk_get_widget(w,"home_item");
......
......@@ -50,7 +50,7 @@
</child>
<child>
<widget class="GtkImageMenuItem" id="menuitem1">
<property name="label">Call history</property>
<property name="label" translatable="yes">Call history</property>
<property name="visible">True</property>
<property name="use_stock">False</property>
<signal name="activate" handler="linphone_gtk_show_call_logs"/>
......@@ -153,7 +153,7 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkImageMenuItem" id="show_logs">
<property name="label">Show debug messages</property>
<property name="label" translatable="yes">Show debug messages</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="use_stock">False</property>
......@@ -178,7 +178,7 @@
</child>
<child>
<widget class="GtkImageMenuItem" id="home_item">
<property name="label">Homepage</property>
<property name="label" translatable="yes">Homepage</property>
<property name="visible">True</property>
<property name="use_stock">False</property>
<signal name="activate" handler="linphone_gtk_link_to_website"/>
......@@ -234,7 +234,7 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="has_tooltip">True</property>
<property name="tooltip" translatable="yes">Start call</property>
<property name="relief">half</property>
<property name="relief">none</property>
<signal name="clicked" handler="linphone_gtk_start_call"/>
<child>
<widget class="GtkHBox" id="hbox4">
......@@ -275,6 +275,8 @@
<widget class="GtkAlignment" id="alignment4">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">5</property>
<property name="right_padding">5</property>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
......@@ -320,7 +322,7 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="has_tooltip">True</property>
<property name="tooltip" translatable="yes">Terminate call</property>
<property name="relief">half</property>
<property name="relief">none</property>
<signal name="clicked" handler="linphone_gtk_terminate_call"/>
<child>
<widget class="GtkHBox" id="hbox21">
......@@ -380,6 +382,7 @@
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="left_padding">12</property>
<property name="right_padding">12</property>
<child>
<widget class="GtkVBox" id="vbox7">
<property name="visible">True</property>
......@@ -467,42 +470,80 @@ Online users</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="directory_search_box">
<widget class="GtkFrame" id="directory_search_box">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<widget class="GtkEntry" id="directory_search_entry">
<widget class="GtkHBox" id="directory_search_vbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="secondary_icon_stock">gtk-find</property>
<property name="secondary_icon_activatable">True</property>
<property name="secondary_icon_sensitive">True</property>
<signal name="focus_in_event" handler="linphone_gtk_directory_search_focus_in"/>
<signal name="activate" handler="linphone_gtk_directory_search_activate"/>
<signal name="icon_press" handler="linphone_gtk_directory_search_activate"/>
<signal name="focus_out_event" handler="linphone_gtk_directory_search_focus_out"/>
<child>
<widget class="GtkEntry" id="directory_search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<signal name="focus_in_event" handler="linphone_gtk_directory_search_focus_in"/>
<signal name="activate" handler="linphone_gtk_directory_search_activate"/>
<signal name="icon_press" handler="linphone_gtk_directory_search_activate"/>
<signal name="focus_out_event" handler="linphone_gtk_directory_search_focus_out"/>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="directory_search_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<signal name="clicked" handler="linphone_gtk_directory_search_button_clicked"/>
<child>
<widget class="GtkHBox" id="hbox12">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="directory_search_button_icon">
<property name="visible">True</property>
<property name="stock">gtk-find</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="directory_search_button_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Search</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="directory_search_button">
<property name="label" translatable="yes">gtk-find</property>
<widget class="GtkLabel" id="label14">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="linphone_gtk_directory_search_button_clicked"/>
<property name="label" translatable="yes">&lt;b&gt;Add contacts from directory&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">2</property>
</packing>
</child>
......@@ -977,7 +1018,6 @@ Fiber Channel</property>
<widget class="GtkImage" id="image7">
<property name="visible">True</property>
<property name="stock">gtk-go-forward</property>
<property name="icon-size">4</property>
</widget>
<packing>
<property name="position">0</property>
......@@ -1020,6 +1060,7 @@ Fiber Channel</property>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="left_padding">12</property>
<property name="right_padding">12</property>
<child>
<widget class="GtkVBox" id="vbox3">
<property name="visible">True</property>
......@@ -1256,6 +1297,7 @@ Fiber Channel</property>
<widget class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="left_padding">12</property>
<property name="right_padding">12</property>
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
......@@ -1369,7 +1411,7 @@ Fiber Channel</property>
<property name="visible">True</property>
<child>
<widget class="GtkButton" id="login_connect">
<property name="label" translatable="yes">gtk-connect</property>
<property name="label">gtk-connect</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
......
......@@ -108,6 +108,7 @@
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
......@@ -219,6 +220,7 @@
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
......@@ -373,6 +375,7 @@
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
......@@ -1546,7 +1549,40 @@ Video codecs</property>
</packing>
</child>
<child>
<placeholder/>
<widget class="GtkFrame" id="ui_level_frame">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<child>
<widget class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<widget class="GtkCheckButton" id="ui_level">
<property name="label" translatable="yes">Show advanced settings</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_ui_level_toggled"/>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Level&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
......
......@@ -700,6 +700,28 @@ void linphone_gtk_lang_changed(GtkComboBox *combo){
}
}
static void linphone_gtk_ui_level_adapt(GtkWidget *top) {
gboolean ui_advanced;
const char *simple_ui = linphone_gtk_get_ui_config("simple_ui", "parameters.codec_tab parameters.transport_frame parameters.ports_frame");
ui_advanced = linphone_gtk_get_ui_config_int("advanced_ui", TRUE);
if (ui_advanced) {
linphone_gtk_visibility_set(simple_ui, "parameters", top, TRUE);
} else {
linphone_gtk_visibility_set(simple_ui, "parameters", top, FALSE);
}
}
void linphone_gtk_ui_level_toggled(GtkWidget *w) {
gint ui_advanced;
GtkWidget *top;
top = gtk_widget_get_toplevel(w);
ui_advanced = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
linphone_gtk_set_ui_config_int("advanced_ui", ui_advanced);
linphone_gtk_ui_level_adapt(top);
}
void linphone_gtk_show_parameters(void){
GtkWidget *pb=linphone_gtk_create_window("parameters");
LinphoneCore *lc=linphone_gtk_get_core();
......@@ -709,6 +731,8 @@ void linphone_gtk_show_parameters(void){
LinphoneFirewallPolicy pol;
GtkWidget *codec_list=linphone_gtk_get_widget(pb,"codec_list");
int mtu;
int ui_advanced;
/* NETWORK CONFIG */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"ipv6_enabled")),
linphone_core_ipv6_enabled(lc));
......@@ -779,6 +803,13 @@ void linphone_gtk_show_parameters(void){
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"upload_bw")),
linphone_core_get_upload_bandwidth(lc));
/* UI CONFIG */
linphone_gtk_fill_langs(pb);
ui_advanced = linphone_gtk_get_ui_config_int("advanced_ui", 1);
linphone_gtk_set_ui_config_int("advanced_ui", ui_advanced);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"ui_level")),
ui_advanced);
linphone_gtk_ui_level_adapt(pb);
gtk_widget_show(pb);
}
......@@ -193,3 +193,43 @@ void linphone_gtk_set_ui_config_int(const char *key , int val){
}
static void parse_item(const char *item, const char *window_name, GtkWidget *w, gboolean show){
char tmp[64];
char *dot;
strcpy(tmp,item);
dot=strchr(tmp,'.');
if (dot){
*dot='\0';
dot++;
if (strcmp(window_name,tmp)==0){
GtkWidget *wd=linphone_gtk_get_widget(w,dot);
if (wd) {
if (!show) gtk_widget_hide(wd);
else gtk_widget_show(wd);
}
}
}
}
void linphone_gtk_visibility_set(const char *hiddens, const char *window_name, GtkWidget *w, gboolean show){
char item[64];
const char *i;
const char *b;
int len;
for(b=i=hiddens;*i!='\0';++i){
if (*i==' '){
len=MIN(i-b,sizeof(item)-1);
strncpy(item,b,len);
item[len]='\0';
b=i+1;
parse_item(item,window_name,w,show);
}
}
len=MIN(i-b,sizeof(item)-1);
if (len>0){
strncpy(item,b,len);
item[len]='\0';
parse_item(item,window_name,w,show);
}
}
......@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: linphone-3.2.0-r659\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-03-02 10:42+0100\n"
"POT-Creation-Date: 2010-03-10 14:21+0100\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"
......@@ -52,17 +52,17 @@ msgid ""
"\\Program Files\\Linphone)"
msgstr ""
#: ../gtk-glade/main.c:436
#: ../gtk-glade/main.c:396
#, fuzzy, c-format
msgid "Call with %s"
msgstr "Diskuze s %s"
#: ../gtk-glade/main.c:749
#: ../gtk-glade/main.c:709
#, c-format
msgid "Incoming call from %s"
msgstr "Příchozí hovor od %s"
#: ../gtk-glade/main.c:787
#: ../gtk-glade/main.c:747
#, c-format
msgid ""
"%s would like to add you to his contact list.\n"
......@@ -75,27 +75,27 @@ msgstr ""
"do svého adresáře?\n"
"Odpovíte-li ne, tato osobo bude dočasně blokována."
#: ../gtk-glade/main.c:865
#: ../gtk-glade/main.c:825
#, fuzzy, c-format
msgid ""
"Please enter your password for username <i>%s</i>\n"
" at domain <i>%s</i>:"
msgstr "Prosím, zadejte svoje heslo pro doménu %s:"
#: ../gtk-glade/main.c:962
#: ../gtk-glade/main.c:922
msgid "Website link"
msgstr ""
#: ../gtk-glade/main.c:998
#: ../gtk-glade/main.c:958
msgid "Linphone - a video internet phone"
msgstr "Lipnhone – internetový videofon"
#: ../gtk-glade/main.c:1017
#: ../gtk-glade/main.c:977
#, c-format
msgid "%s (Default)"
msgstr "%s (Výchozí)"
#: ../gtk-glade/main.c:1258
#: ../gtk-glade/main.c:1225
msgid "A free SIP video-phone"
msgstr "Volný SIP videofon"
......@@ -375,7 +375,7 @@ msgstr "<b>Hovor skončil.</b>"
msgid "Unmute"
msgstr "Neomezená"
#: ../gtk-glade/incall_view.c:180 ../gtk-glade/main.glade.h:40
#: ../gtk-glade/incall_view.c:180 ../gtk-glade/main.glade.h:43
msgid "Mute"
msgstr "Ztlumit"
......@@ -433,22 +433,27 @@ msgid "9"
msgstr "9"
#: ../gtk-glade/main.glade.h:13
#, fuzzy
msgid "<b>Add contacts from directory</b>"
msgstr "Přidat nový kontakt z adresáře %s"
#: ../gtk-glade/main.glade.h:14
msgid "<b>Contact list</b>"
msgstr "<b>Seznam kontaktů</b>"
#: ../gtk-glade/main.glade.h:14
#: ../gtk-glade/main.glade.h:15
msgid "<b>Terminate call</b>"
msgstr "<b>Ukončit hovor</b>"
#: ../gtk-glade/main.glade.h:15
#: ../gtk-glade/main.glade.h:16
msgid "<b>Welcome !</b>"
msgstr "<b>Vítejte!</b>"
#: ../gtk-glade/main.glade.h:16
#: ../gtk-glade/main.glade.h:17
msgid "A"
msgstr "A"
#: ../gtk-glade/main.glade.h:17
#: ../gtk-glade/main.glade.h:18
msgid ""
"ADSL\n"
"Fiber Channel"
......@@ -456,7 +461,7 @@ msgstr ""
"ADSL\n"
"Fiber Channel"
#: ../gtk-glade/main.glade.h:19
#: ../gtk-glade/main.glade.h:20
msgid ""
"All users\n"
"Online users"
......@@ -464,133 +469,143 @@ msgstr ""
"všech uživatelích\n"
"připojených uživatelích"
#: ../gtk-glade/main.glade.h:21
#: ../gtk-glade/main.glade.h:22
msgid "Assistant"
msgstr "Průvodce"
#: ../gtk-glade/main.glade.h:22
#: ../gtk-glade/main.glade.h:23
msgid "Audio & Video"
msgstr "Zvuk i obraz"
#: ../gtk-glade/main.glade.h:23
#: ../gtk-glade/main.glade.h:24
msgid "Audio only"
msgstr "Pouze zvuk"
#: ../gtk-glade/main.glade.h:24
#: ../gtk-glade/main.glade.h:25
#, fuzzy
msgid "Automatically log me in"
msgstr "Automaticky uhodnout platné jméno"
#: ../gtk-glade/main.glade.h:25
#: ../gtk-glade/main.glade.h:26
msgid "B"
msgstr "B"
#: ../gtk-glade/main.glade.h:26 ../gtk-glade/parameters.glade.h:20
#: ../gtk-glade/main.glade.h:27 ../gtk-glade/parameters.glade.h:21
msgid "C"
msgstr "C"
#: ../gtk-glade/main.glade.h:27
#: ../gtk-glade/main.glade.h:28 ../gtk-glade/call_logs.glade.h:1
msgid "Call history"
msgstr "Historie volání"
#: ../gtk-glade/main.glade.h:29
msgid "Check for updates"
msgstr ""
#: ../gtk-glade/main.glade.h:28
#: ../gtk-glade/main.glade.h:30
msgid "D"
msgstr "D"
#: ../gtk-glade/main.glade.h:29
#: ../gtk-glade/main.glade.h:31
msgid "Default"
msgstr "Výchozí"
#: ../gtk-glade/main.glade.h:30
#: ../gtk-glade/main.glade.h:32