}
static void
+show_tower_directions (void)
+{
+ if (tower_directions)
+ {
+ show_browser (tower_directions);
+ }
+ else
+ {
+ show_message ("I don't know where you are!");
+ }
+}
+
+static void
show_peals_list (void)
{
show_browser (peals_list);
tower_window = hildon_stackable_window_new ();
- if (g_str_has_prefix (details->fields[FieldDedication],
- "S "))
- {
- /* FIXME: This needs to be cleverer, because we can have
- * e.g. "S Peter and S Paul".
- * May have to use regexps.
- * Reallocation in general even when unchanged is okay,
- * because it's the common case (most towers are S Something)
- */
-
- /* FIXME: Since we're passing this in as markup,
- * we need to escape the strings.
- */
-
- str = g_strdup_printf("S<sup>t</sup> %s, %s",
- details->fields[FieldDedication]+2,
- details->fields[FieldPlace]);
-
- }
- else
- {
- str = g_strdup_printf("%s, %s",
- details->fields[FieldDedication],
- details->fields[FieldPlace]);
- }
+ str = g_strdup_printf("%s, %s",
+ details->fields[FieldDedication],
+ details->fields[FieldPlace]);
hildon_window_set_markup (HILDON_WINDOW (tower_window),
str);
}
add_button ("Peals", show_peals_list);
add_button ("Map", show_tower_map);
- add_button ("Directions", NULL);
+ add_button ("Directions", show_tower_directions);
/* don't use a toggle button: it looks stupid */
button = hildon_button_new_with_text (HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
tower_map = g_strdup_printf ("http://maps.google.com/maps?q=%s,%s",
details->fields[FieldLat],
details->fields[FieldLong]);
+ g_free (tower_directions);
+ if (device->fix->fields & LOCATION_GPS_DEVICE_LATLONG_SET)
+ {
+ tower_directions = g_strdup_printf ("http://maps.google.com/maps?q=%f,%f+to+%s,%s",
+ device->fix->latitude,
+ device->fix->longitude,
+ details->fields[FieldLat],
+ details->fields[FieldLong]);
+ }
g_free (tower_displayed);
tower_displayed = g_strdup (details->fields[FieldPrimaryKey]);
button = hildon_button_new_with_text (HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
HILDON_BUTTON_ARRANGEMENT_VERTICAL,
- "View the GNU General Public Licence",
- "This program is provided under the GPL, with no warranty.");
+ "Welcome to Belltower. The program is \xc2\xa9 2009 Thomas Thurman.",
+ "View the program's home page.");
+ g_signal_connect (button, "clicked", G_CALLBACK (show_web_page),
+ "http://belltower.garage.maemo.org");
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+ button,
+ TRUE, TRUE, 0);
+
+ button = hildon_button_new_with_text (HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
+ HILDON_BUTTON_ARRANGEMENT_VERTICAL,
+ "This program is provided under the GNU GPL, with no warranty.",
+ "View the GNU General Public Licence.");
g_signal_connect (button, "clicked", G_CALLBACK (show_web_page),
- "www.gnu.org/copyleft/gpl.html");
+ "http://www.gnu.org/copyleft/gpl.html");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
button,
TRUE, TRUE, 0);
button = hildon_button_new_with_text (HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
HILDON_BUTTON_ARRANGEMENT_VERTICAL,
- "View Dove's Guide for Church Bell Ringers",
- "The source of this program's data.");
+ "The data comes from Dove's Guide for Church Bell Ringers.",
+ "View Dove's Guide.");
g_signal_connect (button, "clicked", G_CALLBACK (show_web_page),
"http://dove.cccbr.org.uk");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
button = hildon_button_new_with_text (HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT,
HILDON_BUTTON_ARRANGEMENT_VERTICAL,
- "View belfry photograph",
- "Image \xc2\xa9 Amanda Slater, cc-by-sa.");
+ "The belfry image is \xc2\xa9 Amanda Slater, cc-by-sa.",
+ "View the original photograph.");
g_signal_connect (button, "clicked", G_CALLBACK (show_web_page),
"http://www.flickr.com/photos/pikerslanefarm/3398769335/");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),