restructure configure so pkg-config derived SSL flags get used
[rofl0r-ixchat.git] / src / fe-gtk / about.c
blob16c6bfb6141db8f26554b2b4b4ae95a835c883ea
1 /* X-Chat
2 * Copyright (C) 1998 Peter Zelezny.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
23 #include "fe-gtk.h"
25 #include <gtk/gtkmain.h>
26 #include <gtk/gtkcontainer.h>
27 #include <gtk/gtkdialog.h>
28 #include <gtk/gtkvbox.h>
29 #include <gtk/gtkhbox.h>
30 #include <gtk/gtkimage.h>
31 #include <gtk/gtklabel.h>
32 #include <gtk/gtkbutton.h>
33 #include <gtk/gtkstock.h>
34 #include <gtk/gtkwindow.h>
36 #ifdef USE_XLIB
37 #include <gdk/gdkx.h>
38 #endif
40 #include "../common/xchat.h"
41 #include "../common/util.h"
42 #include "palette.h"
43 #include "pixmaps.h"
44 #include "gtkutil.h"
45 #include "about.h"
48 #if 0 /*def USE_GNOME*/
50 void
51 menu_about (GtkWidget * wid, gpointer sess)
53 char buf[512];
54 const gchar *author[] = { "Peter Zelezny <zed@xchat.org>", 0 };
56 (snprintf) (buf, sizeof (buf),
57 "An IRC Client for UNIX.\n\n"
58 "Using GTK %d.%d.%d X %d\n"
59 "Running on %s",
60 gtk_major_version, gtk_minor_version, gtk_micro_version,
61 #ifdef USE_XLIB
62 VendorRelease (GDK_DISPLAY ()), get_cpu_str());
63 #else
64 666, get_cpu_str());
65 #endif
67 gtk_widget_show (gnome_about_new ("X-Chat", PACKAGE_VERSION,
68 "(C) 1998-2005 Peter Zelezny", author, buf, 0));
71 #else
73 static GtkWidget *about = 0;
75 static int
76 about_close (void)
78 about = 0;
79 return 0;
82 void
83 menu_about (GtkWidget * wid, gpointer sess)
85 GtkWidget *vbox, *label, *hbox;
86 char buf[512];
87 const char *locale = NULL;
88 extern GtkWindow *parent_window; /* maingui.c */
90 if (about)
92 gtk_window_present (GTK_WINDOW (about));
93 return;
96 about = gtk_dialog_new ();
97 gtk_window_set_position (GTK_WINDOW (about), GTK_WIN_POS_CENTER);
98 gtk_window_set_resizable (GTK_WINDOW (about), FALSE);
99 gtk_window_set_title (GTK_WINDOW (about), _("About "DISPLAY_NAME));
100 if (parent_window)
101 gtk_window_set_transient_for (GTK_WINDOW (about), parent_window);
102 g_signal_connect (G_OBJECT (about), "destroy",
103 G_CALLBACK (about_close), 0);
105 vbox = GTK_DIALOG (about)->vbox;
107 wid = gtk_image_new_from_pixbuf (pix_xchat);
108 gtk_container_add (GTK_CONTAINER (vbox), wid);
110 label = gtk_label_new (NULL);
111 gtk_label_set_selectable (GTK_LABEL (label), TRUE);
112 gtk_container_add (GTK_CONTAINER (vbox), label);
113 g_get_charset (&locale);
114 (snprintf) (buf, sizeof (buf),
115 "<span size=\"x-large\"><b>"DISPLAY_NAME" "PACKAGE_VERSION"</b></span>\n\n"
116 "%s\n\n"
117 "%s\n"
118 "<b>Charset</b>: %s "
119 "<b>Renderer</b>: %s\n"
120 "<small>\302\251 1998-2010 Peter \305\275elezn\303\275 &lt;zed@xchat.org></small>",
121 _("A multiplatform IRC Client"),
122 get_cpu_str(),
123 locale,
124 #ifdef USE_XFT
125 "Xft"
126 #else
127 "Pango"
128 #endif
130 gtk_label_set_markup (GTK_LABEL (label), buf);
131 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
133 hbox = gtk_hbox_new (0, 2);
134 gtk_container_add (GTK_CONTAINER (vbox), hbox);
136 wid = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
137 GTK_WIDGET_SET_FLAGS (GTK_WIDGET (wid), GTK_CAN_DEFAULT);
138 gtk_box_pack_end (GTK_BOX (GTK_DIALOG (about)->action_area), wid, 0, 0, 0);
139 gtk_widget_grab_default (wid);
140 g_signal_connect (G_OBJECT (wid), "clicked",
141 G_CALLBACK (gtkutil_destroy), about);
143 gtk_widget_show_all (about);
145 #endif