Commit 12902257 authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

parameters: add lime checkbox activation

parent 17ee1f15
......@@ -1603,7 +1603,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="n_rows">8</property>
<property name="n_rows">6</property>
<property name="n_columns">2</property>
<child>
<object class="GtkLabel" id="sip_udp_port_label">
......@@ -1901,54 +1901,14 @@
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="media_encryption_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Media encryption type</property>
</object>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">6</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="media_encryption_combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="media_encryption_mandatory">
<property name="label" translatable="yes">Media encryption is mandatory</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_set_media_encryption_mandatory" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="tunnel_label">
<property name="can_focus">False</property>
<property name="label" translatable="yes">Tunnel</property>
</object>
<packing>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
</packing>
</child>
<child>
......@@ -1962,8 +1922,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
</packing>
</child>
<child>
......@@ -1973,8 +1933,8 @@
<property name="label" translatable="yes">DSCP fields</property>
</object>
<packing>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
......@@ -1989,8 +1949,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
</object>
......@@ -2236,6 +2196,119 @@
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="encryption_frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment15">
<property name="visible">True</property>
<property name="can_focus">False</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>
<child>
<object class="GtkTable" id="encryption_table">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<child>
<object class="GtkLabel" id="media_encryption_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Media encryption type</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="media_encryption_combo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="chat_lime_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="yalign">0.49000000953674316</property>
<property name="label" translatable="yes">Use Lime in chat</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="chat_lime_checkbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.40000000596046448</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="linphone_gtk_enable_lime" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="media_encryption_mandatory_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Media encryption is mandatory</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="media_encryption_mandatory_checkbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0.40000000596046448</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="linphone_gtk_set_media_encryption_mandatory" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="encryption_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">&lt;b&gt;Encryption&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
......
......@@ -1277,7 +1277,7 @@ void linphone_gtk_ui_level_toggled(GtkWidget *w) {
}
static void linphone_gtk_set_media_encryption_mandatory_sensitive(GtkWidget *propbox, gboolean val){
GtkWidget *w=linphone_gtk_get_widget(propbox,"media_encryption_mandatory");
GtkWidget *w=linphone_gtk_get_widget(propbox,"media_encryption_mandatory_checkbox");
gtk_widget_set_sensitive(w,val);
}
......@@ -1285,7 +1285,7 @@ static void linphone_gtk_media_encryption_changed(GtkWidget *combo){
char *selected=gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo));
LinphoneCore *lc=linphone_gtk_get_core();
GtkWidget *toplevel=gtk_widget_get_toplevel(combo);
GtkWidget *mandatory_box = linphone_gtk_get_widget(toplevel,"media_encryption_mandatory");
GtkWidget *mandatory_box = linphone_gtk_get_widget(toplevel,"media_encryption_mandatory_checkbox");
if (selected!=NULL){
if (strcasecmp(selected,"SRTP")==0){
linphone_core_set_media_encryption(lc,LinphoneMediaEncryptionSRTP);
......@@ -1309,6 +1309,10 @@ void linphone_gtk_set_media_encryption_mandatory(GtkWidget *button){
linphone_core_set_media_encryption_mandatory(linphone_gtk_get_core(),gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)));
}
void linphone_gtk_enable_lime(GtkWidget *button){
linphone_core_enable_lime(linphone_gtk_get_core(), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)));
}
static void linphone_gtk_show_media_encryption(GtkWidget *pb){
LinphoneCore *lc=linphone_gtk_get_core();
GtkWidget *combo=linphone_gtk_get_widget(pb,"media_encryption_combo");
......@@ -1356,10 +1360,11 @@ static void linphone_gtk_show_media_encryption(GtkWidget *pb){
}
if (no_enc){
/*hide this setting*/
gtk_widget_hide(combo);
gtk_widget_hide(linphone_gtk_get_widget(pb,"media_encryption_label"));
gtk_widget_hide(linphone_gtk_get_widget(pb,"media_encryption_mandatory"));
gtk_widget_hide(linphone_gtk_get_widget(pb,"encryption_label"));
gtk_widget_hide(linphone_gtk_get_widget(pb,"encryption_table"));
}else{
gtk_widget_show(linphone_gtk_get_widget(pb,"encryption_label"));
gtk_widget_show(linphone_gtk_get_widget(pb,"encryption_table"));
LinphoneMediaEncryption menc=linphone_core_get_media_encryption(lc);
switch(menc){
case LinphoneMediaEncryptionNone:
......@@ -1387,8 +1392,10 @@ static void linphone_gtk_show_media_encryption(GtkWidget *pb){
}
g_signal_connect(G_OBJECT(combo),"changed",(GCallback)linphone_gtk_media_encryption_changed,NULL);
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"media_encryption_mandatory")),
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"media_encryption_mandatory_checkbox")),
linphone_core_is_media_encryption_mandatory(lc));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"chat_lime_checkbox")),
linphone_core_lime_enabled(lc));
g_object_unref(G_OBJECT(model));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment