X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/96c30db45eb42b538d1b221d71f00a62068eefa0..e8bab170981ff0e1cd572107ca4de122d4aafe8c:/src/dialog.c diff --git a/src/dialog.c b/src/dialog.c index 5d805c7c..9bc2848f 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -29,7 +29,7 @@ #include "degrees_converters.h" #include "authors.h" #include "documenters.h" -#include "util.h" +#include "ui_util.h" #include @@ -591,6 +591,33 @@ static void about_email_hook (GtkAboutDialog *about, } #endif +/** + * Creates a dialog with list of text + * Mostly useful for longer messages that have several lines of information. + */ +void a_dialog_list ( GtkWindow *parent, const gchar *title, GArray *array, gint padding ) +{ + GtkWidget *dialog = gtk_dialog_new_with_buttons ( title, + parent, + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CLOSE, + GTK_RESPONSE_CLOSE, + NULL); + + GtkBox *vbox = GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))); + GtkWidget *label; + + for ( int i = 0; i < array->len; i++ ) { + label = ui_label_new_selectable (NULL); + gtk_label_set_markup ( GTK_LABEL(label), g_array_index(array,gchar*,i) ); + gtk_box_pack_start ( GTK_BOX(vbox), label, FALSE, TRUE, padding ); + } + + gtk_widget_show_all ( dialog ); + gtk_dialog_run ( GTK_DIALOG(dialog) ); + gtk_widget_destroy ( dialog ); +} + void a_dialog_about ( GtkWindow *parent ) { const gchar *program_name = PACKAGE_NAME; @@ -636,6 +663,9 @@ void a_dialog_about ( GtkWindow *parent ) #ifdef HAVE_LIBGPS "libgps", #endif +#ifdef HAVE_LIBGEXIV2 + "libgexiv2", +#endif #ifdef HAVE_LIBEXIF "libexif", #endif @@ -650,6 +680,9 @@ void a_dialog_about ( GtkWindow *parent ) #endif #ifdef HAVE_LIBSQLITE3 "libsqlite3", +#endif +#ifdef HAVE_LIBMAPNIK + "libmapnik", #endif NULL };