Merge pull request #3812 from Biswa96/meson-add-geany-icon
[geany-mirror.git] / src / about.c
blobfbb144b7b16d819d6a81a57b4e21e1ad1ee92a91
1 /*
2 * about.c - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005 The Geany contributors
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 * About dialog and credits.
25 #ifdef HAVE_CONFIG_H
26 # include "config.h"
27 #endif
29 #include "about.h"
31 #include "app.h"
32 #include "gb.c"
33 #include "geany.h"
34 #include "geanywraplabel.h"
35 #include "main.h"
36 #include "support.h"
37 #include "ui_utils.h"
38 #include "utils.h"
40 #include <gtk/gtk.h>
42 #define HEADER "<span size=\"larger\" weight=\"bold\">Geany %s</span>"
43 #define INFO "<span size=\"larger\" weight=\"bold\">%s</span>"
44 #define CODENAME "<span weight=\"bold\">\"" GEANY_CODENAME "\"</span>"
45 #define BUILDDATE "<span size=\"smaller\">%s</span>"
46 #define RUNTIME BUILDDATE
47 #define COPYRIGHT _("Copyright (c) 2005\nThe Geany contributors")
49 static const gchar *translators[][2] = {
50 { "ar", "Fayssal Chamekh &lt;chamfay@gmail.com&gt;"},
51 { "ast", "Marcos Costales &lt;marcoscostales@gmail.com&gt;"},
52 { "be_BY", "Yura Siamashka &lt;yurand2@gmail.com&gt;" },
53 { "bg", "Dilyan Rusev &lt;dilyanrusev@gmail.com&gt;" },
54 { "ca_ES", "Robert Buj &lt;rbuj@fedoraproject.org&gt;\nToni Garcia-Navarro &lt;topi@elpiset.net&gt;" },
55 { "cs_CZ", "Petr Messner &lt;messa@messa.cz&gt;\nAnna Talianova &lt;anickat1@gmail.com&gt;" },
56 { "de_DE", "Frank Lanitz &lt;frank@frank.uvena.de&gt;\nDominic Hopf &lt;dmaphy@googlemail.com&gt;" },
57 { "el", "Stavros Temertzidis &lt;bullgr@gmail.com&gt;" },
58 { "en_GB", "Jeff Bailes &lt;thepizzaking@gmail.com&gt;" },
59 { "es", "Antonio Jiménez González &lt;tonificante@hotmail.com&gt;\nLucas Vieites &lt;lucasvieites@gmail.com&gt;" },
60 { "eu", "Asier Iturralde Sarasola &lt;asier.iturralde@gmail.com&gt;"},
61 { "fa", "Moein Owhadi Kareshk &lt;moein.owhadi@gmail.com&gt;"},
62 { "fi", "Harri Koskinen &lt;harri@fastmonkey.org&gt;\nJari Rahkonen &lt;jari.rahkonen@pp1.inet.fi&gt;" },
63 { "fr", "Jean-Philippe Moal &lt;skateinmars@skateinmars.net&gt;" },
64 { "gl", "José Manuel Castroagudín Silva &lt;chavescesures@gmail.com&gt;"},
65 { "hi", "Asheesh Ranjan &lt;asheeshranjan1@gmail.com&gt;"},
66 { "he", "Yosef Or Boczko &lt;yoseforb@gmail.com&gt;"},
67 { "hu", "Gabor Kmetyko &lt;kg_kilo@freemail.hu&gt;" },
68 { "id", "Fajar Wahyu &lt;fajarwahyuabdillah@gmail.com&gt;\n"
69 "Samsul Ma'arif &lt;mail@samsul.web.id&gt;\n"
70 "Bervianto Leo Pratama &lt;bervianto.leo@gmail.com&gt;" },
71 { "it", "Max Baldinelli &lt;m.baldinelli@agora.it&gt;,\nDario Santomarco &lt;dariello@yahoo.it&gt;" },
72 { "ja", "Tarot Osuji &lt;tarot@sdf.lonestar.org&gt;\nChikahiro Masami &lt;cmasa.z321@gmail.com&gt;" },
73 { "ko", "Park Jang-heon &lt;dotkabi@gmail.com&gt;" },
74 { "kk", "Baurzhan Muftakhidinov &lt;baurthefirst@gmail.com&gt;"},
75 { "lt", "Algimantas Margevičius &lt;margevicius.algimantas@gmail.com&gt;"},
76 { "lb", "Laurent Hoeltgen &lt;hoeltgman@gmail.com&gt;" },
77 { "mn", "tsetsee &lt;tsetsee.yugi@gmail.com&gt;"},
78 { "nl", "Benno Schulenberg &lt;benno@vertaalt.nl&gt;\nPeter Scholtens &lt;peter.scholtens@freedom.nl&gt;\nAyke van Laethem &lt;aykevanlaethem@gmail.com&gt;" },
79 { "pl", "Wojciech Świderski &lt;woj.swiderski@gmail.com&gt;"},
80 { "pt_BR", "Alexandra Moreire &lt;alexandream@gmail.com&gt;\n"
81 "Adrovane Marques Kade &lt;adrovane@gmail.com&gt;\n"
82 "Rafael Peregrino da Silva &lt;rperegrino@linuxnewmedia.com.br&gt;"},
83 { "ro", "Alex Eftimie &lt;alex@rosedu.org&gt;" },
84 { "ru", "brahmann_ &lt;brahmann@lifec0re.net&gt;,\nNikita E. Shalaev &lt;nshalaev@eu.spb.ru&gt;" },
85 { "sk", "Andrej Herceg &lt;chrono.i18n@gmail.com&gt;" },
86 { "sl", "Jože Klepec &lt;joze.klepec@siol.net&gt;"},
87 { "sv", "Tony Mattsson &lt;superxorn@gmail.com&gt;" },
88 { "sr", "Nikola Radovanovic &lt;cobisimo@gmail.com&gt;"},
89 { "tr", "Gürkan Gür &lt;seqizz@gmail.com&gt;"},
90 { "uk", "Artur Shepilko &lt;nomadbyte@gmail.com&gt;" },
91 { "vi_VN", "Clytie Siddall &lt;clytie@riverland.net.au&gt;" },
92 { "zh_CN", "Dormouse Young &lt;mouselinux@163.com&gt;,\nXhacker Liu &lt;liu.dongyuan@gmail.com&gt;" },
93 { "zh_TW", "KoViCH &lt;kovich.ian@gmail.com&gt;\nWei-Lun Chao &lt;chaoweilun@gmail.com&gt;" }
95 static const guint translators_len = G_N_ELEMENTS(translators);
97 static const gchar *prev_translators[][2] = {
98 { "es", "Damián Viano &lt;debian@damianv.com.ar&gt;\nNacho Cabanes &lt;ncabanes@gmail.com&gt;" },
99 { "pl", "Jacek Wolszczak &lt;shutdownrunner@o2.pl&gt;\nJarosław Foksa &lt;jfoksa@gmail.com&gt;" },
100 { "nl", "Kurt De Bree &lt;kdebree@telenet.be&gt;" },
101 { "sk", "Tomáš Vadina &lt;kyberdev@gmail.com&gt;" },
102 { "uk", "Boris Dibrov &lt;dibrov.bor@gmail.com&gt;" }
104 static const guint prev_translators_len = G_N_ELEMENTS(prev_translators);
106 static const gchar *contributors =
107 "Adam Ples, "
108 "Alexander Rodin, Alexey Antipov, Andrew Rowland, Anh Phạm, blackdog, Bo Lorentsen, Bob Doan, "
109 "Bronisław Białek, Can Koy, Catalin Marinas, "
110 "Chris Macksey, Christoph Berg, Colomban Wendling, Conrad Steenberg, Daniel Richard G., "
111 "Daniel Marjamaki, Dave Moore, "
112 "Dimitar Zhekov, Dirk Weber, Elias Pschernig, Eric Forgeot, "
113 "Erik de Castro Lopo, Eugene Arshinov, Felipe Pena, François Cami, "
114 "Giuseppe Torelli, Guillaume de Rorthais, Guillaume Hoffmann, Herbert Voss, Jason Oster, "
115 "Jean-François Wauthy, Jeff Pohlmeyer, Jesse Mayes, Jiří Techet, "
116 "John Gabriele, Jon Senior, Jon Strait, Josef Whiter, "
117 "Jörn Reder, Kelvin Gardiner, Kevin Ellwood, Kristoffer A. Tjernås, Lex Trotman, "
118 "Manuel Bua, Mário Silva, Marko Peric, Matthew Brush, Matti Mårds, "
119 "Moritz Barsnick, Nicolas Sierro, Ondrej Donek, Peter Strand, Philipp Gildein, "
120 "Pierre Joye, Rob van der Linde, "
121 "Robert McGinley, Roland Baudin, Ross McKay, S Jagannathan, Saleem Abdulrasool, "
122 "Sebastian Kraft, Shiv, Slava Semushin, Stefan Oltmanns, Tamim, Taylor Venable, "
123 "Thomas Huth, Thomas Martitz, Tomás Vírseda, "
124 "Tyler Mulligan, Walery Studennikov, Yura Siamashka";
127 static void header_eventbox_style_set(GtkWidget *widget);
128 static void header_label_style_set(GtkWidget *widget);
129 static void homepage_clicked(GtkButton *button, gpointer data);
132 #define ROW(text, row, col, x_align, y_padding, col_span) \
133 label = gtk_label_new((text)); \
134 gtk_table_attach(GTK_TABLE(table), label, (col), (col) + (col_span) + 1, (row), (row) + 1, \
135 (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 0, (y_padding)); \
136 gtk_label_set_use_markup(GTK_LABEL(label), TRUE); \
137 gtk_misc_set_alignment(GTK_MISC(label), (x_align), 0);
140 static GtkWidget *create_dialog(void)
142 GtkWidget *dialog;
143 GtkWidget *header_image;
144 GtkWidget *header_label;
145 GtkWidget *label_info;
146 GtkWidget *codename_label;
147 GtkWidget *builddate_label;
148 GtkWidget *runtime_label;
149 GtkWidget *url_button;
150 GtkWidget *cop_label;
151 GtkWidget *label;
152 GtkWidget *license_textview;
153 GtkWidget *notebook;
154 GtkWidget *box;
155 GtkWidget *credits_scrollwin;
156 GtkWidget *table;
157 GtkWidget *license_scrollwin;
158 GtkWidget *info_box;
159 GtkWidget *header_hbox;
160 GtkWidget *header_eventbox;
161 GtkTextBuffer* tb;
162 gchar *license_text = NULL;
163 gchar buffer[512];
164 gchar buffer2[128];
165 guint i, row = 0;
166 gchar *build_date;
168 dialog = gtk_dialog_new();
170 /* configure dialog */
171 gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(main_widgets.window));
172 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT);
173 gtk_window_set_title(GTK_WINDOW(dialog), _("About Geany"));
174 gtk_window_set_icon_name(GTK_WINDOW(dialog), "geany");
175 gtk_widget_set_name(dialog, "GeanyDialog");
176 gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
177 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CLOSE);
178 g_signal_connect(dialog, "key-press-event", G_CALLBACK(gb_on_key_pressed), NULL);
180 /* create header */
181 header_eventbox = gtk_event_box_new();
182 gtk_widget_show(header_eventbox);
183 header_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
184 gtk_container_set_border_width(GTK_CONTAINER(header_hbox), 4);
185 gtk_widget_show(header_hbox);
186 gtk_container_add(GTK_CONTAINER(header_eventbox), header_hbox);
187 header_image = gtk_image_new_from_icon_name("geany", GTK_ICON_SIZE_DIALOG);
188 gtk_box_pack_start(GTK_BOX(header_hbox), header_image, FALSE, FALSE, 0);
189 header_label = gtk_label_new(NULL);
190 gtk_label_set_use_markup(GTK_LABEL(header_label), TRUE);
191 /* print the subversion revision generated by ./configure if it is available */
192 g_snprintf(buffer, sizeof(buffer), HEADER, main_get_version_string());
193 gtk_label_set_markup(GTK_LABEL(header_label), buffer);
194 gtk_widget_show(header_label);
195 gtk_box_pack_start(GTK_BOX(header_hbox), header_label, FALSE, FALSE, 0);
196 header_eventbox_style_set(header_eventbox);
197 header_label_style_set(header_label);
198 g_signal_connect_after(header_eventbox, "style-set", G_CALLBACK(header_eventbox_style_set), NULL);
199 g_signal_connect_after(header_label, "style-set", G_CALLBACK(header_label_style_set), NULL);
200 gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), header_eventbox, FALSE, FALSE, 0);
202 /* create notebook */
203 notebook = gtk_notebook_new();
204 gtk_widget_show(notebook);
205 gtk_container_set_border_width(GTK_CONTAINER(notebook), 2);
206 gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), notebook, TRUE, TRUE, 0);
208 /* create "Info" tab */
209 info_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
210 gtk_container_set_border_width(GTK_CONTAINER(info_box), 6);
211 gtk_widget_show(info_box);
213 label_info = gtk_label_new(NULL);
214 gtk_label_set_justify(GTK_LABEL(label_info), GTK_JUSTIFY_CENTER);
215 gtk_label_set_selectable(GTK_LABEL(label_info), TRUE);
216 gtk_label_set_use_markup(GTK_LABEL(label_info), TRUE);
217 g_snprintf(buffer, sizeof(buffer), INFO, _("A fast and lightweight IDE"));
218 gtk_label_set_markup(GTK_LABEL(label_info), buffer);
219 gtk_misc_set_padding(GTK_MISC(label_info), 2, 11);
220 gtk_widget_show(label_info);
221 gtk_box_pack_start(GTK_BOX(info_box), label_info, FALSE, FALSE, 0);
223 /* Codename label */
224 codename_label = gtk_label_new(NULL);
225 gtk_label_set_justify(GTK_LABEL(codename_label), GTK_JUSTIFY_CENTER);
226 gtk_label_set_selectable(GTK_LABEL(codename_label), TRUE);
227 gtk_label_set_use_markup(GTK_LABEL(codename_label), TRUE);
228 gtk_label_set_markup(GTK_LABEL(codename_label), CODENAME);
229 gtk_misc_set_padding(GTK_MISC(codename_label), 2, 8);
230 gtk_widget_show(codename_label);
231 gtk_box_pack_start(GTK_BOX(info_box), codename_label, FALSE, FALSE, 0);
233 /* build date label */
234 builddate_label = gtk_label_new(NULL);
235 gtk_label_set_justify(GTK_LABEL(builddate_label), GTK_JUSTIFY_CENTER);
236 gtk_label_set_selectable(GTK_LABEL(builddate_label), TRUE);
237 gtk_label_set_use_markup(GTK_LABEL(builddate_label), TRUE);
238 build_date = utils_parse_and_format_build_date(__DATE__);
239 g_snprintf(buffer2, sizeof(buffer2), _("(built on or after %s)"), build_date);
240 g_free(build_date);
241 g_snprintf(buffer, sizeof(buffer), BUILDDATE, buffer2);
242 gtk_label_set_markup(GTK_LABEL(builddate_label), buffer);
243 gtk_misc_set_padding(GTK_MISC(builddate_label), 2, 2);
244 gtk_widget_show(builddate_label);
245 gtk_box_pack_start(GTK_BOX(info_box), builddate_label, FALSE, FALSE, 0);
247 /* GTK+/GLib runtime version label */
248 runtime_label = gtk_label_new(NULL);
249 gtk_label_set_justify(GTK_LABEL(runtime_label), GTK_JUSTIFY_CENTER);
250 gtk_label_set_selectable(GTK_LABEL(runtime_label), TRUE);
251 gtk_label_set_use_markup(GTK_LABEL(runtime_label), TRUE);
252 g_snprintf(buffer2, sizeof(buffer2),
253 _("Using GTK+ v%u.%u.%u and GLib v%u.%u.%u runtime libraries"),
254 gtk_major_version, gtk_minor_version, gtk_micro_version,
255 glib_major_version, glib_minor_version, glib_micro_version);
256 g_snprintf(buffer, sizeof(buffer), RUNTIME, buffer2);
257 gtk_label_set_markup(GTK_LABEL(runtime_label), buffer);
258 gtk_misc_set_padding(GTK_MISC(runtime_label), 2, 2);
259 gtk_widget_show(runtime_label);
260 gtk_box_pack_start(GTK_BOX(info_box), runtime_label, FALSE, FALSE, 0);
262 box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
263 url_button = gtk_button_new();
264 gtk_button_set_relief(GTK_BUTTON(url_button), GTK_RELIEF_NONE);
265 g_signal_connect(url_button, "clicked", G_CALLBACK(homepage_clicked), (gpointer)GEANY_HOMEPAGE);
266 label = gtk_label_new(NULL);
267 gtk_label_set_text(GTK_LABEL(label), GEANY_HOMEPAGE);
268 gtk_widget_show(label);
269 gtk_container_add(GTK_CONTAINER(url_button), label);
270 gtk_widget_show(url_button);
271 gtk_box_pack_start(GTK_BOX(box), url_button, FALSE, FALSE, 0);
272 gtk_widget_show(box);
273 gtk_box_pack_start(GTK_BOX(info_box), box, FALSE, FALSE, 10);
275 /* copyright label */
276 cop_label = gtk_label_new(NULL);
277 gtk_label_set_justify(GTK_LABEL(cop_label), GTK_JUSTIFY_CENTER);
278 gtk_label_set_selectable(GTK_LABEL(cop_label), FALSE);
279 gtk_label_set_use_markup(GTK_LABEL(cop_label), TRUE);
280 gtk_label_set_markup(GTK_LABEL(cop_label), COPYRIGHT);
281 gtk_misc_set_padding(GTK_MISC(cop_label), 2, 10);
282 gtk_widget_show(cop_label);
283 gtk_box_pack_start(GTK_BOX(info_box), cop_label, FALSE, FALSE, 0);
284 /*gtk_container_add(GTK_CONTAINER(info_box), cop_label); */
286 label = gtk_label_new(_("Info"));
287 gtk_widget_show(label);
288 gtk_widget_show_all(info_box);
289 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), info_box, label);
291 /* create "Credits" tab */
292 credits_scrollwin = gtk_scrolled_window_new(NULL, NULL);
293 gtk_container_set_border_width(GTK_CONTAINER(credits_scrollwin), 6);
294 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(credits_scrollwin),
295 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
297 table = gtk_table_new(23 + translators_len + prev_translators_len, 3, FALSE);
298 gtk_table_set_col_spacings(GTK_TABLE(table), 10);
300 row = 0;
301 g_snprintf(buffer, sizeof(buffer),
302 "<span size=\"larger\" weight=\"bold\">%s</span>", _("Developers"));
303 label = gtk_label_new(buffer);
304 gtk_table_attach(GTK_TABLE(table), label, 0, 2, row, row + 1, GTK_FILL, 0, 0, 5);
305 gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
306 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
307 row++;
309 g_snprintf(buffer, sizeof(buffer), "Colomban Wendling - %s", _("maintainer"));
310 ROW(buffer, row, 0, 0, 0, 1);
311 row++;
312 ROW("&lt;lists.ban@herbesfolles.org&gt;", row, 0, 0, 0, 1);
313 row++;
314 ROW("", row, 0, 0, 0, 0);
315 row++;
317 g_snprintf(buffer, sizeof(buffer), "Nick Treleaven - %s", _("developer"));
318 ROW(buffer, row, 0, 0, 0, 1);
319 row++;
320 ROW("&lt;nick.treleaven@btinternet.com&gt;", row, 0, 0, 0, 1);
321 row++;
322 ROW("", row, 0, 0, 0, 0);
323 row++;
325 g_snprintf(buffer, sizeof(buffer), "Enrico Tröger - %s", _("developer"));
326 ROW(buffer, row, 0, 0, 0, 1);
327 row++;
328 ROW("&lt;enrico.troeger@uvena.de&gt;", row, 0, 0, 0, 1);
329 row++;
330 ROW("", row, 0, 0, 0, 0);
331 row++;
333 g_snprintf(buffer, sizeof(buffer), "Matthew Brush - %s", _("developer"));
334 ROW(buffer, row, 0, 0, 0, 1);
335 row++;
336 ROW("&lt;mbrush@codebrainz.ca&gt;", row, 0, 0, 0, 1);
337 row++;
338 ROW("", row, 0, 0, 0, 0);
339 row++;
341 g_snprintf(buffer, sizeof(buffer), "Frank Lanitz - %s", _("translation maintainer"));
342 ROW(buffer, row, 0, 0, 0, 1);
343 row++;
344 ROW("&lt;frank@frank.uvena.de&gt;", row, 0, 0, 0, 1);
345 row++;
346 ROW("", row, 0, 0, 0, 0);
347 row++;
349 g_snprintf(buffer, sizeof(buffer),
350 "<span size=\"larger\" weight=\"bold\">%s</span>", _("Translators"));
351 label = gtk_label_new(buffer);
352 gtk_table_attach(GTK_TABLE(table), label, 0, 2, row, row + 1,
353 (GtkAttachOptions) (GTK_FILL),
354 (GtkAttachOptions) (0), 0, 5);
355 gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
356 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
357 row++;
359 for (i = 0; i < translators_len; i++)
361 ROW(translators[i][0], row, 0, 1, 4, 0);
362 ROW(translators[i][1], row, 1, 0, 4, 0);
363 row++;
366 ROW("", row, 0, 0, 0, 0);
367 row++;
369 g_snprintf(buffer, sizeof(buffer),
370 "<span size=\"larger\" weight=\"bold\">%s</span>", _("Previous Translators"));
371 label = gtk_label_new(buffer);
372 gtk_table_attach(GTK_TABLE(table), label, 0, 2, row, row + 1,
373 (GtkAttachOptions) (GTK_FILL),
374 (GtkAttachOptions) (0), 0, 5);
375 gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
376 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
377 row++;
379 for (i = 0; i < prev_translators_len; i++)
381 ROW(prev_translators[i][0], row, 0, 1, 4, 0);
382 ROW(prev_translators[i][1], row, 1, 0, 4, 0);
383 row++;
387 ROW("", row, 0, 0, 0, 0);
388 row++;
390 g_snprintf(buffer, sizeof(buffer),
391 "<span size=\"larger\" weight=\"bold\">%s</span>", _("Contributors"));
392 label = gtk_label_new(buffer);
393 gtk_table_attach(GTK_TABLE(table), label, 0, 2, row, row + 1,
394 (GtkAttachOptions) (GTK_FILL),
395 (GtkAttachOptions) (0), 0, 5);
396 gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
397 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
398 row++;
400 g_snprintf(buffer, sizeof(buffer),
401 _("Some of the many contributors (for a more detailed list, see the file %s):"),
402 #ifdef G_OS_WIN32
403 "Thanks.txt"
404 #else
405 "THANKS"
406 #endif
408 label = geany_wrap_label_new(buffer);
409 gtk_table_attach(GTK_TABLE(table), label, 0, 2, row, row + 1,
410 (GtkAttachOptions) (GTK_FILL),
411 (GtkAttachOptions) (0), 0, 5);
412 gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
413 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
414 row++;
416 label = geany_wrap_label_new(contributors);
417 gtk_table_attach(GTK_TABLE(table), label, 0, 2, row, row + 1,
418 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND),
419 (GtkAttachOptions) (0), 0, 5);
420 gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
421 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
422 row++;
424 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(credits_scrollwin), table);
425 gtk_viewport_set_shadow_type(GTK_VIEWPORT(gtk_widget_get_parent(table)), GTK_SHADOW_NONE);
426 gtk_widget_show_all(table);
427 label = gtk_label_new(_("Credits"));
428 gtk_widget_show(label);
429 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), credits_scrollwin, label);
431 /* create "License" tab */
432 license_scrollwin = gtk_scrolled_window_new(NULL, NULL);
433 gtk_container_set_border_width(GTK_CONTAINER(license_scrollwin), 6);
434 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(license_scrollwin),
435 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
436 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(license_scrollwin), GTK_SHADOW_IN);
437 license_textview = gtk_text_view_new();
438 gtk_text_view_set_left_margin(GTK_TEXT_VIEW(license_textview), 2);
439 gtk_text_view_set_right_margin(GTK_TEXT_VIEW(license_textview), 2);
440 gtk_text_view_set_editable(GTK_TEXT_VIEW(license_textview), FALSE);
441 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(license_textview), FALSE);
442 gtk_widget_show(license_textview);
443 gtk_container_add(GTK_CONTAINER(license_scrollwin), license_textview);
444 label = gtk_label_new(_("License"));
445 gtk_widget_show(label);
447 g_snprintf(buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S "GPL-2", app->datadir);
449 g_file_get_contents(buffer, &license_text, NULL, NULL);
450 if (license_text == NULL)
452 license_text = g_strdup(
453 _("License text could not be found, please visit http://www.gnu.org/licenses/gpl-2.0.txt to view it online."));
455 tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(license_textview));
456 gtk_text_buffer_set_text(tb, license_text, -1);
458 g_free(license_text);
460 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), license_scrollwin, label);
462 gtk_widget_show_all(dialog);
463 return dialog;
467 void about_dialog_show(void)
469 GtkWidget *dialog;
471 dialog = create_dialog();
473 gtk_dialog_run(GTK_DIALOG(dialog));
474 gtk_widget_destroy(dialog);
478 static void header_eventbox_style_set(GtkWidget *widget)
480 GtkStyle *style = gtk_widget_get_style(widget);
481 if (! gdk_color_equal(&style->bg[GTK_STATE_NORMAL], &style->bg[GTK_STATE_SELECTED]))
482 gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &style->bg[GTK_STATE_SELECTED]);
486 static void header_label_style_set(GtkWidget *widget)
488 GtkStyle *style = gtk_widget_get_style(widget);
489 if (! gdk_color_equal(&style->fg[GTK_STATE_NORMAL], &style->fg[GTK_STATE_SELECTED]))
490 gtk_widget_modify_fg(widget, GTK_STATE_NORMAL, &style->fg[GTK_STATE_SELECTED]);
494 static void homepage_clicked(GtkButton *button, gpointer data)
496 utils_open_browser(data);