/* ====================================================================
 * FTD4Linux Software License, Version 1.0
 *
 * Copyright (c) 2000-2004 The FTD4Linux Development Team.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        FTD4Linux Development Team (http://www.ftd4linux.2y.net/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "FTD" and "FTD4Linux" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact alguno@ftd4linux.2y.net.
 *
 * 5. Products derived from this software may not be called "FTD4Linux",
 *    nor may "FTD4Linux" appear in their name, without prior written
 *    permission of the FTD4Linux Development Team.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE FTD4LINUX DEVELOPMENT TEAM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#include "ftd_gui_main.h"

void
ftd_gui_about_show(void)
{
    GtkWidget *frmAbout;
    GtkWidget *vbox1;
    GtkWidget *label1;
    GtkWidget *vbox2;
    GtkWidget *label2;
    GtkWidget *scrolledwindow1;
    GtkWidget *textview1;

    g_assert(gui);

    frmAbout = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title (GTK_WINDOW (frmAbout), "About OpenFTD");
    gtk_window_set_modal (GTK_WINDOW (frmAbout), TRUE);
    gtk_window_set_transient_for(GTK_WINDOW(frmAbout), GTK_WINDOW(gui->window));

    vbox1 = gtk_vbox_new (FALSE, 0);
    gtk_widget_show (vbox1);
    gtk_container_add (GTK_CONTAINER (frmAbout), vbox1);

    label1 = gtk_label_new ("<span size='xx-large'><b>OpenFTD</b></span>");
    gtk_widget_show (label1);
    gtk_box_pack_start (GTK_BOX (vbox1), label1, FALSE, FALSE, 0);
    gtk_label_set_use_markup (GTK_LABEL (label1), TRUE);
    gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_CENTER);
    gtk_misc_set_padding (GTK_MISC (label1), 0, 8);

    vbox2 = gtk_vbox_new (FALSE, 0);
    gtk_widget_show (vbox2);
    gtk_box_pack_start (GTK_BOX (vbox1), vbox2, TRUE, TRUE, 0);

    label2 = gtk_label_new ("-= Opgedragen aan Tim van den Elsen =-");
    gtk_widget_show (label2);
    gtk_box_pack_start (GTK_BOX (vbox2), label2, FALSE, FALSE, 0);
    gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_CENTER);
    gtk_misc_set_padding (GTK_MISC (label2), 0, 7);

    scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
    gtk_widget_show (scrolledwindow1);
    gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow1, TRUE, TRUE, 5);
    gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow1), 5);
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_NEVER);

    textview1 = gtk_text_view_new ();
    gtk_container_add (GTK_CONTAINER (scrolledwindow1), textview1);
    gtk_widget_set_sensitive (textview1, FALSE);
    gtk_widget_show (textview1);
    gtk_text_view_set_editable (GTK_TEXT_VIEW (textview1), FALSE);
    gtk_text_view_set_justification (GTK_TEXT_VIEW (textview1), GTK_JUSTIFY_CENTER);
    gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (textview1), FALSE);
    gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview1)),
    	"OpenFTD is een open source programma gemaakt door :\n"
        "\n"
        "- Tim van den Elsen\n"
        "- Joao Schim\n"
        "- Gert-Jan de Boer\n"
        "- Erik van Pienbroek\n"
        "\n"
        "Gebaseerd op het programma FTD voor Windows.\n"
        "Afbeeldingen, HTML pagina's en server-communicatie (c) 2001-2007 FTD\n"
        "Source code FTD4Linux (c) 2003, 2007 FTD4Linux Development Team\n"
        "Voor meer informatie over de licentie van dit programma zie het\n"
        "bestand 'COPYING' dat bij dit programma is meegeleverd.\n"
        "\n"
        "Meer informatie over dit project valt te vinden op http://www.ftd4linux.2y.net", -1);

    gtk_window_set_resizable (GTK_WINDOW (frmAbout), FALSE);
    gtk_window_set_position (GTK_WINDOW (frmAbout), GTK_WIN_POS_CENTER);

    gtk_widget_show (frmAbout);
}
