From 39e52873b467cde9f2fda87bfb4d14713bde8104 Mon Sep 17 00:00:00 2001 From: aa1vs Date: Fri, 26 Aug 2011 15:32:06 +0000 Subject: [PATCH] Add hashes to support storing polar view sky track on and off. git-svn-id: https://gpredict.svn.sourceforge.net/svnroot/gpredict/trunk@892 ab6734ba-2843-0410-b83b-99c217ef6c0f --- ChangeLog | 10 +++++++++- src/gtk-polar-view.c | 24 +++++++++++++++++++++--- src/gtk-polar-view.h | 3 +++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4079f0c..1cf9f51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,12 @@ -2011-08-21 Charles Suprin +2011-08-26 Charles Suprin + + * ChangeLog + * src/gtk-polar-view.h + * src/gtk-polar-view.c + Add hashes to support storing polar view sky track on and off. + + +2011-08-23 Charles Suprin * ChangeLog * src/gtk-sat-module.c diff --git a/src/gtk-polar-view.c b/src/gtk-polar-view.c index 485a2e8..7471830 100644 --- a/src/gtk-polar-view.c +++ b/src/gtk-polar-view.c @@ -201,6 +201,16 @@ gtk_polar_view_new (GKeyFile *cfgdata, GHashTable *sats, qth_t *qth) g_free, NULL); + GTK_POLAR_VIEW (polv)->showtracks_on = g_hash_table_new_full (g_int_hash, + g_int_equal, + g_free, + NULL); + + GTK_POLAR_VIEW (polv)->showtracks_off = g_hash_table_new_full (g_int_hash, + g_int_equal, + g_free, + NULL); + /* get settings */ GTK_POLAR_VIEW (polv)->refresh = mod_cfg_get_int (cfgdata, MOD_CFG_POLAR_SECTION, @@ -832,7 +842,7 @@ update_sat (gpointer key, gpointer value, gpointer data) } /* free pass info */ - free_pass (obj->pass); + //free_pass (obj->pass); obj->pass=NULL; /* if this was the selected satellite we need to @@ -842,7 +852,7 @@ update_sat (gpointer key, gpointer value, gpointer data) g_object_set (polv->sel, "text", "", NULL); } - g_free (obj); + // g_free (obj); /* remove sat object from hash table */ g_hash_table_remove (polv->obj, catnum); @@ -946,7 +956,15 @@ update_sat (gpointer key, gpointer value, gpointer data) if ( obj != NULL) { /* space was allocated now use it */ obj->selected = FALSE; - obj->showtrack = polv->showtrack; + + if (g_hash_table_lookup_extended(polv->showtracks_on,catnum,NULL,NULL)){ + obj->showtrack = TRUE; + } + else if (g_hash_table_lookup_extended(polv->showtracks_off,catnum,NULL,NULL)){ + obj->showtrack = FALSE; + } else { + obj->showtrack = polv->showtrack; + } obj->istarget = FALSE; root = goo_canvas_get_root_item_model (GOO_CANVAS (polv->canvas)); diff --git a/src/gtk-polar-view.h b/src/gtk-polar-view.h index f12099a..fe3abec 100644 --- a/src/gtk-polar-view.h +++ b/src/gtk-polar-view.h @@ -104,6 +104,9 @@ struct _GtkPolarView GooCanvasItemModel *next; /*!< next event text */ GooCanvasItemModel *sel; /*!< Text showing info about selected satellite. */ + GHashTable *showtracks_on; + GHashTable *showtracks_off; + gdouble naos; /*!< Next event time */ gint ncat; /*!< Next event catnum */