summaryrefslogtreecommitdiff
path: root/src/gnome2/about_trans.c
blob: 8de9a0c5cfddd42d598a3112f4221cdfcba049a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
 * Xiphos Bible Study Tool
 * about_trans.c - About Translation
 *
 * Copyright (C) 2008-2009 Xiphos Developer Team
 *
 * 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
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <gtk/gtk.h>

#include "gui/about_trans.h"
#include "gui/utilities.h"
#include "main/settings.h"
#include "main/sword.h"

/******************************************************************************
 * Name
 *   about_trans_ok
 *
 * Description
 *   Callback if about sword button is clicked.
 *
 * Return value
 *   void
 */

static void
about_trans_ok(GtkButton * button, gpointer user_data)
{
	GtkWidget *dlg;

	dlg = gtk_widget_get_toplevel(GTK_WIDGET(button));
	gtk_widget_destroy(dlg);
}

/******************************************************************************
 * Name
 *   gui_create_about_trans
 *
 * Synopsis
 *   #include "about_trans.h"
 *
 *   void gui_create_about_trans(void);
 *
 * Description
 *   Create About Translation dialog and return pointer on it.
 *
 * Return value
 *   GtkWidget *
 */

GtkWidget *
gui_create_about_trans(void)
{
	GtkWidget *dialog_about_trans;
	GtkWidget *dialog_vbox;
	GtkWidget *vbox;
	GtkWidget *pixmap;
	GtkWidget *scrolledwindow;
	GtkWidget *label;
	GtkWidget *textview;
	GtkWidget *href;
	GtkWidget *dialog_action_area;
	GtkWidget *hbuttonbox;
	GtkWidget *button;
	gchar *about =
	    _("Do you like using Xiphos to study the Bible? "
	      "Would you like to see its display using your native language? "
	      "You could translate Xiphos! "
	      "\n\n"
	      "We are always looking for contributions of new "
	      "translations of Xiphos into other languages. "
	      "If you are able to translate for us, please see the link "
	      "below, contact us, and get involved with our efforts."
	      );

	dialog_about_trans = gtk_dialog_new();
	gtk_object_set_data(GTK_OBJECT(dialog_about_trans),
			    "dialog_about_trans", dialog_about_trans);
	gtk_window_set_title(GTK_WINDOW(dialog_about_trans),
			     _("About Xiphos Translation"));
        gtk_window_set_resizable(GTK_WINDOW(dialog_about_trans), FALSE);

	dialog_vbox = GTK_DIALOG(dialog_about_trans)->vbox;
	gtk_object_set_data(GTK_OBJECT(dialog_about_trans),
			    "dialog_vbox", dialog_vbox);
	gtk_widget_show(dialog_vbox);

	vbox = gtk_vbox_new(FALSE, 0);
	gtk_widget_show(vbox);
	gtk_box_pack_start(GTK_BOX(dialog_vbox), vbox, TRUE, TRUE,
			   0);

	pixmap = pixmap_finder("logo.png");
	gtk_widget_show(pixmap);
	gtk_box_pack_start(GTK_BOX(vbox), pixmap, FALSE, FALSE, 4);

	scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
	gtk_widget_show(scrolledwindow);
	gtk_box_pack_start(GTK_BOX(vbox), scrolledwindow, TRUE,
			   TRUE, 4);
	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
				       (scrolledwindow),
				       GTK_POLICY_NEVER,
				       GTK_POLICY_AUTOMATIC);
  	gtk_widget_set_size_request (scrolledwindow, 400, 150);
  	gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow), 4);
	gtk_scrolled_window_set_shadow_type((GtkScrolledWindow *)scrolledwindow,
                                             settings.shadow_type);

	textview = gtk_text_view_new ();
	gtk_widget_show (textview);
	gtk_container_add (GTK_CONTAINER (scrolledwindow), textview);
	gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview), GTK_WRAP_WORD);
	gtk_text_view_set_editable(GTK_TEXT_VIEW(textview),FALSE);
	gtk_text_buffer_set_text (gtk_text_view_get_buffer
				(GTK_TEXT_VIEW (textview)), about, -1);
	gtk_widget_set_sensitive(textview,FALSE);

	label =
	    gtk_label_new(_
			  ("See TRANSLATION-HOWTO in Xiphos source"));
	gtk_widget_show(label);
	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
	gtk_widget_set_usize(label, -2, 24);

	href =  gtk_link_button_new_with_label ("http://xiphos.org/development/",
			   _("Xiphos development"));
	//    gnome_href_new
	gtk_widget_show(href);
	gtk_box_pack_start(GTK_BOX(vbox), href, FALSE, FALSE, 0);

	dialog_action_area =
	    GTK_DIALOG(dialog_about_trans)->action_area;
	gtk_object_set_data(GTK_OBJECT(dialog_about_trans),
			    "dialog_action_area",
			    dialog_action_area);
	gtk_widget_show(dialog_action_area);
	gtk_container_set_border_width(GTK_CONTAINER
				       (dialog_action_area), 10);

	hbuttonbox = gtk_hbutton_box_new();
	gtk_widget_show(hbuttonbox);
	gtk_box_pack_start(GTK_BOX(dialog_action_area), hbuttonbox,
			   TRUE, TRUE, 0);
	gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox),
				  GTK_BUTTONBOX_END);

	button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
	gtk_widget_show(button);
	gtk_container_add(GTK_CONTAINER(hbuttonbox), button);
	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);

	g_signal_connect(GTK_OBJECT(button), "clicked",
			   G_CALLBACK(about_trans_ok), NULL);
	return dialog_about_trans;
}