~jcowgill/ubuntu/trusty/easytag/bug-1295882

« back to all changes in this revision

Viewing changes to src/about.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2006-04-15 15:47:47 UTC
  • mfrom: (1.2.2 upstream) (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20060415154747-vr4eqoxwcrgs2ps1
* New upstream version:
  - New logo and icons,
  - Added ability to display all albums of an artist in the 'Artist / Album'
    view,
  - Added detection of the bugged version of id3lib when writting ID3 tag to 
    Unicode to inform the user (a patch for id3lib is supplied in package
    source),
  - For Ogg files, the field DESCRIPTION is also used for the comment,
  - Fixed stack corruption bugs in Fill Tag scanner,
  - Fixed loading disk number for FLAC tag,
  - Fixed error that displays MP3 files in red when no tag is present,
  - Fixed a crash in the CDDB window when getting tracks of a album,
  - Fixed playlist name bug when creating it in the parent directory,
  - Fixed manual CDDB search when using Squid,
  - Little fix for FLAC tags,
  - Fixed various bugs,
  - Russian translation updated,
  - Greek translation updated,
  - Spanish translation updated,
  - Japanese translation updated,
  - Czech translation updated,
  - Brazilian Portuguese translation updated
  - Danish translation updated,
  - Italian translation updated,
  - Hungarian translation updated,
  - German translation updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* about.c - 2000/05/05 */
2
2
/*
3
3
 *  EasyTAG - Tag editor for MP3 and Ogg Vorbis files
4
 
 *  Copyright (C) 2000-2003  Jerome Couderc <j.couderc@ifrance.com>
 
4
 *  Copyright (C) 2000-2003  Jerome Couderc <easytag@gmail.com>
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
25
25
#include <glib/gi18n-lib.h>
26
26
#include <stdio.h>
27
27
#include <string.h>
28
 
#include <id3.h>
 
28
#include <stdlib.h> // for 'system'
 
29
#ifdef ENABLE_MP3
 
30
#   include <id3.h>
 
31
#endif
29
32
#include <errno.h>
30
33
 
31
34
#include "about.h"
35
38
#include "charset.h"
36
39
 
37
40
#ifndef PACKAGE_DATA_DIR
38
 
#    include "../pixmaps/EasyTAG_logo.xpm"
 
41
#   include "../pixmaps/EasyTAG_logo.xpm"
 
42
#endif
 
43
 
 
44
#ifdef WIN32
 
45
#   include "win32dep.h"
39
46
#endif
40
47
 
41
48
 
96
103
    GtkWidget *ScrollWindow;
97
104
    GtkWidget *TextView;
98
105
    GtkTextBuffer *TextBuffer;
 
106
    GtkTextIter iter;
99
107
    GtkWidget *Button;
100
108
    GtkWidget *Logo;
101
109
    GdkPixmap *pixmap;
102
110
    GdkBitmap *mask;
103
 
    gchar temp[MAX_STRING_LEN];
 
111
    gchar  temp[MAX_STRING_LEN];
 
112
    gchar *temp_str;
 
113
    gint i;
 
114
#ifdef PACKAGE_DATA_DIR
104
115
    FILE *file;
105
 
    gint i;
106
 
    gchar *temp_str;
107
116
    gchar *tmp = NULL;
 
117
#endif
108
118
    gchar *description_text = 
109
119
            _(""
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."
113
123
            "");
114
124
 
115
125
 
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)")},
139
156
            {NULL,NULL}
140
157
            };
 
158
 
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"
165
184
            "    - Artur Polaczynski\n"
166
185
            "    - Maciej Kasprzyk\n"
167
186
            "    - Daniel Pichler\n"
 
187
            "    - Santtu Lakkala\n"
168
188
            "    - Philipp Thomas\n"
169
189
            "    - Tony Mancill\n"
170
190
            "    - Pavel Minayev\n"
171
191
            "    - Justus Schwartz\n"
172
192
            "    - Fredrik Noring\n"
 
193
            "    - Guilherme Destefani\n"
 
194
            "    - Michael Ihde\n"
 
195
            "    - Stewart Whitman\n"
 
196
            "    - Javier Kohen\n"
 
197
            "    - Alexey Illarionov\n"
 
198
            "    - Der Humph\n"
173
199
            "";
174
200
 
175
201
 
197
223
    gtk_notebook_popup_enable(GTK_NOTEBOOK(AboutNoteBook));
198
224
    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(AboutWindow)->vbox),AboutNoteBook,TRUE,TRUE,0);
199
225
 
 
226
    
200
227
    /*
201
228
     * Tab for common informations
202
229
     */
 
230
 
203
231
    Label = gtk_label_new(_("About"));
204
232
    Frame = gtk_frame_new(NULL);
205
233
    gtk_notebook_append_page (GTK_NOTEBOOK(AboutNoteBook),Frame,Label);
227
255
    }
228
256
 
229
257
    /* Infos */
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);
232
261
 
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);
236
265
 
 
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);
 
271
#endif
 
272
 
 
273
#ifndef ENABLE_MP3
 
274
    Label = gtk_label_new(_("(MP3 file support disabled)"));
 
275
    gtk_box_pack_start(GTK_BOX(VBox),Label,FALSE,TRUE,0);
 
276
#endif
241
277
 
