sat-pref-predict.c
1 /* 2 Gpredict: Real-time satellite tracking and orbit prediction program 3 4 Copyright (C) 2001-2009 Alexandru Csete, OZ9AEC. 5 6 Authors: Alexandru Csete <oz9aec@gmail.com> 7 8 Comments, questions and bugreports should be submitted via 9 http://sourceforge.net/projects/gpredict/ 10 More details can be found at the project home page: 11 12 http://gpredict.oz9aec.net/ 13 14 This program is free software; you can redistribute it and/or modify 15 it under the terms of the GNU General Public License as published by 16 the Free Software Foundation; either version 2 of the License, or 17 (at your option) any later version. 18 19 This program is distributed in the hope that it will be useful, 20 but WITHOUT ANY WARRANTY; without even the implied warranty of 21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 GNU General Public License for more details. 23 24 You should have received a copy of the GNU General Public License 25 along with this program; if not, visit http://www.fsf.org/ 26 */ 27 #ifdef HAVE_CONFIG_H 28 #include <build-config.h> 29 #endif 30 #include <glib/gi18n.h> 31 #include <gtk/gtk.h> 32 33 #include "sat-cfg.h" 34 #include "sat-pref-conditions.h" 35 #include "sat-pref-multi-pass.h" 36 #include "sat-pref-predict.h" 37 #include "sat-pref-single-pass.h" 38 #include "sat-pref-sky-at-glance.h" 39 40 41 /** 42 * Create and initialise widgets for the predictor tab. 43 * 44 * The widgets must be preloaded with values from config. If a config value 45 * is NULL, sensible default values, eg. those from defaults.h should 46 * be loaded. 47 */ 48 GtkWidget *sat_pref_predict_create() 49 { 50 GtkWidget *nbook; 51 52 nbook = gtk_notebook_new(); 53 54 gtk_notebook_append_page(GTK_NOTEBOOK(nbook), 55 sat_pref_conditions_create(), 56 gtk_label_new(_("Pass Conditions"))); 57 gtk_notebook_append_page(GTK_NOTEBOOK(nbook), 58 sat_pref_multi_pass_create(), 59 gtk_label_new(_("Multiple Passes"))); 60 gtk_notebook_append_page(GTK_NOTEBOOK(nbook), 61 sat_pref_single_pass_create(), 62 gtk_label_new(_("Single Pass"))); 63 gtk_notebook_append_page(GTK_NOTEBOOK(nbook), 64 sat_pref_sky_at_glance_create(), 65 gtk_label_new(_("Sky at a Glance"))); 66 67 return nbook; 68 } 69 70 /** User pressed cancel. Any changes to config must be cancelled. */ 71 void sat_pref_predict_cancel() 72 { 73 sat_pref_conditions_cancel(); 74 sat_pref_multi_pass_cancel(); 75 sat_pref_single_pass_cancel(); 76 sat_pref_sky_at_glance_cancel(); 77 } 78 79 /** User pressed OK. Any changes should be stored in config. */ 80 void sat_pref_predict_ok() 81 { 82 sat_pref_conditions_ok(); 83 sat_pref_multi_pass_ok(); 84 sat_pref_single_pass_ok(); 85 sat_pref_sky_at_glance_ok(); 86 }