Lines Matching refs:ui

146 static void set_menu_entry_text(struct gui *ui, const char *path,  in set_menu_entry_text()  argument
151 w = gtk_ui_manager_get_widget(ui->uimanager, path); in set_menu_entry_text()
159 static void set_menu_entry_visible(struct gui *ui, const char *path, int show) in set_menu_entry_visible() argument
163 w = gtk_ui_manager_get_widget(ui->uimanager, path); in set_menu_entry_visible()
170 static void set_job_menu_visible(struct gui *ui, int visible) in set_job_menu_visible() argument
172 set_menu_entry_visible(ui, "/MainMenu/JobMenu", visible); in set_job_menu_visible()
175 static void set_view_results_visible(struct gui *ui, int visible) in set_view_results_visible() argument
177 set_menu_entry_visible(ui, "/MainMenu/ViewMenu/Results", visible); in set_view_results_visible()
217 static void update_button_states(struct gui *ui, struct gui_entry *ge) in update_button_states() argument
276 set_menu_entry_visible(ui, "/MainMenu/JobMenu/Connect", connect_state); in update_button_states()
277 set_menu_entry_text(ui, "/MainMenu/JobMenu/Connect", connect_str); in update_button_states()
279 set_menu_entry_visible(ui, "/MainMenu/JobMenu/Edit job", edit_state); in update_button_states()
280 set_menu_entry_visible(ui, "/MainMenu/JobMenu/Send job", send_state); in update_button_states()
281 set_menu_entry_visible(ui, "/MainMenu/JobMenu/Start job", start_state); in update_button_states()
284 set_view_results_visible(ui, 1); in update_button_states()
286 set_view_results_visible(ui, 0); in update_button_states()
292 update_button_states(ge->ui, ge); in gfio_set_state()
295 static void gfio_ui_setup_log(struct gui *ui) in gfio_ui_setup_log() argument
316 ui->log_model = model; in gfio_ui_setup_log()
317 ui->log_tree = tree_view; in gfio_ui_setup_log()
398 g_hash_table_remove(ge->ui->ge_hash, &ge->page_num); in ge_destroy()
412 static void gfio_quit(struct gui *ui) in gfio_quit() argument
420 struct gui *ui = (struct gui *) data; in quit_clicked() local
422 gfio_quit(ui); in quit_clicked()
427 struct gui *ui = arg; in job_thread() local
429 ui->handler_running = 1; in job_thread()
431 ui->handler_running = 0; in job_thread()
469 static void gfio_start_server(struct gui *ui) in gfio_start_server() argument
473 pthread_create(&ui->server_t, NULL, server_thread, NULL); in gfio_start_server()
474 pthread_detach(ui->server_t); in gfio_start_server()
535 struct gui *ui = ge->ui; in get_connection_details() local
542 GTK_WINDOW(ui->window), in get_connection_details()
672 file_open(widget, ge->ui); in connect_clicked()
700 if (!ge->ui->handler_running) in connect_clicked()
701 pthread_create(&ge->ui->t, NULL, job_thread, ge->ui); in connect_clicked()
724 static struct gui_entry *alloc_new_gui_entry(struct gui *ui) in alloc_new_gui_entry() argument
731 ge->ui = ui; in alloc_new_gui_entry()
735 static struct gui_entry *get_new_ge_with_tab(struct gui *ui, const char *name) in get_new_ge_with_tab() argument
739 ge = alloc_new_gui_entry(ui); in get_new_ge_with_tab()
745 ge->page_num = gtk_notebook_append_page(GTK_NOTEBOOK(ui->notebook), ge->vbox, ge->page_label); in get_new_ge_with_tab()
747 g_hash_table_insert(ui->ge_hash, &ge->page_num, ge); in get_new_ge_with_tab()
749 gtk_widget_show_all(ui->window); in get_new_ge_with_tab()
755 struct gui *ui = (struct gui *) data; in file_new() local
758 ge = get_new_ge_with_tab(ui, "Untitled"); in file_new()
759 gtk_notebook_set_current_page(GTK_NOTEBOOK(ui->notebook), ge->page_num); in file_new()
766 static struct gui_entry *get_ge_from_page(struct gui *ui, gint cur_page, in get_ge_from_page() argument
772 return get_new_ge_with_tab(ui, "Untitled"); in get_ge_from_page()
778 return g_hash_table_lookup(ui->ge_hash, &cur_page); in get_ge_from_page()
781 static struct gui_entry *get_ge_from_cur_tab(struct gui *ui) in get_ge_from_cur_tab() argument
789 cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(ui->notebook)); in get_ge_from_cur_tab()
791 return get_ge_from_page(ui, cur_page, NULL); in get_ge_from_cur_tab()
798 struct gui *ui = (struct gui *) data; in file_close() local
804 ge = get_ge_from_cur_tab(ui); in file_close()
810 if (g_hash_table_size(ui->ge_hash)) { in file_close()
811 gfio_report_info(ui, "Error", "The main page view cannot be closed\n"); in file_close()
815 gfio_quit(ui); in file_close()
818 static void file_add_recent(struct gui *ui, const gchar *uri) in file_add_recent() argument
829 gtk_recent_manager_add_full(ui->recentmanager, uri, &grd); in file_add_recent()
857 file_add_recent(ge->ui, uri); in do_file_open()
869 static int do_file_open_with_tab(struct gui *ui, const gchar *uri) in do_file_open_with_tab() argument
879 cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(ui->notebook)); in do_file_open_with_tab()
880 ge = get_ge_from_page(ui, cur_page, &ge_is_new); in do_file_open_with_tab()
882 ge = get_new_ge_with_tab(ui, "Untitled"); in do_file_open_with_tab()
886 gtk_notebook_set_current_page(GTK_NOTEBOOK(ui->notebook), ge->page_num); in do_file_open_with_tab()
899 gfio_start_server(ui); in do_file_open_with_tab()
910 struct gui *ui = (struct gui *) data; in recent_open() local
917 do_file_open_with_tab(ui, uri); in recent_open()
922 struct gui *ui = data; in file_open() local
928 GTK_WINDOW(ui->window), in file_open()
952 do_file_open_with_tab(ui, filename); in file_open()
958 struct gui *ui = data; in file_save() local
962 GTK_WINDOW(ui->window), in file_save()
983 struct gui *ui = (struct gui *) data; in view_log_destroy() local
985 g_object_ref(G_OBJECT(ui->log_tree)); in view_log_destroy()
986 gtk_container_remove(GTK_CONTAINER(w), ui->log_tree); in view_log_destroy()
988 ui->log_view = NULL; in view_log_destroy()
991 void gfio_view_log(struct gui *ui) in gfio_view_log() argument
995 if (ui->log_view) in gfio_view_log()
998 ui->log_view = win = gtk_window_new(GTK_WINDOW_TOPLEVEL); in gfio_view_log()
1009 gtk_box_pack_start(GTK_BOX(box), ui->log_tree, TRUE, TRUE, 0); in gfio_view_log()
1010 g_signal_connect(box, "destroy", G_CALLBACK(view_log_destroy), ui); in gfio_view_log()
1022 struct gui *ui = (struct gui *) data; in view_log() local
1024 gfio_view_log(ui); in view_log()
1029 struct gui *ui = (struct gui *) data; in connect_job_entry() local
1032 ge = get_ge_from_cur_tab(ui); in connect_job_entry()
1039 struct gui *ui = (struct gui *) data; in send_job_entry() local
1042 ge = get_ge_from_cur_tab(ui); in send_job_entry()
1049 struct gui *ui = (struct gui *) data; in edit_job_entry() local
1052 ge = get_ge_from_cur_tab(ui); in edit_job_entry()
1054 gopt_get_options_window(ui->window, ge->client); in edit_job_entry()
1059 struct gui *ui = (struct gui *) data; in start_job_entry() local
1062 ge = get_ge_from_cur_tab(ui); in start_job_entry()
1069 struct gui *ui = (struct gui *) data; in view_results() local
1073 ge = get_ge_from_cur_tab(ui); in view_results()
1107 struct gui *ui = &main_ui; in update_graph_limits() local
1110 __update_graph_settings(&ui->graphs); in update_graph_limits()
1113 …g_signal_emit_by_name(G_OBJECT(ui->graphs.drawing_area), GFIO_DRAW_EVENT, GTK_WIDGET(ui->graphs.dr… in update_graph_limits()
1116 g_hash_table_foreach(ui->ge_hash, ge_update_settings_fn, NULL); in update_graph_limits()
1123 struct gui *ui = (struct gui *) data; in preferences() local
1127 GTK_WINDOW(ui->window), in preferences()
1311 struct gui *ui) in get_menubar_menu() argument
1317 gtk_action_group_add_actions(action_group, menu_items, nmenu_items, ui); in get_menubar_menu()
1459 static GtkWidget *new_main_page(struct gui *ui) in new_main_page() argument
1482 ui->eta.jobs = new_info_entry_in_frame(probe_box, "Running"); in new_main_page()
1483ui->eta.read_bw = new_info_entry_in_frame_rgb(probe_box, "Read BW", GFIO_READ_R, GFIO_READ_G, GFIO… in new_main_page()
1484ui->eta.read_iops = new_info_entry_in_frame_rgb(probe_box, "IOPS", GFIO_READ_R, GFIO_READ_G, GFIO_… in new_main_page()
1485ui->eta.write_bw = new_info_entry_in_frame_rgb(probe_box, "Write BW", GFIO_WRITE_R, GFIO_WRITE_G, … in new_main_page()
1486ui->eta.write_iops = new_info_entry_in_frame_rgb(probe_box, "IOPS", GFIO_WRITE_R, GFIO_WRITE_G, GF… in new_main_page()
1487ui->eta.trim_bw = new_info_entry_in_frame_rgb(probe_box, "Trim BW", GFIO_TRIM_R, GFIO_TRIM_G, GFIO… in new_main_page()
1488ui->eta.trim_iops = new_info_entry_in_frame_rgb(probe_box, "IOPS", GFIO_TRIM_R, GFIO_TRIM_G, GFIO_… in new_main_page()
1497 ui->eta.cr_bw = new_info_label_in_frame(probe_box, "Commit BW"); in new_main_page()
1498 ui->eta.cr_iops = new_info_label_in_frame(probe_box, "Commit IOPS"); in new_main_page()
1500 ui->eta.cw_bw = new_info_label_in_frame(probe_box, "Commit BW"); in new_main_page()
1501 ui->eta.cw_iops = new_info_label_in_frame(probe_box, "Commit IOPS"); in new_main_page()
1507 ui->graphs.drawing_area = gtk_drawing_area_new(); in new_main_page()
1508 gtk_widget_set_size_request(GTK_WIDGET(ui->graphs.drawing_area), in new_main_page()
1510 gtk_widget_modify_bg(ui->graphs.drawing_area, GTK_STATE_NORMAL, &gfio_color_lightyellow); in new_main_page()
1511 g_signal_connect(G_OBJECT(ui->graphs.drawing_area), GFIO_DRAW_EVENT, in new_main_page()
1512 G_CALLBACK(on_expose_drawing_area), &ui->graphs); in new_main_page()
1513 g_signal_connect(G_OBJECT(ui->graphs.drawing_area), "configure_event", in new_main_page()
1514 G_CALLBACK(on_config_drawing_area), &ui->graphs); in new_main_page()
1519 ui->graphs.drawing_area); in new_main_page()
1523 setup_graphs(&ui->graphs); in new_main_page()
1530 ui->buttonbox = gtk_hbox_new(FALSE, 0); in new_main_page()
1531 gtk_container_add(GTK_CONTAINER(bottom_align), ui->buttonbox); in new_main_page()
1537 ui->thread_status_pb = gtk_progress_bar_new(); in new_main_page()
1538 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ui->thread_status_pb), 0.0); in new_main_page()
1539 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ui->thread_status_pb), "No connections"); in new_main_page()
1540 gtk_container_add(GTK_CONTAINER(ui->buttonbox), ui->thread_status_pb); in new_main_page()
1549 struct gui *ui = (struct gui *) data; in notebook_switch_page() local
1553 set_job_menu_visible(ui, 0); in notebook_switch_page()
1554 set_view_results_visible(ui, 0); in notebook_switch_page()
1558 set_job_menu_visible(ui, 1); in notebook_switch_page()
1559 ge = get_ge_from_page(ui, page, NULL); in notebook_switch_page()
1561 update_button_states(ui, ge); in notebook_switch_page()
1574 static void add_recent_file_items(struct gui *ui) in add_recent_file_items() argument
1580 if (ui->recent_ui_id) { in add_recent_file_items()
1581 gtk_ui_manager_remove_ui(ui->uimanager, ui->recent_ui_id); in add_recent_file_items()
1582 gtk_ui_manager_ensure_update(ui->uimanager); in add_recent_file_items()
1584 ui->recent_ui_id = gtk_ui_manager_new_merge_id(ui->uimanager); in add_recent_file_items()
1586 if (ui->actiongroup) { in add_recent_file_items()
1587 gtk_ui_manager_remove_action_group(ui->uimanager, ui->actiongroup); in add_recent_file_items()
1588 g_object_unref(ui->actiongroup); in add_recent_file_items()
1590 ui->actiongroup = gtk_action_group_new("RecentFileActions"); in add_recent_file_items()
1592 gtk_ui_manager_insert_action_group(ui->uimanager, ui->actiongroup, -1); in add_recent_file_items()
1594 items = gtk_recent_manager_get_items(ui->recentmanager); in add_recent_file_items()
1624 g_signal_connect(action, "activate", G_CALLBACK(recent_open), ui); in add_recent_file_items()
1626 gtk_action_group_add_action(ui->actiongroup, action); in add_recent_file_items()
1629 gtk_ui_manager_add_ui(ui->uimanager, ui->recent_ui_id, in add_recent_file_items()
1648 struct gui *ui = (struct gui *) data; in drag_and_drop_received() local
1665 do_file_open_with_tab(ui, uris[0]); in drag_and_drop_received()
1671 static void init_ui(int *argc, char **argv[], struct gui *ui) in init_ui() argument
1696 ui->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); in init_ui()
1697 gtk_window_set_title(GTK_WINDOW(ui->window), "fio"); in init_ui()
1698 gtk_window_set_default_size(GTK_WINDOW(ui->window), 1024, 768); in init_ui()
1700 g_signal_connect(ui->window, "delete-event", G_CALLBACK(quit_clicked), ui); in init_ui()
1701 g_signal_connect(ui->window, "destroy", G_CALLBACK(quit_clicked), ui); in init_ui()
1703 ui->vbox = gtk_vbox_new(FALSE, 0); in init_ui()
1704 gtk_container_add(GTK_CONTAINER(ui->window), ui->vbox); in init_ui()
1706 ui->uimanager = gtk_ui_manager_new(); in init_ui()
1707 ui->menu = get_menubar_menu(ui->window, ui->uimanager, ui); in init_ui()
1708 gfio_ui_setup(settings, ui->menu, ui->vbox, ui->uimanager); in init_ui()
1710 ui->recentmanager = gtk_recent_manager_get_default(); in init_ui()
1711 add_recent_file_items(ui); in init_ui()
1713 ui->notebook = gtk_notebook_new(); in init_ui()
1714 g_signal_connect(ui->notebook, "switch-page", G_CALLBACK(notebook_switch_page), ui); in init_ui()
1715 gtk_notebook_set_scrollable(GTK_NOTEBOOK(ui->notebook), 1); in init_ui()
1716 gtk_notebook_popup_enable(GTK_NOTEBOOK(ui->notebook)); in init_ui()
1717 gtk_container_add(GTK_CONTAINER(ui->vbox), ui->notebook); in init_ui()
1719 vbox = new_main_page(ui); in init_ui()
1720 gtk_drag_dest_set(GTK_WIDGET(ui->window), GTK_DEST_DEFAULT_ALL, NULL, 1, GDK_ACTION_COPY); in init_ui()
1721 gtk_drag_dest_add_uri_targets(GTK_WIDGET(ui->window)); in init_ui()
1722 g_signal_connect(ui->window, "drag-data-received", G_CALLBACK(drag_and_drop_received), ui); in init_ui()
1724 gtk_notebook_append_page(GTK_NOTEBOOK(ui->notebook), vbox, gtk_label_new("Main")); in init_ui()
1726 gfio_ui_setup_log(ui); in init_ui()
1728 gtk_widget_show_all(ui->window); in init_ui()