/* * gsat - a realtime satellite tracking graphical frontend to predict * * Copyright (C) 2001 by Xavier Crehueras, EB3CZS * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Look at the README for more information on the program. */ /* User preferences functions */ #include #include #include #include #include #include "support.h" #include "plugins.h" #include "globals.h" void open_preferences( void ) { char filename[256]; FILE * fd; int n, state; GtkWidget *widget; strncpy(filename,getenv("HOME"),256); strcat(filename,"/.gsat.prefs"); if((fd=fopen( filename, "r" ))==NULL) { strncpy(filename,GSATLIBDIR"/gsat.prefs",256); if((fd=fopen( filename, "r" ))==NULL) return; } prefs_grid[0]=fgetc(fd); prefs_utctime[0]=fgetc(fd); prefs_satfootprint[0]=fgetc(fd); prefs_qthfootprint[0]=fgetc(fd); prefs_track[0]=fgetc(fd); prefs_autofreq[0]=fgetc(fd); fgetc(fd); fgets(prefs_aos_command, 1024, fd); prefs_aos_command[strlen(prefs_aos_command)-1]='\0'; fgets(prefs_los_command, 1024, fd); prefs_los_command[strlen(prefs_los_command)-1]='\0'; fgets(prefs_down_plugin, 256, fd); prefs_down_plugin[strlen(prefs_down_plugin)-1]='\0'; fgets(prefs_down_plugin_config, 256, fd); prefs_down_plugin_config[strlen(prefs_down_plugin_config)-1]='\0'; fgets(prefs_up_plugin, 256, fd); prefs_up_plugin[strlen(prefs_up_plugin)-1]='\0'; fgets(prefs_up_plugin_config, 256, fd); prefs_up_plugin_config[strlen(prefs_up_plugin_config)-1]='\0'; fgets(prefs_beacon_plugin, 256, fd); prefs_beacon_plugin[strlen(prefs_beacon_plugin)-1]='\0'; fgets(prefs_beacon_plugin_config, 256, fd); prefs_beacon_plugin_config[strlen(prefs_beacon_plugin_config)-1]='\0'; fgets(prefs_rotor_plugin, 256, fd); prefs_rotor_plugin[strlen(prefs_rotor_plugin)-1]='\0'; fgets(prefs_rotor_plugin_config, 256, fd); prefs_rotor_plugin_config[strlen(prefs_rotor_plugin_config)-1]='\0'; fclose( fd ); if(strcmp(prefs_down_plugin, "None")!=0) for(n=0; n