Lines Matching refs:gjv
20 struct gopt_job_view *gjv; member
94 static GtkWidget *gopt_get_group_frame(struct gopt_job_view *gjv, in gopt_get_group_frame() argument
111 gfw = &gjv->g_widgets[group]; in gopt_get_group_frame()
131 static void gopt_set_children_visible(struct gopt_job_view *gjv, in gopt_set_children_visible() argument
151 gopt_set_children_visible(gjv, o, visible); in gopt_set_children_visible()
158 static void gopt_mark_index(struct gopt_job_view *gjv, struct gopt *gopt, in gopt_mark_index() argument
163 assert(!gjv->gopts[idx]); in gopt_mark_index()
166 gopt->gjv = gjv; in gopt_mark_index()
167 gjv->gopts[idx] = gopt; in gopt_mark_index()
170 static void gopt_dialog_update_apply_button(struct gopt_job_view *gjv) in gopt_dialog_update_apply_button() argument
172 GtkDialog *dialog = GTK_DIALOG(gjv->dialog); in gopt_dialog_update_apply_button()
175 set = !flist_empty(&gjv->changed_list); in gopt_dialog_update_apply_button()
179 gtk_widget_set_sensitive(gjv->job_combo, 0); in gopt_dialog_update_apply_button()
180 gtk_widget_set_tooltip_text(gjv->job_combo, "Apply option changes before switching to a new job"); in gopt_dialog_update_apply_button()
182 gtk_widget_set_sensitive(gjv->job_combo, 1); in gopt_dialog_update_apply_button()
183 gtk_widget_set_tooltip_text(gjv->job_combo, "Change current job"); in gopt_dialog_update_apply_button()
189 struct gopt_job_view *gjv = gopt->gjv; in gopt_changed() local
191 if (gjv->in_job_switch) in gopt_changed()
199 flist_add_tail(&gopt->changed_list, &gjv->changed_list); in gopt_changed()
200 gopt_dialog_update_apply_button(gjv); in gopt_changed()
216 gopt_set_children_visible(s->gopt.gjv, o, set); in gopt_str_changed()
233 static struct gopt *gopt_new_str_store(struct gopt_job_view *gjv, in gopt_new_str_store() argument
249 gopt_mark_index(gjv, &s->gopt, idx, GOPT_STR); in gopt_new_str_store()
275 gopt_set_children_visible(c->gopt.gjv, o, index); in gopt_combo_changed()
286 static struct gopt_combo *__gopt_new_combo(struct gopt_job_view *gjv, in __gopt_new_combo() argument
302 gopt_mark_index(gjv, &c->gopt, idx, type); in __gopt_new_combo()
329 static struct gopt *gopt_new_combo_str(struct gopt_job_view *gjv, in gopt_new_combo_str() argument
337 c = __gopt_new_combo(gjv, o, idx, GOPT_COMBO_STR); in gopt_new_combo_str()
374 static struct gopt *gopt_new_combo_int(struct gopt_job_view *gjv, in gopt_new_combo_int() argument
382 c = __gopt_new_combo(gjv, o, idx, GOPT_COMBO_INT); in gopt_new_combo_int()
420 static struct gopt *gopt_new_str_multi(struct gopt_job_view *gjv, in gopt_new_str_multi() argument
430 gopt_mark_index(gjv, &m->gopt, idx, GOPT_STR_MULTI); in gopt_new_str_multi()
500 static struct gopt_int *__gopt_new_int(struct gopt_job_view *gjv, in __gopt_new_int() argument
535 gopt_mark_index(gjv, &i->gopt, idx, GOPT_INT); in __gopt_new_int()
550 static struct gopt *gopt_new_int(struct gopt_job_view *gjv, in gopt_new_int() argument
559 i = __gopt_new_int(gjv, o, &ullp, idx); in gopt_new_int()
561 i = __gopt_new_int(gjv, o, NULL, idx); in gopt_new_int()
566 static struct gopt *gopt_new_ullong(struct gopt_job_view *gjv, in gopt_new_ullong() argument
572 i = __gopt_new_int(gjv, o, p, idx); in gopt_new_ullong()
597 gopt_set_children_visible(b->gopt.gjv, o, set); in gopt_bool_toggled()
613 static struct gopt *gopt_new_bool(struct gopt_job_view *gjv, in gopt_new_bool() argument
629 gopt_mark_index(gjv, &b->gopt, idx, GOPT_BOOL); in gopt_new_bool()
706 static struct gopt *gopt_new_int_range(struct gopt_job_view *gjv, in gopt_new_int_range() argument
719 gopt_mark_index(gjv, &r->gopt, idx, GOPT_RANGE); in gopt_new_int_range()
823 static struct gopt *gopt_new_str_val(struct gopt_job_view *gjv, in gopt_new_str_val() argument
838 gopt_mark_index(gjv, &g->gopt, idx, GOPT_STR_VAL); in gopt_new_str_val()
868 static void gopt_set_option(struct gopt_job_view *gjv, struct fio_option *o, in gopt_set_option() argument
1006 static void gopt_add_option(struct gopt_job_view *gjv, GtkWidget *hbox, in gopt_add_option() argument
1019 go = gopt_new_str_val(gjv, o, ullp, opt_index); in gopt_add_option()
1028 go = gopt_new_ullong(gjv, o, ullp, opt_index); in gopt_add_option()
1038 go = gopt_new_combo_int(gjv, o, ip, opt_index); in gopt_add_option()
1045 go = gopt_new_int(gjv, o, ip, opt_index); in gopt_add_option()
1055 go = gopt_new_bool(gjv, o, ip, opt_index); in gopt_add_option()
1065 go = gopt_new_combo_int(gjv, o, ip, opt_index); in gopt_add_option()
1068 go = gopt_new_str_store(gjv, o, NULL, opt_index); in gopt_add_option()
1082 go = gopt_new_str_store(gjv, o, text, opt_index); in gopt_add_option()
1086 go = gopt_new_combo_str(gjv, o, text, opt_index); in gopt_add_option()
1090 go = gopt_new_str_multi(gjv, o, opt_index); in gopt_add_option()
1098 go = gopt_new_int_range(gjv, o, ip, opt_index); in gopt_add_option()
1119 dest = gopt_get_group_frame(gjv, hbox, o->group); in gopt_add_option()
1127 static void gopt_add_options(struct gopt_job_view *gjv, in gopt_add_options() argument
1142 GtkWidget *vbox = gjv->vboxes[ffz(~og->mask)]; in gopt_add_options()
1146 gopt_add_option(gjv, hbox, o, i, to); in gopt_add_options()
1151 static void gopt_set_options(struct gopt_job_view *gjv, in gopt_set_options() argument
1158 struct gopt *gopt = gjv->gopts[i]; in gopt_set_options()
1160 gopt_set_option(gjv, o, gopt, to); in gopt_set_options()
1185 static void gopt_add_group_tabs(GtkWidget *notebook, struct gopt_job_view *gjv) in gopt_add_group_tabs() argument
1197 gjv->vboxes[i] = gopt_add_group_tab(notebook, og); in gopt_add_group_tabs()
1202 static void gopt_handle_str_multi_changed(struct gopt_job_view *gjv, in gopt_handle_str_multi_changed() argument
1206 unsigned int *ip = td_var(gjv->o, o, o->off1); in gopt_handle_str_multi_changed()
1232 static void gopt_handle_range_changed(struct gopt_job_view *gjv, in gopt_handle_range_changed() argument
1236 unsigned int *ip[4] = { td_var(gjv->o, o, o->off1), in gopt_handle_range_changed()
1237 td_var(gjv->o, o, o->off2), in gopt_handle_range_changed()
1238 td_var(gjv->o, o, o->off3), in gopt_handle_range_changed()
1239 td_var(gjv->o, o, o->off4) }; in gopt_handle_range_changed()
1249 static void gopt_handle_str_val_changed(struct gopt_job_view *gjv, in gopt_handle_str_val_changed() argument
1253 unsigned long long *ullp = td_var(gjv->o, o, o->off1); in gopt_handle_str_val_changed()
1274 static void gopt_handle_str_changed(struct gopt_job_view *gjv, in gopt_handle_str_changed() argument
1277 char **p = td_var(gjv->o, o, o->off1); in gopt_handle_str_changed()
1285 static void gopt_handle_bool_changed(struct gopt_job_view *gjv, in gopt_handle_bool_changed() argument
1288 unsigned int *ip = td_var(gjv->o, o, o->off1); in gopt_handle_bool_changed()
1295 static void gopt_handle_int_changed(struct gopt_job_view *gjv, in gopt_handle_int_changed() argument
1298 unsigned int *ip = td_var(gjv->o, o, o->off1); in gopt_handle_int_changed()
1307 static void gopt_handle_combo_str_changed(struct gopt_job_view *gjv, in gopt_handle_combo_str_changed() argument
1311 char **p = td_var(gjv->o, o, o->off1); in gopt_handle_combo_str_changed()
1319 static void gopt_handle_combo_int_changed(struct gopt_job_view *gjv, in gopt_handle_combo_int_changed() argument
1323 unsigned int *ip = td_var(gjv->o, o, o->off1); in gopt_handle_combo_int_changed()
1333 struct gopt_job_view *gjv = gopt->gjv; in gopt_handle_changed() local
1340 gopt_handle_combo_int_changed(gjv, c, o); in gopt_handle_changed()
1347 gopt_handle_combo_str_changed(gjv, c, o); in gopt_handle_changed()
1354 gopt_handle_int_changed(gjv, i, o); in gopt_handle_changed()
1361 gopt_handle_bool_changed(gjv, b, o); in gopt_handle_changed()
1368 gopt_handle_str_changed(gjv, s, o); in gopt_handle_changed()
1375 gopt_handle_str_val_changed(gjv, s, o); in gopt_handle_changed()
1382 gopt_handle_range_changed(gjv, r, o); in gopt_handle_changed()
1389 gopt_handle_str_multi_changed(gjv, m, o); in gopt_handle_changed()
1398 static void gopt_report_update_status(struct gopt_job_view *gjv) in gopt_report_update_status() argument
1400 struct gfio_client *gc = gjv->client; in gopt_report_update_status()
1407 static int gopt_handle_changed_options(struct gopt_job_view *gjv) in gopt_handle_changed_options() argument
1409 struct gfio_client *gc = gjv->client; in gopt_handle_changed_options()
1415 flist_for_each(entry, &gjv->changed_list) { in gopt_handle_changed_options()
1423 ret = fio_client_update_options(gc->client, gjv->o, &waitid); in gopt_handle_changed_options()
1435 while (!flist_empty(&gjv->changed_list)) { in gopt_handle_changed_options()
1436 gopt = flist_first_entry(&gjv->changed_list, struct gopt, changed_list); in gopt_handle_changed_options()
1441 gopt_dialog_update_apply_button(gjv); in gopt_handle_changed_options()
1471 static void gopt_handle_option_dialog(struct gopt_job_view *gjv) in gopt_handle_option_dialog() argument
1476 response = gtk_dialog_run(GTK_DIALOG(gjv->dialog)); in gopt_handle_option_dialog()
1485 gopt_handle_changed_options(gjv); in gopt_handle_option_dialog()
1486 gopt_report_update_status(gjv); in gopt_handle_option_dialog()
1492 gopt_handle_changed_options(gjv); in gopt_handle_option_dialog()
1497 struct gopt_job_view *gjv = (struct gopt_job_view *) data; in gopt_job_changed() local
1499 struct gfio_client *gc = gjv->client; in gopt_job_changed()
1507 if (!flist_empty(&gjv->changed_list)) { in gopt_job_changed()
1512 job = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(gjv->job_combo)); in gopt_job_changed()
1532 gjv->in_job_switch = 1; in gopt_job_changed()
1533 gopt_set_options(gjv, &gco->o); in gopt_job_changed()
1534 gjv->in_job_switch = 0; in gopt_job_changed()
1542 struct gopt_job_view *gjv; in gopt_get_options_window() local
1578 gjv = calloc(1, sizeof(*gjv)); in gopt_get_options_window()
1579 INIT_FLIST_HEAD(&gjv->changed_list); in gopt_get_options_window()
1581 gjv->o = &gco->o; in gopt_get_options_window()
1582 gjv->dialog = dialog; in gopt_get_options_window()
1583 gjv->client = gc; in gopt_get_options_window()
1584 gjv->job_combo = combo; in gopt_get_options_window()
1585 gopt_add_group_tabs(notebook, gjv); in gopt_get_options_window()
1586 gopt_add_options(gjv, &gco->o); in gopt_get_options_window()
1587 gopt_dialog_update_apply_button(gjv); in gopt_get_options_window()
1589 g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(gopt_job_changed), gjv); in gopt_get_options_window()
1593 gopt_handle_option_dialog(gjv); in gopt_get_options_window()
1596 free(gjv); in gopt_get_options_window()