diff --git a/src/sview/block_info.c b/src/sview/block_info.c index cc6f32757aa075a4ccd821586045ea0908b2ded6..53ef5e009b4190253f4a2a18a66da31f7f19c4a5 100644 --- a/src/sview/block_info.c +++ b/src/sview/block_info.c @@ -77,6 +77,7 @@ enum { #ifdef HAVE_BGL SORTID_USE, #endif + SORTID_NODE_INX, SORTID_USER, SORTID_CNT }; @@ -118,6 +119,8 @@ static display_data_t display_data_block[] = { #endif {G_TYPE_STRING, SORTID_MLOADERIMAGE, "Mloader Image", FALSE, EDIT_NONE, refresh_block, create_model_block, admin_edit_block}, + {G_TYPE_POINTER, SORTID_NODE_INX, NULL, FALSE, EDIT_NONE, + refresh_resv, create_model_resv, admin_edit_resv}, {G_TYPE_INT, SORTID_UPDATED, NULL, FALSE, EDIT_NONE, refresh_block, create_model_block, admin_edit_block}, {G_TYPE_NONE, -1, NULL, FALSE, EDIT_NONE} @@ -338,6 +341,9 @@ static void _update_block_record(sview_block_info_t *block_ptr, gtk_tree_store_set(treestore, iter, SORTID_NODELIST, block_ptr->nodes, -1); + gtk_tree_store_set(treestore, iter, + SORTID_NODE_INX, block_ptr->bp_inx, -1); + #ifdef HAVE_BGL gtk_tree_store_set(treestore, iter, SORTID_BLRTSIMAGE, block_ptr->blrtsimage, -1); @@ -1135,6 +1141,7 @@ extern void set_menus_block(void *arg, GtkTreePath *path, extern void popup_all_block(GtkTreeModel *model, GtkTreeIter *iter, int id) { char *name = NULL; + int *node_inx = NULL; char title[100]; ListIterator itr = NULL; popup_info_t *popup_win = NULL; @@ -1142,6 +1149,8 @@ extern void popup_all_block(GtkTreeModel *model, GtkTreeIter *iter, int id) int i=0; gtk_tree_model_get(model, iter, SORTID_BLOCK, &name, -1); + gtk_tree_model_get(model, iter, SORTID_NODE_INX, &node_inx, -1); + switch(id) { case JOB_PAGE: snprintf(title, 100, "Jobs(s) in block %s", name); @@ -1177,9 +1186,11 @@ extern void popup_all_block(GtkTreeModel *model, GtkTreeIter *iter, int id) if(!popup_win) { if(id == INFO_PAGE) - popup_win = create_popup_info(id, BLOCK_PAGE, title); + popup_win = create_popup_info( + id, BLOCK_PAGE, title, node_inx); else - popup_win = create_popup_info(BLOCK_PAGE, id, title); + popup_win = create_popup_info( + BLOCK_PAGE, id, title, node_inx); } else { g_free(name); gtk_window_present(GTK_WINDOW(popup_win->popup)); diff --git a/src/sview/common.c b/src/sview/common.c index b45555f92e37efd3490b14f16964c5bb6187b41c..ac4989a096ec6e32f347624c91d323370eae240b 100644 --- a/src/sview/common.c +++ b/src/sview/common.c @@ -702,7 +702,8 @@ extern gboolean row_clicked(GtkTreeView *tree_view, GdkEventButton *event, return did_something; } -extern popup_info_t *create_popup_info(int type, int dest_type, char *title) +extern popup_info_t *create_popup_info(int type, int dest_type, + char *title, int *node_inx) { GtkScrolledWindow *window = NULL; GtkBin *bin = NULL; @@ -711,7 +712,7 @@ extern popup_info_t *create_popup_info(int type, int dest_type, char *title) GtkWidget *label = NULL; GtkWidget *table = NULL; popup_info_t *popup_win = xmalloc(sizeof(popup_info_t)); - + list_push(popup_list, popup_win); popup_win->spec_info = xmalloc(sizeof(specific_info_t)); @@ -721,7 +722,7 @@ extern popup_info_t *create_popup_info(int type, int dest_type, char *title) popup_win->spec_info->search_info->gchar_data = NULL; popup_win->spec_info->search_info->int_data = NO_VAL; popup_win->spec_info->search_info->int_data2 = NO_VAL; - + popup_win->spec_info->type = type; popup_win->spec_info->title = xstrdup(title); popup_win->popup = gtk_dialog_new_with_buttons( @@ -769,17 +770,10 @@ extern popup_info_t *create_popup_info(int type, int dest_type, char *title) bin = GTK_BIN(&view->bin); popup_win->grid_table = GTK_TABLE(bin->child); popup_win->grid_button_list = NULL; -#ifdef HAVE_BG - if(dest_type != NODE_PAGE || type != INFO_PAGE) { -// gtk_widget_set_size_request(GTK_WIDGET(window), 164, -1); - popup_win->grid_button_list = copy_main_button_list(); - put_buttons_in_table(popup_win->grid_table, - popup_win->grid_button_list); - } -#endif + popup_win->node_inx = node_inx; table = gtk_table_new(1, 2, FALSE); - + gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(window), 0, 1, 0, 1, GTK_SHRINK, GTK_EXPAND | GTK_FILL, 0, 0); diff --git a/src/sview/grid.c b/src/sview/grid.c index 10867b53bfa9ab043e6f765837fc65d51a0b94d7..97cec9d7f27c2499e6fc7b9759ed29172cb73078 100644 --- a/src/sview/grid.c +++ b/src/sview/grid.c @@ -46,6 +46,8 @@ char *sview_colors[] = {"#0000FF", "#00FF00", "#00FFFF", "#FFFF00", "#715627", "#6A8CA2", "#4C7127", "#25B9B9", "#A020F0", "#8293ED", "#FFA500", "#FFC0CB", "#8B6914", "#18A24E", "#F827FC", "#B8A40C"}; +char *blank_color = "#4a4a4a"; + int sview_colors_cnt = 20; GStaticMutex blinking_mutex = G_STATIC_MUTEX_INIT; @@ -85,7 +87,8 @@ static void _open_node(GtkWidget *widget, GdkEventButton *event, list_iterator_destroy(itr); if(!popup_win) { - popup_win = create_popup_info(INFO_PAGE, NODE_PAGE, title); + popup_win = create_popup_info(INFO_PAGE, NODE_PAGE, + title, NULL); popup_win->spec_info->search_info->gchar_data = g_strdup(grid_button->node_name); if (!g_thread_create((gpointer)popup_thr, popup_win, @@ -282,14 +285,19 @@ extern grid_button_t *create_grid_button_from_another( return NULL; if(color_inx >= 0) color_inx %= sview_colors_cnt; - + send_grid_button = xmalloc(sizeof(grid_button_t)); memcpy(send_grid_button, grid_button, sizeof(grid_button_t)); node_base_state = send_grid_button->state & NODE_STATE_BASE; /* need to set the table to empty because we will want to fill this into the new table later */ send_grid_button->table = NULL; - if((color_inx >= 0) && node_base_state == NODE_STATE_DOWN) { + if(color_inx == MAKE_BLACK) { + send_grid_button->button = gtk_button_new(); + gdk_color_parse(blank_color, &color); + gtk_widget_modify_bg(send_grid_button->button, + GTK_STATE_NORMAL, &color); + } else if((color_inx >= 0) && node_base_state == NODE_STATE_DOWN) { GtkWidget *image = gtk_image_new_from_stock( GTK_STOCK_CANCEL, GTK_ICON_SIZE_SMALL_TOOLBAR); @@ -350,6 +358,7 @@ extern grid_button_t *create_grid_button_from_another( return send_grid_button; } +/* start == -1 for all */ extern char *change_grid_color(List button_list, int start, int end, int color_inx) { @@ -361,13 +370,30 @@ extern char *change_grid_color(List button_list, int start, int end, if(!button_list) return NULL; + if(color_inx >= 0) { + color_inx %= sview_colors_cnt; + gdk_color_parse(sview_colors[color_inx], &color); + } else if(color_inx == MAKE_BLACK) + gdk_color_parse(blank_color, &color); + else + gdk_color_parse("#FFFFFF", &color); + itr = list_iterator_create(button_list); - color_inx %= sview_colors_cnt; - gdk_color_parse(sview_colors[color_inx], &color); while((grid_button = list_next(itr))) { - if ((grid_button->inx < start) - || (grid_button->inx > end)) + if(start != -1) + if ((grid_button->inx < start) + || (grid_button->inx > end)) + continue; + + if(color_inx == MAKE_BLACK) { + _put_button_as_up(grid_button); + grid_button->color = blank_color; + gtk_widget_modify_bg(grid_button->button, + GTK_STATE_NORMAL, &color); + continue; + } + node_base_state = grid_button->state & NODE_STATE_BASE; if (node_base_state == NODE_STATE_DOWN) { _put_button_as_down(grid_button, NODE_STATE_DOWN); @@ -375,7 +401,10 @@ extern char *change_grid_color(List button_list, int start, int end, _put_button_as_down(grid_button, NODE_STATE_DRAIN); } else { _put_button_as_up(grid_button); - grid_button->color = sview_colors[color_inx]; + if(color_inx == MAKE_WHITE) + grid_button->color = "#FFFFFF"; + else + grid_button->color = sview_colors[color_inx]; gtk_widget_modify_bg(grid_button->button, GTK_STATE_NORMAL, &color); } @@ -424,7 +453,7 @@ extern void get_button_list_from_main(List *button_list, int start, int end, return; } -extern List copy_main_button_list() +extern List copy_main_button_list(int initial_color) { ListIterator itr = NULL; grid_button_t *grid_button = NULL; @@ -434,7 +463,7 @@ extern List copy_main_button_list() itr = list_iterator_create(grid_button_list); while((grid_button = list_next(itr))) { send_grid_button = create_grid_button_from_another( - grid_button, grid_button->node_name, -1); + grid_button, grid_button->node_name, initial_color); if(send_grid_button) { g_signal_connect(G_OBJECT(send_grid_button->button), "button-press-event", @@ -862,3 +891,32 @@ extern void sview_reset_grid() } list_iterator_destroy(itr); } + +extern void setup_popup_grid_list(popup_info_t *popup_win) +{ + int def_color = MAKE_BLACK; + + if(!popup_win->node_inx || popup_win->spec_info->type == INFO_PAGE) + def_color = MAKE_WHITE; + + if(popup_win->grid_button_list) { + change_grid_color(popup_win->grid_button_list, -1, -1, + def_color); + } else { + popup_win->grid_button_list = copy_main_button_list(def_color); + put_buttons_in_table(popup_win->grid_table, + popup_win->grid_button_list); + popup_win->full_grid = 1; + } + + if(popup_win->node_inx) { + int j=0; + while(popup_win->node_inx[j] >= 0) { + change_grid_color( + popup_win->grid_button_list, + popup_win->node_inx[j], + popup_win->node_inx[j+1], MAKE_WHITE); + j += 2; + } + } +} diff --git a/src/sview/job_info.c b/src/sview/job_info.c index ec4a2828f87c190563286921adbb8b9a5fdd87d0..3d4c67698b2a231b4d73d9e45183eb257702a997 100644 --- a/src/sview/job_info.c +++ b/src/sview/job_info.c @@ -146,6 +146,7 @@ enum { SORTID_UPDATED, SORTID_USER, SORTID_WCKEY, + SORTID_NODE_INX, SORTID_CNT }; @@ -301,6 +302,8 @@ static display_data_t display_data_job[] = { FALSE, EDIT_NONE, refresh_job, create_model_job, admin_edit_job}, {G_TYPE_STRING, SORTID_COMMENT, "Comment", FALSE, EDIT_NONE, refresh_job, create_model_job, admin_edit_job}, + {G_TYPE_POINTER, SORTID_NODE_INX, NULL, FALSE, EDIT_NONE, + refresh_resv, create_model_resv, admin_edit_resv}, {G_TYPE_INT, SORTID_UPDATED, NULL, FALSE, EDIT_NONE, refresh_job, create_model_job, admin_edit_job}, {G_TYPE_NONE, -1, NULL, FALSE, EDIT_NONE} @@ -1662,6 +1665,10 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr, SORTID_NUM_PROCS, tmp_char, -1); gtk_tree_store_set(treestore, iter, SORTID_NODELIST, nodes, -1); + + gtk_tree_store_set(treestore, iter, + SORTID_NODE_INX, job_ptr->node_inx, -1); + gtk_tree_store_set(treestore, iter, SORTID_REQ_NODELIST, job_ptr->req_nodes, -1); gtk_tree_store_set(treestore, iter, SORTID_EXC_NODELIST, @@ -2262,14 +2269,11 @@ void _display_info_job(List info_list, popup_info_t *popup_win) GtkTreeView *treeview = NULL; int update = 0; int i = -1, j = 0; - int first_time = 0; if(spec_info->search_info->int_data == NO_VAL) { /* info = xstrdup("No pointer given!"); */ goto finished; } - if(!list_count(popup_win->grid_button_list)) - first_time = 1; need_refresh: if(!spec_info->display_widget) { @@ -2296,18 +2300,11 @@ need_refresh: } else if(spec_info->search_info->int_data2 == NO_VAL) { j=0; while(sview_job_info->job_ptr->node_inx[j] >= 0) { - if(!first_time) change_grid_color( popup_win->grid_button_list, sview_job_info->job_ptr->node_inx[j], sview_job_info->job_ptr->node_inx[j+1], i); - else - get_button_list_from_main( - &popup_win->grid_button_list, - sview_job_info->job_ptr->node_inx[j], - sview_job_info->job_ptr->node_inx[j+1], - i); j += 2; } _layout_job_record(treeview, sview_job_info, update); @@ -2321,23 +2318,13 @@ need_refresh: spec_info->search_info->int_data2) { j=0; while(step_ptr->node_inx[j] >= 0) { - if(!first_time) - change_grid_color( - popup_win-> - grid_button_list, - step_ptr->node_inx[j], - step_ptr-> - node_inx[j+1], - i); - else - get_button_list_from_main( - &popup_win-> - grid_button_list, - step_ptr->node_inx[j], - step_ptr-> - node_inx[j+1], - i); - + change_grid_color( + popup_win-> + grid_button_list, + step_ptr->node_inx[j], + step_ptr-> + node_inx[j+1], + i); j += 2; } _layout_step_record(treeview, @@ -2378,9 +2365,6 @@ need_refresh: goto need_refresh; } - - put_buttons_in_table(popup_win->grid_table, - popup_win->grid_button_list); } gtk_widget_show_all(spec_info->display_widget); @@ -2875,15 +2859,7 @@ display_it: SORTID_CNT); } - if(popup_win->grid_button_list) { - list_destroy(popup_win->grid_button_list); - } - -#ifdef HAVE_3D - popup_win->grid_button_list = copy_main_button_list(); -#else - popup_win->grid_button_list = list_create(destroy_grid_button); -#endif + setup_popup_grid_list(popup_win); spec_info->view = INFO_VIEW; if(spec_info->type == INFO_PAGE) { @@ -2989,25 +2965,15 @@ display_it: list_push(send_info_list, sview_job_info_ptr); j=0; while(job_ptr->node_inx[j] >= 0) { -#ifdef HAVE_3D change_grid_color( popup_win->grid_button_list, job_ptr->node_inx[j], job_ptr->node_inx[j+1], i); -#else - get_button_list_from_main( - &popup_win->grid_button_list, - job_ptr->node_inx[j], - job_ptr->node_inx[j+1], i); -#endif j += 2; } } list_iterator_destroy(itr); - put_buttons_in_table(popup_win->grid_table, - popup_win->grid_button_list); - _update_info_job(send_info_list, GTK_TREE_VIEW(spec_info->display_widget)); @@ -3042,6 +3008,7 @@ extern void popup_all_job(GtkTreeModel *model, GtkTreeIter *iter, int id) { char *name = NULL; char title[100]; + int *node_inx = NULL; ListIterator itr = NULL; popup_info_t *popup_win = NULL; int jobid = NO_VAL; @@ -3050,6 +3017,8 @@ extern void popup_all_job(GtkTreeModel *model, GtkTreeIter *iter, int id) gtk_tree_model_get(model, iter, SORTID_JOBID, &jobid, -1); gtk_tree_model_get(model, iter, SORTID_ALLOC, &stepid, -1); + gtk_tree_model_get(model, iter, SORTID_NODE_INX, &node_inx, -1); + if(stepid) stepid = NO_VAL; else { @@ -3128,9 +3097,11 @@ extern void popup_all_job(GtkTreeModel *model, GtkTreeIter *iter, int id) if(!popup_win) { if(id == INFO_PAGE) - popup_win = create_popup_info(id, JOB_PAGE, title); + popup_win = create_popup_info( + id, JOB_PAGE, title, node_inx); else - popup_win = create_popup_info(JOB_PAGE, id, title); + popup_win = create_popup_info( + JOB_PAGE, id, title, node_inx); } else { gtk_window_present(GTK_WINDOW(popup_win->popup)); return; diff --git a/src/sview/node_info.c b/src/sview/node_info.c index c9eb292cec42ab40c3b24ab448abd1764535b54a..d377e65f032ba1d175b8af7ff6d3902bcf4cfca6 100644 --- a/src/sview/node_info.c +++ b/src/sview/node_info.c @@ -1123,9 +1123,11 @@ extern void popup_all_node(GtkTreeModel *model, GtkTreeIter *iter, int id) if(!popup_win) { if(id == INFO_PAGE) - popup_win = create_popup_info(id, NODE_PAGE, title); + popup_win = create_popup_info( + id, NODE_PAGE, title, NULL); else - popup_win = create_popup_info(NODE_PAGE, id, title); + popup_win = create_popup_info( + NODE_PAGE, id, title, NULL); popup_win->spec_info->search_info->gchar_data = name; if (!g_thread_create((gpointer)popup_thr, popup_win, FALSE, &error)) diff --git a/src/sview/part_info.c b/src/sview/part_info.c index 5443599ac9fab80b52a9a665bf8cacc858a656bc..d36a232ae28bd7986e0a368cba421cc791a21dda 100644 --- a/src/sview/part_info.c +++ b/src/sview/part_info.c @@ -87,6 +87,7 @@ enum { #ifndef HAVE_BG SORTID_NODELIST, #endif + SORTID_NODE_INX, SORTID_NODES, SORTID_ONLY_LINE, SORTID_PRIORITY, @@ -155,6 +156,8 @@ static display_data_t display_data_part[] = { create_model_part, admin_edit_part}, {G_TYPE_INT, SORTID_ONLY_LINE, NULL, FALSE, EDIT_NONE, refresh_part, create_model_part, admin_edit_part}, + {G_TYPE_POINTER, SORTID_NODE_INX, NULL, FALSE, EDIT_NONE, + refresh_part, create_model_part, admin_edit_part}, {G_TYPE_INT, SORTID_UPDATED, NULL, FALSE, EDIT_NONE, refresh_part, create_model_part, admin_edit_part}, @@ -1051,6 +1054,9 @@ static void _update_part_record(sview_part_info_t *sview_part_info, gtk_tree_store_set(treestore, iter, SORTID_NODELIST, part_ptr->nodes, -1); + + gtk_tree_store_set(treestore, iter, + SORTID_NODE_INX, part_ptr->node_inx, -1); gtk_tree_store_set(treestore, iter, SORTID_ONLY_LINE, 0, -1); /* clear out info for the main listing */ @@ -2309,6 +2315,7 @@ extern void popup_all_part(GtkTreeModel *model, GtkTreeIter *iter, int id) { char *name = NULL; char *state = NULL; + int *node_inx = NULL; char title[100]; int only_line = 0; ListIterator itr = NULL; @@ -2316,6 +2323,7 @@ extern void popup_all_part(GtkTreeModel *model, GtkTreeIter *iter, int id) GError *error = NULL; gtk_tree_model_get(model, iter, SORTID_NAME, &name, -1); + gtk_tree_model_get(model, iter, SORTID_NODE_INX, &node_inx, -1); switch(id) { case JOB_PAGE: @@ -2375,9 +2383,11 @@ extern void popup_all_part(GtkTreeModel *model, GtkTreeIter *iter, int id) if(!popup_win) { if(id == INFO_PAGE) - popup_win = create_popup_info(id, PART_PAGE, title); + popup_win = create_popup_info( + id, PART_PAGE, title, node_inx); else - popup_win = create_popup_info(PART_PAGE, id, title); + popup_win = create_popup_info( + PART_PAGE, id, title, node_inx); } else { g_free(name); g_free(state); diff --git a/src/sview/popups.c b/src/sview/popups.c index 4c83ca03b4fe8aabe14801ec7bb43655007c85c1..a1e993b6a5668c8529fef97f34e1552d85ebb34c 100644 --- a/src/sview/popups.c +++ b/src/sview/popups.c @@ -174,7 +174,7 @@ void _search_entry(sview_search_info_t *sview_search_info) list_iterator_destroy(itr); if(!popup_win) { - popup_win = create_popup_info(id, id, title); + popup_win = create_popup_info(id, id, title, NULL); } else { gtk_window_present(GTK_WINDOW(popup_win->popup)); return; diff --git a/src/sview/resv_info.c b/src/sview/resv_info.c index 69e7552220e8cef6fb80809aeff8d8ecfbb47c3b..1bc95ed6093cf49967208ae3a161b7915080a466 100644 --- a/src/sview/resv_info.c +++ b/src/sview/resv_info.c @@ -55,6 +55,7 @@ enum { SORTID_NAME, SORTID_NODE_CNT, SORTID_NODE_LIST, + SORTID_NODE_INX, SORTID_PARTITION, SORTID_START_TIME, SORTID_UPDATED, @@ -94,6 +95,8 @@ static display_data_t display_data_resv[] = { refresh_resv, create_model_resv, admin_edit_resv}, {G_TYPE_STRING, SORTID_FLAGS, "Flags", FALSE, EDIT_NONE, refresh_resv, create_model_resv, admin_edit_resv}, + {G_TYPE_POINTER, SORTID_NODE_INX, NULL, FALSE, EDIT_NONE, + refresh_resv, create_model_resv, admin_edit_resv}, {G_TYPE_INT, SORTID_UPDATED, NULL, FALSE, EDIT_NONE, refresh_resv, create_model_resv, admin_edit_resv}, {G_TYPE_NONE, -1, NULL, FALSE, EDIT_NONE} @@ -553,6 +556,9 @@ static void _update_resv_record(sview_resv_info_t *sview_resv_info_ptr, gtk_tree_store_set(treestore, iter, SORTID_NODE_LIST, resv_ptr->node_list, -1); + gtk_tree_store_set(treestore, iter, + SORTID_NODE_INX, resv_ptr->node_inx, -1); + gtk_tree_store_set(treestore, iter, SORTID_PARTITION, resv_ptr->partition, -1); @@ -689,14 +695,11 @@ void _display_info_resv(List info_list, popup_info_t *popup_win) sview_resv_info_t *sview_resv_info = NULL; int update = 0; int i = -1, j = 0; - int first_time = 0; if(!spec_info->search_info->gchar_data) { //info = xstrdup("No pointer given!"); goto finished; } - if(!list_count(popup_win->grid_button_list)) - first_time = 1; need_refresh: if(!spec_info->display_widget) { @@ -716,17 +719,10 @@ need_refresh: if(!strcmp(resv_ptr->name, name)) { j=0; while(resv_ptr->node_inx[j] >= 0) { - if(!first_time) - change_grid_color( - popup_win->grid_button_list, - resv_ptr->node_inx[j], - resv_ptr->node_inx[j+1], i); - else - get_button_list_from_main( - &popup_win->grid_button_list, - resv_ptr->node_inx[j], - resv_ptr->node_inx[j+1], - i); + change_grid_color( + popup_win->grid_button_list, + resv_ptr->node_inx[j], + resv_ptr->node_inx[j+1], i); j += 2; } _layout_resv_record(treeview, sview_resv_info, update); @@ -757,9 +753,6 @@ need_refresh: goto need_refresh; } - put_buttons_in_table(popup_win->grid_table, - popup_win->grid_button_list); - } gtk_widget_show(spec_info->display_widget); @@ -1087,15 +1080,7 @@ display_it: popup_win->display_data, SORTID_CNT); } - if(popup_win->grid_button_list) { - list_destroy(popup_win->grid_button_list); - } - -#ifdef HAVE_3D - popup_win->grid_button_list = copy_main_button_list(); -#else - popup_win->grid_button_list = list_create(destroy_grid_button); -#endif + setup_popup_grid_list(popup_win); spec_info->view = INFO_VIEW; if(spec_info->type == INFO_PAGE) { @@ -1152,24 +1137,24 @@ display_it: list_push(send_resv_list, sview_resv_info_ptr); j=0; while(resv_ptr->node_inx[j] >= 0) { -#ifdef HAVE_3D - change_grid_color( - popup_win->grid_button_list, - resv_ptr->node_inx[j], - resv_ptr->node_inx[j+1], i); -#else - get_button_list_from_main( - &popup_win->grid_button_list, - resv_ptr->node_inx[j], - resv_ptr->node_inx[j+1], i); -#endif + if(popup_win->full_grid) + change_grid_color( + popup_win->grid_button_list, + resv_ptr->node_inx[j], + resv_ptr->node_inx[j+1], i); + else + get_button_list_from_main( + &popup_win->grid_button_list, + resv_ptr->node_inx[j], + resv_ptr->node_inx[j+1], i); j += 2; } } list_iterator_destroy(itr); - put_buttons_in_table(popup_win->grid_table, - popup_win->grid_button_list); + if(!popup_win->full_grid) + put_buttons_in_table(popup_win->grid_table, + popup_win->grid_button_list); _update_info_resv(send_resv_list, GTK_TREE_VIEW(spec_info->display_widget)); @@ -1204,17 +1189,18 @@ extern void set_menus_resv(void *arg, GtkTreePath *path, extern void popup_all_resv(GtkTreeModel *model, GtkTreeIter *iter, int id) { char *name = NULL; - char *state = NULL; + int *node_inx = NULL; char title[100]; ListIterator itr = NULL; popup_info_t *popup_win = NULL; GError *error = NULL; gtk_tree_model_get(model, iter, SORTID_NAME, &name, -1); - + gtk_tree_model_get(model, iter, SORTID_NODE_INX, &node_inx, -1); + switch(id) { case PART_PAGE: - snprintf(title, 100, "Partition with reservation %s", name); + snprintf(title, 100, "Partition(s) with reservation %s", name); break; case JOB_PAGE: snprintf(title, 100, "Job(s) in reservation %s", name); @@ -1253,16 +1239,17 @@ extern void popup_all_resv(GtkTreeModel *model, GtkTreeIter *iter, int id) if(!popup_win) { if(id == INFO_PAGE) - popup_win = create_popup_info(id, RESV_PAGE, title); + popup_win = create_popup_info( + id, RESV_PAGE, title, node_inx); else - popup_win = create_popup_info(RESV_PAGE, id, title); + popup_win = create_popup_info( + RESV_PAGE, id, title, node_inx); } else { g_free(name); - g_free(state); gtk_window_present(GTK_WINDOW(popup_win->popup)); return; } - + switch(id) { case JOB_PAGE: case INFO_PAGE: @@ -1277,9 +1264,6 @@ extern void popup_all_resv(GtkTreeModel *model, GtkTreeIter *iter, int id) popup_win->spec_info->search_info->gchar_data = name; popup_win->spec_info->search_info->search_type = SEARCH_NODE_NAME; - - g_free(state); - //specific_info_node(popup_win); break; case SUBMIT_PAGE: diff --git a/src/sview/sview.h b/src/sview/sview.h index 1c3727215c9964c318f470bf9dca92e03b780864..4f5cdd3a8c39c7923709ec9c35f2dc25404881fa 100644 --- a/src/sview/sview.h +++ b/src/sview/sview.h @@ -83,6 +83,9 @@ #define POS_LOC 0 #define DEFAULT_ENTRY_LENGTH 500 +#define MAKE_BLACK -2 +#define MAKE_WHITE -1 + enum { JOB_PAGE, STEP_PAGE, PART_PAGE, @@ -199,7 +202,9 @@ struct popup_info { int toggled; int force_refresh; int *running; + int *node_inx; int show_grid; + int full_grid; bool not_found; GtkWidget *popup; GtkWidget *event_box; @@ -284,6 +289,7 @@ extern int get_system_stats(GtkTable *table); extern int setup_grid_table(GtkTable *table, List button_list, List node_list); extern void sview_init_grid(); extern void sview_reset_grid(); +extern void setup_popup_grid_list(popup_info_t *popup_win); // part_info.c extern void refresh_part(GtkAction *action, gpointer user_data); @@ -400,7 +406,8 @@ extern void right_button_pressed(GtkTreeView *tree_view, GtkTreePath *path, int type); extern gboolean row_clicked(GtkTreeView *tree_view, GdkEventButton *event, const display_data_t *display_data); -extern popup_info_t *create_popup_info(int type, int dest_type, char *title); +extern popup_info_t *create_popup_info(int type, int dest_type, char *title, + int *node_inx); extern void setup_popup_info(popup_info_t *popup_win, display_data_t *display_data, int cnt);