#include "fio.h"
#include "gfio.h"
#include "ghelpers.h"
+#include "goptions.h"
#include "graph.h"
static int gfio_server_running;
static void gfio_update_thread_status(struct gui_entry *ge, char *status_message, double perc);
static void gfio_update_thread_status_all(char *status_message, double perc);
-void report_error(GError *error);
+static void report_error(GError *error);
static struct graph *setup_iops_graph(void)
{
g->bandwidth_graph = setup_bandwidth_graph();
}
-static void multitext_add_entry(struct multitext_widget *mt, const char *text)
-{
- mt->text = realloc(mt->text, (mt->max_text + 1) * sizeof(char *));
- mt->text[mt->max_text] = strdup(text);
- mt->max_text++;
-}
-
-static void multitext_set_entry(struct multitext_widget *mt, unsigned int index)
-{
- if (index >= mt->max_text)
- return;
- if (!mt->text || !mt->text[index])
- return;
-
- mt->cur_text = index;
- gtk_entry_set_text(GTK_ENTRY(mt->entry), mt->text[index]);
-}
-
-static void multitext_update_entry(struct multitext_widget *mt,
- unsigned int index, const char *text)
-{
- if (!mt->text)
- return;
-
- if (mt->text[index])
- free(mt->text[index]);
-
- mt->text[index] = strdup(text);
- if (mt->cur_text == index)
- gtk_entry_set_text(GTK_ENTRY(mt->entry), mt->text[index]);
-}
-
-static void multitext_free(struct multitext_widget *mt)
-{
- int i;
-
- gtk_entry_set_text(GTK_ENTRY(mt->entry), "");
-
- for (i = 0; i < mt->max_text; i++) {
- if (mt->text[i])
- free(mt->text[i]);
- }
-
- free(mt->text);
- mt->cur_text = -1;
- mt->max_text = 0;
-}
-
static void clear_ge_ui_info(struct gui_entry *ge)
{
gtk_label_set_text(GTK_LABEL(ge->probe.hostname), "");
case GE_STATE_NEW:
connect_state = 1;
- edit_state = 0;
+ edit_state = 1;
connect_str = "Connect";
send_state = 0;
start_state = 0;
break;
case GE_STATE_CONNECTED:
connect_state = 1;
- edit_state = 0;
+ edit_state = 1;
connect_str = "Disconnect";
send_state = 1;
start_state = 0;
break;
case GE_STATE_JOB_SENT:
connect_state = 1;
- edit_state = 0;
+ edit_state = 1;
connect_str = "Disconnect";
send_state = 0;
start_state = 1;
update_button_states(ge->ui, ge);
}
-#define ALIGN_LEFT 1
-#define ALIGN_RIGHT 2
-#define INVISIBLE 4
-#define UNSORTABLE 8
-
-GtkTreeViewColumn *tree_view_column(GtkWidget *tree_view, int index, const char *title, unsigned int flags)
-{
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *col;
- double xalign = 0.0; /* left as default */
- PangoAlignment align;
- gboolean visible;
-
- align = (flags & ALIGN_LEFT) ? PANGO_ALIGN_LEFT :
- (flags & ALIGN_RIGHT) ? PANGO_ALIGN_RIGHT :
- PANGO_ALIGN_CENTER;
- visible = !(flags & INVISIBLE);
-
- renderer = gtk_cell_renderer_text_new();
- col = gtk_tree_view_column_new();
-
- gtk_tree_view_column_set_title(col, title);
- if (!(flags & UNSORTABLE))
- gtk_tree_view_column_set_sort_column_id(col, index);
- gtk_tree_view_column_set_resizable(col, TRUE);
- gtk_tree_view_column_pack_start(col, renderer, TRUE);
- gtk_tree_view_column_add_attribute(col, renderer, "text", index);
- gtk_object_set(GTK_OBJECT(renderer), "alignment", align, NULL);
- switch (align) {
- case PANGO_ALIGN_LEFT:
- xalign = 0.0;
- break;
- case PANGO_ALIGN_CENTER:
- xalign = 0.5;
- break;
- case PANGO_ALIGN_RIGHT:
- xalign = 1.0;
- break;
- }
- gtk_cell_renderer_set_alignment(GTK_CELL_RENDERER(renderer), xalign, 0.5);
- gtk_tree_view_column_set_visible(col, visible);
- gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), col);
- return col;
-}
-
static void gfio_ui_setup_log(struct gui *ui)
{
GtkTreeSelection *selection;
g = graph_new(xdim, ydim, gfio_graph_font);
graph_title(g, title);
graph_x_title(g, "Percentile");
+ graph_y_title(g, "Time");
for (i = 0; i < len; i++) {
char fbuf[8];
g = graph_new(xdim, ydim, gfio_graph_font);
graph_title(g, title);
graph_x_title(g, "Buckets");
+ graph_y_title(g, "Percent");
for (i = 0; i < len; i++) {
graph_add_label(g, labels[i]);
scroll = get_scrolled_window(5);
vbox = gtk_vbox_new(FALSE, 3);
box = gtk_hbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), box, TRUE, FALSE, 5);
+ gtk_box_pack_start(GTK_BOX(vbox), box, FALSE, FALSE, 5);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), vbox);
res_notebook = get_results_window(ge);
}
}
-void report_error(GError *error)
+static void report_error(GError *error)
{
struct gui *ui = &main_ui;
gc = malloc(sizeof(*gc));
memset(gc, 0, sizeof(*gc));
+ options_default_fill(&gc->o);
gc->ge = ge;
gc->client = fio_get_client(client);
static void edit_job_entry(GtkWidget *w, gpointer data)
{
+ struct gui *ui = (struct gui *) data;
+ struct gui_entry *ge;
+
+ ge = get_ge_from_cur_tab(ui);
+ if (ge && ge->client)
+ gopt_get_options_window(ui->window, &ge->client->o);
}
static void start_job_entry(GtkWidget *w, gpointer data)
{ "Preferences", GTK_STOCK_PREFERENCES, NULL, "<Control>p", NULL, G_CALLBACK(preferences) },
{ "ViewLog", NULL, "Log", "<Control>l", NULL, G_CALLBACK(view_log) },
{ "ViewResults", NULL, "Results", "<Control>R", NULL, G_CALLBACK(view_results) },
- { "ConnectJob", NULL, "Connect", "<Control>E", NULL, G_CALLBACK(connect_job_entry) },
+ { "ConnectJob", NULL, "Connect", "<Control>D", NULL, G_CALLBACK(connect_job_entry) },
{ "EditJob", NULL, "Edit job", "<Control>E", NULL, G_CALLBACK(edit_job_entry) },
{ "SendJob", NULL, "Send job", "<Control>X", NULL, G_CALLBACK(send_job_entry) },
{ "StartJob", NULL, "Start job", "<Control>L", NULL, G_CALLBACK(start_job_entry) },