From: Alexandru C. <cs...@us...> - 2002-10-12 15:58:02
|
Update of /cvsroot/groundstation/gpredict/src In directory usw-pr-cvs1:/tmp/cvs-serv6431 Modified Files: satdb.c Log Message: Add catalog number to each satellite entry to obtain the same functionality as with the flat lists. Index: satdb.c =================================================================== RCS file: /cvsroot/groundstation/gpredict/src/satdb.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** satdb.c 21 Sep 2002 14:08:10 -0000 1.3 --- satdb.c 12 Oct 2002 15:57:58 -0000 1.4 *************** *** 78,82 **** GdkPixmap *dop,*dcp; GdkBitmap *dob,*dcb; ! GtkCTreeNode *treenode; /* Create pixmaps and bitmaps */ --- 78,84 ---- GdkPixmap *dop,*dcp; GdkBitmap *dob,*dcb; ! GtkCTreeNode *treenode,*satnode; ! gchar catnum_s[6]; ! guint catnum,j; /* Create pixmaps and bitmaps */ *************** *** 88,93 **** satlog_log (SAT_LOG_DEBUG, __FUNCTION__ ": got GNOME_VFS_OK"); tree = gtk_ctree_new (1, 0); ! gtk_ctree_set_expander_style (GTK_CTREE (tree), GTK_CTREE_EXPANDER_NONE); ! gtk_ctree_set_line_style (GTK_CTREE (tree), GTK_CTREE_LINES_NONE); /* loop throough the file list */ --- 90,95 ---- satlog_log (SAT_LOG_DEBUG, __FUNCTION__ ": got GNOME_VFS_OK"); tree = gtk_ctree_new (1, 0); ! /* gtk_ctree_set_expander_style (GTK_CTREE (tree), GTK_CTREE_EXPANDER_NONE); */ ! /* gtk_ctree_set_line_style (GTK_CTREE (tree), GTK_CTREE_LINES_NONE); */ /* loop throough the file list */ *************** *** 122,132 **** x--; } /* add satelite to the tree */ vbuf = g_strsplit (name, "!", 1); ! gtk_ctree_insert_node (GTK_CTREE (tree), ! treenode, NULL, ! vbuf, 5, ! NULL, NULL, NULL, NULL, ! TRUE, FALSE); g_strfreev (vbuf); i++; --- 124,146 ---- x--; } + /* extract catalog number */ + for (j=0; j<6; j++) + catnum_s[j] = line1[j+2]; + catnum_s[5] = 0; + catnum = (guint) g_strtod (catnum_s, NULL); + /* add satelite to the tree */ vbuf = g_strsplit (name, "!", 1); ! satnode = gtk_ctree_insert_node (GTK_CTREE (tree), ! treenode, NULL, ! vbuf, 5, ! NULL, NULL, NULL, NULL, ! TRUE, FALSE); ! ! /* attach catalog number; this will provide the same functionality ! as the flat list (pre-0.4). ! */ ! gtk_ctree_node_set_row_data (GTK_CTREE (tree), satnode, GUINT_TO_POINTER (catnum)); ! g_strfreev (vbuf); i++; |