96
103
GtkWidget *ScrollWindow;
97
104
GtkWidget *TextView;
98
105
GtkTextBuffer *TextBuffer;
99
107
GtkWidget *Button;
101
109
GdkPixmap *pixmap;
103
gchar temp[MAX_STRING_LEN];
111
gchar temp[MAX_STRING_LEN];
114
#ifdef PACKAGE_DATA_DIR
107
116
gchar *tmp = NULL;
108
118
gchar *description_text =
110
120
" EasyTAG is an utility for viewing and editing tags for MP3, MP2, "
111
"FLAC, Ogg Vorbis, MusePack and Monkey's Audio files. Its simple and "
112
"nice GTK+ interface makes tagging easier under GNU/Linux."
121
"FLAC, Ogg Vorbis, MP4/AAC, MusePack and Monkey's Audio files. Its "
122
"simple and nice GTK+ interface makes tagging easier under GNU/Linux."
116
126
/* Translation contributions */
117
127
gchar *translations_thanks_text [][2]= {
118
{" - Bastian Kleineidam ", _("(German translation)")},
119
{" - Adrian Bunk ", _("(German translation)")},
120
{" - Colin Marquardt ", _("(German translation)")},
121
{" - Philipp Thomas ", _("(German translation)")},
122
{" - Sergey Zhumatiy ", _("(Russian translation)")},
123
{" - Andrey Astafiev ", _("(Russian translation)")},
124
{" - Vincent van Adrighem ", _("(Dutch translation)")},
125
{" - Bj�rn Olievier ", _("(Dutch translation)")},
126
{" - Patrik Israelsson ", _("(Swedish translation)")},
127
{" - Szel Miklos ", _("(Hungarian translation)")},
128
{" - Nagy Boldizsar ", _("(Hungarian translation)")},
129
{" - Cappelletti Lorenzo ", _("(Italian translation)")},
130
{" - Kostantino ", _("(Italian translation)")},
131
{" - Takeshi Aihana ", _("(Japanese translation)")},
132
{" - Olexander Kunytsa ", _("(Ukrainian translation)")},
133
{" - Cawko Xakep ", _("(Ukrainian translation)")},
134
{" - Milan Siebenburger ", _("(Czech translation)")},
135
{" - Jaime Serrano Cartagena ", _("(Spanish translation)")},
136
{" - Maciej Kasprzyk ", _("(Polish translation)")},
137
{" - Pauliuc George ", _("(Romanian translation)")},
138
{" - Morten Brix Pedersen ", _("(Danish translation)")},
128
{" - Bastian Kleineidam ", _("(German translation)")},
129
{" - Adrian Bunk ", _("(German translation)")},
130
{" - Colin Marquardt ", _("(German translation)")},
131
{" - Philipp Thomas ", _("(German translation)")},
132
{" - Sergey Zhumatiy ", _("(Russian translation)")},
133
{" - Andrey Astafiev ", _("(Russian translation)")},
134
{" - Vincent van Adrighem ", _("(Dutch translation)")},
135
{" - Bj�rn Olievier ", _("(Dutch translation)")},
136
{" - Patrik Israelsson ", _("(Swedish translation)")},
137
{" - Szel Miklos ", _("(Hungarian translation)")},
138
{" - Nagy Boldizsar ", _("(Hungarian translation)")},
139
{" - M�sz�ros Csaba ", _("(Hungarian translation)")},
140
{" - Cappelletti Lorenzo ", _("(Italian translation)")},
141
{" - Costantino ", _("(Italian translation)")},
142
{" - Takeshi Aihana ", _("(Japanese translation)")},
143
{" - Olexander Kunytsa ", _("(Ukrainian translation)")},
144
{" - Cawko Xakep ", _("(Ukrainian translation)")},
145
{" - Milan Siebenburger ", _("(Czech translation)")},
146
{" - Zbynek Mrkvicka ", _("(Czech translation)")},
147
{" - Jaime Serrano Cartagena ", _("(Spanish translation)")},
148
{" - Fernando M. Bueno Moreno ", _("(Spanish translation)")},
149
{" - Francisco Javier F. Serrador ", _("(Spanish translation)")},
150
{" - Maciej Kasprzyk ", _("(Polish translation)")},
151
{" - Pauliuc George ", _("(Romanian translation)")},
152
{" - Morten Brix Pedersen ", _("(Danish translation)")},
153
{" - Apollon Oikonomopoulos ", _("(Greek translation)")},
154
{" - doutor zero ", _("(Brazilian Portuguese translation)")},
155
{" - Luchezar P. Petkov ", _("(Bulgarian translation)")},
141
159
/* General contributions */
142
160
gchar *general_thanks_text =
143
161
" - Daniel Drake (GTK2 port)\n"
144
162
" - Mihael Vrbanec (GTK2 port)\n"
163
" - Michael Pujos (Win32 port)\n"
145
164
" - Andrew Shuvalov\n"
146
165
" - Sergey Zhumatiy\n"
147
166
" - Kevin Venkiteswaran\n"
230
Label = gtk_label_new(APPNAME" "VERSION);
258
Label = gtk_label_new(NULL);
259
gtk_label_set_markup(GTK_LABEL(Label),"<b>"APPNAME" "VERSION"</b>");
231
260
gtk_box_pack_start(GTK_BOX(VBox),Label,FALSE,TRUE,0);
233
262
sprintf(temp,_("(compiled: %s)"),__DATE__);
234
263
Label = gtk_label_new(temp);
235
264
gtk_box_pack_start(GTK_BOX(VBox),Label,FALSE,TRUE,0);
266
#ifdef ENABLE_MP3 // FIX ME : should separate gtk and id3lib
237
267
sprintf(temp,_("(using: GTK+ %d.%d.%d and id3lib %d.%d.%d)"),GTK_MAJOR_VERSION,GTK_MINOR_VERSION,
238
268
GTK_MICRO_VERSION,ID3LIB_MAJOR_VERSION,ID3LIB_MINOR_VERSION,ID3LIB_PATCH_VERSION);
239
269
Label = gtk_label_new(temp);
240
270
gtk_box_pack_start(GTK_BOX(VBox),Label,FALSE,TRUE,0);
274
Label = gtk_label_new(_("(MP3 file support disabled)"));
275
gtk_box_pack_start(GTK_BOX(VBox),Label,FALSE,TRUE,0);
242
278
#ifndef ENABLE_OGG
243
279
Label = gtk_label_new(_("(Ogg Vorbis file support disabled)"));
299
342
GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
301
344
TextBuffer = gtk_text_buffer_new(NULL);
345
gtk_text_buffer_create_tag(TextBuffer, "italic", "style", PANGO_STYLE_ITALIC, NULL);
346
gtk_text_buffer_create_tag(TextBuffer, "bold", "weight", PANGO_WEIGHT_BOLD, NULL);
347
gtk_text_buffer_create_tag(TextBuffer, "underline", "underline", PANGO_UNDERLINE_SINGLE, NULL);
348
gtk_text_buffer_create_tag(TextBuffer, "large", "scale", PANGO_SCALE_LARGE, NULL);
349
//gtk_text_buffer_create_tag(TextBuffer, "x-large", "scale", PANGO_SCALE_X_LARGE, NULL);
350
//gtk_text_buffer_create_tag(TextBuffer, "monospace", "family", "monospace", NULL);
352
gtk_text_buffer_get_iter_at_offset(TextBuffer, &iter, 0);
302
354
temp_str = _("Translations:\n");
303
gtk_text_buffer_insert_at_cursor(TextBuffer, temp_str, g_utf8_strlen(temp_str, -1));
355
gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter,
357
"bold", "underline", "large", NULL);
304
359
for (i=0; translations_thanks_text[i][0]!=NULL; i++)
306
temp_str = g_strconcat(translations_thanks_text[i][0],translations_thanks_text[i][1],NULL);
307
if (!g_utf8_validate(temp_str, -1, NULL))
309
tmp = convert_string(temp_str, "iso-8859-1", "utf-8");
313
gtk_text_buffer_insert_at_cursor(TextBuffer, temp_str, -1);
314
gtk_text_buffer_insert_at_cursor(TextBuffer, "\r\n", -1);
362
if (!g_utf8_validate(translations_thanks_text[i][0], -1, NULL))
363
temp_str = convert_string(translations_thanks_text[i][0], "iso-8859-1", "utf-8",TRUE);
365
temp_str = g_strdup(translations_thanks_text[i][0]);
366
gtk_text_buffer_insert(TextBuffer, &iter, temp_str, -1);
369
// Translation language
370
if (!g_utf8_validate(translations_thanks_text[i][1], -1, NULL))
371
temp_str = convert_string(translations_thanks_text[i][1], "iso-8859-1", "utf-8",TRUE);
373
temp_str = g_strdup(translations_thanks_text[i][1]);
374
gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter, temp_str, -1,
377
gtk_text_buffer_insert(TextBuffer, &iter, "\n", -1);
318
gtk_text_buffer_insert_at_cursor(TextBuffer, "\n", 1);
380
gtk_text_buffer_insert(TextBuffer, &iter, "\n", -1);
320
382
temp_str = _("General:\n");
321
gtk_text_buffer_insert_at_cursor(TextBuffer, temp_str, g_utf8_strlen(temp_str, -1));
322
gtk_text_buffer_insert_at_cursor(TextBuffer, "\r\n", -1);
323
gtk_text_buffer_insert_at_cursor(TextBuffer, general_thanks_text, g_utf8_strlen(general_thanks_text, -1));
383
gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter,
385
"bold", "underline", "large", NULL);
386
gtk_text_buffer_insert(TextBuffer, &iter, general_thanks_text, -1);
324
388
TextView = gtk_text_view_new_with_buffer(TextBuffer);
325
389
gtk_container_add(GTK_CONTAINER(ScrollWindow),TextView);
326
390
gtk_text_view_set_editable(GTK_TEXT_VIEW(TextView), FALSE);
343
407
GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
345
409
TextBuffer = gtk_text_buffer_new(NULL);
410
gtk_text_buffer_get_iter_at_offset(TextBuffer, &iter, 0);
411
gtk_text_buffer_create_tag(TextBuffer, "monospace", "family", "monospace", NULL);
412
gtk_text_buffer_create_tag(TextBuffer, "red_foreground", "foreground", "red", NULL);
413
gtk_text_buffer_create_tag(TextBuffer, "blue_foreground", "foreground", "blue", NULL);
414
gtk_text_buffer_create_tag(TextBuffer, "bold", "weight", PANGO_WEIGHT_BOLD, NULL);
416
gtk_text_buffer_get_iter_at_offset(TextBuffer, &iter, 0);
346
418
// The file 'ChangeLog' to read
347
419
if ( (file=fopen(PACKAGE_DATA_DIR"/ChangeLog","r"))==0 )
349
421
gchar *msg = g_strdup_printf(_("Can't open file '%s' (%s)\n"),PACKAGE_DATA_DIR"/ChangeLog",g_strerror(errno));
350
gtk_text_buffer_insert_at_cursor(TextBuffer, msg, g_utf8_strlen(msg, -1));
422
gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter,
424
"monospace", "red_foreground", NULL);
428
gint first_version = 0;
354
430
while(fgets(temp,sizeof(temp),file))
356
432
if (temp[strlen(temp)-1]=='\n')
357
433
temp[strlen(temp)-1]='\0';
358
434
if (temp[strlen(temp)-1]=='\r')
359
435
temp[strlen(temp)-1]='\0';
360
// don't use font yet....
361
437
if (!g_utf8_validate(temp, -1, NULL))
362
tmp = convert_string(temp, "iso-8859-1", "utf-8");
438
tmp = convert_string(temp, "iso-8859-1", "utf-8",TRUE);
364
440
tmp = g_strdup(temp);
366
gtk_text_buffer_insert_at_cursor(TextBuffer, tmp, -1);
367
gtk_text_buffer_insert_at_cursor(TextBuffer, "\r\n", -1);
442
if (tmp && tmp[0]!=' ')
445
// To set to bold the title of the version and to red the first version
446
if (first_version > 2) // As title takes 2 lines
447
gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter,
449
"monospace", "bold", NULL);
451
gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter,
453
"monospace", "bold", "blue_foreground", NULL);
456
if (first_version > 2) // As title takes 2 lines
457
gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter,
461
gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter,
463
"monospace", "blue_foreground", NULL);
465
gtk_text_buffer_insert(TextBuffer, &iter, "\n", -1);