242
278
#ifndef ENABLE_OGG
243
279
    Label = gtk_label_new(_("(Ogg Vorbis file support disabled)"));
249
285
    gtk_box_pack_start(GTK_BOX(VBox),Label,FALSE,TRUE,0);
250
286
#endif
251
287
 
 
288
#ifndef ENABLE_MP4
 
289
    Label = gtk_label_new(_("(MP4/AAC file support disabled)"));
 
290
    gtk_box_pack_start(GTK_BOX(VBox),Label,FALSE,TRUE,0);
 
291
#endif
 
292
 
252
293
    /* Insert a blank line */
253
294
    Label = gtk_label_new("");
254
295
    gtk_box_pack_start(GTK_BOX(VBox),Label,FALSE,TRUE,0);
285
326
    gtk_label_set_line_wrap(GTK_LABEL(Label),TRUE);
286
327
    gtk_container_add(GTK_CONTAINER(Frame),Label);
287
328
 
 
329
 
288
330
    /*
289
331
     * Tab for thanks
290
332
     */
 
333
 
291
334
    Label = gtk_label_new(_("Thanks"));
292
335
    Frame = gtk_frame_new(NULL);
293
336
    gtk_notebook_append_page (GTK_NOTEBOOK(AboutNoteBook),Frame,Label);
299
342
                                   GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
300
343
 
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);
 
351
 
 
352
    gtk_text_buffer_get_iter_at_offset(TextBuffer, &iter, 0);
 
353
 
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, 
 
356
                                             temp_str, -1,
 
357
                                             "bold", "underline", "large", NULL);
 
358
 
304
359
    for (i=0; translations_thanks_text[i][0]!=NULL; i++)
305
360
    {
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))
308
 
        {
309
 
            tmp = convert_string(temp_str, "iso-8859-1", "utf-8");
310
 
            g_free(temp_str);
311
 
            temp_str = tmp;
312
 
        }
313
 
        gtk_text_buffer_insert_at_cursor(TextBuffer, temp_str, -1);
314
 
        gtk_text_buffer_insert_at_cursor(TextBuffer, "\r\n", -1);
315
 
        g_free(temp_str);
 
361
        // Translator name
 
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);
 
364
        else
 
365
            temp_str = g_strdup(translations_thanks_text[i][0]);
 
366
        gtk_text_buffer_insert(TextBuffer, &iter, temp_str, -1);
 
367
        g_free(temp_str);
 
368
 
 
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);
 
372
        else
 
373
            temp_str = g_strdup(translations_thanks_text[i][1]);
 
374
        gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter, temp_str, -1,
 
375
                                                 "italic", NULL);
 
376
        g_free(temp_str);
 
377
        gtk_text_buffer_insert(TextBuffer, &iter, "\n", -1);
316
378
    }
317
379
 
318
 
    gtk_text_buffer_insert_at_cursor(TextBuffer, "\n", 1);
 
380
    gtk_text_buffer_insert(TextBuffer, &iter, "\n", -1);
319
381
 
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, 
 
384
                                             temp_str, -1,
 
385
                                             "bold", "underline", "large", NULL);
 
386
    gtk_text_buffer_insert(TextBuffer, &iter, general_thanks_text, -1);
 
387
    
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);
344
408
 
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);
 
415
 
 
416
    gtk_text_buffer_get_iter_at_offset(TextBuffer, &iter, 0);
 
417
 
346
418
    // The file 'ChangeLog' to read
347
419
    if ( (file=fopen(PACKAGE_DATA_DIR"/ChangeLog","r"))==0 )
348
420
    {
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, 
 
423
                                                 msg, -1,
 
424
                                                 "monospace", "red_foreground", NULL);
351
425
        g_free(msg);
352
426
    } else 
353
427
    {
 
428
        gint first_version = 0;
 
429
        
354
430
        while(fgets(temp,sizeof(temp),file))
355
431
        {
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....
 
436
 
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);
363
439
            else
364
440
                tmp = g_strdup(temp);
365
441
 
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]!=' ')
 
443
            {
 
444
                first_version++;
 
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, 
 
448
                                                             tmp, -1,
 
449
                                                             "monospace", "bold", NULL);
 
450
                else
 
451
                    gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter, 
 
452
                                                             tmp, -1,
 
453
                                                             "monospace", "bold", "blue_foreground", NULL);
 
454
            }else
 
455
            {
 
456
                if (first_version > 2) // As title takes 2 lines
 
457
                    gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter, 
 
458
                                                             tmp, -1,
 
459
                                                             "monospace", NULL);
 
460
                else
 
461
                    gtk_text_buffer_insert_with_tags_by_name(TextBuffer, &iter, 
 
462
                                                             tmp, -1,
 
463
                                                             "monospace", "blue_foreground", NULL);
 
464
            }
 
465
            gtk_text_buffer_insert(TextBuffer, &iter, "\n", -1);
368
466
            g_free(tmp);
369
467
        }
370
468
        fclose(file);
395
493
 
396
494
void About_Window_Go_To_Home_Page (void)
397
495
{
 
496
#ifdef WIN32
 
497
    ET_Win32_Notify_Uri(WEBPAGE);
 
498
#else
398
499
    system("gnome-moz-remote "WEBPAGE);
 
500
#endif
399
501
}