/*
* gpx_trace - zavai GPX trace functions
*
- * Copyright (C) 2009 Enrico Zini <enrico@enricozini.org>
+ * Copyright (C) 2009--2010 Enrico Zini <enrico@enricozini.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
namespace ui {
namespace gps {
-#if 0
public class Waypoint : BigButton
{
public Waypoint()
{
set_label("Take waypoint");
- zavai.gps.gpx.tracking_changed += on_gpx_tracking_changed;
+ zavai.gps.gpx.toggled += on_gpx_toggled;
clicked += on_clicked;
- set_sensitive(zavai.gps.gpx.tracking);
+ set_sensitive(zavai.gps.gpx.started);
}
- protected void on_gpx_tracking_changed(zavai.gps.GPX gpx, bool new_state)
+ protected void on_gpx_toggled(bool new_state)
{
stderr.printf("Toggled %d\n", (int)new_state);
set_sensitive(new_state);
else:
self.recorder.stop()
*/
-#endif
public class GPSRequestLink : Gtk.ToggleButton
{
label_start = "Keep GPS on";
label_stop = "Stop keeping GPS on";
set_size_request(0, zavai.config.min_button_height);
+ set_active(zavai.gps.gps.started);
toggled += on_toggled;
set_label(get_active() ? label_stop : label_start);
private void on_toggled(Gtk.Button src)
{
-stderr.printf("TOGGOLED\n");
if (get_active())
zavai.gps.gps.request("servicerequestlink");
else
}
}
-#if 0
-public class GPSStuck : Gtk.Button
-{
- protected bool happened;
-
- public GPSStuck()
- {
- label = "The GPS is stuck";
- happened = false;
- clicked += on_clicked;
- set_size_request(0, zavai.config.min_button_height);
- }
-
- public void on_clicked()
- {
- zavai.gps.gps.power_cycle(happened);
- happened = !happened;
- if (happened)
- label = "The GPS is stuck AGAIN";
- else
- label = "The GPS is stuck";
- }
-}
-#endif
public void init()
{
/*
*/
// Apps
- // var menu_waypoint = new Waypoint();
+ var menu_waypoint = new Waypoint();
var menu_gpsrequest = new GPSRequestLink();
// Menus
zavai.menu_gps.add_service_toggle(zavai.gps.gpx, "Start GPX trace", "Stop GPX trace");
//zavai.menu_gps.add_applet("ui.gps.monitor");
- //zavai.menu_gps.add_widget(menu_waypoint);
+ zavai.menu_gps.add_widget(menu_waypoint);
zavai.menu_gps.add_widget(menu_gpsrequest);
//zavai.menu_gps.add_widget(new GPSStuck());
}