#include <gtk/gtk.h>
Go to the source code of this file.
Functions | |
GtkWidget * | create_sdcapacity_window (GtkWidget *parent) |
void | load_sdcapacity_settings () |
void | save_sdcapacity_settings () |
void | sd_card_mounted (gboolean is_mounted) |
GtkWidget* create_sdcapacity_window | ( | GtkWidget * | parent | ) |
Copyright (C) 2008 iRex Technologies B.V. All rights reserved.
Definition at line 104 of file sd_capacity.c.
References create_sdcapacity_widgets(), create_settingsview(), create_title(), g_sdcapacity_window, 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().
00105 { 00106 // create top window 00107 GtkWidget* top_window = parent; 00108 gtk_window_maximize(GTK_WINDOW(top_window)); 00109 gtk_window_set_resizable(GTK_WINDOW(top_window), FALSE); 00110 gtk_container_set_border_width(GTK_CONTAINER(top_window),WINDOW_BORDER_PADDING ); 00111 gtk_window_set_modal(GTK_WINDOW(top_window), TRUE); 00112 00113 // top level vbox (vboxtop) 00114 GtkWidget* vboxtop = gtk_vbox_new(FALSE, 0); 00115 gtk_container_add(GTK_CONTAINER(top_window), vboxtop); 00116 00117 // add header container the title and subtitle of this settings page 00118 create_title(GTK_VBOX(vboxtop), _("Settings"), _("SD Card Information")); 00119 00120 // add the back/exit bar below the title 00121 GtkWidget* view = create_settingsview(); 00122 gtk_box_pack_start(GTK_BOX(vboxtop), view, FALSE, FALSE,0 ); 00123 g_signal_connect(view, "row-activated", G_CALLBACK(on_listview_row_activated), NULL ) ; 00124 g_signal_connect(view, "navigate-cursor", G_CALLBACK(on_listview_navigate_cursor), NULL ) ; 00125 g_signal_connect(view, "focus-in-event", G_CALLBACK(on_focus_in), NULL ); 00126 g_signal_connect(view, "focus-out-event", G_CALLBACK(on_focus_out), NULL ); 00127 00128 // add an alignment below the exit bar 00129 GtkWidget* alignment = gtk_alignment_new(0, 0, 1.0, 0.0); 00130 gtk_container_add(GTK_CONTAINER(vboxtop), alignment); 00131 00132 // introdude a frame in the alignment 00133 GtkWidget* frame = gtk_frame_new(NULL); 00134 gtk_widget_set_name(frame, "irex-margins-frame"); 00135 gtk_container_add(GTK_CONTAINER(alignment), frame); 00136 gtk_container_set_border_width(GTK_CONTAINER(frame), 3); 00137 00138 // alignment in frame 00139 GtkWidget* alignment2 = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); 00140 gtk_container_add(GTK_CONTAINER(frame), alignment2); 00141 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment2), 00142 WINDOW_TOP_ALT_PADDING, 00143 WINDOW_BOTTOM_PADDING, 00144 WINDOW_H_PADDING, 00145 WINDOW_H_PADDING); 00146 00147 // vbox in alignment2 00148 GtkWidget* innervbox = gtk_vbox_new(FALSE, SMALL_SPACING); 00149 gtk_container_add(GTK_CONTAINER(alignment2), innervbox); 00150 00151 // The margin settings section. 00152 create_sdcapacity_widgets(GTK_BOX(innervbox)); 00153 00154 // Update widget with current settings. 00155 init_widgets_with_settings(); 00156 00157 gtk_widget_grab_focus(view); 00158 00159 gtk_widget_show_all(top_window); 00160 00161 g_sdcapacity_window = top_window; 00162 00163 return top_window; 00164 }
void load_sdcapacity_settings | ( | ) |
Definition at line 167 of file sd_capacity.c.
void save_sdcapacity_settings | ( | ) |
Definition at line 173 of file sd_capacity.c.
void sd_card_mounted | ( | gboolean | is_mounted | ) |
Definition at line 179 of file sd_capacity.c.
Referenced by on_mounted(), and on_unmounted().
00180 { 00181 LOGPRINTF("entry: is_mounted [%d]", is_mounted); 00182 00183 while (g_is_updating == TRUE) { 00184 sched_yield(); 00185 } 00186 00187 g_is_updating = TRUE; 00188 00189 // remember card state 00190 g_sd_card_mounted = is_mounted; 00191 00192 // show free space 00193 00194 if (g_sdcapacity_window != NULL) 00195 { 00196 update_sd_widgets(); 00197 } 00198 g_is_updating = FALSE; 00199 }