#include <gtk/gtk.h>
Go to the source code of this file.
Functions | |
GtkWidget * | create_sensors_window (GtkWidget *parent) |
void | load_sensor_settings () |
void | save_sensor_settings () |
GtkWidget* create_sensors_window | ( | GtkWidget * | parent | ) |
Copyright (C) 2010 iRex Technologies B.V. All rights reserved.
Definition at line 163 of file sensors.c.
References create_frame(), create_light_widgets(), create_lock_widgets(), create_settingsview(), create_sound_widgets(), create_title(), g_sensor_settings_window, init_widgets_with_settings(), on_focus_in(), on_focus_out(), on_listview_navigate_cursor(), on_listview_row_activated(), and WINDOW_BORDER_PADDING.
Referenced by create_concrete_win().
00164 { 00165 // create top window 00166 GtkWidget* top_window = parent; 00167 gtk_window_maximize(GTK_WINDOW(top_window)); 00168 gtk_window_set_resizable(GTK_WINDOW(top_window), FALSE); 00169 gtk_container_set_border_width(GTK_CONTAINER(top_window),WINDOW_BORDER_PADDING ); 00170 gtk_window_set_modal(GTK_WINDOW(top_window), TRUE); 00171 00172 // top level vbox (vboxtop) 00173 GtkWidget* vboxtop = gtk_vbox_new(FALSE, 0); 00174 gtk_container_add(GTK_CONTAINER(top_window), vboxtop); 00175 00176 // add header container the title and subtitle of this settings page 00177 create_title(GTK_VBOX(vboxtop), _("Settings"), _("Navigation Sensors")); 00178 00179 // add the back/exit bar below the title 00180 GtkWidget* view = create_settingsview(); 00181 gtk_box_pack_start(GTK_BOX(vboxtop), view, FALSE, FALSE,0 ); 00182 g_signal_connect(view, "row-activated", G_CALLBACK(on_listview_row_activated), NULL ) ; 00183 g_signal_connect(view, "navigate-cursor", G_CALLBACK(on_listview_navigate_cursor), NULL ) ; 00184 g_signal_connect(view, "focus-in-event", G_CALLBACK(on_focus_in), NULL ); 00185 g_signal_connect(view, "focus-out-event", G_CALLBACK(on_focus_out), NULL ); 00186 00187 00188 GtkWidget* vbox1 = GTK_WIDGET( create_frame(GTK_VBOX(vboxtop)) ); 00189 create_light_widgets(GTK_BOX(vbox1)); 00190 00191 GtkWidget* vbox2 = GTK_WIDGET( create_frame(GTK_VBOX(vboxtop)) ); 00192 create_sound_widgets(GTK_BOX(vbox2)); 00193 00194 GtkWidget* vbox3 = GTK_WIDGET( create_frame(GTK_VBOX(vboxtop)) ); 00195 create_lock_widgets(GTK_BOX(vbox3)); 00196 00197 // Update widget with current settings. 00198 init_widgets_with_settings(); 00199 00200 g_sensor_settings_window = top_window; 00201 00202 gtk_widget_grab_focus(view); 00203 00204 gtk_widget_show_all(top_window); 00205 return top_window; 00206 }
void load_sensor_settings | ( | ) |
Definition at line 119 of file sensors.c.
References GCONF_LOCK_LEFT_SENSOR, GCONF_LOCK_MIDDLE_SENSOR, GCONF_LOCK_RIGHT_SENSOR, GCONF_USE_LIGHT, GCONF_USE_SOUND, get_value_bool(), SensorSettings::lights_on, SensorSettings::lock_left_sensor, SensorSettings::lock_middle_sensor, SensorSettings::lock_right_sensor, LOGPRINTF, and SensorSettings::sound_on.
Referenced by create_concrete_win().
00120 { 00121 g_orig_sensor_settings.lights_on = get_value_bool(GCONF_USE_LIGHT); 00122 g_orig_sensor_settings.sound_on = get_value_bool(GCONF_USE_SOUND); 00123 g_orig_sensor_settings.lock_left_sensor = get_value_bool(GCONF_LOCK_LEFT_SENSOR); 00124 g_orig_sensor_settings.lock_middle_sensor = get_value_bool(GCONF_LOCK_MIDDLE_SENSOR); 00125 g_orig_sensor_settings.lock_right_sensor = get_value_bool(GCONF_LOCK_RIGHT_SENSOR); 00126 00127 g_cur_sensor_settings = g_orig_sensor_settings; 00128 00129 LOGPRINTF("Loading sensor settings, done."); 00130 }
void save_sensor_settings | ( | ) |
Definition at line 133 of file sensors.c.
References GCONF_LOCK_LEFT_SENSOR, GCONF_LOCK_MIDDLE_SENSOR, GCONF_LOCK_RIGHT_SENSOR, GCONF_USE_LIGHT, GCONF_USE_SOUND, SensorSettings::lights_on, SensorSettings::lock_left_sensor, SensorSettings::lock_middle_sensor, SensorSettings::lock_right_sensor, LOGPRINTF, set_value_bool(), and SensorSettings::sound_on.
Referenced by on_listview_row_activated().
00134 { 00135 if (g_cur_sensor_settings.lights_on != g_orig_sensor_settings.lights_on) 00136 { 00137 set_value_bool(GCONF_USE_LIGHT, g_cur_sensor_settings.lights_on); 00138 } 00139 00140 if (g_cur_sensor_settings.sound_on != g_orig_sensor_settings.sound_on) 00141 { 00142 set_value_bool(GCONF_USE_SOUND, g_cur_sensor_settings.sound_on); 00143 } 00144 00145 if (g_cur_sensor_settings.lock_left_sensor != g_orig_sensor_settings.lock_left_sensor) 00146 { 00147 set_value_bool(GCONF_LOCK_LEFT_SENSOR, g_cur_sensor_settings.lock_left_sensor); 00148 } 00149 00150 if (g_cur_sensor_settings.lock_middle_sensor != g_orig_sensor_settings.lock_middle_sensor) 00151 { 00152 set_value_bool(GCONF_LOCK_MIDDLE_SENSOR, g_cur_sensor_settings.lock_middle_sensor); 00153 } 00154 00155 if (g_cur_sensor_settings.lock_right_sensor != g_orig_sensor_settings.lock_right_sensor) 00156 { 00157 set_value_bool(GCONF_LOCK_RIGHT_SENSOR, g_cur_sensor_settings.lock_right_sensor); 00158 } 00159 00160 LOGPRINTF("Saving sensor settings, done."); 00161 }