Clear table, reset log on disconnect
authorKeith Packard <keithp@keithp.com>
Sun, 17 May 2009 08:29:06 +0000 (01:29 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 17 May 2009 08:29:06 +0000 (01:29 -0700)
aoview/aoview.h
aoview/aoview_log.c
aoview/aoview_monitor.c
aoview/aoview_table.c

index a321412..f584045 100644 (file)
@@ -109,6 +109,9 @@ aoview_usbdev_free(struct usbdev *usbdev);
 void
 aoview_state_notify(struct aostate *state);
 
+void
+aoview_state_new(void);
+
 void
 aoview_state_init(GladeXML *xml);
 
@@ -142,6 +145,9 @@ aoview_log_get_serial(void);
 void
 aoview_log_printf(char *format, ...);
 
+void
+aoview_log_new(void);
+
 void
 aoview_table_start(void);
 
@@ -154,5 +160,7 @@ aoview_table_finish(void);
 void
 aoview_table_init(GladeXML *xml);
 
+void
+aoview_table_clear(void);
 
 #endif /* _AOVIEW_H_ */
index 623c5aa..a9300f6 100644 (file)
@@ -52,7 +52,7 @@ aoview_log_configure(GtkWidget *widget, gpointer data)
        gtk_widget_hide(GTK_WIDGET(chooser));
 }
 
-static void
+void
 aoview_log_new(void)
 {
        if (aoview_log_file) {
@@ -60,6 +60,7 @@ aoview_log_new(void)
                aoview_log_file = NULL;
        }
        aoview_log_failed = 0;
+       aoview_state_new();
 }
 
 static void
index ba2e9df..5c2daaa 100644 (file)
@@ -31,6 +31,8 @@ aoview_monitor_disconnect(void)
                aoview_serial_close(monitor_serial);
                monitor_serial = NULL;
        }
+       aoview_table_clear();
+       aoview_log_new();
 }
 
 static void
index e55f8f5..b3fc6a4 100644 (file)
@@ -51,6 +51,12 @@ aoview_table_finish(void)
        gtk_tree_view_columns_autosize(dataview);
 }
 
+void
+aoview_table_clear(void)
+{
+       gtk_tree_view_set_model(dataview, NULL);
+}
+
 void
 aoview_table_init(GladeXML *xml)
 {