Clear UI/progress bar on disconnect/quit

And ensure that server idle loop sends run command once per
idle loop entry.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/gfio.c b/gfio.c
index 03b4a13..3c25c4e 100644
--- a/gfio.c
+++ b/gfio.c
@@ -99,6 +99,24 @@
 	char **job_files;
 } ui;
 
+static void clear_ui_info(struct gui *ui)
+{
+	gtk_label_set_text(GTK_LABEL(ui->probe.hostname), "");
+	gtk_label_set_text(GTK_LABEL(ui->probe.os), "");
+	gtk_label_set_text(GTK_LABEL(ui->probe.arch), "");
+	gtk_label_set_text(GTK_LABEL(ui->probe.fio_ver), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.name), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.iotype), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.ioengine), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.iodepth), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.jobs), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.files), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.read_bw), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.read_iops), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.write_bw), "");
+	gtk_label_set_text(GTK_LABEL(ui->eta.write_iops), "");
+}
+
 static void gfio_set_connected(struct gui *ui, int connected)
 {
 	if (connected) {
@@ -109,6 +127,7 @@
 		ui->connected = 0;
 		gtk_button_set_label(GTK_BUTTON(ui->button[CONNECT_BUTTON]), "Connect");
 		gtk_widget_set_sensitive(ui->button[START_JOB_BUTTON], 0);
+		clear_ui_info(ui);
 	}
 }
 
@@ -445,6 +464,7 @@
 	if (!ui->connected) {
 		if (!ui->nr_job_files)
 			file_open(widget, data);
+		gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ui->thread_status_pb), "No jobs running");
 		fio_clients_connect();
 		pthread_create(&ui->t, NULL, job_thread, NULL);
 		gfio_set_connected(ui, 1);
@@ -842,7 +862,7 @@
 	 */
 	ui->thread_status_pb = gtk_progress_bar_new();
 	gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ui->thread_status_pb), 0.0);
-	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ui->thread_status_pb), "No jobs running");
+	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ui->thread_status_pb), "No connections");
 	gtk_container_add(GTK_CONTAINER(ui->buttonbox), ui->thread_status_pb);