1 /* Hey EMACS -*- linux-c -*- */
2 /* $Id: infos.c 2444 2007-04-15 08:29:34Z roms $ */
3 
4 /*  TiEmu - Tiemu Is an EMUlator
5  *
6  *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin
7  *  Copyright (c) 2001-2003, Romain Lievin
8  *  Copyright (c) 2003, Julien Blache
9  *  Copyright (c) 2004, Romain Li�vin
10  *  Copyright (c) 2005, Romain Li�vin
11  *
12  *  This program is free software; you can redistribute it and/or modify
13  *  it under the terms of the GNU General Public License as published by
14  *  the Free Software Foundation; either version 2 of the License, or
15  *  (at your option) any later version.
16  *  This program is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *  GNU General Public License for more details. *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to the Free Software
22  *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
23  */
24 
25 
26 #ifdef HAVE_CONFIG_H
27 #  include <config.h>
28 #endif				/*  */
29 
30 #include <gtk/gtk.h>
31 #include <glade/glade.h>
32 
33 #include "intl.h"
34 #include "paths.h"
35 #include "skinops.h"
36 #include "ti68k_int.h"
37 
display_infos_dbox()38 gint display_infos_dbox()
39 {
40 	GladeXML *xml;
41 	GtkWidget *dbox;
42 	GtkWidget *label;
43 	gint result;
44 	gchar *str;
45 
46 	xml = glade_xml_new
47 		(tilp_paths_build_glade("infos-2.glade"), "infos_dbox",
48 		 PACKAGE);
49 	if (!xml)
50 		g_error(_("%s: GUI loading failed!\n"), __FILE__);
51 	glade_xml_signal_autoconnect(xml);
52 
53 	dbox = glade_xml_get_widget(xml, "infos_dbox");
54 
55 	label = glade_xml_get_widget(xml, "label20");
56 	switch(skin_infos.type)
57 	{
58 	case SKIN_TYPE_TIEMU:	str = g_strdup_printf("%s", "TiEmu v2.00"); break;
59 	case SKIN_TYPE_VTI:		str = g_strdup_printf("%s", "VTi 2.5"); break;
60 	case SKIN_TYPE_OLD_VTI:	str = g_strdup_printf("%s", "VTi 2.1"); break;
61 	default:				str = g_strdup_printf("%s", _("unknown")); break;
62 	}
63 	gtk_label_set_text(GTK_LABEL(label), str);
64 	g_free(str);
65 
66 	label = glade_xml_get_widget(xml, "label21");
67 	str = g_strdup_printf("%s", skin_infos.name);
68 	gtk_label_set_text(GTK_LABEL(label), str);
69 	g_free(str);
70 
71 	label = glade_xml_get_widget(xml, "label22");
72 	if(skin_infos.author)
73 	    str = g_strdup_printf("%s", skin_infos.author);
74 	else
75 	    str = g_strdup("");
76 	gtk_label_set_text(GTK_LABEL(label), str);
77 	g_free(str);
78 
79 	label = glade_xml_get_widget(xml, "label23");
80 	str = g_strdup_printf("%s", ti68k_calctype_to_string(tihw.calc_type));
81 	gtk_label_set_text(GTK_LABEL(label), str);
82 	g_free(str);
83 
84 	label = glade_xml_get_widget(xml, "label24");
85 	str = g_strdup_printf("%s", tihw.rom_version);
86 	gtk_label_set_text(GTK_LABEL(label), str);
87 	g_free(str);
88 
89 	label = glade_xml_get_widget(xml, "label25");
90 	str = g_strdup_printf("%i KB", tihw.ram_size >> 10);
91 	gtk_label_set_text(GTK_LABEL(label), str);
92 	g_free(str);
93 
94 	label = glade_xml_get_widget(xml, "label26");
95 	str = g_strdup_printf("%i KB", tihw.rom_size >> 10);
96 	gtk_label_set_text(GTK_LABEL(label), str);
97 	g_free(str);
98 
99 	label = glade_xml_get_widget(xml, "label27");
100 	str = g_strdup_printf("%s", ti68k_romtype_to_string(tihw.rom_flash));
101 	gtk_label_set_text(GTK_LABEL(label), str);
102 	g_free(str);
103 
104 	label = glade_xml_get_widget(xml, "label28");
105 	str = g_strdup_printf("%s", ti68k_hwtype_to_string(tihw.hw_type));
106 	gtk_label_set_text(GTK_LABEL(label), str);
107 	g_free(str);
108 
109 	result = gtk_dialog_run(GTK_DIALOG(dbox));
110 	switch (result) {
111 	case GTK_RESPONSE_OK:
112 		break;
113 	default:
114 		break;
115 	}
116 
117 	gtk_widget_destroy(dbox);
118 
119 	return 0;
120 }
121