static void _get_current_debug_flags(GtkToggleAction *action) { static uint64_t debug_flags = 0, tmp_flags; static slurm_ctl_conf_info_msg_t *slurm_ctl_conf_ptr = NULL; int err_code = get_new_info_config(&slurm_ctl_conf_ptr); GtkAction *debug_action = NULL; GtkToggleAction *toggle_action; gboolean orig_state, new_state; int i; if (err_code != SLURM_ERROR) debug_flags = slurm_ctl_conf_ptr->debug_flags; for (i = 0; i < debug_action_entries; i++) { debug_action = gtk_action_group_get_action( menu_action_group, debug_actions[i].name); toggle_action = GTK_TOGGLE_ACTION(debug_action); orig_state = gtk_toggle_action_get_active(toggle_action); if (debug_str2flags((char *)debug_actions[i].name, &tmp_flags) != SLURM_SUCCESS) { g_error("debug_str2flags no good: %s\n", debug_actions[i].name); continue; } new_state = debug_flags & tmp_flags; if (orig_state != new_state) gtk_toggle_action_set_active(toggle_action, new_state); } }
extern void create_config_popup(GtkAction *action, gpointer user_data) { GtkWidget *popup = gtk_dialog_new_with_buttons( "SLURM Config Info", GTK_WINDOW(user_data), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE, GTK_RESPONSE_OK, NULL); GtkTreeStore *treestore = _local_create_treestore_2cols(popup, 600, 400); static slurm_ctl_conf_info_msg_t *slurm_ctl_conf_ptr = NULL; g_signal_connect(G_OBJECT(popup), "delete_event", G_CALLBACK(_delete_popup), NULL); g_signal_connect(G_OBJECT(popup), "response", G_CALLBACK(_delete_popup), NULL); (void) get_new_info_config(&slurm_ctl_conf_ptr); _layout_conf_ctl(treestore, slurm_ctl_conf_ptr); gtk_widget_show_all(popup); return; }
static void _get_current_debug(GtkRadioAction *action) { static int debug_level = 0; static slurm_ctl_conf_info_msg_t *slurm_ctl_conf_ptr = NULL; static GtkAction *debug_action = NULL; int err_code = get_new_info_config(&slurm_ctl_conf_ptr); if (err_code != SLURM_ERROR) debug_level = slurm_ctl_conf_ptr->slurmctld_debug; if (!debug_action) debug_action = gtk_action_group_get_action( menu_action_group, "debug_quiet"); /* Since this is the inital value we don't signal anything changed so we need to make it happen here */ if (debug_level == 0) debug_inited = 1; sview_radio_action_set_current_value(GTK_RADIO_ACTION(debug_action), debug_level); }