]> git.gag.com Git - fw/altos/blob - ao-tools/ao-view/aoview_log.c
update changelog for Debian build
[fw/altos] / ao-tools / ao-view / aoview_log.c
1 /*
2  * Copyright © 2009 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
16  */
17
18 #include "aoview.h"
19
20 static struct aoview_file       *aoview_log;
21
22 void
23 aoview_log_new(void)
24 {
25         aoview_file_finish(aoview_log);
26         aoview_state_new();
27 }
28
29 void
30 aoview_log_set_serial(int serial)
31 {
32         aoview_file_set_serial(aoview_log, serial);
33 }
34
35 int
36 aoview_log_get_serial(void)
37 {
38         return aoview_file_get_serial(aoview_log);
39 }
40
41 void
42 aoview_log_set_flight(int flight)
43 {
44         aoview_file_set_flight(aoview_log, flight);
45 }
46
47 int
48 aoview_log_get_flight(void)
49 {
50         return aoview_file_get_flight(aoview_log);
51 }
52
53 void
54 aoview_log_printf(char *format, ...)
55 {
56         va_list ap;
57
58         va_start(ap, format);
59         aoview_file_vprintf(aoview_log, format, ap);
60         va_end(ap);
61 }
62
63 static void
64 aoview_log_new_item(GtkWidget *widget, gpointer data)
65 {
66         aoview_file_finish(aoview_log);
67 }
68
69 void
70 aoview_log_init(GladeXML *xml)
71 {
72         GtkWidget       *log_new;
73
74         aoview_log = aoview_file_new("telem");
75         assert(aoview_log);
76
77         log_new = glade_xml_get_widget(xml, "log_new");
78         assert(log_new);
79         g_signal_connect(G_OBJECT(log_new), "activate",
80                          G_CALLBACK(aoview_log_new_item),
81                          NULL);
82 }