From: Alexandru C. <cs...@us...> - 2007-02-04 21:23:48
|
Update of /cvsroot/groundstation/gpredict2/src In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv1103/src Modified Files: Makefile.am gtk-sat-module-popup.c sat-cfg.c sat-cfg.h Added Files: gtk-sky-glance.c gtk-sky-glance.h Log Message: Some preliminary work on the ksy at a glance function. --- NEW FILE: gtk-sky-glance.c --- /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* Gpredict: Real-time satellite tracking and orbit prediction program Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. Authors: Alexandru Csete <cs...@us...> Comments, questions and bugreports should be submitted via http://sourceforge.net/projects/groundstation/ More details can be found at the project home page: 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, visit http://www.fsf.org/ */ /** \brief Sky at a glance Widget. * * Note about the sizing policy: * Initially we require 30 pixels per sat + 5 pix margin between the sats. * Additionally. * * When we get additional space due to resizing, the space will be allocated * to make the rectangles taller. * */ #include <gtk/gtk.h> #include <glib/gi18n.h> #include "sgpsdp/sgp4sdp4.h" #include "sat-log.h" #include "config-keys.h" #include "sat-cfg.h" #include "mod-cfg-get-param.h" #include "time-tools.h" #include "sat-popup-menu.h" #include "gtk-sat-data.h" #include "gpredict-utils.h" #include "time-tools.h" //#include "gtk-sky-glance-popup.h" #include "gtk-sky-glance.h" #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <goocanvas.h> #define SKG_DEFAULT_WIDTH 600 #define SKG_DEFAULT_HEIGHT 300 #define SKG_PIX_PER_SAT 30 #define SKG_MARGIN 5 #define SKG_FOOTER 50 static void gtk_sky_glance_class_init (GtkSkyGlanceClass *class); static void gtk_sky_glance_init (GtkSkyGlance *skg); static void gtk_sky_glance_destroy (GtkObject *object); static void size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation, gpointer data); static gboolean on_motion_notify (GooCanvasItemView *view, GooCanvasItemView *target, GdkEventMotion *event, gpointer data); static void on_item_view_created (GooCanvasView *view, GooCanvasItemView *item_view, GooCanvasItem *item, gpointer data); static void on_canvas_realized (GtkWidget *canvas, gpointer data); static gboolean on_button_press (GooCanvasItemView *view, GooCanvasItemView *target, GdkEventButton *event, gpointer data); static gboolean on_button_release (GooCanvasItemView *view, GooCanvasItemView *target, GdkEventButton *event, gpointer data); static GooCanvasModelSimple* create_canvas_model (GtkSkyGlance *skg); static gdouble t2x (GtkSkyGlance *skg, gdouble t); static gdouble x2t (GtkSkyGlance *skg, gdouble x); static GtkVBoxClass *parent_class = NULL; GtkType gtk_sky_glance_get_type () { static GType gtk_sky_glance_type = 0; if (!gtk_sky_glance_type) { static const GTypeInfo gtk_sky_glance_info = { sizeof (GtkSkyGlanceClass), NULL, /* base init */ NULL, /* base finalise */ (GClassInitFunc) gtk_sky_glance_class_init, NULL, /* class finalise */ NULL, /* class data */ sizeof (GtkSkyGlance), 1, /* n_preallocs */ (GInstanceInitFunc) gtk_sky_glance_init, }; gtk_sky_glance_type = g_type_register_static (GTK_TYPE_VBOX, "GtkSkyGlance", >k_sky_glance_info, 0); } return gtk_sky_glance_type; } static void gtk_sky_glance_class_init (GtkSkyGlanceClass *class) { GObjectClass *gobject_class; GtkObjectClass *object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; gobject_class = G_OBJECT_CLASS (class); object_class = (GtkObjectClass*) class; widget_class = (GtkWidgetClass*) class; container_class = (GtkContainerClass*) class; parent_class = g_type_class_peek_parent (class); object_class->destroy = gtk_sky_glance_destroy; //widget_class->size_allocate = gtk_sky_glance_size_allocate; } static void gtk_sky_glance_init (GtkSkyGlance *skg) { skg->sats = NULL; skg->qth = NULL; skg->passes = NULL; skg->x0 = 0; skg->y0 = 0; skg->w = 0; skg->h = 0; skg->pps = 0; skg->ts = 0.0; skg->te = 0.0; } /* for some reason, this function is called twice when parent is destroyed. */ static void gtk_sky_glance_destroy (GtkObject *object) { (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); /* free satellites */ } /** \brief Create a new GtkSkyGlance widget. * \param sats Pointer to the hash table containing the asociated satellites. * \param qth Pointer to the ground station data. */ GtkWidget* gtk_sky_glance_new (GHashTable *sats, qth_t *qth) { GtkWidget *skg; GooCanvasModelSimple *canvas_model; GdkColor bg_color = {0, 0xFFFF, 0xFFFF, 0xFFFF}; guint height; skg = g_object_new (GTK_TYPE_SKY_GLANCE, NULL); /* FIXME */ GTK_SKY_GLANCE (skg)->sats = sats; GTK_SKY_GLANCE (skg)->qth = qth; /* get settings */ GTK_SKY_GLANCE (skg)->numsat = g_hash_table_size (sats); GTK_SKY_GLANCE (skg)->ts = get_current_daynum (); GTK_SKY_GLANCE (skg)->te = GTK_SKY_GLANCE (skg)->ts + sat_cfg_get_int (SAT_CFG_INT_SKYATGL_TIME)*(1.0/24.0); /* calculate preferred sizes */ GTK_SKY_GLANCE (skg)->w = SKG_DEFAULT_WIDTH; GTK_SKY_GLANCE (skg)->h = GTK_SKY_GLANCE (skg)->numsat * SKG_PIX_PER_SAT + (GTK_SKY_GLANCE (skg)->numsat + 1) * SKG_MARGIN; GTK_SKY_GLANCE (skg)->pps = SKG_PIX_PER_SAT; /* create the canvas */ GTK_SKY_GLANCE (skg)->canvas = goo_canvas_view_new (); gtk_widget_modify_base (GTK_SKY_GLANCE (skg)->canvas, GTK_STATE_NORMAL, &bg_color); gtk_widget_set_size_request (GTK_SKY_GLANCE (skg)->canvas, GTK_SKY_GLANCE (skg)->w, GTK_SKY_GLANCE (skg)->h + SKG_FOOTER); goo_canvas_view_set_bounds (GOO_CANVAS_VIEW (GTK_SKY_GLANCE (skg)->canvas), 0, 0, GTK_SKY_GLANCE (skg)->w, GTK_SKY_GLANCE (skg)->h + SKG_FOOTER); /* connect size-request signal */ g_signal_connect (GTK_SKY_GLANCE (skg)->canvas, "size-allocate", G_CALLBACK (size_allocate_cb), skg); g_signal_connect (GTK_SKY_GLANCE (skg)->canvas, "item_view_created", (GtkSignalFunc) on_item_view_created, skg); g_signal_connect_after (GTK_SKY_GLANCE (skg)->canvas, "realize", (GtkSignalFunc) on_canvas_realized, skg); gtk_widget_show (GTK_SKY_GLANCE (skg)->canvas); /* Create the canvas model */ canvas_model = create_canvas_model (GTK_SKY_GLANCE (skg)); goo_canvas_view_set_model (GOO_CANVAS_VIEW (GTK_SKY_GLANCE (skg)->canvas), GOO_CANVAS_MODEL (canvas_model)); g_object_unref (canvas_model); gtk_container_add (GTK_CONTAINER (skg), GTK_SKY_GLANCE (skg)->canvas); return skg; } static GooCanvasModelSimple * create_canvas_model (GtkSkyGlance *skg) { GooCanvasModelSimple *canvas_model; GooCanvasItem *root; GooCanvasItem *hrt,*hrl,*hrm; guint i,n; gdouble th,tm; time_t tt; gdouble xh,xm; gchar buff[3]; canvas_model = goo_canvas_model_simple_new (); root = goo_canvas_model_get_root_item (GOO_CANVAS_MODEL (canvas_model)); /* satellites */ /* cursor tracking line */ skg->cursor = goo_canvas_polyline_new_line (root, skg->x0, skg->y0, skg->x0, skg->h, "stroke-color-rgba", 0x0000005F, "line-width", 0.5, NULL); /* time label */ skg->timel = goo_canvas_text_new (root, "--:--", skg->x0 + 5, skg->y0, -1, GTK_ANCHOR_NW, "font", "Sans 8", "fill-color-rgba", 0x0000005F, NULL); /* footer */ skg->footer = goo_canvas_rect_new (root, skg->x0, skg->h, skg->w, SKG_FOOTER, "fill-color-rgba", 0x000000FF, "stroke-color-rgba", 0xFFFFFFFF, NULL); /* time ticks and labels */ skg->axisl = goo_canvas_text_new (root, _("TIME"), skg->w / 2, skg->h + SKG_FOOTER - 5, -1, GTK_ANCHOR_S, "font", "Sans 9", "fill-color-rgba", 0xFFFFFFFF, NULL); /* get the first hour and first 30 min slot */ /*** FIXME: still a little rough because of rounding errors */ th = ceil (skg->ts * 24.0) / 24.0; /* the first 30 min tick can be either before or after the first hour tick */ if ((th - skg->ts) > 0.02083) { tm = th - 0.02083; } else { tm = th + 0.02083; } /* the number of steps equals the number of hours */ n = sat_cfg_get_int (SAT_CFG_INT_SKYATGL_TIME); for (i = 0; i < n; i++) { /* hour tick */ xh = t2x (skg, th); hrt = goo_canvas_polyline_new_line (root, xh, skg->h, xh, skg->h + 10, "stroke-color-rgba", 0xFFFFFFFF, NULL); /* hour tick label */ tt = (th - 2440587.5)*86400.; if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME)) strftime (buff, 3, "%H", localtime (&tt)); else strftime (buff, 3, "%H", gmtime (&tt)); buff[2] = '\0'; hrl = goo_canvas_text_new (root, buff, xh, skg->h + 12, -1, GTK_ANCHOR_N, "font", "Sans 8", "fill-color-rgba", 0xFFFFFFFF, NULL); /* 30 min tick */ xm = t2x (skg, tm); hrm = goo_canvas_polyline_new_line (root, xm, skg->h, xm, skg->h + 5, "stroke-color-rgba", 0xFFFFFFFF, NULL); /* store canvas items */ skg->majors = g_slist_append (skg->majors, hrt); skg->labels = g_slist_append (skg->labels, hrl); skg->minors = g_slist_append (skg->minors, hrm); th += 0.04167; tm += 0.04167; } return canvas_model; } /** \brief Manage new size allocation. * * This function is called when the canvas receives a new size allocation, * e.g. when the container is re-sized. The function re-calculates the graph * dimensions based on the new canvas size. */ static void size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation, gpointer data) { GtkSkyGlance *skg; GooCanvasPoints *pts; GooCanvasItem *obj; guint i,n; gdouble th,tm; time_t tt; gdouble xh,xm; if (GTK_WIDGET_REALIZED (widget)) { /* get graph dimensions */ skg = GTK_SKY_GLANCE (data); skg->w = allocation->width; skg->h = allocation->height - SKG_FOOTER; skg->x0 = 0; skg->y0 = 0; skg->pps = (skg->h - SKG_MARGIN) / skg->numsat - SKG_MARGIN; /* update cursor tracking line */ pts = goo_canvas_points_new (2); pts->coords[0] = skg->x0; pts->coords[1] = skg->y0; pts->coords[2] = skg->x0; pts->coords[3] = skg->h; g_object_set (skg->cursor, "points", pts, NULL); goo_canvas_points_unref (pts); /* time label */ g_object_set (skg->timel, "x", (gdouble) skg->x0 + 5, NULL); /* update footer */ g_object_set (skg->footer, "x", (gdouble) skg->x0, "y", (gdouble) skg->h, "width", (gdouble) skg->w, "height", (gdouble) SKG_FOOTER, NULL); g_object_set (skg->axisl, "x", (gdouble) (skg->w / 2), "y", (gdouble) (skg->h + SKG_FOOTER - 5), NULL); /* get the first hour and first 30 min slot */ th = ceil (skg->ts * 24.0) / 24.0; if ((th - skg->ts) > 0.02083) { tm = th - 0.02083; } else { tm = th + 0.02083; } /* the number of steps equals the number of hours */ n = sat_cfg_get_int (SAT_CFG_INT_SKYATGL_TIME); for (i = 0; i < n; i++) { xh = t2x (skg, th); pts = goo_canvas_points_new (2); pts->coords[0] = xh; pts->coords[1] = skg->h; pts->coords[2] = xh; pts->coords[3] = skg->h + 10; obj = GOO_CANVAS_ITEM (g_slist_nth_data (skg->majors, i)); g_object_set (obj, "points", pts, NULL); goo_canvas_points_unref (pts); obj = GOO_CANVAS_ITEM (g_slist_nth_data (skg->labels, i)); g_object_set (obj, "x", (gdouble) xh, "y", (gdouble) (skg->h + 12), NULL); /* 30 min tick */ xm = t2x (skg, tm); pts = goo_canvas_points_new (2); pts->coords[0] = xm; pts->coords[1] = skg->h; pts->coords[2] = xm; pts->coords[3] = skg->h + 5; obj = GOO_CANVAS_ITEM (g_slist_nth_data (skg->minors, i)); g_object_set (obj, "points", pts, NULL); goo_canvas_points_unref (pts); th += 0.04167; tm += 0.04167; } } } /** \brief Manage canvas realise signals. * * This function is used to re-initialise the graph dimensions when * the graph is realized, i.e. displayed for the first time. This is * necessary in order to compensate for missing "re-allocate" signals for * graphs that have not yet been realised, e.g. when opening several module */ static void on_canvas_realized (GtkWidget *canvas, gpointer data) { GtkAllocation aloc; aloc.width = canvas->allocation.width; aloc.height = canvas->allocation.height; size_allocate_cb (canvas, &aloc, data); } /** \brief Manage mouse motion events. */ static gboolean on_motion_notify (GooCanvasItemView *view, GooCanvasItemView *target, GdkEventMotion *event, gpointer data) { GtkSkyGlance *skg = GTK_SKY_GLANCE (data); GooCanvasPoints *pts; gdouble t; time_t tt; gchar buff[6]; /* update cursor tracking line and time label */ pts = goo_canvas_points_new (2); pts->coords[0] = event->x; pts->coords[1] = skg->y0; pts->coords[2] = event->x; pts->coords[3] = skg->h; g_object_set (skg->cursor, "points", pts, NULL); goo_canvas_points_unref (pts); /* get time corresponding to x */ t = x2t (skg, event->x); /* convert julian date to struct tm */ tt = (t - 2440587.5)*86400.; /* format either local time or UTC depending on check box */ if (sat_cfg_get_bool (SAT_CFG_BOOL_USE_LOCAL_TIME)) strftime (buff, 6, "%H:%M", localtime (&tt)); else strftime (buff, 6, "%H:%M", gmtime (&tt)); buff[5] = '\0'; /* in order to avoid label clipping close to the edges of the chart, the label is placed left/right of the cursor tracking line depending on which half we are in. */ if (event->x > (skg->w / 2)) { g_object_set (skg->timel, "text", buff, "x", (gdouble) event->x - 5, "anchor", GTK_ANCHOR_NE, NULL); } else { g_object_set (skg->timel, "text", buff, "x", (gdouble) event->x + 5, "anchor", GTK_ANCHOR_NW, NULL); } return TRUE; } /** \brief Finish canvas item setup. * \param view * \param item_view * \param item * \param data Pointer to the GtkSkyGlance object. * * This function is called when a canvas item is created. Its purpose is to connect * the corresponding signals to the created items. */ static void on_item_view_created (GooCanvasView *view, GooCanvasItemView *item_view, GooCanvasItem *item, gpointer data) { if (!goo_canvas_item_get_parent (item)) { /* root item / canvas */ g_signal_connect (item_view, "motion_notify_event", (GtkSignalFunc) on_motion_notify, data); } else if (!g_object_get_data (G_OBJECT (item), "skip-signal-connection")) { g_signal_connect (item_view, "button_press_event", (GtkSignalFunc) on_button_press, data); g_signal_connect (item_view, "button_release_event", (GtkSignalFunc) on_button_release, data); } } /** \brief Manage button press events * * This function is called when a mouse button is pressed on a satellite object. * If the pressed button is #3 (right button) the satellite popup menu will be * created and executed. */ static gboolean on_button_press (GooCanvasItemView *view, GooCanvasItemView *target, GdkEventButton *event, gpointer data) { GooCanvasItem *item = goo_canvas_item_view_get_item (view); GtkSkyGlance *skg = GTK_SKY_GLANCE (data); switch (event->button) { /* pop-up menu */ case 3: break; default: break; } return TRUE; } /** \brief Manage button release events. * * This function is called when the mouse button is released above * a satellite object. It will act as a button click and if the relesed * button is the left one, the clock will correspond to selecting or * deselecting a satellite */ static gboolean on_button_release (GooCanvasItemView *view, GooCanvasItemView *target, GdkEventButton *event, gpointer data) { GooCanvasItem *item = goo_canvas_item_view_get_item (view); GtkSkyGlance *skg = GTK_SKY_GLANCE (data); switch (event->button) { /* Select / de-select satellite */ case 1: break; default: break; } return TRUE; } /** \brief Convert time value to x position. * \param skg The GtkSkyGlance widget. * \param t Julian date * \return X coordinate. * * No error checking is made to ensure that we are within visible range. * */ static gdouble t2x (GtkSkyGlance *skg, gdouble t) { gdouble frac; frac = (t - skg->ts) / (skg->te - skg->ts); return (skg->x0 + frac * skg->w); } /** \brief Convert x coordinate to Julian date. * \param skg The GtkSkyGlance widget. * \param x The X coordinate. * \return The Julian date corresponding to X. * * No error checking is made to ensure that we are within visible range. * */ static gdouble x2t (GtkSkyGlance *skg, gdouble x) { gdouble frac; frac = (x - skg->x0) / skg->w; return (skg->ts + frac * (skg->te - skg->ts)); } --- NEW FILE: gtk-sky-glance.h --- /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* Gpredict: Real-time satellite tracking and orbit prediction program Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. Authors: Alexandru Csete <cs...@us...> Comments, questions and bugreports should be submitted via http://sourceforge.net/projects/groundstation/ More details can be found at the project home page: 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, visit http://www.fsf.org/ */ #ifndef __GTK_SKY_GLANCE_H__ #define __GTK_SKY_GLANCE_H__ 1 #include <glib.h> #include <glib/gi18n.h> #include <gdk/gdk.h> #include <gtk/gtkwidget.h> #include <gtk/gtkvbox.h> #include "gtk-sat-data.h" #include "predict-tools.h" #include <goocanvas.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define GTK_SKY_GLANCE(obj) GTK_CHECK_CAST (obj, gtk_sky_glance_get_type (), GtkSkyGlance) #define GTK_SKY_GLANCE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_sky_glance_get_type (), GtkSkyGlanceClass) #define GTK_IS_SKY_GLANCE(obj) GTK_CHECK_TYPE (obj, gtk_sky_glance_get_type ()) #define GTK_TYPE_SKY_GLANCE (gtk_sky_glance_get_type ()) #define IS_GTK_SKY_GLANCE(obj) GTK_CHECK_TYPE (obj, gtk_sky_glance_get_type ()) typedef struct _GtkSkyGlance GtkSkyGlance; typedef struct _GtkSkyGlanceClass GtkSkyGlanceClass; /** \brief Satellite object on graph. */ typedef struct { guint catnum; /*!< Catalogue number of satellite */ pass_t *pass; /*!< Details of the corresponding pass. */ GooCanvasItem *box; /*!< Canvas item showing the pass */ } sky_pass_t; #define SKY_PASS_T(obj) ((sky_pass_t *)obj) struct _GtkSkyGlance { GtkVBox vbox; GtkWidget *canvas; /*!< The canvas widget */ GHashTable *sats; /*!< Copy of satellites. */ qth_t *qth; /*!< Pointer to current location. */ GSList *passes; /*!< Canvas items representing each pass */ guint x0; /*!< X0 */ guint y0; /*!< Y0 */ guint w; /*!< width of the plot */ guint h; /*!< height of the plot */ guint pps; /*!< pixels per satellite */ guint numsat; /*!< Number of satellites */ gdouble ts,te; /*!< Start and end times (Julian date) */ GSList *majors; /*!< Major ticks for every hour */ GSList *minors; /*!< Minor ticks for every 30 min */ GSList *labels; /*!< Tick labels for every hour */ GooCanvasItem *footer; /*!< Footer area with time ticks and labels */ GooCanvasItem *axisl; /*!< Axis label */ GooCanvasItem *cursor; /*!< Vertical line tracking the cursor */ GooCanvasItem *timel; /*!< Label showinf time under cursor */ }; struct _GtkSkyGlanceClass { GtkVBoxClass parent_class; }; GtkType gtk_sky_glance_get_type (void); GtkWidget* gtk_sky_glance_new (GHashTable *sats, qth_t *qth); /* void gtk_sky_glance_reconf (GtkWidget *skg); void gtk_sky_glance_reload_sats (GtkWidget *skg, GHashTable *sats); */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __GTK_SKY_GLANCE_H__ */ Index: Makefile.am =================================================================== RCS file: /cvsroot/groundstation/gpredict2/src/Makefile.am,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Makefile.am 3 Jan 2007 08:30:26 -0000 1.60 --- Makefile.am 4 Feb 2007 21:23:35 -0000 1.61 *************** *** 45,48 **** --- 45,49 ---- gtk-sat-tree.c gtk-sat-tree.h \ gtk-single-sat.c gtk-single-sat.h \ + gtk-sky-glance.c gtk-sky-glance.h \ gui.c gui.h \ loc-tree.c loc-tree.h \ Index: gtk-sat-module-popup.c =================================================================== RCS file: /cvsroot/groundstation/gpredict2/src/gtk-sat-module-popup.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** gtk-sat-module-popup.c 2 Sep 2006 14:56:18 -0000 1.14 --- gtk-sat-module-popup.c 4 Feb 2007 21:23:35 -0000 1.15 *************** *** 34,37 **** --- 34,38 ---- #include "mod-mgr.h" #include "compat.h" + #include "gtk-sky-glance.h" #ifdef HAVE_CONFIG_H # include <config.h> *************** *** 50,54 **** static void close_cb (GtkWidget *menuitem, gpointer data); static void name_changed (GtkWidget *widget, gpointer data); ! --- 51,55 ---- static void close_cb (GtkWidget *menuitem, gpointer data); static void name_changed (GtkWidget *widget, gpointer data); ! static gint window_delete (GtkWidget *widget, GdkEvent *event, gpointer data); *************** *** 74,79 **** if ((module == NULL) || !IS_GTK_SAT_MODULE (module)) { sat_log_log (SAT_LOG_LEVEL_BUG, ! _("%s:%d: %s called with NULL parameter!"), ! __FILE__, __LINE__, __FUNCTION__); return; --- 75,80 ---- if ((module == NULL) || !IS_GTK_SAT_MODULE (module)) { sat_log_log (SAT_LOG_LEVEL_BUG, ! _("%s:%d: %s called with NULL parameter!"), ! __FILE__, __LINE__, __FUNCTION__); return; *************** *** 91,95 **** gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (docking_state_cb), module); } else { --- 92,96 ---- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (docking_state_cb), module); } else { *************** *** 102,106 **** gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (docking_state_cb), module); } --- 103,107 ---- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (docking_state_cb), module); } *************** *** 110,127 **** menuitem = gtk_image_menu_item_new_with_label (_("Leave fullscreen")); image = gtk_image_new_from_stock (GTK_STOCK_LEAVE_FULLSCREEN, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (screen_state_cb), module); } else { menuitem = gtk_image_menu_item_new_with_label (_("Fullscreen")); image = gtk_image_new_from_stock (GTK_STOCK_FULLSCREEN, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (screen_state_cb), module); } --- 111,128 ---- menuitem = gtk_image_menu_item_new_with_label (_("Leave fullscreen")); image = gtk_image_new_from_stock (GTK_STOCK_LEAVE_FULLSCREEN, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (screen_state_cb), module); } else { menuitem = gtk_image_menu_item_new_with_label (_("Fullscreen")); image = gtk_image_new_from_stock (GTK_STOCK_FULLSCREEN, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (screen_state_cb), module); } *************** *** 134,153 **** menuitem = gtk_image_menu_item_new_with_label (_("Configure")); image = gtk_image_new_from_stock (GTK_STOCK_PROPERTIES, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (config_cb), module); /* clone */ menuitem = gtk_image_menu_item_new_with_label (_("Clone...")); image = gtk_image_new_from_stock (GTK_STOCK_COPY, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (clone_cb), module); - #if 0 /* separator */ menuitem = gtk_separator_menu_item_new (); --- 135,153 ---- menuitem = gtk_image_menu_item_new_with_label (_("Configure")); image = gtk_image_new_from_stock (GTK_STOCK_PROPERTIES, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (config_cb), module); /* clone */ menuitem = gtk_image_menu_item_new_with_label (_("Clone...")); image = gtk_image_new_from_stock (GTK_STOCK_COPY, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (clone_cb), module); /* separator */ menuitem = gtk_separator_menu_item_new (); *************** *** 162,167 **** gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (sky_at_glance_cb), module); ! #endif /* separator */ --- 162,166 ---- gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (sky_at_glance_cb), module); /* separator */ *************** *** 172,194 **** menuitem = gtk_image_menu_item_new_with_label (_("Delete")); image = gtk_image_new_from_stock (GTK_STOCK_DELETE, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (delete_cb), module); /* close */ menuitem = gtk_image_menu_item_new_with_label (_("Close")); image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (close_cb), module); gtk_widget_show_all (menu); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, ! 0, gdk_event_get_time (NULL)); } --- 171,193 ---- menuitem = gtk_image_menu_item_new_with_label (_("Delete")); image = gtk_image_new_from_stock (GTK_STOCK_DELETE, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (delete_cb), module); /* close */ menuitem = gtk_image_menu_item_new_with_label (_("Close")); image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, ! GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menuitem); g_signal_connect (menuitem, "activate", ! G_CALLBACK (close_cb), module); gtk_widget_show_all (menu); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, ! 0, gdk_event_get_time (NULL)); } *************** *** 236,247 **** dialog = gtk_dialog_new_with_buttons (_("Clone Module"), ! GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (module))), ! GTK_DIALOG_MODAL | ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_STOCK_CANCEL, ! GTK_RESPONSE_CANCEL, ! GTK_STOCK_OK, ! GTK_RESPONSE_OK, ! NULL); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); --- 235,246 ---- dialog = gtk_dialog_new_with_buttons (_("Clone Module"), ! GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (module))), ! GTK_DIALOG_MODAL | ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_STOCK_CANCEL, ! GTK_RESPONSE_CANCEL, ! GTK_STOCK_OK, ! GTK_RESPONSE_OK, ! NULL); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); *************** *** 256,264 **** tooltips = gtk_tooltips_new (); gtk_tooltips_set_tip (tooltips, entry, ! _("Enter a short name for this module.\n"\ ! "Allowed charachters: 0..9, a..z, A..Z, - and _"), ! _("The name will be used to identify the module "\ ! "and it is also used a file name for saving the data."\ ! "Max length is 25 charachters.")); /* attach changed signal so that we can enable OK button when --- 255,263 ---- tooltips = gtk_tooltips_new (); gtk_tooltips_set_tip (tooltips, entry, ! _("Enter a short name for this module.\n"\ ! "Allowed charachters: 0..9, a..z, A..Z, - and _"), ! _("The name will be used to identify the module "\ ! "and it is also used a file name for saving the data."\ ! "Max length is 25 charachters.")); /* attach changed signal so that we can enable OK button when *************** *** 267,275 **** */ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), ! GTK_RESPONSE_OK, ! FALSE); g_signal_connect (entry, "changed", G_CALLBACK (name_changed), dialog); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), ! entry, FALSE, FALSE, 0); --- 266,274 ---- */ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), ! GTK_RESPONSE_OK, ! FALSE); g_signal_connect (entry, "changed", G_CALLBACK (name_changed), dialog); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), ! entry, FALSE, FALSE, 0); *************** *** 279,287 **** tooltips = gtk_tooltips_new (); gtk_tooltips_set_tip (tooltips, toggle, ! _("If checked, the new module will be opened "\ ! "after it has been created"), ! NULL); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), ! toggle, FALSE, FALSE, 20); --- 278,286 ---- tooltips = gtk_tooltips_new (); gtk_tooltips_set_tip (tooltips, toggle, ! _("If checked, the new module will be opened "\ ! "after it has been created"), ! NULL); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), ! toggle, FALSE, FALSE, 20); *************** *** 295,323 **** case GTK_RESPONSE_OK: sat_log_log (SAT_LOG_LEVEL_MSG, ! _("%s:%d: Cloning %s => %s"), ! __FILE__, __LINE__, module->name, ! gtk_entry_get_text (GTK_ENTRY (entry))); /* build full file names */ source = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ! ".gpredict2", G_DIR_SEPARATOR_S, ! "modules", G_DIR_SEPARATOR_S, ! module->name, ".mod", NULL); target = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ! ".gpredict2", G_DIR_SEPARATOR_S, ! "modules", G_DIR_SEPARATOR_S, ! gtk_entry_get_text (GTK_ENTRY (entry)), ! ".mod", NULL); /* copy file */ if (gpredict_file_copy (source, target)) { sat_log_log (SAT_LOG_LEVEL_ERROR, ! _("%s:%d: Failed to clone %s."), ! __FILE__, __LINE__, module->name); } else { sat_log_log (SAT_LOG_LEVEL_MSG, ! _("%s:%d: Successfully cloned %s."), ! __FILE__, __LINE__, module->name); /* open module if requested */ --- 294,322 ---- case GTK_RESPONSE_OK: sat_log_log (SAT_LOG_LEVEL_MSG, ! _("%s:%d: Cloning %s => %s"), ! __FILE__, __LINE__, module->name, ! gtk_entry_get_text (GTK_ENTRY (entry))); /* build full file names */ source = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ! ".gpredict2", G_DIR_SEPARATOR_S, ! "modules", G_DIR_SEPARATOR_S, ! module->name, ".mod", NULL); target = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ! ".gpredict2", G_DIR_SEPARATOR_S, ! "modules", G_DIR_SEPARATOR_S, ! gtk_entry_get_text (GTK_ENTRY (entry)), ! ".mod", NULL); /* copy file */ if (gpredict_file_copy (source, target)) { sat_log_log (SAT_LOG_LEVEL_ERROR, ! _("%s:%d: Failed to clone %s."), ! __FILE__, __LINE__, module->name); } else { sat_log_log (SAT_LOG_LEVEL_MSG, ! _("%s:%d: Successfully cloned %s."), ! __FILE__, __LINE__, module->name); /* open module if requested */ *************** *** 338,347 **** newmod->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (newmod->win), ! newmod->name); /* use size of source module */ gtk_window_set_default_size (GTK_WINDOW (newmod->win), ! GTK_WIDGET (module)->allocation.width, ! GTK_WIDGET (module)->allocation.height); /** FIXME: window icon and such */ --- 337,346 ---- newmod->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (newmod->win), ! newmod->name); /* use size of source module */ gtk_window_set_default_size (GTK_WINDOW (newmod->win), ! GTK_WIDGET (module)->allocation.width, ! GTK_WIDGET (module)->allocation.height); /** FIXME: window icon and such */ *************** *** 349,353 **** /* add module to window */ gtk_container_add (GTK_CONTAINER (newmod->win), ! GTK_WIDGET (newmod)); if (newmod->state == GTK_SAT_MOD_STATE_FULLSCREEN) { --- 348,352 ---- /* add module to window */ gtk_container_add (GTK_CONTAINER (newmod->win), ! GTK_WIDGET (newmod)); if (newmod->state == GTK_SAT_MOD_STATE_FULLSCREEN) { *************** *** 370,381 **** case GTK_RESPONSE_CANCEL: sat_log_log (SAT_LOG_LEVEL_MSG, ! _("%s:%d: Cloning cancelled by user."), ! __FILE__, __LINE__); break; default: sat_log_log (SAT_LOG_LEVEL_MSG, ! _("%s:%d: Cloning interrupted."), ! __FILE__, __LINE__); break; } --- 369,380 ---- case GTK_RESPONSE_CANCEL: sat_log_log (SAT_LOG_LEVEL_MSG, ! _("%s:%d: Cloning cancelled by user."), ! __FILE__, __LINE__); break; default: sat_log_log (SAT_LOG_LEVEL_MSG, ! _("%s:%d: Cloning interrupted."), ! __FILE__, __LINE__); break; } *************** *** 425,429 **** GTK_SAT_MODULE (module)->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (GTK_SAT_MODULE (module)->win), ! GTK_SAT_MODULE (module)->name); gtk_window_set_default_size (GTK_WINDOW (GTK_SAT_MODULE (module)->win), w, h); --- 424,428 ---- GTK_SAT_MODULE (module)->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (GTK_SAT_MODULE (module)->win), ! GTK_SAT_MODULE (module)->name); gtk_window_set_default_size (GTK_WINDOW (GTK_SAT_MODULE (module)->win), w, h); *************** *** 456,460 **** } else if ((GTK_SAT_MODULE (module)->layout == GTK_SAT_MOD_LAYOUT_3) || ! (GTK_SAT_MODULE (module)->layout == GTK_SAT_MOD_LAYOUT_4)) { GTK_SAT_MODULE (module)->vpanedpos = gtk_paned_get_position (GTK_PANED (GTK_SAT_MODULE (module)->vpaned)); --- 455,459 ---- } else if ((GTK_SAT_MODULE (module)->layout == GTK_SAT_MOD_LAYOUT_3) || ! (GTK_SAT_MODULE (module)->layout == GTK_SAT_MOD_LAYOUT_4)) { GTK_SAT_MODULE (module)->vpanedpos = gtk_paned_get_position (GTK_PANED (GTK_SAT_MODULE (module)->vpaned)); *************** *** 482,487 **** sat_log_log (SAT_LOG_LEVEL_BUG, ! _("%s:%d: Unknown module satate: %d"), ! __FILE__, __LINE__, GTK_SAT_MODULE (module)->state); break; --- 481,486 ---- sat_log_log (SAT_LOG_LEVEL_BUG, ! _("%s:%d: Unknown module satate: %d"), ! __FILE__, __LINE__, GTK_SAT_MODULE (module)->state); break; *************** *** 521,525 **** GTK_SAT_MODULE (module)->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (GTK_SAT_MODULE (module)->win), ! GTK_SAT_MODULE (module)->name); /* add module to window */ --- 520,524 ---- GTK_SAT_MODULE (module)->win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (GTK_SAT_MODULE (module)->win), ! GTK_SAT_MODULE (module)->name); /* add module to window */ *************** *** 561,565 **** } else if ((GTK_SAT_MODULE (module)->layout == GTK_SAT_MOD_LAYOUT_3) || ! (GTK_SAT_MODULE (module)->layout == GTK_SAT_MOD_LAYOUT_4)) { GTK_SAT_MODULE (module)->vpanedpos = gtk_paned_get_position (GTK_PANED (GTK_SAT_MODULE (module)->vpaned)); --- 560,564 ---- } else if ((GTK_SAT_MODULE (module)->layout == GTK_SAT_MOD_LAYOUT_3) || ! (GTK_SAT_MODULE (module)->layout == GTK_SAT_MOD_LAYOUT_4)) { GTK_SAT_MODULE (module)->vpanedpos = gtk_paned_get_position (GTK_PANED (GTK_SAT_MODULE (module)->vpaned)); *************** *** 576,581 **** sat_log_log (SAT_LOG_LEVEL_BUG, ! _("%s:%d: Unknown module satate: %d"), ! __FILE__, __LINE__, GTK_SAT_MODULE (module)->state); break; --- 575,580 ---- sat_log_log (SAT_LOG_LEVEL_BUG, ! _("%s:%d: Unknown module satate: %d"), ! __FILE__, __LINE__, GTK_SAT_MODULE (module)->state); break; *************** *** 594,598 **** sky_at_glance_cb (GtkWidget *menuitem, gpointer data) { ! g_print ("FIXME: SKY_AT_GLANCE not implemented\n"); } --- 593,622 ---- sky_at_glance_cb (GtkWidget *menuitem, gpointer data) { ! GtkSatModule *module = GTK_SAT_MODULE (data); ! GtkWidget *skg; ! GtkWidget *window; ! gchar *buff; ! ! ! /* create window */ ! window = gtk_window_new (GTK_WINDOW_TOPLEVEL); ! buff = g_strdup_printf (_("The sky at a glance (%s)"), module->name); ! gtk_window_set_title (GTK_WINDOW (window), buff); ! g_free (buff); ! g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (window_delete), NULL); ! ! /* window icon */ ! buff = icon_file_name ("gpredict-planner.png"); ! gtk_window_set_icon_from_file (GTK_WINDOW (window), buff, NULL); ! g_free (buff); ! ! /* create sky at a glance widget */ ! skg = gtk_sky_glance_new (module->satellites, module->qth); ! ! gtk_container_set_border_width (GTK_CONTAINER (window), 10); ! gtk_container_add (GTK_CONTAINER (window), skg); ! ! gtk_widget_show_all (window); ! } *************** *** 627,633 **** file = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ! ".gpredict2", G_DIR_SEPARATOR_S, ! "modules", G_DIR_SEPARATOR_S, ! GTK_SAT_MODULE (data)->name, ".mod", NULL); gtk_sat_module_close_cb (menuitem, data); --- 651,657 ---- file = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ! ".gpredict2", G_DIR_SEPARATOR_S, ! "modules", G_DIR_SEPARATOR_S, ! GTK_SAT_MODULE (data)->name, ".mod", NULL); gtk_sat_module_close_cb (menuitem, data); *************** *** 650,660 **** if (g_remove (file)) { sat_log_log (SAT_LOG_LEVEL_ERROR, ! _("%s:%d: Failed to delete %s."), ! __FILE__, __LINE__, file); } else { sat_log_log (SAT_LOG_LEVEL_ERROR, ! _("%s:%d: %s deleted permanently."), ! __FILE__, __LINE__, file); } break; --- 674,684 ---- if (g_remove (file)) { sat_log_log (SAT_LOG_LEVEL_ERROR, ! _("%s:%d: Failed to delete %s."), ! __FILE__, __LINE__, file); } else { sat_log_log (SAT_LOG_LEVEL_ERROR, ! _("%s:%d: %s deleted permanently."), ! __FILE__, __LINE__, file); } break; *************** *** 686,714 **** /* step 1: ensure that only valid characters are entered ! (stolen from xlog, tnx pg4i) */ entry = gtk_editable_get_chars (GTK_EDITABLE (widget), 0, -1); if ((len = g_utf8_strlen (entry, -1)) > 0) - { - end = entry + g_utf8_strlen (entry, -1); - for (j = entry; j < end; ++j) { ! switch (*j) ! { ! case '0' ... '9': ! case 'a' ... 'z': ! case 'A' ... 'Z': ! case '-': ! case '_': ! break; ! default: ! gdk_beep (); ! pos = gtk_editable_get_position (GTK_EDITABLE (widget)); ! gtk_editable_delete_text (GTK_EDITABLE (widget), ! pos, pos+1); ! break; ! } } - } --- 710,738 ---- /* step 1: ensure that only valid characters are entered ! (stolen from xlog, tnx pg4i) */ entry = gtk_editable_get_chars (GTK_EDITABLE (widget), 0, -1); if ((len = g_utf8_strlen (entry, -1)) > 0) { ! end = entry + g_utf8_strlen (entry, -1); ! for (j = entry; j < end; ++j) ! { ! switch (*j) ! { ! case '0' ... '9': ! case 'a' ... 'z': ! case 'A' ... 'Z': ! case '-': ! case '_': ! break; ! default: ! gdk_beep (); ! pos = gtk_editable_get_position (GTK_EDITABLE (widget)); ! gtk_editable_delete_text (GTK_EDITABLE (widget), ! pos, pos+1); ! break; ! } ! } } *************** *** 718,729 **** if (g_utf8_strlen (text, -1) > 0) { gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), ! GTK_RESPONSE_OK, ! TRUE); } else { gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), ! GTK_RESPONSE_OK, ! FALSE); } } --- 742,764 ---- if (g_utf8_strlen (text, -1) > 0) { gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), ! GTK_RESPONSE_OK, ! TRUE); } else { gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), ! GTK_RESPONSE_OK, ! FALSE); } } + + + + /* ensure that deleted top-level windows are destroyed */ + static gint + window_delete (GtkWidget *widget, + GdkEvent *event, + gpointer data) + { + return FALSE; + } Index: sat-cfg.c =================================================================== RCS file: /cvsroot/groundstation/gpredict2/src/sat-cfg.c,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** sat-cfg.c 20 Jan 2007 14:16:58 -0000 1.69 --- sat-cfg.c 4 Feb 2007 21:23:35 -0000 1.70 *************** *** 3,7 **** Gpredict: Real-time satellite tracking and orbit prediction program ! Copyright (C) 2001-2006 Alexandru Csete, OZ9AEC. Authors: Alexandru Csete <cs...@us...> --- 3,7 ---- Gpredict: Real-time satellite tracking and orbit prediction program ! Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. Authors: Alexandru Csete <cs...@us...> *************** *** 103,106 **** --- 103,107 ---- + /** \brief Structure representing a string value */ typedef struct { *************** *** 170,173 **** --- 171,185 ---- { "PREDICT", "SINGLE_PASS_COL", SINGLE_PASS_COL_DEFAULTS}, { "PREDICT", "MULTI_PASS_COL", MULTI_PASS_COL_DEFAULTS}, + { "SKY_AT_GLANCE", "TIME_SPAN_HOURS", 12}, + { "SKY_AT_GLANCE", "COLOUR_01", 0xFA0000}, + { "SKY_AT_GLANCE", "COLOUR_02", 0xFA0000}, + { "SKY_AT_GLANCE", "COLOUR_03", 0xFA0000}, + { "SKY_AT_GLANCE", "COLOUR_04", 0xFA0000}, + { "SKY_AT_GLANCE", "COLOUR_05", 0xFA0000}, + { "SKY_AT_GLANCE", "COLOUR_06", 0xFA0000}, + { "SKY_AT_GLANCE", "COLOUR_07", 0xFA0000}, + { "SKY_AT_GLANCE", "COLOUR_08", 0xFA0000}, + { "SKY_AT_GLANCE", "COLOUR_09", 0xFA0000}, + { "SKY_AT_GLANCE", "COLOUR_10", 0xFA0000}, { "GLOBAL", "WINDOW_WIDTH", 700}, { "GLOBAL", "WINDOW_HEIGHT", 700}, *************** *** 188,191 **** --- 200,205 ---- { "MODULES", "MAP_FONT", "Sans 10"}, { "MODULES", "POLAR_FONT", "Sans 10"}, + { "SKY_AT_GLANCE", "SATELLITES", "25544;28375;24278;28650;27607;"\ + "22825;20439;25338;27453;28654"}, { "TLE", "SERVER", "http://www.celestrak.com/NORAD/elements/"}, { "TLE", "FILES", "amateur.txt;cubesat.txt;galileo.txt;geo.txt;gps-ops.txt;"\ *************** *** 725,726 **** --- 739,742 ---- } } + + Index: sat-cfg.h =================================================================== RCS file: /cvsroot/groundstation/gpredict2/src/sat-cfg.h,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** sat-cfg.h 9 Dec 2006 16:55:05 -0000 1.45 --- sat-cfg.h 4 Feb 2007 21:23:35 -0000 1.46 *************** *** 3,7 **** Gpredict: Real-time satellite tracking and orbit prediction program ! Copyright (C) 2001-2006 Alexandru Csete, OZ9AEC. Authors: Alexandru Csete <cs...@us...> --- 3,7 ---- Gpredict: Real-time satellite tracking and orbit prediction program ! Copyright (C) 2001-2007 Alexandru Csete, OZ9AEC. Authors: Alexandru Csete <cs...@us...> *************** *** 94,97 **** --- 94,108 ---- SAT_CFG_INT_PRED_SINGLE_COL, /*!< Visible columns in single-pass dialog */ SAT_CFG_INT_PRED_MULTI_COL, /*!< Visible columns in multi-pass dialog */ + SAT_CFG_INT_SKYATGL_TIME, /*!< Time span for sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_01, /*!< Colour 1 in sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_02, /*!< Colour 2 in sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_03, /*!< Colour 3 in sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_04, /*!< Colour 4 in sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_05, /*!< Colour 5 in sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_06, /*!< Colour 6 in sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_07, /*!< Colour 7 in sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_08, /*!< Colour 8 in sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_09, /*!< Colour 9 in sky at a glance predictions */ + SAT_CFG_INT_SKYATGL_COL_10, /*!< Colour 10 in sky at a glance predictions */ SAT_CFG_INT_WINDOW_WIDTH, /*!< Main window width during last session */ SAT_CFG_INT_WINDOW_HEIGHT, /*!< Main window height during last session */ *************** *** 103,106 **** --- 114,119 ---- } sat_cfg_int_e; + + /** \brief Symbolic references for string config values. */ typedef enum { *************** *** 112,115 **** --- 125,129 ---- SAT_CFG_STR_MAP_FONT, /*!< Map font. */ SAT_CFG_STR_POL_FONT, /*!< Polar view font. */ + SAT_CFG_STR_SKYATGL_SATS, /*!< Satellites for sky at a glance in global mode */ SAT_CFG_STR_TLE_SERVER, /*!< Server for TLE updates. */ SAT_CFG_STR_TLE_FILES, /*!< ; separated list of files on server. */ *************** *** 138,140 **** --- 152,155 ---- void sat_cfg_reset_int (sat_cfg_int_e param); + #endif |