#include <gtk/gtk.h>
Go to the source code of this file.
Functions | |
GtkWidget * | create_device_info_window (GtkWidget *parent) |
void | load_device_info () |
GtkWidget* create_device_info_window | ( | GtkWidget * | parent | ) |
Copyright (C) 2008 iRex Technologies B.V. All rights reserved.
Definition at line 136 of file device_info.c.
References create_copyright_widgets(), create_device_info_widgets(), create_settingsview_for_type(), create_title(), g_frame, SETTING_DEVINFO, SMALL_SPACING, WINDOW_BORDER_PADDING, WINDOW_BOTTOM_PADDING, WINDOW_H_PADDING, and WINDOW_TOP_ALT_PADDING.
Referenced by create_concrete_win().
00137 { 00138 // create top window 00139 GtkWidget* top_window = parent; 00140 gtk_window_maximize(GTK_WINDOW(top_window)); 00141 gtk_window_set_resizable(GTK_WINDOW(top_window), FALSE); 00142 gtk_container_set_border_width(GTK_CONTAINER(top_window), WINDOW_BORDER_PADDING ); 00143 gtk_window_set_modal(GTK_WINDOW(top_window), TRUE); 00144 00145 00146 // top level vbox (vboxtop) 00147 GtkWidget* vboxtop = gtk_vbox_new(FALSE, 3); 00148 gtk_container_add(GTK_CONTAINER(top_window), vboxtop); 00149 00150 // add header container the title and subtitle of this settings page 00151 create_title(GTK_VBOX(vboxtop), _("Settings"), _("Device Information")); 00152 00153 // add the back/exit bar below the title 00154 GtkWidget* view = create_settingsview_for_type( SETTING_DEVINFO ); 00155 gtk_box_pack_start(GTK_BOX(vboxtop), view, FALSE, FALSE,0 ); 00156 00157 // add an alignment below the exit bar 00158 GtkWidget* alignment = gtk_alignment_new(0, 0, 1.0, 0.0); 00159 gtk_box_pack_start(GTK_BOX(vboxtop), alignment, FALSE, FALSE, 0); 00160 00161 // introdude a frame in the alignment 00162 GtkWidget* frame = gtk_frame_new(NULL); 00163 gtk_widget_set_name(frame, "irex-margins-frame"); 00164 gtk_container_add(GTK_CONTAINER(alignment), frame); 00165 gtk_container_set_border_width(GTK_CONTAINER(frame), 3); 00166 g_frame = frame ; 00167 00168 // alignment in frame 00169 GtkWidget* alignment2 = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); 00170 gtk_container_add(GTK_CONTAINER(frame), alignment2); 00171 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment2), 00172 WINDOW_TOP_ALT_PADDING, 00173 WINDOW_BOTTOM_PADDING, 00174 WINDOW_H_PADDING, 00175 WINDOW_H_PADDING); 00176 00177 // vbox in alignment2 00178 GtkWidget* innervbox = gtk_vbox_new(FALSE, SMALL_SPACING); 00179 gtk_container_add(GTK_CONTAINER(alignment2), innervbox); 00180 00181 // The device info section. 00182 create_device_info_widgets(GTK_BOX(innervbox)); 00183 00184 create_copyright_widgets(GTK_BOX(vboxtop)); 00185 00186 gtk_widget_grab_focus(view); 00187 00188 gtk_widget_show_all(top_window); 00189 return top_window; 00190 }
void load_device_info | ( | ) |
Definition at line 211 of file device_info.c.
References add_info_item(), get_file_content(), get_kernel_version(), GET_SYSSET_FILE, micro_sysfs_read(), and total_info_items.
Referenced by create_concrete_win().
00212 { 00213 total_info_items = 0; 00214 00215 // serial number 00216 add_info_item( 00217 _("Serial Number"), 00218 GET_SYSSET_FILE("fasm/serial")); 00219 00220 // product type 00221 add_info_item( 00222 _("Product Type"), 00223 g_strconcat( 00224 GET_SYSSET_FILE("fasm/category"), 00225 GET_SYSSET_FILE("fasm/model"), 00226 "-", 00227 GET_SYSSET_FILE("fasm/region"), 00228 NULL)); 00229 00230 #if MACHINE_IS_DR800S || MACHINE_IS_DR800SG || MACHINE_IS_DR800SW 00231 // pcba revision 00232 add_info_item( 00233 _("PCBA Revision"), 00234 micro_sysfs_read("pcba_rev")); 00235 00236 // pcba id 00237 add_info_item( 00238 _("PCBA ID"), 00239 micro_sysfs_read("mfg_serial")); 00240 #elif MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW 00241 // pcba revision 00242 add_info_item( 00243 _("PCBA Revision"), 00244 GET_SYSSET_FILE("mpcb/pcb_rev")); 00245 #else 00246 #error Unhandled machine type 00247 #endif 00248 00249 // epd id 00250 add_info_item( 00251 _("EPD ID"), 00252 g_strconcat( 00253 GET_SYSSET_FILE("display/fpl"), 00254 GET_SYSSET_FILE("display/waveform"), 00255 NULL)); 00256 00257 // software version 00258 add_info_item( 00259 _("Software Version"), 00260 get_file_content("/etc/er_version_commercial")); 00261 00262 // build number 00263 add_info_item( 00264 _("Software Build Number"), 00265 get_file_content("/etc/version")); 00266 00267 // kernel version 00268 add_info_item( 00269 _("Kernel Version"), 00270 get_kernel_version()); 00271 00272 #if MACHINE_IS_DR800S || MACHINE_IS_DR800SG || MACHINE_IS_DR800SW 00273 // micro boot version 00274 add_info_item( 00275 _("Micro Bootloader Version"), 00276 micro_sysfs_read("boot_ver")); 00277 #endif 00278 00279 // micro app version 00280 add_info_item( 00281 _("Micro Application Version"), 00282 micro_sysfs_read("micro_ver")); 00283 00284 #if MACHINE_IS_DR1000SW || MACHINE_IS_DR800SW 00285 // wifi mac 00286 add_info_item( 00287 _("WiFi MAC Address"), 00288 GET_SYSSET_FILE("wifi/address")); 00289 00290 // bluetooth mac 00291 add_info_item( 00292 _("Bluetooth MAC Address"), 00293 GET_SYSSET_FILE("bluetooth/address")); 00294 #endif 00295 00296 #if MACHINE_IS_DR800SG 00297 add_info_item( 00298 _("3G MEID"), 00299 GET_SYSSET_FILE("3g/meid")); 00300 add_info_item( 00301 _("3G IMEI"), 00302 GET_SYSSET_FILE("3g/imei")); 00303 #endif 00304 }