+
+ // 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_LIBGEXIV2
+ "libgexiv2",
+#endif
+#ifdef HAVE_LIBEXIF
+ "libexif",
+#endif
+#ifdef HAVE_LIBX11
+ "libX11",
+#endif
+#ifdef HAVE_LIBMAGIC
+ "libmagic",
+#endif
+#ifdef HAVE_LIBBZ2
+ "libbz2",
+#endif
+#ifdef HAVE_LIBSQLITE3
+ "libsqlite3",
+#endif
+#ifdef HAVE_LIBMAPNIK
+ "libmapnik",
+#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,
+ "version", version,
+ "website", website,
+ "comments", comments,
+ "copyright", copyright,
+ "license", license,
+ "wrap-license", TRUE,
+ /* logo automatically retrieved via gtk_window_get_default_icon_list */
+ "authors", AUTHORS,
+ "documenters", DOCUMENTERS,
+ "translator-credits", _("Translation is coordinated on http://launchpad.net/viking"),
+ "artists", libs,
+ NULL);
+}
+
+gboolean a_dialog_map_n_zoom(GtkWindow *parent, gchar *mapnames[], gint default_map, gchar *zoom_list[], gint default_zoom, gint *selected_map, gint *selected_zoom)
+{
+ gchar **s;
+
+ GtkWidget *dialog = gtk_dialog_new_with_buttons ( _("Download along track"), parent, 0, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL );
+ gtk_dialog_set_default_response ( GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT );
+ GtkWidget *response_w = NULL;
+#if GTK_CHECK_VERSION (2, 20, 0)
+ response_w = gtk_dialog_get_widget_for_response ( GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT );
+#endif
+
+ GtkWidget *map_label = gtk_label_new(_("Map type:"));
+ GtkWidget *map_combo = vik_combo_box_text_new();
+ for (s = mapnames; *s; s++)
+ vik_combo_box_text_append (GTK_COMBO_BOX(map_combo), *s);
+ gtk_combo_box_set_active (GTK_COMBO_BOX(map_combo), default_map);
+
+ GtkWidget *zoom_label = gtk_label_new(_("Zoom level:"));
+ GtkWidget *zoom_combo = vik_combo_box_text_new();
+ for (s = zoom_list; *s; s++)
+ vik_combo_box_text_append (GTK_COMBO_BOX(zoom_combo), *s);
+ gtk_combo_box_set_active (GTK_COMBO_BOX(zoom_combo), default_zoom);
+
+ GtkTable *box = GTK_TABLE(gtk_table_new(2, 2, FALSE));
+ gtk_table_attach_defaults(box, map_label, 0, 1, 0, 1);
+ gtk_table_attach_defaults(box, map_combo, 1, 2, 0, 1);
+ gtk_table_attach_defaults(box, zoom_label, 0, 1, 1, 2);
+ gtk_table_attach_defaults(box, zoom_combo, 1, 2, 1, 2);
+
+ gtk_box_pack_start ( GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), GTK_WIDGET(box), FALSE, FALSE, 5 );
+
+ if ( response_w )
+ gtk_widget_grab_focus ( response_w );
+
+ gtk_widget_show_all ( dialog );
+ if ( gtk_dialog_run ( GTK_DIALOG(dialog) ) != GTK_RESPONSE_ACCEPT ) {
+ gtk_widget_destroy(dialog);
+ return FALSE;