From: Alexandru C. <cs...@us...> - 2006-02-03 22:35:32
|
Update of /cvsroot/groundstation/gpredict2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14171 Modified Files: loc-tree.c Log Message: Added debug info and some comments to the code. Index: loc-tree.c =================================================================== RCS file: /cvsroot/groundstation/gpredict2/src/loc-tree.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** loc-tree.c 5 Nov 2005 00:58:06 -0000 1.5 --- loc-tree.c 3 Feb 2006 22:35:23 -0000 1.6 *************** *** 95,106 **** gchar **wx) { ! GtkCellRenderer *renderer; ! GtkTreeViewColumn *column; ! GtkTreeModel *model; ! GtkWidget *view; ! GtkTreeSelection *selection;/* used to set selection checking func */ ! GtkWidget *swin; ! GtkWidget *dialog; ! gint response; /* return false if specified file does not exist */ --- 95,107 ---- gchar **wx) { ! GtkCellRenderer *renderer; /* tree view cell renderer */ ! GtkTreeViewColumn *column; /* tree view column used to add columns */ ! GtkTreeModel *model; /* tree model */ ! GtkWidget *view; /* tree view widget */ ! GtkTreeSelection *selection; /* used to set selection checking func */ ! GtkWidget *swin; /* scrolled window widget */ ! GtkWidget *dialog; /* the dialog widget */ ! gint response; /* response ID returned by gtk_dialog_run */ ! gchar *msg; /* debug message */ /* return false if specified file does not exist */ *************** *** 211,220 **** "text", TREE_COL_SELECT, NULL); - /* gtk_tree_view_column_set_alignment (column, 0.5); */ - /* gtk_tree_view_column_set_cell_data_func (column, */ - /* renderer, */ - /* loc_tree_int_cell_data_function, */ - /* GUINT_TO_POINTER (TREE_COL_SELECT), */ - /* NULL); */ gtk_tree_view_insert_column (GTK_TREE_VIEW (view), column, --- 212,215 ---- *************** *** 243,247 **** gtk_container_add (GTK_CONTAINER (swin), view); ! /**** CRASH (because treeview) *****/ gtk_widget_show_all (swin); --- 238,242 ---- gtk_container_add (GTK_CONTAINER (swin), view); ! /**** CRASH (because treeview float data func) *****/ gtk_widget_show_all (swin); *************** *** 279,282 **** --- 274,285 ---- loc_tree_get_selection (view, loc, lat, lon, alt, wx); gtk_widget_destroy (dialog); + + /* send debug message */ + msg = g_strdup_printf (_("%s: Selected %s"), + __FUNCTION__, loc + fname); + sat_log_log (SAT_LOG_LEVEL_MSG, msg); + g_free (msg); + return TRUE; break; *************** *** 284,287 **** --- 287,298 ---- default: gtk_widget_destroy (dialog); + + /* send debug message */ + msg = g_strdup_printf (_("%s: No location selected"), + __FUNCTION__, + fname); + sat_log_log (SAT_LOG_LEVEL_MSG, msg); + g_free (msg); + return FALSE; *************** *** 300,305 **** loc_tree_create_and_fill_model (const gchar *fname) { ! GtkTreeStore *treestore; ! GtkTreeIter toplevel,midlevel,child; GIOChannel *locfile; /* file we read locations from */ gchar *line; /* line read from file */ --- 311,318 ---- loc_tree_create_and_fill_model (const gchar *fname) { ! GtkTreeStore *treestore; /* tree store, which is loaded and returned */ ! GtkTreeIter toplevel; /* highest level rows, continent or region */ ! GtkTreeIter midlevel; /* mid level rows, country or state in the US */ ! GtkTreeIter child; /* lowest level rows, cities */ GIOChannel *locfile; /* file we read locations from */ gchar *line; /* line read from file */ *************** *** 309,314 **** gchar *continent = g_strdup("DUMMY"); /* current continent */ gchar *country = g_strdup("DUMMY"); /* current country */ ! gchar *msg = NULL; ! GError *error = NULL; --- 322,327 ---- gchar *continent = g_strdup("DUMMY"); /* current continent */ gchar *country = g_strdup("DUMMY"); /* current country */ ! gchar *msg = NULL; /* debug message */ ! GError *error = NULL; /* error data when reading file */ *************** *** 406,410 **** TREE_COL_LAT, g_ascii_strtod (buff[4], NULL), TREE_COL_LON, g_ascii_strtod (buff[5], NULL), ! // Crashes here if type is not correctly cast TREE_COL_ALT, (guint)g_ascii_strtod (buff[6], NULL), --- 419,423 ---- TREE_COL_LAT, g_ascii_strtod (buff[4], NULL), TREE_COL_LON, g_ascii_strtod (buff[5], NULL), ! /* Crashes here if type is not correctly cast */ TREE_COL_ALT, (guint)g_ascii_strtod (buff[6], NULL), *************** *** 500,504 **** } else { - /* BUG! */ buff = g_strdup_printf (_("%s: Invalid column: %d"), __FUNCTION__, --- 513,516 ---- *************** *** 510,515 **** } - - if (fabs (LTMN-number) > LTEPS) { buff = g_strdup_printf ("%.2f\302\260%c", number, hmf); --- 522,525 ---- |