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 a3214128b480b38720a1010eaf67355a90741ce6..f584045f3a517a06ecac28112fbf77ff41a6c72b 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 623c5aa62dbc4148a0a4d98a0dac4869f8262192..a9300f61e7c3d22b95ee70653a041a3f511c34c8 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 ba2e9df79d452873f951516595125ccd7d40e49d..5c2daaa59d3b06561c05aec058494317b870da12 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 e55f8f5070ffce5cb4b64f1e4d9a3f9af66342a4..b3fc6a47c133925d181fbd0e19ff95e343f91d2f 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)
 {