From 1234694eb903b204488ddc7cb30bcfe34bf1e677 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 17 May 2009 01:29:06 -0700 Subject: [PATCH] Clear table, reset log on disconnect --- aoview/aoview.h | 8 ++++++++ aoview/aoview_log.c | 3 ++- aoview/aoview_monitor.c | 2 ++ aoview/aoview_table.c | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/aoview/aoview.h b/aoview/aoview.h index a3214128..f584045f 100644 --- a/aoview/aoview.h +++ b/aoview/aoview.h @@ -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_ */ diff --git a/aoview/aoview_log.c b/aoview/aoview_log.c index 623c5aa6..a9300f61 100644 --- a/aoview/aoview_log.c +++ b/aoview/aoview_log.c @@ -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 diff --git a/aoview/aoview_monitor.c b/aoview/aoview_monitor.c index ba2e9df7..5c2daaa5 100644 --- a/aoview/aoview_monitor.c +++ b/aoview/aoview_monitor.c @@ -31,6 +31,8 @@ aoview_monitor_disconnect(void) aoview_serial_close(monitor_serial); monitor_serial = NULL; } + aoview_table_clear(); + aoview_log_new(); } static void diff --git a/aoview/aoview_table.c b/aoview/aoview_table.c index e55f8f50..b3fc6a47 100644 --- a/aoview/aoview_table.c +++ b/aoview/aoview_table.c @@ -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) { -- 2.30.2