From: Alexandru C. <cs...@us...> - 2002-06-30 15:48:36
|
Update of /cvsroot/groundstation/gpredict/src In directory usw-pr-cvs1:/tmp/cvs-serv18778 Modified Files: ChangeLog Makefile.am engine.c main.c qth.c qth.h Added Files: satconfig.c satconfig.h Log Message: Added satconfig files. --- NEW FILE: satconfig.c --- /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* satconfig.c: Configuration wizard for Gnome Predict. Available as of version 0.4 and obsoletes the newuser.c and newuser.h files. The idea is, that every separate module, which needs some initial configuration, is located in separate files and these files contain functions to create the required widgets, their callbacks and finally functions to store the configuration values. Copyright (C) 2002 Groundstation Software Suite Team. Authors: Alexandru Csete <cs...@us...> Comments, questions and bugreports should be submitted via http://sourceforge.net/projects/groundstation/ More details can be found at http://groundstation.sourceforge.net/ 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 */ #include <gnome.h> #include "satconfig.h" #ifdef HAVE_CONFIG_H # include "../config.h" #endif /* Provate function prototypes */ static GtkWidget *satconf_page_start (void); static GtkWidget *satconf_page_end (void); void satconfig_open () { /* This function should be called to create and open a new configuration druid. The druid will recycle existing configuration values, so it is safe to call it as a reconfiguration thingy (although the main purpose is to configure Gnome Predict when it is run or the first time. */ GtkWidget *druid,*druidwin; /* create the druid and the pages */ druid = gnome_druid_new (); gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (satconfig_page_start)); gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (satconfig_page_end)); druidwin = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_add (GTK_CONTAINER (druidwin), druid); gtk_widget_show_all (druidwin); } const gchar *welcome = { N_("We need some config stuff...") }; static GtkWidget *satconfig_page_start () { /* This function creates the start page in the configuration druid. */ GtkWidget *page; GdkImlibImage *logo,*mark; gchar *fname; /* create logo and watermark */ fname = g_strconcat (PACKAGE_PIXMAPS_DIR, G_DIR_SEPARATOR_S, "icons", G_DIR_SEPARATOR_S, "gpredict-icon.png",NULL); logo = gdk_imlib_load_image (logofile); g_free (logofile); mark = gdk_imlib_load_image ("/usr/share/gpredict/icons/radio.png"); page = gnome_druid_page_start_new_with_vals (_("Welcome to Gnome Predict !"), welcome, logo, mark); gdk_imlib_destroy_image (logo); gdk_imlib_destroy_image (mark); return page; } const gchar *end = { N_("Thanks for the config stuff...") }; static GtkWidget *satconfig_page_end () { /* This function creates the last page in the configuration druid. */ GtkWidget *page; GdkImlibImage *logo,*mark; gchar *fname; page = gnome_druid_page_end_new_with_vals (_("Configuration complete !"), end, logo, mark); return page; } --- NEW FILE: satconfig.h --- /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* satconfig.h: Configuration wizard for Gnome Predict. Available as of version 0.4 and obsoletes newuser.c and newuser.h Copyright (C) 2001, 2002 Groundstation Software Suite Team. Authors: Alexandru Csete <cs...@us...> Comments, questions and bugreports should be submitted via http://sourceforge.net/projects/groundstation/ More details can be found at http://groundstation.sourceforge.net/ 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 */ #ifndef SATCONFIG_H #define SATCONFIG_H void satconfig_open (void); #endif Index: ChangeLog =================================================================== RCS file: /cvsroot/groundstation/gpredict/src/ChangeLog,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** ChangeLog 28 Jun 2002 02:25:01 -0000 1.75 --- ChangeLog 30 Jun 2002 15:48:32 -0000 1.76 *************** *** 1,2 **** --- 1,9 ---- + 2002-06-29; Alexandru Csete <cs...@us...> + * qth.c, qth.h: Renamed qth_init to qth_init_old. New + qth_init function uses GConf! + * satconfig.c, satconfig.h: Added files. Will contain + new configuration wizard obsoleting newuser.c and + newuser.h + 2002-06-28; Alexandru Csete <cs...@us...> * iconbar-popup-menu.c: Added GNOMEUIINFO_SEPARATOR Index: Makefile.am =================================================================== RCS file: /cvsroot/groundstation/gpredict/src/Makefile.am,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Makefile.am 11 Apr 2002 21:37:25 -0000 1.51 --- Makefile.am 30 Jun 2002 15:48:32 -0000 1.52 *************** *** 39,43 **** satprint.c satprint.h \ satplot.c satplot.h \ ! satplot-print.c satplot-print.h ## This one goes bananas if the lib is not installed? --- 39,44 ---- satprint.c satprint.h \ satplot.c satplot.h \ ! satplot-print.c satplot-print.h \ ! satconfig.c satconfig.h ## This one goes bananas if the lib is not installed? Index: engine.c =================================================================== RCS file: /cvsroot/groundstation/gpredict/src/engine.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** engine.c 6 May 2002 21:05:55 -0000 1.39 --- engine.c 30 Jun 2002 15:48:32 -0000 1.40 *************** *** 83,87 **** sat_t *sat; ! if ( qth_init() ) return 1; --- 83,87 ---- sat_t *sat; ! if ( qth_init_old () ) return 1; Index: main.c =================================================================== RCS file: /cvsroot/groundstation/gpredict/src/main.c,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** main.c 15 Jun 2002 11:17:45 -0000 1.99 --- main.c 30 Jun 2002 15:48:32 -0000 1.100 *************** *** 52,55 **** --- 52,56 ---- #include "iconbar.h" #include "satmodules.h" + #include "satconfig.h" #ifdef HAVE_CONFIG_H *************** *** 183,186 **** --- 184,189 ---- /* reload "session" */ reopen_modules (); + + satconfig_open (); gtk_main (); Index: qth.c =================================================================== RCS file: /cvsroot/groundstation/gpredict/src/qth.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** qth.c 3 Apr 2002 13:12:02 -0000 1.3 --- qth.c 30 Jun 2002 15:48:32 -0000 1.4 *************** *** 29,32 **** --- 29,33 ---- #include <gnome.h> + #include <gconf/gconf-client.h> #include <stdio.h> #include "defaults.h" *************** *** 40,47 **** qth_struc qth; ! /* returns 1 on error */ ! gint qth_init() { FILE *qthf; --- 41,48 ---- qth_struc qth; ! extern GConfClient *client; /* returns 1 on error */ ! gint qth_init_old() { FILE *qthf; *************** *** 80,83 **** --- 81,108 ---- } + + gint qth_init (gchar *id) + { + /* This function reads the specified location of the + observer which is used by the tracking engine. The + id is 0 for the default location (the one that is + specified when the program is run for the first + time. Other id's can be specified on the command + line. + */ + + gchar *confpath,*key; + + if (id) + confpath = g_strconcat (QTH_ROOT_PATH, + G_DIR_SEPARATOR_S, + id, NULL); + else + confpath = g_strconcat (QTH_ROOT_PATH, + G_DIR_SEPARATOR_S, + "0", NULL); + g_free (confpath); + + } void qth_close() Index: qth.h =================================================================== RCS file: /cvsroot/groundstation/gpredict/src/qth.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** qth.h 3 Apr 2002 13:12:02 -0000 1.2 --- qth.h 30 Jun 2002 15:48:32 -0000 1.3 *************** *** 31,34 **** --- 31,37 ---- #define QTH_H + /* append the id to this one... */ + #define QTH_ROOT_PATH "/apps/gpredict/locations" + typedef struct _qth_struc { gchar *name; /* Name eg. Callsign */ *************** *** 42,47 **** ! gint qth_init( void ); ! void qth_close( void ); #endif --- 45,51 ---- ! gint qth_init_old (void); ! gint qth_init (gchar *); ! void qth_close (void); #endif |