Commit a900f649 authored by François Grisez's avatar François Grisez
Browse files

Add a parameter inb the property panel to set the delay before auto-answering

parent bb437b6a
......@@ -1384,8 +1384,9 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call
linphone_gtk_in_call_view_set_incoming(call);
linphone_gtk_status_icon_set_blinking(TRUE);
if (linphone_gtk_get_ui_config_int("auto_answer", 0)) {
int delay = linphone_gtk_get_ui_config_int("auto_answer_delay", 2000);
linphone_call_ref(call);
g_timeout_add(2000,(GSourceFunc)linphone_gtk_auto_answer ,call);
g_timeout_add(delay, (GSourceFunc)linphone_gtk_auto_answer, call);
}
break;
case LinphoneCallResuming:
......
......@@ -2,69 +2,12 @@
<interface>
<requires lib="gtk+" version="2.18"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">500</property>
<property name="upper">3001</property>
<property name="value">500</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment10">
<property name="upper">500</property>
<property name="value">50</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="lower">1</property>
<property name="upper">65535</property>
<property name="value">1</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
<property name="lower">1</property>
<property name="upper">65535</property>
<property name="value">1</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment4">
<property name="upper">65535</property>
<property name="value">1</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment5">
<property name="lower">-1</property>
<property name="upper">100000</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment6">
<object class="GtkAdjustment" id="adjustment_download_bw">
<property name="lower">-1</property>
<property name="upper">100000</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment7">
<property name="upper">65535</property>
<property name="value">5060</property>
<property name="step_increment">1</property>
<property name="page_increment">9.9999999995529656</property>
</object>
<object class="GtkAdjustment" id="adjustment8">
<property name="upper">65535</property>
<property name="value">5060</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment9">
<property name="upper">100</property>
<property name="value">10</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_max_audio_port">
<property name="upper">65535</property>
<property name="step_increment">2</property>
......@@ -85,12 +28,31 @@
<property name="step_increment">2</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_mtu">
<property name="lower">500</property>
<property name="upper">3001</property>
<property name="value">500</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_tcp_port">
<property name="upper">65535</property>
<property name="value">1</property>
<property name="value">5060</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment_upload_bw">
<property name="lower">-1</property>
<property name="upper">100000</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="ajustment_auto_answer_delay">
<property name="upper">60000</property>
<property name="value">2000</property>
<property name="step_increment">100</property>
<property name="page_increment">500</property>
</object>
<object class="GtkListStore" id="liststore1"/>
<object class="GtkListStore" id="liststore2">
<columns>
......@@ -189,6 +151,29 @@
</row>
</data>
</object>
<object class="GtkListStore" id="model8">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">SIP (UDP)</col>
</row>
<row>
<col id="0" translatable="yes">SIP (TCP)</col>
</row>
<row>
<col id="0" translatable="yes">SIP (TLS)</col>
</row>
</data>
</object>
<object class="GtkAdjustment" id="udp_port_adjustment">
<property name="upper">65535</property>
<property name="value">5060</property>
<property name="step_increment">1</property>
<property name="page_increment">9.9999999995529656</property>
</object>
<object class="GtkWindow" id="parameters">
<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>
......@@ -253,7 +238,7 @@
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">adjustment1</property>
<property name="adjustment">adjustment_mtu</property>
<signal name="value-changed" handler="linphone_gtk_mtu_changed" swapped="no"/>
</object>
<packing>
......@@ -391,7 +376,7 @@
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">adjustment8</property>
<property name="adjustment">udp_port_adjustment</property>
<signal name="value-changed" handler="linphone_gtk_udp_port_value_changed" swapped="no"/>
</object>
<packing>
......@@ -461,7 +446,7 @@
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">adjustment8</property>
<property name="adjustment">adjustment_tcp_port</property>
<signal name="value-changed" handler="linphone_gtk_tcp_port_value_changed" swapped="no"/>
</object>
<packing>
......@@ -1940,13 +1925,55 @@
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkCheckButton" id="auto_answer_checkbox">
<property name="label" translatable="yes">Automatically answer when a call is received</property>
<object class="GtkTable" id="table7">
<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_enable_auto_answer" swapped="no"/>
<property name="can_focus">False</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<child>
<object class="GtkCheckButton" id="auto_answer_checkbox">
<property name="label" translatable="yes">Automatically answer when a call is received</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_enable_auto_answer" swapped="no"/>
</object>
<packing>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="auto_answer_delay_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Delay before answering (ms)</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="auto_answer_delay_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">ajustment_auto_answer_delay</property>
<property name="numeric">True</property>
<signal name="value-changed" handler="linphone_gtk_auto_answer_delay_changed" swapped="no"/>
</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>
</object>
</child>
</object>
......@@ -2273,7 +2300,7 @@
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">adjustment5</property>
<property name="adjustment">adjustment_upload_bw</property>
<signal name="value-changed" handler="linphone_gtk_upload_bw_changed" swapped="no"/>
</object>
<packing>
......@@ -2295,7 +2322,7 @@
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">adjustment6</property>
<property name="adjustment">adjustment_download_bw</property>
<signal name="value-changed" handler="linphone_gtk_download_bw_changed" swapped="no"/>
</object>
<packing>
......@@ -2801,21 +2828,4 @@
</object>
</child>
</object>
<object class="GtkListStore" id="model8">
<columns>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">SIP (UDP)</col>
</row>
<row>
<col id="0" translatable="yes">SIP (TCP)</col>
</row>
<row>
<col id="0" translatable="yes">SIP (TLS)</col>
</row>
</data>
</object>
</interface>
......@@ -1584,6 +1584,7 @@ void linphone_gtk_show_parameters(void){
/* CALL PARAMS CONFIG */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb, "auto_answer_checkbox")), linphone_gtk_get_ui_config_int("auto_answer", 0));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb, "auto_answer_delay_spinbutton")), linphone_gtk_get_ui_config_int("auto_answer_delay", 2000));
/* UI CONFIG */
linphone_gtk_fill_langs(pb);
......@@ -1777,3 +1778,8 @@ void linphone_gtk_enable_auto_answer(GtkToggleButton *checkbox, gpointer user_da
gboolean auto_answer_enabled = gtk_toggle_button_get_active(checkbox);
linphone_gtk_set_ui_config_int("auto_answer", auto_answer_enabled ? 1 : 0);
}
void linphone_gtk_auto_answer_delay_changed(GtkSpinButton *spinbutton, gpointer user_data) {
int delay = gtk_spin_button_get_value(spinbutton);
linphone_gtk_set_ui_config_int("auto_answer_delay", delay);
}
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