|
|
Star *selStar =(Star *)gtk_clist_get_row_data(list,row); | Star *selStar =(Star *)gtk_clist_get_row_data(list,row); |
if (selStar) | if (selStar) |
{ | { |
browserSel.select(selStar); |
browserSel = Selection(selStar); |
return TRUE; | return TRUE; |
} | } |
return FALSE; | return FALSE; |
|
|
if ((body=(Body *)gtk_ctree_node_get_row_data(tree,node))) | if ((body=(Body *)gtk_ctree_node_get_row_data(tree,node))) |
{ | { |
if (body == (Body *) nearestStar) | if (body == (Body *) nearestStar) |
browserSel.select((Star *) nearestStar); |
browserSel = Selection((Star *) nearestStar); |
else | else |
browserSel.select(body); |
browserSel = Selection(body); |
return TRUE; | return TRUE; |
} | } |
DPRINTF(0, "Unable to find body for this node.\n"); | DPRINTF(0, "Unable to find body for this node.\n"); |
|
|
for (unsigned int i = 0; i < currentLength; i++) | for (unsigned int i = 0; i < currentLength; i++) |
gtk_clist_remove(GTK_CLIST(clist), 0); | gtk_clist_remove(GTK_CLIST(clist), 0); |
currentLength=(*stars).size(); | currentLength=(*stars).size(); |
browserSel.select((Star *)(*stars)[0]); |
browserSel = Selection((Star *)(*stars)[0]); |
UniversalCoord ucPos = appSim->getObserver().getPosition(); | UniversalCoord ucPos = appSim->getObserver().getPosition(); |
| |
for (unsigned int i = 0; i < currentLength; i++) | for (unsigned int i = 0; i < currentLength; i++) |
|
|
{ | { |
sbrowser.refresh(); | sbrowser.refresh(); |
loadNearestStarSystem(); | loadNearestStarSystem(); |
tmpSel=browserSel.star; |
tmpSel=(Star*)browserSel.obj; |
browserSel.star=(Star *)nearestStar; |
browserSel = Selection((Star *)nearestStar); |
browserSel.body=NULL; |
|
} | } |
else | else |
browserSel.select((Star *)tmpSel); |
browserSel = Selection((Star *)tmpSel); |
return(TRUE); | return(TRUE); |
} | } |
| |
|
|
GtkWidget *browser= gnome_dialog_new("Celestial Browser", | GtkWidget *browser= gnome_dialog_new("Celestial Browser", |
GNOME_STOCK_BUTTON_OK, | GNOME_STOCK_BUTTON_OK, |
NULL); | NULL); |
browserSel.select((Star *)NULL); |
browserSel = Selection((Star *)NULL); |
if (browser == NULL) | if (browser == NULL) |
{ | { |
DPRINTF(0, "Unable to open celestial browser dialog!\n"); | DPRINTF(0, "Unable to open celestial browser dialog!\n"); |
|
|
gtk_container_add(GTK_CONTAINER(align),GTK_WIDGET(hbox)); | gtk_container_add(GTK_CONTAINER(align),GTK_WIDGET(hbox)); |
sbrowser.setSimulation(appSim); | sbrowser.setSimulation(appSim); |
addStars(); | addStars(); |
tmpSel=browserSel.star; |
tmpSel=(Star*)browserSel.obj; |
gtk_signal_connect(GTK_OBJECT(clist), "select-row", | gtk_signal_connect(GTK_OBJECT(clist), "select-row", |
GTK_SIGNAL_FUNC(listSelect), NULL); | GTK_SIGNAL_FUNC(listSelect), NULL); |
gtk_clist_select_row(GTK_CLIST(clist), 0, 0); | gtk_clist_select_row(GTK_CLIST(clist), 0, 0); |
|
|
gnome_dialog_run_and_close(GNOME_DIALOG(browser)); | gnome_dialog_run_and_close(GNOME_DIALOG(browser)); |
clist=NULL; | clist=NULL; |
ctree=NULL; | ctree=NULL; |
browserSel.select((Star *)NULL); |
browserSel = Selection((Star *)NULL); |
} | } |
| |
| |