#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <time.h>
void a_dialog_msg ( GtkWindow *parent, gint type, const gchar *info, const gchar *extra )
{
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), lonlabel, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), lon, FALSE, FALSE, 0);
+ // 'ok' when press return in the entry
+ g_signal_connect_swapped (lat, "activate", G_CALLBACK(a_dialog_response_accept), dialog);
+ g_signal_connect_swapped (lon, "activate", G_CALLBACK(a_dialog_response_accept), dialog);
+
gtk_dialog_set_default_response ( GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT );
if ( gtk_dialog_run ( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT )
struct LatLon ll;
GtkWidget *latlabel, *lonlabel, *namelabel, *latentry, *lonentry, *altentry, *altlabel, *nameentry=NULL;
GtkWidget *commentlabel, *commententry, *descriptionlabel, *descriptionentry, *imagelabel, *imageentry, *symbollabel, *symbolentry;
+ GtkWidget *timelabel = NULL;
+ GtkWidget *timevaluelabel = NULL; // No editing of time allowed ATM
GtkListStore *store;
gchar *lat, *lon, *alt;
if ( !is_new && wp->image )
vik_file_entry_set_filename ( VIK_FILE_ENTRY(imageentry), wp->image );
+ if ( !is_new && wp->has_timestamp ) {
+ gchar tmp_str[64];
+ timelabel = gtk_label_new ( _("Time:") );
+ timevaluelabel = gtk_label_new ( NULL );
+ strftime ( tmp_str, sizeof(tmp_str), "%c", localtime(&(wp->timestamp)) );
+ gtk_label_set_text ( GTK_LABEL(timevaluelabel), tmp_str );
+ }
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), latlabel, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), latentry, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), lonlabel, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), lonentry, FALSE, FALSE, 0);
+ if ( timelabel ) {
+ gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), timelabel, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), timevaluelabel, FALSE, FALSE, 0);
+ }
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), altlabel, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), altentry, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), commentlabel, FALSE, FALSE, 0);
return NULL;
}
-gchar *a_dialog_new_track ( GtkWindow *parent, GHashTable *tracks, gchar *default_name, gboolean is_route )
+gchar *a_dialog_new_track ( GtkWindow *parent, gchar *default_name, gboolean is_route )
{
GtkWidget *dialog = gtk_dialog_new_with_buttons ( is_route ? _("Add Route") : _("Add Track"),
parent,
}
/* creates a vbox full of labels */
-GtkWidget *a_dialog_create_label_vbox ( gchar **texts, int label_count )
+GtkWidget *a_dialog_create_label_vbox ( gchar **texts, int label_count, gint spacing, gint padding )
{
GtkWidget *vbox, *label;
int i;
- vbox = gtk_vbox_new( TRUE, 3 );
+ vbox = gtk_vbox_new( TRUE, spacing );
for ( i = 0; i < label_count; i++ )
{
label = gtk_label_new(NULL);
gtk_label_set_markup ( GTK_LABEL(label), _(texts[i]) );
- gtk_box_pack_start ( GTK_BOX(vbox), label, FALSE, TRUE, 5 );
+ gtk_box_pack_start ( GTK_BOX(vbox), label, FALSE, TRUE, padding );
}
return vbox;
}
}
/**
+ * a_dialog_get_positive_number:
+ *
* Dialog to return a positive number via a spinbox within the supplied limits
- * A return value of zero indicates the dialog was cancelled
+ *
+ * Returns: A value of zero indicates the dialog was cancelled
*/
guint a_dialog_get_positive_number ( GtkWindow *parent, gchar *title_text, gchar *label_text, guint default_num, guint min, guint max, guint step )
{
"along with this program; if not, write to the Free Software "
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA");
+ // Would be nice to use gtk_about_dialog_add_credit_section (), but that requires gtk 3.4
+ // For now shove it in the 'artists' section so at least the information is easily visible
+ // Something more advanced might have proper version information too...
+ const gchar *libs[] = {
+ "Compiled in libraries:",
+ // Default libs
+ "libglib-2.0",
+ "libgthread-2.0",
+ "libgtk+-2.0",
+ "libgio-2.0",
+ // Potentially optional libs (but probably couldn't build without them)
+#ifdef HAVE_LIBM
+ "libm",
+#endif
+#ifdef HAVE_LIBZ
+ "libz",
+#endif
+#ifdef HAVE_LIBCURL
+ "libcurl",
+#endif
+ // Actually optional libs
+#ifdef HAVE_LIBGPS
+ "libgps",
+#endif
+#ifdef HAVE_LIBEXIF
+ "libexif",
+#endif
+#ifdef HAVE_LIBX11
+ "libX11",
+#endif
+#ifdef HAVE_LIBMAGIC
+ "libmagic",
+#endif
+#ifdef HAVE_LIBBZ2
+ "libbz2",
+#endif
+ NULL
+ };
// Newer versions of GTK 'just work', calling gtk_show_uri() on the URL or email and opens up the appropriate program
// This is the old method:
#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 24)
gtk_about_dialog_set_url_hook (about_url_hook, NULL, NULL);
gtk_about_dialog_set_email_hook (about_email_hook, NULL, NULL);
#endif
+
gtk_show_about_dialog (parent,
/* TODO do not set program-name and correctly set info for g_get_application_name */
"program-name", program_name,
"authors", AUTHORS,
"documenters", DOCUMENTERS,
"translator-credits", _("Translation is coordinated on http://launchpad.net/viking"),
+ "artists", libs,
NULL);
}