Changeset 570:6a61c5ce242a in mediastreamer2
- Timestamp:
- Jul 30, 2009 5:19:23 PM (4 years ago)
- Branch:
- default
- Location:
- linphone
- Files:
-
- 6 edited
-
configure.in (modified) (1 diff)
-
coreapi/misc.c (modified) (1 diff)
-
gtk-glade/linphone.h (modified) (1 diff)
-
gtk-glade/parameters.glade (modified) (10 diffs)
-
gtk-glade/propertybox.c (modified) (2 diffs)
-
gtk-glade/support.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
linphone/configure.in
r507 r570 68 68 ALL_LINGUAS="fr it de ja es pl cs nl sv pt_BR hu ru" 69 69 AC_SUBST(ALL_LINGUAS) 70 AC_DEFINE_UNQUOTED(LINPHONE_ALL_LANGS, "$ALL_LINGUAS", [All supported languages]) 70 71 71 72 if test "$mingw_found" != "yes" ; then -
linphone/coreapi/misc.c
r493 r570 716 716 } 717 717 #ifdef WIN32 718 Sleep(10 );718 Sleep(100); 719 719 #else 720 usleep(10000 );720 usleep(100000); 721 721 #endif 722 722 } -
linphone/gtk-glade/linphone.h
r505 r570 60 60 void linphone_gtk_check_for_new_version(void); 61 61 const char *linphone_gtk_get_lang(const char *config_file); 62 void linphone_gtk_set_lang(const char *code); 62 63 SipSetupContext* linphone_gtk_get_default_sip_setup_context(void); 63 64 void linphone_gtk_show_buddy_lookup_window(SipSetupContext *ctx); -
linphone/gtk-glade/parameters.glade
r493 r570 17 17 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 18 18 <child> 19 <widget class="GtkVBox" id=" vbox2">19 <widget class="GtkVBox" id="network_tab"> 20 20 <property name="visible">True</property> 21 21 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 22 22 <child> 23 <widget class="GtkFrame" id=" frame1">23 <widget class="GtkFrame" id="transport_frame"> 24 24 <property name="visible">True</property> 25 25 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> … … 113 113 </child> 114 114 <child> 115 <widget class="GtkFrame" id=" frame2">115 <widget class="GtkFrame" id="ports_frame"> 116 116 <property name="visible">True</property> 117 117 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> … … 224 224 </child> 225 225 <child> 226 <widget class="GtkFrame" id=" frame6">226 <widget class="GtkFrame" id="nat_frame"> 227 227 <property name="visible">True</property> 228 228 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> … … 410 410 </child> 411 411 <child> 412 <widget class="GtkVBox" id=" vbox10">412 <widget class="GtkVBox" id="multimedia_tab"> 413 413 <property name="visible">True</property> 414 414 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> … … 430 430 <property name="n_columns">2</property> 431 431 <child> 432 <widget class="GtkHBox" id=" hbox19">432 <widget class="GtkHBox" id="ring_sound_box"> 433 433 <property name="visible">True</property> 434 434 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> … … 467 467 </child> 468 468 <child> 469 <widget class="GtkLabel" id=" label37">469 <widget class="GtkLabel" id="ring_sound_label"> 470 470 <property name="visible">True</property> 471 471 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> … … 664 664 </child> 665 665 <child> 666 <widget class="GtkLabel" id=" label8">666 <widget class="GtkLabel" id="video_size_label"> 667 667 <property name="visible">True</property> 668 668 <property name="label" translatable="yes">Prefered video resolution:</property> … … 1509 1509 </packing> 1510 1510 </child> 1511 <child> 1512 <widget class="GtkVBox" id="vbox2"> 1513 <property name="visible">True</property> 1514 <property name="orientation">vertical</property> 1515 <child> 1516 <widget class="GtkFrame" id="lang_frame"> 1517 <property name="visible">True</property> 1518 <property name="label_xalign">0</property> 1519 <child> 1520 <widget class="GtkAlignment" id="alignment3"> 1521 <property name="visible">True</property> 1522 <property name="left_padding">12</property> 1523 <child> 1524 <widget class="GtkComboBox" id="lang_combo"> 1525 <property name="visible">True</property> 1526 <property name="items" translatable="yes">C</property> 1527 <signal name="changed" handler="linphone_gtk_lang_changed"/> 1528 </widget> 1529 </child> 1530 </widget> 1531 </child> 1532 <child> 1533 <widget class="GtkLabel" id="lang_label"> 1534 <property name="visible">True</property> 1535 <property name="label" translatable="yes"><b>Language</b></property> 1536 <property name="use_markup">True</property> 1537 </widget> 1538 <packing> 1539 <property name="type">label_item</property> 1540 </packing> 1541 </child> 1542 </widget> 1543 <packing> 1544 <property name="expand">False</property> 1545 <property name="position">0</property> 1546 </packing> 1547 </child> 1548 <child> 1549 <placeholder/> 1550 </child> 1551 </widget> 1552 <packing> 1553 <property name="position">4</property> 1554 </packing> 1555 </child> 1556 <child> 1557 <widget class="GtkHBox" id="hbox4"> 1558 <property name="visible">True</property> 1559 <child> 1560 <widget class="GtkImage" id="image13"> 1561 <property name="visible">True</property> 1562 <property name="stock">gtk-properties</property> 1563 <property name="icon-size">3</property> 1564 </widget> 1565 <packing> 1566 <property name="position">0</property> 1567 </packing> 1568 </child> 1569 <child> 1570 <widget class="GtkLabel" id="label10"> 1571 <property name="visible">True</property> 1572 <property name="label" translatable="yes">User interface</property> 1573 </widget> 1574 <packing> 1575 <property name="position">1</property> 1576 </packing> 1577 </child> 1578 </widget> 1579 <packing> 1580 <property name="position">4</property> 1581 <property name="tab_fill">False</property> 1582 <property name="type">tab</property> 1583 </packing> 1584 </child> 1511 1585 </widget> 1512 1586 <packing> … … 1521 1595 <child> 1522 1596 <widget class="GtkButton" id="button5"> 1523 <property name="label" translatable="yes">gtk-close</property>1524 1597 <property name="visible">True</property> 1525 1598 <property name="can_focus">True</property> 1526 1599 <property name="receives_default">True</property> 1527 1600 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1528 <property name="use_stock">True</property>1529 1601 <signal name="clicked" handler="linphone_gtk_parameters_closed"/> 1602 <child> 1603 <widget class="GtkHBox" id="hbox3"> 1604 <property name="visible">True</property> 1605 <child> 1606 <widget class="GtkImage" id="image12"> 1607 <property name="visible">True</property> 1608 <property name="stock">gtk-apply</property> 1609 <property name="icon-size">4</property> 1610 </widget> 1611 <packing> 1612 <property name="position">0</property> 1613 </packing> 1614 </child> 1615 <child> 1616 <widget class="GtkLabel" id="label8"> 1617 <property name="visible">True</property> 1618 <property name="label" translatable="yes">Done</property> 1619 </widget> 1620 <packing> 1621 <property name="position">1</property> 1622 </packing> 1623 </child> 1624 </widget> 1625 </child> 1530 1626 </widget> 1531 1627 <packing> 1532 1628 <property name="expand">False</property> 1533 1629 <property name="fill">False</property> 1630 <property name="padding">10</property> 1534 1631 <property name="position">0</property> 1535 1632 </packing> … … 1537 1634 </widget> 1538 1635 <packing> 1636 <property name="padding">5</property> 1539 1637 <property name="position">1</property> 1540 1638 </packing> -
linphone/gtk-glade/propertybox.c
r495 r570 612 612 } 613 613 614 typedef struct _LangCodes{ 615 const char *code; 616 const char *name; 617 }LangCodes; 618 619 static LangCodes supported_langs[]={ 620 { "C" , N_("English") }, 621 { "fr" , N_("French") }, 622 { "sv" , N_("Swedish") }, 623 { "it" , N_("Italian") }, 624 { "es" , N_("Spanish") }, 625 { "pt_BR" , N_("Bresilian") }, 626 { "pl" , N_("Polish") }, 627 { "de" , N_("German") }, 628 { "ru" , N_("Russian") }, 629 { "ja" , N_("Japanese") }, 630 { "nl" , N_("Dutch") }, 631 { "hu" , N_("Hungarian") }, 632 { "cs" , N_("Czech") }, 633 { NULL , NULL } 634 }; 635 636 static const char *lang_get_name(const char *code){ 637 LangCodes *p=supported_langs; 638 while(p->code!=NULL){ 639 if (strcmp(p->code,code)==0) return p->name; 640 p++; 641 } 642 return NULL; 643 } 644 645 static gboolean lang_equals(const char *l1, const char *l2){ 646 return ((strncmp(l1,l2,5)==0 || strncmp(l1,l2,2)==0)); 647 } 648 649 static void linphone_gtk_fill_langs(GtkWidget *pb){ 650 GtkWidget *combo=linphone_gtk_get_widget(pb,"lang_combo"); 651 char code[10]; 652 const char *all_langs="C " LINPHONE_ALL_LANGS; 653 const char *name; 654 int i=0,index=0; 655 int adv; 656 const char *cur_lang=getenv("LANG"); 657 int cur_lang_index=-1; 658 char text[256]={0}; 659 if (cur_lang==NULL) cur_lang="C"; 660 /* glade creates a combo box without list model and text renderer, 661 unless we fill it with a dummy text. 662 This dummy text needs to be removed first*/ 663 gtk_combo_box_remove_text(GTK_COMBO_BOX(combo),0); 664 while(sscanf(all_langs+i,"%s %n",code,&adv)>=1){ 665 i+=adv; 666 name=lang_get_name(code); 667 snprintf(text,sizeof(text)-1,"%s : %s",code,name!=NULL ? _(name) : code); 668 gtk_combo_box_append_text(GTK_COMBO_BOX(combo),text); 669 if (cur_lang_index==-1 && lang_equals(cur_lang,code)) 670 cur_lang_index=index; 671 index++; 672 } 673 gtk_combo_box_set_active(GTK_COMBO_BOX(combo),cur_lang_index); 674 } 675 676 void linphone_gtk_lang_changed(GtkComboBox *combo){ 677 const char *selected=gtk_combo_box_get_active_text(combo); 678 char code[10]; 679 const char *cur_lang=getenv("LANG"); 680 if (selected!=NULL){ 681 sscanf(selected,"%s",code); 682 if (cur_lang==NULL) cur_lang="C"; 683 if (!lang_equals(cur_lang,code)){ 684 GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(combo))), 685 GTK_DIALOG_DESTROY_WITH_PARENT, 686 GTK_MESSAGE_INFO, 687 GTK_BUTTONS_CLOSE, 688 "%s", 689 (const gchar*)_("You need to restart linphone for the new language selection to take effect.")); 690 /* Destroy the dialog when the user responds to it (e.g. clicks a button) */ 691 g_signal_connect_swapped (G_OBJECT (dialog), "response", 692 G_CALLBACK (gtk_widget_destroy), 693 G_OBJECT (dialog)); 694 gtk_widget_show(dialog); 695 linphone_gtk_set_lang(code); 696 } 697 } 698 } 699 614 700 void linphone_gtk_show_parameters(void){ 615 701 GtkWidget *pb=linphone_gtk_create_window("parameters"); … … 689 775 gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"upload_bw")), 690 776 linphone_core_get_upload_bandwidth(lc)); 777 778 linphone_gtk_fill_langs(pb); 691 779 gtk_widget_show(pb); 692 780 } -
linphone/gtk-glade/support.c
r342 r570 125 125 } 126 126 127 void linphone_gtk_set_lang(const char *code){ 128 LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core()); 129 lp_config_set_string(cfg,"GtkUi","lang",code); 130 #ifdef WIN32 131 char tmp[128]; 132 snprintf(tmp,sizeof(tmp),"LANG=%s",code); 133 _putenv(tmp); 134 #else 135 setenv("LANG",code,1); 136 #endif 137 } 138 127 139 const gchar *linphone_gtk_get_ui_config(const char *key, const char *def){ 128 140 LinphoneCore *lc=linphone_gtk_get_core();
Note: See TracChangeset
for help on using the changeset viewer.
