Use macros instead of raw numbers for login type
[rofl0r-ixchat.git] / src / fe-gtk / about.c
blobd3a0efcacaddd9367fcab7141343abb3c0aa8421
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 "This binary was compiled on "__DATE__"\n"
59 "Using GTK %d.%d.%d X %d\n"
60 "Running on %s",
61 gtk_major_version, gtk_minor_version, gtk_micro_version,
62 #ifdef USE_XLIB
63 VendorRelease (GDK_DISPLAY ()), get_cpu_str());
64 #else
65 666, get_cpu_str());
66 #endif
68 gtk_widget_show (gnome_about_new ("X-Chat", PACKAGE_VERSION,
69 "(C) 1998-2005 Peter Zelezny", author, buf, 0));
72 #else
74 static GtkWidget *about = 0;
76 static int
77 about_close (void)
79 about = 0;
80 return 0;
83 void
84 menu_about (GtkWidget * wid, gpointer sess)
86 GtkWidget *vbox, *label, *hbox;
87 char buf[512];
88 const char *locale = NULL;
89 extern GtkWindow *parent_window; /* maingui.c */
91 if (about)
93 gtk_window_present (GTK_WINDOW (about));
94 return;
97 about = gtk_dialog_new ();
98 gtk_window_set_position (GTK_WINDOW (about), GTK_WIN_POS_CENTER);
99 gtk_window_set_resizable (GTK_WINDOW (about), FALSE);
100 gtk_window_set_title (GTK_WINDOW (about), _("About "DISPLAY_NAME));
101 if (parent_window)
102 gtk_window_set_transient_for (GTK_WINDOW (about), parent_window);
103 g_signal_connect (G_OBJECT (about), "destroy",
104 G_CALLBACK (about_close), 0);
106 vbox = GTK_DIALOG (about)->vbox;
108 wid = gtk_image_new_from_pixbuf (pix_xchat);
109 gtk_container_add (GTK_CONTAINER (vbox), wid);
111 label = gtk_label_new (NULL);
112 gtk_label_set_selectable (GTK_LABEL (label), TRUE);
113 gtk_container_add (GTK_CONTAINER (vbox), label);
114 g_get_charset (&locale);
115 (snprintf) (buf, sizeof (buf),
116 "<span size=\"x-large\"><b>"DISPLAY_NAME" "PACKAGE_VERSION"</b></span>\n\n"
117 "%s\n\n"
118 "%s\n"
119 "<b>Charset</b>: %s "
120 "<b>Renderer</b>: %s\n"
121 "<b>Compiled</b>: "__DATE__"\n\n"
122 "<small>\302\251 1998-2010 Peter \305\275elezn\303\275 &lt;zed@xchat.org></small>",
123 _("A multiplatform IRC Client"),
124 get_cpu_str(),
125 locale,
126 #ifdef USE_XFT
127 "Xft"
128 #else
129 "Pango"
130 #endif
132 gtk_label_set_markup (GTK_LABEL (label), buf);
133 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
135 hbox = gtk_hbox_new (0, 2);
136 gtk_container_add (GTK_CONTAINER (vbox), hbox);
138 wid = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
139 GTK_WIDGET_SET_FLAGS (GTK_WIDGET (wid), GTK_CAN_DEFAULT);
140 gtk_box_pack_end (GTK_BOX (GTK_DIALOG (about)->action_area), wid, 0, 0, 0);
141 gtk_widget_grab_default (wid);
142 g_signal_connect (G_OBJECT (wid), "clicked",
143 G_CALLBACK (gtkutil_destroy), about);
145 gtk_widget_show_all (about);
147 #endif