Commit fd74e2f1 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Save in linphonerc user preference for scroll_to_end in gtk debug logs window

parent 55ca45db
......@@ -30,7 +30,7 @@
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="active">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="linphone_gtk_log_scroll_to_end" swapped="no"/>
</object>
......
......@@ -216,7 +216,6 @@ void linphone_gtk_create_log_window(void){
/*prevent the log window from being destroyed*/
g_signal_connect (G_OBJECT (log_window), "delete-event",
G_CALLBACK (gtk_widget_hide_on_delete), log_window);
}
void linphone_gtk_destroy_log_window(void){
......@@ -292,11 +291,12 @@ static void stick_to_end(GtkTextView *v){
gtk_text_view_scroll_to_iter(v,&iter,0,FALSE,1.0,0);
}
void linphone_gtk_log_scroll_to_end(GtkToggleButton *button){
void linphone_gtk_log_scroll_to_end(GtkToggleButton *button) {
if (gtk_toggle_button_get_active(button)){
GtkTextView *v=GTK_TEXT_VIEW(linphone_gtk_get_widget(log_window,"textview"));
stick_to_end(v);
}
lp_config_set_int(linphone_core_get_config(linphone_gtk_get_core()), "GtkUi", "logs_scroll_to_end", gtk_toggle_button_get_active(button) ? 1 : 0);
}
/*
......@@ -316,8 +316,10 @@ gboolean linphone_gtk_check_logs(void){
if (log_queue) g_list_free(log_queue);
log_queue=NULL;
g_static_mutex_unlock(&log_mutex);
if (v)
if (v) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(log_window,"scroll_to_end")), lp_config_get_int(linphone_core_get_config(linphone_gtk_get_core()), "GtkUi", "logs_scroll_to_end", 0) == 1);
linphone_gtk_log_scroll_to_end(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(log_window,"scroll_to_end")));
}
return TRUE;
}
......
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