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.
34 #include "geanywraplabel.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 <chamfay@gmail.com>"},
51 { "ast", "Marcos Costales <marcoscostales@gmail.com>"},
52 { "be_BY", "Yura Siamashka <yurand2@gmail.com>" },
53 { "bg", "Dilyan Rusev <dilyanrusev@gmail.com>" },
54 { "ca_ES", "Robert Buj <rbuj@fedoraproject.org>\nToni Garcia-Navarro <topi@elpiset.net>" },
55 { "cs_CZ", "Petr Messner <messa@messa.cz>\nAnna Talianova <anickat1@gmail.com>" },
56 { "de_DE", "Frank Lanitz <frank@frank.uvena.de>\nDominic Hopf <dmaphy@googlemail.com>" },
57 { "el", "Stavros Temertzidis <bullgr@gmail.com>" },
58 { "en_GB", "Jeff Bailes <thepizzaking@gmail.com>" },
59 { "es", "Antonio Jiménez González <tonificante@hotmail.com>\nLucas Vieites <lucasvieites@gmail.com>" },
60 { "eu", "Asier Iturralde Sarasola <asier.iturralde@gmail.com>"},
61 { "fa", "Moein Owhadi Kareshk <moein.owhadi@gmail.com>"},
62 { "fi", "Harri Koskinen <harri@fastmonkey.org>\nJari Rahkonen <jari.rahkonen@pp1.inet.fi>" },
63 { "fr", "Jean-Philippe Moal <skateinmars@skateinmars.net>" },
64 { "gl", "José Manuel Castroagudín Silva <chavescesures@gmail.com>"},
65 { "hi", "Asheesh Ranjan <asheeshranjan1@gmail.com>"},
66 { "he", "Yosef Or Boczko <yoseforb@gmail.com>"},
67 { "hu", "Gabor Kmetyko <kg_kilo@freemail.hu>" },
68 { "id", "Fajar Wahyu <fajarwahyuabdillah@gmail.com>\n"
69 "Samsul Ma'arif <mail@samsul.web.id>\n"
70 "Bervianto Leo Pratama <bervianto.leo@gmail.com>" },
71 { "it", "Max Baldinelli <m.baldinelli@agora.it>,\nDario Santomarco <dariello@yahoo.it>" },
72 { "ja", "Tarot Osuji <tarot@sdf.lonestar.org>\nChikahiro Masami <cmasa.z321@gmail.com>" },
73 { "ko", "Park Jang-heon <dotkabi@gmail.com>" },
74 { "kk", "Baurzhan Muftakhidinov <baurthefirst@gmail.com>"},
75 { "lt", "Algimantas Margevičius <margevicius.algimantas@gmail.com>"},
76 { "lb", "Laurent Hoeltgen <hoeltgman@gmail.com>" },
77 { "mn", "tsetsee <tsetsee.yugi@gmail.com>"},
78 { "nl", "Benno Schulenberg <benno@vertaalt.nl>\nPeter Scholtens <peter.scholtens@freedom.nl>\nAyke van Laethem <aykevanlaethem@gmail.com>" },
79 { "pl", "Wojciech Świderski <woj.swiderski@gmail.com>"},
80 { "pt_BR", "Alexandra Moreire <alexandream@gmail.com>\n"
81 "Adrovane Marques Kade <adrovane@gmail.com>\n"
82 "Rafael Peregrino da Silva <rperegrino@linuxnewmedia.com.br>"},
83 { "ro", "Alex Eftimie <alex@rosedu.org>" },
84 { "ru", "brahmann_ <brahmann@lifec0re.net>,\nNikita E. Shalaev <nshalaev@eu.spb.ru>" },
85 { "sk", "Andrej Herceg <chrono.i18n@gmail.com>" },
86 { "sl", "Jože Klepec <joze.klepec@siol.net>"},
87 { "sv", "Tony Mattsson <superxorn@gmail.com>" },
88 { "sr", "Nikola Radovanovic <cobisimo@gmail.com>"},
89 { "tr", "Gürkan Gür <seqizz@gmail.com>"},
90 { "uk", "Artur Shepilko <nomadbyte@gmail.com>" },
91 { "vi_VN", "Clytie Siddall <clytie@riverland.net.au>" },
92 { "zh_CN", "Dormouse Young <mouselinux@163.com>,\nXhacker Liu <liu.dongyuan@gmail.com>" },
93 { "zh_TW", "KoViCH <kovich.ian@gmail.com>\nWei-Lun Chao <chaoweilun@gmail.com>" }
95 static const guint translators_len
= G_N_ELEMENTS(translators
);
97 static const gchar
*prev_translators
[][2] = {
98 { "es", "Damián Viano <debian@damianv.com.ar>\nNacho Cabanes <ncabanes@gmail.com>" },
99 { "pl", "Jacek Wolszczak <shutdownrunner@o2.pl>\nJarosław Foksa <jfoksa@gmail.com>" },
100 { "nl", "Kurt De Bree <kdebree@telenet.be>" },
101 { "sk", "Tomáš Vadina <kyberdev@gmail.com>" },
102 { "uk", "Boris Dibrov <dibrov.bor@gmail.com>" }
104 static const guint prev_translators_len
= G_N_ELEMENTS(prev_translators
);
106 static const gchar
*contributors
=
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)
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
;
152 GtkWidget
*license_textview
;
155 GtkWidget
*credits_scrollwin
;
157 GtkWidget
*license_scrollwin
;
159 GtkWidget
*header_hbox
;
160 GtkWidget
*header_eventbox
;
162 gchar
*license_text
= NULL
;
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
);
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);
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
);
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);
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);
309 g_snprintf(buffer
, sizeof(buffer
), "Colomban Wendling - %s", _("maintainer"));
310 ROW(buffer
, row
, 0, 0, 0, 1);
312 ROW("<lists.ban@herbesfolles.org>", row
, 0, 0, 0, 1);
314 ROW("", row
, 0, 0, 0, 0);
317 g_snprintf(buffer
, sizeof(buffer
), "Nick Treleaven - %s", _("developer"));
318 ROW(buffer
, row
, 0, 0, 0, 1);
320 ROW("<nick.treleaven@btinternet.com>", row
, 0, 0, 0, 1);
322 ROW("", row
, 0, 0, 0, 0);
325 g_snprintf(buffer
, sizeof(buffer
), "Enrico Tröger - %s", _("developer"));
326 ROW(buffer
, row
, 0, 0, 0, 1);
328 ROW("<enrico.troeger@uvena.de>", row
, 0, 0, 0, 1);
330 ROW("", row
, 0, 0, 0, 0);
333 g_snprintf(buffer
, sizeof(buffer
), "Matthew Brush - %s", _("developer"));
334 ROW(buffer
, row
, 0, 0, 0, 1);
336 ROW("<mbrush@codebrainz.ca>", row
, 0, 0, 0, 1);
338 ROW("", row
, 0, 0, 0, 0);
341 g_snprintf(buffer
, sizeof(buffer
), "Frank Lanitz - %s", _("translation maintainer"));
342 ROW(buffer
, row
, 0, 0, 0, 1);
344 ROW("<frank@frank.uvena.de>", row
, 0, 0, 0, 1);
346 ROW("", row
, 0, 0, 0, 0);
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);
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);
366 ROW("", row
, 0, 0, 0, 0);
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);
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);
387 ROW("", row
, 0, 0, 0, 0);
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);
400 g_snprintf(buffer
, sizeof(buffer
),
401 _("Some of the many contributors (for a more detailed list, see the file %s):"),
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);
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);
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
);
467 void about_dialog_show(void)
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
);