]> git.street.me.uk Git - andy/viking.git/blobdiff - src/dialog.c
Don't remove project name if one decides not to delete all layers.
[andy/viking.git] / src / dialog.c
index 5d805c7c501cde08402e54d888d79dddb33cb953..2f244364391f6b0bf2f40766625093612bfd52f8 100644 (file)
@@ -29,7 +29,7 @@
 #include "degrees_converters.h"
 #include "authors.h"
 #include "documenters.h"
-#include "util.h"
+#include "ui_util.h"
 
 #include <glib/gi18n.h>
 
@@ -371,6 +371,10 @@ GtkWidget *a_dialog_create_label_vbox ( gchar **texts, int label_count, gint spa
   {
     label = gtk_label_new(NULL);
     gtk_label_set_markup ( GTK_LABEL(label), _(texts[i]) );
+    if ( strchr(texts[i], ':') ) {
+      // Align label to the right
+      gtk_misc_set_alignment ( GTK_MISC(label), 1.0, 0.5 );
+    }
     gtk_box_pack_start ( GTK_BOX(vbox), label, FALSE, TRUE, padding );
   }
   return vbox;
@@ -591,12 +595,39 @@ 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;
   const gchar *version = VIKING_VERSION;
   const gchar *website = VIKING_URL;
-  const gchar *copyright = "2003-2008, Evan Battaglia\n2008-2013, Viking's contributors";
+  const gchar *copyright = "2003-2008, Evan Battaglia\n2008-2015, Viking's contributors";
   const gchar *comments = _("GPS Data and Topo Analyzer, Explorer, and Manager.");
   const gchar *license = _("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 "
@@ -631,11 +662,17 @@ void a_dialog_about ( GtkWindow *parent )
 #endif
 #ifdef HAVE_LIBCURL
     "libcurl",
+#endif
+#ifdef HAVE_EXPAT_H
+    "libexpat",
 #endif
     // Actually optional libs
 #ifdef HAVE_LIBGPS
     "libgps",
 #endif
+#ifdef HAVE_LIBGEXIV2
+    "libgexiv2",
+#endif
 #ifdef HAVE_LIBEXIF
     "libexif",
 #endif
@@ -648,8 +685,14 @@ void a_dialog_about ( GtkWindow *parent )
 #ifdef HAVE_LIBBZ2
     "libbz2",
 #endif
+#ifdef HAVE_LIBZIP
+    "libzip",
+#endif
 #ifdef HAVE_LIBSQLITE3
     "libsqlite3",
+#endif
+#ifdef HAVE_LIBMAPNIK
+    "libmapnik",
 #endif
     NULL
   };