Commit 1dfdbdd0 authored by François Grisez's avatar François Grisez

Add a checkbox to enoble/disable auto-answering

+ auto-answering is now controled by the "auto-answer" parameter in the GtkUi
  section of linphonerc
+ The corresponding command line argument is now unhadled
parent 67ffa6b6
......@@ -92,7 +92,6 @@ static gint main_window_y=0;
#endif
static gboolean verbose=0;
static gboolean quit_done=FALSE;
static gboolean auto_answer = 0;
static gchar * addr_to_call = NULL;
static int start_option = START_LINPHONE;
static gboolean no_video=FALSE;
......@@ -139,7 +138,6 @@ static GOptionEntry linphone_options[]={
LINPHONE_OPTION("no-video", '\0', G_OPTION_ARG_NONE, (gpointer)&no_video, N_("Start linphone with video disabled.")),
LINPHONE_OPTION("iconified", '\0', G_OPTION_ARG_NONE, (gpointer)&iconified, N_("Start only in the system tray, do not show the main interface.")),
LINPHONE_OPTION("call", 'c', G_OPTION_ARG_STRING, &addr_to_call, N_("address to call right now")),
LINPHONE_OPTION("auto-answer", 'a', G_OPTION_ARG_NONE, (gpointer) & auto_answer, N_("if set automatically answer incoming calls")),
LINPHONE_OPTION("workdir", '\0', G_OPTION_ARG_STRING, (gpointer) & workingdir, N_("Specifiy a working directory (should be the base of the installation, eg: c:\\Program Files\\Linphone)")),
LINPHONE_OPTION("config", '\0', G_OPTION_ARG_FILENAME, (gpointer) &custom_config_file, N_("Configuration file")),
LINPHONE_OPTION("run-audio-assistant", '\0', G_OPTION_ARG_NONE, (gpointer) &run_audio_assistant, N_("Run the audio assistant")),
......@@ -1375,7 +1373,7 @@ static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call
linphone_gtk_create_in_call_view(call);
linphone_gtk_in_call_view_set_incoming(call);
linphone_gtk_status_icon_set_blinking(TRUE);
if (auto_answer) {
if (linphone_gtk_get_ui_config_int("auto_answer", 0)) {
linphone_call_ref(call);
g_timeout_add(2000,(GSourceFunc)linphone_gtk_auto_answer ,call);
}
......
This diff is collapsed.
......@@ -1582,6 +1582,8 @@ void linphone_gtk_show_parameters(void){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"adaptive_rate_control")),
linphone_core_adaptive_rate_control_enabled(lc));
/* CALL PARAMS CONFIG */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb, "auto_answer")), linphone_gtk_get_ui_config_int("auto_answer", 0));
/* UI CONFIG */
linphone_gtk_fill_langs(pb);
......@@ -1770,3 +1772,8 @@ void linphone_gtk_dscp_edit_response(GtkWidget *dialog, guint response_id){
}
gtk_widget_destroy(dialog);
}
void linphone_gtk_enable_auto_answer(GtkToggleButton *checkbox, gpointer user_data) {
gboolean auto_answer_enabled = gtk_toggle_button_get_active(checkbox);
linphone_gtk_set_ui_config_int("auto_answer", auto_answer_enabled ? 1 : 0);
}
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