#include <gtk/gtk.h>
Go to the source code of this file.
Functions | |
GtkWidget * | create_advanced_window (GtkWidget *parent) |
void | load_advanced_settings () |
void | save_advanced_settings () |
GtkWidget* create_advanced_window | ( | GtkWidget * | parent | ) |
Copyright (C) 2010 IREX Technologies B.V. All rights reserved.
Definition at line 150 of file advanced.c.
References create_frame(), create_scribble_widgets(), create_sd_card_widgets(), create_settingsview(), create_thumbnail_widgets(), create_title(), create_zooming_widgets(), g_advanced_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().
00151 { 00152 // create top window 00153 GtkWidget* top_window = parent; 00154 gtk_window_maximize(GTK_WINDOW(top_window)); 00155 gtk_window_set_resizable(GTK_WINDOW(top_window), FALSE); 00156 gtk_container_set_border_width(GTK_CONTAINER(top_window),WINDOW_BORDER_PADDING ); 00157 gtk_window_set_modal(GTK_WINDOW(top_window), TRUE); 00158 00159 // top level vbox (vboxtop) 00160 GtkWidget* vboxtop = gtk_vbox_new(FALSE, 0); 00161 gtk_container_add(GTK_CONTAINER(top_window), vboxtop); 00162 00163 // add header container the title and subtitle of this settings page 00164 create_title(GTK_VBOX(vboxtop), _("Settings"), _("Advanced Settings")); 00165 00166 // add the back/exit bar below the title 00167 GtkWidget* view = create_settingsview(); 00168 gtk_box_pack_start(GTK_BOX(vboxtop), view, FALSE, FALSE,0 ); 00169 g_signal_connect(view, "row-activated", G_CALLBACK(on_listview_row_activated), NULL ) ; 00170 g_signal_connect(view, "navigate-cursor", G_CALLBACK(on_listview_navigate_cursor), NULL ) ; 00171 g_signal_connect(view, "focus-in-event", G_CALLBACK(on_focus_in), NULL ); 00172 g_signal_connect(view, "focus-out-event", G_CALLBACK(on_focus_out), NULL ); 00173 00174 00175 GtkWidget* vbox1 = GTK_WIDGET( create_frame(GTK_VBOX(vboxtop)) ); 00176 create_zooming_widgets(GTK_BOX(vbox1)); 00177 00178 GtkWidget* vbox2 = GTK_WIDGET( create_frame(GTK_VBOX(vboxtop)) ); 00179 create_scribble_widgets(GTK_BOX(vbox2)); 00180 00181 GtkWidget* vbox3 = GTK_WIDGET( create_frame(GTK_VBOX(vboxtop)) ); 00182 create_sd_card_widgets(GTK_BOX(vbox3)); 00183 00184 GtkWidget* vbox4 = GTK_WIDGET( create_frame(GTK_VBOX(vboxtop)) ); 00185 create_thumbnail_widgets(GTK_BOX(vbox4)); 00186 00187 // Update widget with current settings. 00188 init_widgets_with_settings(); 00189 00190 g_advanced_settings_window = top_window; 00191 00192 gtk_widget_grab_focus(view); 00193 00194 gtk_widget_show_all(top_window); 00195 return top_window; 00196 }
void load_advanced_settings | ( | ) |
Definition at line 112 of file advanced.c.
References AdvancedSettings::enable_scribble, AdvancedSettings::enable_sd_card, AdvancedSettings::enable_zooming, GCONF_ENABLE_SCRIBBLE, GCONF_ENABLE_SD_CARD, GCONF_ENABLE_ZOOMING, GCONF_INDEX_WITH_THUMBNAILS, get_value_bool(), AdvancedSettings::index_with_thumbnails, and LOGPRINTF.
Referenced by create_concrete_win().
00113 { 00114 g_original_settings.enable_zooming = get_value_bool(GCONF_ENABLE_ZOOMING); 00115 g_original_settings.enable_scribble = get_value_bool(GCONF_ENABLE_SCRIBBLE); 00116 g_original_settings.enable_sd_card = get_value_bool(GCONF_ENABLE_SD_CARD); 00117 g_original_settings.index_with_thumbnails = get_value_bool(GCONF_INDEX_WITH_THUMBNAILS); 00118 00119 g_current_settings = g_original_settings; 00120 00121 LOGPRINTF("Loading advanced settings, done."); 00122 }
void save_advanced_settings | ( | ) |
Definition at line 125 of file advanced.c.
References AdvancedSettings::enable_scribble, AdvancedSettings::enable_sd_card, AdvancedSettings::enable_zooming, GCONF_ENABLE_SCRIBBLE, GCONF_ENABLE_SD_CARD, GCONF_ENABLE_ZOOMING, GCONF_INDEX_WITH_THUMBNAILS, AdvancedSettings::index_with_thumbnails, LOGPRINTF, and set_value_bool().
Referenced by on_listview_row_activated().
00126 { 00127 if (g_current_settings.enable_zooming != g_original_settings.enable_zooming) 00128 { 00129 set_value_bool(GCONF_ENABLE_ZOOMING, g_current_settings.enable_zooming); 00130 } 00131 00132 if (g_current_settings.enable_scribble != g_original_settings.enable_scribble) 00133 { 00134 set_value_bool(GCONF_ENABLE_SCRIBBLE, g_current_settings.enable_scribble); 00135 } 00136 00137 if (g_current_settings.enable_sd_card != g_original_settings.enable_sd_card) 00138 { 00139 set_value_bool(GCONF_ENABLE_SD_CARD, g_current_settings.enable_sd_card); 00140 } 00141 00142 if (g_current_settings.index_with_thumbnails != g_original_settings.index_with_thumbnails) 00143 { 00144 set_value_bool(GCONF_INDEX_WITH_THUMBNAILS, g_current_settings.index_with_thumbnails); 00145 } 00146 00147 LOGPRINTF("Saving advanced settings, done."); 00148 }