#include <gtk/gtk.h>
Go to the source code of this file.
Functions | |
GtkWidget * | create_flightmode_window (GtkWidget *parent) |
void | load_flightmode_settings () |
void | save_flightmode_settings () |
GtkWidget* create_flightmode_window | ( | GtkWidget * | parent | ) |
Copyright (C) 2008 iRex Technologies B.V. All rights reserved.
Definition at line 108 of file flightmode.c.
References create_flightmode_widgets(), create_settingsview(), create_title(), init_widgets_with_settings(), on_focus_in(), on_focus_out(), on_listview_navigate_cursor(), on_listview_row_activated(), SMALL_SPACING, WINDOW_BORDER_PADDING, WINDOW_BOTTOM_PADDING, WINDOW_H_PADDING, and WINDOW_TOP_ALT_PADDING.
Referenced by create_concrete_win().
00109 { 00110 // create top window 00111 GtkWidget* top_window = parent; 00112 gtk_window_maximize(GTK_WINDOW(top_window)); 00113 gtk_window_set_resizable(GTK_WINDOW(top_window), FALSE); 00114 gtk_container_set_border_width(GTK_CONTAINER(top_window),WINDOW_BORDER_PADDING ); 00115 gtk_window_set_modal(GTK_WINDOW(top_window), TRUE); 00116 00117 // top level vbox (vboxtop) 00118 GtkWidget* vboxtop = gtk_vbox_new(FALSE, 3); 00119 gtk_container_add(GTK_CONTAINER(top_window), vboxtop); 00120 00121 // add header container the title and subtitle of this settings page 00122 create_title(GTK_VBOX(vboxtop), _("Settings"), _("Airplane Mode")); 00123 00124 // add the back/exit bar below the title 00125 GtkWidget* view = create_settingsview(); 00126 gtk_box_pack_start(GTK_BOX(vboxtop), view, FALSE, FALSE,0 ); 00127 g_signal_connect(view, "row-activated", G_CALLBACK(on_listview_row_activated), NULL ) ; 00128 g_signal_connect(view, "navigate-cursor", G_CALLBACK(on_listview_navigate_cursor), NULL ) ; 00129 g_signal_connect(view, "focus-in-event", G_CALLBACK(on_focus_in), NULL ); 00130 g_signal_connect(view, "focus-out-event", G_CALLBACK(on_focus_out), NULL ); 00131 00132 // add an alignment below the exit bar 00133 GtkWidget* alignment = gtk_alignment_new(0, 0, 1.0, 0.0); 00134 gtk_container_add(GTK_CONTAINER(vboxtop), alignment); 00135 00136 // introdude a frame in the alignment 00137 GtkWidget* frame = gtk_frame_new(NULL); 00138 gtk_widget_set_name(frame, "irex-margins-frame"); 00139 gtk_container_add(GTK_CONTAINER(alignment), frame); 00140 gtk_container_set_border_width(GTK_CONTAINER(frame), 3); 00141 00142 // alignment in frame 00143 GtkWidget* alignment2 = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); 00144 gtk_container_add(GTK_CONTAINER(frame), alignment2); 00145 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment2), 00146 WINDOW_TOP_ALT_PADDING, 00147 WINDOW_BOTTOM_PADDING, 00148 WINDOW_H_PADDING, 00149 WINDOW_H_PADDING); 00150 00151 // vbox in alignment2 00152 GtkWidget* innervbox = gtk_vbox_new(FALSE, SMALL_SPACING); 00153 gtk_container_add(GTK_CONTAINER(alignment2), innervbox); 00154 00155 // The margin settings section. 00156 create_flightmode_widgets(GTK_BOX(innervbox)); 00157 00158 // Update widget with current settings. 00159 init_widgets_with_settings(); 00160 00161 // back button has initial focus 00162 gtk_widget_grab_focus(view); 00163 00164 gtk_widget_show_all(top_window); 00165 return top_window; 00166 }
void load_flightmode_settings | ( | ) |
Definition at line 228 of file flightmode.c.
References g_cur_is_flightmode_enabled, g_orig_is_flightmode_enabled, GCONF_FLIGHTMODE_MODE, and get_value_bool().
Referenced by create_concrete_win().
00229 { 00230 g_orig_is_flightmode_enabled = get_value_bool (GCONF_FLIGHTMODE_MODE); 00231 00232 g_cur_is_flightmode_enabled = g_orig_is_flightmode_enabled; 00233 }
void save_flightmode_settings | ( | ) |
Definition at line 236 of file flightmode.c.
References g_cur_is_flightmode_enabled, g_orig_is_flightmode_enabled, GCONF_FLIGHTMODE_MODE, LOGPRINTF, and set_value_bool().
Referenced by on_listview_row_activated().
00237 { 00238 if (g_cur_is_flightmode_enabled != g_orig_is_flightmode_enabled ) 00239 { 00240 set_value_bool(GCONF_FLIGHTMODE_MODE, g_cur_is_flightmode_enabled); 00241 g_orig_is_flightmode_enabled = g_cur_is_flightmode_enabled; 00242 } 00243 00244 LOGPRINTF("Saving flightmode settings, done."); 00245 }