diff pui-prefs-application.c @ 4:3d72ca76538d

Add setting to control whether to use a mobile connection
author Guido Berhoerster <guido+pui@berhoerster.name>
date Sun, 17 Jun 2018 11:05:28 +0200
parents 2f04ec9e0506
children 9cbb0f8a66c4
line wrap: on
line diff
--- a/pui-prefs-application.c	Wed Jun 13 23:25:09 2018 +0200
+++ b/pui-prefs-application.c	Sun Jun 17 11:05:28 2018 +0200
@@ -127,6 +127,7 @@
 	GtkTreeModel	*tree_model;
 	GtkWidget	*update_command_entry;
 	GtkWidget	*refresh_interval_combo_box;
+	GtkWidget	*use_mobile_check_button;
 
 	application_class->startup(application);
 
@@ -146,6 +147,8 @@
 	    "refresh-interval"));
 	tree_model =
 	    gtk_combo_box_get_model(GTK_COMBO_BOX(refresh_interval_combo_box));
+	use_mobile_check_button = GTK_WIDGET(gtk_builder_get_object(builder,
+	    "use-mobile-connection"));
 
 	/* bind settings to widgets */
 	self->settings = pui_settings_new();
@@ -155,6 +158,8 @@
 	    refresh_interval_combo_box, "active", G_SETTINGS_BIND_DEFAULT,
 	    map_refresh_interval_to_index, map_index_to_refresh_interval,
 	    tree_model, NULL);
+	g_settings_bind(self->settings, "use-mobile-connection",
+	    use_mobile_check_button, "active", G_SETTINGS_BIND_DEFAULT);
 
 	/* show window */
 	gtk_widget_show(window);