diff options
author | Keith Packard <keithp@keithp.com> | 2009-05-17 01:29:06 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-05-17 01:29:06 -0700 |
commit | 1234694eb903b204488ddc7cb30bcfe34bf1e677 (patch) | |
tree | bedd82fba6f84e7cdcc95a586184b37de5949a23 | |
parent | 4316b6af86b37522038e642235c163fcaad52e96 (diff) |
Clear table, reset log on disconnect
-rw-r--r-- | aoview/aoview.h | 8 | ||||
-rw-r--r-- | aoview/aoview_log.c | 3 | ||||
-rw-r--r-- | aoview/aoview_monitor.c | 2 | ||||
-rw-r--r-- | aoview/aoview_table.c | 6 |
4 files changed, 18 insertions, 1 deletions
diff --git a/aoview/aoview.h b/aoview/aoview.h index a3214128..f584045f 100644 --- a/aoview/aoview.h +++ b/aoview/aoview.h @@ -110,6 +110,9 @@ void aoview_state_notify(struct aostate *state); void +aoview_state_new(void); + +void aoview_state_init(GladeXML *xml); int16_t @@ -143,6 +146,9 @@ void aoview_log_printf(char *format, ...); void +aoview_log_new(void); + +void aoview_table_start(void); 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 @@ -52,6 +52,12 @@ aoview_table_finish(void) } void +aoview_table_clear(void) +{ + gtk_tree_view_set_model(dataview, NULL); +} + +void aoview_table_init(GladeXML *xml) { dataview = GTK_TREE_VIEW(glade_xml_get_widget(xml, "dataview")); |